local config = {
teleportId = 27723,
days = {
["Tuesday"] = {Position(998, 996, 7), Position(1487, 308, 13)},
},
bossPosition = Position(1507, 309, 14),
bossName = "Gaz'haragoth",
spawnTime = '18:43:00',
teleportDuration = 5 * 60 * 1000,
}
local Gazharagoth = GlobalEvent("Gazharagoth")
local function removeTeleport()
local teleportItem = Tile(config.days["Tuesday"][1]):getItemById(config.teleportId)
if teleportItem then
teleportItem:remove()
end
end
function Gazharagoth.onTime(interval)
local day = config.days[os.date("%A")]
if day then
Game.broadcastMessage(config.bossName .. ' Em vingança pela morte do meu irmão, eu devastarei este continente!', MESSAGE_GAME_HIGHLIGHT)
Game.broadcastMessage(config.bossName .. ' Em vingança pela morte do meu irmão, eu devastarei este continente!', MESSAGE_EVENT_ADVANCE)
local item = Game.createItem(config.teleportId, 1, day[1])
if item and item:isTeleport() then
item:setDestination(day[2])
addEvent(function()
Game.createMonster(config.bossName, config.bossPosition, false, true)
addEvent(removeTeleport, config.teleportDuration)
end, 5000)
end
end
return true
end
Gazharagoth:time(config.spawnTime)
Gazharagoth:register()


info
Grupo: Campones
Registrado: 03/05/18
Posts: 4
Reputação: 0
essa action que eu tenho funciona perfeitamente. só preciso que ela remova o teleport depois de 5 mim. alguem poderia ajudar o amigo!
local config = {
teleportId = 27723,
days = {
["Tuesday"] = {Position(998, 996, 7), Position(1487, 308, 13)}, -- Morshabaal - monday-Segunda, tuesday-Terça, wednesday-Quarta, thursday-Quinta, friday-Sexta, saturday-Sabado and sunday-Domingo
},
bossPosition = Position(1507, 309, 14),
bossName = "Gaz'haragoth",
spawnTime = '18:43:00'
}
local Gazharagoth = GlobalEvent("Gazharagoth")
function Gazharagoth.onTime(interval)
local day = config.days[os.date("%A")]
if day then
Game.broadcastMessage(config.bossName .. ' In revenge for my brother death, I will devastate this continent!', MESSAGE_GAME_HIGHLIGHT)
Game.broadcastMessage(config.bossName .. ' In revenge for my brother death, I will devastate this continent!', MESSAGE_EVENT_ADVANCE)
local item = Game.createItem(config.teleportId, 1, day[1])
if item then
if not item:isTeleport() then
item:remove()
return false
end
item:setDestination(day[2])
end
addEvent(function()
Game.createMonster(config.bossName, config.bossPosition, false, true)
end, 5000)
end
return true
end
Gazharagoth:time(config.spawnTime)
Gazharagoth:register()