WoW:API UnitPower: Difference between revisions

236 bytes removed ,  15 August 2023
m
Move page script moved page API UnitPower to WoW:API UnitPower without leaving a redirect
(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'...)
 
m (Move page script moved page API UnitPower to WoW:API UnitPower without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
Returns the power level of the specified unit.
power = UnitPower("unit" , powerType);


Returns the power level of the specified unit.  As of 3.0, this function has replaced [[API_UnitMana|UnitMana]] as the preferred method of obtaining unit power.
==Arguments==
;[[API TYPE UnitId|UnitId]] : String - The UnitID of the unit whose power should be returned
;[[powerType]] : Number (optional) - The power type of the unit whose power should be returned


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


local power = UnitPower("unit" [, type]);
==Type==
If Type is omitted or nil, 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.


----
==Also See==
;''Arguments''
* [[API UnitPowerMax|UnitPowerMax]]
 
:;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
 
----
;''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 [[API UnitPowerType|UnitPowerType]].  However, values for all power types are available in any form.
Anonymous user