Estive sem tempo pra fazer nos últimos dias, caso ainda esteja precisando.
--<action itemid="5985" event="script" value="dungeon_door.lua"/>--
local levelNeeded = 100
local enterPosition = {x=795, y=500, z=7} -- Position que o player será levado
local timeToSendBack = 15 * 60 -- Tempo para retornar o player pro templo
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.aid == 5985 and getPlayerLevel(cid) >= levelNeeded then
setPlayerStorageValue(cid, 79932, 0)
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, enterPosition)
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
addEvent(function()
if getPlayerStorageValue(cid, 79932) < 1 then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
end, timeToSendBack*100)
end
return true
end
--<action actionid="5986" event="script" value="teleport_back.lua"/>--
local timeToSendBack = 15 -- Tempo para retornar o player pro templo
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.aid == 5986 then
addEvent(function()
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, 79932, 1)
end, timeToSendBack*1000)
end
return true
end