stoneharry

Untitled

Sep 16th, 2012
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 39.57 KB | None | 0 0
  1. LEVEL_UP_TYPE_CHARACTER = "character";  --Name used in globalstring LEVEL_UP
  2. LEVEL_UP_TYPE_GUILD = "guild";  --Name used in globalstring GUILD_LEVEL_UP
  3. LEVEL_UP_TYPE_PET = "pet" -- Name used in globalstring PET_LEVEL_UP
  4. LEVEL_UP_TYPE_SCENARIO = "scenario";
  5. TOAST_QUEST_BOSS_EMOTE = "questbossemote";
  6. TOAST_PET_BATTLE_WINNER = "petbattlewinner";
  7. TOAST_CHALLENGE_MODE_RECORD = "challengemode";
  8.  
  9. LEVEL_UP_FEATURE2 = "test";
  10. LEVEL_UP_SPECIALIZATION_LINK = " testing";
  11. LEVEL_UP_TALENTS_LINK = " testing2";
  12. LEVEL_UP_BG_LINK = " testing3";
  13. LEVEL_UP_LFD_LINK  = " testing4";
  14. LEVEL_UP_DUAL_SPEC_LINK = " testing5";
  15. LEVEL_UP_ABILITY2 = "Ability2 ";
  16. LEVEL_UP_YOU_REACHED = "Congratulations, you have reached"
  17.  
  18. scen_name, scen_currentStage, scen_numStages, scen_stageName, scen_stageDescription = "", 0, 0, "", "";
  19.  
  20. LEVEL_UP_EVENTS = {
  21. --  Level  = {unlock}
  22.     [10] = {"SpecializationUnlocked", "BGsUnlocked"},
  23.     [15] = {"TalentsUnlocked","LFDUnlocked"},
  24.     [25] = {"Glyphs"},
  25.     [30] = {"DualSpec"},
  26.     [50] = {"GlyphSlots"},
  27.     [70] = {"HeroicBurningCrusade"},
  28.     [75] = {"GlyphSlots"},
  29.     [80] = {"HeroicWrathOfTheLichKing"},
  30.     [85] = {"HeroicCataclysm"},
  31.     [90] = {"HeroicMistsOfPandaria"},
  32. }
  33.  
  34. SUBICON_TEXCOOR_BOOK    = {0.64257813, 0.72070313, 0.03710938, 0.11132813};
  35. SUBICON_TEXCOOR_LOCK    = {0.64257813, 0.70117188, 0.11523438, 0.18359375};
  36. SUBICON_TEXCOOR_ARROW   = {0.72460938, 0.78320313, 0.03710938, 0.10351563};
  37.  
  38. local levelUpTexCoords = {
  39.     [LEVEL_UP_TYPE_CHARACTER] = {
  40.         dot = { 0.64257813, 0.68359375, 0.18750000, 0.23046875 },
  41.         goldBG = { 0.56054688, 0.99609375, 0.24218750, 0.46679688 },
  42.         gLine = { 0.00195313, 0.81835938, 0.01953125, 0.03320313 },
  43.         gLineDelay = 1.5,
  44.     },
  45.     [LEVEL_UP_TYPE_GUILD] = {
  46.         dot = { 0.64257813, 0.68359375, 0.77734375, 0.8203125 },
  47.         goldBG = { 0.56054688, 0.99609375, 0.486328125, 0.7109375 },
  48.         gLine = { 0.00195313, 0.81835938, 0.96484375, 0.97851563 },
  49.         textTint = {0.11765, 1, 0},
  50.         gLineDelay = 1.5,
  51.     },
  52.     [LEVEL_UP_TYPE_PET] = {
  53.         dot = { 0.64257813, 0.68359375, 0.18750000, 0.23046875 },
  54.         goldBG = { 0.56054688, 0.99609375, 0.24218750, 0.46679688 },
  55.         gLine = { 0.00195313, 0.81835938, 0.01953125, 0.03320313 },
  56.         tint = {1, 0.5, 0.25},
  57.         textTint = {1, 0.7, 0.25},
  58.         gLineDelay = 1.5,
  59.     },
  60.     [TOAST_PET_BATTLE_WINNER] = {
  61.         gLine = { 0.00195313, 0.81835938, 0.01953125, 0.03320313 },
  62.         tint = {1, 0.5, 0.25},
  63.         textTint = {1, 0.7, 0.25},
  64.         gLineDelay = 1.5,
  65.     },
  66.     [LEVEL_UP_TYPE_SCENARIO] = {
  67.         gLine = { 0.00195313, 0.81835938, 0.00195313, 0.01562500 },
  68.         tint = {1, 0.996, 0.745},
  69.         gLineDelay = 0,
  70.     },
  71.     [TOAST_QUEST_BOSS_EMOTE] = {
  72.         gLine = { 0.00195313, 0.81835938, 0.01953125, 0.03320313 },
  73.         tint = {1, 0.996, 0.745},
  74.         textTint = {1, 0.7, 0.25},
  75.         gLineDelay = 0,
  76.     },
  77.     [TOAST_CHALLENGE_MODE_RECORD] = {
  78.         gLine = { 0.00195313, 0.81835938, 0.00195313, 0.01562500 },
  79.         tint = {0.777, 0.698, 0.451},
  80.         gLineDelay = 0,
  81.     }, 
  82. }
  83.  
  84. LEVEL_UP_TYPES = {
  85.     ["TalentPoint"]             =   {   icon="Interface\\Icons\\Ability_Marksmanship",
  86.                                         subIcon=SUBICON_TEXCOOR_ARROW,
  87.                                         text=LEVEL_UP_TALENT_MAIN,
  88.                                         subText=LEVEL_UP_TALENT_SUB,
  89.                                         link=LEVEL_UP_TALENTPOINT_LINK;
  90.                                     },
  91.    
  92.     ["PetTalentPoint"]          =   {   icon="Interface\\Icons\\Ability_Marksmanship",
  93.                                         subIcon=SUBICON_TEXCOOR_ARROW,
  94.                                         text=PET_LEVEL_UP_TALENT_MAIN,
  95.                                         subText=PET_LEVEL_UP_TALENT_SUB,
  96.                                         link=PET_LEVEL_UP_TALENTPOINT_LINK;
  97.                                     },
  98.                                    
  99.     ["SpecializationUnlocked"]  =   {   icon="Interface\\Icons\\Ability_Marksmanship",
  100.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  101.                                         text=SPECIALIZATION,
  102.                                         subText=LEVEL_UP_FEATURE,
  103.                                         link=LEVEL_UP_FEATURE2..LEVEL_UP_SPECIALIZATION_LINK
  104.                                     },
  105.                                    
  106.     ["TalentsUnlocked"]         =   {   icon="Interface\\Icons\\Ability_Marksmanship",
  107.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  108.                                         text=TALENT_POINTS,
  109.                                         subText=LEVEL_UP_FEATURE,
  110.                                         link=LEVEL_UP_FEATURE2..LEVEL_UP_TALENTS_LINK
  111.                                     },
  112.                                    
  113.     ["BGsUnlocked"]             =   {   icon="Interface\\Icons\\Ability_DualWield",
  114.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  115.                                         text=BATTLEFIELDS,
  116.                                         subText=LEVEL_UP_FEATURE,
  117.                                         link=LEVEL_UP_FEATURE2..LEVEL_UP_BG_LINK
  118.                                     },
  119.  
  120.     ["LFDUnlocked"]             =   {   icon="Interface\\Icons\\LevelUpIcon-LFD",
  121.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  122.                                         text=LOOKING_FOR_DUNGEON,
  123.                                         subText=LEVEL_UP_FEATURE,
  124.                                         link=LEVEL_UP_FEATURE2..LEVEL_UP_LFD_LINK
  125.                                     },
  126.  
  127.     ["Glyphs"]                  =   {   icon="Interface\\Icons\\Inv_inscription_tradeskill01",
  128.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  129.                                         text=GLYPHS,
  130.                                         subText=LEVEL_UP_FEATURE,
  131.                                         link=LEVEL_UP_GLYPHSLOT_LINK
  132.                                     },
  133.  
  134.     ["GlyphSlots"]              =   {   icon="Interface\\Icons\\Inv_inscription_tradeskill01",
  135.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  136.                                         text=GLYPH_SLOTS,
  137.                                         subText=LEVEL_UP_FEATURE,
  138.                                         link=LEVEL_UP_GLYPHSLOT_LINK
  139.                                     },
  140.  
  141.     ["DualSpec"]                =   {   icon="Interface\\Icons\\INV_Misc_Coin_01",
  142.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  143.                                         text=LEVEL_UP_DUALSPEC,
  144.                                         subText=LEVEL_UP_FEATURE,
  145.                                         link=LEVEL_UP_FEATURE2..LEVEL_UP_DUAL_SPEC_LINK
  146.                                     },
  147.  
  148.     ["HeroicBurningCrusade"]    =   {   entryType = "heroicdungeon",
  149.                                         tier = 2,
  150.                                         icon="Interface\\Icons\\ExpansionIcon_BurningCrusade",
  151.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  152.                                         text=EXPANSION_NAME1,
  153.                                         subText=LEVEL_UP_HEROIC,
  154.                                     },
  155.                                    
  156.     ["HeroicWrathOfTheLichKing"]=   {   entryType = "heroicdungeon",
  157.                                         tier = 3,
  158.                                         icon="Interface\\Icons\\ExpansionIcon_WrathoftheLichKing",
  159.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  160.                                         text=EXPANSION_NAME2,
  161.                                         subText=LEVEL_UP_HEROIC,
  162.                                     },
  163.                                    
  164.     ["HeroicCataclysm"]         =   {   entryType = "heroicdungeon",
  165.                                         tier = 4,
  166.                                         icon="Interface\\Icons\\ExpansionIcon_Cataclysm",
  167.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  168.                                         text=EXPANSION_NAME3,
  169.                                         subText=LEVEL_UP_HEROIC,
  170.                                     },
  171.                                    
  172.     ["HeroicMistsOfPandaria"]   =   {   entryType = "heroicdungeon",
  173.                                         tier = 5,
  174.                                         icon="Interface\\Icons\\ExpansionIcon_MistsofPandaria",
  175.                                         subIcon=SUBICON_TEXCOOR_LOCK,
  176.                                         text=EXPANSION_NAME4,
  177.                                         subText=LEVEL_UP_HEROIC
  178.                                     },
  179.                                    
  180. ------ HACKS BELOW     
  181.     ["Teleports"]           = { spellID=109424  },
  182.     ["PortalsHorde"]        = { spellID=109400  },
  183.     ["PortalsAlliance"]     = { spellID=109401  },
  184.                                    
  185.     ["LockMount1"]          = { spellID=5784    },
  186.     ["LockMount2"]          = { spellID=23161   },
  187.     ["PaliMount1"]          = { spellID=34769   },
  188.     ["PaliMount2"]          = { spellID=34767   },
  189.     ["PaliMountTauren1"]    = { spellID=69820   },
  190.     ["PaliMountTauren2"]    = { spellID=69826   },
  191.     ["PaliMountDraenei1"]   = { spellID=73629   },
  192.     ["PaliMountDraenei2"]   = { spellID=73630   },
  193.    
  194.     ["Plate"]               = { spellID=750, feature=true},
  195.     ["Mail"]                = { spellID=8737, feature=true  },
  196.    
  197.     ["TrackBeast"]          = { spellID=1494  },
  198.     ["TrackHumanoid"]       = { spellID=19883  },
  199.     ["TrackUndead"]         = { spellID=19884  },
  200.     ["TrackHidden"]         = { spellID=19885  },
  201.     ["TrackElemental"]      = { spellID=19880  },
  202.     ["TrackDemons"]         = { spellID=19878 },
  203.     ["TrackGiants"]         = { spellID=19882  },
  204.     ["TrackDragonkin"]      = { spellID=19879  },
  205. ------ END HACKS
  206. }
  207.  
  208.  
  209. LEVEL_UP_CLASS_HACKS = {
  210.    
  211.     ["MAGEHorde"]       = {
  212.                             --  Level  = {unlock}
  213.                                 [50] = {"Teleports"},
  214.                                 [50] = {"PortalsHorde"},
  215.                             },
  216.     ["MAGEAlliance"]    = {
  217.                             --  Level  = {unlock}
  218.                                 [50] = {"Teleports"},
  219.                                 [50] = {"PortalsAlliance"},
  220.                             },
  221.     ["WARLOCK"]         = {
  222.                             --  Level  = {unlock}
  223.                                 [50] = {"LockMount1"},
  224.                                 [50] = {"LockMount2"},
  225.                             },
  226.     ["SHAMAN"]      = {
  227.                             --  Level  = {unlock}
  228.                                 [50] = {"Mail"},
  229.                             },
  230.     ["HUNTER"]      = {
  231.                             --  Level  = {unlock}
  232.                                 [50] = {"TrackBeast"},
  233.                                 [50] = {"TrackHumanoid"},
  234.                                 [50] = {"TrackUndead"},
  235.                                 [50] = {"TrackHidden"},
  236.                                 [50] = {"TrackElemental"},
  237.                                 [50] = {"TrackDemons"},
  238.                                 [50] = {"Mail"},
  239.                                 [50] = {"TrackGiants"},
  240.                                 [50] = {"TrackDragonkin"},
  241.                             },
  242.     ["WARRIOR"]         = {
  243.                             --  Level  = {unlock}
  244.                                 [50] = {"Plate"},
  245.                             },
  246.     ["PALADIN"]         = {
  247.                             --  Level  = {unlock}
  248.                                 [50] = {"PaliMount1"},
  249.                                 [50] = {"PaliMount2", "Plate"},
  250.                             },
  251.     ["PALADINTauren"]   = {
  252.                             --  Level  = {unlock}
  253.                                 [50] = {"PaliMountTauren1"},
  254.                                 [50] = {"PaliMountTauren2", "Plate"},
  255.                             }, 
  256.     ["PALADINDraenei"]  = {
  257.                             --  Level  = {unlock}
  258.                                 [50] = {"PaliMountDraenei1"},
  259.                                 [50] = {"PaliMountDraenei2", "Plate"},
  260.                             }, 
  261. }
  262.  
  263. LEVEL_UP_TRAP_LEVELS = {427, 77, 135}
  264.  
  265. function LevelUpDisplay_OnLoad(self)
  266.     self:RegisterEvent("PLAYER_LEVEL_UP");
  267.     self:RegisterEvent("CHAT_MSG_SYSTEM");
  268.     --[[self:RegisterEvent("UNIT_GUILD_LEVEL");
  269.     self:RegisterEvent("UNIT_LEVEL");
  270.     self:RegisterEvent("SCENARIO_UPDATE");
  271.     self:RegisterEvent("PET_BATTLE_FINAL_ROUND"); -- display winner, start listening for additional results
  272.     self:RegisterEvent("PET_BATTLE_CLOSE");        -- stop listening for additional results
  273.     self:RegisterEvent("QUEST_BOSS_EMOTE");
  274.     self:RegisterEvent("CHALLENGE_MODE_NEW_RECORD");
  275.     self:RegisterEvent("PET_JOURNAL_TRAP_LEVEL_SET");]]
  276.     self.currSpell = 0;
  277.  
  278. end
  279.  
  280. function scen_split(str)
  281.     local b = {}
  282.     local c = 1
  283.     local d = {}
  284.     string.gsub(str, "[%w%s-]", function(a)
  285.         if (a == "-") then
  286.             c = c + 1
  287.         else
  288.             if (not b[c]) then
  289.                 b[c] = {}
  290.             end
  291.             table.insert(b[c], a)
  292.         end
  293.     end)
  294.     for k, v in pairs (b) do
  295.         table.insert(d, table.concat(v))
  296.     end
  297.     return d
  298. end
  299.  
  300. function LevelUpDisplay_OnEvent(self, event, ...)
  301.     local arg1 = ...;
  302.     if event ==  "PLAYER_LEVEL_UP" then
  303.         local level = ...
  304.         self.level = level;
  305.         self.type = LEVEL_UP_TYPE_CHARACTER;
  306.         self:Show();
  307.         LevelUpDisplaySide:Hide();
  308.     elseif event == "CHAT_MSG_SYSTEM" then
  309.         local messageGot = arg1;
  310.         if string.find(messageGot, "CHAOTIC:SCENARIO", 1, true) ~= nil then
  311.             local i = 0;
  312.             local scen_table = scen_split(messageGot)
  313.             for k,token in pairs(scen_table) do
  314.                 if i == 1 then
  315.                     scen_name = token;
  316.                 elseif i == 2 then
  317.                     scen_currentStage = tonumber(token);
  318.                 elseif i == 3 then
  319.                     scen_numStages = tonumber(token);
  320.                 elseif i == 4 then
  321.                     scen_stageName = token;
  322.                 elseif i == 5 then
  323.                     scen_stageDescription = token;
  324.                 end
  325.                 i = i + 1;
  326.             end
  327.             self.type = LEVEL_UP_TYPE_SCENARIO;
  328.             self:Show();
  329.         end
  330.         -- CHAOTIC:SCENARIO-name-0-0-name-description
  331.        
  332.     --[[elseif event == "UNIT_GUILD_LEVEL" then
  333.         local unit, level = ...;
  334.         if ( unit == "player" ) then
  335.             self.level = level;
  336.             self.type = LEVEL_UP_TYPE_GUILD;
  337.             self:Show();
  338.             LevelUpDisplaySide:Hide();
  339.         end
  340.     elseif event == "UNIT_LEVEL" and arg1 == "pet" then
  341.         if (UnitName("pet") ~= UNKNOWNOBJECT) then
  342.             self.level = UnitLevel("pet");
  343.             self.type = LEVEL_UP_TYPE_PET;
  344.             self:Show();
  345.             LevelUpDisplaySide:Hide();
  346.         end
  347.     elseif ( event == "SCENARIO_UPDATE" ) then
  348.         if ( arg1 and not C_Scenario.IsChallengeMode() ) then
  349.             self.type = LEVEL_UP_TYPE_SCENARIO;
  350.             self:Show();
  351.         end
  352.     elseif ( event == "ZONE_CHANGED_NEW_AREA" ) then
  353.         self:UnregisterEvent("ZONE_CHANGED_NEW_AREA");
  354.         LevelUpDisplay_OnShow(self);
  355.     elseif ( event == "PET_BATTLE_CLOSE" ) then
  356.         self:UnregisterEvent("PET_BATTLE_LEVEL_CHANGED");
  357.         self:UnregisterEvent("PET_BATTLE_CAPTURED");
  358.     elseif ( event == "PET_BATTLE_FINAL_ROUND" ) then
  359.         self:RegisterEvent("PET_BATTLE_LEVEL_CHANGED");
  360.         self:RegisterEvent("PET_BATTLE_CAPTURED");
  361.         self.type = TOAST_PET_BATTLE_WINNER;
  362.         self.winner = arg1;
  363.         self:Show();
  364.     elseif ( event == "PET_JOURNAL_TRAP_LEVEL_SET" ) then
  365.         local trapLevel = ...;
  366.         if (trapLevel >= 1 and trapLevel <= #LEVEL_UP_TRAP_LEVELS) then
  367.             LevelUpDisplay_AddBattlePetTrapUpgradeEvent(self, trapLevel);
  368.         end
  369.     elseif ( event == "PET_BATTLE_LEVEL_CHANGED" ) then
  370.         local activePlayer, activePetSlot, newLevel = ...;
  371.         if (activePlayer == LE_BATTLE_PET_ALLY) then
  372.             LevelUpDisplay_AddBattlePetLevelUpEvent(self, activePlayer, activePetSlot, newLevel);
  373.         end
  374.     elseif ( event == "PET_BATTLE_CAPTURED" ) then
  375.         local fromPlayer, activePetSlot = ...;
  376.         if (fromPlayer == 2) then
  377.             LevelUpDisplay_AddBattlePetCaptureEvent(self, fromPlayer, activePetSlot);
  378.         end
  379.     elseif ( event == "QUEST_BOSS_EMOTE" ) then
  380.         local str, name, displayTime, warningSound = ...;
  381.         self.type = TOAST_QUEST_BOSS_EMOTE;
  382.         self.bossText = format(str, name, name);
  383.         self.time = displayTime;
  384.         self.sound = warningSound;
  385.         self:Show();
  386.     elseif ( event == "CHALLENGE_MODE_NEW_RECORD" ) then
  387.         local mapID, recordTime, medal = ...;
  388.         self.type = TOAST_CHALLENGE_MODE_RECORD;
  389.         self.mapID = mapID;
  390.         self.recordTime = recordTime;
  391.         self.medal = medal;
  392.         self:Show();]]
  393.     end
  394. end
  395.  
  396. function LevelUpDisplay_BuildCharacterList(self)
  397.     local name, icon = "","";
  398.     self.unlockList = {};
  399.  
  400.     if LEVEL_UP_EVENTS[self.level] then
  401.         for _, unlockType in pairs(LEVEL_UP_EVENTS[self.level]) do
  402.             self.unlockList[#self.unlockList +1] = LEVEL_UP_TYPES[unlockType];
  403.         end
  404.     end
  405.    
  406.     local spells = getPlayerSpellsForClass(self.level);
  407.     for _,spell in pairs(spells) do    
  408.         name, _, icon = GetSpellInfo(spell);
  409.         self.unlockList[#self.unlockList +1] = { entryType = "spell", text = name, subText = LEVEL_UP_ABILITY, icon = icon, subIcon = SUBICON_TEXCOOR_BOOK,
  410.                                                                 link=LEVEL_UP_ABILITY2.." "..GetSpellLink(spell)
  411.                                                             };
  412.     end
  413.    
  414.     local GUILD_EVENT_TEXTURE_PATH = "Interface\\LFGFrame\\LFGIcon-";
  415.     local dungeons = {};
  416.     for _,dungeon in pairs(dungeons) do
  417.         name, icon, link = GetDungeonInfo(dungeon);
  418.         if link then -- link can come back as nil if there's no Dungeon Journal entry
  419.             self.unlockList[#self.unlockList +1] = { entryType = "dungeon", text = name, subText = LEVEL_UP_DUNGEON, icon = GUILD_EVENT_TEXTURE_PATH..icon, subIcon = SUBICON_TEXCOOR_LOCK,
  420.                                                                         link = LEVEL_UP_DUNGEON2.." "..link
  421.                                                                     };
  422.         else
  423.             self.unlockList[#self.unlockList +1] = { entryType = "dungeon", text = name, subText = LEVEL_UP_DUNGEON, icon = GUILD_EVENT_TEXTURE_PATH..icon, subIcon = SUBICON_TEXCOOR_LOCK,
  424.                                                                         link = LEVEL_UP_DUNGEON2.." "..name
  425.                                                                     };
  426.         end
  427.     end
  428.    
  429.     local raids = {};
  430.     for _,raid in pairs(raids) do
  431.         name, icon, link = GetDungeonInfo(raid);
  432.         if link then -- link can come back as nil if there's no Dungeon Journal entry
  433.             self.unlockList[#self.unlockList +1] = { entryType = "dungeon", text = name, subText = LEVEL_UP_RAID, icon = GUILD_EVENT_TEXTURE_PATH..icon, subIcon = SUBICON_TEXCOOR_LOCK,
  434.                                                                         link = LEVEL_UP_RAID2.." "..link
  435.                                                                     };
  436.         else
  437.             self.unlockList[#self.unlockList +1] = { entryType = "dungeon", text = name, subText = LEVEL_UP_RAID, icon = GUILD_EVENT_TEXTURE_PATH..icon, subIcon = SUBICON_TEXCOOR_LOCK,
  438.                                                                         link = LEVEL_UP_RAID2.." "..name
  439.                                                                     };
  440.         end
  441.     end
  442.  
  443.  
  444.     -- This loop is LEVEL_UP_CLASS_HACKS
  445.     local race, raceFile = UnitRace("player");
  446.     local _, class = UnitClass("player");
  447.     local factionName = UnitFactionGroup("player");
  448.     local hackTable = LEVEL_UP_CLASS_HACKS[class..raceFile] or LEVEL_UP_CLASS_HACKS[class..factionName] or LEVEL_UP_CLASS_HACKS[class];
  449.     if  hackTable and hackTable[self.level] then
  450.         hackTable = hackTable[self.level];
  451.         for _,spelltype in pairs(hackTable) do
  452.             if LEVEL_UP_TYPES[spelltype] and LEVEL_UP_TYPES[spelltype].spellID then
  453.                 if LEVEL_UP_TYPES[spelltype].feature then
  454.                     name, _, icon = GetSpellInfo(LEVEL_UP_TYPES[spelltype].spellID);
  455.                     self.unlockList[#self.unlockList +1] = { text = name, subText = LEVEL_UP_FEATURE, icon = icon, subIcon = SUBICON_TEXCOOR_LOCK,
  456.                                                                             link=LEVEL_UP_FEATURE2.." "..GetSpellLink(LEVEL_UP_TYPES[spelltype].spellID)
  457.                                                                         };
  458.                 else
  459.                     name, _, icon = GetSpellInfo(LEVEL_UP_TYPES[spelltype].spellID);
  460.                     self.unlockList[#self.unlockList +1] = { text = name, subText = LEVEL_UP_ABILITY, icon = icon, subIcon = SUBICON_TEXCOOR_BOOK,
  461.                                                                             link=LEVEL_UP_ABILITY2.." "..GetSpellLink(LEVEL_UP_TYPES[spelltype].spellID)
  462.                                                                         };
  463.                 end
  464.             end
  465.         end
  466.     end
  467.    
  468.    
  469.     local features = {};
  470.     for _,feature in pairs(features) do    
  471.         name, _, icon = GetSpellInfo(feature);
  472.         self.unlockList[#self.unlockList +1] = { entryType = "spell", text = name, subText = LEVEL_UP_FEATURE, icon = icon, subIcon = SUBICON_TEXCOOR_LOCK,
  473.                                                                 link=LEVEL_UP_FEATURE2.." "..GetSpellLink(feature)
  474.                                                             };
  475.     end
  476.    
  477.     self.currSpell = 1;
  478. end
  479.  
  480. function LevelUpDisplay_BuildPetList(self)
  481.     local name, icon = "","";
  482.     self.unlockList = {};
  483.  
  484.     -- TODO: Pet Spells
  485.    
  486.     self.currSpell = 1;
  487. end
  488.  
  489. function LevelUpDisplay_BuildBattlePetList(self)
  490.     self.unlockList = {};
  491.    
  492.     -- TODO: Battle Pet spell slots & spells
  493.    
  494.     self.currSpell = 1;
  495. end
  496.  
  497. function LevelUpDisplay_BuildEmptyList(self)
  498.     self.unlockList = {};
  499.     self.currSpell = 1;
  500. end
  501.  
  502. function LevelUpDisplay_BuildGuildList(self)
  503.     self.unlockList = {};
  504.    
  505.     for i=1, GetNumGuildPerks() do
  506.         local name, spellID, iconTexture, level = GetGuildPerkInfo(i);
  507.         if ( level == self.level ) then
  508.             tinsert(self.unlockList, { text = name, subText = GUILD_LEVEL_UP_PERK, icon = iconTexture, subIcon = SUBICON_TEXCOOR_LOCK,
  509.                                                 link = GUILD_LEVEL_UP_PERK2.." "..GetSpellLink(spellID)
  510.                                             });
  511.         end
  512.     end
  513.    
  514.     self.currSpell = 1;
  515. end
  516.  
  517. function LevelUpDisplay_BuildPetBattleWinnerList(self)
  518.     self.unlockList = {};
  519.     self.winnerString = PET_BATTLE_RESULT_LOSE;
  520.     self.winnerSoundKitID = 31750; -- UI_PetBattle_Defeat
  521.     if ( self.winner == LE_BATTLE_PET_ALLY ) then
  522.         self.winnerString = PET_BATTLE_RESULT_WIN;
  523.         self.winnerSoundKitID = 31749; -- UI_PetBattle_Victory
  524.     end;
  525.     self.currSpell = 1;
  526. end
  527.  
  528. function LevelUpDisplay_AddBattlePetTrapUpgradeEvent(self, trapLevel)
  529.     if ( trapLevel < 1 or trapLevel > #LEVEL_UP_TRAP_LEVELS ) then
  530.         return;
  531.     end
  532.  
  533.     local name, icon, typeEnum = C_PetJournal.GetPetAbilityInfo(LEVEL_UP_TRAP_LEVELS[trapLevel]);
  534.  
  535.     if (name and self.unlockList) then
  536.         table.insert(self.unlockList,
  537.             {
  538.             entryType = "spell",
  539.             text = name,
  540.             subText = PET_BATTLE_TRAP_UPGRADE,
  541.             icon = icon,
  542.             subIcon = nil
  543.             });
  544.     end
  545. end
  546.  
  547. function LevelUpDisplay_AddBattlePetLevelUpEvent(self, activePlayer, activePetSlot, newLevel)
  548.     if (self.currSpell == 0 or self.type ~= TOAST_PET_BATTLE_WINNER) then
  549.         return;
  550.     end
  551.  
  552.     if (activePlayer ~= LE_BATTLE_PET_ALLY) then
  553.         return;
  554.     end
  555.  
  556.     local petID = C_PetJournal.GetPetLoadOutInfo(activePetSlot);
  557.     if (not petID) then
  558.         return;
  559.     end
  560.    
  561.     local speciesID, customName, petLevel, xp, maxXp, displayID, name, petIcon = C_PetJournal.GetPetInfoByPetID(petID);
  562.     if (not speciesID) then
  563.         return;
  564.     end
  565.    
  566.     table.insert(self.unlockList,
  567.         {
  568.         entryType = "petlevelup",
  569.         text = format(PET_LEVEL_UP_REACHED, customName or name),
  570.         subText = format(LEVEL_GAINED,newLevel),
  571.         icon = petIcon,
  572.         subIcon = SUBICON_TEXCOOR_ARROW,
  573.         });
  574.     local abilityID = PetBattleFrame_GetAbilityAtLevel(speciesID, newLevel);
  575.     if (abilityID) then
  576.         local abName, abIcon = C_PetJournal.GetPetAbilityInfo(abilityID);
  577.         table.insert(self.unlockList,
  578.             {
  579.             entryType = "spell",
  580.             text = abName,
  581.             subText = LEVEL_UP_ABILITY,
  582.             icon = abIcon,
  583.             subIcon = nil,
  584.             });
  585.     end
  586. end
  587.  
  588. function LevelUpDisplay_AddBattlePetCaptureEvent(self, fromPlayer, activePetSlot)
  589.     if (self.currSpell == 0 or self.type ~= TOAST_PET_BATTLE_WINNER) then
  590.         return;
  591.     end
  592.    
  593.     if (fromPlayer ~= LE_BATTLE_PET_ENEMY) then
  594.         return;
  595.     end
  596.  
  597.     local petName = C_PetBattles.GetName(fromPlayer, activePetSlot);
  598.     local petIcon = C_PetBattles.GetIcon(fromPlayer, activePetSlot);
  599.     local quality = C_PetBattles.GetBreedQuality(fromPlayer, activePetSlot);
  600.    
  601.     table.insert(self.unlockList,
  602.         {
  603.         entryType = "petcapture",
  604.         text = BATTLE_PET_CAPTURED,
  605.         subText = petName,
  606.         icon = petIcon,
  607.         quality = quality
  608.         });
  609.  
  610. end
  611.  
  612. function LevelUpDisplay_OnShow(self)
  613.     --if ( not IsPlayerInWorld() ) then
  614.         -- this is pretty much the zoning-into-a-scenario case
  615.     --  self:RegisterEvent("ZONE_CHANGED_NEW_AREA");
  616.     --  return;
  617.     --end
  618.    
  619.     local playAnim;
  620.     if  self.currSpell == 0 then
  621.         if ( self.type == LEVEL_UP_TYPE_SCENARIO ) then
  622.             if ( scen_currentStage > 0 and scen_currentStage <= scen_numStages ) then
  623.                 if ( scen_currentStage == numStages ) then
  624.                     self.scenarioFrame.level:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  625.                     self.scenarioFrame.level:SetText(scen_stageName);
  626.                 else
  627.                     self.scenarioFrame.level:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  628.                     self.scenarioFrame.level:SetFormattedText(scen_name, scen_currentStage);
  629.                 end
  630.                 self.scenarioFrame.name:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  631.                 self.scenarioFrame.name:SetText(scen_stageName);
  632.                 self.scenarioFrame.description:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  633.                 self.scenarioFrame.description:SetText(scen_stageDescription);
  634.                 LevelUpDisplay:SetPoint("TOP", 0, -250);
  635.                 playAnim = self.scenarioFrame.newStage;
  636.             end
  637.         elseif ( self.type == TOAST_CHALLENGE_MODE_RECORD ) then
  638.             local medal = self.medal;
  639.             if ( CHALLENGE_MEDAL_TEXTURES[medal] ) then
  640.                 self.challengeModeFrame.MedalEarned:SetText(_G["CHALLENGE_MODE_MEDALNAME"..medal]);
  641.                 self.challengeModeFrame.RecordTime:SetFormattedText(CHALLENGE_MODE_NEW_BEST, GetTimeStringFromSeconds(self.recordTime / 1000));
  642.                 self.challengeModeBits.MedalFlare:Show();
  643.                 self.challengeModeBits.MedalIcon:SetTexture(CHALLENGE_MEDAL_TEXTURES[medal]);
  644.                 self.challengeModeBits.MedalIcon:Show();
  645.                 self.challengeModeBits.BottomFiligree:Show();
  646.             else
  647.                 -- no medal earned, still a record time for player
  648.                 self.challengeModeFrame.MedalEarned:SetText(CHALLENGE_MODE_NEW_RECORD);
  649.                 self.challengeModeFrame.RecordTime:SetText(GetTimeStringFromSeconds(self.recordTime / 1000));
  650.                 self.challengeModeBits.MedalFlare:Hide();
  651.                 self.challengeModeBits.MedalIcon:Hide();
  652.                 self.challengeModeBits.BottomFiligree:Hide();
  653.             end
  654.             LevelUpDisplay:SetPoint("TOP", 0, -190);
  655.             playAnim = self.challengeModeFrame.challengeComplete;
  656.         else
  657.             LevelUpDisplay:SetPoint("TOP", 0, -190);
  658.             playAnim = self.levelFrame.levelUp;
  659.             self.levelFrame.reachedText:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  660.             self.levelFrame.reachedText:SetText("");
  661.             self.levelFrame.levelText:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  662.             self.levelFrame.levelText:SetText("");
  663.             self.levelFrame.singleline:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  664.             self.levelFrame.singleline:SetText("");
  665.             self.levelFrame.blockText:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  666.             self.levelFrame.blockText:SetText("");
  667.             if ( self.type == LEVEL_UP_TYPE_CHARACTER ) then
  668.                 LevelUpDisplay_BuildCharacterList(self);
  669.                 self.levelFrame.reachedText:SetText(LEVEL_UP_YOU_REACHED)
  670.                 self.levelFrame.levelText:SetFormattedText(LEVEL_GAINED,self.level);
  671.             elseif ( self.type == LEVEL_UP_TYPE_PET ) then
  672.                 LevelUpDisplay_BuildPetList(self);
  673.                 local petName = UnitName("pet");
  674.                 self.levelFrame.reachedText:SetFormattedText(PET_LEVEL_UP_REACHED, petName or "");
  675.                 self.levelFrame.levelText:SetFormattedText(LEVEL_GAINED,self.level);
  676.             elseif ( self.type == LEVEL_UP_TYPE_GUILD ) then
  677.                 LevelUpDisplay_BuildGuildList(self);
  678.                 local guildName = GetGuildInfo("player");
  679.                 self.levelFrame.reachedText:SetFormattedText(GUILD_LEVEL_UP_YOU_REACHED, guildName);
  680.                 self.levelFrame.levelText:SetFormattedText(LEVEL_GAINED,self.level);
  681.             elseif ( self.type == TOAST_PET_BATTLE_WINNER ) then
  682.                 LevelUpDisplay_BuildPetBattleWinnerList(self);
  683.                 self.levelFrame.singleline:SetText(self.winnerString);
  684.                 PlaySoundKitID(self.winnerSoundKitID);
  685.                 playAnim = self.levelFrame.fastReveal;
  686.             elseif (self.type == TOAST_QUEST_BOSS_EMOTE ) then
  687.                 LevelUpDisplay_BuildEmptyList(self);
  688.                 self.levelFrame.blockText:SetText(self.bossText);
  689.                 if (self.sound and self.sound == true) then
  690.                     PlaySound("RaidBossEmoteWarning");
  691.                 end
  692.                 playAnim = self.levelFrame.fastReveal;
  693.             end
  694.         end
  695.  
  696.         if ( playAnim ) then
  697.             self.gLine:SetTexCoord(unpack(levelUpTexCoords[self.type].gLine));
  698.             self.gLine2:SetTexCoord(unpack(levelUpTexCoords[self.type].gLine));
  699.             if (levelUpTexCoords[self.type].tint) then
  700.                 self.gLine:SetVertexColor(unpack(levelUpTexCoords[self.type].tint));
  701.                 self.gLine2:SetVertexColor(unpack(levelUpTexCoords[self.type].tint));
  702.             else
  703.                 self.gLine:SetVertexColor(1, 1, 1);
  704.                 self.gLine2:SetVertexColor(1, 1, 1);
  705.             end
  706.             if (levelUpTexCoords[self.type].textTint) then
  707.                 self.levelFrame.levelText:SetTextColor(unpack(levelUpTexCoords[self.type].textTint));
  708.             else
  709.                 self.levelFrame.levelText:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
  710.             end
  711.             self.gLine.grow.anim1:SetStartDelay(levelUpTexCoords[self.type].gLineDelay);
  712.             self.gLine2.grow.anim1:SetStartDelay(levelUpTexCoords[self.type].gLineDelay);
  713.             self.blackBg.grow.anim1:SetStartDelay(levelUpTexCoords[self.type].gLineDelay);
  714.             playAnim:Play();
  715.             if (levelUpTexCoords[self.type].subIcon) then
  716.                 self.battlePetLevelFrame.subIcon:SetTexCoord(unpack(levelUpTexCoords[self.type].subIcon));
  717.             end
  718.         else
  719.             self:Hide();
  720.         end
  721.     end
  722. end
  723.  
  724.  
  725. function LevelUpDisplay_AnimStep(self, fast)
  726.     if self.currSpell > #self.unlockList then
  727.         LevelUpDisplay_AnimOut(self, fast);
  728.     else
  729.         local spellInfo = self.unlockList[self.currSpell];
  730.         self.currSpell = self.currSpell+1;
  731.  
  732.         self.spellFrame.name:SetText("");
  733.         self.spellFrame.flavorText:SetText("");
  734.         self.spellFrame.upperwhite:SetText("");
  735.         self.spellFrame.bottomGiant:SetFont("Fonts\\MORPHEUS.ttf", 80, "OUTLINE")
  736.         self.spellFrame.bottomGiant:SetText("");
  737.         self.spellFrame.subIcon:Hide();
  738.         self.spellFrame.subIconRight:Hide();
  739.         self.spellFrame.rarityUpperwhite:SetText("");
  740.         self.spellFrame.rarityMiddleHuge:SetText("");
  741.         self.spellFrame.rarityIcon:Hide();
  742.         self.spellFrame.rarityValue:SetText("");
  743.         self.spellFrame.rarityValue:Hide();
  744.        
  745.         if (not spellInfo.entryType or
  746.             spellInfo.entryType == "spell" or
  747.             spellInfo.entryType == "dungeon" or
  748.             spellInfo.entryType == "heroicdungeon") then
  749.             self.spellFrame.name:SetText(spellInfo.text);
  750.             self.spellFrame.flavorText:SetText(spellInfo.subText);
  751.             self.spellFrame.icon:SetTexture(spellInfo.icon);
  752.             if (spellInfo.subIcon) then
  753.                 self.spellFrame.subIcon:Show();
  754.                 self.spellFrame.subIcon:SetTexCoord(unpack(spellInfo.subIcon));
  755.             end
  756.             self.spellFrame.showAnim:Play();
  757.         elseif (spellInfo.entryType == "petlevelup") then
  758.             if (spellInfo.subIcon) then
  759.                 self.spellFrame.subIconRight:Show();
  760.                 self.spellFrame.subIconRight:SetTexCoord(unpack(spellInfo.subIcon));
  761.             end
  762.             self.spellFrame.icon:SetTexture(spellInfo.icon);
  763.             self.spellFrame.upperwhite:SetText(spellInfo.text);
  764.             self.spellFrame.bottomGiant:SetText(spellInfo.subText);
  765.             self.spellFrame.showAnim:Play();
  766.         elseif (spellInfo.entryType == "petcapture") then
  767.             self.spellFrame.icon:SetTexture(spellInfo.icon);
  768.             self.spellFrame.rarityUpperwhite:SetText(spellInfo.text);
  769.             self.spellFrame.rarityMiddleHuge:SetText(spellInfo.subText);
  770.             if (spellInfo.quality) then
  771.                 self.spellFrame.iconBorder:Show();
  772.                 self.spellFrame.iconBorder:SetVertexColor(ITEM_QUALITY_COLORS[spellInfo.quality-1].r, ITEM_QUALITY_COLORS[spellInfo.quality-1].g, ITEM_QUALITY_COLORS[spellInfo.quality-1].b);
  773.                 self.spellFrame.rarityIcon:Show();
  774.                 self.spellFrame.rarityValue:SetText(_G["BATTLE_PET_BREED_QUALITY"..spellInfo.quality]);
  775.                 self.spellFrame.rarityValue:SetTextColor(ITEM_QUALITY_COLORS[spellInfo.quality-1].r, ITEM_QUALITY_COLORS[spellInfo.quality-1].g, ITEM_QUALITY_COLORS[spellInfo.quality-1].b);
  776.                 self.spellFrame.rarityValue:Show();
  777.             end
  778.             self.spellFrame.showAnim:Play();
  779.         end
  780.     end
  781. end
  782.  
  783. function LevelUpDisplay_AnimOut(self, fast)
  784.     self = self or LevelUpDisplay;
  785.     self.currSpell = 0;
  786.     if (fast) then
  787.         self.fastHideAnim:Play();
  788.     else
  789.         self.hideAnim:Play();
  790.     end
  791. end
  792.  
  793. --Side display Functions
  794.  
  795. function LevelUpDisplay_ShowSideDisplay(level, levelUpType, arg1)
  796.     if LevelUpDisplaySide.level and LevelUpDisplaySide.level == level and LevelUpDisplaySide.type == levelUpType and LevelUpDisplaySide.arg1 == arg1 then
  797.         if LevelUpDisplaySide:IsVisible() then     
  798.             LevelUpDisplaySide:Hide(); 
  799.         else   
  800.             LevelUpDisplaySide:Show();
  801.         end
  802.     else
  803.         LevelUpDisplaySide.level = level;
  804.         LevelUpDisplaySide.type = levelUpType;
  805.         LevelUpDisplaySide.arg1 = arg1;
  806.         LevelUpDisplaySide:Hide();
  807.         LevelUpDisplaySide:Show();
  808.     end
  809. end
  810.  
  811.  
  812. function LevelUpDisplaySide_OnShow(self)
  813.     if ( self.type == LEVEL_UP_TYPE_CHARACTER ) then
  814.         LevelUpDisplay_BuildCharacterList(self);
  815.         self.reachedText:SetText(LEVEL_UP_YOU_REACHED);
  816.         self.levelText:SetFormattedText(LEVEL_GAINED,self.level);
  817.     elseif ( self.type == LEVEL_UP_TYPE_PET ) then
  818.         LevelUpDisplay_BuildPetList(self);
  819.         local petName = self.arg1;
  820.         self.reachedText:SetFormattedText(PET_LEVEL_UP_REACHED, petName);
  821.         self.levelText:SetFormattedText(LEVEL_GAINED,self.level);
  822.     elseif ( self.type == LEVEL_UP_TYPE_GUILD ) then
  823.         LevelUpDisplay_BuildGuildList(self);
  824.         local guildName = GetGuildInfo("player");
  825.         self.reachedText:SetFormattedText(GUILD_LEVEL_UP_YOU_REACHED, guildName);
  826.         self.levelText:SetFormattedText(LEVEL_GAINED,self.level);
  827.     end
  828.     self.goldBG:SetTexCoord(unpack(levelUpTexCoords[self.type].goldBG));
  829.     self.dot:SetTexCoord(unpack(levelUpTexCoords[self.type].dot));
  830.    
  831.     if (levelUpTexCoords[self.type].tint) then
  832.         self.goldBG:SetVertexColor(unpack(levelUpTexCoords[self.type].tint));
  833.         self.dot:SetVertexColor(unpack(levelUpTexCoords[self.type].tint));
  834.     else
  835.         self.goldBG:SetVertexColor(1, 1, 1);
  836.         self.dot:SetVertexColor(1, 1, 1);
  837.     end
  838.    
  839.     if (levelUpTexCoords[self.type].textTint) then
  840.         self.levelText:SetTextColor(unpack(levelUpTexCoords[self.type].textTint));
  841.     else
  842.         self.levelText:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
  843.     end
  844.    
  845.     local i = 1;
  846.     local displayFrame = _G["LevelUpDisplaySideUnlockFrame1"];
  847.     while i <=  #self.unlockList do
  848.         if not displayFrame then -- make frames as needed
  849.             displayFrame = CreateFrame("FRAME", "LevelUpDisplaySideUnlockFrame"..i, LevelUpDisplaySide, "LevelUpSkillTemplate");
  850.             displayFrame:SetPoint("TOP",  _G["LevelUpDisplaySideUnlockFrame"..(i-1)], "BOTTOM", 0, -1);
  851.             displayFrame:SetAlpha(0.0);
  852.         end
  853.         i = i+1;       
  854.         displayFrame = _G["LevelUpDisplaySideUnlockFrame"..i];
  855.     end
  856.     self:SetHeight(65);
  857.     self.fadeIn:Play();
  858. end
  859.  
  860. function LevelUpDisplaySide_OnHide(self)
  861.     local displayFrame = _G["LevelUpDisplaySideUnlockFrame1"];
  862.     local i = 1;
  863.     while displayFrame do  
  864.         if displayFrame.sideAnimIn:IsPlaying() then
  865.             displayFrame.sideAnimIn:Stop();
  866.         end            
  867.         displayFrame:SetAlpha(0.0);
  868.         i = i+1;
  869.         displayFrame = _G["LevelUpDisplaySideUnlockFrame"..i];
  870.     end
  871. end
  872.  
  873.  
  874. function LevelUpDisplaySide_AnimStep(self)
  875.  
  876.     if self.currSpell > 1 then
  877.         _G["LevelUpDisplaySideUnlockFrame"..(self.currSpell-1)]:SetAlpha(1.0);
  878.     end
  879.  
  880.     if self.currSpell <= #self.unlockList then
  881.         local spellInfo = self.unlockList[self.currSpell];
  882.         local displayFrame = _G["LevelUpDisplaySideUnlockFrame"..self.currSpell];
  883.         displayFrame.name:SetText(spellInfo.text);
  884.         displayFrame.flavorText:SetText(spellInfo.subText);
  885.         displayFrame.icon:SetTexture(spellInfo.icon);
  886.         displayFrame.subIcon:SetTexCoord(unpack(spellInfo.subIcon));
  887.         displayFrame.subIconRight:Hide();
  888.         displayFrame.sideAnimIn:Play();
  889.         self.currSpell = self.currSpell+1;
  890.         self:SetHeight(self:GetHeight()+45);
  891.     end
  892. end
  893.  
  894. function LevelUpDisplaySide_Remove()
  895.     LevelUpDisplaySide.fadeOut:Play();
  896. end
  897.  
  898. -- Chat print function
  899. function LevelUpDisplay_ChatPrint(self, level, levelUpType, ...)
  900.     local info;
  901.     local chatLevelUP = {level = level, type = levelUpType};
  902.     local levelstring;
  903.     if ( levelUpType == LEVEL_UP_TYPE_CHARACTER ) then
  904.         LevelUpDisplay_BuildCharacterList(chatLevelUP);
  905.         levelstring = format(LEVEL_UP, level, level);
  906.         info = ChatTypeInfo["SYSTEM"];
  907.     elseif ( levelUpType == LEVEL_UP_TYPE_PET ) then
  908.         LevelUpDisplay_BuildPetList(chatLevelUP);
  909.         local petName = UnitName("pet");
  910.         if (petName) then
  911.             levelstring = format(PET_LEVEL_UP, petName, level, petName, level);
  912.         else
  913.             levelstring = "";
  914.         end
  915.         info = ChatTypeInfo["SYSTEM"];
  916.     elseif ( levelUpType == LEVEL_UP_TYPE_GUILD ) then
  917.         LevelUpDisplay_BuildGuildList(chatLevelUP);
  918.         local guildName = GetGuildInfo("player");
  919.         levelstring = format(GUILD_LEVEL_UP, guildName, level, level);
  920.         info = ChatTypeInfo["GUILD"];
  921.     end
  922.     self:AddMessage(levelstring, info.r, info.g, info.b, info.id);
  923.     for _,skill in pairs(chatLevelUP.unlockList) do
  924.         if skill.entryType == "heroicdungeon" then
  925.             local name, link = EJ_GetTierInfo(skill.tier);
  926.             self:AddMessage(LEVEL_UP_HEROIC2..link, info.r, info.g, info.b, info.id);
  927.         elseif skill.entryType ~= "spell" then
  928.             self:AddMessage(skill.link, info.r, info.g, info.b, info.id);
  929.         end
  930.     end
  931. end
  932.  
  933. function getPlayerSpellsForClass(level)
  934.     local spells = {};
  935.     local loc,class = UnitClass("player")
  936.     if class == "WARRIOR" then
  937.         if level == 2 then
  938.             spells = {6673};
  939.         elseif level == 4 then
  940.             spells = {100, 772};
  941.         elseif level == 6 then
  942.             spells = {6343};
  943.         elseif level == 8 then
  944.             spells = {6343, 284};
  945.         elseif level == 10 then
  946.             spells = {2687, 6546, 674, 71, 2458};
  947.         elseif level == 12 then
  948.             spells = {7384, 5242, 72, 6552};
  949.         elseif level == 14 then
  950.             spells = {1160, 6572};
  951.         elseif level == 16 then
  952.             spells = {285, 694, 2565};
  953.         elseif level == 18 then
  954.             spells = {8198, 676};
  955.         elseif level == 20 then
  956.             spells = {6547, 20230, 845, 20252, 12678};
  957.         elseif level == 22 then
  958.         elseif level == 24 then
  959.         elseif level == 26 then
  960.         elseif level == 28 then
  961.         elseif level == 30 then
  962.         end
  963.     elseif class == "PALADIN" then
  964.         if level == 2 then
  965.             spells = {465}
  966.         elseif level == 4 then
  967.             spells = {19740, 20271}
  968.         elseif level == 6 then
  969.             spells = {639, 498}
  970.         elseif level == 8 then
  971.             spells = {1152, 853}
  972.         elseif level == 10 then
  973.             spells = {633, 1022, 10290}
  974.         elseif level == 12 then
  975.             spells = {53408, 19834, 7328}
  976.         elseif level == 14 then
  977.             spells = {647, 31789, 19742}
  978.         elseif level == 16 then
  979.             spells = {7294, 25780, 62124}
  980.         elseif level == 18 then
  981.             spells = {1044, 31785}
  982.         elseif level == 20 then
  983.             spells = {26573, 879, 19750, 5502, 20217, 643, 10290}
  984.         elseif level == 22 then
  985.         elseif level == 24 then
  986.         elseif level == 26 then
  987.         elseif level == 28 then
  988.         elseif level == 30 then
  989.         end
  990.     elseif class == "HUNTER" then
  991.         if level == 2 then
  992.             spells = {1516, 1494}
  993.         elseif level == 4 then
  994.             spells = {1978, 13163}
  995.         elseif level == 6 then
  996.             spells = {3044, 1130}
  997.         elseif level == 8 then
  998.             spells = {5116, 14260}
  999.         elseif level == 10 then
  1000.             spells = {13165, 674, 19883, 13549}
  1001.         elseif level == 12 then
  1002.             spells = {136, 14281, 2974, 20736}
  1003.         elseif level == 14 then
  1004.             spells = {6197, 1002, 1513}
  1005.         elseif level == 16 then
  1006.             spells = {13795, 5118, 1495, 14261}
  1007.         elseif level == 18 then
  1008.             spells = {14318, 2643, 19884, 13550}
  1009.         elseif level == 20 then
  1010.             spells = {34074, 3111, 14282, 781, 1499}
  1011.         elseif level == 22 then
  1012.         elseif level == 24 then
  1013.         elseif level == 26 then
  1014.         elseif level == 28 then
  1015.         elseif level == 30 then
  1016.         end
  1017.     elseif class == "ROGUE" then
  1018.         if level == 2 then
  1019.             spells = {1784}
  1020.         elseif level == 4 then
  1021.             spells = {921, 53}
  1022.         elseif level == 6 then
  1023.             spells = {1776, 1757}
  1024.         elseif level == 8 then
  1025.             spells = {5277, 6760}
  1026.         elseif level == 10 then
  1027.             spells = {5171, 2983, 6770}
  1028.         elseif level == 12 then
  1029.             spells = {2589, 1766}
  1030.         elseif level == 14 then
  1031.             spells = {1758, 703, 8647}
  1032.         elseif level == 16 then
  1033.             spells = {6761, 1966, 1804, 85001}
  1034.         elseif level == 18 then
  1035.             spells = {8676, 81866}
  1036.         elseif level == 20 then
  1037.             spells = {51722, 1943, 2590, 408}
  1038.         elseif level == 22 then
  1039.         elseif level == 24 then
  1040.         elseif level == 26 then
  1041.         elseif level == 28 then
  1042.         elseif level == 30 then
  1043.         end
  1044.     elseif class == "PRIEST" then
  1045.         if level == 2 then
  1046.             spells = {1243}
  1047.         elseif level == 4 then
  1048.             spells = {2052, 589}
  1049.         elseif level == 6 then
  1050.             spells = {17, 591}
  1051.         elseif level == 8 then
  1052.             spells = {586, 139}
  1053.         elseif level == 10 then
  1054.             spells = {2053, 2006, 8092, 594}
  1055.         elseif level == 12 then
  1056.             spells = {1244, 592, 588}
  1057.         elseif level == 14 then
  1058.             spells = {528, 6074, 598, 8122}
  1059.         elseif level == 16 then
  1060.             spells = {2054, 8102}
  1061.         elseif level == 18 then
  1062.             spells = {600, 970, 527}
  1063.         elseif level == 20 then
  1064.             spells = {6346, 7128, 9484, 2061, 14914, 15237, 6075, 2944, 453}
  1065.         elseif level == 22 then
  1066.         elseif level == 24 then
  1067.         elseif level == 26 then
  1068.         elseif level == 28 then
  1069.         elseif level == 30 then
  1070.         end
  1071.     elseif class == "SHAMAN" then
  1072.         if level == 2 then
  1073.             spells = {8017, 674}
  1074.         elseif level == 4 then
  1075.             spells = {8042, 3599, 8071}
  1076.         elseif level == 6 then
  1077.             spells = {2484, 332}
  1078.         elseif level == 8 then
  1079.             spells = {8044, 529, 5730, 324, 8018}
  1080.         elseif level == 10 then
  1081.             spells = {8050, 8024, 8075, 8154}
  1082.         elseif level == 12 then
  1083.             spells = {2008, 1535, 370, 547}
  1084.         elseif level == 14 then
  1085.             spells = {8045, 548}
  1086.         elseif level == 16 then
  1087.             spells = {57994, 526, 2645, 325, 8019}
  1088.         elseif level == 18 then
  1089.             spells = {8143, 8052, 6390, 8027, 913}
  1090.         elseif level == 20 then
  1091.             spells = {8056, 915, 6363, 8033, 8004, 52127}
  1092.         elseif level == 22 then
  1093.         elseif level == 24 then
  1094.         elseif level == 26 then
  1095.         elseif level == 28 then
  1096.         elseif level == 30 then
  1097.         end
  1098.     elseif class == "MAGE" then
  1099.         if level == 2 then
  1100.             spells = {1459}
  1101.         elseif level == 4 then
  1102.             spells = {5504, 116}
  1103.         elseif level == 6 then
  1104.             spells = {2136, 587, 143}
  1105.         elseif level == 8 then
  1106.             spells = {5143, 118, 205}
  1107.         elseif level == 10 then
  1108.             spells = {5504, 122, 7300}
  1109.         elseif level == 12 then
  1110.             spells = {604, 145, 597, 130}
  1111.         elseif level == 14 then
  1112.             spells = {1449, 1460, 2137, 837}
  1113.         elseif level == 16 then
  1114.             spells = {2120, 5144}
  1115.         elseif level == 18 then
  1116.             spells = {1008, 475, 3140}
  1117.         elseif level == 20 then
  1118.             spells = {1953, 5506, 12051, 1463, 12824, 543, 10, 7301, 7322}
  1119.         elseif level == 22 then
  1120.         elseif level == 24 then
  1121.         elseif level == 26 then
  1122.         elseif level == 28 then
  1123.         elseif level == 30 then
  1124.         end
  1125.     elseif class == "WARLOCK" then
  1126.         if level == 2 then
  1127.             spells = {348, 688}
  1128.         elseif level == 4 then
  1129.             spells = {172, 702}
  1130.         elseif level == 6 then
  1131.             spells = {1454, 695}
  1132.         elseif level == 8 then
  1133.             spells = {980, 5782}
  1134.         elseif level == 10 then
  1135.             spells = {707, 696, 6201, 697, 1120}
  1136.         elseif level == 12 then
  1137.             spells = {1108, 705, 755}
  1138.         elseif level == 14 then
  1139.             spells = {6222, 689}
  1140.         elseif level == 16 then
  1141.             spells = {1455, 5697}
  1142.         elseif level == 18 then
  1143.             spells = {693, 5676, 1014}
  1144.         elseif level == 20 then
  1145.             spells = {706, 3698, 698, 1094, 5740, 1088}
  1146.         elseif level == 22 then
  1147.         elseif level == 24 then
  1148.         elseif level == 26 then
  1149.         elseif level == 28 then
  1150.         elseif level == 30 then
  1151.         end
  1152.     elseif class == "DRUID" then
  1153.         if level == 2 then
  1154.             spells = {1126}
  1155.         elseif level == 4 then
  1156.             spells = {774, 8921}
  1157.         elseif level == 8 then
  1158.             spells = {339, 5186}
  1159.         elseif level == 6 then
  1160.             spells = {5177, 467}
  1161.         elseif level == 10 then
  1162.             spells = {5487, 6807, 99, 1066, 8924, 5232, 1058, 16689}
  1163.         elseif level == 12 then
  1164.             spells = {50769, 5229, 8936}
  1165.         elseif level == 14 then
  1166.             spells = {5187, 5178, 782, 5211}
  1167.         elseif level == 16 then
  1168.             spells = {1430, 8925, 779, 783}
  1169.         elseif level == 18 then
  1170.             spells = {1062, 16810, 2637, 770, 6808, 16857, 8938}
  1171.         elseif level == 20 then
  1172.             spells = {2912, 768, 33891, 1735, 5215, 1079, 5188, 6756, 24858}
  1173.         elseif level == 22 then
  1174.         elseif level == 24 then
  1175.         elseif level == 26 then
  1176.         elseif level == 28 then
  1177.         elseif level == 30 then
  1178.         end
  1179.     elseif class == "DEMONHUNTER" then
  1180.         -- starts at level 10, will leave it returning {} (nothing)
  1181.     end
  1182.     -- debug
  1183.     --spells = {5, 11}
  1184.     return spells;
  1185. end
Advertisement
Add Comment
Please, Sign In to add comment