Fandom

WoWWiki

API UnitAttackPower

104,635pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

WoW API < UnitAttackPower

Returns the unit's melee attack power and modifiers.

base, posBuff, negBuff = UnitAttackPower(unit);

ParametersEdit

ArgumentsEdit

unit 
UnitId - The unit to get information from. (Does not work for "target" - Possibly only "player" and "pet")

ReturnsEdit

base 
Number - The unit's base attack power
posBuff 
Number - The total effect of positive buffs to attack power.
negBuff 
Number - The total effect of negative buffs to the attack power (a negative number)

ExampleEdit

local base, posBuff, negBuff = UnitAttackPower("player");
local effective = base + posBuff + negBuff;
DEFAULT_CHAT_MESSAGE("Your current attack power: " .. effective);

ResultEdit

Displays the player's current attack power in the default chat window.

Also on Fandom

Random Wiki