WoW:API UnitArmor: Difference between revisions

m
Move page script moved page API UnitArmor to WoW:API UnitArmor without leaving a redirect
mNo edit summary
m (Move page script moved page API UnitArmor to WoW:API UnitArmor without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{wowapi}}
{{wowapi}} __NOTOC__
Returns the armor statistics relevant to the specified target.
Returns the armor statistics relevant to the specified target.


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


----
== Parameters ==
;''Arguments''
=== Arguments ===
:
:;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 [[unitId]] to get information from. Normally only works for <tt>"player"</tt> and <tt>"pet"</tt>, but also for "target" if the target is a beast upon which the hunter player has cast Beast Lore.
;''Returns''
 
=== Returns ===


:base, effectiveArmor, armor, posBuff, negBuff
:base, effectiveArmor, armor, posBuff, negBuff
Line 19: Line 18:
:;negBuff : Number - Amount of armor reduction due to negative buffs (a negative number)
:;negBuff : Number - Amount of armor reduction due to negative buffs (a negative number)


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