Returns the unit's level.
level = UnitLevel("unit")
- String - The unitId to get information from. (e.g. "player", "target")
- Number - The unit level. Returns -1 for bosses, or players more than 10 levels above the player
- Note that the value returned by
UnitLevel("player")will most likely be incorrect when called in a PLAYER_LEVEL_UP event handler, or shortly after leveling in general. Check the PLAYER_LEVEL_UP payload for the correct level.
- If the unit's level is unknown, i.e. a Level ?? target, or is a special boss,
UnitLevel()will return -1.