aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Kalimdor
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-01-03 20:04:19 +0100
committerGitHub <noreply@github.com>2018-01-03 20:04:19 +0100
commit532ab1c7f8653d1a2e48aa1f1f8a9ba1041d4bb7 (patch)
tree81e2f7eb89b3144c14dd488ea6304f6d44d19848 /src/server/scripts/Kalimdor
parent425b181544a21d2246fdf0261ba76a37e2510883 (diff)
Core: Combat/threat system rewrite (PR #19930)
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with. - PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting. - By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers. - Threat and combat systems are no longer the same. - They still have an enforced relationship (threat implies combat - clearing combat clears threat)... - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list... - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress! - AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`. - Vehicle threat is now properly pooled on the main vehicle body (fixes #16542). - Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar). - Target re-selection is now significantly faster. - Fixed a ton of other smaller edge case bugs, probably. Closes #7951 and #19998.
Diffstat (limited to 'src/server/scripts/Kalimdor')
-rw-r--r--src/server/scripts/Kalimdor/boss_azuregos.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp
index 8a98eae734a..e4e12a765ca 100644
--- a/src/server/scripts/Kalimdor/boss_azuregos.cpp
+++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp
@@ -118,13 +118,10 @@ class boss_azuregos : public CreatureScript
case EVENT_TELEPORT:
{
Talk(SAY_TELEPORT);
- ThreatContainer::StorageType const& threatlist = me->GetThreatManager().getThreatList();
- for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
- {
- if (Player* player = ObjectAccessor::GetPlayer(*me, (*i)->getUnitGuid()))
+ for (auto const& pair : me->GetCombatManager().GetPvECombatRefs())
+ if (Player* player = pair.second->GetOther(me)->ToPlayer())
DoTeleportPlayer(player, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, player->GetOrientation());
- }
-
+
ResetThreatList();
events.ScheduleEvent(EVENT_TELEPORT, 30000);
break;