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

Macro : cap from abilities

Hello, First I apologize for my bad english :( Here is my question, as a newcomer to Roll20 I 'am tring some macro, and I I'am toying with level as a parameter such as : casting a magic missile : /roll @{selected|Lvl}D4+@{selected|Lvl} (for a level 5 character will roll as 5D4+5 so far it is ok. Then I want a macro to cast searing light :"A creature struck by this ray of light takes 1d8 points of damage per two caster levels (maximum 5d8)." so : 1st level caster 1D8 2nd level caster 1D8 3rd level caster 2D8 4th level caster 1D8 5th level caster 3D8 6th level caster 3D8 7th level caster 3D8 8th level caster 3D8..... I found out how to divide level by two, rounded up or rounded down /me test multiple niveau level = @{selected|Lvl} /roll @{selected|Lvl}D8+@{selected|Lvl} /me test multiple fraction niveau arrondi inférieur level = @{selected|Lvl} /roll [[floor(@{selected|Lvl}/2)]]D8+5 /me test multiple fraction niveau arrondi supérieur level = @{selected|Lvl} /roll [[ceil(@{selected|Lvl}/2)]]D8+5 But how to max the result to 5 for the ability selected (here level) ??
[[{floor(@{selected|Lvl}/2), 5}KL1]]d8+5
Thank you very much !!!