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

Port From (https://github.com/TrinityCore/TrinityCore/commit/7d78ddcbd5f68ba7b8d3a7cce527d53d4f37ae0a)
This commit is contained in:
hondacrx
2022-01-05 17:15:41 -05:00
parent f017da4540
commit 873569750b
+10
View File
@@ -504,6 +504,16 @@ namespace Game.AI
}
}
void ForceStopCombatForCreature(uint entry, float maxSearchRange = 250.0f)
{
Log.outWarn(LogFilter.ScriptsAi, $"BossAI::ForceStopCombatForCreature: called on '{me.GetName()}' with creature entry '{entry}'. This should be fixed in another way than calling this function. Debug info: {me.GetDebugInfo()}");
List<Creature> creatures = new();
me.GetCreatureListWithEntryInGrid(creatures, entry, maxSearchRange);
foreach (Creature creature in creatures)
creature.CombatStop();
}
public override void JustSummoned(Creature summon)
{
summons.Summon(summon);