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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user