API UnitRangedAttackPower

From Wowpedia
Jump to: navigation, search

Returns the unit's ranged attack power and modifiers.

base, posBuff, negBuff = UnitRangedAttackPower("unit");

Parameters

Arguments

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

Returns

base 
Number - The unit's base ranged attack power (seems to give a positive number even if no ranged weapon equipped)
posBuff 
Number - The total effect of positive buffs to ranged attack power.
negBuff 
Number - The total effect of negative buffs to the ranged attack power (a negative number)

Example

local base, posBuff, negBuff = UnitRangedAttackPower("player");
local effective = base + posBuff + negBuff;
message("Your current ranged attack power: " .. effective);

Result

A message with your current ranged attack power is displayed.