Wowpedia

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

READ MORE

Wowpedia
mNo edit summary
Yakehira (talk | contribs)
mNo edit summary
Tag: WoW API docs
Line 1: Line 1:
 
{{wowapi}} __NOTOC__
 
{{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 ==
 
;unit : {{api|t=t|string}} - The [[unitId]] to get information from. Normally only works for <code>"player"</code> and <code>"pet"</code>, but also for "target" if the target is a beast upon which the hunter player has cast Beast Lore.
=== Arguments ===
 
   
 
== Returns ==
:;unit : String - The [[unitId]] to get information from. Normally only works for <code>"player"</code> and <code>"pet"</code>, but also for "target" if the target is a beast upon which the hunter player has cast Beast Lore.
 
 
;baselineArmor : {{api|t=t|number}} - The unit's base armor without buffs, armor kits or enchantments.
 
;effectiveArmor : {{api|t=t|number}} - The unit's effective armor after buffs.
 
;armor : {{api|t=t|number}} - The unit's armor after adding armor kits and enchantments but without buffs.
 
;bonusArmor : {{api|t=t|number}} - Amount of armor increase due to positive buffs
   
=== Returns ===
+
== Example ==
  +
<syntaxhighlight lang="lua">
 
local baseArmor , effectiveArmor, armor, posBuff, negBuff = UnitArmor("player");
 
DEFAULT_CHAT_FRAME:AddMessage(("Your current armor is " .. effectiveArmor .. " (base is " .. baseArmor .. ")");
  +
</syntaxhighlight>
   
  +
== External links ==
:base, effectiveArmor, armor, posBuff, negBuff
 
  +
<!-- Please read https://wow.gamepedia.com/Wowpedia:External_links_policy before adding new links. -->
:;base : Number - The unit's base armor without buffs, armor kits or enchantments.
 
  +
{{Elinks-api}}
:;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 baseArmor , effectiveArmor, armor, posBuff, negBuff = UnitArmor("player");
 
message("Your current armor is " .. effectiveArmor .. " (base is " .. baseArmor .. ")");
 

Revision as of 23:49, 26 February 2021

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. Normally only works for "player" and "pet", but also for "target" if the target is a beast upon which the hunter player has cast Beast Lore.

Returns

baselineArmor
number - The unit's base armor without buffs, armor kits or enchantments.
effectiveArmor
number - The unit's effective armor after buffs.
armor
number - The unit's armor after adding armor kits and enchantments but without buffs.
bonusArmor
number - Amount of armor increase due to positive buffs

Example

local baseArmor , effectiveArmor, armor, posBuff, negBuff = UnitArmor("player");
DEFAULT_CHAT_FRAME:AddMessage(("Your current armor is " .. effectiveArmor .. " (base is " .. baseArmor .. ")");

External links