WoW:API UnitArmor: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
<center>'''UnitArmor''' ''-Documentation by [[user:danboo|danboo]]-''</center>
{{wowapi}}
 
Returns the armor statistics relevant to the specified target.
Returns the armor statistics relevant to the specified target.


Line 7: Line 6:
----
----
;''Arguments''
;''Arguments''
 
:
:("unit")
 
:;unit : String - The [[API TYPE UnitId|UnitId]] to get information from. (Only seems to work for <tt>"player"</tt> and <tt>"pet"</tt>) (Also works for "target" if that is a beast on which the player has cast Beast Lore.)
:;unit : String - The [[API TYPE UnitId|UnitId]] to get information from. (Only seems to work for <tt>"player"</tt> and <tt>"pet"</tt>) (Also works for "target" if that is a beast on which the player has cast Beast Lore.)


Line 24: Line 21:
----
----
;''Example''
;''Example''
  local base, effectiveArmor, armor, posBuff, negBuff = UnitArmor(unit);
  local base, effectiveArmor, armor, posBuff, negBuff = UnitArmor("player");
message("Your current armor is " .. effectiveArmor .. " (base is " .. baseArmor .. ")");


;''Result''
;''Result''
 
: Message box appears displaying the current and base armor values of your character.
----
;''Description''
 
: Returns the armor statistics relevant to the specified target.
 
----
{{WoW API}}

Revision as of 12:30, 18 June 2006

WoW API < UnitArmor

Returns the armor statistics relevant to the specified target.

base, effectiveArmor, armor, posBuff, negBuff = UnitArmor(unit);

Arguments
unit
String - The UnitId to get information from. (Only seems to work for "player" and "pet") (Also works for "target" if that is a beast on which the player has cast Beast Lore.)

Returns
base, effectiveArmor, armor, posBuff, negBuff
base
Number - The unit's base armor without buffs, armor kits or enchantments.
effectiveArmor
Number - The unit's effective armor after buffs (and ??)
armor
Number - The unit's armor after adding armor kits and enchantments but without buffs.
posBuff
Number - Amount of armor increase due to positive buffs
negBuff
Number - Amount of armor reduction due to negative buffs (a negative number)

Example
local base, effectiveArmor, armor, posBuff, negBuff = UnitArmor("player");
message("Your current armor is " .. effectiveArmor .. " (base is " .. baseArmor .. ")");
Result
Message box appears displaying the current and base armor values of your character.