CONTAINER_BONUSID = 1987
ITEMCONDITIONS = {
[2158] = function ()
-- add remove condition
end,
}
function Player:onMoveItem(item, count, fromPosition, toPosition)
local moveitemid = item:getId()
if ITEMCONDITIONS[moveitemid] then
local guid = self:getGuid()
if toPosition.x == CONTAINER_POSITION then
if toPosition.y >= 64 then
local container = self:getContainerById(toPosition.y-64)
local topparent = container:getTopParent()
local moveToItem = container:getItem(toPosition.z)
if topparent and topparent:isPlayer() and topparent:getGuid() == self:getGuid() then
local itemid = container:getId()
if itemid == CONTAINER_BONUSID then
if container:getSize() < container:getCapacity() then
print("Moved item inside")
end
elseif moveToItem then
if moveToItem:getId() == CONTAINER_BONUSID then
print("Moved item inside")
end
end
end
else
local citem = self:getSlotItem(toPosition.y)
if citem and citem:getId() == CONTAINER_BONUSID then
local container = Container(citem:getUniqueId())
if container then
if container:getSize() < container:getCapacity() then
print("Moved item inside")
end
end
end
end
end
if fromPosition.x == CONTAINER_POSITION then
if fromPosition.y >= 64 then
local container = self:getContainerById(fromPosition.y-64)
local topparent = container:getTopParent()
if topparent and topparent:isPlayer() and topparent:getGuid() == self:getGuid() then
print("Moved item outside")
end
end
end
end
return true
end