WoW:API UnitBuff: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Formatting)
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(unit, buffIndex[, showCastable]);
  buffName, buffRank, buffTexture, buffApplications = UnitBuff(unit, buffIndex[, showCastable]);


== Parameters ==
== Parameters ==
Line 17: Line 17:


=== Returns ===
=== Returns ===
:;buffName : String - The name of the spell or effect of the buff. This is the name shown in yellow when you mouse over the icon. (Added in 2.0)
:;buffRank : String - The rank of the spell or effect that caused the buff. Returns "" if there is no rank. (Added in 2.0)


:;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

Revision as of 06:38, 8 December 2006

WoW API < UnitBuff

Retrieve info about a certain buff on a certain unit.

buffName, buffRank, 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

buffName
String - The name of the spell or effect of the buff. This is the name shown in yellow when you mouse over the icon. (Added in 2.0)
buffRank
String - The rank of the spell or effect that caused the buff. Returns "" if there is no rank. (Added in 2.0)
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