forgottenserver/data/scripts/movements/quest_door.lua
Marco ad6a00db48
Comparison Updates: Replacing -1 with nil Checks in Multiple Files (#4578)
* refactor: replace -1 with nil

* refactor: replace nil checks with not in conditions

* resolve conversation

* revert this

* Update login.lua
2023-12-04 13:59:19 -06:00

20 lines
540 B
Lua

local questDoor = MoveEvent()
questDoor:type("stepin")
function questDoor.onStepIn(creature, item, position, fromPosition)
if not creature:isPlayer() then
return false
end
if not creature:getStorageValue(item.actionid) and not creature:getGroup():getAccess() then
creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
creature:teleportTo(fromPosition, true)
return false
end
return true
end
for _, i in ipairs(openQuestDoors) do
questDoor:id(i)
end
questDoor:register()