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

MoP/Scholomance/JandiceBarov: Add boss module #1004

Merged
merged 2 commits into from
May 24, 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
108 changes: 108 additions & 0 deletions MoP/Scholomance/JandiceBarov.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
--------------------------------------------------------------------------------
-- 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_AURA_APPLIED", "WondrousRapidityApplied", 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)
prev = args.time
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

function mod:WondrousRapidityApplied(args)
-- immediately after Whirl of Illusion ends she can instant cast this ability with
-- no SPELL_CAST_START (and sometimes with no SPELL_CAST_SUCCESS), so show the alert
-- with an adjusted timer on SPELL_AURA_APPLIED if we didn't get the SPELL_CAST_START.
if args.time - prev > 2 then
self:Message(args.spellId, "purple")
self:PlaySound(args.spellId, "alarm")
if self:Normal() then
self:CDBar(args.spellId, 20.3)
else -- Heroic
self:CDBar(args.spellId, 30.0)
end
end
end
end

function mod:UNIT_SPELLCAST_SUCCEEDED(_, _, _, spellId)
if spellId == 113808 then -- Whirl of Illusion
-- this doesn't affect the CD of Wondrous Rapidity like it does for Gravity Flux
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")
if not self:Normal() then
self:CDBar(114059, 10.4) -- Gravity Flux
end
end
end
5 changes: 5 additions & 0 deletions MoP/Scholomance/Options/Colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ BigWigs:AddColors("Instructor Chillheart", {
[111854] = "cyan",
})

BigWigs:AddColors("Jandice Barov", {
[-5535] = {"cyan","green"},
[114059] = "orange",
[114062] = "purple",
})
5 changes: 5 additions & 0 deletions MoP/Scholomance/Options/Sounds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ BigWigs:AddSounds("Instructor Chillheart", {
[111854] = "info",
})

BigWigs:AddSounds("Jandice Barov", {
[-5535] = {"info","long"},
[114059] = "alarm",
[114062] = "alarm",
})
1 change: 1 addition & 0 deletions MoP/Scholomance/modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
..\FrameXML\UI.xsd">

<Script file="InstructorChillheart.lua"/>
<Script file="JandiceBarov.lua"/>

<Include file="Options\options.xml"/>

Expand Down