Core/Combat: rename getThreatMgr() to GetThreatMgr() (#11758)

This commit is contained in:
Maelthyr
2022-05-18 10:36:57 +02:00
committed by GitHub
parent 8c058791ed
commit c5368816fa
67 changed files with 129 additions and 129 deletions

View File

@@ -91,8 +91,8 @@ public:
if (Unit* target = me->GetVictim())
{
_conflagrateTarget = me->GetVictim()->GetGUID();
_conflagrateThreat = me->getThreatMgr().getThreat(me->GetVictim());
me->getThreatMgr().modifyThreatPercent(target, -100);
_conflagrateThreat = me->GetThreatMgr().getThreat(me->GetVictim());
me->GetThreatMgr().modifyThreatPercent(target, -100);
}
events.ScheduleEvent(EVENT_CONFLAGRATION, urand(10000, 13000));
events.ScheduleEvent(EVENT_CHECK_CONFLAGRATION_TARGET, 10000);
@@ -112,7 +112,7 @@ public:
case EVENT_CHECK_CONFLAGRATION_TARGET:
if (Unit* target = ObjectAccessor::GetUnit(*me, _conflagrateTarget))
{
me->getThreatMgr().addThreat(target, _conflagrateThreat);
me->GetThreatMgr().addThreat(target, _conflagrateThreat);
}
break;
}

View File

@@ -122,13 +122,13 @@ struct boss_mor_grayhoof : public BossAI
// Sleep can target tank, we need to drop threat temporarily on the target.
_sleepTargetGUID = target->GetGUID();
_sleepTargetThreat = me->getThreatMgr().getThreat(target);
me->getThreatMgr().modifyThreatPercent(target, -100);
_sleepTargetThreat = me->GetThreatMgr().getThreat(target);
me->GetThreatMgr().modifyThreatPercent(target, -100);
_scheduler.Schedule(10s, [this](TaskContext /*context*/)
{
if (Unit* sleepTarget = ObjectAccessor::GetUnit(*me, _sleepTargetGUID))
{
me->getThreatMgr().addThreat(sleepTarget, _sleepTargetThreat);
me->GetThreatMgr().addThreat(sleepTarget, _sleepTargetThreat);
}
});
}

View File

@@ -674,7 +674,7 @@ struct boss_nefarian : public BossAI
break;
case EVENT_CLASSCALL:
std::set<uint8> classesPresent;
for (auto& ref : me->getThreatMgr().getThreatList())
for (auto& ref : me->GetThreatMgr().getThreatList())
{
if (ref->getTarget() && ref->getTarget()->GetTypeId() == TYPEID_PLAYER)
{

View File

@@ -597,7 +597,7 @@ public:
{
if (Creature* creatureCaster = caster->ToCreature())
{
creatureCaster->getThreatMgr().ResetAllThreat();
creatureCaster->GetThreatMgr().ResetAllThreat();
}
}
}

View File

@@ -234,7 +234,7 @@ public:
void EnterEvadeMode(EvadeReason why) override
{
if (!me->getThreatMgr().getThreatList().empty())
if (!me->GetThreatMgr().getThreatList().empty())
{
if (!_processingMagmaBurst)
{

View File

@@ -170,8 +170,8 @@ public:
if (Creature* creatureCaster = caster->ToCreature())
{
creatureCaster->getThreatMgr().ResetAllThreat();
creatureCaster->getThreatMgr().addThreat(target, 1);
creatureCaster->GetThreatMgr().ResetAllThreat();
creatureCaster->GetThreatMgr().addThreat(target, 1);
creatureCaster->AI()->AttackStart(target); // Attack the target which caster will teleport to.
}
}

View File

@@ -212,7 +212,7 @@ public:
}
// aggro target if Red Beam
if (j == RED_PORTAL && me->GetVictim() != target && target->GetTypeId() == TYPEID_PLAYER)
me->getThreatMgr().addThreat(target, 100000.0f + DoGetThreat(me->GetVictim()));
me->GetThreatMgr().addThreat(target, 100000.0f + DoGetThreat(me->GetVictim()));
}
}

View File

@@ -251,7 +251,7 @@ public:
if (!info)
return;
ThreatContainer::StorageType const& t_list = me->getThreatMgr().getThreatList();
ThreatContainer::StorageType const& t_list = me->GetThreatMgr().getThreatList();
std::vector<Unit*> targets;
if (t_list.empty())

View File

@@ -162,7 +162,7 @@ public:
void FlameWreathEffect()
{
std::vector<Unit*> targets;
ThreatContainer::StorageType const& t_list = me->getThreatMgr().getThreatList();
ThreatContainer::StorageType const& t_list = me->GetThreatMgr().getThreatList();
if (t_list.empty())
return;

View File

@@ -393,7 +393,7 @@ public:
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster()->getThreatMgr().ResetAllThreat();
GetCaster()->GetThreatMgr().ResetAllThreat();
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, SPELL_BLINK, true);
}

View File

@@ -299,15 +299,15 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
void RecalculateThreat()
{
ThreatContainer::StorageType const& tList = me->getThreatMgr().getThreatList();
ThreatContainer::StorageType const& tList = me->GetThreatMgr().getThreatList();
for( ThreatContainer::StorageType::const_iterator itr = tList.begin(); itr != tList.end(); ++itr )
{
Unit* pUnit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
if( pUnit && pUnit->GetTypeId() == TYPEID_PLAYER && me->getThreatMgr().getThreat(pUnit) )
if( pUnit && pUnit->GetTypeId() == TYPEID_PLAYER && me->GetThreatMgr().getThreat(pUnit) )
{
float threatMod = GetThreatMod(me->GetDistance2d(pUnit), (float)pUnit->GetArmor(), pUnit->GetHealth(), pUnit->GetMaxHealth(), pUnit);
me->getThreatMgr().modifyThreatPercent(pUnit, -100);
if (HostileReference* ref = me->getThreatMgr().getOnlineContainer().getReferenceByTarget(pUnit))
me->GetThreatMgr().modifyThreatPercent(pUnit, -100);
if (HostileReference* ref = me->GetThreatMgr().getOnlineContainer().getReferenceByTarget(pUnit))
ref->addThreat(10000000.0f * threatMod);
}
}
@@ -741,7 +741,7 @@ public:
case EVENT_SPELL_BLINK:
{
bool InMeleeRange = false;
ThreatContainer::StorageType const& t_list = me->getThreatMgr().getThreatList();
ThreatContainer::StorageType const& t_list = me->GetThreatMgr().getThreatList();
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
if (Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
if (target->IsWithinMeleeRange(me))

View File

@@ -368,7 +368,7 @@ public:
Unit* SelectUnitCasting()
{
ThreatContainer::StorageType threatlist = me->getThreatMgr().getThreatList();
ThreatContainer::StorageType threatlist = me->GetThreatMgr().getThreatList();
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))