WoW:API UnitArmor: Difference between revisions

No edit summary
m (Move page script moved page API UnitArmor to API UnitArmor without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<center>'''UnitArmor''' ''-Documentation by [[user:danboo|danboo]]-''</center>
{{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")
:;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.


:;unit : String - The [[API TYPE UnitId|UnitId]] to get information from. (Only seems to work for <tt>"player"</tt> and <tt>"pet"</tt>)
=== Returns ===
 
----
;''Returns''


:base, effectiveArmor, armor, posBuff, negBuff
:base, effectiveArmor, armor, posBuff, negBuff
:;base : Number - The unit's base armor without buffs
:;base : Number - The unit's base armor without buffs, armor kits or enchantments.
:;effectiveArmor : Number - The unit's effective armor after buffs (and ??)
:;effectiveArmor : Number - The unit's effective armor after buffs (and ??)
:;armor : Number - Dont know what the difference between this and effectiveArmor is.
:;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
:;posBuff : Number - Amount of armor increase due to positive buffs
:;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(unit);
message("Your current armor is " .. effectiveArmor .. " (base is " .. baseArmor .. ")");
 
;''Result''
 
----
;''Description''
 
: Returns the armor statistics relevant to the specified target.
 
----
{{WoW API}}

Latest revision as of 04:47, 15 August 2023

WoW API < UnitArmor

Returns the armor statistics relevant to the specified target.

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

Parameters

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

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 baseArmor , effectiveArmor, armor, posBuff, negBuff = UnitArmor("player");
message("Your current armor is " .. effectiveArmor .. " (base is " .. baseArmor .. ")");