Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Improve macro to add crit damage?

So i use this macro to easily click attack and compare it to the npc_ac from targetted token (only works for tokens with filled sheet though). I found out that when it rolls a nat 20, the damage is not crit. Maybe if anyone can improve it to detect nat 20, that would be great. Damage: [[{{1d20cs>20  + 6}>@{target|npc_AC}} * {1d4 + 4} ]] piercing, and DC11 CON save or half [[3d6]] poison
1598797730

Edited 1598961710
Oosh
Sheet Author
API Scripter
You need to use a trick to grab the d20 roll, since you lose it once you use the > comparison operator: Damage: [[ [[{[[1d20+6]],0}k1>@{target|npc_ac}]]*{1d4+4}  ]] piercing, and DC11 CON save or half [[3d6]] poison, attack roll $[[0]] Then you just have to check for the crit in the box at the end - default is crit on 20 only. Or you could do this: &{template:default} [[ {ceil([[[[1+{[[1d20+6]],0}k1>26f<@{target|npc_ac}]]d4]]/100)*4,4}kl1 ]] {{name=Weapon Attack}} {{Roll=$[[0]]}} {{Damage=$[[2]] + $[[3]] piercing}} {{DC11 CON save=[[3d6]] poison}} this will roll 2d4+4 on a crit, 1d4+4 on a hit, and 0d4 + 0 on a miss.