feat(Core/Formations): Implement GROUP_AI_FLAG_DONT_RESPAWN_LEADER_ON… (#12128)

This commit is contained in:
Skjalf
2022-06-21 07:07:41 -03:00
committed by GitHub
parent 61c64bbf30
commit ed7622b028
4 changed files with 16 additions and 33 deletions

View File

@@ -103,35 +103,6 @@ public:
zealot->ResetFaction();
}
// TODO: do this in formations, once a flag is added to prevent leaders from respawning as well.
std::list<Creature*> creatureList;
GetCreatureListWithEntryInGrid(creatureList, me, NPC_ZULGURUB_TIGER, 15.0f);
if (_catGuids.empty())
{
for (Creature* creature : creatureList)
{
_catGuids.push_back(creature->GetGUID());
if (!creature->IsAlive())
{
creature->Respawn(true);
}
}
}
else
{
for (ObjectGuid guid : _catGuids)
{
if (Creature* creature = ObjectAccessor::GetCreature(*me, guid))
{
if (!creature->IsAlive())
{
creature->Respawn(true);
}
}
}
}
_scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);