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

@@ -189,7 +189,7 @@ public:
else if (s->GetEntry() == NPC_THROW)
{
ThrowGUID = s->GetGUID();
if( Unit* t = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true) )
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true) )
s->GetMotionMaster()->MovePoint(0, t->GetPositionX(), t->GetPositionY(), t->GetPositionZ());
}
}

View File

@@ -197,7 +197,7 @@ public:
events.RepeatEvent(urand(4000, 5000));
break;
case EVENT_FROST_TOMB:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true) )
if( !target->HasAura(SPELL_FROST_TOMB_AURA) )
{
Talk(SAY_FROST_TOMB_EMOTE, target);

View File

@@ -196,7 +196,7 @@ public:
Talk(YELL_SKARVALD_DAL_DIEDFIRST);
break;
case EVENT_SHARVALD_CHARGE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, (IsHeroic() ? 100.0f : 30.0f), true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, (IsHeroic() ? 100.0f : 30.0f), true))
{
ScriptedAI::DoResetThreat();
me->AddThreat(target, 10000.0f);
@@ -372,14 +372,14 @@ public:
Talk(YELL_DALRONN_SKA_DIEDFIRST);
break;
case EVENT_SHADOW_BOLT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
{
me->CastSpell(target, DUNGEON_MODE(SPELL_SHADOW_BOLT_N, SPELL_SHADOW_BOLT_H), false);
}
events.RepeatEvent(2050);
break;
case EVENT_DEBILITATE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
{
me->CastSpell(target, SPELL_DEBILITATE, false);
events.RepeatEvent(urand(5000, 10000));

View File

@@ -301,7 +301,7 @@ public:
}
case EVENT_PALEHOOF_IMPALE:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, IsHeroic() ? SPELL_IMPALE_H : SPELL_IMPALE_N, false);
events.RepeatEvent(8000 + rand() % 4000);
@@ -415,7 +415,7 @@ public:
{
case EVENT_JORMUNGAR_ACID_SPIT:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, SPELL_ACID_SPIT, false);
events.RepeatEvent(2000 + rand() % 2000);
@@ -441,7 +441,7 @@ public:
}
case EVENT_JORMUNGAR_POISON_BREATH:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, IsHeroic() ? SPELL_POISON_BREATH_H : SPELL_POISON_BREATH_N, false);
events.RepeatEvent(8000 + rand() % 4000);
@@ -551,7 +551,7 @@ public:
}
case EVENT_RHINO_WOUND:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, IsHeroic() ? SPELL_GRIEVOUS_WOUND_H : SPELL_GRIEVOUS_WOUND_N, false);
events.RepeatEvent(18000 + rand() % 4000);

View File

@@ -226,7 +226,7 @@ public:
}
case EVENT_SKADI_SPEAR:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, IsHeroic() ? SPELL_POISONED_SPEAR_H : SPELL_POISONED_SPEAR_N, false);
events.RepeatEvent(10000);

View File

@@ -323,7 +323,7 @@ public:
break;
}
case EVENT_SORROWGRAVE_RITUAL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
Talk(SAY_SACRIFICE_PLAYER);