aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2019-06-23 23:31:51 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-12 02:09:15 +0100
commit38d7c1530a65a7ff1bd10775c4a35269b2416538 (patch)
treecb35c9ea9e6e26f0d09ce82ddc3bb41a13fc038f /src/server/scripts/EasternKingdoms
parenta9946bd580272d85b2f88464a33e4766ba93c10a (diff)
Combat/Threat: Split ThreatManager::NotifyDisengaged off from ThreatManager::ClearAllThreat. NotifyDisengaged signifies intent to clear the engagement flag, and should only be called from AI. Fixes #23490.
(cherry picked from commit 1158f267df22c0782fb5f20f7de31f5643ac0b58)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp2
4 files changed, 9 insertions, 10 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 f6bbc3bd5ea..b2a1a795c7a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
@@ -375,8 +375,8 @@ public:
{//do not call EnterEvadeMode(), it will create infinit loops
boss->Respawn();
boss->RemoveAllAuras();
- boss->GetThreatManager().ClearAllThreat();
boss->CombatStop(true);
+ boss->GetThreatManager().NotifyDisengaged();
boss->LoadCreaturesAddon();
boss->GetMotionMaster()->MoveTargetedHome();
boss->SetLootRecipient(nullptr);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index 6f8157e3306..68400643091 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -1257,7 +1257,7 @@ public:
Julianne->GetMotionMaster()->Clear();
Julianne->setDeathState(JUST_DIED);
Julianne->CombatStop(true);
- Julianne->GetThreatManager().ClearAllThreat();
+ Julianne->GetThreatManager().NotifyDisengaged();
Julianne->SetDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}
return;
@@ -1527,7 +1527,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &dama
Romulo->GetMotionMaster()->Clear();
Romulo->setDeathState(JUST_DIED);
Romulo->CombatStop(true);
- Romulo->GetThreatManager().ClearAllThreat();
+ 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 e97cfd077d4..64c8497712c 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -1387,8 +1387,8 @@ public:
if (me->HasAura(SPELL_THE_MIGHT_OF_MOGRAINE))
me->RemoveAurasDueToSpell(SPELL_THE_MIGHT_OF_MOGRAINE);
me->RemoveAllAuras();
- me->GetThreatManager().ClearAllThreat();
me->CombatStop(true);
+ me->GetThreatManager().NotifyDisengaged();
me->InterruptNonMeleeSpells(false);
me->SetWalk(false);
@@ -1408,8 +1408,8 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKorfaxGUID))
{
temp->RemoveAllAuras();
- temp->GetThreatManager().ClearAllThreat();
temp->CombatStop(true);
+ temp->GetThreatManager().NotifyDisengaged();
temp->AttackStop();
temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
@@ -1419,7 +1419,6 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiMaxwellGUID))
{
temp->RemoveAllAuras();
- temp->GetThreatManager().ClearAllThreat();
temp->CombatStop(true);
temp->AttackStop();
temp->SetFaction(me->GetFaction());
@@ -1430,8 +1429,8 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEligorGUID))
{
temp->RemoveAllAuras();
- temp->GetThreatManager().ClearAllThreat();
temp->CombatStop(true);
+ temp->GetThreatManager().NotifyDisengaged();
temp->AttackStop();
temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
@@ -1442,8 +1441,8 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKoltiraGUID))
{
temp->RemoveAllAuras();
- temp->GetThreatManager().ClearAllThreat();
temp->CombatStop(true);
+ temp->GetThreatManager().NotifyDisengaged();
temp->AttackStop();
temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
@@ -1457,8 +1456,8 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiThassarianGUID))
{
temp->RemoveAllAuras();
- temp->GetThreatManager().ClearAllThreat();
temp->CombatStop(true);
+ temp->GetThreatManager().NotifyDisengaged();
temp->AttackStop();
temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index 10b2f60e1c2..98bb8501173 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -682,7 +682,7 @@ class spell_mandokir_ohgan_orders_trigger : public SpellScriptLoader
// HACK: research better way
caster->ClearUnitState(UNIT_STATE_CASTING);
caster->GetMotionMaster()->Clear();
- caster->GetThreatManager().ClearAllThreat();
+ caster->GetThreatManager().ResetAllThreat();
caster->GetThreatManager().AddThreat(target, 50000000.0f);
// TODO: Fixate mechanic
}