Skip to content

Commit

Permalink
Warmane-TowerDefense: remake Combat detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Zidras committed Dec 31, 2024
1 parent ef7ced8 commit c4c65e5
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions DBM-WorldEvents/WarmaneEvents/TowerDefense.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
local mod = DBM:NewMod("WarmaneTowerDefense", "DBM-WorldEvents", 2)
local L = mod:GetLocalizedStrings()

mod:SetRevision("20241230230506")
mod.noStatistics = true
mod:SetRevision("20241230233433")
mod.noStatistics = true -- needed to avoid Start/End chat messages, as well as other interactions not really suited for this event (wave based)

mod:RegisterCombat("emote_regex", L.RoundStart)
mod:SetWipeTime(100) -- random number, just to reach waves/not assume wipe

mod:RegisterEvents(
"CHAT_MSG_RAID_BOSS_EMOTE"
)

mod:RegisterEventsInCombat(
"SPELL_CAST_START 31999 73775 15847 21099",
"SPELL_AURA_APPLIED 36096 66009 73061 21098 22067"
)

-- General
local warnBossNow = mod:NewSpellAnnounce(31315, 1)

Expand Down Expand Up @@ -102,20 +110,14 @@ end
function mod:CHAT_MSG_RAID_BOSS_EMOTE(msg)
if msg:match(L.RoundStart) then
self.vb.roundCounter = msg:match(L.RoundStart)
-- DBM:StartCombat(self, 0, "MONSTER_MESSAGE")
DBM:AddSpecialEventToTranscriptorLog("Started round" .. self.vb.roundCounter or "nil")
DBM:AddSpecialEventToTranscriptorLog("Started round" .. (self.vb.roundCounter or "nil"))
resurrectionTicker(self)
if (self.vb.roundCounter % 4 == 0) then -- Boss spawns every 4 rounds
warnBossNow:Show()
end
self:RegisterShortTermEvents(
"SPELL_CAST_START 31999 73775 15847 21099",
"SPELL_AURA_APPLIED 36096 66009 73061 21098 22067"
)
elseif msg:match(L.RoundComplete) then -- victory
-- DBM:EndCombat(self)
self:Stop()
DBM:AddSpecialEventToTranscriptorLog("Completed round" .. self.vb.roundCounter or "nil")
DBM:EndCombat(self)
DBM:AddSpecialEventToTranscriptorLog("Completed round" .. (self.vb.roundCounter or "nil"))
self:Unschedule(resurrectionTicker)
self:UnregisterShortTermEvents()
timerCombatStart:Start()
Expand All @@ -124,9 +126,8 @@ function mod:CHAT_MSG_RAID_BOSS_EMOTE(msg)
DBM.RangeCheck:Hide()
end
elseif msg:find(L.RoundFailed) then -- wipe
-- DBM:EndCombat(self, true)
self:Stop()
DBM:AddSpecialEventToTranscriptorLog("Wiped on round" .. self.vb.roundCounter or "nil")
DBM:EndCombat(self, true)
DBM:AddSpecialEventToTranscriptorLog("Wiped on round" .. (self.vb.roundCounter or "nil"))
self:Unschedule(resurrectionTicker)
self:UnregisterShortTermEvents()

Expand Down

0 comments on commit c4c65e5

Please sign in to comment.