diff --git a/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua b/data/scripts/globalevents/boss_lever_death.lua similarity index 99% rename from data-otservbr-global/scripts/globalevents/others/bosslever_death.lua rename to data/scripts/globalevents/boss_lever_death.lua index 9538fe15eb7..aa6745c3098 100644 --- a/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua +++ b/data/scripts/globalevents/boss_lever_death.lua @@ -1,22 +1,28 @@ local onBossDeath = CreatureEvent("BossLeverOnDeath") + function onBossDeath.onDeath(creature) if not creature then return true end + local name = creature:getName() local key = "boss." .. toKey(name) local zone = Zone(key) + if not zone then return true end + local bossLever = BossLever[name] if not bossLever then return true end + if bossLever.timeoutEvent then stopEvent(bossLever.timeoutEvent) bossLever.timeoutEvent = nil end + if bossLever.timeAfterKill > 0 then zone:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. name .. " has been defeated. You have " .. bossLever.timeAfterKill .. " seconds to leave the room.") bossLever.timeoutEvent = addEvent(function(zn)