mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 08:46:09 +00:00
refactor(Core/AI) don't add currentTarget to the front of the SelectTargetList for MaxThreat/Random (#21965)
This commit is contained in:
@@ -67,7 +67,7 @@ public:
|
||||
}).Schedule(25s, 32s, [this](TaskContext context)
|
||||
{
|
||||
Talk(SAY_SLEEP);
|
||||
DoCastRandomTarget(SPELL_SLEEP, 1, 0.0f, true, false, false);
|
||||
DoCastRandomTarget(SPELL_SLEEP, 0, 0.0f, true, false, false);
|
||||
context.Repeat(35s, 48s);
|
||||
}).Schedule(30s, 48s, [this](TaskContext context)
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ struct boss_lieutenant_drake : public BossAI
|
||||
context.Repeat(25s);
|
||||
}).Schedule(1s, [this](TaskContext context)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 40.0f))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, false, false))
|
||||
{
|
||||
DoCast(target, SPELL_EXPLODING_SHOT);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ struct boss_kurinnaxx : public BossAI
|
||||
context.Repeat(8s, 10s);
|
||||
}).Schedule(5s, 15s, [this](TaskContext context)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.f, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.f, true, false))
|
||||
{
|
||||
target->CastSpell(target, SPELL_SAND_TRAP, true, nullptr, nullptr, me->GetGUID());
|
||||
}
|
||||
|
||||
@@ -50,16 +50,10 @@ struct npc_hivezara_stinger : public ScriptedAI
|
||||
|
||||
scheduler.Schedule(5s, [this](TaskContext context)
|
||||
{
|
||||
Unit* target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u)
|
||||
{
|
||||
return u && !u->IsPet() && u->IsWithinDist2d(me, 20.f) && u->HasAura(SPELL_HIVEZARA_CATALYST);
|
||||
});
|
||||
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 20.0f, true, false, SPELL_HIVEZARA_CATALYST);
|
||||
if (!target)
|
||||
{
|
||||
target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u)
|
||||
{
|
||||
return u && !u->IsPet() && u->IsWithinDist2d(me, 20.f);
|
||||
});
|
||||
target = SelectTarget(SelectTargetMethod::Random, 0, 20.0f, true, false);
|
||||
}
|
||||
|
||||
if (target)
|
||||
|
||||
@@ -98,7 +98,7 @@ struct boss_fankriss : public BossAI
|
||||
})
|
||||
.Schedule(15s, 20s, [this](TaskContext context)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, false))
|
||||
{
|
||||
uint32 spellId = Acore::Containers::SelectRandomContainerElement(entangleSpells);
|
||||
DoCast(target, spellId);
|
||||
|
||||
@@ -115,7 +115,7 @@ struct boss_sartura : public BossAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SARTURA_WHIRLWIND:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false))
|
||||
{
|
||||
me->GetThreatMgr().ResetAllThreat();
|
||||
me->AddThreat(target, 1000.0f);
|
||||
@@ -199,7 +199,7 @@ struct npc_sartura_royal_guard : public ScriptedAI
|
||||
switch (eventid)
|
||||
{
|
||||
case EVENT_GUARD_WHIRLWIND:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false))
|
||||
{
|
||||
me->GetThreatMgr().ResetAllThreat();
|
||||
me->AddThreat(target, 1000.0f);
|
||||
|
||||
@@ -98,7 +98,7 @@ struct npc_anubisath_defender : public ScriptedAI
|
||||
{
|
||||
scheduler.Schedule(6s, 10s, [this](TaskContext context)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 0.0f, false, false))
|
||||
DoCast(target, SPELL_PLAGUE, true);
|
||||
context.Repeat(6s, 10s);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user