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 .
×

Macro for effects on an attack roll

Our DM created unique homebrew weapons based on our characters for our campaign.  Some of the weapons have special effects that occur when we roll a specific number on our attack roll.  For example our cleric has a mace that when he rolls a 19 with trigger an AOE healing effect for our party and when he rolls a 20 will have an AOE damage effect on his attack.  I'm wondering if I can write a macro for the people in our group so that when they roll the specific #'s for their weapons that it will automatically trigger the custom effects out DM has outlined for our weapons.  Another example for me is my bow when i roll a 20 i have to roll a 1d4 to determine which nature element will be added to my damage. so a simple pseudo code of it would be if roll = 20 then (element = 1d4) select case element     case 1: 2d6 frost dmg     case 2: 2d6 fire dmg     case 3: 2d6 daylight     case 4: 2d6 bludgeoning etc. Is it possible to write something like that? I can write them just not really sure where to start with it. since I've never writted any macros on this site before. Thanks!!
1550777709
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Conditional logic is not possible with the macro language, which is really just a strong dice roll parser. You can set up the ability for the user to choose which case, via a roll query . Also, the macro language cannot change values on a character sheet or token. All of these things are possible with the API.
Thanks for the quick reply. I'll check out the API documentation then!
1550825761
Ziechael
Forum Champion
Sheet Author
API Scripter
Which sheet are you using? The bow could be potentially possible using a rollable table (it's not pretty but it works...) so other options may work too: (woot... tenth upload attempt is the charm!)
1550825804
Ziechael
Forum Champion
Sheet Author
API Scripter
Also it's worth noting that the API is awesome... but requires the creator of the game to have a Pro subscription.