stoneharry

Untitled

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