![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#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 eventId) |
uint32 | StartSystem () |
void | Initialize () |
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) |
void | LoadEventVendors () |
uint32 | GetHolidayEventId (uint32 holidayId) const |
Static Public Member Functions | |
static GameEventMgr * | instance () |
Public Attributes | |
GameEventGuidMap | GameEventCreatureGuids |
GameEventGuidMap | GameEventGameobjectGuids |
std::vector< uint32 > | ModifiedHolidays |
typedef std::set<uint16> GameEventMgr::ActiveEvents |
|
private |
typedef std::vector<GameEventData> GameEventMgr::GameEventDataMap |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
privatedefault |
|
inlineprivate |
|
private |
Run SAI scripts with SMART_EVENT_GAME_EVENT_START
References _gameEvent, ChangeEquipOrModel(), CONFIG_EVENT_ANNOUNCE, GameEventSpawn(), GameEventUnspawn(), LANG_EVENTMESSAGE, LOG_DEBUG, RunSmartAIScripts(), ChatHandler::SendWorldText(), sWorld, UpdateBattlegroundSettings(), UpdateEventNPCFlags(), UpdateEventNPCVendor(), UpdateEventQuests(), and UpdateWorldStates().
Referenced by StartEvent().
|
private |
References _gameEventModelEquip, CreatureData::displayid, CreatureData::equipmentId, CreatureData::mapid, sMapMgr, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
bool GameEventMgr::CheckOneGameEvent | ( | uint16 | entry | ) | const |
References _gameEvent, GAMEEVENT_INTERNAL, GAMEEVENT_NORMAL, GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_INACTIVE, GAMEEVENT_WORLD_NEXTPHASE, GameTime::GetGameTime(), and MINUTE.
Referenced by Update().
|
private |
Runs SMART_EVENT_GAME_EVENT_START/_END SAI.
References _gameEvent, GAMEEVENT_WORLD_NEXTPHASE, and GameTime::GetGameTime().
Referenced by HandleQuestComplete(), StartEvent(), and Update().
|
private |
References _gameEvent, _gameEventPoolIds, Map::AddToMap(), GameEventCreatureGuids, GameEventGameobjectGuids, Map::Instanceable(), Map::IsGridLoaded(), GameObject::isSpawnedByDefault(), Creature::LoadCreatureFromDB(), GameObject::LoadGameObjectFromDB(), LOG_ERROR, sMapMgr, sObjectMgr, and sPoolMgr.
Referenced by ApplyNewEvent(), UnApplyEvent(), and Update().
|
private |
References _gameEvent, GameEventCreatureGuids, HasCreatureActiveEventExcept(), LOG_ERROR, sMapMgr, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
inline |
References _activeEvents.
|
inline |
References _gameEvent.
References sGameEventMgr.
References _activeEvents, _gameEventNPCFlags, and Creature::GetSpawnId().
Referenced by UpdateEventNPCFlags().
void GameEventMgr::HandleQuestComplete | ( | uint32 | quest_id | ) |
References _gameEvent, _questToEventConditions, CHAR_DEL_GAME_EVENT_CONDITION_SAVE, CHAR_INS_GAME_EVENT_CONDITION_SAVE, CharacterDatabase, CheckOneGameEventConditions(), GAMEEVENT_WORLD_CONDITIONS, IsActiveEvent(), SaveWorldEventStateToDB(), PreparedStatementBase::SetData(), and sWorld.
|
private |
References _activeEvents, _gameEvent, and GameEventCreatureGuids.
Referenced by GameEventUnspawn().
References _activeEvents, and _gameEventCreatureQuests.
Referenced by UpdateEventQuests().
|
private |
References _activeEvents, _gameEvent, and GameEventGameobjectGuids.
References _activeEvents, and _gameEventGameObjectQuests.
Referenced by UpdateEventQuests().
void GameEventMgr::Initialize | ( | ) |
References _gameEvent, _gameEventBattlegroundHolidays, _gameEventCreatureQuests, _gameEventGameObjectQuests, _gameEventModelEquip, _gameEventNPCFlags, _gameEventPoolIds, _gameEventVendors, GameEventCreatureGuids, GameEventGameobjectGuids, Field::Get(), and WorldDatabase.
|
static |
|
inline |
References _activeEvents.
Referenced by HandleQuestComplete(), StartEvent(), StopEvent(), and Update().
|
private |
References _gameEvent, _gameEventBattlegroundHolidays, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, WORLD_SEL_GAME_EVENT_BATTLEGROUND_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, WORLD_SEL_GAME_EVENT_CONDITION_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, CHAR_SEL_GAME_EVENT_CONDITION_SAVE_DATA, CharacterDatabase, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, and LOG_WARN.
Referenced by LoadFromDB().
|
private |
References _gameEvent, GameEventCreatureGuids, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, sObjectMgr, WORLD_SEL_GAME_EVENT_CREATURE_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, GameEventGameobjectGuids, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, sObjectMgr, WORLD_SEL_GAME_EVENT_GAMEOBJECT_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEventGameObjectQuests, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, WORLD_SEL_GAME_EVENT_GAMEOBJECT_QUEST_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEventModelEquip, ModelEquip::EquipementIdPrev, ModelEquip::EquipmentId, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, ModelEquip::ModelId, ModelEquip::ModelIdPrev, sObjectMgr, WORLD_SEL_GAME_EVENT_MODEL_EQUIPMENT_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, _gameEventNPCFlags, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, WORLD_SEL_GAME_EVENT_NPC_FLAGS, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, _gameEventPoolIds, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, sPoolMgr, WORLD_SEL_GAME_EVENT_POOL_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, GAMEEVENT_INTERNAL, GAMEEVENT_NORMAL, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, WORLD_SEL_GAME_EVENT_PREREQUISITE_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, _questToEventConditions, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, WORLD_SEL_GAME_EVENT_QUEST_CONDITION_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEventCreatureQuests, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, WORLD_SEL_GAME_EVENT_QUEST_DATA, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, GameEventData::Announce, GameEventData::Description, GameEventData::End, GameEventData::EventId, GAMEEVENT_NORMAL, Field::Get(), GameTime::GetGameTime(), getMSTime(), GetMSTimeDiffToNow(), HOLIDAY_NONE, GameEventData::HolidayId, GameEventData::HolidayStage, GameEventData::Length, LOG_ERROR, LOG_INFO, LOG_WARN, GameEventData::NextStart, GameEventData::Occurence, SetHolidayEventTime(), sHolidaysStore, GameEventData::Start, GameEventData::State, WORLD_SEL_GAME_EVENTS, and WorldDatabase.
Referenced by LoadFromDB().
|
private |
References _gameEvent, CHAR_SEL_GAME_EVENT_SAVE_DATA, CharacterDatabase, GAMEEVENT_INTERNAL, GAMEEVENT_NORMAL, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, and LOG_WARN.
Referenced by LoadFromDB().
|
private |
References _gameEvent, _gameEventSeasonalQuestsMap, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, sObjectMgr, WORLD_SEL_GAME_EVENT_QUEST_SEASONAL_RELATIONS, and WorldDatabase.
Referenced by LoadFromDB().
void GameEventMgr::LoadEventVendors | ( | ) |
References _gameEventNPCFlags, _gameEventVendors, NPCVendorEntry::Entry, NPCVendorEntry::ExtendedCost, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), NPCVendorEntry::Incrtime, IsEventActive(), NPCVendorEntry::Item, LOG_ERROR, LOG_INFO, LOG_WARN, NPCVendorEntry::MaxCount, sObjectMgr, WORLD_SEL_GAME_EVENT_NPC_VENDOR, and WorldDatabase.
Referenced by LoadFromDB().
void GameEventMgr::LoadFromDB | ( | ) |
References LoadEventBattlegroundData(), LoadEventConditionData(), LoadEventConditionSaveData(), LoadEventCreatureData(), LoadEventGameObjectData(), LoadEventGameObjectQuestData(), LoadEventModelEquipmentChangeData(), LoadEventNPCFlags(), LoadEventPoolData(), LoadEventPrerequisiteData(), LoadEventQuestConditionData(), LoadEventQuestData(), LoadEvents(), LoadEventSaveData(), LoadEventSeasonalQuestRelations(), and LoadEventVendors().
void GameEventMgr::LoadHolidayDates | ( | ) |
References Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, MAX_HOLIDAY_DATES, ModifiedHolidays, sHolidaysStore, WORLD_SEL_GAME_EVENT_HOLIDAY_DATES, and WorldDatabase.
References _gameEvent, GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_NEXTPHASE, GameTime::GetGameTime(), max_ge_check_delay, and MINUTE.
Referenced by Update().
|
inlineprivate |
|
private |
Iterate over every supported source type (creature and gameobject) Not entirely sure how this will affect units in non-loaded grids.
References Map::GetObjectsStore(), sMapMgr, and TypeContainerVisitor< VISITOR, TYPE_CONTAINER >::Visit().
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
References _gameEvent, CHAR_DEL_GAME_EVENT_SAVE, CHAR_INS_GAME_EVENT_SAVE, CharacterDatabase, and PreparedStatementBase::SetData().
Referenced by HandleQuestComplete(), StartEvent(), and Update().
References _gameEvent, and Player::SendUpdateWorldState().
|
private |
References HolidaysEntry::CalendarFilterType, HolidaysEntry::Date, HolidaysEntry::Duration, GameTime::GetGameTime(), GameEventData::HolidayId, GameEventData::HolidayStage, HOUR, GameEventData::Length, LOG_ERROR, HolidaysEntry::Looping, MAX_HOLIDAY_DATES, MAX_HOLIDAY_DURATIONS, MINUTE, sHolidaysStore, Acore::Time::TimeBreakdown(), WEEK, and YEAR.
Referenced by LoadEvents().
bool GameEventMgr::StartEvent | ( | uint16 | event_id, |
bool | overwrite = false |
||
) |
References _gameEvent, _gameEventSeasonalQuestsMap, AddActiveEvent(), ApplyNewEvent(), CheckOneGameEventConditions(), DISABLE_TYPE_GAME_EVENT, GameEventData::End, GAMEEVENT_INTERNAL, GAMEEVENT_NORMAL, GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_INACTIVE, GameTime::GetGameTime(), IsActiveEvent(), GameEventData::Length, SaveWorldEventStateToDB(), sDisableMgr, sScriptMgr, GameEventData::Start, GameEventData::State, and sWorld.
Referenced by StartInternalEvent(), and Update().
void GameEventMgr::StartInternalEvent | ( | uint16 | event_id | ) |
References _activeEvents, _gameEvent, and StartEvent().
uint32 GameEventMgr::StartSystem | ( | ) |
References _activeEvents, _isSystemInit, and Update().
void GameEventMgr::StopEvent | ( | uint16 | event_id, |
bool | overwrite = false |
||
) |
References _gameEvent, 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(), IsActiveEvent(), GameEventData::Length, MINUTE, GameEventData::NextStart, RemoveActiveEvent(), PreparedStatementBase::SetData(), sScriptMgr, GameEventData::Start, GameEventData::State, sWorld, and UnApplyEvent().
Referenced by Update().
|
private |
Run SAI scripts with SMART_EVENT_GAME_EVENT_END
References _gameEvent, ChangeEquipOrModel(), GameEventSpawn(), GameEventUnspawn(), LOG_DEBUG, RunSmartAIScripts(), UpdateBattlegroundSettings(), UpdateEventNPCFlags(), UpdateEventNPCVendor(), UpdateEventQuests(), and UpdateWorldStates().
Referenced by StopEvent().
uint32 GameEventMgr::Update | ( | ) |
References _gameEvent, _isSystemInit, CheckOneGameEvent(), CheckOneGameEventConditions(), GAMEEVENT_INTERNAL, GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_NEXTPHASE, GameEventSpawn(), GameTime::GetGameTime(), IN_MILLISECONDS, IsActiveEvent(), LOG_DEBUG, max_ge_check_delay, NextCheck(), SaveWorldEventStateToDB(), sScriptMgr, StartEvent(), StopEvent(), and sWorld.
Referenced by StartSystem().
|
private |
References _activeEvents, _gameEventBattlegroundHolidays, and sBattlegroundMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
References _gameEventNPCFlags, Map::GetCreatureBySpawnIdStore(), Creature::GetCreatureTemplate(), GetNPCFlag(), Unit::ReplaceAllNpcFlags(), sMapMgr, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
References _gameEventVendors, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
References _gameEventCreatureQuests, _gameEventGameObjectQuests, HasCreatureQuestActiveEventExcept(), HasGameObjectQuestActiveEventExcept(), and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
References _gameEvent, BATTLEGROUND_TYPE_NONE, HOLIDAY_NONE, BattlemasterListEntry::HolidayWorldStateId, sBattlemasterListStore, sWorldSessionMgr, WorldPackets::WorldState::UpdateWorldState::Value, WorldPackets::WorldState::UpdateWorldState::VariableID, BattlegroundMgr::WeekendHolidayIdToBGType(), and WorldPackets::WorldState::UpdateWorldState::Write().
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Referenced by AddActiveEvent(), GetActiveEventList(), GetNPCFlag(), HasCreatureActiveEventExcept(), HasCreatureQuestActiveEventExcept(), HasGameObjectActiveEventExcept(), HasGameObjectQuestActiveEventExcept(), IsActiveEvent(), RemoveActiveEvent(), StartInternalEvent(), StartSystem(), and UpdateBattlegroundSettings().
|
private |
Referenced by ApplyNewEvent(), CheckOneGameEvent(), CheckOneGameEventConditions(), GameEventSpawn(), GameEventUnspawn(), GetEventMap(), HandleQuestComplete(), HasCreatureActiveEventExcept(), HasGameObjectActiveEventExcept(), Initialize(), LoadEventBattlegroundData(), LoadEventConditionData(), LoadEventConditionSaveData(), LoadEventCreatureData(), LoadEventGameObjectData(), LoadEventNPCFlags(), LoadEventPoolData(), LoadEventPrerequisiteData(), LoadEventQuestConditionData(), LoadEvents(), LoadEventSaveData(), LoadEventSeasonalQuestRelations(), NextCheck(), SaveWorldEventStateToDB(), SendWorldStateUpdate(), StartEvent(), StartInternalEvent(), StopEvent(), UnApplyEvent(), Update(), and UpdateWorldStates().
|
private |
Referenced by Initialize(), LoadEventBattlegroundData(), and UpdateBattlegroundSettings().
|
private |
Referenced by HasCreatureQuestActiveEventExcept(), Initialize(), LoadEventQuestData(), and UpdateEventQuests().
|
private |
Referenced by HasGameObjectQuestActiveEventExcept(), Initialize(), LoadEventGameObjectQuestData(), and UpdateEventQuests().
|
private |
Referenced by ChangeEquipOrModel(), Initialize(), and LoadEventModelEquipmentChangeData().
|
private |
Referenced by GetNPCFlag(), Initialize(), LoadEventNPCFlags(), LoadEventVendors(), and UpdateEventNPCFlags().
|
private |
Referenced by GameEventSpawn(), Initialize(), and LoadEventPoolData().
|
private |
Referenced by LoadEventSeasonalQuestRelations(), and StartEvent().
|
private |
Referenced by Initialize(), LoadEventVendors(), and UpdateEventNPCVendor().
|
private |
Referenced by StartSystem(), and Update().
|
private |
Referenced by HandleQuestComplete(), and LoadEventQuestConditionData().
GameEventGuidMap GameEventMgr::GameEventCreatureGuids |
Referenced by GameEventSpawn(), GameEventUnspawn(), HasCreatureActiveEventExcept(), Initialize(), and LoadEventCreatureData().
GameEventGuidMap GameEventMgr::GameEventGameobjectGuids |
Referenced by GameEventSpawn(), HasGameObjectActiveEventExcept(), Initialize(), and LoadEventGameObjectData().
std::vector<uint32> GameEventMgr::ModifiedHolidays |
Referenced by LoadHolidayDates().