![]() |
TrinityCore
|
#include <GameEventMgr.h>
Public Types | |
| typedef std::set< uint16 > | ActiveEvents |
| typedef std::vector< GameEventData > | GameEventDataMap |
Public Member Functions | |
| ActiveEvents const & | GetActiveEventList () const |
| GameEventDataMap const & | GetEventMap () const |
| bool | CheckOneGameEvent (uint16 entry) const |
| uint32 | NextCheck (uint16 entry) const |
| void | LoadFromDB () |
| void | LoadHolidayDates () |
| 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) |
| uint32 | GetNPCFlag (Creature *cr) |
Static Public Member Functions | |
| static GameEventMgr * | instance () |
Public Attributes | |
| GameEventGuidMap | mGameEventCreatureGuids |
| GameEventGuidMap | mGameEventGameobjectGuids |
| std::vector< uint32 > | modifiedHolidays |
Private Types | |
| typedef std::list< ObjectGuid::LowType > | GuidList |
| typedef std::list< uint32 > | IdList |
| typedef std::vector< GuidList > | GameEventGuidMap |
| typedef std::vector< IdList > | GameEventIdMap |
| typedef std::pair< ObjectGuid::LowType, ModelEquip > | ModelEquipPair |
| typedef std::list< ModelEquipPair > | ModelEquipList |
| typedef std::vector< ModelEquipList > | GameEventModelEquipMap |
| typedef std::pair< uint32, uint32 > | QuestRelation |
| typedef std::list< QuestRelation > | QuestRelList |
| typedef std::vector< QuestRelList > | GameEventQuestMap |
| typedef std::list< NPCVendorEntry > | NPCVendorList |
| typedef std::vector< NPCVendorList > | GameEventNPCVendorMap |
| typedef std::map< uint32, GameEventQuestToEventConditionNum > | QuestIdToEventConditionMap |
| typedef std::pair< ObjectGuid::LowType, uint32 > | GuidNPCFlagPair |
| typedef std::list< GuidNPCFlagPair > | NPCFlagList |
| typedef std::vector< NPCFlagList > | GameEventNPCFlagMap |
| typedef std::vector< uint32 > | GameEventBattlegroundMap |
Definition at line 101 of file GameEventMgr.h.
| typedef std::set<uint16> GameEventMgr::ActiveEvents |
Definition at line 110 of file GameEventMgr.h.
|
private |
Definition at line 169 of file GameEventMgr.h.
| typedef std::vector<GameEventData> GameEventMgr::GameEventDataMap |
Definition at line 111 of file GameEventMgr.h.
|
private |
Definition at line 155 of file GameEventMgr.h.
|
private |
Definition at line 156 of file GameEventMgr.h.
|
private |
Definition at line 159 of file GameEventMgr.h.
|
private |
Definition at line 168 of file GameEventMgr.h.
|
private |
Definition at line 164 of file GameEventMgr.h.
|
private |
Definition at line 162 of file GameEventMgr.h.
|
private |
Definition at line 153 of file GameEventMgr.h.
|
private |
Definition at line 166 of file GameEventMgr.h.
|
private |
Definition at line 154 of file GameEventMgr.h.
|
private |
Definition at line 158 of file GameEventMgr.h.
|
private |
Definition at line 157 of file GameEventMgr.h.
|
private |
Definition at line 167 of file GameEventMgr.h.
|
private |
Definition at line 163 of file GameEventMgr.h.
|
private |
Definition at line 165 of file GameEventMgr.h.
|
private |
Definition at line 160 of file GameEventMgr.h.
|
private |
Definition at line 161 of file GameEventMgr.h.
|
private |
Definition at line 1589 of file GameEventMgr.cpp.
|
inlineprivate |
Definition at line 105 of file GameEventMgr.h.
|
inlineprivate |
Definition at line 131 of file GameEventMgr.h.
Referenced by StartEvent().
|
private |
Run SAI scripts with SMART_EVENT_GAME_EVENT_START
Definition at line 1158 of file GameEventMgr.cpp.
References ChangeEquipOrModel(), CONFIG_EVENT_ANNOUNCE, GameEventSpawn(), GameEventUnspawn(), GetLastStartTime(), LANG_EVENTMESSAGE, mGameEvent, RunSmartAIScripts(), sWorld, TC_LOG_INFO, UpdateBattlegroundSettings(), UpdateEventNPCFlags(), UpdateEventNPCVendor(), UpdateEventQuests(), and UpdateWorldStates().
Referenced by StartEvent().
|
private |
Definition at line 1396 of file GameEventMgr.cpp.
References CreatureData::displayid, CreatureData::equipmentId, SpawnMetadata::mapId, mGameEventModelEquip, sMapMgr, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
| bool GameEventMgr::CheckOneGameEvent | ( | uint16 | entry | ) | const |
Definition at line 40 of file GameEventMgr.cpp.
References GAMEEVENT_INTERNAL, GAMEEVENT_NORMAL, GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_INACTIVE, GAMEEVENT_WORLD_NEXTPHASE, GameTime::GetGameTime(), mGameEvent, and MINUTE.
Referenced by Update().
|
private |
Runs SMART_EVENT_GAME_EVENT_START/_END SAI.
Definition at line 1646 of file GameEventMgr.cpp.
References GAMEEVENT_WORLD_NEXTPHASE, GameTime::GetGameTime(), and mGameEvent.
Referenced by HandleQuestComplete(), StartEvent(), and Update().
|
private |
Definition at line 1242 of file GameEventMgr.cpp.
References Map::AddToMap(), Map::Instanceable(), Map::IsGridLoaded(), GameObject::isSpawnedByDefault(), Creature::LoadFromDB(), GameObject::LoadFromDB(), mGameEvent, mGameEventCreatureGuids, mGameEventGameobjectGuids, mGameEventPoolIds, Map::RemoveRespawnTime(), sMapMgr, sObjectMgr, SPAWN_TYPE_CREATURE, SPAWN_TYPE_GAMEOBJECT, sPoolMgr, and TC_LOG_ERROR.
Referenced by ApplyNewEvent(), UnApplyEvent(), and Update().
|
private |
Definition at line 1319 of file GameEventMgr.cpp.
References hasCreatureActiveEventExcept(), mGameEvent, mGameEventCreatureGuids, sMapMgr, sObjectMgr, and TC_LOG_ERROR.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
inline |
Definition at line 112 of file GameEventMgr.h.
|
inline |
Definition at line 113 of file GameEventMgr.h.
|
private |
Definition at line 1821 of file GameEventMgr.cpp.
References GAMEEVENT_NORMAL, GameTime::GetSystemTime(), and mGameEvent.
Referenced by ApplyNewEvent().
Definition at line 990 of file GameEventMgr.cpp.
References Creature::GetSpawnId(), m_ActiveEvents, and mGameEventNPCFlags.
Referenced by UpdateEventNPCFlags().
| void GameEventMgr::HandleQuestComplete | ( | uint32 | quest_id | ) |
Definition at line 1591 of file GameEventMgr.cpp.
References CHAR_DEL_GAME_EVENT_CONDITION_SAVE, CHAR_INS_GAME_EVENT_CONDITION_SAVE, CharacterDatabase, CheckOneGameEventConditions(), GAMEEVENT_WORLD_CONDITIONS, IsActiveEvent(), mGameEvent, mQuestToEventConditions, SaveWorldEventStateToDB(), PreparedStatementBase::setFloat(), PreparedStatementBase::setUInt32(), PreparedStatementBase::setUInt8(), and sWorld.
|
private |
Definition at line 1481 of file GameEventMgr.cpp.
References m_ActiveEvents, mGameEvent, and mGameEventCreatureGuids.
Referenced by GameEventUnspawn().
Definition at line 1454 of file GameEventMgr.cpp.
References m_ActiveEvents, and mGameEventCreatureQuests.
Referenced by UpdateEventQuests().
|
private |
Definition at line 1497 of file GameEventMgr.cpp.
References m_ActiveEvents, mGameEvent, and mGameEventGameobjectGuids.
Definition at line 1468 of file GameEventMgr.cpp.
References m_ActiveEvents, and mGameEventGameObjectQuests.
Referenced by UpdateEventQuests().
| void GameEventMgr::Initialize | ( | ) |
Definition at line 1007 of file GameEventMgr.cpp.
References Field::GetUInt8(), mGameEvent, mGameEventBattlegroundHolidays, mGameEventCreatureGuids, mGameEventCreatureQuests, mGameEventGameobjectGuids, mGameEventGameObjectQuests, mGameEventModelEquip, mGameEventNPCFlags, mGameEventPoolIds, mGameEventVendors, and WorldDatabase.
|
static |
|
inline |
Definition at line 119 of file GameEventMgr.h.
Referenced by HandleQuestComplete(), and Update().
| void GameEventMgr::LoadFromDB | ( | ) |
Definition at line 211 of file GameEventMgr.cpp.
References GameEventData::announce, CharacterDatabase, GameEventData::description, GameEventData::end, NPCVendorEntry::entry, ModelEquip::equipement_id_prev, ModelEquip::equipment_id, NPCVendorEntry::ExtendedCost, GAMEEVENT_INTERNAL, GAMEEVENT_NORMAL, Field::GetFloat(), Field::GetInt8(), getMSTime(), GetMSTimeDiffToNow(), Field::GetString(), Field::GetUInt16(), Field::GetUInt32(), Field::GetUInt64(), Field::GetUInt8(), GameEventData::holiday_id, HOLIDAY_NONE, GameEventData::holidayStage, NPCVendorEntry::incrtime, NPCVendorEntry::item, GameEventData::length, MAX_HOLIDAY_DURATIONS, NPCVendorEntry::maxcount, mGameEvent, mGameEventBattlegroundHolidays, mGameEventCreatureGuids, mGameEventCreatureQuests, mGameEventGameobjectGuids, mGameEventGameObjectQuests, mGameEventModelEquip, mGameEventNPCFlags, mGameEventPoolIds, mGameEventVendors, ModelEquip::modelid, ModelEquip::modelid_prev, mQuestToEventConditions, GameEventData::nextstart, GameEventData::occurence, Quest::SetEventIdForQuest(), SetHolidayEventTime(), sHolidaysStore, sObjectMgr, SPAWN_TYPE_CREATURE, SPAWN_TYPE_GAMEOBJECT, sPoolMgr, GameEventData::start, GameEventData::state, TC_LOG_ERROR, TC_LOG_INFO, and WorldDatabase.
| void GameEventMgr::LoadHolidayDates | ( | ) |
Definition at line 943 of file GameEventMgr.cpp.
References HolidaysEntry::Date, HolidaysEntry::Duration, getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), Field::GetUInt8(), HolidaysEntry::ID, MAX_HOLIDAY_DATES, modifiedHolidays, sHolidaysStore, TC_LOG_ERROR, TC_LOG_INFO, and WorldDatabase.
Definition at line 78 of file GameEventMgr.cpp.
References GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_NEXTPHASE, GameTime::GetGameTime(), max_ge_check_delay, mGameEvent, and MINUTE.
Referenced by Update().
|
inlineprivate |
Definition at line 132 of file GameEventMgr.h.
Referenced by StopEvent().
|
private |
Iterate over every supported source type (creature and gameobject) Not entirely sure how this will affect units in non-loaded grids.
Definition at line 1718 of file GameEventMgr.cpp.
References Map::GetObjectsStore(), sMapMgr, and TypeContainerVisitor< VISITOR, TYPE_CONTAINER >::Visit().
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 1663 of file GameEventMgr.cpp.
References CHAR_DEL_GAME_EVENT_SAVE, CHAR_INS_GAME_EVENT_SAVE, CharacterDatabase, mGameEvent, PreparedStatementBase::setUInt32(), and PreparedStatementBase::setUInt8().
Referenced by HandleQuestComplete(), StartEvent(), and Update().
Definition at line 1679 of file GameEventMgr.cpp.
References mGameEvent, and Player::SendUpdateWorldState().
|
private |
Definition at line 1730 of file GameEventMgr.cpp.
References HolidaysEntry::CalendarFilterType, HolidaysEntry::Date, HolidaysEntry::Duration, GameTime::GetGameTime(), GameEventData::holiday_id, GameEventData::holidayStage, HOUR, GameEventData::length, HolidaysEntry::Looping, MAX_HOLIDAY_DATES, MAX_HOLIDAY_DURATIONS, MINUTE, GameEventData::occurence, sHolidaysStore, TC_LOG_ERROR, WEEK, and YEAR.
Referenced by LoadFromDB().
| void GameEventMgr::StartArenaSeason | ( | ) |
Definition at line 1040 of file GameEventMgr.cpp.
References CONFIG_ARENA_SEASON_ID, Field::GetUInt8(), mGameEvent, StartEvent(), sWorld, TC_LOG_ERROR, TC_LOG_INFO, and WorldDatabase.
| bool GameEventMgr::StartEvent | ( | uint16 | event_id, |
| bool | overwrite = false |
||
| ) |
Definition at line 131 of file GameEventMgr.cpp.
References AddActiveEvent(), ApplyNewEvent(), CheckOneGameEventConditions(), GameEventData::end, GAMEEVENT_INTERNAL, GAMEEVENT_NORMAL, GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_INACTIVE, GameTime::GetGameTime(), GameEventData::length, mGameEvent, MINUTE, SaveWorldEventStateToDB(), GameEventData::start, GameEventData::state, and sWorld.
Referenced by StartArenaSeason(), StartInternalEvent(), and Update().
| void GameEventMgr::StartInternalEvent | ( | uint16 | event_id | ) |
Definition at line 117 of file GameEventMgr.cpp.
References m_ActiveEvents, mGameEvent, and StartEvent().
| uint32 GameEventMgr::StartSystem | ( | ) |
Definition at line 1032 of file GameEventMgr.cpp.
References isSystemInit, m_ActiveEvents, and Update().
| void GameEventMgr::StopEvent | ( | uint16 | event_id, |
| bool | overwrite = false |
||
| ) |
Definition at line 171 of file GameEventMgr.cpp.
References CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE, CHAR_DEL_GAME_EVENT_SAVE, CharacterDatabase, GameEventData::conditions, GameEventData::end, GAMEEVENT_INTERNAL, GAMEEVENT_NORMAL, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_INACTIVE, GameTime::GetGameTime(), GameEventData::length, mGameEvent, MINUTE, GameEventData::nextstart, RemoveActiveEvent(), PreparedStatementBase::setUInt8(), GameEventData::start, GameEventData::state, and UnApplyEvent().
Referenced by Update().
|
private |
Run SAI scripts with SMART_EVENT_GAME_EVENT_END
Definition at line 1135 of file GameEventMgr.cpp.
References ChangeEquipOrModel(), GameEventSpawn(), GameEventUnspawn(), mGameEvent, RunSmartAIScripts(), TC_LOG_INFO, UpdateBattlegroundSettings(), UpdateEventNPCFlags(), UpdateEventNPCVendor(), UpdateEventQuests(), and UpdateWorldStates().
Referenced by StopEvent().
| uint32 GameEventMgr::Update | ( | ) |
Definition at line 1065 of file GameEventMgr.cpp.
References CheckOneGameEvent(), CheckOneGameEventConditions(), GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_NEXTPHASE, GameEventSpawn(), GameTime::GetGameTime(), IN_MILLISECONDS, IsActiveEvent(), isSystemInit, max_ge_check_delay, mGameEvent, NextCheck(), SaveWorldEventStateToDB(), StartEvent(), StopEvent(), and TC_LOG_INFO.
Referenced by StartSystem().
|
private |
Definition at line 1223 of file GameEventMgr.cpp.
References m_ActiveEvents, mGameEventBattlegroundHolidays, and sBattlegroundMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 1190 of file GameEventMgr.cpp.
References Map::GetCreatureBySpawnIdStore(), Creature::GetCreatureTemplate(), GetNPCFlag(), mGameEventNPCFlags, Unit::ReplaceAllNpcFlags(), sMapMgr, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 1231 of file GameEventMgr.cpp.
References mGameEventVendors, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 1514 of file GameEventMgr.cpp.
References hasCreatureQuestActiveEventExcept(), hasGameObjectQuestActiveEventExcept(), mGameEventCreatureQuests, mGameEventGameObjectQuests, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 1569 of file GameEventMgr.cpp.
References BATTLEGROUND_TYPE_NONE, HOLIDAY_NONE, BattlemasterListEntry::HolidayWorldState, mGameEvent, sBattlemasterListStore, sWorld, WorldPackets::WorldState::UpdateWorldState::Value, WorldPackets::WorldState::UpdateWorldState::VariableID, BattlegroundMgr::WeekendHolidayIdToBGType(), and WorldPackets::WorldState::UpdateWorldState::Write().
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 182 of file GameEventMgr.h.
Referenced by StartSystem(), and Update().
|
private |
Definition at line 181 of file GameEventMgr.h.
Referenced by GetNPCFlag(), hasCreatureActiveEventExcept(), hasCreatureQuestActiveEventExcept(), hasGameObjectActiveEventExcept(), hasGameObjectQuestActiveEventExcept(), StartInternalEvent(), StartSystem(), and UpdateBattlegroundSettings().
|
private |
Definition at line 177 of file GameEventMgr.h.
Referenced by ApplyNewEvent(), CheckOneGameEvent(), CheckOneGameEventConditions(), GameEventSpawn(), GameEventUnspawn(), GetLastStartTime(), HandleQuestComplete(), hasCreatureActiveEventExcept(), hasGameObjectActiveEventExcept(), Initialize(), LoadFromDB(), NextCheck(), SaveWorldEventStateToDB(), SendWorldStateUpdate(), StartArenaSeason(), StartEvent(), StartInternalEvent(), StopEvent(), UnApplyEvent(), Update(), and UpdateWorldStates().
|
private |
Definition at line 178 of file GameEventMgr.h.
Referenced by Initialize(), LoadFromDB(), and UpdateBattlegroundSettings().
| GameEventGuidMap GameEventMgr::mGameEventCreatureGuids |
Definition at line 185 of file GameEventMgr.h.
Referenced by GameEventSpawn(), GameEventUnspawn(), hasCreatureActiveEventExcept(), Initialize(), and LoadFromDB().
|
private |
Definition at line 170 of file GameEventMgr.h.
Referenced by hasCreatureQuestActiveEventExcept(), Initialize(), LoadFromDB(), and UpdateEventQuests().
| GameEventGuidMap GameEventMgr::mGameEventGameobjectGuids |
Definition at line 186 of file GameEventMgr.h.
Referenced by GameEventSpawn(), hasGameObjectActiveEventExcept(), Initialize(), and LoadFromDB().
|
private |
Definition at line 171 of file GameEventMgr.h.
Referenced by hasGameObjectQuestActiveEventExcept(), Initialize(), LoadFromDB(), and UpdateEventQuests().
|
private |
Definition at line 173 of file GameEventMgr.h.
Referenced by ChangeEquipOrModel(), Initialize(), and LoadFromDB().
|
private |
Definition at line 180 of file GameEventMgr.h.
Referenced by GetNPCFlag(), Initialize(), LoadFromDB(), and UpdateEventNPCFlags().
|
private |
Definition at line 176 of file GameEventMgr.h.
Referenced by GameEventSpawn(), Initialize(), and LoadFromDB().
|
private |
Definition at line 172 of file GameEventMgr.h.
Referenced by Initialize(), LoadFromDB(), and UpdateEventNPCVendor().
| std::vector<uint32> GameEventMgr::modifiedHolidays |
Definition at line 187 of file GameEventMgr.h.
Referenced by LoadHolidayDates().
|
private |
Definition at line 179 of file GameEventMgr.h.
Referenced by HandleQuestComplete(), and LoadFromDB().