Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
 
(Manually migrated from wowwiki)
 
Line 1: Line 1:
  +
{{wowapi}} __NOTOC__
<onlyinclude>{{tooltip
 
  +
Returns a number corresponding to the power type (e.g., mana, rage or energy) of the specified unit.
|float={{#ifeq:{{PAGENAME}}|Arcanite Dragonling|right|left}}
 
  +
powerType, powerTypeString = UnitPowerType(UnitId);
|width=18em
 
|skill=Engineering (300)
 
|sell={{cost|4||}}
 
|icon=INV_Misc_Head_Dragon_01
 
|quality=Rare
 
|bind=BoE
 
|slot=Trinket
 
|itemid=16022
 
|unique-eq=1
 
|ilvl=60
 
|name=Arcanite Dragonling
 
|level=50
 
|effect=Use: Activates your Arcanite Dragonling to fight for you for 1 min. It requires an hour to cool down before it can be used again.}}</onlyinclude>
 
   
==Source==
+
==Arguments==
  +
:;[[UnitId]] : String - The unit whose power type to query.
This item can be crafted using [[Engineering]] (300); taught by {{loot|Uncommon|Schematic: Arcanite Dragonling}}.
 
{{reagentbox|caption=Materials required
 
|item1=1x {{loot|Common|Mithril Mechanical Dragonling}}|icon1=INV_Misc_Head_Dragon_01
 
|item2=8x {{loot|Common|Delicate Arcanite Converter}}|icon2=INV_Gizmo_07
 
|item3=10x {{loot|Common|Enchanted Thorium Bar}}|icon3=INV_Ingot_Eternium
 
|item4=6x {{loot|Common|Thorium Widget}}|icon4=INV_Gizmo_04
 
|item5=4x {{loot|Common|Gold Power Core}}|icon5=INV_Battery_02
 
|item6=6x {{loot|Common|Enchanted Leather}}|icon6=INV_Misc_Rune_05}}
 
   
==External links==
+
==Returns==
  +
:;[[powerType]] : Integer - the power type.
{{elinks-item|16022}}
 
   
  +
:;powerTypeString : String - also the power type:
[[Category:Trinkets]]
 
  +
::* "MANA"
[[Category:Engineering Products]]
 
  +
::* "RAGE"
[[Category:Rare Items]]
 
  +
::* "FOCUS"
  +
::* "ENERGY"
  +
::* "HAPPINESS"
  +
::* "RUNES"
  +
::* "RUNIC_POWER"
  +
::* "SOUL_SHARDS"
  +
::* "ECLIPSE"
  +
::* "HOLY_POWER"
  +
::* "AMMOSLOT" (vehicles, 3.1)
  +
::* "FUEL" (vehicles, 3.1)
  +
  +
==Example==
  +
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"));
  +
  +
===Result===
  +
Displays the player's current mana/rage/energy/etc in the default chat frame.

Revision as of 19:09, 21 October 2010

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

powerType, powerTypeString = UnitPowerType(UnitId);

Arguments

UnitId
String - The unit whose power type to query.

Returns

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)

Example

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"));

Result

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