Advertisement
Tearrain

itemupgrader

Jul 13th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.60 KB | None | 0 0
  1. local npcid = 600075
  2. local tokenid = 600182
  3.  
  4. local T = {
  5.                [1] = { "Torment 1", 1, --
  6.                     {"One-Handed Axe of starry heavens (100 Token)", 0, 400},
  7.                     {"Two-Handed Axe of starry heavens (100 Token)", 0, 401},
  8.                     {"Bow of starry heavens (100 Token)", 0, 402},
  9.                     {"Gun of starry heavens (100 Token)", 0, 403},
  10.                     {"One-Handed Sword of starry heavens (100 Token)", 0, 404},
  11.                     {"Two-Handed Sword of starry heavens (100 Token)", 0, 405},
  12.                     {"Stave of starry heavens (100 Token)", 0, 406},
  13.                     {"Wand of starry heavens (100 Token)", 0, 407},
  14.                     {"Dagger of starry heavens (100 Token)", 0, 408},
  15.                     {"One-Handed Mace of starry heavens (100 Token)", 0, 418},
  16.                     {"Two-Handed Mace of starry heavens (100 Token)", 0, 419},
  17.  
  18.             },
  19.             [2] = { "Torment 2", 2, --
  20.                     {"One-Handed Axe of starry heavens (500 Token)", 0, 409},
  21.                     {"Two-Handed Axe of starry heavens (500 Token)", 0, 410},
  22.                     {"Bow of starry heavens (500 Token)", 0, 411},
  23.                     {"Gun of starry heavens (500 Token)", 0, 412},
  24.                     {"One-Handed Sword of starry heavens (500 Token)", 0, 413},
  25.                     {"Two-Handed Sword of starry heavens (500 Token)", 0, 414},
  26.                     {"Stave of starry heavens (500 Token)", 0, 415},
  27.                     {"Wand of starry heavens (500 Token)", 0, 416},
  28.                     {"Dagger of starry heavens (500 Token)", 0, 417},
  29.                     {"One-Handed Mace of starry heavens (500 Token)", 0, 420},
  30.                     {"Two-Handed Mace of starry heavens (500 Token)", 0, 421},
  31.             },
  32.     };
  33.  
  34.  
  35.      
  36.     --[[ CODE STUFFS! DO NOT EDIT BELOW ]]--
  37.     --[[ UNLESS YOU KNOW WHAT YOU'RE DOING! ]]--
  38.      
  39. function Vendor_Gossip(event, player, unit)
  40.             if (#T <= 100) then
  41.                     for i, v in ipairs(T) do
  42.                                     player:GossipMenuAddItem(0, v[1], 0, i)
  43.                             end
  44.                     end
  45.                     player:GossipSendMenu(1, unit)
  46.             end  
  47.      
  48. function Vendor_OnSelect(event, player, unit, sender, intid, code)
  49.            if(intid == 0) then
  50.                     Vendor_Gossip(event, player, unit)
  51.             elseif(intid <= 100) then
  52.                     for i, v in ipairs(T[intid]) do
  53.                             if (i > 2) then
  54.                                     player:GossipMenuAddItem(0, v[1], 0, v[3])
  55.                             end
  56.                     end
  57.                     player:GossipMenuAddItem(0, "Back", 0, 0)
  58.                     player:GossipSendMenu(1, unit)
  59.                     end
  60.                 --1axet1
  61.                     if(intid == 400) then
  62.                     if player:GetItemCount(tokenid) >100 then
  63.                     player:RemoveItem(tokenid, 100)
  64.                     player:AddItem(600183, 1)
  65.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  66.                     player:GossipComplete()
  67.                     else
  68.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  69.                     player:GossipComplete()
  70.                 end
  71.             end    
  72.                 --2axet1
  73.                     if(intid == 401) then
  74.                     if player:GetItemCount(tokenid) >100 then
  75.                     player:RemoveItem(tokenid, 100)
  76.                     player:AddItem(600184, 1)
  77.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  78.                     player:GossipComplete()
  79.                     else
  80.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  81.                     player:GossipComplete()
  82.                 end
  83.             end            
  84.             --bt1
  85.                     if(intid == 402) then
  86.                     if player:GetItemCount(tokenid) >100 then
  87.                     player:RemoveItem(tokenid, 100)
  88.                     player:AddItem(600185, 1)
  89.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  90.                     player:GossipComplete()
  91.                     else
  92.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  93.                     player:GossipComplete()
  94.                 end
  95.             end
  96.             --gt1
  97.                     if(intid == 403) then
  98.                     if player:GetItemCount(tokenid) >100 then
  99.                     player:RemoveItem(tokenid, 100)
  100.                     player:AddItem(600186, 1)
  101.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  102.                     player:GossipComplete()
  103.                     else
  104.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  105.                     player:GossipComplete()
  106.                 end
  107.             end
  108.            
  109.                 --1hst1
  110.                     if(intid == 404) then
  111.                     if player:GetItemCount(tokenid) >100 then
  112.                     player:RemoveItem(tokenid, 100)
  113.                     player:AddItem(600187, 1)
  114.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  115.                     player:GossipComplete()
  116.                     else
  117.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  118.                     player:GossipComplete()
  119.                 end
  120.             end
  121.                 --2hst1
  122.                     if(intid == 405) then
  123.                     if player:GetItemCount(tokenid) >100 then
  124.                     player:RemoveItem(tokenid, 100)
  125.                     player:AddItem(600188, 1)
  126.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  127.                     player:GossipComplete()
  128.                     else
  129.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  130.                     player:GossipComplete()
  131.                 end
  132.             end
  133.                 --st1
  134.                     if(intid == 406) then
  135.                     if player:GetItemCount(tokenid) >100 then
  136.                     player:RemoveItem(tokenid, 100)
  137.                     player:AddItem(600189, 1)
  138.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  139.                     player:GossipComplete()
  140.                     else
  141.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  142.                     player:GossipComplete()
  143.                 end
  144.             end
  145.                 --wt1
  146.                     if(intid == 407) then
  147.                     if player:GetItemCount(tokenid) >100 then
  148.                     player:RemoveItem(tokenid, 100)
  149.                     player:AddItem(600190, 1)
  150.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  151.                     player:GossipComplete()
  152.                     else
  153.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  154.                     player:GossipComplete()
  155.                 end
  156.             end
  157.                 --dt1
  158.                     if(intid == 408) then
  159.                     if player:GetItemCount(tokenid) >100 then
  160.                     player:RemoveItem(tokenid, 100)
  161.                     player:AddItem(600191, 1)
  162.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  163.                     player:GossipComplete()
  164.                     else
  165.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  166.                     player:GossipComplete()
  167.                 end
  168.             end
  169.                 --1mt1
  170.                     if(intid == 418) then
  171.                     if player:GetItemCount(tokenid) >100 then
  172.                     player:RemoveItem(tokenid, 100)
  173.                     player:AddItem(600192, 1)
  174.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  175.                     player:GossipComplete()
  176.                     else
  177.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  178.                     player:GossipComplete()
  179.                 end
  180.             end
  181.                 --2mt1
  182.                     if(intid == 419) then
  183.                     if player:GetItemCount(tokenid) >100 then
  184.                     player:RemoveItem(tokenid, 100)
  185.                     player:AddItem(600193, 1)
  186.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  187.                     player:GossipComplete()
  188.                     else
  189.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  190.                     player:GossipComplete()
  191.                 end
  192.             end
  193.                 --1axet2
  194.                     if(intid == 409) then
  195.                     if player:GetItemCount(tokenid) >500 then
  196.                     if player:GetItemCount(600183) >0 then
  197.                     player:RemoveItem(tokenid, 500)
  198.                     player:RemoveItem(600183, 1)
  199.                     player:AddItem(600194, 1)
  200.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  201.                     player:GossipComplete()
  202.                     else
  203.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  204.                     player:GossipComplete()
  205.                 end
  206.             end
  207.         end
  208.                 --2axet2
  209.                     if(intid == 410) then
  210.                     if player:GetItemCount(tokenid) >500 then
  211.                     if player:GetItemCount(600184) >0 then
  212.                     player:RemoveItem(tokenid, 500)
  213.                     player:RemoveItem(600184, 1)
  214.                     player:AddItem(600195, 1)
  215.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  216.                     player:GossipComplete()
  217.                     else
  218.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  219.                     player:GossipComplete()
  220.                 end
  221.             end
  222.         end
  223.             --bt2
  224.                     if(intid == 411) then
  225.                     if player:GetItemCount(tokenid) >500 then
  226.                     if player:GetItemCount(600185) >0 then
  227.                     player:RemoveItem(tokenid, 500)
  228.                     player:RemoveItem(600185, 1)
  229.                     player:AddItem(600196, 1)
  230.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  231.                     player:GossipComplete()
  232.                     else
  233.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  234.                     player:GossipComplete()
  235.                 end
  236.             end
  237.         end
  238.             --gt2
  239.                     if(intid == 412) then
  240.                     if player:GetItemCount(tokenid) >500 then
  241.                     if player:GetItemCount(600186) >0 then
  242.                     player:RemoveItem(tokenid, 500)
  243.                     player:RemoveItem(600186, 1)
  244.                     player:AddItem(600197, 1)
  245.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  246.                     player:GossipComplete()
  247.                     else
  248.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  249.                     player:GossipComplete()
  250.                 end
  251.             end
  252.         end        
  253.                 --1hst2
  254.                     if(intid == 413) then
  255.                     if player:GetItemCount(tokenid) >500 then
  256.                     if player:GetItemCount(600187) >0 then
  257.                     player:RemoveItem(tokenid, 500)
  258.                     player:RemoveItem(600187, 1)
  259.                     player:AddItem(600198, 1)
  260.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  261.                     player:GossipComplete()
  262.                     else
  263.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  264.                     player:GossipComplete()
  265.                 end
  266.             end
  267.         end
  268.                 --2hst2
  269.                     if(intid == 414) then
  270.                     if player:GetItemCount(tokenid) >500 then
  271.                     if player:GetItemCount(600188) >0 then
  272.                     player:RemoveItem(tokenid, 500)
  273.                     player:RemoveItem(600188, 1)
  274.                     player:AddItem(600199, 1)
  275.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  276.                     player:GossipComplete()
  277.                     else
  278.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  279.                     player:GossipComplete()
  280.                 end
  281.             end
  282.         end
  283.                 --st2
  284.                     if(intid == 415) then
  285.                     if player:GetItemCount(tokenid) >500 then
  286.                     if player:GetItemCount(600189) >0 then
  287.                     player:RemoveItem(tokenid, 500)
  288.                     player:RemoveItem(600189, 1)
  289.                     player:AddItem(600200, 1)
  290.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  291.                     player:GossipComplete()
  292.                     else
  293.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  294.                     player:GossipComplete()
  295.                 end
  296.             end
  297.         end
  298.                 --wt2
  299.                     if(intid == 416) then
  300.                     if player:GetItemCount(tokenid) >500 then
  301.                     if player:GetItemCount(600190) >0 then
  302.                     player:RemoveItem(tokenid, 500)
  303.                     player:RemoveItem(600190, 1)
  304.                     player:AddItem(600201, 1)
  305.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  306.                     player:GossipComplete()
  307.                     else
  308.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  309.                     player:GossipComplete()
  310.                 end
  311.             end
  312.         end
  313.                 --dt2
  314.                     if(intid == 417) then
  315.                     if player:GetItemCount(tokenid) >500 then
  316.                     if player:GetItemCount(600191) >0 then
  317.                     player:RemoveItem(tokenid, 500)
  318.                     player:RemoveItem(600191, 1)
  319.                     player:AddItem(600202, 1)
  320.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  321.                     player:GossipComplete()
  322.                     else
  323.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  324.                     player:GossipComplete()
  325.                 end
  326.             end
  327.         end
  328.                 --1mt2
  329.                     if(intid == 420) then
  330.                     if player:GetItemCount(tokenid) >500 then
  331.                     if player:GetItemCount(600192) >0 then
  332.                     player:RemoveItem(tokenid, 500)
  333.                     player:RemoveItem(600191, 1)
  334.                     player:AddItem(600203, 1)
  335.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  336.                     player:GossipComplete()
  337.                     else
  338.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  339.                     player:GossipComplete()
  340.                 end
  341.             end
  342.         end
  343.                 --2mt2
  344.                     if(intid == 421) then
  345.                     if player:GetItemCount(tokenid) >500 then
  346.                     if player:GetItemCount(600193) >0 then
  347.                     player:RemoveItem(tokenid, 500)
  348.                     player:RemoveItem(600193, 1)
  349.                     player:AddItem(600204, 1)
  350.                     player:SendBroadcastMessage("Hier habt Ihr euer Item!")
  351.                     player:GossipComplete()
  352.                     else
  353.                     player:SendBroadcastMessage("Du hast nicht genug Gutscheine!")
  354.                     player:GossipComplete()
  355.                 end
  356.             end
  357.         end
  358.     end
  359.  
  360.  
  361. RegisterCreatureGossipEvent(npcid, 1, Vendor_Gossip)
  362. RegisterCreatureGossipEvent(npcid, 2, Vendor_OnSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement