function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if(toPosition.x == 0xFFFF) then
if(toPosition.y >= 64) then
local container = self:getContainerById(toPosition.y-64)
if(container) then
local backpack = backpacks[container:getId()]
if(backpack and not(isInArray(backpack, item:getId()))) then
self:sendTextMessage(MESSAGE_STATUS_SMALL, "You may carry only runes of specific type in this backpack, nothing else.")
return false
else
local slot = toPosition.z
if(slot < container:getSize()) then
local c = container:getItem(slot)
if(c and c:isContainer()) then
backpack = backpacks[c:getId()]
if(backpack and not(isInArray(backpack, item:getId()))) then
self:sendTextMessage(MESSAGE_STATUS_SMALL, "You may carry only runes of specific type in this backpack, nothing else.")
return false
end
end
end
end
end
else
local container = self:getSlotItem(toPosition.y)
if(container) then
local backpack = backpacks[container:getId()]
if(backpack and not(isInArray(backpack, item:getId()))) then
self:sendTextMessage(MESSAGE_STATUS_SMALL, "You may carry only runes of specific type in this backpack, nothing else.")
return false
end
end
end
end
return true
end
-- Rune emblem system :: backpacks only for certain runes
local runy = {
{backpack = 5322, runes = 3174}, -- LMM
{backpack = 5320, runes = 3198}, -- Heavy Magic Missile
{backpack = 5321, runes = 3152}, -- Intense Healing Rune
{backpack = 5319, runes = 2304}, -- Great Fireball
{backpack = 5326, runes = 3160}, -- Ultimate Healing Rune
{backpack = 5318, runes = 3200}, -- Explosion
{backpack = 5324, runes = 3180}, -- Magic Wall
{backpack = 5325, runes = 3155}, -- Sudden Death Rune
}
-- Rune emblem system :: backpacks only for certain runes //
if toPosition.x == CONTAINER_POSITION then <<LINE 130
local niceContainer = nil
if toCylinder:isCreature() then
local target = self:getSlotItem(toPosition.y)
if target then
niceContainer = NICE_CONTAINERS_SET[target:getId()]
end
else
local target = toCylinder:getItem(toPosition.z)
if target and target:isContainer() then
niceContainer = NICE_CONTAINERS_SET[target:getId()]
else
niceContainer = NICE_CONTAINERS_SET[toCylinder:getId()]
end
end
if niceContainer then
local fit = false
if type(niceContainer) == 'table' then
if isInArray(niceContainer, item:getId()) then
fit = true
end
elseif item:getId() == niceContainer then
fit = true
end
if not fit then
self:sendTextMessage(MESSAGE_STATUS_SMALL, "You may carry only specific items in this backpack.")
return false
end
end
end
-- // Rune emblem system