API UnitEffectiveLevel

From Wowpedia
Jump to: navigation, search

Returns the unit's effective (scaled) level.

Parameters

Arguments

unit 
String - The unitId to get information from. (e.g. "player", "target")

Returns

level 
Number - The unit level. Returns -1 for bosses, or players more than 10 levels above the player

Sample usage:

 /run print("Level "..UnitLevel("target"));

If the current target is a Level 50 mob, this macro will print Level 50 in your chat window. If the unit's level is unknown, i.e. a Level ?? target, or is a special boss, UnitLevel() will return -1.

See also