diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2019-07-21 01:49:58 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2019-07-21 01:50:52 +0200 |
| commit | 0e7c66cb4c7ff7d44e232d0b50703a48605ffd24 (patch) | |
| tree | 4ffe19100d1173ff3641bf6d4be82d826d729924 /src/server/scripts/EasternKingdoms | |
| parent | eba10f309eb541a7246754285bea6b821710d9fd (diff) | |
Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged. Fixes #17981 and #23602 for real this time.
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
3 files changed, 8 insertions, 16 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index 64f8dd07af0..e40f750154b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -395,16 +395,9 @@ public: if (Creature* boss = instance->GetCreature(TombBossGUIDs[i])) { if (!boss->IsAlive()) - {//do not call EnterEvadeMode(), it will create infinit loops boss->Respawn(); - boss->RemoveAllAuras(); - boss->CombatStop(true); - boss->GetThreatManager().NotifyDisengaged(); - boss->LoadCreaturesAddon(); - boss->GetMotionMaster()->MoveTargetedHome(); - boss->SetLootRecipient(nullptr); - } - boss->SetFaction(FACTION_FRIENDLY); + else + boss->SetFaction(FACTION_FRIENDLY); } } GhostKillCount = 0; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index c46ac193ab6..cff444a3650 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -1258,7 +1258,6 @@ public: Julianne->GetMotionMaster()->Clear(); Julianne->setDeathState(JUST_DIED); Julianne->CombatStop(true); - Julianne->GetThreatManager().NotifyDisengaged(); Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } return; @@ -1528,7 +1527,6 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &dama Romulo->GetMotionMaster()->Clear(); Romulo->setDeathState(JUST_DIED); Romulo->CombatStop(true); - Romulo->GetThreatManager().NotifyDisengaged(); Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 931df7115d0..d701f0f4300 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1387,9 +1387,10 @@ public: me->RemoveAurasDueToSpell(SPELL_THE_MIGHT_OF_MOGRAINE); me->RemoveAllAuras(); me->CombatStop(true); - me->GetThreatManager().NotifyDisengaged(); me->InterruptNonMeleeSpells(false); me->SetWalk(false); + + EngagementOver(); for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) DespawnNPC(uiDefenderGUID[i]); @@ -1406,9 +1407,9 @@ public: if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKorfaxGUID)) { + temp->AI()->EnterEvadeMode(); temp->RemoveAllAuras(); temp->CombatStop(true); - temp->GetThreatManager().NotifyDisengaged(); temp->AttackStop(); temp->SetFaction(me->GetFaction()); temp->SetWalk(false); @@ -1427,9 +1428,9 @@ public: if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEligorGUID)) { + temp->AI()->EnterEvadeMode(); temp->RemoveAllAuras(); temp->CombatStop(true); - temp->GetThreatManager().NotifyDisengaged(); temp->AttackStop(); temp->SetFaction(me->GetFaction()); temp->SetWalk(false); @@ -1439,9 +1440,9 @@ public: if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKoltiraGUID)) { + temp->AI()->EnterEvadeMode(); temp->RemoveAllAuras(); temp->CombatStop(true); - temp->GetThreatManager().NotifyDisengaged(); temp->AttackStop(); temp->SetFaction(me->GetFaction()); temp->SetWalk(false); @@ -1454,9 +1455,9 @@ public: if (Creature* temp = ObjectAccessor::GetCreature(*me, uiThassarianGUID)) { + temp->AI()->EnterEvadeMode(); temp->RemoveAllAuras(); temp->CombatStop(true); - temp->GetThreatManager().NotifyDisengaged(); temp->AttackStop(); temp->SetFaction(me->GetFaction()); temp->SetWalk(false); |
