Jump to content
Toggle menu
  • 17.3K articles
  • 8.2K files
  • 5 users
  • 280.7K edits
WoW Classic Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

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.

Template:WoW API