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

@@ -123,7 +123,7 @@ public:
events.RepeatEvent(2000);
break;
case EVENT_SPELL_SOUL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
Talk(SAY_ROAR);
me->CastSpell(target, SPELL_STOLEN_SOUL, false);
@@ -138,7 +138,7 @@ public:
events.RepeatEvent(urand(25000, 30000));
break;
case EVENT_SPELL_RIBBON:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
events.RepeatEvent(urand(10000, 20000));
break;

View File

@@ -153,7 +153,7 @@ public:
events.RepeatEvent(10000);
break;
case EVENT_SPELL_FOCUS_FIRE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
{
if (Creature* cr = me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 7000))
focusGUID = cr->GetGUID();

View File

@@ -95,7 +95,7 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_VOID_BLAST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
DoCast(target, SPELL_VOID_BLAST);
++VoidBlastCounter;

View File

@@ -125,7 +125,7 @@ public:
events.RepeatEvent(urand(7000, 12000));
break;
case EVENT_SPELL_POLYMORPH:
if (Unit* target = (IsHeroic() ? SelectTarget(SELECT_TARGET_RANDOM, 0) : SelectTarget(SELECT_TARGET_TOPAGGRO, 1)))
if (Unit* target = (IsHeroic() ? SelectTarget(SelectTargetMethod::Random, 0) : SelectTarget(SelectTargetMethod::MaxThreat, 1)))
me->CastSpell(target, SPELL_POLYMORPH_N, false);
events.RepeatEvent(urand(15000, 17500));
break;
@@ -143,7 +143,7 @@ public:
break;
case EVENT_SPELL_BLINK:
Talk(EMOTE_ARCANE_EXP);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
me->CastSpell(target, SPELL_BLINK, false);
me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation());
@@ -290,13 +290,13 @@ public:
events.DelayEvents(3000);
break;
case EVENT_SPELL_BOMB:
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_SPELL_BOMB, false);
events.RepeatEvent(urand(16000, 24500));
events.DelayEvents(3000);
break;
case EVENT_SPELL_CYCLONE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 45.0f, true))
me->CastSpell(target, SPELL_CYCLONE, false);
events.RepeatEvent(urand(22000, 27000));
events.DelayEvents(3000);

View File

@@ -132,7 +132,7 @@ public:
break;
}
case EVENT_SPELL_CHARGE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_CHARGE, false);
events.RepeatEvent(urand(15000, 25000));
break;

View File

@@ -175,7 +175,7 @@ public:
events.RepeatEvent(urand(15000, 30000));
break;
case EVENT_SPELL_BANISH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, false))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30, false))
me->CastSpell(target, SPELL_BANISH, false);
events.RepeatEvent(16000);
break;

View File

@@ -117,7 +117,7 @@ public:
me->CastSpell(me, DUNGEON_MODE(SPELL_SONIC_BOOM_EFFECT_N, SPELL_SONIC_BOOM_EFFECT_H), true);
break;
case EVENT_SPELL_MURMURS_TOUCH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 80.0f, true))
me->CastSpell(target, DUNGEON_MODE(SPELL_MURMURS_TOUCH_N, SPELL_MURMURS_TOUCH_H), false);
events.RepeatEvent(urand(25000, 35000));
break;
@@ -127,7 +127,7 @@ public:
events.RepeatEvent(5000);
break;
case EVENT_SPELL_MAGNETIC:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 80.0f, true))
{
me->CastSpell(target, SPELL_MAGNETIC_PULL, false);
events.RepeatEvent(urand(15000, 30000));