WoW:API UnitPower: Difference between revisions
Jump to navigation
Jump to search
(Add Link to UnitPowerMax) |
m (Move page script moved page API UnitPower to API UnitPower without leaving a redirect) |
||
(2 intermediate revisions by 2 users not shown) | |||
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" | power = UnitPower("unit" , powerType); | ||
==Arguments== | ==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== | ==Returns== | ||
;power : Number - the unit's current power level. | ;power : Number - the unit's current power level. | ||
== | ==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== | ==Also See== | ||
* [[API UnitPowerMax|UnitPowerMax]] | * [[API UnitPowerMax|UnitPowerMax]] |
Latest revision as of 04:47, 15 August 2023
Returns the power level of the specified unit.
power = UnitPower("unit" , powerType);
Arguments[edit]
- 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[edit]
- power
- Number - the unit's current power level.
Type[edit]
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 UnitPowerType. Values for all power types are available in any form.