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

Add macro/script that adds toggle for critical hit?

Hi all, I have a Paladin PC and I love to cast a Divine Smite when I critical hit on attack rolls. I wanted to see whether I could add a script or macro to ask "Do you want to Divine Smite?' if I roll a critical hit on attack rolls. Any recommendations on if or how I could implement this? Whether it is on the character sheet or something else?
1630548708
timmaugh
Pro
API Scripter
If no one else has a method to do it, you can metascript it. The following assumes that your attack roll is the 0th roll (ie, the first) of the message. {& if 0 < {& eval}getDiceByVal($[[0]] >0 crit count){& /eval}}{& eval}!w --<character name> --You scored a critical hit. Would you like to roll Divine Smite? --CRITICAL HIT --Smite|<character name>|<Smite ability>{\& /eval}{&end} Drop that anywhere in another command line to have it process. You will have to replace the <character name> with your character's name (or token name, etc.), and replace <Smite ability> with the ability on your character sheet that would fire the Diving Smite attack. Alternately, you can reference an attribute that would fire the Divine Smite attack this way: --Smite|<character name>|@<Smite ability> If the above detects a critical hit, it fires off the call to DiscreteWhisper, and you get a message in the chat like this: Required scripts : ZeroFrame, APILogic, Plugger, DiscreteWhisper, and possibly SelectManager
Kyle W. said: Hi all, I have a Paladin PC and I love to cast a Divine Smite when I critical hit on attack rolls. I wanted to see whether I could add a script or macro to ask "Do you want to Divine Smite?' if I roll a critical hit on attack rolls. Any recommendations on if or how I could implement this? Whether it is on the character sheet or something else? I could totally see this possible with Customizeable Roll Listener.  It will check for a template that rolls a critical and then its just a matter of figuring out what sort of macro/template/api button you want fed as a whisper to said player who just critted.   You could also just go lazy mode with it and insert an API button for your preferred community divine smite macro in the description field of all the pallies melee attacks, which is what I do cause I find that while all the programming seems fun, 99% of it is theorycraft that doesn't survive a live sessions fluid/improv level gameplay and I wind up more involved in programming then playing dnd.