Wikia

WoWWiki

API UnitPowerType

Talk0
101,547pages on
this wiki
Revision as of 20:16, October 20, 2010 by DrDoom (Talk | contribs)

(diff) ←Older revision | Latest revision (diff) | Newer revision → (diff)
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"
  • "HAPPINESS"
  • "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] = "happiness", [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.

Around Wikia's network

Random Wiki