mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
refactor(Core/UnitAI): Update target selector (#13169)
* refactor(Core/UnitAI): Update TargetSelector. Cherry-pick: *https://github.com/TrinityCore/TrinityCore/pull/19930 Co-authored-by: Treeston <treeston@users.noreply.github.com> * fix GGC/CLang errors in scripts * . * missing a file and fix a script error * . * fix path changes dude to a miss click in the second commit * . Co-authored-by: Maelthyrr <lynethris@protonmail.ch> Co-authored-by: Treeston <treeston@users.noreply.github.com>
This commit is contained in:
@@ -105,10 +105,10 @@ struct npc_obsidian_destroyer : public ScriptedAI
|
||||
_scheduler.Schedule(6s, [this](TaskContext context)
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
SelectTargetList(targets, [&](Unit* target)
|
||||
SelectTargetList(targets, 6, SelectTargetMethod::Random, 1, [&](Unit* target)
|
||||
{
|
||||
return target && target->IsPlayer() && target->GetPower(POWER_MANA) > 0;
|
||||
}, 6, SelectTargetMethod::Random);
|
||||
});
|
||||
|
||||
for (Unit* target : targets)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user