WoW:API UnitPower: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
(clean up formatting)
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
Returns the power level of the specified unit.
Returns the power level of the specified unit.
power = UnitPower("unit" [, type]);


----
==Arguments==
;''Usage''
;unit : String - The [[API TYPE UnitId|UnitId]] of the unit whose power should be returned
 
;type : Number (optional) - The power type of the unit whose power should be returned
local power = UnitPower("unit" [, type]);
 
----
;''Arguments''
 
:;unit : String - The [[API TYPE UnitId|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


----
==Returns==
;''Details''
;power : Number - the unit's current power level.


: 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 [[API UnitPowerType|UnitPowerType]]. However, values for all power types are available in any form.
==Details==
FrameXML 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 {{api|UnitPowerType}}. Values for all power types are available in any form.

Revision as of 21:14, 9 September 2009

WoW API < UnitPower

Returns the power level of the specified unit.

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

FrameXML 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. Values for all power types are available in any form.