WoW:API UnitBuff: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
Retrieve info about a certain buff on a certain unit.
Retrieve info about a certain buff on a certain unit.


  buffTexture, buffApplications = UnitBuff(unitName, buffIndex, showCastable);
  buffTexture, buffApplications = UnitBuff(unit, buffIndex, showCastable);


----
----
;''Arguments''
;''Arguments''


:(String unitName)
:(String unit)
:;unit : String - The [[API TYPE UnitId|UnitId]] to select as a target.


:;unitName : The name of the unit you wish to retrieve info on
:;buffIndex : Number - The index num of the buff to retrieve info on. Starts at 1 and goes up to (and possibly beyond) a certain number. The maximum numbers used by the Blizzard code are 16 for party/pet and 8(?) for target buffs.


: Viable names known:
:;showCastable : Boolean - Flag <small><i>(optional)</i></small> - Can be 0, 1, or nil. If present and 1, then only buffs will be returned which are castable by the player. Index is still starting with 1 and counting up. (new in 1.9, works in 1.9.3)
:* player
:* party1-4
:* raid1-40
:* pet
:* partypet1-4
:* target
 
:(Number buffIndex)
 
:;buffIndex : The index num of the buff to retrieve info on. Starts at 1 and goes up to (and possibly beyond) a certain number.
 
: The maximum numbers used by the Blizzard code are 16 for party/pet and 8(?) for target buffs.
 
:(Boolean showCastable)
 
:;showCastable : Flag <small><i>(optional)</i></small> - Can be 0, 1, or nil. If present and 1, then only buffs will be returned which are castable by the player. Index is still starting with 1 and counting up. (new in 1.9, works in 1.9.3)


----
----
;''Returns''
;''Returns''


:(String buffTexture)
:;buffTexture : String - The identifier of (path and filename to) the indicated buff, or nil if no buff
 
:;buffTexture : The identifier of (path and filename to) the indicated buff, or nil if no buff
 
:(String buffApplications)


:;buffApplications : The number of times the buff has been applied to the target.
:;buffApplications : String - The number of times the buff has been applied to the target.
----
----
;''Example''
;''Example''

Revision as of 18:47, 13 July 2006

UnitBuff -Documentation by Sarf-

Retrieve info about a certain buff on a certain unit.

buffTexture, buffApplications = UnitBuff(unit, buffIndex, showCastable);

Arguments
(String unit)
unit
String - The UnitId to select as a target.
buffIndex
Number - The index num of the buff to retrieve info on. Starts at 1 and goes up to (and possibly beyond) a certain number. The maximum numbers used by the Blizzard code are 16 for party/pet and 8(?) for target buffs.
showCastable
Boolean - Flag (optional) - Can be 0, 1, or nil. If present and 1, then only buffs will be returned which are castable by the player. Index is still starting with 1 and counting up. (new in 1.9, works in 1.9.3)

Returns
buffTexture
String - The identifier of (path and filename to) the indicated buff, or nil if no buff
buffApplications
String - The number of times the buff has been applied to the target.

Example
buff = UnitBuff("pet", i);
Result

Retrieves the buff texture of the pets buff with the index of "i".


Description
Retrieve info (texture name) about a certain buff of the specified unit.

See Also
UnitDebuff
Sample Code Check Hunter Aspect
List of known buff and debuff effects that can be queried

Template:WoW API