WoW:API UnitArmor: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
{{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 : 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( | 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. | |||
: | |||
Revision as of 12:30, 18 June 2006
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.