From 99ff139f99de3455265c37caa25f770e589f43d8 Mon Sep 17 00:00:00 2001 From: funkydude Date: Wed, 23 Oct 2024 22:54:39 +0100 Subject: [PATCH] Cleanups --- BlackfathomDeeps_Classic/Ghamoo-ra.lua | 4 ++-- BlackwingLair/Nefarian.lua | 3 --- BlackwingLair/Trash.lua | 2 +- BlackwingLair/Vaelastrasz.lua | 6 ++++-- Gnomeregan_Classic/MekgineerThermaplugg.lua | 15 +++++++++------ MoltenCore/Golemagg.lua | 4 ++-- Onyxia_Classic/Onyxia.lua | 4 ++-- SunkenTemple_Classic/DreamscytheAndWeaver.lua | 4 ++-- SunkenTemple_Classic/MorphazAndHazzas.lua | 4 ++-- 9 files changed, 24 insertions(+), 22 deletions(-) diff --git a/BlackfathomDeeps_Classic/Ghamoo-ra.lua b/BlackfathomDeeps_Classic/Ghamoo-ra.lua index 9a32f86..20b090c 100644 --- a/BlackfathomDeeps_Classic/Ghamoo-ra.lua +++ b/BlackfathomDeeps_Classic/Ghamoo-ra.lua @@ -70,8 +70,8 @@ function mod:CrunchArmorApplied(args) self:PlaySound(args.spellId, "alert") end elseif args.amount and self:Player(args.destFlags) then -- Players, not pets - local bossUnit = self:GetUnitIdByGUID(args.sourceGUID) - if bossUnit and self:Tanking(bossUnit, args.destName) then + local bossUnit, targetUnit = self:GetUnitIdByGUID(args.sourceGUID), self:UnitTokenFromGUID(args.destGUID, true) + if bossUnit and targetUnit and self:Tanking(bossUnit, targetUnit) then self:StackMessage(args.spellId, "purple", args.destName, args.amount, 3) if args.amount >= 3 then self:PlaySound(args.spellId, "alert") diff --git a/BlackwingLair/Nefarian.lua b/BlackwingLair/Nefarian.lua index 0e7dcca..9ac845f 100644 --- a/BlackwingLair/Nefarian.lua +++ b/BlackwingLair/Nefarian.lua @@ -194,9 +194,6 @@ end function mod:CHAT_MSG_MONSTER_YELL(_, msg) if msg:find(L.engage_yell_trigger, nil, true) then - if self:IsEngaged() then - self:Wipe() - end self:Engage() elseif msg:find(L.stage3_yell_trigger, nil, true) then self:SetStage(3) diff --git a/BlackwingLair/Trash.lua b/BlackwingLair/Trash.lua index 0a4bd40..2c1f5af 100644 --- a/BlackwingLair/Trash.lua +++ b/BlackwingLair/Trash.lua @@ -264,7 +264,7 @@ function mod:NaturesFuryApplied(args) self:TargetBar(args.spellId, 8, args.destName) self:CustomIcon(naturesFuryMarker, args.destName, 4) if self:Me(args.destGUID) then - self:Say(args.spellId, CL.rticon:format(args.spellName, 4), nil, "Natures Fury ({rt4})") + self:Say(args.spellId, CL.rticon:format(args.spellName, 4), nil, "Nature's Fury ({rt4})") self:SayCountdown(args.spellId, 8, 4, 5) self:PlaySound(args.spellId, "warning", nil, args.destName) end diff --git a/BlackwingLair/Vaelastrasz.lua b/BlackwingLair/Vaelastrasz.lua index 9fc52f6..4ba9f8d 100644 --- a/BlackwingLair/Vaelastrasz.lua +++ b/BlackwingLair/Vaelastrasz.lua @@ -123,7 +123,8 @@ end function mod:BurningAdrenalineAppliedSoD(args) local unit = bossGUID and self:GetUnitIdByGUID(bossGUID) - if unit and self:Tanking(unit, args.destName) then + local targetUnit = self:UnitTokenFromGUID(args.destGUID, true) + if unit and targetUnit and self:Tanking(unit, targetUnit) then self:TargetMessage(23620, "purple", args.destName, L.tank_bomb) if self:Me(args.destGUID) then self:Say(23620, L.tank_bomb, nil, "Tank Bomb") @@ -146,7 +147,8 @@ function mod:BurningAdrenalineAppliedDoseSoD(args) self:StackMessage(18173, "blue", args.destName, args.amount, 30, CL.bomb) else local unit = bossGUID and self:GetUnitIdByGUID(bossGUID) - if unit and self:Tanking(unit, args.destName) then + local targetUnit = self:UnitTokenFromGUID(args.destGUID, true) + if unit and targetUnit and self:Tanking(unit, args.destName) then self:StackMessage(23620, "purple", args.destName, args.amount, 30, L.tank_bomb) self:PlaySound(23620, "long", nil, args.destName) end diff --git a/Gnomeregan_Classic/MekgineerThermaplugg.lua b/Gnomeregan_Classic/MekgineerThermaplugg.lua index 41df5b3..b7f5256 100644 --- a/Gnomeregan_Classic/MekgineerThermaplugg.lua +++ b/Gnomeregan_Classic/MekgineerThermaplugg.lua @@ -243,8 +243,9 @@ function mod:SprocketfireApplied(args) if self:Me(args.destGUID) then self:StackMessage(args.spellId, "blue", args.destName, args.amount, 4) else - local bossUnit = self:GetUnitIdByGUID(currentBossGUID) -- Source can vary or be nil - if bossUnit and self:Tanking(bossUnit, args.destName) then + local bossUnit = self:GetUnitIdByGUID(currentBossGUID) -- Source can vary or be nil here, so store it from other abilities + local targetUnit = self:UnitTokenFromGUID(args.destGUID, true) + if bossUnit and targetUnit and self:Tanking(bossUnit, targetUnit) then self:StackMessage(args.spellId, "orange", args.destName, args.amount, 4) end end @@ -277,8 +278,9 @@ function mod:FreezingApplied(args) if self:Me(args.destGUID) then self:StackMessage(args.spellId, "blue", args.destName, args.amount, 5) elseif self:Player(args.destFlags) then -- Players, not pets - local bossUnit = self:GetUnitIdByGUID(currentBossGUID) -- Source can vary or be nil - if bossUnit and self:Tanking(bossUnit, args.destName) then + local bossUnit = self:GetUnitIdByGUID(currentBossGUID) -- Source can vary or be nil here, so store it from other abilities + local targetUnit = self:UnitTokenFromGUID(args.destGUID, true) + if bossUnit and targetUnit and self:Tanking(bossUnit, targetUnit) then self:StackMessage(args.spellId, "orange", args.destName, args.amount, 5) end end @@ -310,8 +312,9 @@ function mod:RadiationSicknessApplied(args) if self:Me(args.destGUID) then self:StackMessage(args.spellId, "blue", args.destName, args.amount, 3, CL.disease) elseif args.amount then - local bossUnit = self:GetUnitIdByGUID(currentBossGUID) -- Source can vary or be nil - if bossUnit and self:Tanking(bossUnit, args.destName) then + local bossUnit = self:GetUnitIdByGUID(currentBossGUID) -- Source can vary or be nil here, so store it from other abilities + local targetUnit = self:UnitTokenFromGUID(args.destGUID, true) + if bossUnit and targetUnit and self:Tanking(bossUnit, targetUnit) then self:StackMessage(args.spellId, "orange", args.destName, args.amount, 3, CL.disease) end end diff --git a/MoltenCore/Golemagg.lua b/MoltenCore/Golemagg.lua index b79a39f..4ef8743 100644 --- a/MoltenCore/Golemagg.lua +++ b/MoltenCore/Golemagg.lua @@ -51,8 +51,8 @@ function mod:MagmaSplashApplied(args) self:PlaySound(args.spellId, "alert") end elseif self:Player(args.destFlags) and args.amount >= 3 then -- Players, not pets - local unit = self:GetUnitIdByGUID(args.sourceGUID) - if unit and self:Tanking(unit, args.destName) then + local unit, targetUnit = self:GetUnitIdByGUID(args.sourceGUID), self:UnitTokenFromGUID(args.destGUID, true) + if unit and targetUnit and self:Tanking(unit, targetUnit) then self:StackMessage(args.spellId, "purple", args.destName, args.amount, 4) if args.amount >= 4 then self:PlaySound(args.spellId, "alert") diff --git a/Onyxia_Classic/Onyxia.lua b/Onyxia_Classic/Onyxia.lua index a603f0d..446edfe 100644 --- a/Onyxia_Classic/Onyxia.lua +++ b/Onyxia_Classic/Onyxia.lua @@ -223,8 +223,8 @@ function mod:UNIT_HEALTH(event, unit) end function mod:FlameLashApplied(args) - local unit = self:GetUnitIdByGUID(args.sourceGUID) - if unit and self:Tanking(unit, args.destName) then + local unit, targetUnit = self:GetUnitIdByGUID(args.sourceGUID), self:UnitTokenFromGUID(args.destGUID, true) + if unit and targetUnit and self:Tanking(unit, targetUnit) then self:StackMessage(args.spellId, "purple", args.destName, args.amount, 2) end end diff --git a/SunkenTemple_Classic/DreamscytheAndWeaver.lua b/SunkenTemple_Classic/DreamscytheAndWeaver.lua index c4c8c55..6375f03 100644 --- a/SunkenTemple_Classic/DreamscytheAndWeaver.lua +++ b/SunkenTemple_Classic/DreamscytheAndWeaver.lua @@ -65,8 +65,8 @@ function mod:AcidBreathApplied(args) self:PlaySound(args.spellId, "alert") end else - local bossUnit = self:GetUnitIdByGUID(args.sourceGUID) - if bossUnit and self:Tanking(bossUnit, args.destName) then + local bossUnit, targetUnit = self:GetUnitIdByGUID(args.sourceGUID), self:UnitTokenFromGUID(args.destGUID, true) + if bossUnit and targetUnit and self:Tanking(bossUnit, targetUnit) then self:StackMessage(args.spellId, "purple", args.destName, args.amount, 2) if args.amount then self:PlaySound(args.spellId, "alert") diff --git a/SunkenTemple_Classic/MorphazAndHazzas.lua b/SunkenTemple_Classic/MorphazAndHazzas.lua index 554de55..be85cd9 100644 --- a/SunkenTemple_Classic/MorphazAndHazzas.lua +++ b/SunkenTemple_Classic/MorphazAndHazzas.lua @@ -100,8 +100,8 @@ function mod:CorruptedBreathApplied(args) self:PlaySound(args.spellId, "alert") end else - local bossUnit = self:GetUnitIdByGUID(args.sourceGUID) - if bossUnit and self:Tanking(bossUnit, args.destName) then + local bossUnit, targetUnit = self:GetUnitIdByGUID(args.sourceGUID), self:UnitTokenFromGUID(args.destGUID, true) + if bossUnit and targetUnit and self:Tanking(bossUnit, targetUnit) then self:StackMessage(args.spellId, "purple", args.destName, args.amount, 2) if args.amount then self:PlaySound(args.spellId, "alert")