TrinityCore
GameEventMgr Class Reference

#include <GameEventMgr.h>

Public Types

typedef std::set< uint16ActiveEvents
 
typedef std::vector< GameEventDataGameEventDataMap
 

Public Member Functions

ActiveEvents const & GetActiveEventList () const
 
GameEventDataMap const & GetEventMap () const
 
bool CheckOneGameEvent (uint16 entry) const
 
uint32 NextCheck (uint16 entry) const
 
void LoadFromDB ()
 
uint32 Update ()
 
bool IsActiveEvent (uint16 event_id)
 
uint32 StartSystem ()
 
void Initialize ()
 
void StartArenaSeason ()
 
void StartInternalEvent (uint16 event_id)
 
bool StartEvent (uint16 event_id, bool overwrite=false)
 
void StopEvent (uint16 event_id, bool overwrite=false)
 
void HandleQuestComplete (uint32 quest_id)
 
uint64 GetNPCFlag (Creature *cr)
 

Static Public Member Functions

static GameEventMgrinstance ()
 

Public Attributes

GameEventGuidMap mGameEventCreatureGuids
 
GameEventGuidMap mGameEventGameobjectGuids
 

Private Types

typedef std::list< ObjectGuid::LowTypeGuidList
 
typedef std::list< uint32IdList
 
typedef std::vector< GuidListGameEventGuidMap
 
typedef std::vector< IdListGameEventIdMap
 
typedef std::pair< ObjectGuid::LowType, ModelEquipModelEquipPair
 
typedef std::list< ModelEquipPairModelEquipList
 
typedef std::vector< ModelEquipListGameEventModelEquipMap
 
typedef std::pair< uint32, uint32QuestRelation
 
typedef std::list< QuestRelationQuestRelList
 
typedef std::vector< QuestRelListGameEventQuestMap
 
typedef std::unordered_map< uint32, std::vector< VendorItem > > NPCVendorMap
 
typedef std::vector< NPCVendorMapGameEventNPCVendorMap
 
typedef std::map< uint32, GameEventQuestToEventConditionNumQuestIdToEventConditionMap
 
typedef std::pair< ObjectGuid::LowType, uint64GuidNPCFlagPair
 
typedef std::list< GuidNPCFlagPairNPCFlagList
 
typedef std::vector< NPCFlagListGameEventNPCFlagMap
 

Private Member Functions

 GameEventMgr ()
 
 ~GameEventMgr ()
 
void SendWorldStateUpdate (Player *player, uint16 event_id)
 
void AddActiveEvent (uint16 event_id)
 
void RemoveActiveEvent (uint16 event_id)
 
void ApplyNewEvent (uint16 event_id)
 
void UnApplyEvent (uint16 event_id)
 
void GameEventSpawn (int16 event_id)
 
void GameEventUnspawn (int16 event_id)
 
void ChangeEquipOrModel (int16 event_id, bool activate)
 
void UpdateEventQuests (uint16 event_id, bool activate)
 
void UpdateWorldStates (uint16 event_id, bool Activate)
 
void UpdateEventNPCFlags (uint16 event_id)
 
void UpdateEventNPCVendor (uint16 event_id, bool activate)
 
void RunSmartAIScripts (uint16 event_id, bool activate)
 Runs SMART_EVENT_GAME_EVENT_START/_END SAI. More...
 
bool CheckOneGameEventConditions (uint16 event_id)
 
void SaveWorldEventStateToDB (uint16 event_id)
 
bool hasCreatureQuestActiveEventExcept (uint32 quest_id, uint16 event_id)
 
bool hasGameObjectQuestActiveEventExcept (uint32 quest_id, uint16 event_id)
 
bool hasCreatureActiveEventExcept (ObjectGuid::LowType creature_guid, uint16 event_id)
 
bool hasGameObjectActiveEventExcept (ObjectGuid::LowType go_guid, uint16 event_id)
 
void SetHolidayEventTime (GameEventData &event)
 
time_t GetLastStartTime (uint16 event_id) const
 

Private Attributes

GameEventQuestMap mGameEventCreatureQuests
 
GameEventQuestMap mGameEventGameObjectQuests
 
