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
This post has been closed. You can still view previous posts, but you can't post any new replies.

5th Edition - Macro to automatically work out extra spell dice at 5th, 11th and 17th level.

I'm sure plenty of people have figured this out already - but didn't see it in a search of the forum. As many 5th edition D&D players are aware, a lot of attack spells get extra dice at 5th, 11th and 17th level. Ray Of Frost for example.  I wanted my attack macros to automatically work the number of extra dice out without having to force the player to input the number of dice every time. so I made an attribute called 'spell_damage_dice_mult' with a formula of :  (1+(((@{level}+1)/6)-0.5)) And I use it in conjunction with the dice as follows: [[@{spell_damage_dice_mult}d8]] the first '1' in the formula is for the main attack die that you get at level 1. Then we take the level, add 1 to it so that the numbers we're interested all become divisible by 6 (6,12,18). Then the -0.5 avoids any rounding up (which would cause extra dice to be thrown). So the resulting number is 1 until 5th level, then 2 until 11th, then 3 until 17th level - where it becomes 4. technically if you 'levelled' to level 23 then the number would go up to 5 - which isn't in the rules - but hey ho.
1474668947
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Very nice work. Always good to have stuff like this around as a resource.
1474669090

Edited 1474669123
Tetsuo
Forum Champion
Instead of the -.05, you could probably use the floor command to force it to always round down to the nearest whole number.  [[1+floor((@{level}+1)/6)]]
Franky H. said: Instead of the -.05, you could probably use the floor command to force it to always round down to the nearest whole number.  [[1+floor((@{level}+1)/6)]] Cool - thanks Franky - I wasn't aware of the floor command - that makes it neater.
1474669410
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep although, you then have to put the equation in an inline roll as you noted. Not a huge deal, but I've had inline rolls cause kinkiness when they are deeply nested before.
Scott C. said: Yep although, you then have to put the equation in an inline roll as you noted. Not a huge deal, but I've had inline rolls cause kinkiness when they are deeply nested before. Leaving spaces after the inline brackets helps with that. Use [[ 1+floor((@{level}+1)/6) ]] and helps prevent macros from breaking with multiple nested inline rolls. 
Nice work. Am I wrong, or do the spells that come from the SRD if you're using the 5e shaped character sheet already have that feature built in? I was just checking one of my characters and it appears to.
Gregory F. said: Nice work. Am I wrong, or do the spells that come from the SRD if you're using the 5e shaped character sheet already have that feature built in? I was just checking one of my characters and it appears to. Probably - I'm using the 'OGL by Roll20' template.
Great work Benelio! I have been using a similar but less accruate formula and I am very happy to see your improvement! Thanks!
1474965038
Kryx
Pro
Sheet Author
API Scripter
It can be simplified further: "((@{level} + 1) / 6 + 0.5)d10" for fire bolt for example