diff options
author | ccrs <ccrs@users.noreply.github.com> | 2019-11-25 20:43:23 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-19 01:05:59 +0100 |
commit | d967d03151b94e89180192684c055e9709cb1447 (patch) | |
tree | 93ecf72b5a86df6e7a07192a3c4abef64be9d09c /src/server/game/AI/ScriptedAI | |
parent | 9bede687ce3d291c8af8f4deb3f1dcebba1a315d (diff) |
Core/AI: add another helper for "ScriptedAI::ForceCombatStop"
(cherry picked from commit 3842ab2781e4ca518d98d4f50566e42eeced18bf)
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 6 | ||||
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 80ce28a98ee..5bc89845941 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -272,6 +272,12 @@ void ScriptedAI::ForceCombatStopForCreatureEntry(uint32 entry, float maxSearchRa ForceCombatStop(creature, reset); } +void ScriptedAI::ForceCombatStopForCreatureEntry(std::vector<uint32> creatureEntries, float maxSearchRange /*= 250.0f*/, bool samePhase /*= true*/, bool reset /*= true*/) +{ + for (uint32 const entry : creatureEntries) + ForceCombatStopForCreatureEntry(entry, maxSearchRange, samePhase, reset); +} + Creature* ScriptedAI::DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime) { return me->SummonCreature(entry, me->GetPositionX() + offsetX, me->GetPositionY() + offsetY, me->GetPositionZ() + offsetZ, angle, TempSummonType(type), despawntime); diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 42d2006ebd4..dbeae11f4c5 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -192,6 +192,8 @@ struct TC_GAME_API ScriptedAI : public CreatureAI void ForceCombatStop(Creature* who, bool reset = true); // Stops combat, ignoring restrictions, for the found creatures void ForceCombatStopForCreatureEntry(uint32 entry, float maxSearchRange = 250.0f, bool samePhase = true, bool reset = true); + // Stops combat, ignoring restrictions, for the found creatures + void ForceCombatStopForCreatureEntry(std::vector<uint32> creatureEntries, float maxSearchRange = 250.0f, bool samePhase = true, bool reset = true); void DoTeleportTo(float x, float y, float z, uint32 time = 0); void DoTeleportTo(float const pos[4]); |