Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
mNo edit summary
mNo edit summary
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{wowapi}} __NOTOC__
<center>'''UnitAffectingCombat''' ''-Documentation by [[user:Flickering|Flickering]]-''</center>
 
  +
   
 
Determine whether a unit is in combat or has aggro.
 
Determine whether a unit is in combat or has aggro.
Line 12: Line 13:
   
 
=== Returns ===
 
=== Returns ===
;''Returns''
 
:affectingCombat
 
   
 
:;affectingCombat : Flag - Returns 1 if the unit is in combat or has aggro, nil otherwise.
 
:;affectingCombat : Flag - Returns 1 if the unit is in combat or has aggro, nil otherwise.
Line 19: Line 18:
 
==Details==
 
==Details==
   
:Goes true when initiating combat.
+
:Returns true when initiating combat.
:Goes true if aggroed, even if enemy doesn't land a blow.
+
:Returns true if aggroed, even if enemy doesn't land a blow.
:If a hunter, then goes true shortly after pet enters combat.
+
:If a hunter, then returns true shortly after pet enters combat.
:If using timed spell such as aimed shot, goes true when spell fires (not during charge up).
+
:If using timed spell such as aimed shot, returns true when spell fires (not during charge up).
:Goes to false on death.
+
: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.''
  +
   
 
----
 
----
__NOTOC__
 
{{Template:WoW API}}
 
[[Category:API Unit Functions|UnitAffectingCombat]]
 

Revision as of 18:09, 2 November 2007


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.