aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.h')
-rw-r--r--src/server/game/Globals/ObjectMgr.h41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 0931ab9616a..abd452eaeb0 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -490,19 +490,15 @@ struct CellObjectGuids
typedef std::unordered_map<uint32/*cell_id*/, CellObjectGuids> CellObjectGuidsMap;
typedef std::unordered_map<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> MapObjectGuids;
-// Trinity string ranges
-#define MIN_TRINITY_STRING_ID 1 // 'trinity_string'
-#define MAX_TRINITY_STRING_ID 2000000000
-
// Trinity Trainer Reference start range
#define TRINITY_TRAINER_START_REF 200000
-struct TrinityStringLocale
+struct TrinityString
{
StringVector Content;
};
-typedef std::map<uint64, uint64> LinkedRespawnContainer;
+typedef std::map<ObjectGuid, ObjectGuid> LinkedRespawnContainer;
typedef std::unordered_map<uint32, CreatureData> CreatureDataContainer;
typedef std::unordered_map<uint32, GameObjectData> GameObjectDataContainer;
typedef std::map<TempSummonGroupKey, std::vector<TempSummonData> > TempSummonDataContainer;
@@ -512,10 +508,11 @@ typedef std::unordered_map<uint32, ItemLocale> ItemLocaleContainer;
typedef std::unordered_map<uint32, QuestLocale> QuestLocaleContainer;
typedef std::unordered_map<uint32, NpcTextLocale> NpcTextLocaleContainer;
typedef std::unordered_map<uint32, PageTextLocale> PageTextLocaleContainer;
-typedef std::unordered_map<int32, TrinityStringLocale> TrinityStringLocaleContainer;
typedef std::unordered_map<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleContainer;
typedef std::unordered_map<uint32, PointOfInterestLocale> PointOfInterestLocaleContainer;
+typedef std::unordered_map<uint32, TrinityString> TrinityStringContainer;
+
typedef std::multimap<uint32, uint32> QuestRelations; // unit/go -> quest
typedef std::multimap<uint32, uint32> QuestRelationsReverse; // quest -> unit/go
typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator> QuestRelationBounds;
@@ -785,7 +782,7 @@ class ObjectMgr
void GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo* info) const;
- uint64 GetPlayerGUIDByName(std::string const& name) const;
+ ObjectGuid GetPlayerGUIDByName(std::string const& name) const;
/**
* Retrieves the player name by guid.
@@ -800,9 +797,9 @@ class ObjectMgr
*
* @return true if player was found, false otherwise
*/
- bool GetPlayerNameByGUID(uint64 guid, std::string& name) const;
- uint32 GetPlayerTeamByGUID(uint64 guid) const;
- uint32 GetPlayerAccountIdByGUID(uint64 guid) const;
+ bool GetPlayerNameByGUID(ObjectGuid guid, std::string& name) const;
+ uint32 GetPlayerTeamByGUID(ObjectGuid guid) const;
+ uint32 GetPlayerAccountIdByGUID(ObjectGuid guid) const;
uint32 GetPlayerAccountIdByPlayerName(std::string const& name) const;
uint32 GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team);
@@ -977,6 +974,8 @@ class ObjectMgr
return _creatureQuestInvolvedRelationsReverse.equal_range(questId);
}
+ bool LoadTrinityStrings();
+
void LoadEventScripts();
void LoadSpellScripts();
void LoadWaypointScripts();
@@ -986,8 +985,6 @@ class ObjectMgr
void LoadBroadcastTexts();
void LoadBroadcastTextLocales();
- bool LoadTrinityStrings(char const* table, int32 min_value, int32 max_value);
- bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string", MIN_TRINITY_STRING_ID, MAX_TRINITY_STRING_ID); }
void LoadCreatureClassLevelStats();
void LoadCreatureLocales();
void LoadGraveyardOrientations();
@@ -1144,10 +1141,10 @@ class ObjectMgr
}
CreatureData& NewOrExistCreatureData(uint32 guid) { return _creatureDataStore[guid]; }
void DeleteCreatureData(uint32 guid);
- uint64 GetLinkedRespawnGuid(uint64 guid) const
+ ObjectGuid GetLinkedRespawnGuid(ObjectGuid guid) const
{
LinkedRespawnContainer::const_iterator itr = _linkedRespawnStore.find(guid);
- if (itr == _linkedRespawnStore.end()) return 0;
+ if (itr == _linkedRespawnStore.end()) return ObjectGuid::Empty;
return itr->second;
}
CreatureLocale const* GetCreatureLocale(uint32 entry) const
@@ -1208,14 +1205,15 @@ class ObjectMgr
GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; }
void DeleteGOData(uint32 guid);
- TrinityStringLocale const* GetTrinityStringLocale(int32 entry) const
+ TrinityString const* GetTrinityString(uint32 entry) const
{
- TrinityStringLocaleContainer::const_iterator itr = _trinityStringLocaleStore.find(entry);
- if (itr == _trinityStringLocaleStore.end()) return NULL;
+ TrinityStringContainer::const_iterator itr = _trinityStringStore.find(entry);
+ if (itr == _trinityStringStore.end())
+ return nullptr;
return &itr->second;
}
- const char *GetTrinityString(int32 entry, LocaleConstant locale_idx) const;
- const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); }
+ char const* GetTrinityString(uint32 entry, LocaleConstant locale) const;
+ char const* GetTrinityStringForDBCLocale(uint32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); }
LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; }
void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }
@@ -1485,10 +1483,11 @@ class ObjectMgr
QuestLocaleContainer _questLocaleStore;
NpcTextLocaleContainer _npcTextLocaleStore;
PageTextLocaleContainer _pageTextLocaleStore;
- TrinityStringLocaleContainer _trinityStringLocaleStore;
GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore;
PointOfInterestLocaleContainer _pointOfInterestLocaleStore;
+ TrinityStringContainer _trinityStringStore;
+
CacheVendorItemContainer _cacheVendorItemStore;
CacheTrainerSpellContainer _cacheTrainerSpellStore;