WoW API: UnitPower

From AddOn Studio
Revision as of 22:20, 29 September 2008 by WoWWiki>Naandi (New page: {{wowapi}} Returns the power level of the specified unit. As of 3.0, this function has replaced UnitMana as the preferred method of obtaining unit power. ---- ;''Usage'...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW API < UnitPower

Returns the power level of the specified unit. As of 3.0, this function has replaced UnitMana as the preferred method of obtaining unit power.


Usage
local power = UnitPower("unit" [, type]);

Arguments
unit
String - The UnitId of the unit whose power should be returned
type
Number (optional) - The power type of the unit whose power should be returned

Returns
power
Number - the unit's current power level

Details
The default interface defines constants that can be used for the 'type' argument, such as SPELL_POWER_ENERGY. If no type is specified, UnitPower returns the current primary type, e.g., energy for a druid in cat form. You can determine the current power type via UnitPowerType. However, values for all power types are available in any form.