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

Single query in D&D Attack roll to change crit and damage (hexblade)

I have a player who has a hexblade warlock and I was trying to make an easy query to account for the hexblades curse increasing crit range and adding  damage. In the Crit section of the weapon attack on the sheet I put  ?{HBC?|No,20|Yes,19} Nice and easy, if using hexblades curse he crits on a 19. I would like to use that one query and give a different result in the damage or damage2 section. I tried ?{HBC?|No,0|Yes,2} but it instead gives the initial 20 or 19 result. Can the one query give 2 results? My other option so far has been to use a global modifier or a second query ?{Hex?|No,0|Yes,2} in the damage section.
1624760591

Edited 1624760693
Oosh
Sheet Author
API Scripter
There's an old one here , which should still work, or at least give you the idea of how to handle it. You need to reuse the the initial Query result in some math trickery to turn 19 into a 1, and 20 into a 0, then multiply the PB by that: ?{HBC?|No,20|Yes,19} .... [[abs(?{HBC?}-20)*@{pb}]] Worth noting that this won't work if you roll damage separately as the Query result will be lost between chat inputs... unless you nest the Query result inside the damage link button.
1624762633
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Oosh's suggestion is good, but has some extra math functions that aren't really needed. You can find another solution in this old reddit post . Note that you can get it to work even if you do the damage separately by just repeating the full query in the damage roll.
Thanks. I used Scott Cs solution and it is working a treat.