WoW:API UnitStat: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 8: Line 8:
;''Arguments''
;''Arguments''


:;unit : String - The [[API TYPE UnitId|UnitId]] to get information from. (Likely only works for <tt>"player"</tt> and <tt>"pet"</tt> -- unconfirmed)
:;unit : String - The [[API TYPE UnitId|UnitId]] to get information from. (Only works for <tt>"player"</tt> and <tt>"pet"</tt>. Will work on <tt>"target"</tt> as long as it is equal to <tt>"player"</tt>)


:;statID : Number - An internal id corresponding to one of the stats. (1-5)
:;statID : Number - An internal id corresponding to one of the stats. (1-5)

Revision as of 21:30, 18 March 2005

UnitStat -Documentation by geekgirljess-
base, stat, posBuff, negBuff = UnitStat("unit", statID);

Returns info about one of the unit's stats (strength, agility, stamina, intellect, spirit).


Arguments
unit
String - The UnitId to get information from. (Only works for "player" and "pet". Will work on "target" as long as it is equal to "player")
statID
Number - An internal id corresponding to one of the stats. (1-5)

Returns
base, stat, posBuff, negBuff
base
Number - The unit's base stat.
stat
Number - The unit's current stat.
posBuff
Number - Any positive buffs applied to the stat.
negBuff
Number - Any negative buffs applied to the stat.

Example
local base, stat, posBuff, negBuff = UnitStat("player",1);
DEFAULT_CHAT_FRAME:AddMessage("Your current Strength is "..stat);

Template:WoW API