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 .
×

How to roll an arbitrary amount of disadvantaged attack rolls via macro?

I'm currently playing a necromancer, and having an army of skeletons has finally become plot-relevant and is just around the corner. I'm planning on animating an arbitrarily large amount of skeletons, and I've successfully made a macro for rolling all of their shortbow attack rolls at once - {?{Skeletons}d20+4}>?{Target AC}. However, I've run into the issue of the long range shortbow attack being at disadvantage. Having things be statistically accurate is important to me, and rolling this macro twice and taking the lower amount of successes just wouldn't do it for me. Ideally, I'd be able to run {2d20>?{Target AC}kl1} as many times as necessary, but I haven't been able to figure out a way to input the amount of times I run that line in the macro itself without manually copying and pasting it. Since the number of skeletons would be variable, I can't just manually copy and paste it to whatever number I need each time without clogging up a scene and taking way too long, and I can't just run the single macro roll a bunch of times since we're talking 50+ attacks and it would take way too long. TL;DR, I need to run one line of a macro - a disadvantaged attack roll - any number of times based on my input.
1594727485

Edited 1594727574
The Aaron
Roll20 Production Team
API Scripter
That isn't directly possible without the API.&nbsp; The best you could do would be to build a Rollable Table with the properly weighted rows for 1–20, and roll that some number of times. You can get the odds:&nbsp; <a href="https://anydice.com/program/1227" rel="nofollow">https://anydice.com/program/1227</a> Rollable tables only deal in Integer odds, so 1 would have a weight of 975, 20 would have a weight of 25, etc...
1594732813

Edited 1594732905
David M.
Pro
API Scripter
FYI, I just did a write-up describing in detail Aaron's rollable table approach for calling adv &amp; disadv d20 rollable tables&nbsp; here . (EDIT -- Looks like you might have to scroll up from the link I gave) If you scroll all the way down, there is also a solution (well, partial solution, for you) using the npcattack template (5E char for Roll20 sheet) that might help, too. Not sure what character sheet you are using, though. While it doesn't do exactly what you're asking, it might be enough. The latter solution ends up not using the rollable table method, but outputs 25 attacks with Adv/DisAdv in a pretty compact display. The attack &amp; damage mods are hardcoded for simplicity, since it was for a specific magic item, but sounds like that might not be an issue for you, either. You could also modify to do the &gt;Target AC comparison, or else manually compare. The OP in that thread wanted a macro that could be used by PC's and GM's, so that's why the target AC was omitted for that application.&nbsp; &nbsp; Check out the thread, though, because Oosh also gave another option (again near the end of the thread) that uses the default template and, through a second ability macro, adds up the total damage for an arbitrary number of Normal/Adv/DisAdv attacks using a neat trick. Up to 25 attacks, again. :) There might be enough info in there to get you close to what you want.
Thanks all, I figured out how to get it working well enough with a rollable table
1594815514
David M.
Pro
API Scripter
Great! Would you mind posting your solution for anybody else following this?
Hey! Sorry for the delay, didn't see the notification. I have a rollable table set up with each of the attack bonuses already included, and I have a nat 20 set as a weight of 1, 19 set as weight of 3 (marked as 23 w/ attack bonus of +4), 18 with a weight of 5,17 as 7 and so on, all the way down to a nat 1 with a weight of 39. This effectively emulates the odds of rolling each number at disadvantage, though it does take a bit of time to set up. You can roll on the table any number of times with simple roll20 commands, but it doesn't automatically check for success. From there I tally up the number of hits and crits and roll my damage macros accordingly.
1595340798
David M.
Pro
API Scripter
Cool. So something like this for your Damage macro? Queries for NumHits, NumCrits, and DamageBonus. Hardcoded for d6 shortbow damage, but could also be queried. &amp;{template:default} {{name=Mob Shortbow Damage}} {{Total damage=[[ ((?{Number of hits|4})d6 + (?{Damage bonus|2}*?{Number of hits})[BASE]) + (?{Number of crits|0})d6[CRIT] ]] piercing }}&nbsp; 10 hits with 2 crits gives:
Yup, that's more or less what I got as far as hit/crit queries
my exact macro is /r {?{Hits}d6}+{?{Hits}*2}+{?{Crits}d6} it'd be super easy to change the 2 into a query or any other number you might need