#include <GameEventMgr.h>
Public Types | |
typedef std::set< uint16 > | ActiveEvents |
typedef std::vector< GameEventData > | GameEventDataMap |
Public Member Functions | |
GameEventMgr () | |
~GameEventMgr () | |
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 | Initialize () |
bool | StartEvent (uint16 event_id, bool overwrite=false) |
void | StopEvent (uint16 event_id, bool overwrite=false) |
void | HandleQuestComplete (uint32 quest_id) |
void | HandleWorldEventGossip (Player *plr, Creature *c) |
uint32 | GetNPCFlag (Creature *cr) |
Definition at line 88 of file GameEventMgr.h.
typedef std::set<uint16> GameEventMgr::ActiveEvents |
Definition at line 92 of file GameEventMgr.h.
|
protected |
Definition at line 160 of file GameEventMgr.h.
|
protected |
Definition at line 162 of file GameEventMgr.h.
typedef std::vector<GameEventData> GameEventMgr::GameEventDataMap |
Definition at line 94 of file GameEventMgr.h.
|
protected |
Definition at line 146 of file GameEventMgr.h.
|
protected |
Definition at line 147 of file GameEventMgr.h.
|
protected |
Definition at line 150 of file GameEventMgr.h.
|
protected |
Definition at line 159 of file GameEventMgr.h.
|
protected |
Definition at line 155 of file GameEventMgr.h.
|
protected |
Definition at line 153 of file GameEventMgr.h.
|
protected |
Definition at line 161 of file GameEventMgr.h.
|
protected |
Definition at line 144 of file GameEventMgr.h.
|
protected |
Definition at line 157 of file GameEventMgr.h.
|
protected |
Definition at line 145 of file GameEventMgr.h.
|
protected |
Definition at line 149 of file GameEventMgr.h.
|
protected |
Definition at line 148 of file GameEventMgr.h.
|
protected |
Definition at line 158 of file GameEventMgr.h.
|
protected |
Definition at line 154 of file GameEventMgr.h.
|
protected |
Definition at line 156 of file GameEventMgr.h.
|
protected |
Definition at line 151 of file GameEventMgr.h.
|
protected |
Definition at line 152 of file GameEventMgr.h.
GameEventMgr::GameEventMgr | ( | ) |
|
inline |
Definition at line 92 of file GameEventMgr.h.
|
inlineprivate |
|
private |
Run SAI scripts with SMART_EVENT_GAME_EVENT_END
Definition at line 950 of file GameEventMgr.cpp.
References ChangeEquipOrModel(), CONFIG_EVENT_ANNOUNCE, GameEventSpawn(), GameEventUnspawn(), LANG_EVENTMESSAGE, mGameEvent, RunSmartAIScripts(), sLog, sWorld, UpdateBattlegroundSettings(), UpdateEventNPCFlags(), UpdateEventNPCVendor(), and UpdateEventQuests().
Referenced by StartEvent().
|
private |
Definition at line 1158 of file GameEventMgr.cpp.
References CreatureModelInfo::bounding_radius, CreatureModelInfo::combat_reach, CreatureData::displayid, CreatureInfo::equipmentId, CreatureData::equipmentId, Creature::GetCurrentEquipmentId(), Unit::GetDisplayId(), ObjectAccessor::GetObjectInWorld(), HIGHGUID_UNIT, CreatureData::id, Oregon::Singleton< ObjectAccessor, Oregon::ClassLevelLockable< ObjectAccessor, ACE_Thread_Mutex > >::Instance(), Creature::LoadEquipment(), MAKE_NEW_GUID, mGameEventModelEquip, CreatureModelInfo::modelid, Unit::SetDisplayId(), Object::SetFloatValue(), Unit::SetNativeDisplayId(), sObjectMgr, UNIT_FIELD_BOUNDINGRADIUS, and UNIT_FIELD_COMBATREACH.
Referenced by ApplyNewEvent(), and UnApplyEvent().
bool GameEventMgr::CheckOneGameEvent | ( | uint16 | entry | ) | const |
Definition at line 32 of file GameEventMgr.cpp.
References GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_INACTIVE, GAMEEVENT_WORLD_NEXTPHASE, mGameEvent, and MINUTE.
Referenced by Update().
|
private |
Runs SMART_EVENT_GAME_EVENT_START/_END SAI.
Definition at line 1403 of file GameEventMgr.cpp.
References GAMEEVENT_WORLD_NEXTPHASE, and mGameEvent.
Referenced by HandleQuestComplete(), StartEvent(), and Update().
|
private |
Definition at line 1026 of file GameEventMgr.cpp.
References Map::AddToMap(), MapManager::CreateBaseMap(), Oregon::Singleton< MapManager, Oregon::ClassLevelLockable< MapManager, ACE_Thread_Mutex > >::Instance(), Map::Instanceable(), Map::IsGridLoaded(), GameObject::isSpawnedByDefault(), Creature::LoadCreatureFromDB(), GameObject::LoadGameObjectFromDB(), mGameEvent, mGameEventCreatureGuids, mGameEventGameobjectGuids, mGameEventPoolIds, SIZEFMTD, sLog, sObjectMgr, and sPoolMgr.
Referenced by ApplyNewEvent(), UnApplyEvent(), and Update().
|
private |
Definition at line 1102 of file GameEventMgr.cpp.
References hasCreatureActiveEventExcept(), hasGameObjectActiveEventExcept(), HIGHGUID_GAMEOBJECT, HIGHGUID_UNIT, Oregon::Singleton< ObjectAccessor, Oregon::ClassLevelLockable< ObjectAccessor, ACE_Thread_Mutex > >::Instance(), MAKE_NEW_GUID, mGameEvent, mGameEventCreatureGuids, mGameEventGameobjectGuids, mGameEventPoolIds, SIZEFMTD, sLog, sObjectMgr, and sPoolMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
inline |
Definition at line 95 of file GameEventMgr.h.
|
inline |
Definition at line 99 of file GameEventMgr.h.
Definition at line 832 of file GameEventMgr.cpp.
References Creature::GetDBTableGUIDLow(), m_ActiveEvents, and mGameEventNPCFlags.
Referenced by UpdateEventNPCFlags().
void GameEventMgr::HandleQuestComplete | ( | uint32 | quest_id | ) |
Definition at line 1357 of file GameEventMgr.cpp.
References Database::BeginTransaction(), CharacterDatabase, CheckOneGameEventConditions(), Database::CommitTransaction(), GAMEEVENT_WORLD_CONDITIONS, IsActiveEvent(), mGameEvent, mQuestToEventConditions, Database::PExecute(), SaveWorldEventStateToDB(), and sWorld.
Definition at line 1431 of file GameEventMgr.cpp.
References Creature::GetDBTableGUIDLow(), IsActiveEvent(), mNPCGossipIds, and SendWorldStateUpdate().
Definition at line 1264 of file GameEventMgr.cpp.
References m_ActiveEvents, mGameEvent, and mGameEventCreatureGuids.
Referenced by GameEventUnspawn().
Definition at line 1237 of file GameEventMgr.cpp.
References m_ActiveEvents, and mGameEventCreatureQuests.
Referenced by UpdateEventQuests().
Definition at line 1280 of file GameEventMgr.cpp.
References m_ActiveEvents, mGameEvent, and mGameEventGameobjectGuids.
Referenced by GameEventUnspawn().
Definition at line 1251 of file GameEventMgr.cpp.
References m_ActiveEvents, and mGameEventGameObjectQuests.
Referenced by UpdateEventQuests().
uint32 GameEventMgr::Initialize | ( | ) |
Definition at line 849 of file GameEventMgr.cpp.
References isSystemInit, m_ActiveEvents, sLog, and Update().
|
inline |
Definition at line 107 of file GameEventMgr.h.
References AIRegistry::Initialize().
Referenced by HandleQuestComplete(), HandleWorldEventGossip(), and Update().
void GameEventMgr::LoadFromDB | ( | ) |
Definition at line 167 of file GameEventMgr.cpp.
References CharacterDatabase, GameEventData::description, GameEventData::end, NPCVendorEntry::entry, ModelEquip::equipement_id_prev, ModelEquip::equipment_id, NPCVendorEntry::ExtendedCost, GAMEEVENT_NORMAL, Field::GetCppString(), NPCVendorEntry::incrtime, NPCVendorEntry::item, GameEventData::length, NPCVendorEntry::maxcount, mGameEvent, mGameEventBattlegroundHolidays, mGameEventCreatureGuids, mGameEventCreatureQuests, mGameEventGameobjectGuids, mGameEventGameObjectQuests, mGameEventModelEquip, mGameEventNPCFlags, mGameEventPoolIds, mGameEventVendors, mNPCGossipIds, ModelEquip::modelid, ModelEquip::modelid_prev, mQuestToEventConditions, GameEventData::nextstart, GameEventData::occurence, Database::Query(), sLog, sObjectMgr, sPoolMgr, GameEventData::start, GameEventData::state, and WorldDatabase.
Definition at line 62 of file GameEventMgr.cpp.
References GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_NEXTPHASE, max_ge_check_delay, mGameEvent, 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.
Definition at line 1466 of file GameEventMgr.cpp.
References ObjectAccessor::GetCreatures(), ObjectAccessor::GetGameObjects(), and Oregon::Singleton< ObjectAccessor, Oregon::ClassLevelLockable< ObjectAccessor, ACE_Thread_Mutex > >::Instance().
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 1420 of file GameEventMgr.cpp.
References Database::BeginTransaction(), CharacterDatabase, Database::CommitTransaction(), mGameEvent, Database::PExecute(), and UI64FMTD.
Referenced by HandleQuestComplete(), StartEvent(), and Update().
Definition at line 1443 of file GameEventMgr.cpp.
References mGameEvent, and Player::SendUpdateWorldState().
Referenced by HandleWorldEventGossip().
Definition at line 96 of file GameEventMgr.cpp.
References AddActiveEvent(), ApplyNewEvent(), CheckOneGameEventConditions(), GAMEEVENT_NORMAL, GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_INACTIVE, mGameEvent, SaveWorldEventStateToDB(), and sWorld.
Referenced by Update().
Definition at line 135 of file GameEventMgr.cpp.
References Database::BeginTransaction(), CharacterDatabase, Database::CommitTransaction(), GameEventFinishCondition::done, GAMEEVENT_NORMAL, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_INACTIVE, mGameEvent, MINUTE, Database::PExecute(), RemoveActiveEvent(), and UnApplyEvent().
Referenced by Update().
|
private |
Run SAI scripts with SMART_EVENT_GAME_EVENT_END
Definition at line 928 of file GameEventMgr.cpp.
References ChangeEquipOrModel(), GameEventSpawn(), GameEventUnspawn(), mGameEvent, RunSmartAIScripts(), sLog, UpdateBattlegroundSettings(), UpdateEventNPCFlags(), UpdateEventNPCVendor(), and UpdateEventQuests().
Referenced by StopEvent().
uint32 GameEventMgr::Update | ( | ) |
Definition at line 858 of file GameEventMgr.cpp.
References CheckOneGameEvent(), CheckOneGameEventConditions(), GAMEEVENT_WORLD_CONDITIONS, GAMEEVENT_WORLD_FINISHED, GAMEEVENT_WORLD_NEXTPHASE, GameEventSpawn(), IN_MILLISECONDS, IsActiveEvent(), isSystemInit, max_ge_check_delay, mGameEvent, NextCheck(), SaveWorldEventStateToDB(), sLog, StartEvent(), and StopEvent().
Referenced by Initialize().
|
private |
Definition at line 1007 of file GameEventMgr.cpp.
References m_ActiveEvents, mGameEventBattlegroundHolidays, and sBattlegroundMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 983 of file GameEventMgr.cpp.
References HashMapHolder< T >::Find(), Creature::GetCreatureTemplate(), GetNPCFlag(), HIGHGUID_UNIT, MAKE_NEW_GUID, mGameEventNPCFlags, Object::SetUInt32Value(), sObjectMgr, and UNIT_NPC_FLAGS.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 1015 of file GameEventMgr.cpp.
References mGameEventVendors, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
private |
Definition at line 1297 of file GameEventMgr.cpp.
References hasCreatureQuestActiveEventExcept(), hasGameObjectQuestActiveEventExcept(), mGameEventCreatureQuests, mGameEventGameObjectQuests, and sObjectMgr.
Referenced by ApplyNewEvent(), and UnApplyEvent().
|
protected |
Definition at line 176 of file GameEventMgr.h.
Referenced by GameEventMgr(), Initialize(), and Update().
|
protected |
Definition at line 175 of file GameEventMgr.h.
Referenced by GetNPCFlag(), hasCreatureActiveEventExcept(), hasCreatureQuestActiveEventExcept(), hasGameObjectActiveEventExcept(), hasGameObjectQuestActiveEventExcept(), Initialize(), and UpdateBattlegroundSettings().
|
protected |
Definition at line 170 of file GameEventMgr.h.
Referenced by ApplyNewEvent(), CheckOneGameEvent(), CheckOneGameEventConditions(), GameEventSpawn(), GameEventUnspawn(), HandleQuestComplete(), hasCreatureActiveEventExcept(), hasGameObjectActiveEventExcept(), LoadFromDB(), NextCheck(), SaveWorldEventStateToDB(), SendWorldStateUpdate(), StartEvent(), StopEvent(), UnApplyEvent(), and Update().
|
protected |
Definition at line 171 of file GameEventMgr.h.
Referenced by LoadFromDB(), and UpdateBattlegroundSettings().
|
protected |
Definition at line 167 of file GameEventMgr.h.
Referenced by GameEventSpawn(), GameEventUnspawn(), hasCreatureActiveEventExcept(), and LoadFromDB().
|
protected |
Definition at line 163 of file GameEventMgr.h.
Referenced by hasCreatureQuestActiveEventExcept(), LoadFromDB(), and UpdateEventQuests().
|
protected |
Definition at line 168 of file GameEventMgr.h.
Referenced by GameEventSpawn(), GameEventUnspawn(), hasGameObjectActiveEventExcept(), and LoadFromDB().
|
protected |
Definition at line 164 of file GameEventMgr.h.
Referenced by hasGameObjectQuestActiveEventExcept(), LoadFromDB(), and UpdateEventQuests().
|
protected |
Definition at line 166 of file GameEventMgr.h.
Referenced by ChangeEquipOrModel(), and LoadFromDB().
|
protected |
Definition at line 173 of file GameEventMgr.h.
Referenced by GetNPCFlag(), LoadFromDB(), and UpdateEventNPCFlags().
|
protected |
Definition at line 169 of file GameEventMgr.h.
Referenced by GameEventSpawn(), GameEventUnspawn(), and LoadFromDB().
|
protected |
Definition at line 165 of file GameEventMgr.h.
Referenced by LoadFromDB(), and UpdateEventNPCVendor().
|
protected |
Definition at line 174 of file GameEventMgr.h.
Referenced by HandleWorldEventGossip(), and LoadFromDB().
|
protected |
Definition at line 172 of file GameEventMgr.h.
Referenced by HandleQuestComplete(), and LoadFromDB().