Core/AI: add another helper for "ScriptedAI::ForceCombatStop"

(cherry picked from commit 3842ab2781)
This commit is contained in:
ccrs
2019-11-25 20:43:23 +01:00
committed by Shauren
parent 9bede687ce
commit d967d03151
2 changed files with 8 additions and 0 deletions

View File

@@ -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);

View File

@@ -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]);