WoW API < UnitAttackPower

Returns the unit's melee attack power and modifiers.

base, posBuff, negBuff = UnitAttackPower(unit);

Parameters[edit | edit source]

Arguments[edit | edit source]

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

Returns[edit | edit source]

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

Example[edit | edit source]

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

Result[edit | edit source]

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

Community content is available under CC-BY-SA unless otherwise noted.