local config = {
specialFloorIds = {10003,10004},-- Special floor IDs
requiredBootsId = 7457 -- Required item ID (boots)
}
local specialFloor = MoveEvent()
function specialFloor.onStepIn(creature, item, position, fromPosition)
if not creature:isPlayer() then
return true
end
local player = creature:getPlayer()
local boots = player:getSlotItem(CONST_SLOT_FEET)
if not boots or boots:getId() ~= config.requiredBootsId then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need to wear the special boots to step on this floor.")
player:teleportTo(fromPosition, true)
position:sendMagicEffect(CONST_ME_POFF)
return false
end
player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Welcome to the special floor!")
return true
end
for _, index in pairs(config.specialFloorIds) do
specialFloor:uid(index)
end
specialFloor:type("stepin")
specialFloor:register()