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 .
×
May your rolls be chill this holiday season!
Create a free account

[5e Shaped] How to make Toll the Dead work correctly?

Hi All, I am trying to figure out how to make toll the dead work correctly when cast. At 1st level it does 1d8 damage to undamaged targets and 1d12 to damaged targets. The damage increases by one die when you reach 5th, 11th, and 17th level. So I need a code that checks for if the targets current HP < Max HP and adjusts the die used PLUS increases the dice rolled at higher levels. Can anyone help and perhaps explain the code they use? I'd like to apply this knowledge to other skills and feats in the future. Thank you
1546176972

Edited 1546177180
Andreas J.
Forum Champion
Sheet Author
Translator
It sounds like a conditional thing like that can only be replicated with API scripts, which are a Pro-member feature. Probably the best for you is just to have two versions of the spell, and use the correct one depending on if the DM/GM tells you the minion is wounded. Still, I'd check some macros that looks at a selected token's stats might not be able to do what you are after. It should describe what's possible to do.
Thanks I'll give that a whirl and post my results.
1546206886

Edited 1546206942
vÍnce
Pro
Sheet Author
If you don't mind a prompt... Toll the Dead damage macro; [[ [[ {floor((@{selected|level}+1)/6)+1,4}kl1 ]]d[[4*(?{Target injured?|yes,3|no,2})]] ]] [[ [[ {floor((@{selected|level}+1)/6)+1,4}kl1 ]] This part determines the number of damage dice based on your level. Floor rounds fractions down, kl1 compares your level calc with "4" and keeps the lower of the two values to prevent the number of damage dice from scaling any higher for levels above 17th.  d[[4*(?{Target injured?|yes,3|no,2})]] ]] This part will change the size of die based on whether the target has been injured. Results in 8 or 12.
1546302449

Edited 1546302588
Thanks Vince!! I wanted to somehow add this code to the actual cantrip text button from the character sheet rather than on a macro button onscreen (my players can add it as a macro as they please). I got it working by adding Freeform to my settings. I created a new cantrip called Toll the Dead and entered the typical spell details and content in the usual spaces. I then added a saving throw and 2 d8 to the damage field and tested it. I pressed up in chat and copied the results and went back to the cantrip and un-toggled the saving throw. I left all the damage, saving throws etc un-toggled. Then in the freeform I finished the spell code by adding: {{saving_throw_vs_ability=WISDOM}} {{saving_throw_dc= @{spell_save_DC} }} {{has_saving_throw_damage=1}} {{saving_throw_damage= [[[[ {floor((@{selected|level}+1)/6)+1,4}kl1 ]]d[[4*(?{Target injured?|yes,3|no,2})]][damage]]] }} {{saving_throw_damage_type=necrotic}} {{has_saving_throw_damage=1}} {{saving_throw_damage_macro=[Saving throw failure:](~-LUF3Khn_LARn_aFHEMw|repeating_spell0_-LV5RCkV7ZdEdZBHCa3O_saving_throw_damage)}} So in this instance I stopped the spells displayed results coding at the end of the description and used freeform to finish the spells display text and results. I changed the saving throw query to pull from the player stats and added your code to the damage field. I cleaned up the remaining character specific code so the code above can be copy pasted into any Toll the Dead cantrip for any player. The results look the same as any spell and works without a hitch. Thank again Vince. note: {{saving_throw_damage_macro=[Saving throw failure:](~-LUF3Khn_LARn_aFHEMw|repeating_spell0_-LV5RCkV7ZdEdZBHCa3O_saving_throw_damage)}} The above seems to just add "saving throw damage" in pink above the damage roll results and remove the repeat button (which doesn't show up anyway if not referenced. I dunno how necessary it is but I left it in.