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

Adding a plus 2 modifier to spell damage

January 12 (4 years ago)

Edited January 12 (4 years ago)

Like the title says I am trying to add a +2 per dice modifier. I've got the following but can't get it to work right. Any suggestions?

[[ @{damageDice} + [[@{damageDice}>0 * 2]] + @{stdDmgBonus} ]]


January 12 (4 years ago)
Kraynic
Pro
Sheet Author

You might want to mention what character sheet you are using, if this is interacting with sheet rolls.  Otherwise, what does @{damageDice} contain?  Basically, there is more info needed unless someone recognizes these specific attributes.

Standard roll20 for a 5e campaign. Let's go with 3d6 for example on damage


January 12 (4 years ago)

Edited January 12 (4 years ago)
Kraynic
Pro
Sheet Author

I don't play 5E, but if @{damageDice} contains the entire dice expression (3d6), I'm not sure there is a way to separate out the 3.  Usually when you have a mechanic like that, you might have something like @{numberDice}@{damageDice} with the first one having the number of dice and the second having the d6, d8, or whatever. That way you can pull out the number of dice easily.

You may end up needing to just put a static modifier in and update it manually when your number of dice changes.  Maybe someone more familiar with that sheet will have a more automated option.

January 13 (4 years ago)

Edited January 13 (4 years ago)
Oosh
Sheet Author
API Scripter

Where are you getting the number of dice from? Are you pulling it straight from a damage field on the sheet? As Kraynic said, you can't deconstruct a dice expression using a macro. If the players are entering the number of dice you can do it, other than that you'd need the API to pull the expression apart.

If you had a straight XdY expression stored with no modifier, like 3d6, what you've already got will work (assuming by "dice modifier" you mean "number of dice"):

3d6 + 3d6>0*2

But "3d6 + 5" will not, since the success operator doesn't work on the 5.

Again, that's API territory, a macro cannot modify existing strings.

January 13 (4 years ago)

If it's something to modify spell damage, you can override the default higher spell level query* and insert your own into the damage field that will also allow you to add the extra damage per die that you're looking for.

For example, if you're modifying Burning Hands, the damage would be:

[[2+?{What Spell Level?|1|2|3|4|5|6|7|8|9}]]d6+[[(2+?{What Spell Level?})]]*2

You're basically creating a formula that will result in the proper number of damage dice based on the spell level, and that same formula will allow you to add the extra 2/die.


*To disable the default spell level query, take the number out of the field for Higher Level Casting, and change the die to None.