refactor(Core/AI) don't add currentTarget to the front of the SelectTargetList for MaxThreat/Random (#21965)

This commit is contained in:
Tereneckla
2025-05-05 19:17:10 +00:00
committed by GitHub
parent 2772da9bf2
commit a8b982dca8
46 changed files with 71 additions and 77 deletions
@@ -99,7 +99,7 @@ struct boss_gurtogg_bloodboil : public BossAI
}, 15s);
ScheduleTimedEvent(1min, [&] {
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true, false))
{
me->RemoveAurasByType(SPELL_AURA_MOD_TAUNT);
me->RemoveAurasDueToSpell(SPELL_ACIDIC_WOUND);
@@ -65,9 +65,11 @@ enum Misc
struct ShadowOfDeathSelector
{
Unit const* _tank;
ShadowOfDeathSelector(Unit const* tank) : _tank(tank) {}
bool operator()(Unit const* target) const
{
return target && !target->HasAura(SPELL_SHADOW_OF_DEATH) && !target->HasAura(SPELL_POSSESS_SPIRIT_IMMUNE);
return target && !target->HasAura(SPELL_SHADOW_OF_DEATH) && !target->HasAura(SPELL_POSSESS_SPIRIT_IMMUNE) && target != _tank;
}
};
@@ -113,7 +115,7 @@ struct boss_teron_gorefiend : public BossAI
ScheduleTimedEvent(10s, [&]
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, ShadowOfDeathSelector()))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, ShadowOfDeathSelector(me->GetThreatMgr().GetCurrentVictim())))
me->CastSpell(target, SPELL_SHADOW_OF_DEATH, false);
}, 30s, 50s);
@@ -91,7 +91,7 @@ struct boss_najentus : public BossAI
ScheduleTimedEvent(21s, [&]
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, false, false))
{
DoCast(target, SPELL_IMPALING_SPINE);
target->CastSpell(target, SPELL_SUMMON_IMPALING_SPINE, true);