diff --git a/src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_laj.cpp b/src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_laj.cpp index 9f683c5ec6..95588e4730 100644 --- a/src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_laj.cpp +++ b/src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_laj.cpp @@ -73,6 +73,29 @@ struct boss_lajAI : public CombatAI AddCustomAction(LAJ_TELEPORT_SUMMON, true, [&]() { HandleTeleportSummon(); }, TIMER_COMBAT_COMBAT); } + GuidVector m_spawns; + + void Reset() override + { + SetCombatMovement(true); + SetCombatScriptStatus(false); + DespawnGuids(m_spawns); + CombatAI::Reset(); + } + + void EnterEvadeMode() override + { + SetCombatMovement(true); + SetCombatScriptStatus(false); + DespawnGuids(m_spawns); + CombatAI::EnterEvadeMode(); + } + + void JustDied(Unit* /*killer*/) override + { + DespawnGuids(m_spawns); + } + void AddTransformCooldowns(uint32 spellId) { if (spellId != SPELL_LAJ_ARCANE) @@ -113,6 +136,8 @@ struct boss_lajAI : public CombatAI summoned->AI()->DoCastSpellIfCan(nullptr, SPELL_ROOT_SELF, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, nullptr, SELECT_FLAG_PLAYER)) summoned->AI()->AttackStart(target); + + m_spawns.push_back(summoned->GetObjectGuid()); } void OnSpellCast(SpellEntry const* spellInfo, Unit* /*target*/) override @@ -124,7 +149,15 @@ struct boss_lajAI : public CombatAI case SPELL_LAJ_FROST: case SPELL_LAJ_NATURE: case SPELL_LAJ_SHADOW: AddTransformCooldowns(spellInfo->Id); break; - case SPELL_TELEPORT_SELF: SetCombatMovement(false, true); ResetTimer(LAJ_TELEPORT_SUMMON, 4000); break; + case SPELL_TELEPORT_SELF: + // Remove CombatMovement + SetCombatMovement(false, true); + // Remove the target focus + SetCombatScriptStatus(true); + SetMeleeEnabled(false); + m_creature->SetTarget(nullptr); + ResetTimer(LAJ_TELEPORT_SUMMON, 4000); + break; } } @@ -133,8 +166,10 @@ struct boss_lajAI : public CombatAI DoSummons(); DoBroadcastText(EMOTE_SUMMON, m_creature); - if (m_creature->GetVictim()) - m_creature->GetMotionMaster()->MoveChase(m_creature->GetVictim()); + SetCombatScriptStatus(false); + + SetMeleeEnabled(true); + SetCombatMovement(true, true); } };