Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns the armor stats for the unit.
base, effectiveArmor, armor, bonusArmor = UnitArmor(unit) -- retail
base, effectiveArmor, armor, posBuff, negBuff = UnitArmor(unit) -- classic
Arguments[]
- unit
- string : UnitId - Only works for
"player"
and"pet"
. Works for"target"
with Hunter's Beast Lore.
Returns[]
- base
- number - The unit's base armor.
- effectiveArmor
- number - The unit's effective armor.
- armor
- number
Retail[]
- bonusArmor
- number
Classic[]
- 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 = UnitArmor("player")
print(format("Your current armor is %d (%d base)", effectiveArmor, base))