From 2376672c99e0c3a4ab6aa7be008afa1827924207 Mon Sep 17 00:00:00 2001 From: Nick Towle Date: Thu, 23 May 2024 19:43:27 -0400 Subject: [PATCH 1/2] MoP/Scholomance/JandiceBarov: Add boss module --- MoP/Scholomance/JandiceBarov.lua | 98 ++++++++++++++++++++++++++++++ MoP/Scholomance/Options/Colors.lua | 5 ++ MoP/Scholomance/Options/Sounds.lua | 5 ++ MoP/Scholomance/modules.xml | 1 + 4 files changed, 109 insertions(+) create mode 100644 MoP/Scholomance/JandiceBarov.lua diff --git a/MoP/Scholomance/JandiceBarov.lua b/MoP/Scholomance/JandiceBarov.lua new file mode 100644 index 000000000..d43b8ff4e --- /dev/null +++ b/MoP/Scholomance/JandiceBarov.lua @@ -0,0 +1,98 @@ +-------------------------------------------------------------------------------- +-- Module Declaration +-- + +local mod, CL = BigWigs:NewBoss("Jandice Barov", 1007, 663) +if not mod then return end +mod:RegisterEnableMob(59184) -- Jandice Barov +mod:SetEncounterID(1427) +mod:SetRespawnTime(30) +mod:SetStage(1) + +-------------------------------------------------------------------------------- +-- Locals +-- + +local whirlOfIllusionCount = 1 + +-------------------------------------------------------------------------------- +-- Initialization +-- + +function mod:GetOptions() + return { + 114062, -- Wondrous Rapidity + -5535, -- Whirl of Illusion + 114059, -- Gravity Flux + }, { + [114059] = CL.heroic, -- Gravity Flux (Heroic) + } +end + +function mod:OnBossEnable() + self:Log("SPELL_CAST_START", "WondrousRapidity", 114062) + self:Log("SPELL_CAST_SUCCESS", "WondrousRapidity", 114062) + self:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", nil, "boss1") -- Whirl of Illusion, Gravity Flux +end + +function mod:OnEngage() + whirlOfIllusionCount = 1 + self:SetStage(1) + self:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT") + self:CDBar(114062, 6.1) -- Wondrous Rapidity + if not self:Normal() then + self:CDBar(114059, 17.2) -- Gravity Flux + end +end + +-------------------------------------------------------------------------------- +-- Event Handlers +-- + +do + local prev = 0 + function mod:WondrousRapidity(args) + -- immediately after Whirl of Illusion ends she can instant cast this ability with + -- no SPELL_CAST_START, so register both START and SUCCESS and throttle the alert. + local t = args.time + if t - prev > 3 then + prev = t + self:Message(args.spellId, "purple") + self:PlaySound(args.spellId, "alarm") + if self:Normal() then + self:CDBar(args.spellId, 21.8) + else -- Heroic + self:CDBar(args.spellId, 31.5) + end + end + end +end + +function mod:UNIT_SPELLCAST_SUCCEEDED(_, _, _, spellId) + if spellId == 113808 then -- Whirl of Illusion + self:StopBar(114062) -- Wondrous Rapidity + self:StopBar(114059) -- Gravity Flux + self:SetStage(2) + local percent = whirlOfIllusionCount == 1 and 66 or 33 + self:Message(-5535, "cyan", CL.percent:format(percent, self:SpellName(-5535))) + self:PlaySound(-5535, "long") + whirlOfIllusionCount = whirlOfIllusionCount + 1 + elseif spellId == 114059 then -- Gravity Flux + self:Message(spellId, "orange") + self:PlaySound(spellId, "alarm") + self:CDBar(spellId, 31.5) + end +end + +function mod:INSTANCE_ENCOUNTER_ENGAGE_UNIT() + -- the boss frame goes away during Stage 2, use this to detect when the boss returns to start Stage 1 again + if self:GetStage() == 2 and self:GetBossId(59184) and UnitExists("boss1") then -- Jandice Barov + self:SetStage(1) + self:Message(-5535, "green", CL.over:format(self:SpellName(-5535))) -- Whirl of Illusion + self:PlaySound(-5535, "info") + self:CDBar(114062, 1.0) -- Wondrous Rapidity + if not self:Normal() then + self:CDBar(114059, 10.4) -- Gravity Flux + end + end +end diff --git a/MoP/Scholomance/Options/Colors.lua b/MoP/Scholomance/Options/Colors.lua index 9de8a590a..c3fc50cb2 100644 --- a/MoP/Scholomance/Options/Colors.lua +++ b/MoP/Scholomance/Options/Colors.lua @@ -7,3 +7,8 @@ BigWigs:AddColors("Instructor Chillheart", { [111854] = "cyan", }) +BigWigs:AddColors("Jandice Barov", { + [-5535] = {"cyan","green"}, + [114059] = "orange", + [114062] = "purple", +}) diff --git a/MoP/Scholomance/Options/Sounds.lua b/MoP/Scholomance/Options/Sounds.lua index 24e5515ea..bff0bfb85 100644 --- a/MoP/Scholomance/Options/Sounds.lua +++ b/MoP/Scholomance/Options/Sounds.lua @@ -7,3 +7,8 @@ BigWigs:AddSounds("Instructor Chillheart", { [111854] = "info", }) +BigWigs:AddSounds("Jandice Barov", { + [-5535] = {"info","long"}, + [114059] = "alarm", + [114062] = "alarm", +}) diff --git a/MoP/Scholomance/modules.xml b/MoP/Scholomance/modules.xml index 309fb1092..26cd0ebd1 100644 --- a/MoP/Scholomance/modules.xml +++ b/MoP/Scholomance/modules.xml @@ -2,6 +2,7 @@ ..\FrameXML\UI.xsd">