Guest User

edgemaster.lua

a guest
Sep 23rd, 2014
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.43 KB | None | 0 0
  1. local function edgemaster (event, player, item, bag, slot)
  2.     player:SaveToDB()
  3.     local playerguid = player:GetGUIDLow()
  4.     if (item:IsEquipped()) and (item:GetEntry()==9623) then
  5.         player:LearnSpell(196, player) --1H AXE
  6.         player:LearnSpell(197, player) --2H AXE
  7.         player:LearnSpell(198, player) --1H MACE
  8.         player:LearnSpell(199, player) --2H MACE
  9.         player:LearnSpell(200, player) --POLEARMS
  10.         player:LearnSpell(201, player) --1H SWORD
  11.         player:LearnSpell(202, player) --2H SWORD
  12.         player:LearnSpell(227, player) --STAVES
  13.         player:LearnSpell(15590, player) --FIST
  14.         player:LearnSpell(1180, player) --DAGGER
  15.     end
  16. end
  17. local function unequip (event, player, enemy)
  18.     if (player:GetEquippedItemBySlot(4)==nil) or ((player:GetEquippedItemBySlot(4)):GetEntry()~=9623) then
  19.         if ((player:GetClass())==2) then            --CRUSADER
  20.             if (player:GetEquippedItemBySlot(15)) then
  21.                 local mainhand = player:GetEquippedItemBySlot(15)
  22.                 local mainhand_entry = mainhand:GetEntry()
  23.                 if (mainhand:GetSubClass()<4) or (mainhand:GetSubClass()>8) then
  24.                     player:RemoveItem(mainhand, 1)
  25.                     player:AddItem(mainhand_entry, 1)
  26.                     player:RemoveSpell(1180, player) --DAGGERS
  27.                     player:RemoveSpell(227, player) --STAVES
  28.                     player:RemoveSpell(15590, player) --FIST
  29.                     player:RemoveSpell(196, player) --1H AXE
  30.                     player:RemoveSpell(197, player) --2H AXE
  31.                 end
  32.             end
  33.         end
  34.         if ((player:GetClass())==3) then            --RANGER
  35.             if (player:GetEquippedItemBySlot(15)) then
  36.                 local mainhand = player:GetEquippedItemBySlot(15)
  37.                 local mainhand_entry = mainhand:GetEntry()
  38.                 if (mainhand:GetSubClass()==4) or (mainhand:GetSubClass()==5) or (mainhand:GetSubClass()==13) then
  39.                     player:RemoveItem(mainhand, 1)
  40.                     player:AddItem(mainhand_entry, 1)
  41.                     player:RemoveSpell(198, player) --1H MACE
  42.                     player:RemoveSpell(199, player) --2H MACE
  43.                     player:RemoveSpell(15590, player) --FIST
  44.                 end
  45.             end
  46.         end
  47.         if ((player:GetClass())==4) then            --THIEF
  48.             if (player:GetEquippedItemBySlot(15)) then
  49.                 local mainhand = player:GetEquippedItemBySlot(15)
  50.                 local mainhand_entry = mainhand:GetEntry()
  51.                 if (mainhand:GetSubClass()==0) or (mainhand:GetSubClass()==1) or (mainhand:GetSubClass()==5) or (mainhand:GetSubClass()==8) or (mainhand:GetSubClass()==10) or (mainhand:GetSubClass()==6) then
  52.                     player:RemoveItem(mainhand, 1)
  53.                     player:AddItem(mainhand_entry, 1)
  54.                     player:RemoveSpell(196, player) --1H AXE
  55.                     player:RemoveSpell(197, player) --2H AXE
  56.                     player:RemoveSpell(199, player) --2H MACE
  57.                     player:RemoveSpell(200, player) --POLEARMS
  58.                     player:RemoveSpell(202, player) --2H SWORD
  59.                     player:RemoveSpell(227, player) --STAVES
  60.                 end
  61.             end
  62.         end
  63.         if ((player:GetClass())==5) then            --PRELATE
  64.             if (player:GetEquippedItemBySlot(15)) then
  65.                 local mainhand = player:GetEquippedItemBySlot(15)
  66.                 local mainhand_entry = mainhand:GetEntry()
  67.                 if (mainhand:GetSubClass()~=4) or (mainhand:GetSubClass()~=10) or (mainhand:GetSubClass()~=15) then
  68.                     player:RemoveItem(mainhand, 1)
  69.                     player:AddItem(mainhand_entry, 1)
  70.                     player:RemoveSpell(196, player) --1H AXE
  71.                     player:RemoveSpell(197, player) --2H AXE
  72.                     player:RemoveSpell(199, player) --2H MACE
  73.                     player:RemoveSpell(200, player) --POLEARMS
  74.                     player:RemoveSpell(201, player) --1H SWORD
  75.                     player:RemoveSpell(202, player) --2H SWORD
  76.                     player:RemoveSpell(15590, player) --FIST
  77.                     player:LearnSpell(1180, player) --DAGGER
  78.                 end
  79.             end
  80.         end
  81.         if ((player:GetClass())==6) then            --NECROMANCER
  82.             if (player:GetEquippedItemBySlot(15)) then
  83.                 local mainhand = player:GetEquippedItemBySlot(15)
  84.                 local mainhand_entry = mainhand:GetEntry()
  85.                 if (mainhand:GetSubClass()~=4) or (mainhand:GetSubClass()~=10) or (mainhand:GetSubClass()~=15) then
  86.                     player:RemoveItem(mainhand, 1)
  87.                     player:AddItem(mainhand_entry, 1)
  88.                     player:RemoveSpell(196, player) --1H AXE
  89.                     player:RemoveSpell(197, player) --2H AXE
  90.                     player:RemoveSpell(199, player) --2H MACE
  91.                     player:RemoveSpell(200, player) --POLEARMS
  92.                     player:RemoveSpell(201, player) --1H SWORD
  93.                     player:RemoveSpell(202, player) --2H SWORD
  94.                     player:RemoveSpell(15590, player) --FIST
  95.                 end
  96.             end
  97.         end
  98.         if ((player:GetClass())==7) then            --SHAMAN
  99.             if (player:GetEquippedItemBySlot(15)) then
  100.                 local mainhand = player:GetEquippedItemBySlot(15)
  101.                 local mainhand_entry = mainhand:GetEntry()
  102.                 if (mainhand:GetSubClass()==7) or (mainhand:GetSubClass()==8) then
  103.                     player:RemoveItem(mainhand, 1)
  104.                     player:AddItem(mainhand_entry, 1)
  105.                     player:RemoveSpell(201, player) --1H SWORD
  106.                     player:RemoveSpell(202, player) --2H SWORD
  107.                 end
  108.             end
  109.         end
  110.         if ((player:GetClass())==8) then            --SORCERER
  111.             if (player:GetEquippedItemBySlot(15)) then
  112.                 local mainhand = player:GetEquippedItemBySlot(15)
  113.                 local mainhand_entry = mainhand:GetEntry()
  114.                 if (mainhand:GetSubClass()~=7) or (mainhand:GetSubClass()~=10) or (mainhand:GetSubClass()~=15) then
  115.                     player:RemoveItem(mainhand, 1)
  116.                     player:AddItem(mainhand_entry, 1)
  117.                     player:RemoveSpell(196, player) --1H AXE
  118.                     player:RemoveSpell(197, player) --2H AXE
  119.                     player:RemoveSpell(198, player) --1H MACE
  120.                     player:RemoveSpell(199, player) --2H MACE
  121.                     player:RemoveSpell(200, player) --POLEARMS
  122.                     player:RemoveSpell(202, player) --2H SWORD
  123.                     player:RemoveSpell(15590, player) --FIST
  124.                 end
  125.             end
  126.         end
  127.         if ((player:GetClass())==9) then            --DIABLOIST
  128.             if (player:GetEquippedItemBySlot(15)) then
  129.                 local mainhand = player:GetEquippedItemBySlot(15)
  130.                 local mainhand_entry = mainhand:GetEntry()
  131.                 if (mainhand:GetSubClass()~=7) or (mainhand:GetSubClass()~=10) or (mainhand:GetSubClass()~=15) then
  132.                     player:RemoveItem(mainhand, 1)
  133.                     player:AddItem(mainhand_entry, 1)
  134.                     player:RemoveSpell(196, player) --1H AXE
  135.                     player:RemoveSpell(197, player) --2H AXE
  136.                     player:RemoveSpell(198, player) --1H MACE
  137.                     player:RemoveSpell(199, player) --2H MACE
  138.                     player:RemoveSpell(200, player) --POLEARMS
  139.                     player:RemoveSpell(202, player) --2H SWORD
  140.                     player:RemoveSpell(15590, player) --FIST
  141.                 end
  142.             end
  143.         end
  144.         if ((player:GetClass())==11) then           --DRUID
  145.             if (player:GetEquippedItemBySlot(15)) then
  146.                 local mainhand = player:GetEquippedItemBySlot(15)
  147.                 local mainhand_entry = mainhand:GetEntry()
  148.                 if (mainhand:GetSubClass()~=4) or (mainhand:GetSubClass()~=10) or (mainhand:GetSubClass()~=5) or (mainhand:GetSubClass()~=15) then
  149.                     player:RemoveItem(mainhand, 1)
  150.                     player:AddItem(mainhand_entry, 1)
  151.                     player:RemoveSpell(196, player) --1H AXE
  152.                     player:RemoveSpell(197, player) --2H AXE
  153.                     player:RemoveSpell(200, player) --POLEARMS
  154.                     player:RemoveSpell(201, player) --1H SWORD
  155.                     player:RemoveSpell(202, player) --2H SWORD
  156.                     player:RemoveSpell(15590, player) --FIST
  157.                 end
  158.             end
  159.         end
  160.         if ((player:GetClass())==12) then           --SPELLBREAKER
  161.             if (player:GetEquippedItemBySlot(15)) then
  162.                 local mainhand = player:GetEquippedItemBySlot(15)
  163.                 local mainhand_entry = mainhand:GetEntry()
  164.                 if (mainhand:GetSubClass()<4) or (mainhand:GetSubClass()>8) then
  165.                     player:RemoveItem(mainhand, 1)
  166.                     player:AddItem(mainhand_entry, 1)
  167.                     player:RemoveSpell(1180, player) --DAGGERS
  168.                     player:RemoveSpell(227, player) --STAVES
  169.                     player:RemoveSpell(15590, player) --FIST
  170.                     player:RemoveSpell(196, player) --1H AXE
  171.                     player:RemoveSpell(197, player) --2H AXE
  172.                 end
  173.             end
  174.         end
  175.     end
  176. end
  177. RegisterPlayerEvent(29, edgemaster)
  178. RegisterPlayerEvent(33, unequip)
Advertisement
Add Comment
Please, Sign In to add comment