WoW:API UnitDefense: Difference between revisions

m
Move page script moved page API UnitDefense to WoW:API UnitDefense without leaving a redirect
mNo edit summary
m (Move page script moved page API UnitDefense to WoW:API UnitDefense without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
"unit" can be player or target and work as of 07-06-05
{{wowapi}}
Returns the [[defense]] of the unit without [[armor]], and defense value of their armor.


[[Category:API Functions|UnitDefense]]
:For NPCs and pets, it will return a baseDefense value, though armorDefense will be 0.
[[Category:API Unit Functions|UnitDefense]]
: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 [[API TYPE UnitId|UnitId]] to get information from. (Works for <tt>"player"</tt> and <tt>"target"</tt>)
 
----
;''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.
Anonymous user