Wowpedia

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

READ MORE

Wowpedia
m (→‎Values: Added raid entries!)
m (→‎Values: Updated for 1.5.0 (pet unit ID's and target suffix))
Line 1: Line 1:
 
Many of the API functions which act on units in the game world (Players, NPC's, Monsters, etc) refer to the unit in question by an identifier that is related to how the player is accessing the unit. The following values are available:
 
Many of the API functions which act on units in the game world (Players, NPC's, Monsters, etc) refer to the unit in question by an identifier that is related to how the player is accessing the unit. The following values are available:
   
== Values ==
+
== Base Values ==
   
 
; <tt>"player"</tt> : The current player
 
; <tt>"player"</tt> : The current player
Line 15: Line 15:
 
; <tt>"party4"</tt> : The fourth other party member
 
; <tt>"party4"</tt> : The fourth other party member
   
; <tt>"target"</tt> : The currently targetted unit
+
; <tt>"partypet<i>N</i>"</tt> : The pet of the N'th party member (N is 1,2,3, or 4) (New in 1.5.0)
   
; <tt>"mouseover"</tt> : The unit which the mouse is currently (or was most recently) hovering over
+
; <tt>"raid<i>N</i>"</tt> : The N'th raid member (N is 1,2,3,...,40)
   
; <tt>"raid1"</tt> : The first raid member (New in 1.3.0!)
+
; <tt>"raidpet<i>N</i>"</tt> : The N'th raid member's pet (N is 1,2,3,...,40) (New in 1.5.0)
   
; <tt>"raid<i>N</i>"</tt> : The N'th raid member (New in 1.3.0!)
+
; <tt>"target"</tt> : The currently targetted unit
  +
  +
; <tt>"mouseover"</tt> : The unit which the mouse is currently (or was most recently) hovering over
   
 
The following value also appears in some very specific places (Vendor interactions, for example)
 
The following value also appears in some very specific places (Vendor interactions, for example)
   
 
; <tt>"npc"</tt> or <tt>"NPC"</tt> : The NPC with which the player is currently interacting.
 
; <tt>"npc"</tt> or <tt>"NPC"</tt> : The NPC with which the player is currently interacting.
  +
  +
== Targets ==
  +
  +
You can append the suffix <tt>target</tt> to any UnitId to get a UnitId which refers to that unit's target (e.g. <tt>"partypet2target"</tt>). This appending can be repeated indefinitely (<tt>"playertargettarget"</tt>), though you will observe an attendant performance hit if you overdo it, as the game engine has to jump from target to target.
   
 
== Notes ==
 
== Notes ==

Revision as of 18:59, 12 June 2005

Many of the API functions which act on units in the game world (Players, NPC's, Monsters, etc) refer to the unit in question by an identifier that is related to how the player is accessing the unit. The following values are available:

Base Values

"player"
The current player
"pet"
The current player's pet
"party1"
The first other party member
"party2"
The second other party member
"party3"
The third other party member
"party4"
The fourth other party member
"partypetN"
The pet of the N'th party member (N is 1,2,3, or 4) (New in 1.5.0)
"raidN"
The N'th raid member (N is 1,2,3,...,40)
"raidpetN"
The N'th raid member's pet (N is 1,2,3,...,40) (New in 1.5.0)
"target"
The currently targetted unit
"mouseover"
The unit which the mouse is currently (or was most recently) hovering over

The following value also appears in some very specific places (Vendor interactions, for example)

"npc" or "NPC"
The NPC with which the player is currently interacting.

Targets

You can append the suffix target to any UnitId to get a UnitId which refers to that unit's target (e.g. "partypet2target"). This appending can be repeated indefinitely ("playertargettarget"), though you will observe an attendant performance hit if you overdo it, as the game engine has to jump from target to target.

Notes

Many of the functions which take a UnitId only provide useful results for a subset of ID's. Other functions will only provide information for friendly targets (or those upon which a power is active).

Template:WoW API