local items = {12670, 12661}
function searchContainers(uid,itemss)
local items = itemss
local containers = {}
local check = false
for i = 0, getContainerSize(uid)-1 do
local item = getContainerItem(uid,i)
if not isContainer(item.uid) then
if isInArray(items,item.itemid) then
check = true
end
else
table.insert(containers,item.uid)
end
end
for _, container in ipairs(containers) do
if searchContainers(container,items) then
check = true
break
end
end
return check
end
function onMoveItem(cid, item, formPosition, toPosition, fromItem, toItem, fromGround, toGround, status)
if status.inInv == 1 and status.inInvBag == 3 and status.inDepot == 3 and isInArray(items,getPlayerSlotItem(cid,status.slot).itemid ) then
doPlayerSendCancel(cid,"You can't drop a special item on the ground.")
doSendMagicEffect(getThingPos(cid),2)
return false
end
if (status.inInv == 0 and status.inInvBag == 3 and status.inDepot == 3) or
(status.inDepot == 0 and status.inInv == 3 and status.inInvBag == 3 ) or
(status.inInvBag == 0 and status.inDepot == 3 and status.inInv == 3) then
if not isContainer(item.uid) then
if isInArray(items,item.itemid) then
doPlayerSendCancel(cid,"You can't drop a special item on the ground.")
doSendMagicEffect(getThingPos(cid),2)
return false
end
else
if searchContainers(item.uid,items) then
doPlayerSendCancel(cid,"You can't throw this bag that contains special item[s] on ground")
doSendMagicEffect(getThingPos(cid),2)
return false
end
end
end
return true
end