Zurr72217@legacy41590943 (talk | contribs) m (sp) |
Poposhka45178@legacy41564821 (talk | contribs) (→Details: changed terminology a bit) |
||
Line 19: | Line 19: | ||
==Details== |
==Details== |
||
− | : |
+ | :Returns true when initiating combat. |
− | : |
+ | :Returns true if aggroed, even if enemy doesn't land a blow. |
− | :If a hunter, then |
+ | :If a hunter, then returns true shortly after pet enters combat. |
− | :If using timed spell such as aimed shot, |
+ | :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: |
+ | ''Note: returns false if a unit is proximity-aggroed. It wont return true until it either attacks or is attacked.'' |
Revision as of 17:30, 12 September 2007
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
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 1 if the unit is in combat or has aggro, nil 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.