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

MOB Attack Table

1603403809

Edited 1603404018
Murph
Plus
New to coding: I am looking for a macro that allows me to take simplify this: /desc A mob of ?{Number of Xvort|3} Xvart swarm @{target|foe|token_name}. *They make a Group Attack* /w gm [[@{target|foe|AC}-4]]**Is the d20 Roll Needed to determine how many Attackers Needed for One to Hit** [x](<a href="https://i.ibb.co/02vp4M6/Mob-Attack-Chart.jpg" rel="nofollow">https://i.ibb.co/02vp4M6/Mob-Attack-Chart.jpg</a>) There is a crossreference table that i'd like to build into the macro, rather than just telling the players "3 attacked you, 2 of them hit. I think i want to know how i take the Number of Xvart divided by the &lt;target|foe|AC&gt; number and have that spit out how many Xvart creatures actually hit..= The chart is from page 250 of the DMG
1603428050

Edited 1603430307
Oosh
Sheet Author
API Scripter
There's no clean way to represent that chart as a formula, you won't be able to automate that easily. The easy way is this (I'm assuming you're using the R20 5e sheet): &amp;{template:npcaction} {{rname=Swarm Attack}} [[@{target|foe|ac}-{@{selected|repeating_npcaction_$0_attack_tohit},@{selected|repeating_npcaction_$1_attack_tohit}}k1]]mob {{description=Swarm: @{selected|token_name} Target: @{target|foe|token_name} Roll required: [[@{target|foe|ac}-{@{selected|repeating_npcaction_$0_attack_tohit},@{selected|repeating_npcaction_$1_attack_tohit}}k1]] Attackers in swarm: [[?{Swarm size|3}]] [img](<a href="https://s3.amazonaws.com/files.d20.io/images/172431902/_3LACL6wBlv7INroLwe4fA/original.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/172431902/_3LACL6wBlv7INroLwe4fA/original.jpg</a>)}} &amp;{noerror} Then do the calculation manually. Or you could put another line in there with a button link to another macro to enter the needed numbers: [Calculate result](~macros|mobCalc), and the mobCalc would just be: [[floor(?{Number of Attackers}/ ?{Attackers required per hit?|0} )]] attacks hit. or you could use the second macro to actually calculate damage, of course. There is a method to look up the Attackers required per hit, it's a lot of work. You would need to set up 20 roll tables, named 1mob to 20mob, each with the single "Attackers needed" value for that roll, e.g. 15mob would have a single entry: 4, 20mob would contain 20, and so on. You could then change the main macro to something like this: &amp;{template:npcaction} {{rname=Swarm Attack}} [[floor(?{Number of attackers?|5}/[[1t[[[@{target|foe|ac}-{@{selected|repeating_npcaction_$0_attack_tohit},@{selected|repeating_npcaction_$1_attack_tohit}}k1]]mob] ]]) +1d0cs0cf0]] {{description=Swarm: @{selected|token_name} Target: @{target|foe|token_name} Roll required: $[[0]] Attackers in swarm: ?{Number of attackers?} Attackers required per hit: $[[1]] Attacks landed: $[[2]] [Calculate result](~macros|mobCalc)}} &amp;{noerror} And something along these lines for damage: &amp;{template:npcdmg}{{dmg1flag=1}}{{dmg1=[[{[[0@{selected|repeating_npcaction_$0_attack_damage}]],[[0@{selected|repeating_npcaction_$1_attack_damage}]]}k1*?{Number of hits?|1}]]}} {{dmg1type=from ?{Number of hits?} attacks}}&amp;{noerror} Resulting in:
Awesome thank you