View Single Post
08-03-14, 09:52 AM   #14
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
Originally Posted by syncrow View Post
For WoD, I plan to use the exp-bar otherwise at maxlvl.
Lua Code:
  1. --[[
  2. For finding the maximum attainable player level:
  3.     0: WoW Classic. Level 60
  4.     1: The Burning Cruade. Level 70
  5.     2: Wrath of the Lich King. Level 80
  6.     3: Cataclysm. Level 85
  7.     4: Mists of Pandaria. Level 90
  8.     5: Warlords of Draenor. Level 100
  9. --]]
  10. local maxPlayerLevel = MAX_PLAYER_LEVEL_TABLE[GetExpansionLevel()]
  11.  
  12. -- Check if player is already max level
  13. local displayXP = true
  14. if UnitLevel("player") == maxPlayerLevel then
  15.     displayXP = false
  16. end
  17.  
  18. -- Disable XP bar upon hitting max level
  19. local frame = CreateFrame("Frame")
  20. frame:RegisterEvent("PLAYER_LEVEL_UP")
  21. frame:SetScript("OnEvent", function(self, event, level)
  22.     if level == maxPlayerLevel then
  23.         displayXP = false
  24.     end
  25. end)

If I've misunderstood, please clarify.
  Reply With Quote