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

RAW magic missile macro with upcasting and total damage

Can anyone point me to a magic missile macro that follows RAW (i.e., one damage roll for all missiles), allows for upcasting, and produces a total damage figure (useful if all missiles target one creature)?  I wrote the following query which does most of what I need but assumes each missile does damage independently: 3d4 + 3 [FORCE] [BASE]+ ?{Cast at what level?|Level 1,0d4 + 0 [force] |Level 2,1d4 + 1 [force] |Level 3, 2d4 + 2 [force] |Level 4, 3d4 + 3 [force] |Level 5, 4d4 + 4 [force] |Level 6, 5d4 + 5 [force] |Level 7, 6d4 + 6 [force] |Level 8, 7d4 + 7 [force] |Level 9, 8d4 + 8 [force] |}[UPCAST] I also found this in the forums written by someone who referred to the RAW damage interpretation, but it does not output total damage: Presto the Wizard produces [[?{Spell level|1}+2]] glowing darts of magical force that each do [[1d4+1]] points of force damage. Basically, I need a way to save a value (attribute?) equal to the product of  [[?{Spell level|1}+2]] and  [[1d4+1]] so it can be reported, ostensibly using the "Presto" code above.
1687006814
timmaugh
Forum Champion
API Scripter
You'll want to use a combined roll which you then split out for the component parts... [[ [[?{Spell level|1}+2]] * [[1d4+1]] ]] Then you can out put the results like this: @{selected|token_name} produces $[[0]] glowing darts of magical force that each do $[[1]] points of force damage, for a total of [[ [[?{Spell level|1}+2]] * [[1d4+1]] ]]. Or, as a template (feel free to sub for a template specific to the sheet you're using): &{template: default} [[ [[?{Spell level|1}+2]] * [[1d4+1]] ]]{{name=@{selected|token_name} Casts Magic Missile!}}{{Missiles=$[[0]]}}{{Base Damage=$[[1]]}}{{Total Damage=$[[2]]}}
timmaugh said: You'll want to use a combined roll which you then split out for the component parts... [[ [[?{Spell level|1}+2]] * [[1d4+1]] ]] Then you can out put the results like this: @{selected|token_name} produces $[[0]] glowing darts of magical force that each do $[[1]] points of force damage, for a total of [[ [[?{Spell level|1}+2]] * [[1d4+1]] ]]. Or, as a template (feel free to sub for a template specific to the sheet you're using): &{template: default} [[ [[?{Spell level|1}+2]] * [[1d4+1]] ]]{{name=@{selected|token_name} Casts Magic Missile!}}{{Missiles=$[[0]]}}{{Base Damage=$[[1]]}}{{Total Damage=$[[2]]}} Thanks, Timmaugh.  I tried the template code you provided, but it didn't work.  It would ask me to pick a spell level but would then just create a blank line in the chat window.  What did work was the following: &{template:npcaction} {{rname= Magic Missile (Level 2)}} [[ [[?{Spell level|1}+2]] * [[1d4+1]] ]] {{description=MyName produces $[[0]] glowing darts of magical force that each do $[[1]] damage.    Total Damage=$[[2]]}} One additional problem is that the character has bloodletting focus, which adds necrotic damage to each missile based on the spell level.  This damage would be equal to the number of magic missiles or $[[0]] in the macro.  Unfortunately, I can't find a way to account for this in the above code.  When I try something like ...  [[ [[?{Spell level|1}+2]] * [[1d4+1 + $[[0]]]] ]] ... or ...  [[ [[?{Spell level|1}+2]] * [[1d4+1]]   [[$[[0]] * [[1d4+1]]  ]] ... I get an "INVALID INLINE ROLL" error.  Basically, I need to calculate both a sum and a product involving $[[0]] to report the correct per-missile and total damage values.  Is there any way to do this?  
1687185029
timmaugh
Forum Champion
API Scripter
First, my apologies... the error in the template statement was a problem of there being a space after the colon in the formation: &{template:default} That's what I get using my phone to reply. So, my original template command line (modified to remove the space) would be: &{template:default}[[ [[?{Spell level|1}+2]] * [[1d4+1]] ]]{{name=@{selected|token_name} Casts Magic Missile!}}{{Missiles=$[[0]]}}{{Base Damage=$[[1]]}}{{Total Damage=$[[2]]}} And would produce this: If I were to apply that to your npcaction template, and if I wanted to incorporate the bloodletting necrotic damage, it would look more like this (note that since your bloodletting bonus isn't randomized, you don't have to preserve the roll of it... you can just use the Spell level query + 2 that forms the basis of the roll you want to reference): &{template:npcaction} {{rname= Magic Missile (Level ?{Spell level|1})}} [[ [[?{Spell level}+2]] * [[ [[1d4+1]]+?{Spell level}+2]] ]] {{description=@{selected|token_name} produces $[[0]] glowing darts of magical force that each do $[[2]] damage. **PER DART DAMAGE** [[(?{Spell level}+2)]] | Necrotic $[[2]] | ALL **TOTAL DAMAGE** [[(?{Spell level}+2) * (?{Spell level}+2)]] | Necrotic $[[3]] | ALL}} I like information in my output, but it might also be beneficial for you to see how I pulled out the component parts and was able to reconstruct them, later. Again, you benefit from not having a randomized value which you need to use in both a summation and product -- I don't think you can do that short of a script. In any case, the above would produce an output like this:
Timmaugh, thanks!  This works perfectly.  Now I can see where I was going wrong.  Really appreciate the education (and saved time).