hucke.ducke
Tibia the real rpg. <3
Hello, i need to make some items unmovable by using an action id so i can mark them in the RME map editor.
I had that system in 0.36 but im super noob with programming, so i know it should be done in the player.lua, and i find something in the forum but doesn't work for my TFS 1.2.
Please can someone help me to make it work on my distro. Thanks !
I had that system in 0.36 but im super noob with programming, so i know it should be done in the player.lua, and i find something in the forum but doesn't work for my TFS 1.2.
Please can someone help me to make it work on my distro. Thanks !
Lua:
function Player:onMoveItem(item, count, fromPosition, toPosition)
if blockTeleportTrashing and toPosition.x ~= CONTAINER_POSITION then
local thing = Tile(toPosition):getItemByType(ITEM_TYPE_TELEPORT)
if thing then
self:sendCancelMessage('Sorry, not possible.')
self:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
end
if isInArray({1714, 1715, 1716, 1717, 1738, 1740, 1741, 1747, 1748, 1749}, item.itemid) and item.actionid > 0 or item.actionid == 5640 then
self:sendCancelMessage('You cannot move this object.')
return false
elseif item.itemid == 7466 then
self:sendCancelMessage('You cannot move this object.')
return false
end