GameEventNPCVendorMap mGameEventVendors
 
GameEventModelEquipMap mGameEventModelEquip
 
GameEventIdMap mGameEventPoolIds
 
GameEventDataMap mGameEvent
 
QuestIdToEventConditionMap mQuestToEventConditions
 
GameEventNPCFlagMap mGameEventNPCFlags
 
ActiveEvents m_ActiveEvents
 
bool isSystemInit
 

Detailed Description

Definition at line 93 of file GameEventMgr.h.

Member Typedef Documentation

◆ ActiveEvents

Definition at line 102 of file GameEventMgr.h.

◆ GameEventDataMap

Definition at line 103 of file GameEventMgr.h.

◆ GameEventGuidMap

typedef std::vector<GuidList> GameEventMgr::GameEventGuidMap
private

Definition at line 145 of file GameEventMgr.h.

◆ GameEventIdMap

typedef std::vector<IdList> GameEventMgr::GameEventIdMap
private

Definition at line 146 of file GameEventMgr.h.

◆ GameEventModelEquipMap

Definition at line 149 of file GameEventMgr.h.

◆ GameEventNPCFlagMap

typedef std::vector<NPCFlagList> GameEventMgr::GameEventNPCFlagMap
private

Definition at line 158 of file GameEventMgr.h.

◆ GameEventNPCVendorMap

typedef std::vector<NPCVendorMap> GameEventMgr::GameEventNPCVendorMap
private

Definition at line 154 of file GameEventMgr.h.

◆ GameEventQuestMap

typedef std::vector<QuestRelList> GameEventMgr::GameEventQuestMap
private

Definition at line 152 of file GameEventMgr.h.

◆ GuidList

typedef std::list<ObjectGuid::LowType> GameEventMgr::GuidList
private

Definition at line 143 of file GameEventMgr.h.

◆ GuidNPCFlagPair

Definition at line 156 of file GameEventMgr.h.

◆ IdList

typedef std::list<uint32> GameEventMgr::IdList
private

Definition at line 144 of file GameEventMgr.h.

◆ ModelEquipList

typedef std::list<ModelEquipPair> GameEventMgr::ModelEquipList
private

Definition at line 148 of file GameEventMgr.h.

◆ ModelEquipPair

Definition at line 147 of file GameEventMgr.h.

◆ NPCFlagList

typedef std::list<GuidNPCFlagPair> GameEventMgr::NPCFlagList
private

Definition at line 157 of file GameEventMgr.h.

◆ NPCVendorMap

typedef std::unordered_map<uint32, std::vector<VendorItem> > GameEventMgr::NPCVendorMap
private

Definition at line 153 of file GameEventMgr.h.

◆ QuestIdToEventConditionMap

◆ QuestRelation

typedef std::pair<uint32, uint32> GameEventMgr::QuestRelation
private

Definition at line 150 of file GameEventMgr.h.

◆ QuestRelList

typedef std::list<QuestRelation> GameEventMgr::QuestRelList
private

Definition at line 151 of file GameEventMgr.h.

Constructor & Destructor Documentation

◆ GameEventMgr()

GameEventMgr::GameEventMgr ( )
private

Definition at line 1510 of file GameEventMgr.cpp.

◆ ~GameEventMgr()

GameEventMgr::~GameEventMgr ( )
private

Definition at line 1514 of file GameEventMgr.cpp.

Member Function Documentation

◆ AddActiveEvent()

void GameEventMgr::AddActiveEvent ( uint16  event_id)
inlineprivate

Definition at line 122 of file GameEventMgr.h.

+ Here is the caller graph for this function:

◆ ApplyNewEvent()

void GameEventMgr::ApplyNewEvent ( uint16  event_id)
private

Run SAI scripts with SMART_EVENT_GAME_EVENT_START

Definition at line 1085 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ChangeEquipOrModel()

void GameEventMgr::ChangeEquipOrModel ( int16  event_id,
bool  activate 
)
private

Definition at line 1330 of file GameEventMgr.cpp.

+ Here is the caller graph for this function:

◆ CheckOneGameEvent()

bool GameEventMgr::CheckOneGameEvent ( uint16  entry) const

