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

D&D5e Elemental Adept Script/Macro

1552352968

Edited 1552353761
I'm really not sure whether this is an API question but I suspect that it may be. It doesn't seem to fit under other categories. I've spent some time trawling the forums but have so far not been able to find anything about this. The Elemental Adept  feat allows a player to select from a number of damage types and become adept at that type. All 1's rolled for damage of the selected type will become 2's. Is there a readily available example of a way to script this either in a macro or the API, or even simply as a dice roll? Example A sorcerer chooses to be adept at fire-based spells and then casts a fireball at level 3 rolling 8d6 for damage with the following result: 1, 3, 5, 3, 1, 6, 1, 2 which totals 22 but because he is a fire adept, the 1's should become 2's so the total is really 25. This is not a case of rerolling the 1's, but of incrementing them by 1. A roll something along the lines of 8d6<=1inc1, or something of the sort, would have been really useful.
You can accomplish this using the dice roller, though it is not as nice as 8d6<=1inc1. It requires you to compare each individual die roll and sum the results. So for your example 8d6 you would need to use: [[ [[{1d6,2d1}kh1]] + [[{1d6,2d1}kh1]] + [[{1d6,2d1}kh1]] + [[{1d6,2d1}kh1]] + [[{1d6,2d1}kh1]] + [[{1d6,2d1}kh1]] + [[{1d6,2d1}kh1]] + [[{1d6,2d1}kh1]] ]]
Many thanks. Not pretty, and fairly static, but workable to an extent. I'm going to have to think about how this would be implemented when casting at higher levels where the number of dice changes according to the spell slot level used. I may have to write a script with a for loop. I haven't looked to much into the API, but that should be a fairly simple.thing to do.