mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/AI: Add new method to force creatures around to stop combat
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user