mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Core/Threat: Threat system adjustments:
* Online states are now re-evaluated before victim update instead of continuously. Closes #22226. Tagging #21501.
* Victim update now happens every 1s as opposed to every server tick unless current target goes away.
* Suppressed threat is no longer re-established until the victim gains additional threat (by hitting the target, for instance).
* Assistance threat is now split between non-controlled units threatened by target, as opposed to all units threatened by target.
(cherry picked from commit 5cea572a9a)
This commit is contained in:
@@ -295,9 +295,6 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!_lastPlayerCombatState && me->IsEngaged())
|
||||
me->GetThreatManager().UpdateOnlineStates(false, true);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
|
||||
@@ -610,7 +610,10 @@ struct boss_faction_championsAI : public BossAI
|
||||
{
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetModifiableThreatList())
|
||||
if (Player* victim = ref->GetVictim()->ToPlayer())
|
||||
ref->SetThreat(1000000.0f * CalculateThreat(me->GetDistance2d(victim), victim->GetArmor(), victim->GetHealth()));
|
||||
{
|
||||
ref->ScaleThreat(0.0f);
|
||||
ref->AddThreat(1000000.0f * CalculateThreat(me->GetDistance2d(victim), victim->GetArmor(), victim->GetHealth()));
|
||||
}
|
||||
}
|
||||
|
||||
void UpdatePower()
|
||||
|
||||
@@ -600,7 +600,7 @@ class boss_algalon_the_observer : public CreatureScript
|
||||
//! for creatures that start combat in REACT_PASSIVE and UNIT_FLAG_NOT_SELECTABLE
|
||||
//! causing them to immediately evade
|
||||
if (!me->GetThreatManager().IsThreatListEmpty())
|
||||
AttackStart(me->GetThreatManager().SelectVictim());
|
||||
AttackStart(me->GetThreatManager().GetCurrentVictim());
|
||||
for (uint32 i = 0; i < LIVING_CONSTELLATION_COUNT; ++i)
|
||||
if (Creature* summon = DoSummon(NPC_LIVING_CONSTELLATION, ConstellationPos[i], 0, TEMPSUMMON_DEAD_DESPAWN))
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
|
||||
Reference in New Issue
Block a user