From 2923a4aa43d0afdee369dc5c1638f309c343de01 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:28:46 -0300 Subject: [PATCH] fix(Scripts/ZulAman): Fix Electric Storm shouldnt hit safe players (#20897) * fix(Scripts/ZulAman): Fix Electric Storm shouldnt hit safe players * increase cloud duration by 500ms Co-Authored-By: killerwife --------- Co-authored-by: killerwife --- .../scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 7a8fc0ac2..11cf383a0 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -114,8 +114,12 @@ struct boss_akilzon : public BossAI EnterEvadeMode(); return; } - target->CastSpell(target, SPELL_ELECTRICAL_STORM_AREA, true); // cloud visual + DoCast(target, SPELL_ELECTRICAL_STORM); // storm cyclon + visual + target->CastSpell(target, SPELL_ELECTRICAL_STORM_AREA, true); // cloud visual + + if (DynamicObject* dynObj = target->GetDynObject(SPELL_ELECTRICAL_STORM_AREA)) + dynObj->SetDuration(8500); float x, y, z; target->GetPosition(x, y, z); @@ -328,6 +332,11 @@ class spell_electrical_storm_proc : public SpellScript { PrepareSpellScript(spell_electrical_storm_proc); + void FilterTargets(std::list& targets) + { + targets.remove_if(Acore::UnitAuraCheck(true, SPELL_ELECTRICAL_STORM_AREA)); + } + void HandleDamageCalc(SpellEffIndex /*effIndex*/) { if (Aura* aura = GetCaster()->GetAura(SPELL_ELECTRICAL_STORM)) @@ -339,6 +348,7 @@ class spell_electrical_storm_proc : public SpellScript void Register() override { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_electrical_storm_proc::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); OnEffectHitTarget += SpellEffectFn(spell_electrical_storm_proc::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } };