refactor(Core/ScriptedAI): few improvements with threat methods (#13146)

improve threat scripts

Co-authored-by: Maelthyrr <lynethris@protonmail.ch>
This commit is contained in:
Maelthyr
2022-11-12 13:29:28 +01:00
committed by GitHub
parent 758ed35db3
commit c1c9dc6105
50 changed files with 100 additions and 73 deletions

View File

@@ -835,7 +835,7 @@ public:
_flyTargetGUID.Clear();
me->RemoveAura(SPELL_LIGHTNING_TENDRILS);
me->RemoveAura(61883);
DoResetThreat();
DoResetThreatList();
break;
case EVENT_ENRAGE:
Talk(SAY_BRUNDIR_BERSERK);

View File

@@ -412,7 +412,7 @@ public:
if (_feralRushTimer >= 6000)
{
DoResetThreat();
DoResetThreatList();
if (!UpdateVictim())
return;

View File

@@ -1184,7 +1184,7 @@ public:
break;
case EVENT_DETONATING_LASHER_FLAME_LASH:
me->CastSpell(me->GetVictim(), SPELL_FLAME_LASH, false);
DoResetThreat();
DoResetThreatList();
if (Unit* target = SelectTargetFromPlayerList(80))
AttackStart(target);
else

View File

@@ -1033,7 +1033,7 @@ public:
break;
case 4:
me->SetReactState(REACT_AGGRESSIVE);
DoResetThreat();
DoResetThreatList();
Phase = 4;
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
if (Unit* target = SelectTargetFromPlayerList(75.0f))
@@ -1613,7 +1613,7 @@ public:
break;
case 4:
me->SetReactState(REACT_AGGRESSIVE);
DoResetThreat();
DoResetThreatList();
Phase = 4;
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
if (Unit* target = SelectTargetFromPlayerList(75.0f))

View File

@@ -518,7 +518,7 @@ public:
Talk(EMOTE_PERMA_GROUND);
me->SetControlled(false, UNIT_STATE_ROOT);
me->DisableRotate(false);
DoResetThreat();
DoResetThreatList();
Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0, true);
if (!target)
target = me->SelectNearestPlayer(200.0f);

View File

@@ -552,7 +552,7 @@ public:
summons.DoAction(ACTION_SIF_JOIN_FIGHT, pred);
}
DoResetThreat();
DoResetThreatList();
if (Player* player = GetArenaPlayer())
me->AddThreat(player, 1000.0f);
}

View File

@@ -1511,7 +1511,7 @@ public:
{
if (who && damagetype == DIRECT_DAMAGE)
{
DoResetThreat();
DoResetThreatList();
me->AddThreat(who, 100000);
AttackStart(who);
me->InterruptNonMeleeSpells(false);
@@ -1539,7 +1539,7 @@ public:
return;
me->CastSpell(me, SPELL_DIMINISH_POWER, false);
DoResetThreat();
DoResetThreatList();
}
};
};