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

Cataclysm/ThroneTides/Mindbender: Support Cataclysm Classic #958

Merged
merged 2 commits into from
Nov 14, 2023
Merged
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
31 changes: 17 additions & 14 deletions Cataclysm/ThroneTides/Mindbender.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local isTenDotTwo = select(4, GetBuildInfo()) >= 100200 --- XXX delete when 10.2 is live everywhere
--------------------------------------------------------------------------------
-- Module Declaration
--
Expand All @@ -17,8 +16,7 @@ mod:SetStage(1)
-- Initialization
--

-- XXX remove isTenDotTwo check once 10.2 is live everywhere
local stormflurryTotemMarker = isTenDotTwo and mod:AddMarkerOption(true, "npc", 8, 429037, 8) -- Stormflurry Totem
local stormflurryTotemMarker = mod:Retail() and mod:AddMarkerOption(true, "npc", 8, 429037, 8) or nil -- Stormflurry Totem
function mod:GetOptions()
return {
"stages",
Expand All @@ -29,10 +27,6 @@ function mod:GetOptions()
{429048, "DISPEL", "OFF"}, -- Flame Shock
-- Mindbender Ghur'sha
{429172, "CASTBAR", "CASTBAR_COUNTDOWN"}, -- Terrifying Vision
-- XXX delete these option keys below when 10.2 is live everywhere
not isTenDotTwo and {76207, "ICON"} or nil, -- Enslave
not isTenDotTwo and 76307 or nil, -- Absorb Magic
not isTenDotTwo and 76230 or nil, -- Mind Fog
}, {
[429051] = -2194, -- Erunak Stonespeaker
[429172] = -2199, -- Mindbender Ghur'sha
Expand Down Expand Up @@ -61,8 +55,11 @@ function mod:OnEngage()
self:CDBar(429051, 22.9) -- Earthfury
end

-- XXX delete this entire block below when 10.2 is live everywhere
if not isTenDotTwo then
--------------------------------------------------------------------------------
-- Classic Initialization
--

if mod:Classic() then
function mod:GetOptions()
return {
{76207, "ICON"}, -- Enslave
Expand All @@ -71,13 +68,15 @@ if not isTenDotTwo then
"stages",
}
end

function mod:OnBossEnable()
self:Log("SPELL_CAST_SUCCESS", "Enslave", 76207)
self:Log("SPELL_AURA_REMOVED", "EnslaveRemoved", 76207)
self:Log("SPELL_CAST_START", "AbsorbMagic", 76307)
self:Log("SPELL_AURA_APPLIED", "MindFog", 76230)
self:RegisterUnitEvent("UNIT_HEALTH", nil, "boss1")
end

function mod:OnEngage()
end
end
Expand Down Expand Up @@ -152,18 +151,21 @@ function mod:TerrifyingVision(args)
self:CDBar(args.spellId, 23.0)
end

-- XXX delete everything below this comment when 10.2 is live everywhere
--------------------------------------------------------------------------------
-- Classic Event Handlers
--

function mod:UNIT_HEALTH(event, unit)
local hp = self:GetHealth(unit)
if hp < 55 then
self:UnregisterUnitEvent(event, unit)
self:MessageOld("stages", "cyan", nil, CL.soon:format(CL.stage:format(2)), false)
self:Message("stages", "cyan", CL.soon:format(CL.stage:format(2)), false)
end
end

function mod:Enslave(args)
self:TargetMessageOld(args.spellId, args.destName, "red", "alert")
self:TargetMessage(args.spellId, "red", args.destName)
self:PlaySound(args.spellId, "alert", nil, args.destName)
self:PrimaryIcon(args.spellId, args.destName)
end

Expand All @@ -172,11 +174,12 @@ function mod:EnslaveRemoved(args)
end

function mod:AbsorbMagic(args)
self:MessageOld(args.spellId, "orange", nil, CL.casting:format(args.spellName))
self:Message(args.spellId, "orange", CL.casting:format(args.spellName))
end

function mod:MindFog(args)
if self:Me(args.destGUID) then
self:TargetMessageOld(args.spellId, args.destName, "blue", "alarm")
self:PersonalMessage(args.spellId)
self:PlaySound(args.spellId, "alarm", nil, args.destName)
end
end