diff options
| author | Seyden <saiifii@live.de> | 2022-12-27 16:39:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-27 16:39:05 +0100 |
| commit | 61c51b76c00d932a9180bc6781a244dc18375ef7 (patch) | |
| tree | 291da8d7ade7f1eb9663007550c84936a51f21d3 /src/server/game/AI/ScriptedAI | |
| parent | 8e6842b8b6c12a1a7537909ceea386a215250b89 (diff) | |
Core/Creatures: Implement StringId for Creatures, a custom identifier to make finding specific creatures in script easier (#28500)
Allows targeting specific spawns without hardcoding guids or find a bunch of different creatures with a single search
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index a6037edf291..d8d3a356c06 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -391,6 +391,11 @@ inline Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, return source->FindNearestCreature(entry, maxSearchRange, alive); } +inline Creature* GetClosestCreatureWithOptions(WorldObject* source, float maxSearchRange, FindCreatureOptions const& options) +{ + return source->FindNearestCreatureWithOptions(maxSearchRange, options); +} + inline GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool spawnedOnly = true) { return source->FindNearestGameObject(entry, maxSearchRange, spawnedOnly); @@ -403,6 +408,12 @@ inline void GetCreatureListWithEntryInGrid(Container& container, WorldObject* so } template <typename Container> +inline void GetCreatureListWithOptionsInGrid(Container& container, WorldObject* source, float maxSearchRange, FindCreatureOptions const& options) +{ + source->GetCreatureListWithOptionsInGrid(container, maxSearchRange, options); +} + +template <typename Container> inline void GetGameObjectListWithEntryInGrid(Container& container, WorldObject* source, uint32 entry, float maxSearchRange) { source->GetGameObjectListWithEntryInGrid(container, entry, maxSearchRange); |
