-- Areos WoW: make the XP bar work for levels 80-120. -- The stock 3.3.5a UI treats level 80 as the max and hides the XP bar. This tells -- the interface the cap is 120 (the Ascension cap) and force-refreshes the bar so it -- shows and fills all the way to 120. Leveling itself is server-driven; this is -- display only. At true max (120) the bar hides normally, as intended. local CAP = 120 -- Tell the default UI the level cap is 120 (drives the "am I max level?" checks -- that decide whether to show the XP bar). local function ApplyCap() MAX_PLAYER_LEVEL = CAP if type(MAX_PLAYER_LEVEL_TABLE) == "table" then local x = (GetExpansionLevel and GetExpansionLevel()) or 2 MAX_PLAYER_LEVEL_TABLE[x] = CAP MAX_PLAYER_LEVEL_TABLE[2] = CAP -- WotLK slot, belt-and-suspenders end end -- Force the XP bar visible and correctly filled below the cap, in case a build -- decides max via the C API (GetMaxPlayerLevel) instead of the Lua global. local function ForceBar() local lvl = UnitLevel("player") or 1 if lvl < CAP and MainMenuExpBar then local cur = UnitXP("player") or 0 local mx = UnitXPMax("player") or 0 if mx > 0 then MainMenuExpBar:SetMinMaxValues(0, mx) MainMenuExpBar:SetValue(cur) MainMenuExpBar:Show() end end end local f = CreateFrame("Frame") f:RegisterEvent("PLAYER_ENTERING_WORLD") f:RegisterEvent("PLAYER_LEVEL_UP") f:RegisterEvent("PLAYER_XP_UPDATE") f:RegisterEvent("UPDATE_EXHAUSTION") f:SetScript("OnEvent", function() ApplyCap() ForceBar() end) -- Re-assert right after Blizzard's own XP-bar update so we always win. if type(MainMenuExpBar_Update) == "function" then hooksecurefunc("MainMenuExpBar_Update", ForceBar) end ApplyCap()