aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2019-07-21 01:49:58 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-17 00:23:33 +0100
commitc13d83796f7b2111c5dcf8546bdd84eccd232ae3 (patch)
tree03c4220a955113e46b3aa2f9cc270574ba3a79c4 /src/server/scripts/EasternKingdoms
parentf9fe00bf8c4c913bcfedd8df7d8e1001129962a0 (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.
(cherry picked from commit 0e7c66cb4c7ff7d44e232d0b50703a48605ffd24)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp11
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 a326d9c2323..2057c55a29b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
@@ -372,16 +372,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 68400643091..7c6fb0e4689 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -1257,7 +1257,6 @@ public:
Julianne->GetMotionMaster()->Clear();
Julianne->setDeathState(JUST_DIED);
Julianne->CombatStop(true);
- Julianne->GetThreatManager().NotifyDisengaged();
Julianne->SetDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}
return;
@@ -1527,7 +1526,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->SetDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 64c8497712c..f62c84c7dc0 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -1388,9 +1388,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]);
@@ -1407,9 +1408,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);
@@ -1428,9 +1429,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);
@@ -1440,9 +1441,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);
@@ -1455,9 +1456,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);