WoW:API UnitPowerType
Jump to navigation
Jump to search
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.