Execute-like buttons not glowing
ennvina opened this issue · 0 comments
There are many situations where buttons of abilities like Execute (e.g. Hammer or Wrath, Kill Shot…) do not glow as intended. This is mostly due to the Global Cooldown (GCD) kicking in and disabling the buttons for a short period of time.
For Execute-like buttons we can simply check if the target’s HP is low and if the target is hostile and/or can be attacked.
It requires tracking the following events:
- PLAYER_TARGET_CHANGED to detect when the target's HP and hostility must be re-evaluated
- UNIT_HEALTH / UNIT_HEALTH_FREQUENT / UNIT_MAXHEALTH to detect when HP drops below 20%
Target’s hostility/attackability can be checked with UnitCanAttack.
Suggestion: add a new script called execute.lua
in the components
folder and give it a new method called SAO.RegisterExecute
which has an aura name as parameter, just like SAO.RegisterCounter
in counter.lua
uses an existing aura name.