refactor(Core/Combat): Code style and improvement of ThreatMgr (#12992)
This commit is contained in:
+3
-3
@@ -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().ModifyThreatByPercent(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;
|
||||
}
|
||||
|
||||
+3
-3
@@ -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().ModifyThreatByPercent(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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -679,7 +679,7 @@ struct boss_nefarian : public BossAI
|
||||
case EVENT_CLASSCALL:
|
||||
if (classesPresent.empty())
|
||||
{
|
||||
for (auto& ref : me->GetThreatMgr().getThreatList())
|
||||
for (auto& ref : me->GetThreatMgr().GetThreatList())
|
||||
{
|
||||
if (ref->getTarget() && ref->getTarget()->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
|
||||
@@ -236,7 +236,7 @@ public:
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (!me->GetThreatMgr().getThreatList().empty())
|
||||
if (!me->GetThreatMgr().GetThreatList().empty())
|
||||
{
|
||||
if (!_processingMagmaBurst)
|
||||
{
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
if (Creature* creatureCaster = caster->ToCreature())
|
||||
{
|
||||
creatureCaster->GetThreatMgr().ResetAllThreat();
|
||||
creatureCaster->GetThreatMgr().addThreat(target, 1);
|
||||
creatureCaster->GetThreatMgr().AddThreat(target, 1);
|
||||
creatureCaster->AI()->AttackStart(target); // Attack the target which caster will teleport to.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user