2022-04-18 18:50:47 +03:00

38 lines
840 B
Lua

local throneStorages = {
17679,
17680,
17681,
17682,
17683,
17684,
17685
}
local function hasTouchedOneThrone(player)
for i = 1, #throneStorages do
if player:getStorageValue(throneStorages[i]) == 1 then
return true
end
end
return false
end
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
if not hasTouchedOneThrone(player) or player:getLevel() < 100 or player:getStorageValue(12160) < 20 then
player:teleportTo(fromPosition)
position:sendMagicEffect(CONST_ME_TELEPORT)
fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
return true
end
local destination = Position(33168, 31683, 15)
player:teleportTo(destination)
position:sendMagicEffect(CONST_ME_TELEPORT)
destination:sendMagicEffect(CONST_ME_TELEPORT)
return true
end