adrianoswatt

doPlayerReceiveOnDepot

Dec 16th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. _ODIRION_RUNES_STTGS = {
  2.     runeids = {2287, 2288},
  3. }
  4.  
  5. function onPlayerBuyingMarket(cid, itembp, itemid, amount, town)
  6.     runelist = _ODIRION_RUNES_STTGS.runeids
  7.     local default_backpack = 2000
  8.     if isNumber(itembp) then default_backpack = tonumber(itembp) end
  9.     local name = getPlayerName(cid)
  10.     if isItemStackable(itemid) and not isInArray(runelist, itemid) then
  11.         local j = doCreateItemEx(default_backpack-1)
  12.         for a = 1, 20 do
  13.             doAddContainerItem(j, itemid, 100)
  14.         end
  15.         doPlayerSendMailByName(name, j, town, "")
  16.     elseif isInArray(runelist, itemid) then
  17.         local j = doCreateItemEx(default_backpack-1)
  18.         for a = 1, 20 do
  19.             doAddContainerItem(j, itemid, 100)
  20.         end
  21.         for x = 0, 19 do
  22.             remov = getContainerItem(j, x).uid
  23.             r = 100-amount
  24.             doRemoveItem(remov, r)
  25.         end
  26.         doPlayerSendMailByName(name, j, town, "")
  27.     else
  28.         local j = doCreateItemEx(itemid-1)
  29.         doPlayerSendMailByName(name, j, town, "")
  30.     end
  31. return true
  32. end
Advertisement
Add Comment
Please, Sign In to add comment