mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 03:42:37 +01:00
Core/AI: Add new method to force creatures around to stop combat
(cherry picked from commit 06443e38e7)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -338,6 +338,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