mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
feat(Core/AI): convert SelectAggroTarget to enum class (#9893)
This commit is contained in:
@@ -138,7 +138,7 @@ public:
|
||||
|
||||
if (SwarmTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
{
|
||||
DoCast(target, SPELL_CARRION_SWARM);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
target->CastSpell(target, SPELL_SLEEP, true);
|
||||
}
|
||||
SleepTimer = 60000;
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
else AuraTimer -= diff;
|
||||
if (InfernoTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO);
|
||||
DoCast(SelectTarget(SelectTargetMethod::Random, 0, 100, true), SPELL_INFERNO);
|
||||
InfernoTimer = 45000;
|
||||
Talk(SAY_INFERNO);
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ public:
|
||||
{
|
||||
// Three doomfire can be up at the same time
|
||||
Talk(SAY_DOOMFIRE);
|
||||
Unit* temp = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
Unit* temp = SelectTarget(SelectTargetMethod::Random, 1);
|
||||
if (!temp)
|
||||
temp = me->GetVictim();
|
||||
|
||||
@@ -647,19 +647,19 @@ public:
|
||||
case EVENT_SPELL_FINGER_OF_DEATH:
|
||||
if (CanUseFingerOfDeath())
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = SelectTarget(SelectTargetMethod::Random, 0);
|
||||
DoCast(target, SPELL_FINGER_OF_DEATH);
|
||||
DoCastVictim(SPELL_RED_SKY_EFFECT);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_FINGER_OF_DEATH, 3500);
|
||||
break;
|
||||
case EVENT_SPELL_GRIP_OF_THE_LEGION:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION);
|
||||
DoCast(SelectTarget(SelectTargetMethod::Random, 0), SPELL_GRIP_OF_THE_LEGION);
|
||||
events.ScheduleEvent(EVENT_SPELL_GRIP_OF_THE_LEGION, urand(5000, 25000));
|
||||
break;
|
||||
case EVENT_SPELL_AIR_BURST:
|
||||
Talk(SAY_AIR_BURST);
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_AIR_BURST);
|
||||
DoCast(SelectTarget(SelectTargetMethod::Random, 0), SPELL_AIR_BURST);
|
||||
events.ScheduleEvent(EVENT_SPELL_AIR_BURST, urand(25000, 40000));
|
||||
break;
|
||||
case EVENT_SPELL_FEAR:
|
||||
|
||||
@@ -141,14 +141,14 @@ public:
|
||||
|
||||
if (RainTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true), SPELL_RAIN_OF_FIRE);
|
||||
DoCast(SelectTarget(SelectTargetMethod::Random, 0, 30, true), SPELL_RAIN_OF_FIRE);
|
||||
RainTimer = 20000 + rand() % 15000;
|
||||
}
|
||||
else RainTimer -= diff;
|
||||
|
||||
if (DoomTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_DOOM);//never on tank
|
||||
DoCast(SelectTarget(SelectTargetMethod::Random, 1, 100, true), SPELL_DOOM);//never on tank
|
||||
DoomTimer = 45000 + rand() % 5000;
|
||||
}
|
||||
else DoomTimer -= diff;
|
||||
@@ -269,7 +269,7 @@ public:
|
||||
|
||||
if (CrippleTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CRIPPLE);
|
||||
DoCast(SelectTarget(SelectTargetMethod::Random, 0, 100, true), SPELL_CRIPPLE);
|
||||
CrippleTimer = 25000 + rand() % 5000;
|
||||
}
|
||||
else CrippleTimer -= diff;
|
||||
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
else NovaTimer -= diff;
|
||||
if (IceboltTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true), SPELL_ICEBOLT);
|
||||
DoCast(SelectTarget(SelectTargetMethod::Random, 0, 40, true), SPELL_ICEBOLT);
|
||||
IceboltTimer = 11000 + rand() % 20000;
|
||||
}
|
||||
else IceboltTimer -= diff;
|
||||
|
||||
@@ -854,7 +854,7 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
break;
|
||||
|
||||
case TARGETTYPE_RANDOM:
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
target = SelectTarget(SelectTargetMethod::Random, 0);
|
||||
break;
|
||||
|
||||
case TARGETTYPE_VICTIM:
|
||||
|
||||
@@ -764,7 +764,7 @@ public:
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true);
|
||||
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30, true);
|
||||
if (target)
|
||||
summon->Attack(target, false);
|
||||
summons.Summon(summon);
|
||||
@@ -1365,7 +1365,7 @@ public:
|
||||
forcemove = false;
|
||||
if (forcemove)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
me->Attack(target, false);
|
||||
}
|
||||
if (MoveTimer <= diff)
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_CURSE_OF_EXERTION:
|
||||
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_CURSE_OF_EXERTION, false);
|
||||
events.RepeatEvent(9000);
|
||||
break;
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
case EVENT_SPELL_TIME_WARP:
|
||||
Talk(SAY_TIME_WARP);
|
||||
me->CastSpell(me, SPELL_TIME_WARP, false);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_TIME_STEP_N, SPELL_TIME_STEP_H), true);
|
||||
|
||||
events.RepeatEvent(25000);
|
||||
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
events.RepeatEvent(8000);
|
||||
break;
|
||||
case EVENT_SPELL_CORRUPTING_BLIGHT:
|
||||
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_CORRUPTING_BLIGHT, false);
|
||||
events.RepeatEvent(12000);
|
||||
break;
|
||||
|
||||
@@ -149,13 +149,13 @@ public:
|
||||
events.RepeatEvent(7000);
|
||||
break;
|
||||
case EVENT_SPELL_MIND_BLAST:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_MIND_BLAST_N, SPELL_MIND_BLAST_H), false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
case EVENT_SPELL_SLEEP:
|
||||
Talk(SAY_SLEEP);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_SLEEP_N, SPELL_SLEEP_H), false);
|
||||
events.RepeatEvent(17000);
|
||||
break;
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
case EVENT_SPELL_CONSTRICTING_CHAINS:
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, 50.0f, true))
|
||||
if (Unit* pTarget = SelectTarget(SelectTargetMethod::MinThreat, 0, 50.0f, true))
|
||||
me->CastSpell(pTarget, DUNGEON_MODE(SPELL_CONSTRICTING_CHAINS_N, SPELL_CONSTRICTING_CHAINS_H), false);
|
||||
events.RepeatEvent(14000);
|
||||
break;
|
||||
|
||||
@@ -1177,7 +1177,7 @@ public:
|
||||
switch (combatEvents.ExecuteEvent())
|
||||
{
|
||||
case EVENT_COMBAT_EXORCISM:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_ARTHAS_EXORCISM_N, SPELL_ARTHAS_EXORCISM_H), false);
|
||||
|
||||
combatEvents.RepeatEvent(7300);
|
||||
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, 25000);
|
||||
break;
|
||||
case EVENT_EXPLODING_SHOT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 40.0f))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 40.0f))
|
||||
me->CastSpell(target, SPELL_EXPLODING_SHOT, false);
|
||||
events.ScheduleEvent(EVENT_EXPLODING_SHOT, 25000);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user