stoneharry

Untitled

Jun 24th, 2011
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.88 KB | None | 0 0
  1.  
  2. function ItemExchangerGossip(pUnit, event, player)
  3.    pUnit:GossipCreateMenu(1, player, 0)
  4.    pUnit:GossipMenuAddItem(4, "Exchange Warsong Gulch Marks (Enter how many)", 245, 1)
  5.    pUnit:GossipMenuAddItem(4, "Exchange Arathi Basin Marks (Enter how many)", 246, 1)
  6.    pUnit:GossipMenuAddItem(4, "Exchange Eye of the Storm Marks (Enter how many)", 247, 1)
  7.    pUnit:GossipMenuAddItem(0, "Nevermind.", 250, 0)
  8.    pUnit:GossipSendMenu(player)
  9. end
  10.  
  11. function ItemExchangerGossipSelect(pUnit, event, player, id, intid, code)
  12.     if tonumber(code) ~= nil then
  13.         code = tonumber(code)
  14.         if code > 0 and code < 1000 then
  15.             if(intid == 245) then
  16.                 local amount = player:GetItemCount(20558) -- WSG
  17.                 if amount ~= nil then
  18.                     if tonumber(amount) ~= 0 then
  19.                         if tonumber(amount) >= code then
  20.                             player:RemoveItem(20558, code)
  21.                             player:AddItem(47241, code)
  22.                         else
  23.                             pUnit:SendAreaTriggerMessage("You do not have enough marks!")
  24.                         end
  25.                     end
  26.                 end
  27.             end
  28.             if(intid == 246) then
  29.                 local amount = player:GetItemCount(20559) -- AB
  30.                 if amount ~= nil then
  31.                     if tonumber(amount) ~= 0 then
  32.                         if tonumber(amount) >= code then
  33.                             player:RemoveItem(20559, code)
  34.                             player:AddItem(47241, code)
  35.                         else
  36.                             pUnit:SendAreaTriggerMessage("You do not have enough marks!")
  37.                         end
  38.                     end
  39.                 end
  40.             end
  41.             if(intid == 247) then
  42.                 local amount = player:GetItemCount(29024) -- EOTS
  43.                 if amount ~= nil then
  44.                     if tonumber(amount) ~= 0 then
  45.                         if tonumber(amount) >= code then
  46.                             player:RemoveItem(29024, code)
  47.                             player:AddItem(47241, code)
  48.                         else
  49.                             pUnit:SendAreaTriggerMessage("You do not have enough marks!")
  50.                         end
  51.                     end
  52.                 end
  53.             end
  54.         end
  55.     end
  56.     player:GossipComplete()
  57. end
  58.  
  59. RegisterUnitGossipEvent(75000, 1, "ItemExchangerGossip")
  60. RegisterUnitGossipEvent(75000, 2, "ItemExchangerGossipSelect")
Advertisement
Add Comment
Please, Sign In to add comment