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

Math Macro Help for 3.5 Jump spell

So the Jump spell says "The subject gets a +10 enhancement bonus on Jump checks. The enhancement bonus increases to +20 at caster level 5th, and to +30 (the maximum) at caster level 9th." I'm making spell macros and I was wondering if there was some way to derive the bonus from caster level in a macro. I tried a bunch of things with floor and ceil functions, but could never get it right. Level 4 always seemed to give +20 when it should be +10 or level 5 would do the reverse. This is more for the challenge than anything else. The bonuses are pretty simple to figure out and apply in play. If I really needed it to be generated automatically, I could do a rollable table or the API to get what I want, but something tells me there is a way to do it in a macro and I just can't see it. Maybe I have been working on this too long... :-) Thanks to anyone who can satisfy my curiosity!
1437276770
Lithl
Pro
Sheet Author
API Scripter
[[10 + {floor(@{caster_level} / 5), 1}kl1 * 10 + {floor(@caster_level} / 9), 1}kl1 * 10]] should do. At levels 1-4, that'll be 10 + 0 + 0, at level 5-8 it'll be 10 + 10 + 0, and at level 9+ it'll be 10 + 10 + 10. You can add nested inline rolls to clean up the output if you like.
[[ [[[[ceil((5 - ?{CL})/100)]]d1* 10 ]] + [[[[ceil((9*floor(?{CL}/5) - ?{CL}*floor(?{CL}/5))/100)]]d1* 20 ]] + [[ceil([[floor(?{CL}/9)]]/100)* 30 ]] ]]
Wow! Thanks to you both for the quick response! I will put these into my Macro text file and parse them out to add to my math knowledge. Many thanks again! :-)