Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _ODIRION_RUNES_STTGS = {
- runeids = {2287, 2288},
- }
- function onPlayerBuyingMarket(cid, itembp, itemid, amount, town)
- runelist = _ODIRION_RUNES_STTGS.runeids
- local default_backpack = 2000
- if isNumber(itembp) then default_backpack = tonumber(itembp) end
- local name = getPlayerName(cid)
- if isItemStackable(itemid) and not isInArray(runelist, itemid) then
- local j = doCreateItemEx(default_backpack-1)
- for a = 1, 20 do
- doAddContainerItem(j, itemid, 100)
- end
- doPlayerSendMailByName(name, j, town, "")
- elseif isInArray(runelist, itemid) then
- local j = doCreateItemEx(default_backpack-1)
- for a = 1, 20 do
- doAddContainerItem(j, itemid, 100)
- end
- for x = 0, 19 do
- remov = getContainerItem(j, x).uid
- r = 100-amount
- doRemoveItem(remov, r)
- end
- doPlayerSendMailByName(name, j, town, "")
- else
- local j = doCreateItemEx(itemid-1)
- doPlayerSendMailByName(name, j, town, "")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment