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

@@ -151,7 +151,7 @@ public:
events.RepeatEvent(2000);
break;
case EVENT_SPELL_FEAR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true))
me->CastCustomSpell(SPELL_FEAR, SPELLVALUE_MAX_TARGETS, 1, target, false);
events.RepeatEvent(urand(8000, 12000));
break;
@@ -160,7 +160,7 @@ public:
events.RepeatEvent(urand(10000, 15000));
break;
case EVENT_SPELL_CORRUPT_SOUL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
Talk(SAY_CORRUPT_SOUL);
me->CastSpell(target, SPELL_CORRUPT_SOUL, false);

View File

@@ -212,7 +212,7 @@ public:
events.RepeatEvent(5000);
break;
case EVENT_SPELL_MIRRORED_SOUL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 90.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
{
me->CastSpell(target, SPELL_MIRRORED_SOUL, false);
me->setAttackTimer(BASE_ATTACK, 2500);
@@ -221,7 +221,7 @@ public:
events.RepeatEvent(urand(20000, 30000));
break;
case EVENT_SPELL_WELL_OF_SOULS:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, SPELL_WELL_OF_SOULS, false);
events.RepeatEvent(urand(25000, 30000));
events.DelayEventsToMax(4000, 0);
@@ -237,7 +237,7 @@ public:
case EVENT_SPELL_WAILING_SOULS:
Talk(SAY_FACE_WAILING_SOUL);
Talk(EMOTE_WAILING_SOUL);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
me->CastCustomSpell(SPELL_WAILING_SOULS_TARGETING, SPELLVALUE_MAX_TARGETS, 1, target, false);
events.RepeatEvent(80000);
events.DelayEventsToMax(20000, 0);

View File

@@ -685,7 +685,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -781,7 +781,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -925,7 +925,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -1020,7 +1020,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -1103,7 +1103,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}

View File

@@ -242,7 +242,7 @@ public:
break;
case EVENT_SPELL_THROW_SARONITE:
bCanSayBoulderHit = true;
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 140.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 140.0f, true))
{
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_BOSS_EMOTE, LANG_UNIVERSAL, me, nullptr, EMOTE_THROW_SARONITE);
@@ -264,7 +264,7 @@ public:
events.RepeatEvent(35000);
break;
case EVENT_SPELL_DEEP_FREEZE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
Talk(EMOTE_DEEP_FREEZE, target);
me->CastSpell(target, SPELL_DEEP_FREEZE, false);

View File

@@ -188,7 +188,7 @@ public:
case EVENT_SPELL_TOXIC_WASTE:
if (Creature* k = GetKrick())
if (!k->HasUnitState(UNIT_STATE_CASTING))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
{
k->CastSpell(target, SPELL_TOXIC_WASTE);
events.RepeatEvent(urand(7000, 10000));
@@ -203,7 +203,7 @@ public:
case EVENT_SPELL_SHADOW_BOLT:
if (Creature* k = GetKrick())
if (!k->HasUnitState(UNIT_STATE_CASTING))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 35.0f, true))
{
k->CastSpell(target, SPELL_SHADOW_BOLT);
events.RepeatEvent(14000);
@@ -223,7 +223,7 @@ public:
case 0: // Pursuit
if (Creature* k = GetKrick())
k->AI()->Talk(RAND(SAY_TARGET_1, SAY_TARGET_2, SAY_TARGET_3));
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true))
me->CastSpell(target, SPELL_PURSUIT, false);
break;
case 1: // Poison Nova

View File

@@ -173,18 +173,18 @@ public:
events.ScheduleEvent(EVENT_SPELL_FORCEFUL_SMASH, urand(40000, 48000));
break;
case EVENT_SPELL_OVERLORDS_BRAND:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 95.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 95.0f, true))
me->CastSpell(target, SPELL_OVERLORDS_BRAND, false);
events.RepeatEvent(urand(11000, 12000));
break;
case EVENT_RIMEFANG_SPELL_ICY_BLAST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 190.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 190.0f, true))
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_RIMEFANG_GUID)))
c->CastSpell(target, RIMEFANG_SPELL_ICY_BLAST, false);
events.RepeatEvent(5000);
break;
case EVENT_SPELL_MARK_OF_RIMEFANG:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 190.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 190.0f, true))
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_RIMEFANG_GUID)))
{
Talk(SAY_MARK);

View File

@@ -476,7 +476,7 @@ public:
events.RepeatEvent(4000);
break;
case 2: // Conversion Beam
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, 69578, false);
events.RepeatEvent(urand(20000, 25000));
break;