Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API UnitDefense

Last wiki revision 2022-07-26

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: : UnitId - Only is supported
  • Returns
  • baseDefense, armorDefense
  • baseDefense: - The unit's defense without armor. Includes the warrior talent Anticipation.
  • armorDefense: - The defense gained from the unit's armor.

local baseDefense, armorDefense = UnitDefense("player");

  • Example
  • Result
  • Description
  • Returns the defense statistics of the player.

Source

https://warcraft.wiki.gg/wiki/API_UnitDefense · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.