Skip to content

Commit

Permalink
Chromaggus: Add timers for Breath Volley and Fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
emmericp committed Oct 13, 2024
1 parent 60e3d05 commit ba3d07a
Show file tree
Hide file tree
Showing 5 changed files with 368 additions and 11 deletions.
67 changes: 60 additions & 7 deletions DBM-Raids-Vanilla/BWL/Chromaggus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mod:RegisterCombat("combat")

mod:RegisterEventsInCombat(
"SPELL_CAST_START 23308 23309 23313 23314 23187 23189 23315 23316 23310 23312",
"SPELL_CAST_SUCCESS 467883 468594",
"SPELL_AURA_APPLIED 23155 23169 23153 23154 23170 23128 23537 22277 22278 22279 22280 22281",
"SPELL_AURA_REMOVED 23155 23169 23153 23154 23170 23128",
"UNIT_HEALTH",
Expand All @@ -42,15 +43,22 @@ local warnFrenzy = mod:NewSpellAnnounce(23128, 3, nil, "Tank|RemoveEnrage|Heale
local warnPhase2Soon = mod:NewPrePhaseAnnounce(2, 1)
local warnPhase2 = mod:NewPhaseAnnounce(2)
local warnMutation = mod:NewCountAnnounce(23174, 4) ---@type Announce -- string as count in :Show() is unusual but valid
local warnVuln = mod:NewAnnounce("WarnVulnerable", 1, nil, nil, "WarnVulnNew")
local warnVuln = mod:NewAnnounce("WarnVulnerable", 1, nil, nil, "WarnVulnerableNew")
local warnRollOverSoon = mod:NewSoonAnnounce(468199)
local warnRollOver = mod:NewSpellAnnounce(468199)
local warnFetch = mod:NewSpellAnnounce(467884)

local specWarnBronze = mod:NewSpecialWarningYou(23170, nil, nil, nil, 1, 8)
local specWarnFrenzy = mod:NewSpecialWarningDispel(23128, "RemoveEnrage", nil, nil, 1, 6)
local specWarnBronze = mod:NewSpecialWarningYou(23170, nil, nil, nil, 1, 8)
local specWarnFrenzy = mod:NewSpecialWarningDispel(23128, "RemoveEnrage", nil, nil, 1, 6)
local specWarnBreathSoon = mod:NewSpecialWarningSoon(17087)

local timerBreath = mod:NewTimer(2, "TimerBreath", 23316, nil, nil, 3)
local timerBreathCD = mod:NewTimer(60, "TimerBreathCD", 23316, nil, nil, 3)
local timerAllBreaths = mod:NewTimer(80, "TimerAllBreaths", 23316, nil, nil, 3)
local timerFrenzy = mod:NewBuffActiveTimer(8, 23128, nil, "Tank|RemoveEnrage|Healer", 3, 5, nil, DBM_COMMON_L.TANK_ICON..DBM_COMMON_L.ENRAGE_ICON)
local timerVuln = mod:NewTimer(19.5, "TimerVulnCD", nil, nil, nil, nil, nil, true) -- seen 16.94 - 25.53, avg 21.8; extreme outliers are somewhat rare, so going for 19.5
local timerFetch = mod:NewCDTimer(40, 467884)
local timerRollOver = mod:NewBuffActiveTimer(16, 468199)

mod:AddNamePlateOption("NPAuraOnVulnerable", 22277)
mod:AddInfoFrameOption(22277, true)
Expand Down Expand Up @@ -152,19 +160,31 @@ local function checkTargetVulnerabilities(self)
updateVulnerability(self, spellId)
end

local nextBreath, nextVolley, volleyCount = 0, 0, 0
local rolloverWarnShown
function mod:OnCombatStart(delay)
self:SetStage(1)
rolloverWarnShown = false
nextBreath = GetTime() + 30 - delay
nextVolley = GetTime() + 40 - delay
volleyCount = 0
timerBreathCD:Start(30-delay, L.Breath1)
timerBreathCD:Start(60-delay, L.Breath2)--60
specWarnBreathSoon:Schedule(27-delay) -- +2 sec casting time == you got 5 seconds to run
specWarnBreathSoon:Schedule(57-delay)
mydebuffs = 0
if self.Options.NPAuraOnVulnerable then
DBM:FireEvent("BossMod_EnableHostileNameplates")
end
checkTargetVulnerabilities(self)
if self:IsBwlBlackEssenceEnabled() then
timerFetch:Start(20.9-delay)
timerAllBreaths:Start(40-delay)
specWarnBreathSoon:Schedule(37-delay)
end
end

function mod:OnCombatEnd()
self:UnregisterShortTermEvents()
if self.Options.NPAuraOnVulnerable then
DBM.Nameplate:Hide(true, nil, nil, nil, true, true)--isGUID, unit, spellId, texture, force, isHostile, isFriendly
end
Expand All @@ -173,13 +193,39 @@ function mod:OnCombatEnd()
end
end

function mod:SPELL_CAST_SUCCESS(args)
if args:IsSpell(467883) then
warnFetch:Show()
timerFetch:Start()
elseif args:IsSpell(468594) then
timerRollOver:Start()
warnRollOver:Show()
end
end

function mod:SPELL_CAST_START(args)
if args:IsSpell(23308, 23309, 23313, 23314, 23187, 23189, 23315, 23316, 23310, 23312) then
warnBreath:Show(args.spellName)
timerBreath:Start(2, args.spellName)
timerBreath:UpdateIcon(args.spellId)
timerBreathCD:Start(60, args.spellName)
timerBreathCD:UpdateIcon(args.spellId)
-- Is part of a volley or regular breath? This is bit messy to reconstruct :/
local nextBreathOffset = math.abs(GetTime() - nextBreath)
local nextVolleyOffset = math.abs(GetTime() - nextVolley)
if (nextBreathOffset < nextVolleyOffset and volleyCount == 0) or not self:IsBwlBlackEssenceEnabled() then -- Regular breath
timerBreathCD:Start(60, args.spellName)
timerBreathCD:UpdateIcon(args.spellId)
nextBreath = GetTime() + 30
specWarnBreathSoon:Schedule(57)
else -- part of a volley
if volleyCount == 0 then
nextVolley = GetTime() + 80
timerAllBreaths:Start()
end
volleyCount = volleyCount + 1
if volleyCount == 5 then
volleyCount = 0
end
end
end
end

Expand Down Expand Up @@ -273,9 +319,16 @@ function mod:SPELL_AURA_REMOVED(args)
end

function mod:UNIT_HEALTH(uId)
if UnitHealth(uId) / UnitHealthMax(uId) <= 0.25 and self:GetUnitCreatureId(uId) == 14020 and self.vb.phase == 1 then
if self:GetUnitCreatureId(uId) ~= 14020 then
return
end
local health = UnitHealth(uId) / UnitHealthMax(uId)
if health <= 0.25 and self.vb.phase == 1 then
warnPhase2Soon:Show()
self:SetStage(1.5)
elseif health <= 0.65 and health >= 0.6 and self:IsBwlBlackEssenceEnabled() and not rolloverWarnShown then
warnRollOverSoon:Show()
rolloverWarnShown = true
end
end

Expand Down
10 changes: 6 additions & 4 deletions DBM-Raids-Vanilla/localization.en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,16 @@ L:SetWarningLocalization{
L:SetTimerLocalization{
TimerBreathCD = "%s CD",
TimerBreath = "%s cast",
TimerVulnCD = "Vulnerability CD"
TimerVulnCD = "Vulnerability CD",
TimerAllBreaths = "Breath Volley"
}
L:SetOptionLocalization{
WarnBreath = "Show warning when Chromaggus casts one of his Breaths",
WarnVulnerableNew = "Show warning for spell vulnerabilities",
TimerBreathCD = "Show Breath CD",
TimerBreath = "Show Breath cast",
TimerVulnCD = "Show Vulnerability CD"
TimerBreathCD = "Show timer for Breath cooldown",
TimerBreath = "Show timer for Breath cast",
TimerVulnCD = "Show Vulnerability CD",
TimerAllBreaths = "Show timer for Breath Volley"
}
L:SetMiscLocalization{
Breath1 = "First Breath",
Expand Down
2 changes: 2 additions & 0 deletions DBM-Test-Vanilla/DBM-Test-Vanilla_Vanilla.toc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Season of Discovery/Blackwing Lair/Broodlord-Heroic-Kill.lua
Season of Discovery/Blackwing Lair/Firemaw-Normal-Wipe.lua
Season of Discovery/Blackwing Lair/EbonrocAndFlamegor-BlueGreenBronze-Kill.lua
Season of Discovery/Blackwing Lair/Chromaggus-BlueGreenBronze-Kill.lua
Season of Discovery/Blackwing Lair/Chromaggus-Black-Synthetic.lua

Season of Discovery/Blackwing Lair/Reports/SoDTrials.lua
Season of Discovery/Blackwing Lair/Reports/SoDTrialsv2.lua
Expand All @@ -24,6 +25,7 @@ Season of Discovery/Blackwing Lair/Reports/Broodlord-Heroic-Kill.lua
Season of Discovery/Blackwing Lair/Reports/Firemaw-Normal-Wipe.lua
Season of Discovery/Blackwing Lair/Reports/EbonrocAndFlamegor-BlueGreenBronze-Kill.lua
Season of Discovery/Blackwing Lair/Reports/Chromaggus-BlueGreenBronze-Kill.lua
Season of Discovery/Blackwing Lair/Reports/Chromaggus-Black-Synthetic.lua

# Zul'Gurub
Season of Discovery/ZulGurub/Hakkar-Kill.lua
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

local spells = {
breath1 = 23187,
breath2 = 23308,
breath3 = 23310,
breath4 = 23313,
breath5 = 23315,
fetch = 467883,
roll = 468594
}
local function spellEvent(time, subEvent, spell)
local id = spells[spell]
local name = GetSpellInfo(id)
return {time, "COMBAT_LOG_EVENT_UNFILTERED", subEvent, "Vehicle-0-1-469-1-14020-0000000001", "Chromaggus", 0xa48, 0x0, "", nil, 0x0, 0x0, id, name, 0x0, nil, nil}
end

DBM.Test:DefineTest{
name = "SoD/BWL/Chromaggus/Black/Synthetic",
gameVersion = "SeasonOfDiscovery",
addon = "DBM-Raids-Vanilla",
mod = "Chromaggus",
instanceInfo = {name = "Blackwing Lair", instanceType = "raid", difficultyID = 186, difficultyName = "40 Player", difficultyModifier = 1, maxPlayers = 40, dynamicDifficulty = 0, isDynamic = false, instanceID = 469, instanceGroupSize = 40, lfgDungeonID = nil},
players = {
{"Player1", "Player-1-00000008", logRecorder = true},
},
perspective = "Player1",
log = {
{0.00, "ENCOUNTER_START", 616, "Chromaggus", 186, 40},
{0.00, "IsEncounterInProgress()", true},
-- Fetch
spellEvent(21.00, "SPELL_CAST_SUCCESS", "fetch"),
-- Regular cast
spellEvent(30.73, "SPELL_CAST_START", "breath3"),
spellEvent(32.73, "SPELL_CAST_SUCCESS", "breath3"),
-- Volley
spellEvent(40.73, "SPELL_CAST_START", "breath1"),
spellEvent(42.73, "SPELL_CAST_SUCCESS", "breath1"),
spellEvent(43.67, "SPELL_CAST_START", "breath2"),
spellEvent(45.67, "SPELL_CAST_SUCCESS", "breath2"),
spellEvent(46.90, "SPELL_CAST_START", "breath3"),
spellEvent(48.90, "SPELL_CAST_SUCCESS", "breath3"),
spellEvent(50.12, "SPELL_CAST_START", "breath4"),
spellEvent(52.12, "SPELL_CAST_SUCCESS", "breath4"),
spellEvent(53.37, "SPELL_CAST_START", "breath5"),
spellEvent(55.37, "SPELL_CAST_SUCCESS", "breath5"),
-- Regular cast
spellEvent(61.45, "SPELL_CAST_START", "breath2"),
-- Fetch cancels breath (bug?) Timers are triggered on _START, so not a problem
spellEvent(61.45, "SPELL_CAST_SUCCESS", "fetch"),
-- Regular cast
spellEvent(92.20, "SPELL_CAST_START", "breath3"),
spellEvent(94.20, "SPELL_CAST_SUCCESS", "breath3"),
-- Fetch
spellEvent(101.90, "SPELL_CAST_SUCCESS", "fetch"),
-- Volley
spellEvent(121.34, "SPELL_CAST_START", "breath1"),
spellEvent(123.34, "SPELL_CAST_SUCCESS", "breath1"),
spellEvent(124.57, "SPELL_CAST_START", "breath2"),
spellEvent(126.57, "SPELL_CAST_SUCCESS", "breath2"),
spellEvent(127.80, "SPELL_CAST_START", "breath3"),
spellEvent(129.80, "SPELL_CAST_SUCCESS", "breath3"),
spellEvent(131.10, "SPELL_CAST_START", "breath4"),
spellEvent(133.10, "SPELL_CAST_SUCCESS", "breath4"),
spellEvent(134.30, "SPELL_CAST_START", "breath5"),
spellEvent(136.30, "SPELL_CAST_SUCCESS", "breath5"),
-- Regular cast, delayed by Volley
spellEvent(139.15, "SPELL_CAST_START", "breath2"),
spellEvent(141.15, "SPELL_CAST_SUCCESS", "breath2"),
-- Fetch without a bad breath interaction
spellEvent(142.38, "SPELL_CAST_SUCCESS", "fetch"),
-- Regular cast
spellEvent(153.73, "SPELL_CAST_START", "breath3"),
spellEvent(155.73, "SPELL_CAST_SUCCESS", "breath3"),
-- 60% HP
spellEvent(168.3, "SPELL_CAST_SUCCESS", "roll"),
-- Regular cast, TODO: get a log where this would be affected by roll over
spellEvent(200.70, "SPELL_CAST_START", "breath2"),
spellEvent(202.70, "SPELL_CAST_SUCCESS", "breath2"),
{230.00, "ENCOUNTER_END", 616, "Chromaggus", 186, 40, 1},
{230.00, "BOSS_KILL", 616, "Chromaggus"}
},
}
Loading

0 comments on commit ba3d07a

Please sign in to comment.