feat(Core/AI): convert SelectAggroTarget to enum class (#9893)

This commit is contained in:
Kargatum
2021-12-29 05:13:12 +07:00
committed by GitHub
parent e928d8b67e
commit c81891fc11
236 changed files with 622 additions and 598 deletions

View File

@@ -756,7 +756,7 @@ public:
events.RepeatEvent(3000);
break;
case EVENT_SPELL_STATIC_FIELD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, false))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, false))
{
me->SetFacingToObject(target);
me->CastSpell(target, SPELL_STATIC_FIELD_MAIN, true);
@@ -1497,7 +1497,7 @@ public:
{
uint8 i = 0;
std::list<Unit*> drakes;
c->AI()->SelectTargetList(drakes, (c->GetMap()->GetSpawnMode() == 0 ? 1 : 3), SELECT_TARGET_RANDOM, 0.0f, false, 57403 /*only drakes have this aura*/);
c->AI()->SelectTargetList(drakes, (c->GetMap()->GetSpawnMode() == 0 ? 1 : 3), SelectTargetMethod::Random, 0.0f, false, 57403 /*only drakes have this aura*/);
for (std::list<Unit*>::iterator itr = drakes.begin(); itr != drakes.end() && i < 3; ++itr)
{
DrakeGUID[i++] = (*itr)->GetGUID();

View File

@@ -167,7 +167,7 @@ public:
events.ScheduleEvent(EVENT_ANOMALUS_HEALTH, 1000);
break;
case EVENT_ANOMALUS_ARCANE_ATTRACTION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_ARCANE_ATTRACTION, false);
events.ScheduleEvent(EVENT_ANOMALUS_ARCANE_ATTRACTION, 15000);
break;

View File

@@ -115,7 +115,7 @@ public:
events.ScheduleEvent(EVENT_WHIRLWIND, 16000);
break;
case EVENT_COMMANDER_CHARGE:
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 25.0f))
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 25.0f))
me->CastSpell(target, SPELL_CHARGE, false);
events.ScheduleEvent(EVENT_COMMANDER_CHARGE, 20000);
break;

View File

@@ -181,7 +181,7 @@ public:
Talk(SAY_CRYSTAL_NOVA);
if (IsHeroic())
me->CastSpell(me, SPELL_CRYSTALIZE, false);
else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
else if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, SPELL_CRYSTAL_CHAINS, false);
events.ScheduleEvent(EVENT_CRYSTAL_CHAINS, DUNGEON_MODE(20000, 11000));
break;

View File

@@ -198,7 +198,7 @@ public:
events.ScheduleEvent(EVENT_MAGUS_HEALTH2, 1000);
break;
case EVENT_MAGUS_FIREBOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_FIREBOMB, false);
events.ScheduleEvent(EVENT_MAGUS_FIREBOMB, 3000);
break;

View File

@@ -146,7 +146,7 @@ public:
events.ScheduleEvent(EVENT_ORMOROK_SPELL_REFLECTION, 30000);
break;
case EVENT_ORMOROK_SUMMON:
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 50.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 50.0f, true))
me->CastSpell(target, SPELL_SUMMON_CRYSTALLINE_TANGLER, true);
events.ScheduleEvent(EVENT_ORMOROK_SUMMON, 17000);
break;

View File

@@ -223,7 +223,7 @@ public:
Talk(SAY_SHIELD);
me->CastSpell(me, SPELL_PLANAR_SHIFT, false);
for( uint8 i = 0; i < 3; ++i )
if( Unit* t = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, false) )
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 300.0f, false) )
if( Creature* pa = me->SummonCreature(NPC_PLANAR_ANOMALY, *me, TEMPSUMMON_TIMED_DESPAWN, 17000) )
{
pa->SetCanFly(true);

View File

@@ -335,7 +335,7 @@ public:
events.RepeatEvent(urand(7000, 11000));
break;
case EVENT_TIME_BOMB:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
DoCast(target, DUNGEON_MODE(SPELL_TIME_BOMB_N, SPELL_TIME_BOMB_H));
events.RepeatEvent(urand(20000, 25000));
break;

View File

@@ -173,7 +173,7 @@ public:
break;
case EVENT_AMPLIFY_MAGIC:
{
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
me->CastSpell(target, SPELL_AMPLIFY_MAGIC, false);
events.RepeatEvent(urand(17500, 22500));
}
@@ -204,7 +204,7 @@ public:
events.ScheduleEvent(EVENT_CALL_AZURE_RING_CAPTAIN_1, 16000);
break;
}
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
{
if( Creature* trigger = me->SummonCreature(NPC_ARCANE_BEAM, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13000) )
{