Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-24-16, 08:52 PM   #1
tonyis3l33t
A Cyclonian
 
tonyis3l33t's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 47
best way to detect combat status as an event?

Hey guys. I'm trying to find the best way to determine if the player is in combat, and run a function based on that status.

Right now I'm using the event PLAYER_REGEN_ENABLED, but it only fires when the player has agro. This wouldn't work for, say, dps or a healer entering combat, but not being attacked themselves.

Elsewhere I'm using UnitAffectingCombat("player") as a condition for an if statement, but it's not a great solution either as it's buried in an OnEnter hook, so it only checks when the mouse hovers on that frame.

Thanks,
Tony
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » best way to detect combat status as an event?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off