Skip to content

Commit

Permalink
chore: boss lever death to core
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Apr 4, 2024
1 parent 0bb10ab commit 5797ec7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 5797ec7

Please sign in to comment.