WoW:API UnitAffectingCombat: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
(Does not return nill or 1 but true or false.)
Line 14: Line 14:
=== Returns ===
=== Returns ===


:;affectingCombat : Flag - Returns 1 if the unit is in combat or has aggro, nil otherwise.
;affectingCombat : Flag - Returns true if the unit is in combat or has aggro, false otherwise.


==Details==
==Details==

Revision as of 23:21, 21 October 2014

WoW API < UnitAffectingCombat


Determine whether a unit is in combat or has aggro.

affectingCombat = UnitAffectingCombat("unit");

Parameters

Arguments

("unit")
unit
String - The UnitId of the unit to check (Tested with "player", "pet", "party1", hostile "target")

Returns

affectingCombat
Flag - Returns true if the unit is in combat or has aggro, false otherwise.

Details

Returns true when initiating combat.
Returns true if aggroed, even if enemy doesn't land a blow.
If a hunter, then returns true shortly after pet enters combat.
If using timed spell such as aimed shot, returns true when spell fires (not during charge up).
Returns to false on death.
Returns false if the unit being checked for aggro is out of range, or in another zone.

Note: returns false if a unit is proximity-aggroed. It wont return true until it either attacks or is attacked.