refactor(Core/Combat): implement compatiblity layer for ResetAllThreat() (#11778)

* implement ResetAllThreat()

* .
This commit is contained in:
Maelthyr
2022-05-17 17:01:25 +02:00
committed by GitHub
parent 758463ffe1
commit 5ede1177c5
17 changed files with 23 additions and 20 deletions

View File

@@ -296,7 +296,7 @@ public:
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)) )
{
me->getThreatMgr().resetAllAggro();
me->getThreatMgr().ResetAllThreat();
me->AddThreat(target, 10000.0f);
AttackStart(target);
me->CastSpell(target, SPELL_MINIONS_CHARGE, false);
@@ -749,7 +749,7 @@ public:
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)) )
{
me->getThreatMgr().resetAllAggro();
me->getThreatMgr().ResetAllThreat();
me->AddThreat(target, 10000.0f);
AttackStart(target);
me->CastSpell(target, SPELL_MINIONS_CHARGE, false);

View File

@@ -161,7 +161,7 @@ public:
if (me->HealthBelowPct(50))
{
Talk(SAY_FLESH);
me->getThreatMgr().resetAllAggro();
me->getThreatMgr().ResetAllThreat();
me->CastSpell((Unit*)nullptr, SPELL_TURN_FLESH, false);
events.Reset();
@@ -257,7 +257,7 @@ public:
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
PreventDefaultAction();
GetUnitOwner()->getThreatMgr().resetAllAggro();
GetUnitOwner()->getThreatMgr().ResetAllThreat();
GetUnitOwner()->GetMotionMaster()->Clear();
GetUnitOwner()->CastSpell((Unit*)nullptr, SPELL_TURN_BONES, false);
GetUnitOwner()->GetAI()->DoAction(ACTION_TURN_BONES);

View File

@@ -125,7 +125,7 @@ public:
case EVENT_ECK_SPRING:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 30.0f, true))
{
me->getThreatMgr().resetAllAggro();
me->getThreatMgr().ResetAllThreat();
me->AddThreat(target, 500.0f);
me->CastSpell(target, SPELL_ECK_SPRING, false);
}

View File

@@ -930,7 +930,7 @@ public:
ScriptedAI::AttackStart(who);
if (!targetGUID)
{
me->getThreatMgr().resetAllAggro();
me->getThreatMgr().ResetAllThreat();
me->AddThreat(who, 1000000.0f);
targetGUID = who->GetGUID();
}

View File

@@ -1779,7 +1779,7 @@ public:
for (ThreatContainer::StorageType::const_iterator iter = target_tl.begin(); iter != target_tl.end(); ++iter)
me->getThreatMgr().addThreat((*iter)->getTarget(), (*iter)->getThreat());
c->getThreatMgr().resetAllAggro();
c->getThreatMgr().ResetAllThreat();
for (ThreatContainer::StorageType::const_iterator iter = me_tl.begin(); iter != me_tl.end(); ++iter)
c->getThreatMgr().addThreat((*iter)->getTarget(), (*iter)->getThreat());
}

View File

@@ -1674,7 +1674,7 @@ public:
if (!target || !caster)
return;
caster->getThreatMgr().resetAllAggro();
caster->getThreatMgr().ResetAllThreat();
caster->GetAI()->AttackStart(target); // Chase target
caster->AddThreat(target, 10000000.0f);
}

View File

@@ -138,7 +138,7 @@ public:
heat->ModStackAmount(-1);
}
me->CastSpell(me, SPELL_MOLTEN, true);
me->getThreatMgr().resetAllAggro();
me->getThreatMgr().ResetAllThreat();
}
}
}

View File

@@ -1158,7 +1158,7 @@ public:
}
}
_playerAttack = true;
me->getThreatMgr().resetAllAggro();
me->getThreatMgr().ResetAllThreat();
me->CallForHelp(40.0f);
AttackStart(who);
}

View File

@@ -191,7 +191,7 @@ public:
if (switchTimer >= 10000)
{
switchTimer = 0;
me->getThreatMgr().resetAllAggro();
me->getThreatMgr().ResetAllThreat();
if (Player* player = SelectTargetFromPlayerList(100.0f))
me->AddThreat(player, 100000.0f);
}