WoW:API UnitBuff: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(Formatting)
Line 1: Line 1:
<center>'''UnitBuff''' ''-Documentation by Sarf-''</center>
{{wowapi}} __NOTOC__


Retrieve info about a certain buff on a certain unit.
Retrieve info about a certain buff on a certain unit.


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


----
== Parameters ==
;''Arguments''
=== Arguments ===


:(String unit)
:(unit, buffIndex, showCastable)
:;unit : String - The [[API TYPE UnitId|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.
:;unit : String - The [[unitId]] to query information for


:;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)
:;buffIndex : Number - The index of the buff to retrieve information for. Starts at 1 and goes up to a certain number: The maximum numbers used by the Blizzard code are 16 for party/pet and 8(?) for target buffs. ''Is this information up to date? --[[User:Mikk|Mikk]] 07:14, 11 August 2006 (EDT)''


----
:;showCastable : [[Boolean]] - If present and true (1), then only buffs will be returned which are castable by the player. Index is still starting with 1 and counting up. (Added in 1.9, works in 1.9.3)
;''Returns''
 
=== Returns ===


:;buffTexture : String - The identifier of (path and filename to) the indicated buff, or nil if no buff
:;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.
:;buffApplications : String - The number of times the buff has been applied to the target.
----
;''Example''
buff = UnitBuff("pet", i);


;''Result''
== Example ==
buff = UnitBuff("pet", 1);


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


----
: Retrieves the texture name of the first buff that your pet has
;''Description''


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


----
== See also ==
;''See Also''


: [[API UnitDebuff|UnitDebuff]]
: [[API UnitDebuff|UnitDebuff]]
: [[Check Hunter Aspect|Sample Code Check Hunter Aspect]]
: [[Check Hunter Aspect|Sample Code Check Hunter Aspect]]
: [[Queriable Buff effects|List of known buff and debuff effects that can be queried]]
: [[Queriable Buff effects|List of known buff and debuff effects that can be queried]]
----
{{WoW API}}

Revision as of 11:14, 11 August 2006

WoW API < UnitBuff

Retrieve info about a certain buff on a certain unit.

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

Parameters

Arguments

(unit, buffIndex, showCastable)
unit
String - The unitId to query information for
buffIndex
Number - The index of the buff to retrieve information for. Starts at 1 and goes up to a certain number: The maximum numbers used by the Blizzard code are 16 for party/pet and 8(?) for target buffs. Is this information up to date? --Mikk 07:14, 11 August 2006 (EDT)
showCastable
Boolean - If present and true (1), then only buffs will be returned which are castable by the player. Index is still starting with 1 and counting up. (Added 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", 1);

Result

Retrieves the texture name of the first buff that your pet has


See also

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