WoW:API UnitLevel: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 12: Line 12:
--- tarp (first post, probably broke all the design rules :) )
--- tarp (first post, probably broke all the design rules :) )


== Details ==
: Note that the value returned by <tt>UnitLevel("player")</tt> will most likely be incorrect when called in a [[Events_P_(Party,_Petition,_Pet,_PlayerBank,_Player)#PLAYER_LEVEL_UP|PLAYER_LEVEL_UP]] event handler, or shortly after leveling in general. See [[Events_P_(Party,_Petition,_Pet,_PlayerBank,_Player)#PLAYER_LEVEL_UP|PLAYER_LEVEL_UP]] arg1 for the correct level.


 
----
(sorry for the bad format and all, but wanted to get something up)


[[Category:API Functions|UnitLevel]]
[[Category:API Functions|UnitLevel]]
[[Category:API Unit Functions|UnitLevel]]
[[Category:API Unit Functions|UnitLevel]]

Revision as of 11:58, 9 September 2005

Retrieves the unit's level. unit being target,party,pet etc.

EX:

 /script SendChatMessage("Level "..UnitLevel("target"));

will say, if you're targeting a lvl50: Level 50


As of some patch (1.5?) it will return -1 if the level is unknown (ie, you're too low to know it, or it's a special boss)
--- tarp (first post, probably broke all the design rules :) )

Details

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. See PLAYER_LEVEL_UP arg1 for the correct level.