WoW:API UnitDefense: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (Move page script moved page API UnitDefense to API UnitDefense without leaving a redirect) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Returns the defense of the unit without armor, and defense value of their armor. | {{wowapi}} | ||
Returns the [[defense]] of the unit without [[armor]], and defense value of their armor. | |||
:For NPCs and pets, it will return a baseDefense value, though armorDefense will be 0. | :For NPCs and pets, it will return a baseDefense value, though armorDefense will be 0. | ||
| Line 30: | Line 31: | ||
: Returns the defense statistics of the player. | : Returns the defense statistics of the player. | ||
Latest revision as of 04:47, 15 August 2023
← WoW API < UnitDefense
Returns the defense of the unit without armor, and defense value of their armor.
- For NPCs and pets, it will return a baseDefense value, though armorDefense will be 0.
- For other player targets than "player", it will return 0 for baseDefense and 0 for armorDefense.
baseDefense, armorDefense = UnitDefense(unit);
- Arguments
- ("unit")
- unit
- String - The UnitId to get information from. (Works for "player" and "target")
- Returns
- baseDefense, armorDefense
- baseDefense
- Number - The unit's defense without armor. Includes the warrior talent Anticipation.
- armorDefense
- Number - The defense gained from the unit's armor.
- Example
local baseDefense, armorDefense = UnitDefense("player");
- Result
- Description
- Returns the defense statistics of the player.