From 5ce8bc4d2693b71a9f6efb355cf17b51c41c6e74 Mon Sep 17 00:00:00 2001 From: Nick Towle Date: Wed, 8 Nov 2023 16:39:53 -0500 Subject: [PATCH 1/2] Cataclysm/ThroneTides/Mindbender: Support Cataclysm Classic --- Cataclysm/ThroneTides/Mindbender.lua | 35 +++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/Cataclysm/ThroneTides/Mindbender.lua b/Cataclysm/ThroneTides/Mindbender.lua index 1594f2301..3fc88de7c 100644 --- a/Cataclysm/ThroneTides/Mindbender.lua +++ b/Cataclysm/ThroneTides/Mindbender.lua @@ -1,4 +1,3 @@ -local isTenDotTwo = select(4, GetBuildInfo()) >= 100200 --- XXX delete when 10.2 is live everywhere -------------------------------------------------------------------------------- -- Module Declaration -- @@ -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", @@ -29,10 +27,10 @@ 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 + -- Classic options declared here as well for gen_option_values + not mod and {76207, "ICON"} or nil, -- Enslave + not mod and 76307 or nil, -- Absorb Magic + not mod and 76230 or nil, -- Mind Fog }, { [429051] = -2194, -- Erunak Stonespeaker [429172] = -2199, -- Mindbender Ghur'sha @@ -61,8 +59,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 @@ -71,6 +72,7 @@ if not isTenDotTwo then "stages", } end + function mod:OnBossEnable() self:Log("SPELL_CAST_SUCCESS", "Enslave", 76207) self:Log("SPELL_AURA_REMOVED", "EnslaveRemoved", 76207) @@ -78,6 +80,7 @@ if not isTenDotTwo then self:Log("SPELL_AURA_APPLIED", "MindFog", 76230) self:RegisterUnitEvent("UNIT_HEALTH", nil, "boss1") end + function mod:OnEngage() end end @@ -152,18 +155,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 @@ -172,11 +178,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 From 07b343974e6474bbe262d6d3924f9661922ead01 Mon Sep 17 00:00:00 2001 From: Nick Towle Date: Mon, 13 Nov 2023 23:02:20 -0500 Subject: [PATCH 2/2] remove parser workaround --- Cataclysm/ThroneTides/Mindbender.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Cataclysm/ThroneTides/Mindbender.lua b/Cataclysm/ThroneTides/Mindbender.lua index 3fc88de7c..4b8a46c49 100644 --- a/Cataclysm/ThroneTides/Mindbender.lua +++ b/Cataclysm/ThroneTides/Mindbender.lua @@ -27,10 +27,6 @@ function mod:GetOptions() {429048, "DISPEL", "OFF"}, -- Flame Shock -- Mindbender Ghur'sha {429172, "CASTBAR", "CASTBAR_COUNTDOWN"}, -- Terrifying Vision - -- Classic options declared here as well for gen_option_values - not mod and {76207, "ICON"} or nil, -- Enslave - not mod and 76307 or nil, -- Absorb Magic - not mod and 76230 or nil, -- Mind Fog }, { [429051] = -2194, -- Erunak Stonespeaker [429172] = -2199, -- Mindbender Ghur'sha