WoW:API UnitPowerType

From AddOn Studio
Revision as of 01:26, 1 December 2004 by WoWWiki>Blackaxe
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
UnitPowerType -Documentation by blackaxe-

Returns a number corresponding to the power type (e.g., mana, rage or energy) of the specified unit.

local powerType = UnitPowerType(unit);

Arguments
(String unit)
arg1
the unit's power type to query

Returns
powerType
powerType
the power type of the query as a number. Values seen so far are
  • 0 for Mana
  • 1 for Rage
  • 3 for Energy

Example
if (UnitPowerType("player") == 1) then
  ChatFrame1:AddMessage('players rage: ' .. UnitMana("player"));
else
  ChatFrame1:AddMessage('players mana: ' .. UnitMana("player"));
end
Result
'players rage: 0' - For warriors(and probably druids in bear form)
'players mana: 0' - Otherwise

Description
Returns a number corresponding to the power type (e.g., mana, rage or energy) of the specified unit.

Template:WoW API