To create a character called Hellfox:
<<set $hellfox to {}>>
To roll Hellfox's DEX:
<<set $hellfox.dex to random (3,18)>>
To calculate Hellfox's DEX modifier:
<<if $hellfox.dex lte 1>>
<<set $hellfox.dexmod to -5>>
<<elseif $hellfox.dex == 2 or $hellfox.dex == 3>>
<<set $hellfox.dexmod to -4>>
<<elseif $hellfox.dex == 4 or $hellfox.dex == 5>>
<<set $hellfox.dexmod to -3>>
<<elseif $hellfox.dex == 6 or $hellfox.dex == 7>>
<<set $hellfox.dexmod to -2>>
<<elseif $hellfox.dex == 8 or $hellfox.dex == 9>>
<<set $hellfox.dexmod to -1>>
<<elseif $hellfox.dex == 10 or $hellfox.dex == 11>>
<<set $hellfox.dexmod to 0>>
<<elseif $hellfox.dex == 12 or $hellfox.dex == 13>>
<<set $hellfox.dexmod to 1>>
<<elseif $hellfox.dex == 14 or $hellfox.dex == 15>>
<<set $hellfox.dexmod to 2>>
<<elseif $hellfox.dex == 16 or $hellfox.dex == 17>>
<<set $hellfox.dexmod to 3>>
<<elseif $hellfox.dex == 18>>
<<set $hellfox.dexmod to 4>>
<</if>>
To work out Hellfox's base Armor Class:
<<set $hellfox.ac to 10 + $hellfox.dexmod>>
To make a DEX check for Hellfox:
<<if random (1,20) lte $hellfox.dex>>
<<print ":)">>
<<else>>
<<print ":(">>
<</if>>