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

This commit is contained in:
jackpoz
2019-10-12 20:28:18 +02:00
parent 7fcb77ecd1
commit 06443e38e7
2 changed files with 12 additions and 0 deletions

View File

@@ -517,6 +517,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);

View File

@@ -336,6 +336,8 @@ class TC_GAME_API BossAI : public ScriptedAI
void TeleportCheaters();
void ForceStopCombatForCreature(uint32 entry, float maxSearchRange = 250.0f);
EventMap events;
SummonList summons;
TaskScheduler scheduler;