Definition at line 44 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckOneGameEventConditions()

bool GameEventMgr::CheckOneGameEventConditions ( uint16  event_id)
private

Definition at line 1573 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GameEventSpawn()

void GameEventMgr::GameEventSpawn ( int16  event_id)
private
Todo:
find out when it is add to map

Definition at line 1163 of file GameEventMgr.cpp.

+ Here is the caller graph for this function:

◆ GameEventUnspawn()

void GameEventMgr::GameEventUnspawn ( int16  event_id)
private

Definition at line 1246 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetActiveEventList()

ActiveEvents const & GameEventMgr::GetActiveEventList ( ) const
inline

Definition at line 104 of file GameEventMgr.h.

◆ GetEventMap()

GameEventDataMap const & GameEventMgr::GetEventMap ( ) const
inline

Definition at line 105 of file GameEventMgr.h.

◆ GetLastStartTime()

time_t GameEventMgr::GetLastStartTime ( uint16  event_id) const
private

Definition at line 1748 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNPCFlag()

uint64 GameEventMgr::GetNPCFlag ( Creature cr)

Definition at line 920 of file GameEventMgr.cpp.

+ Here is the call graph for this function:

◆ HandleQuestComplete()

void GameEventMgr::HandleQuestComplete ( uint32  quest_id)

Definition at line 1518 of file GameEventMgr.cpp.

+ Here is the call graph for this function:

◆ hasCreatureActiveEventExcept()

bool GameEventMgr::hasCreatureActiveEventExcept ( ObjectGuid::LowType  creature_guid,
uint16  event_id 
)
private

Definition at line 1413 of file GameEventMgr.cpp.

+ Here is the caller graph for this function:

◆ hasCreatureQuestActiveEventExcept()

bool GameEventMgr::hasCreatureQuestActiveEventExcept ( uint32  quest_id,
uint16  event_id 
)
private

Definition at line 1386 of file GameEventMgr.cpp.

+ Here is the caller graph for this function:

◆ hasGameObjectActiveEventExcept()

bool GameEventMgr::hasGameObjectActiveEventExcept ( ObjectGuid::LowType  go_guid,
uint16  event_id 
)
private

Definition at line 1429 of file GameEventMgr.cpp.

◆ hasGameObjectQuestActiveEventExcept()

bool GameEventMgr::hasGameObjectQuestActiveEventExcept ( uint32  quest_id,
uint16  event_id 
)
private

Definition at line 1400 of file GameEventMgr.cpp.

+ Here is the caller graph for this function:

◆ Initialize()

void GameEventMgr::Initialize ( )

Definition at line 937 of file GameEventMgr.cpp.

+ Here is the call graph for this function:

◆ instance()

GameEventMgr * GameEventMgr::instance ( )
static

Definition at line 38 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsActiveEvent()

bool GameEventMgr::IsActiveEvent ( uint16  event_id)
inline

Definition at line 110 of file GameEventMgr.h.

+ Here is the caller graph for this function:

◆ LoadFromDB()

void GameEventMgr::LoadFromDB ( )
Todo:
Change to uint8

Definition at line 215 of file GameEventMgr.cpp.

+ Here is the call graph for this function:

◆ NextCheck()

uint32 GameEventMgr::NextCheck ( uint16  entry) const

Definition at line 82 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveActiveEvent()

void GameEventMgr::RemoveActiveEvent ( uint16  event_id)
inlineprivate

Definition at line 123 of file GameEventMgr.h.

+ Here is the caller graph for this function:

◆ RunSmartAIScripts()

void GameEventMgr::RunSmartAIScripts ( uint16  event_id,
bool  activate 
)
private

Runs SMART_EVENT_GAME_EVENT_START/_END SAI.

Iterate over every supported source type (creature and gameobject) Not entirely sure how this will affect units in non-loaded grids.

Definition at line 1645 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveWorldEventStateToDB()

void GameEventMgr::SaveWorldEventStateToDB ( uint16  event_id)
private

Definition at line 1590 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendWorldStateUpdate()

void GameEventMgr::SendWorldStateUpdate ( Player player,
uint16  event_id 
)
private

