aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp2
-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
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp5
-rw-r--r--src/server/scripts/Kalimdor/zone_desolace.cpp4
-rw-r--r--src/server/scripts/Kalimdor/zone_the_barrens.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp7
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp1
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp2
-rw-r--r--src/server/scripts/Outland/zone_hellfire_peninsula.cpp4
-rw-r--r--src/server/scripts/Outland/zone_terokkar_forest.cpp2
-rw-r--r--src/server/scripts/Pet/pet_priest.cpp2
17 files changed, 30 insertions, 37 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index fba83d2edfb..12385a46865 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -868,7 +868,7 @@ public:
ThreatManager& mgr = target->GetThreatManager();
if (!target->IsAlive())
{
- handler->PSendSysMessage("%s (GUID %u) is not alive.", target->GetName().c_str(), target->GetGUID().GetCounter());
+ handler->PSendSysMessage("%s (GUID %u) is not alive.%s", target->GetName().c_str(), target->GetGUID().GetCounter(), target->IsEngaged() ? " (It is, however, engaged. Huh?)" : "");
return true;
}
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);
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
index 9abbf1269c5..c5b67fdd915 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
@@ -424,9 +424,10 @@ void hyjalAI::EnterEvadeMode(EvadeReason /*why*/)
if (me->GetEntry() != JAINA)
me->RemoveAllAuras();
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
+
+ EngagementOver();
+
me->LoadCreaturesAddon();
-
if (me->IsAlive())
me->GetMotionMaster()->MoveTargetedHome();
diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp
index e57fb68463c..ffe447d5cfa 100644
--- a/src/server/scripts/Kalimdor/zone_desolace.cpp
+++ b/src/server/scripts/Kalimdor/zone_desolace.cpp
@@ -90,9 +90,11 @@ public:
me->UpdateEntry(NPC_TAMED_KODO);
me->CombatStop();
- me->GetThreatManager().NotifyDisengaged();
me->SetFaction(FACTION_FRIENDLY);
me->SetSpeedRate(MOVE_RUN, 0.6f);
+
+ EngagementOver();
+
me->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, me->GetFollowAngle());
me->setActive(true);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
index 90ce8c130f6..3bf0afe1c7d 100644
--- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp
+++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
@@ -221,11 +221,11 @@ public:
{
me->RemoveAllAuras();
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
-
me->StopMoving();
+
+ EngagementOver();
+
me->GetMotionMaster()->MoveIdle();
-
me->SetFaction(FACTION_FRIENDLY_F);
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
index 45b64917dc4..291b5a8b395 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
@@ -580,7 +580,7 @@ struct gunship_npc_AI : public ScriptedAI
return;
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
me->GetMotionMaster()->MoveTargetedHome();
}
@@ -725,7 +725,6 @@ class npc_gunship : public CreatureScript
Creature* stalker = *itr;
stalker->RemoveAllAuras();
stalker->CombatStop(true);
- stalker->GetThreatManager().NotifyDisengaged();
}
uint32 explosionSpell = isVictory ? SPELL_EXPLOSION_VICTORY : SPELL_EXPLOSION_WIPE;
@@ -884,7 +883,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
return;
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
me->GetMotionMaster()->MoveTargetedHome();
Reset();
@@ -1148,7 +1147,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
return;
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
me->GetMotionMaster()->MoveTargetedHome();
Reset();
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index 086b0eeeca2..e0cfd7c7f67 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -1801,7 +1801,7 @@ class npc_terenas_menethil : public CreatureScript
return;
me->CombatStop(false);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
}
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
index 76257a25b44..c658e5985e8 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
@@ -122,7 +122,7 @@ public:
ThreatReference* secondThreat = nullptr;
ThreatReference* thirdThreat = nullptr;
- ThreatManager const& mgr = me->GetThreatManager();
+ ThreatManager& mgr = me->GetThreatManager();
Unit* currentVictim = mgr.GetCurrentVictim();
auto list = mgr.GetModifiableThreatList();
auto it = list.begin(), end = list.end();
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
index eebed61e227..2b1a7853139 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
@@ -292,7 +292,7 @@ class boss_urom : public CreatureScript
{
me->RemoveAllAuras();
me->CombatStop(false);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
}
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
index b41f7639b90..dd75d8c9906 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
@@ -634,7 +634,7 @@ class boss_freya : public CreatureScript
Elder->RemoveAllAuras();
Elder->AttackStop();
Elder->CombatStop(true);
- Elder->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
Elder->AI()->DoAction(ACTION_ELDER_FREYA_KILLED);
}
}
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index 7993913252f..396f5d52c5d 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -753,7 +753,6 @@ public:
Creature* owner = GetOwner()->ToCreature();
owner->RemoveAllAurasExceptType(SPELL_AURA_DUMMY);
owner->CombatStop(true);
- owner->GetThreatManager().NotifyDisengaged();
owner->GetMotionMaster()->Clear();
owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, 0.0f);
owner->CastSpell(owner, SPELL_SUBDUED, true);
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
index ee12d3f7772..33e1bf0d82b 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
@@ -525,7 +525,7 @@ public:
{
ThreatManager const& mgr = me->GetThreatManager();
std::list<Unit*> TargetList;
- Unit* currentVictim = mgr.GetCurrentVictim();
+ Unit* currentVictim = mgr.GetLastVictim();
for (ThreatReference const* ref : mgr.GetSortedThreatList())
{
if (Player* tempTarget = ref->GetVictim()->ToPlayer())
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
index 676e2798d79..68be3572bf9 100644
--- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
@@ -102,7 +102,7 @@ public:
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
me->RemoveAllAuras();
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
Talk(SAY_FREE);
return;
}
@@ -974,7 +974,7 @@ public:
me->RestoreFaction();
me->RemoveAllAuras();
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
me->SetImmuneToPC(true);
Talk(SAY_DEFEATED);
diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp
index 9a000906d7c..c9a30cff9af 100644
--- a/src/server/scripts/Outland/zone_terokkar_forest.cpp
+++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp
@@ -92,7 +92,7 @@ public:
me->SetStandState(UNIT_STAND_STATE_SIT);
me->RemoveAllAuras();
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
UnkorUnfriendly_Timer = 60000;
}
diff --git a/src/server/scripts/Pet/pet_priest.cpp b/src/server/scripts/Pet/pet_priest.cpp
index 573dd9750ea..3ef8383e53c 100644
--- a/src/server/scripts/Pet/pet_priest.cpp
+++ b/src/server/scripts/Pet/pet_priest.cpp
@@ -50,7 +50,7 @@ class npc_pet_pri_lightwell : public CreatureScript
return;
me->CombatStop(true);
- me->GetThreatManager().NotifyDisengaged();
+ EngagementOver();
me->ResetPlayerDamageReq();
}
};