19 #ifndef TRINITY_POOLHANDLER_H
20 #define TRINITY_POOLHANDLER_H
50 bool IsActiveObject(
uint64 db_guid_or_pool_id)
const;
55 void ActivateObject(
uint64 db_guid_or_pool_id,
uint32 pool_id);
76 bool isEmpty()
const {
return ExplicitlyChanced.empty() && EqualChanced.empty(); }
78 bool CheckPool()
const;
81 void Despawn1Object(
uint64 guid);
86 void RemoveOneRelation(
uint32 child_pool_id);
89 if (EqualChanced.empty())
91 return EqualChanced.front().guid;
114 void LoadQuestPools();
115 void SaveQuestsToDB();
123 bool IsSpawnedObject(
uint64 db_guid_or_pool_id)
const {
return mSpawnedData.IsActiveObject<T>(db_guid_or_pool_id); }
125 bool CheckPool(
uint32 pool_id)
const;
127 void SpawnPool(
uint32 pool_id);
128 void DespawnPool(
uint32 pool_id);
131 void UpdatePool(
uint32 pool_id,
uint64 db_guid_or_pool_id);
133 void ChangeDailyQuests();
134 void ChangeWeeklyQuests();
141 void SpawnPool(
uint32 pool_id,
uint64 db_guid_or_pool_id);
166 #define sPoolMgr PoolMgr::instance()
172 SearchMap::const_iterator itr = mCreatureSearchMap.find(db_guid);
173 if (itr != mCreatureSearchMap.end())
183 SearchMap::const_iterator itr = mGameobjectSearchMap.find(db_guid);
184 if (itr != mGameobjectSearchMap.end())
194 SearchMap::const_iterator itr = mQuestSearchMap.find(pool_id);
195 if (itr != mQuestSearchMap.end())
205 SearchMap::const_iterator itr = mPoolSearchMap.find(pool_id);
206 if (itr != mPoolSearchMap.end())
PooledQuestRelation mQuestGORelation
Definition: PoolMgr.h:137
~PoolGroup()
Definition: PoolMgr.h:75
uint64 GetFirstEqualChancedObjectId()
Definition: PoolMgr.h:87
std::vector< PoolGroup< GameObject > > PoolGroupGameObjectMap
Definition: PoolMgr.h:146
PoolGroup()
Definition: PoolMgr.h:73
SearchMap mCreatureSearchMap
Definition: PoolMgr.h:157
PoolObject(uint64 _guid, float _chance)
Definition: PoolMgr.h:36
SearchMap mGameobjectSearchMap
Definition: PoolMgr.h:158
std::pair< PooledQuestRelation::iterator, PooledQuestRelation::iterator > PooledQuestRelationBoundsNC
Definition: PoolMgr.h:102
PoolObjectList EqualChanced
Definition: PoolMgr.h:97
PoolObjectList ExplicitlyChanced
Definition: PoolMgr.h:96
uint32 max_pool_id
Definition: PoolMgr.h:143
void LoadFromDB()
Definition: AddonMgr.cpp:40
std::multimap< uint32, uint32 > PooledQuestRelation
Definition: PoolMgr.h:100
std::set< uint64 > ActivePoolObjects
Definition: PoolMgr.h:43
PooledQuestRelation mQuestCreatureRelation
Definition: PoolMgr.h:136
PoolGroupPoolMap mPoolPoolGroups
Definition: PoolMgr.h:155
PoolGroupQuestMap mPoolQuestGroups
Definition: PoolMgr.h:156
std::vector< PoolGroup< Creature > > PoolGroupCreatureMap
Definition: PoolMgr.h:145
std::map< uint64, uint32 > SearchMap
Definition: PoolMgr.h:150
ActivePoolObjects mSpawnedCreatures
Definition: PoolMgr.h:62
bool isEmpty() const
Definition: PoolMgr.h:76
~PoolMgr()
Definition: PoolMgr.h:108
uint32_t uint32
Definition: Define.h:150
static void Initialize(PCASC_SALSA20 pState, LPBYTE pbKey, DWORD cbKeyLength, LPBYTE pbVector)
Definition: CascDecrypt.cpp:81
uint64_t uint64
Definition: Define.h:149
PoolTemplateDataMap mPoolTemplate
Definition: PoolMgr.h:152
ActivePoolPools mSpawnedPools
Definition: PoolMgr.h:65
ActivePoolObjects mSpawnedGameobjects
Definition: PoolMgr.h:63
ActivePoolData mSpawnedData
Definition: PoolMgr.h:163
Definition: PoolMgr.h:104
ActivePoolObjects mActiveQuests
Definition: PoolMgr.h:64
std::vector< PoolGroup< Quest > > PoolGroupQuestMap
Definition: PoolMgr.h:148
std::pair< PooledQuestRelation::const_iterator, PooledQuestRelation::const_iterator > PooledQuestRelationBounds
Definition: PoolMgr.h:101
#define TC_GAME_API
Definition: Define.h:134
bool IsSpawnedObject(uint64 db_guid_or_pool_id) const
Definition: PoolMgr.h:123
std::vector< PoolGroup< Pool > > PoolGroupPoolMap
Definition: PoolMgr.h:147
uint32 MaxLimit
Definition: PoolMgr.h:29
std::vector< PoolObject > PoolObjectList
Definition: PoolMgr.h:71
std::pair< uint64, uint32 > SearchPair
Definition: PoolMgr.h:149
PoolGroupCreatureMap mPoolCreatureGroups
Definition: PoolMgr.h:153
float chance
Definition: PoolMgr.h:35
std::vector< PoolTemplateData > PoolTemplateDataMap
Definition: PoolMgr.h:144
uint64 guid
Definition: PoolMgr.h:34
ActivePoolObjects GetActiveQuests() const
Definition: PoolMgr.h:60
void SetPoolId(uint32 pool_id)
Definition: PoolMgr.h:74
PoolGroupGameObjectMap mPoolGameobjectGroups
Definition: PoolMgr.h:154
SearchMap mQuestSearchMap
Definition: PoolMgr.h:160
SearchMap mPoolSearchMap
Definition: PoolMgr.h:159
std::map< uint64, uint32 > ActivePoolPools
Definition: PoolMgr.h:44
void RemoveObject(T *object)
Definition: ObjectAccessor.h:104
uint32 GetPoolId() const
Definition: PoolMgr.h:93
uint32 poolId
Definition: PoolMgr.h:95