mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
refactor(Core/Combat): implement compatiblity layer for ResetAllThreat() (#11778)
* implement ResetAllThreat() * .
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -930,7 +930,7 @@ public:
|
||||
ScriptedAI::AttackStart(who);
|
||||
if (!targetGUID)
|
||||
{
|
||||
me->getThreatMgr().resetAllAggro();
|
||||
me->getThreatMgr().ResetAllThreat();
|
||||
me->AddThreat(who, 1000000.0f);
|
||||
targetGUID = who->GetGUID();
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
heat->ModStackAmount(-1);
|
||||
}
|
||||
me->CastSpell(me, SPELL_MOLTEN, true);
|
||||
me->getThreatMgr().resetAllAggro();
|
||||
me->getThreatMgr().ResetAllThreat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1158,7 +1158,7 @@ public:
|
||||
}
|
||||
}
|
||||
_playerAttack = true;
|
||||
me->getThreatMgr().resetAllAggro();
|
||||
me->getThreatMgr().ResetAllThreat();
|
||||
me->CallForHelp(40.0f);
|
||||
AttackStart(who);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user