Definition at line 1606 of file GameEventMgr.cpp.

+ Here is the call graph for this function:

◆ SetHolidayEventTime()

void GameEventMgr::SetHolidayEventTime ( GameEventData event)
private

Definition at line 1657 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartArenaSeason()

void GameEventMgr::StartArenaSeason ( )

Definition at line 969 of file GameEventMgr.cpp.

+ Here is the call graph for this function:

◆ StartEvent()

bool GameEventMgr::StartEvent ( uint16  event_id,
bool  overwrite = false 
)

Definition at line 135 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartInternalEvent()

void GameEventMgr::StartInternalEvent ( uint16  event_id)

Definition at line 121 of file GameEventMgr.cpp.

+ Here is the call graph for this function:

◆ StartSystem()

uint32 GameEventMgr::StartSystem ( )

Definition at line 961 of file GameEventMgr.cpp.

+ Here is the call graph for this function:

◆ StopEvent()

void GameEventMgr::StopEvent ( uint16  event_id,
bool  overwrite = false 
)

Definition at line 175 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UnApplyEvent()

void GameEventMgr::UnApplyEvent ( uint16  event_id)
private

Run SAI scripts with SMART_EVENT_GAME_EVENT_END

Definition at line 1064 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Update()

uint32 GameEventMgr::Update ( )

Definition at line 994 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateEventNPCFlags()

void GameEventMgr::UpdateEventNPCFlags ( uint16  event_id)
private

Definition at line 1115 of file GameEventMgr.cpp.

+ Here is the caller graph for this function:

◆ UpdateEventNPCVendor()

void GameEventMgr::UpdateEventNPCVendor ( uint16  event_id,
bool  activate 
)
private

Definition at line 1149 of file GameEventMgr.cpp.

+ Here is the caller graph for this function:

◆ UpdateEventQuests()

void GameEventMgr::UpdateEventQuests ( uint16  event_id,
bool  activate 
)
private

Definition at line 1446 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateWorldStates()

void GameEventMgr::UpdateWorldStates ( uint16  event_id,
bool  Activate 
)
private

Definition at line 1501 of file GameEventMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ isSystemInit

bool GameEventMgr::isSystemInit
private

Definition at line 170 of file GameEventMgr.h.

◆ m_ActiveEvents

ActiveEvents GameEventMgr::m_ActiveEvents
private

Definition at line 169 of file GameEventMgr.h.

◆ mGameEvent

GameEventDataMap GameEventMgr::mGameEvent
private

Definition at line 166 of file GameEventMgr.h.

◆ mGameEventCreatureGuids

GameEventGuidMap GameEventMgr::mGameEventCreatureGuids

Definition at line 173 of file GameEventMgr.h.

◆ mGameEventCreatureQuests

GameEventQuestMap GameEventMgr::mGameEventCreatureQuests
private

Definition at line 159 of file GameEventMgr.h.

◆ mGameEventGameobjectGuids

GameEventGuidMap GameEventMgr::mGameEventGameobjectGuids

Definition at line 174 of file GameEventMgr.h.

◆ mGameEventGameObjectQuests

GameEventQuestMap GameEventMgr::mGameEventGameObjectQuests
private

Definition at line 160 of file GameEventMgr.h.

◆ mGameEventModelEquip

GameEventModelEquipMap GameEventMgr::mGameEventModelEquip
private

Definition at line 162 of file GameEventMgr.h.

◆ mGameEventNPCFlags

GameEventNPCFlagMap GameEventMgr::mGameEventNPCFlags
private

Definition at line 168 of file GameEventMgr.h.

◆ mGameEventPoolIds

GameEventIdMap GameEventMgr::mGameEventPoolIds
private

Definition at line 165 of file GameEventMgr.h.

◆ mGameEventVendors

GameEventNPCVendorMap GameEventMgr::mGameEventVendors
private

Definition at line 161 of file GameEventMgr.h.

◆ mQuestToEventConditions

QuestIdToEventConditionMap GameEventMgr::mQuestToEventConditions
private

Definition at line 167 of file GameEventMgr.h.


The documentation for this class was generated from the following files: