Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warmane-TowerDefense: revise combat detection #237

Merged
merged 5 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions DBM-Core/DBM-Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ local function currentFullDate()
end

DBM = {
Revision = parseCurseDate("20241228174232"),
Revision = parseCurseDate("20241231163959"),
DisplayVersion = "10.1.13 alpha", -- the string that is shown as version
ReleaseRevision = releaseDate(2024, 07, 20) -- the date of the latest stable version that is available, optionally pass hours, minutes, and seconds for multiple releases in one day
}
Expand Down Expand Up @@ -5464,7 +5464,9 @@ do
return true
end
--Current player level non Mythic raid
if self.Options.LogCurrentRaids and instanceDifficultyBylevel[LastInstanceMapID] and (instanceDifficultyBylevel[LastInstanceMapID][1] >= playerLevel) and (instanceDifficultyBylevel[LastInstanceMapID][2] == 3) and difficultyIndex ~= 16 then
if self.Options.LogCurrentRaids and instanceDifficultyBylevel[LastInstanceMapID] and (instanceDifficultyBylevel[LastInstanceMapID][1] >= playerLevel) and (instanceDifficultyBylevel[LastInstanceMapID][2] == 3) and difficultyIndex ~= 16
or difficultyIndex == 18 -- Custom (Warmane Events)
then
return true
end
--Trivial raid (ie one below players level)
Expand Down
35 changes: 19 additions & 16 deletions DBM-WorldEvents/WarmaneEvents/TowerDefense.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
local mod = DBM:NewMod("WarmaneTowerDefense", "DBM-WorldEvents", 2)
local L = mod:GetLocalizedStrings()

mod:SetRevision("20241231101506")
mod:SetRevision("20241231161938")
mod:SetHotfixNoticeRev(20241231000000)
mod.noStatistics = true
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)

local timerToResurrect = mod:NewNextTimer(30, 72423, nil, nil, nil, 6)
local timerCombatStart = mod:NewCombatTimer(45)
local timerCombatStart = mod:NewCombatTimer(30)

mod:RemoveOption("HealthFrame")

Expand Down Expand Up @@ -105,31 +113,26 @@ 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 == "30" then
timerCombatStart:Start()
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()
-- timerCombatStart:Start(45) -- Disabled here, since EndCombat schedules timer stops after 3s

if self.Options.RangeFrame then
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
Loading