Advertisement
Rochet2

Untitled

Jan 23rd, 2018
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.07 KB | None | 0 0
  1. local npcid = 60
  2.  
  3. local T = {
  4.     ["Menu"] = {
  5.         {"Headpiece", 0},
  6.         {"Shoulders", 2},
  7.         {"Chest", 4},
  8.         {"Legs", 6},
  9.         {"Boots", 7},
  10.         {"Bracers", 8},
  11.         {"Gloves", 9},
  12.         {"Cloak", 14},
  13.         {"Main-Hand Weapons", 15},
  14.         {"Two-Handed Weapons", 150},
  15.         {"Off-Hand Weapons", 16},
  16.         {"Shields", 160},
  17.     },
  18.    
  19.     [0] = {
  20.         -- Headpiece
  21.         {"+10 intellect, +10 stamina, +24 healing", 2591},
  22.         {"+10 stamina, +1% hit rating, +24 ranged attack power", 2586},
  23.         {"+1% spell hit rating, +18 spell damage and healing", 2588},
  24.         {"+10 stamina, +7 defense rating, +24 healing", 2584},
  25.         {"+10 stamina, +24 healing, +4 mana/5 sec", 2590},
  26.         {"+1% dodge rating, +28 attack power", 2585},
  27.         {"+15 intellect, +13 spell damage and healing", 2587},
  28.         {"+10 stamina, +18 spell damage and healing", 2589},
  29.         {"+10 stamina, +7 defense rating, +15 shield block value", 2583},
  30.         {"+8 agility", 1508},
  31.         {"+8 intellect", 1509},
  32.         {"+8 spirit", 1510},
  33.         {"+8 stamina", 1507},
  34.         {"+8 strength", 1506},
  35.     },
  36.    
  37.     [2] = {
  38.         -- Shoulders
  39.         {"+26 attack power, +1% critical strike rating", 2717},
  40.         {"+15 spell damage and healing, +1% spell critical strike rating", 2721},
  41.         {"+31 healing, +11 spell damage, +5mana/5sec", 2715},
  42.         {"+16 stamina, +100 armor", 2716},
  43.         {"+30 attack power", 2606},
  44.         {"+33 healing", 2604},
  45.         {"+18 spell damage and healing", 2605},
  46.     },
  47.    
  48.     [4] = {
  49.         -- Chest
  50.         {"+3 defense rating", 2503},
  51.         {"5% chance to absorb 25 damage", 63},
  52.         {"+100 health", 1892},
  53.         {"+100 mana", 1893},
  54.         {"+4 all stats", 1891},
  55.     },
  56.    
  57.     [6] = {
  58.         -- Legs
  59.         {"+10 intellect, +10 stamina, +24 healing", 2591},
  60.         {"+10 stamina, +10 hit rating, +24 ranged attack power", 2586},
  61.         {"+1% spell hit rating, +18 spell damage and healing", 2588},
  62.         {"+10 stamina, +7 defense rating, +24 healing", 2584},
  63.         {"+10 stamina, +24 healing, +4 mana/5 sec", 2590},
  64.         {"+1% dodge rating, +28 attack power", 2585},
  65.         {"+15 intellect, +13 spell damage and healing", 2587},
  66.         {"+10 stamina, +18 spell damage and healing", 2589},
  67.         {"+10 stamina, +7 defense rating, +15 shield block value", 2583},
  68.         {"+8 agility", 1508},
  69.         {"+8 intellect", 1509},
  70.         {"+8 spirit", 1510},
  71.         {"+8 stamina", 1507},
  72.         {"+8 strength", 1506},
  73.     },
  74.    
  75.     [7] = {
  76.         -- Boots
  77.         {"+8% run speed", 911},
  78.         {"+3 defense rating", 2503},
  79.         {"+7 agilty", 1887},
  80.         {"+5 Spirit", 851},
  81.         {"+7 stamina", 852},
  82.     },
  83.    
  84.     [8] = {
  85.         -- Bracers
  86.         {"+24 healing", 2566},
  87.         {"+4 mana/5 sec", 36},
  88.         {"+3 defense rating", 923},
  89.         {"+7 intellect", 1883},
  90.         {"+9 spirit", 1884},
  91.         {"+9 stamina", 1886},
  92.         {"+9 strength", 1885},
  93.     },
  94.    
  95.     [9] = {
  96.         -- Gloves
  97.         {"+55 healing", 2617},
  98.         {"+20 fire spell damage", 2616},
  99.         {"+20 frost spell damage", 2615},
  100.         {"+20 shadow spell damage", 2614},
  101.         {"+3 defense rating", 2503},
  102.         {"+15 agility", 2564},
  103.         {"+7 strength", 927},
  104.         {"+40 armor", 1843},
  105.     },
  106.    
  107.     [14] = {
  108.         -- Cloak
  109.         {"+70 armor", 1889},
  110.         {"+1% dodge rating", 2622},
  111.         {"+5 stealth rating", 910},
  112.         {"+5 all resistances", 1888},
  113.         {"+15 fire resistance", 2619},
  114.         {"+15 nature resistance", 2620},
  115.     },
  116.    
  117.     [15] = {
  118.         -- Main Hand
  119.         {"+5 damage", 1897},
  120.         {"Often heals for 75-125 and adds +100 strength for 15 sec", 1900},
  121.         {"Often steals 30 health from the target", 1898},
  122.         {"+55 healing", 2505},
  123.         {"+30 spell damage and healing", 2504},
  124.         {"Cannot be disarmed", 37},
  125.         {"+15 agility", 2564},
  126.         {"+22 intellect", 2568},
  127.         {"+20 spirit", 2567},
  128.         {"+15 strength", 2563},
  129.         {"Often causes the target's movement speed to be slowed by 30% and the time between its attacks to be increased by 25% for 5 sec", 1894},
  130.         {"Often curses the target, causing its damage to be reduced by 15 for 12 sec", 1899},
  131.     },
  132.    
  133.     [150] = {
  134.         -- Two-Handed
  135.         {"+9 damage", 1896},
  136.         {"+25 agility", 2646},
  137.         {"+9 intellect", 1904},
  138.         {"+9 spirit", 1903},
  139.     },
  140.    
  141.     [16] = {
  142.         -- Offhand
  143.         {"+5 damage", 1897},
  144.         {"Often heals for 75-125 and adds +100 strength for 15 sec", 1900},
  145.         {"Often steals 30 health from the target", 1898},
  146.         {"+55 healing", 2505},
  147.         {"+30 spell damage and healing", 2504},
  148.         {"Cannot be disarmed", 37},
  149.         {"+15 agility", 2564},
  150.         {"+22 intellect", 2568},
  151.         {"+20 spirit", 2567},
  152.         {"+15 strength", 2563},
  153.         {"Often causes the target's movement speed to be slowed by 30% and the time between its attacks to be increased by 25% for 5 sec", 1894},
  154.         {"Often curses the target, causing its damage to be reduced by 15 for 12 sec", 1899},
  155.     },
  156.    
  157.     [160] = {
  158.         -- Shields
  159.         {"+30 armor", 848},
  160.         {"+2% block rating", 863},
  161.         {"+20-30 block damage", 1704},
  162.         {"+8 frost resistance", 926},
  163.         {"+9 spirit", 1890},
  164.         {"+7 stamina", 929},
  165.     },
  166. }
  167.  
  168. function Enchanter(event, plr, unit)
  169.     for _, v in ipairs(T["Menu"]) do
  170.         plr:GossipMenuAddItem(3, "Enchant "..v[1]..".", v[2], 0)
  171.     end
  172.     plr:GossipSendMenu(1, unit)
  173. end
  174.  
  175. function EnchanterSelect(event, plr, unit, slot, enchant, code)
  176.     if T[slot] then
  177.         for i, v in ipairs(T[slot]) do
  178.             plr:GossipMenuAddItem(3, "Enchant "..v[1].."", slot, v[2])
  179.         end
  180.         plr:GossipMenuAddItem(3, "[Back]", 99999999, 0) -- some nonexistant slot
  181.         plr:GossipSendMenu(1, unit)
  182.     else
  183.         Enchanter(event, plr, unit)
  184.     end
  185.     if T[slot] and enchant ~= 0 then
  186.         local realslot = slot >= 100 and slot/10 or slot
  187.         local item = plr:GetEquippedItemBySlot(realslot)
  188.         if item then
  189.             local WType = item:GetSubClass()
  190.             if slot == 150 then
  191.                 if not (WType == 1 or WType == 5 or WType == 6 or WType == 8 or WType == 10) then
  192.                     plr:SendAreaTriggerMessage("You don't have a Two-Handed Weapon equipped!")
  193.                     return
  194.                 end
  195.             elseif slot == 160 then
  196.                 if not (WType == 6) then
  197.                     plr:SendAreaTriggerMessage("You don't have a Shield equipped!")
  198.                     return
  199.                 end
  200.             end
  201.             item:ClearEnchantment(0,0)
  202.             item:SetEnchantment(enchant, 0, 0)
  203.             plr:PlayDirectSound(3337)
  204.         else
  205.             plr:SendAreaTriggerMessage("You have no item to enchant in the selected slot!")
  206.             return
  207.         end
  208.     end
  209. end
  210.  
  211. RegisterCreatureGossipEvent(npcid, 1, Enchanter)
  212. RegisterCreatureGossipEvent(npcid, 2, EnchanterSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement