Core/AI: Add new method to force creatures around to stop combat

(cherry picked from commit 06443e38e761ed8ac7ce803c39bbbc7263983479)
This commit is contained in:
jackpoz
2021-12-18 22:46:24 +01:00
committed by Shauren
parent 14c2a7fb92
commit 7d78ddcbd5
2 changed files with 12 additions and 0 deletions
@@ -515,6 +515,16 @@ void BossAI::TeleportCheaters()
}
}
void BossAI::ForceStopCombatForCreature(uint32 entry, float maxSearchRange /*= 250.0f*/)
{
TC_LOG_WARN("scripts.ai", "BossAI::ForceStopCombatForCreature: called on '%s' with creature entry '%u'. This should be fixed in another way than calling this function. Debug info: %s", me->GetName().c_str(), entry, me->GetDebugInfo().c_str());
std::list<Creature*> creatures;
me->GetCreatureListWithEntryInGrid(creatures, entry, maxSearchRange);
for (Creature* creature : creatures)
creature->CombatStop();
}
void BossAI::JustSummoned(Creature* summon)
{
summons.Summon(summon);