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

Need help with a macro for use with Power Card API Script

I am working on creating a spell book for use with the powercards API script and I hope someone can tell me how to add a "ceiling" to the damage output under the effect by the description max damage is 5d4 +30 (the 30 coming from the casters level) any help will be appreciated. 
1572117599

Edited 1572117702
!power {{ --format|atwill --border|3px solid #000 --name|Lance of Disruption  --emote|@{selected|token_name} Gathers energy and casts a spell --Level|3 --Reversible|NA --Effect|[[[[({@{level-class1}}kl1)*2+[[5d4]]]]]] --School/Sphere| Invocation/Evocation,Elemental Air,Force --Range|0    --Components| V,S      --Duration|Instantaneous          --Casting Time|3    --Area of Effect| 5 ft. x 60 ft         --Saving Throw|1/2        --Description|This spell creates a beam of concussive, disrupting force that lashes out from the wizard’s hand in a path 5 feet wide and 60 feet long. Any creatures caught in the beam’s path suffer 5d4 points of damage, plus 2 points of damage per caster level (maximum damage is 5d4+30); for example, a 6th-level wizard would inflict 5d4+12 damage with the lance of disruption. Victims are allowed a saving throw vs. spell for half damage. The lance’s energy delivers a powerful blow against inanimate objects and can easily blast light furniture, thin wooden walls, or fragile stonework to flinders. Barred wooden doors can be blasted of their hinges and even sturdy iron-bound doors or heavy stonework can be seriously damaged by the lance of disruption. Creatures with amorphous or nonsolid bodies, such as fire or air elementals and some oozes and slimes, are resistant to the lance’s effects and only sustain half damage, or one-quarter damage with a successful save.                    --| }}
1572119286

Edited 1572119404
Ziechael
Forum Champion
Sheet Author
API Scripter
You would use the kl ( keep lowest ) function: [[ 5d4 + {@{selected|caster-level}*2,30}kl1 ]]
Thanks works perfect if i may ask another question in the equation : [[[[({20,@{level-class1}}kl1)*10+60]]]]  what does the 20 in front of the comma represent?
1572123183

Edited 1572123301
Ziechael
Forum Champion
Sheet Author
API Scripter
In that instance it is doing the same thing but in reverse, the {,}kl1 is comparing both sides of the comma and keeping the lowest (so functionally it is the same as {@{level-class1},20}kl1). In the example you posted it takes the lowest value out of the 20 or the result of the @{level-class1} attribute's value, the lowest of those 2 is then multiplied by 10 and has 60 added to it.
Awesome Thanks a ton