Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. require("scripts/globals/settings");
  2. require("scripts/globals/titles");
  3. require("scripts/globals/quests");
  4.  
  5.  
  6. function onTrade(player,npc,trade)
  7.     local TextIDs = "scripts/zones/" .. player:getZoneName() .. "/TextIDs";
  8.     package.loaded[TextIDs] = nil;
  9.     require(TextIDs);
  10.  
  11.     local pewp = math.random(1,100)
  12.     local reward = 0
  13.     if (trade:hasItemQty(13916,1) and trade:getItemCount() == 1) then --
  14.         if pewp < 50 then
  15.             reward = 4446 -- Pumpkin Pie
  16.         end
  17.         if pewp >= 50 and pewp < 80 then
  18.             reward = 4525 -- Pumpkin Pie +1
  19.         end
  20.         if pewp >= 80 and pewp < 90 then
  21.             reward = 13916 -- Pumpkin Head
  22.         end
  23.         if pewp >= 90 then
  24.             reward = 15176 -- Pumpkin Head II
  25.         end
  26.     end
  27.     if (trade:hasItemQty(17565,1) and trade:getItemCount() == 1) then -- Trick Staff
  28.         if pewp < 50 then
  29.             reward = 4446 -- Pumpkin Pie
  30.         end
  31.         if pewp >= 50 and pewp < 80 then
  32.             reward = 5631 -- Pumpkin Cake
  33.         end
  34.         if pewp >= 80 and pewp < 90 then
  35.             reward = 4525 -- Pumpkin Pie +1
  36.         end
  37.         if pewp >= 90 then
  38.             reward = 17587 -- Trick Staff II
  39.         end
  40.     end
  41.     if (trade:hasItemQty(17566,1) and trade:getItemCount() == 1) then -- Treat Staff
  42.         if pewp < 50 then
  43.             reward = 4446 -- Pumpkin Pie
  44.         end
  45.         if pewp >= 50 and pewp < 80 then
  46.             reward = 5631 -- Pumpkin Cake
  47.         end
  48.         if pewp >= 80 and pewp < 90 then
  49.             reward = 4430 -- Pumpkin Soup
  50.         end
  51.         if pewp >= 90 then
  52.             reward = 17588 -- Treat Staff II
  53.         end
  54.     end
  55.    
  56.     if (player:getFreeSlotsCount() == 0 and reward > 0) then
  57.             player:messageSpecial( ITEM_CANNOT_BE_OBTAINED, reward);
  58.            
  59.     end
  60.  
  61.     if (player:getFreeSlotsCount() >= 1 and reward > 0) then
  62.         player:addItem(reward,1);
  63.         player:messageSpecial( ITEM_OBTAINED, reward );
  64.     end
  65. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement