From 6de928dccdcaf1e482c785cbc883216e6f4bafbe Mon Sep 17 00:00:00 2001 From: insunaa Date: Wed, 1 Jan 2025 22:51:53 +0100 Subject: [PATCH 1/2] Spell: Despawn Wandering Eye of Kilrogg after summon --- sql/scriptdev2/spell.sql | 1 + .../scripts/kalimdor/dire_maul/dire_maul.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 806b4157be..59cf142234 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -64,6 +64,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (20038,'spell_explosion_razorgore'), (21651,'spell_opening_capping'), (22858,'spell_retaliation_creature'), +(22876,'spell_summon_netherwalker'), (23134,'spell_goblin_bomb'), (23226,'spell_ritual_candle_aura'), (24228,'spell_arlokk_vanish'), diff --git a/src/game/AI/ScriptDevAI/scripts/kalimdor/dire_maul/dire_maul.cpp b/src/game/AI/ScriptDevAI/scripts/kalimdor/dire_maul/dire_maul.cpp index f46f3d21ae..bbfe23cb7a 100644 --- a/src/game/AI/ScriptDevAI/scripts/kalimdor/dire_maul/dire_maul.cpp +++ b/src/game/AI/ScriptDevAI/scripts/kalimdor/dire_maul/dire_maul.cpp @@ -308,6 +308,18 @@ struct RitualCandleAura : public SpellScript } }; +// 22876 - Summon Netherwalker +struct SummonNetherWalker : public SpellScript +{ + void OnSuccessfulFinish(Spell* spell) const override + { + Creature* caster = static_cast(spell->GetCaster()); + if (!caster || !caster->IsAlive() || !caster->IsCreature()) + return; + caster->ForcedDespawn(); + } +}; + void AddSC_dire_maul() { Script* pNewScript = new Script; @@ -326,4 +338,5 @@ void AddSC_dire_maul() pNewScript->RegisterSelf(); RegisterSpellScript("spell_ritual_candle_aura"); + RegisterSpellScript("spell_summon_netherwalker"); } From 2143d45a7b2b5a4fcf1f733fa022c32176917026 Mon Sep 17 00:00:00 2001 From: insunaa Date: Wed, 1 Jan 2025 22:52:10 +0100 Subject: [PATCH 2/2] UnitAI: Remove GetVictim check to allow fleeing --- src/game/AI/BaseAI/UnitAI.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/game/AI/BaseAI/UnitAI.cpp b/src/game/AI/BaseAI/UnitAI.cpp index 4111524ad2..edd5b0d5c8 100644 --- a/src/game/AI/BaseAI/UnitAI.cpp +++ b/src/game/AI/BaseAI/UnitAI.cpp @@ -829,10 +829,6 @@ void UnitAI::TimedFleeingEnded() bool UnitAI::DoFlee(uint32 duration) { - Unit* victim = m_unit->GetVictim(); - if (!victim) - return false; - if (!duration) duration = sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_FLEE_DELAY);