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

View File

@@ -122,7 +122,7 @@ struct boss_hazzarah : public BossAI
case EVENT_CHAIN_BURN:
if (me->GetPowerPct(POWER_MANA) > 5.f) // totally guessed
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u) { return u && !u->IsPet() && u->getPowerType() == POWER_MANA; }))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [&](Unit* u) { return u && !u->IsPet() && u->getPowerType() == POWER_MANA && u != me->GetVictim(); }))
{
DoCast(target, SPELL_CHAIN_BURN);
}

View File

@@ -150,7 +150,7 @@ public:
events.ScheduleEvent(EVENT_VANISH, 38s, 45s);
return;
case EVENT_AMBUSH:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, false, false))
{
me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation());
DoCast(target, SPELL_AMBUSH, true);