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

@@ -305,7 +305,7 @@ public:
if (target->GetGUID() == me->GetVictim()->GetGUID())
{
me->AddThreat(me->GetVictim(), -1000000); // drop current player, add a ton to second. This should guarantee that we don't end up with both 1 and 2 in a cage...
if (Unit* newTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1, 200.0f)) // search in whole room
if (Unit* newTarget = SelectTarget(SelectTargetMethod::MaxThreat, 1, 200.0f)) // search in whole room
{
me->AddThreat(newTarget, 1000000);
}
@@ -336,7 +336,7 @@ public:
events.ScheduleEvent(SPELL_ARCANE_MISSILES, urand(TIMER_ARCANE_MIN, TIMER_ARCANE_MAX));
break;
case SPELL_CURSE_DARKMASTER:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
DoCast(target, SPELL_CURSE_DARKMASTER);
}
@@ -348,7 +348,7 @@ public:
break;
case SPELL_SHADOW_PORTAL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 15.0, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 15.0, true))
{
room = FindRoom();
if (room < 6)

View File

@@ -204,7 +204,7 @@ public:
events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 20000);
break;
case EVENT_DOMINATE_MIND:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 20.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 20.0f, true))
{
me->CastSpell(target, SPELL_DOMINATE_MIND, false);
}

View File

@@ -442,7 +442,7 @@ public:
}
break;
case 3:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, POWER_MANA, 20.0f, false)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, PowerUsersSelector(me, POWER_MANA, 20.0f, false)))
{
me->CastSpell(target, DRAIN_MANA_SPELL, false);
}