-- Rename both and call each of them in Player:onMoveItem()
function Player:onMoveItem1(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if item:getId() == 1300 and toPosition.x ~= CONTAINER_POSITION then
return false
else
self:sendTextMessage(MESSAGE_INFO_DESCR, "You moved item to inside a container.")
end
return true
end
function Player:onMoveItem2(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if toPosition.x == CONTAINER_POSITION and toCylinder and toCylinder:getId() == 17432 then
self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end
return true
end
function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
local ret1 = self:onMoveItem1(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
local ret2 = self:onMoveItem2(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
return ret1 and ret2
end