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

@@ -429,7 +429,7 @@ public:
{
case SPELL_CLAW_N:
case SPELL_CLAW_H:
DoResetThreat();
DoResetThreatList();
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f))
{
me->AddThreat(target, 100.0f);

View File

@@ -927,7 +927,7 @@ public:
Player* player = itr->GetSource();
if( player && me->IsInRange(player, 8.0f, 25.0f, false) )
{
DoResetThreat();
DoResetThreatList();
me->AddThreat(player, 5.0f);
me->CastSpell(player, SPELL_INTERCEPT, false);
break;

View File

@@ -767,7 +767,7 @@ public:
me->RemoveAllAuras();
}
DoZoneInCombat();
DoResetThreat();
DoResetThreatList();
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
{
if (!next)

View File

@@ -336,7 +336,7 @@ public:
case EVENT_SPELL_FEL_STEAK:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 44.0f, true) )
{
DoResetThreat();
DoResetThreatList();
me->AddThreat(target, 50000.0f);
me->CastSpell(target, SPELL_FEL_STEAK_MORPH, true);
me->CastSpell(target, SPELL_FEL_STEAK, true);

View File

@@ -593,7 +593,7 @@ struct boss_jormungarAI : public ScriptedAI
}
me->UpdatePosition(Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + std::sin(angle)*dist, me->GetPositionZ(), me->GetOrientation(), true);
me->StopMovingOnCurrentPos();
DoResetThreat();
DoResetThreatList();
events.RescheduleEvent(EVENT_EMERGE, 6000);
}