Jump to content
Toggle menu
  • 17.3K articles
  • 8.2K files
  • 5 users
  • 280.7K edits
WoW Classic Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
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
  • 2 for Focus (hunter pets)
  • 3 for Energy
  • 4 for Happiness

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

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



Template:WoW API