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

Protection from Evil

I want to tap the brain trust and give mind for a potential revolutionary use of api and macros. I really want Protection from (insert) to be a reactive modifier. I was thinking (wondering) I it could be done with a macro written into It's a Trap? Something that could read the "victim's" alignment or similar trait and the apply a penalty to their next attack roll (or increase targets defense).  Aside from cluttering attributes and macros if if/else statements, any suggestions? Seeing OnMyTurn, Its a Trap, !Radar, etc I think there must be a way to do something like this.
So this is what I did. On a custom character sheet I created conditions/buffs for protection from evil/good/law/chaos. It has a value of 0 and 2 (checkbox input). As well as alignment axis checkboxes (good, evil, neutral, lawful, chaotic, neutral) with values of 0 and 1. In the powercards macro for melee attacks I added a -(@{target|Evil}*@{selected|protectionfromevil}) to the attack roll. Range attack macros use a skipto feature based on range query that is manually added each attack. If the range is greater than 10' it skips to an attack roll that ignores the protection penalty. Add in audio and fx for flavor.
I also use division in the range attack using range to target (from query) and weapon range to calculate range penalty.  Math. Its some sumbitch. 
Math, it's helluva drug.
APIs used: Powercards,. But chatsetattr is used to activate protection from (insert), tokenmod is used to trigger aura to show effect radius and statusmarker, !act for duration, roll20am for audio. 
You might want to check out the Paladin Aura script . It automatically adjusts token stats based on distance to a paladin with an aura like Protection from Evil and Good. 
Sigh
Jarren K. said: You might want to check out the Paladin Aura script . It automatically adjusts token stats based on distance to a paladin with an aura like Protection from Evil and Good.  I looked it over. Beyond my skill to modify since its 5E OGL only and I play Castles and Crusades. But thanks.