From b305ee83e3fda8267e89386fc92460d2f3da3acb Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Thu, 8 Oct 2026 02:00:20 -0300 Subject: [PATCH] fix(Scripts/TrialOfTheCrusader): Stun Paralytic Toxin targets with Paralysis at full slow (#27975) Co-authored-by: Keader --- .../game/Spells/Auras/SpellAuraEffects.cpp | 13 ------- .../boss_northrend_beasts.cpp | 38 ++++++++++++++++++- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 0007bc3c61..f6ad1b90b5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1034,19 +1034,6 @@ void AuraEffect::UpdatePeriodic(Unit* caster) case 59911: // Tenacity (vehicle) GetBase()->RefreshDuration(); break; - case 66823: - case 67618: - case 67619: - case 67620: // Paralytic Toxin - // Get 0 effect aura - if (AuraEffect* slow = GetBase()->GetEffect(0)) - { - int32 newAmount = slow->GetAmount() - 10; - if (newAmount < -100) - newAmount = -100; - slow->ChangeAmount(newAmount); - } - break; case 66020: // Get 0 effect aura if (AuraEffect* slow = GetBase()->GetEffect(0)) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index aefd2816cd..b8d59f0f3b 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -482,6 +482,7 @@ enum JormungarSpells SPELL_ACID_SPEW = 66818, SPELL_PARALYTIC_SPRAY = 66901, SPELL_PARALYTIC_BITE = 66824, + SPELL_PARALYSIS = 66830, SPELL_FIRE_SPIT = 66796, SPELL_MOLTEN_SPEW = 66821, @@ -680,7 +681,7 @@ struct boss_jormungarAI : public ScriptedAI } break; case EVENT_SPELL_SPRAY: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true)) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false)) me->CastSpell(target, _SPELL_SPRAY, false); events.Repeat(20s); break; @@ -789,6 +790,11 @@ class spell_jormungars_paralytic_toxin_aura : public AuraScript { PrepareAuraScript(spell_jormungars_paralytic_toxin_aura); + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_PARALYSIS }); + } + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* caster = GetCaster(); @@ -797,9 +803,39 @@ class spell_jormungars_paralytic_toxin_aura : public AuraScript acidmaw->AI()->Talk(WHISPER_PARALYTIC_TOXIN, GetTarget()); } + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(SPELL_PARALYSIS); + } + + // Keeps the accumulated slow across amount recalculations + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) + { + if (!canBeRecalculated) + amount = aurEff->GetAmount(); + + canBeRecalculated = false; + } + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + AuraEffect* slow = GetEffect(EFFECT_0); + if (!slow) + return; + + int32 newAmount = std::max(slow->GetAmount() - 10, -100); + slow->ChangeAmount(newAmount); + + if (newAmount == -100 && !GetTarget()->HasAura(SPELL_PARALYSIS)) + GetTarget()->CastSpell(GetTarget(), SPELL_PARALYSIS, true, nullptr, slow, GetCasterGUID()); + } + void Register() override { AfterEffectApply += AuraEffectApplyFn(spell_jormungars_paralytic_toxin_aura::OnApply, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_jormungars_paralytic_toxin_aura::OnRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_jormungars_paralytic_toxin_aura::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_jormungars_paralytic_toxin_aura::HandlePeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY); } };