WoW:API UnitDamage: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=== Description ===
<center>'''UnitDamage''' ''-Documentation by [[User:The_ED|The_ED]]-''</center>
 
Unit damage returns information about your current damage stats. Doesn't seem to return usable values for mobs, NPCs, or other players. The method returns 7 values, only some of which appear to be useful.
Unit damage returns information about your current damage stats. Doesn't seem to return usable values for mobs, NPCs, or other players. The method returns 7 values, only some of which appear to be useful.


=== Return Values ===
lowDmg, hiDmg, offlowDmg, offhiDmg, posBuff, negBuff, percentmod = UnitDamage("unit");
# Main hand low damage
 
# Main hand high damage
----
# Off hand low damage (always returned 0 for me for characters without dual wield ability)
;''Arguments''
# Off hand high damage (same as above)
 
# positive physical Bonus (should be >= 0)
:("unit")
# negative physical Bonus (should be <= 0)
:;unit : String - The [[API TYPE UnitId|UnitId]] to get information from. (Likely only works for <tt>"player"</tt> and <tt>"pet"</tt> -- unconfirmed)
# percentage modifier (usually 1)
----
;''Returns''
 
: lowDmg, hiDmg, offlowDmg, offhiDmg, posBuff, negBuff, percentmod
:;lowDmg : Number - The unit's minimum melee damage.
:;hiDmg : Number - The unit's maximum melee damage.
:;offlowDmg : Number - The unit's minimum offhand melee damage.
:;offhiDmg : Number - The unit's maximum offhand melee damage. (same as above)
:;posBuff : Number - positive physical Bonus (should be >= 0)
:;negBuff : Number - negative physical Bonus (should be <= 0)
:;percentmod : Number - percentage modifier (usually 1)

Revision as of 16:52, 29 May 2005

UnitDamage -Documentation by The_ED-

Unit damage returns information about your current damage stats. Doesn't seem to return usable values for mobs, NPCs, or other players. The method returns 7 values, only some of which appear to be useful.

lowDmg, hiDmg, offlowDmg, offhiDmg, posBuff, negBuff, percentmod = UnitDamage("unit");

Arguments
("unit")
unit
String - The UnitId to get information from. (Likely only works for "player" and "pet" -- unconfirmed)

Returns
lowDmg, hiDmg, offlowDmg, offhiDmg, posBuff, negBuff, percentmod
lowDmg
Number - The unit's minimum melee damage.
hiDmg
Number - The unit's maximum melee damage.
offlowDmg
Number - The unit's minimum offhand melee damage.
offhiDmg
Number - The unit's maximum offhand melee damage. (same as above)
posBuff
Number - positive physical Bonus (should be >= 0)
negBuff
Number - negative physical Bonus (should be <= 0)
percentmod
Number - percentage modifier (usually 1)