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

Auto-choose an NPC Attack

"The Champion" (VGM p. 212) has two weapon attacks that deal damaged based on their HP. I've set up token actions for my PCs to help speed combat. I'd like the Champion to either query me, or make the determination on it's own and use the attack macro....and that's where it gets difficult. If I write a macro query asking me about the health, then call another macro/ability/attribute, the way the system processes things jumbles the query. Seems an easier solution was to write an API, check the health on Bar 1, then fire the Greatsword or Greatsword+ macro....but you can't easily fire macros from the API. Essentially: !ChampionAttack with @Bar1 sent to API.......---->  Bar 1 < 50%.    ----> Greatsword+ Bar 1 > 50%     -----> Greatsword Any suggestions?
1588618805

Edited 1588618950
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'd just solve this with a macro. The second damage is already in the attack, so add the following line to the description of the attack: Champion has **@{selected|bar1} HP**. If this is greater than [[@{selected|bar1|max}/2]] then add second damage. You might be able to work out a math function that will express this better. This was seat of my pants.