diff options
| author | Matan Shukry <matanshukry@gmail.com> | 2021-12-28 14:24:10 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-28 13:24:10 +0100 | 
| commit | 8fabe5a3aacf7797f03d074ab8434f445be64955 (patch) | |
| tree | dd3c977290be47d5a708947893c3544678045194 /src/server/game/Globals/ObjectMgr.h | |
| parent | 1aad7f8ddd486e60f76730d3baa36ec63711c7e8 (diff) | |
Core/Phasing: Implemented db spawns in personal phases (#26345)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.h')
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.h | 23 | 
1 files changed, 17 insertions, 6 deletions
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 52eefdec97c..4443d8ba018 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -487,6 +487,7 @@ struct CellObjectGuids  };  typedef std::unordered_map<uint32/*cell_id*/, CellObjectGuids> CellObjectGuidsMap;  typedef std::unordered_map<std::pair<uint32 /*mapId*/, Difficulty>, CellObjectGuidsMap> MapObjectGuids; +typedef std::map<std::tuple<uint32/*mapId*/, Difficulty, uint32 /*phaseId*/>, CellObjectGuidsMap> MapPersonalObjectGuids;  struct TrinityString  { @@ -1454,16 +1455,19 @@ class TC_GAME_API ObjectMgr              return nullptr;          } -        CellObjectGuids const& GetCellObjectGuids(uint16 mapid, Difficulty spawnMode, uint32 cell_id) +        CellObjectGuids const& GetCellObjectGuids(uint32 mapid, Difficulty spawnMode, uint32 cell_id)          {              return _mapObjectGuidsStore[{ mapid, spawnMode }][cell_id];          } -        CellObjectGuidsMap const& GetMapObjectGuids(uint16 mapid, Difficulty spawnMode) +        CellObjectGuidsMap const& GetMapObjectGuids(uint32 mapid, Difficulty spawnMode)          {              return _mapObjectGuidsStore[{ mapid, spawnMode }];          } +        bool HasPersonalSpawns(uint32 mapid, Difficulty spawnMode, uint32 phaseId) const; +        CellObjectGuids const* GetCellPersonalObjectGuids(uint32 mapid, Difficulty spawnMode, uint32 phaseId, uint32 cell_id) const; +          /**           * Gets temp summon data for all creatures of specified group.           * @@ -1589,10 +1593,10 @@ class TC_GAME_API ObjectMgr          void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }          // grid objects -        void AddCreatureToGrid(ObjectGuid::LowType guid, CreatureData const* data); -        void RemoveCreatureFromGrid(ObjectGuid::LowType guid, CreatureData const* data); -        void AddGameobjectToGrid(ObjectGuid::LowType guid, GameObjectData const* data); -        void RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectData const* data); +        void AddCreatureToGrid(CreatureData const* data); +        void RemoveCreatureFromGrid(CreatureData const* data); +        void AddGameobjectToGrid(GameObjectData const* data); +        void RemoveGameobjectFromGrid(GameObjectData const* data);          ObjectGuid::LowType AddGameObjectData(uint32 entry, uint32 map, Position const& pos, QuaternionData const& rot, uint32 spawntimedelay = 0);          ObjectGuid::LowType AddCreatureData(uint32 entry, uint32 map, Position const& pos, uint32 spawntimedelay = 0); @@ -1839,6 +1843,12 @@ class TC_GAME_API ObjectMgr          QuestRelationResult GetQuestRelationsFrom(QuestRelations const& map, uint32 key, bool onlyActive) const { return { map.equal_range(key), onlyActive }; }          void PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count); +        template<CellGuidSet CellObjectGuids::*guids> +        void AddSpawnDataToGrid(SpawnData const* data); + +        template<CellGuidSet CellObjectGuids::*guids> +        void RemoveSpawnDataFromGrid(SpawnData const* data); +          MailLevelRewardContainer _mailLevelRewardStore;          CreatureBaseStatsContainer _creatureBaseStatsStore; @@ -1865,6 +1875,7 @@ class TC_GAME_API ObjectMgr          HalfNameContainer _petHalfName1;          MapObjectGuids _mapObjectGuidsStore; +        MapPersonalObjectGuids _mapPersonalObjectGuidsStore;          CreatureDataContainer _creatureDataStore;          CreatureTemplateContainer _creatureTemplateStore;          CreatureModelContainer _creatureModelStore;  | 
