Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

API UnitAttackPower

From Wowpedia
Jump to: navigation, search

Returns the unit's melee attack power and modifiers.

base, posBuff, negBuff = UnitAttackPower(unit);

Parameters

Arguments

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

Returns

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)

Example

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

Result

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