WoW:API UnitPowerMax: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(New page: {{wowapi}} Returns the power level of the specified unit. As of 3.0, this function has replaced UnitManaMax as the preferred method of obtaining maximum unit power. ...)
 
m (Move page script moved page API UnitPowerMax to API UnitPowerMax without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
Returns the maximum power level of the specified unit.  As of 3.0, this function has replaced [[API_UnitManaMax|UnitManaMax]] as the preferred method of obtaining maximum unit power.
Returns the maximum power level of the specified unit.  As of 3.0, this function has replaced [[API_UnitManaMax|UnitManaMax]] as the preferred method of obtaining maximum unit power.


----
== Usage ==
;''Usage''


  local maxpower = UnitPowerMax("unit" [, type]);
  local maxpower = UnitPowerMax(UnitID , powerType);


----
== Arguments ==
;''Arguments''


:;unit : String - The [[API TYPE UnitId|UnitId]] of the unit whose maximum power should be returned
:;[[API TYPE UnitId|UnitId]] : String - The UnitID of the unit whose maximum power should be returned
:;type : Number (optional) - The power type of the unit whose maximum power should be returned (see [[API_UnitPowerType|UnitPowerType]] for a list of valid types)
:;[[powerType]] : Number (optional) - The power type of the unit whose maximum power should be returned


----
== Returns ==
;''Returns''


:;maxpower : Number - the unit's maximum power level
:;maxpower : Number - the unit's maximum power level


----
== Details ==
;''Details''


: If no type is specified, UnitPowerMax 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.
: If no type is specified, UnitPowerMax 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.

Latest revision as of 04:47, 15 August 2023

WoW API < UnitPowerMax

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

Usage[edit]

local maxpower = UnitPowerMax(UnitID , powerType);

Arguments[edit]

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

Returns[edit]

maxpower
Number - the unit's maximum power level

Details[edit]

If no type is specified, UnitPowerMax 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.