Advertisement
Rochet2

Untitled

Aug 23rd, 2013
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local item_id = 90001
  2.  
  3. local T = {}
  4. T.Warrior = {47436, 47450, 11578, 47465, 47502, 34428, 1715, 2687, 71, 7386, 355, 72, 47437, 57823, 694, 2565, 676, 47520, 20230, 12678, 47471, 1161, 871, 2458, 20252, 47475, 18499, 1680, 6552, 47488, 1719, 23920, 47440, 3411, 64382, 55694, 57755, 674, 750, 5246}
  5. T.Paladin = {750, 48942, 48782, 48932, 20271, 498, 853, 1152, 10278, 48788, 53408, 48950, 48936, 31789, 62124, 54043, 25780, 1044, 20217, 48819, 48801, 48785, 5502, 20164, 10326, 1038, 53407, 48943, 20165, 48945, 642, 48947, 20166, 4987, 48806, 6940, 48817, 48934, 48938, 25898, 25899, 32223, 31884, 54428, 61411, 53601, 33388, 33391, 34769, 34767}
  6. T.Hunter = {8737, 1494, 13163, 48996, 49001, 49045, 53338, 5116, 27044, 883, 2641, 6991, 982, 1515, 19883, 20736, 48990, 2974, 6197, 1002, 14327, 5118, 49056, 53339, 49048, 19884, 34074, 781, 14311, 1462, 19885, 19880, 13809, 13161, 5384, 1543, 19878, 49067, 3034, 13159, 19882, 58434, 49071, 49052, 19879, 19263, 19801, 34026, 34600, 34477, 61006, 61847, 53271, 60192, 62757}
  7. T.Rogue = {674, 48668, 48638, 1784, 48657, 921, 1776, 26669, 51724, 6774, 11305, 1766, 48676, 48659, 1804, 8647, 48691, 51722, 48672, 1725, 26889, 2836, 1833, 1842, 8643, 2094, 1860, 57993, 48674, 31224, 5938, 57934, 51723}
  8. T.Priest = {2053, 48161, 48123, 48125, 48066, 586, 48068, 48127, 48171, 48168, 10890, 6064, 988, 48300, 6346, 48071, 48135, 48078, 453, 9484, 10909, 8129, 48073, 605, 48072, 48169, 552, 1706, 48063, 48162, 48170, 48074, 48158, 48120, 34433, 48113, 32375, 64843, 64901, 53023}
  9. T["Death Knight"] = {50842, 49941, 49930, 47476, 45529, 3714, 56222, 48743, 48263, 49909, 66188, 47528, 45524, 48792, 57623, 56815, 47568, 49895, 50977, 49576, 49921, 46584, 49938, 48707, 48265, 61999, 42650, 53428, 53331, 54447, 53342, 54446, 53323, 53344, 70164, 62158, 33391, 48778, 51425, 49924, 49924}
  10. T.Shaman = {8737, 49273, 49238, 10399, 49231, 58753, 2484, 49281, 58582, 49233, 58790, 58704, 58643, 49277, 61657, 8012, 526, 2645, 57994, 8143, 49236, 58796, 58757, 49276, 57960, 131, 58745, 6196, 58734, 58774, 58739, 58656, 546, 556, 66842, 51994, 8177, 58749, 20608, 36936, 58804, 49271, 8512, 6495, 8170, 66843, 55459, 66844, 3738, 2894, 60043, 51514}
  11. T.Mage = {42995, 42833, 27090, 42842, 33717, 42873, 42846, 12826, 28271, 61780, 61721, 28272, 61305, 42917, 43015, 130, 42921, 42926, 43017, 475, 1953, 42940, 12051, 43010, 43020, 43012, 42859, 2139, 42931, 42985, 43008, 45438, 43024, 43002, 43046, 42897, 42914, 66, 58659, 30449, 42956, 47610, 61316, 61024, 55342, 53142}
  12. T.Warlock = {696, 47811, 47809, 688, 47813, 50511, 57946, 47864, 6215, 47878, 47855, 697, 47856, 47857, 5697, 47884, 47815, 47889, 47820, 698, 712, 126, 5138, 5500, 11719, 132, 60220, 18647, 61191, 47823, 691, 47865, 47891, 47888, 17928, 47860, 47825, 1122, 47867, 18540, 47893, 47838, 29858, 58887, 47836, 61290, 48018, 48020, 33388, 33391, 23161}
  13. T.Druid = {48378, 48469, 48461, 48463, 48441, 53307, 53308, 5487, 48560, 6795, 48480, 53312, 18960, 5229, 48443, 50763, 8983, 8946, 1066, 48562, 783, 770, 16857, 18658, 768, 1082, 16979, 49376, 5215, 48477, 49800, 48465, 48572, 26995, 48574, 2782, 50213, 2893, 33357, 5209, 48575, 48447, 48577, 48579, 5225, 22842, 49803, 9634, 20719, 48467, 29166, 62600, 22812, 48470, 48564, 48566, 33891, 33943, 49802, 48451, 48568, 33786, 40120, 62078, 52610, 50464, 48570}
  14. local skills = {
  15.     201, -- One-Handed Swords
  16.     202, -- Two-Handed Swords
  17.     196, -- One-Handed Axes
  18.     197, -- Two-Handed Axes
  19.     227, -- Staves
  20.     200, -- Polearms
  21.     266, -- Guns
  22.     264, -- Bows
  23.     5011, -- Crossbows
  24.     3018, -- Shoot (Bow, Crossbow or Gun,
  25.     198, -- One-Handed Maces
  26.     199, -- Two-Handed Maces
  27.     1180, -- Daggers
  28.     2567, -- Thrown
  29.     2764, -- Throw (With Thrown,
  30.     5009, -- Wands
  31.     5019, -- Shoot (Wands)
  32. }
  33.  
  34. local function ItemHello(event, player, item)
  35.     player:GossipMenuAddItem(0, "Teach Me My Class Spells", 0, 0)
  36.     player:GossipMenuAddItem(0, "Teach Me My Riding Skills", 0, 1)
  37.     player:GossipMenuAddItem(0, "Teach Me My Weapon Skills", 0, 2)
  38.     player:GossipMenuAddItem(0, "Advance All My Skills", 0, 3)
  39.     player:GossipMenuAddItem(0, "Reset My Talents", 0, 4)
  40.     player:GossipSendMenu(1, item)
  41. end
  42.  
  43. local function ItemSelect(event, player, item, id, intid, code)
  44.     if (intid == 0) then
  45.         local class = player:GetClassAsString()
  46.         if(not T[class]) then return end
  47.         for k, spell in ipairs(T[class]) do
  48.             player:LearnSpell(spell)
  49.         end
  50.  
  51.         if (class == "Warrior") then -- Warrior
  52.             if (player:HasSpell(12294)) then
  53.                 player:LearnSpell(47486)
  54.             end
  55.             if (player:HasSpell(20243)) then
  56.                 player:LearnSpell(47498)
  57.             end
  58.         elseif (class == "Paladin") then -- Paladin
  59.             if (player:GetTeam() < 1) then
  60.                 player:LearnSpell(31801)
  61.             else
  62.                 player:LearnSpell(53736)
  63.             end
  64.             if (player:HasSpell(20925)) then
  65.                 player:LearnSpell(48952)
  66.             end
  67.             if (player:HasSpell(31935)) then
  68.                 player:LearnSpell(48827)
  69.             end
  70.             if (player:HasSpell(20473)) then
  71.                 player:LearnSpell(48825)
  72.             end
  73.         elseif (class == "Hunter") then -- Hunter
  74.             if (player:HasSpell(19386)) then
  75.                 player:LearnSpell(49012)
  76.             end
  77.             if (player:HasSpell(53301)) then
  78.                 player:LearnSpell(60053)
  79.             end
  80.             if (player:HasSpell(19306)) then
  81.                 player:LearnSpell(48999)
  82.             end
  83.             if (player:HasSpell(19434)) then
  84.                 player:LearnSpell(49050)
  85.             end
  86.         elseif (class == "Rogue") then -- Rogue
  87.             if (player:HasSpell(16511)) then
  88.                 player:LearnSpell(48660)
  89.             end
  90.             if (player:HasSpell(1329)) then
  91.                 player:LearnSpell(48666)
  92.             end
  93.         elseif (class == "Priest") then -- Priest
  94.             if (player:HasSpell(34914)) then
  95.                 player:LearnSpell(48160)
  96.             end
  97.             if (player:HasSpell(47540)) then
  98.                 player:LearnSpell(53007)
  99.             end
  100.             if (player:HasSpell(724)) then
  101.                 player:LearnSpell(48087)
  102.             end
  103.             if (player:HasSpell(19236)) then
  104.                 player:LearnSpell(48173)
  105.             end
  106.             if (player:HasSpell(34861)) then
  107.                 player:LearnSpell(48089)
  108.             end
  109.             if (player:HasSpell(15407)) then
  110.                 player:LearnSpell(48156)
  111.             end
  112.         elseif (class == "Death Knight") then -- Death Knight
  113.             if (player:HasSpell(55050)) then
  114.                 player:LearnSpell(55262)
  115.             end
  116.             if (player:HasSpell(49143)) then
  117.                 player:LearnSpell(55268)
  118.             end
  119.             if (player:HasSpell(49184)) then
  120.                 player:LearnSpell(51411)
  121.             end
  122.             if (player:HasSpell(55090)) then
  123.                 player:LearnSpell(55271)
  124.             end
  125.             if (player:HasSpell(49158)) then
  126.                 player:LearnSpell(51328)
  127.             end
  128.         elseif (class == "Shaman") then -- Shaman
  129.             if (player:GetTeam() < 1) then
  130.                 player:LearnSpell(32182)
  131.             else
  132.                 player:LearnSpell(2825)
  133.             end
  134.             if (player:HasSpell(61295)) then
  135.                 player:LearnSpell(61301)
  136.             end
  137.             if (player:HasSpell(974)) then
  138.                 player:LearnSpell(49284)
  139.             end
  140.             if (player:HasSpell(30706)) then
  141.                 player:LearnSpell(57722)
  142.             end
  143.             if (player:HasSpell(51490)) then
  144.                 player:LearnSpell(59159)
  145.             end
  146.         elseif (class == "Mage") then -- Mage
  147.             local portals
  148.             if (player:GetTeam() < 1) then -- Alliance Portals
  149.                 portals = {32271, 49359, 3565, 33690, 3562, 3561, 11419, 32266, 11416, 33691, 11059, 49360}
  150.             else -- Horde Portals
  151.                 portals = {3567, 35715, 3566, 49358, 32272, 3563, 11417, 35717, 32267, 49361, 11420, 11418}
  152.             end
  153.             for k, spell in ipairs(portals) do
  154.                 player:LearnSpell(spell)
  155.             end
  156.             if (player:HasSpell(11366)) then
  157.                 player:LearnSpell(42891)
  158.             end
  159.             if (player:HasSpell(11426)) then
  160.                 player:LearnSpell(43039)
  161.             end
  162.             if (player:HasSpell(44457)) then
  163.                 player:LearnSpell(55360)
  164.             end
  165.             if (player:HasSpell(31661)) then
  166.                 player:LearnSpell(42950)
  167.             end
  168.             if (player:HasSpell(11113)) then
  169.                 player:LearnSpell(42945)
  170.             end
  171.             if (player:HasSpell(44425)) then
  172.                 player:LearnSpell(44781)
  173.             end
  174.         elseif (class == "Warlock") then -- Warlock
  175.             if (player:HasSpell(17877)) then
  176.                 player:LearnSpell(47827)
  177.             end
  178.             if (player:HasSpell(30283)) then
  179.                 player:LearnSpell(47847)
  180.             end
  181.             if (player:HasSpell(30108)) then
  182.                 player:LearnSpell(47843)
  183.             end
  184.             if (player:HasSpell(50796)) then
  185.                 player:LearnSpell(59172)
  186.             end
  187.             if (player:HasSpell(48181)) then
  188.                 player:LearnSpell(59164)
  189.             end
  190.             if (player:HasSpell(18220)) then
  191.                 player:LearnSpell(59092)
  192.             end
  193.         elseif (class == "Druid") then -- Druid
  194.             if (player:HasSpell(50516)) then
  195.                 player:LearnSpell(61384)
  196.             end
  197.             if (player:HasSpell(48505)) then
  198.                 player:LearnSpell(53201)
  199.             end
  200.             if (player:HasSpell(48438)) then
  201.                 player:LearnSpell(53251)
  202.             end
  203.             if (player:HasSpell(5570)) then
  204.                 player:LearnSpell(48468)
  205.             end
  206.         end
  207.         player:SendBroadcastMessage("You have learned your spells!")
  208.     elseif (intid == 1) then
  209.         if (player:GetLevel() >= 20) then
  210.             player:LearnSpell(33388)
  211.         end
  212.         if (player:GetLevel() >= 40) then
  213.             player:LearnSpell(33391)
  214.         end
  215.         if (player:GetLevel() >= 60) then
  216.             player:LearnSpell(34091)
  217.             player:LearnSpell(34090)
  218.         end
  219.         if (player:GetLevel() >= 80) then
  220.             player:LearnSpell(54197)
  221.             player:LearnSpell(90265)
  222.         end
  223.         player:SendBroadcastMessage("You have learned your riding skills!")
  224.     elseif (intid == 2) then
  225.         for k, spell in ipairs(skills) do
  226.             player:LearnSpell(spell)
  227.         end
  228.         player:SendBroadcastMessage("You have learned all your weapon skills!")
  229.     elseif (intid == 3) then
  230.         player:AdvanceAllSkills(450)
  231.         player:SendBroadcastMessage("Your skills have been advanced!")
  232.     elseif (intid == 4) then
  233.         player:ResetTalents(true)
  234.         player:SendBroadcastMessage("You talents have been reset!")
  235.     else
  236.         return
  237.     end
  238.     ItemHello(event, player, item)
  239. end
  240.  
  241. RegisterItemGossipEvent(item_id, 1, ItemHello)
  242. RegisterItemGossipEvent(item_id, 2, ItemSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement