Fandom

WoWWiki

API UnitPowerType

104,631pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

WoW API < UnitPowerType

Returns a number corresponding to the power type (e.g., mana, rage or energy) of the specified unit.

powerType, powerTypeString = UnitPowerType(UnitId);

ArgumentsEdit

UnitId 
String - The unit whose power type to query.

ReturnsEdit

powerType 
Integer - the power type.
powerTypeString 
String - also the power type:
  • "MANA"
  • "RAGE"
  • "FOCUS"
  • "ENERGY"
  • "COMBO_POINTS"
  • "RUNES"
  • "RUNIC_POWER"
  • "SOUL_SHARDS"
  • "ECLIPSE"
  • "HOLY_POWER"
  • "AMMOSLOT" (vehicles, 3.1)
  • "FUEL" (vehicles, 3.1)

ExampleEdit

local t = {[0] = "mana", [1] = "rage", [2] = "focus", [3] = "energy", [4] = "combo points", [5] = "runes", [6] = "runic power", [7] = "soul shards", [8] = "eclipse", [9] = "holy power"};
DEFAULT_CHAT_FRAME:AddMessage(UnitName("player") .. "'s " .. t[UnitPowerType("player")] .. ": " .. UnitPower("player"));

ResultEdit

Displays the player's current mana/rage/energy/etc in the default chat frame.

Also on Fandom

Random Wiki