214 QueryResult result =
WorldDatabase.
Query(
"SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, description, world_event, announce FROM game_event");
218 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 game events. DB table `game_event` is empty.");
225 Field* fields = result->Fetch();
230 TC_LOG_ERROR(
"sql.sql",
"`game_event` game event entry 0 is reserved and can't be used.");
236 pGameEvent.
start = time_t(starttime);
238 pGameEvent.
end = time_t(endtime);
249 TC_LOG_ERROR(
"sql.sql",
"`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id);
257 TC_LOG_ERROR(
"sql.sql",
"`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.
holiday_id);
266 while (result->NextRow());
272 TC_LOG_INFO(
"server.loading",
"Loading Game Event Saves Data...");
280 TC_LOG_INFO(
"server.loading",
">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty.");
286 Field* fields = result->Fetch();
292 TC_LOG_ERROR(
"sql.sql",
"`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id);
299 mGameEvent[event_id].nextstart = time_t(fields[2].GetUInt32());
303 TC_LOG_ERROR(
"sql.sql",
"game_event_save includes event save for non-worldevent id %u", event_id);
309 while (result->NextRow());
316 TC_LOG_INFO(
"server.loading",
"Loading Game Event Prerequisite Data...");
323 TC_LOG_INFO(
"server.loading",
">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty.");
329 Field* fields = result->Fetch();
335 TC_LOG_ERROR(
"sql.sql",
"`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
344 TC_LOG_ERROR(
"sql.sql",
"`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event);
347 mGameEvent[event_id].prerequisite_events.insert(prerequisite_event);
351 TC_LOG_ERROR(
"sql.sql",
"game_event_prerequisiste includes event entry for non-worldevent id %u", event_id);
357 while (result->NextRow());
364 TC_LOG_INFO(
"server.loading",
"Loading Game Event Creature Data...");
372 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty");
378 Field* fields = result->Fetch();
388 TC_LOG_ERROR(
"sql.sql",
"`game_event_creature` contains creature (GUID: " UI64FMTD ") not found in `creature` table.", guid);
394 TC_LOG_ERROR(
"sql.sql",
"`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
399 crelist.push_back(guid);
403 while (result->NextRow());
410 TC_LOG_INFO(
"server.loading",
"Loading Game Event GO Data...");
418 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty.");
424 Field* fields = result->Fetch();
434 TC_LOG_ERROR(
"sql.sql",
"`game_event_gameobject` contains gameobject (GUID: " UI64FMTD ") not found in `gameobject` table.", guid);
440 TC_LOG_ERROR(
"sql.sql",
"`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
445 golist.push_back(guid);
449 while (result->NextRow());
455 TC_LOG_INFO(
"server.loading",
"Loading Game Event Model/Equipment Change Data...");
460 QueryResult result =
WorldDatabase.
Query(
"SELECT creature.guid, creature.id, game_event_model_equip.eventEntry, game_event_model_equip.modelid, game_event_model_equip.equipment_id "
461 "FROM creature JOIN game_event_model_equip ON creature.guid=game_event_model_equip.guid");
464 TC_LOG_INFO(
"server.loading",
">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty.");
470 Field* fields = result->Fetch();
478 TC_LOG_ERROR(
"sql.sql",
"`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
492 if (!
sObjectMgr->GetEquipmentInfo(entry, equipId))
494 TC_LOG_ERROR(
"sql.sql",
"Table `game_event_model_equip` have creature (Guid: " UI64FMTD ", entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.",
500 equiplist.push_back(std::pair<ObjectGuid::LowType, ModelEquip>(guid, newModelEquipSet));
504 while (result->NextRow());
510 TC_LOG_INFO(
"server.loading",
"Loading Game Event Quest Data...");
518 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty.");
524 Field* fields = result->Fetch();
532 TC_LOG_ERROR(
"sql.sql",
"`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
541 while (result->NextRow());
547 TC_LOG_INFO(
"server.loading",
"Loading Game Event GO Quest Data...");
555 TC_LOG_INFO(
"server.loading",
">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty.");
561 Field* fields = result->Fetch();
569 TC_LOG_ERROR(
"sql.sql",
"`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
578 while (result->NextRow());
584 TC_LOG_INFO(
"server.loading",
"Loading Game Event Quest Condition Data...");
592 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty.");
598 Field* fields = result->Fetch();
607 TC_LOG_ERROR(
"sql.sql",
"`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
617 while (result->NextRow());
623 TC_LOG_INFO(
"server.loading",
"Loading Game Event Condition Data...");
628 QueryResult result =
WorldDatabase.
Query(
"SELECT eventEntry, condition_id, req_num, max_world_state_field, done_world_state_field FROM game_event_condition");
631 TC_LOG_INFO(
"server.loading",
">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty.");
637 Field* fields = result->Fetch();
644 TC_LOG_ERROR(
"sql.sql",
"`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
649 mGameEvent[event_id].conditions[condition].done = 0;
655 while (result->NextRow());
661 TC_LOG_INFO(
"server.loading",
"Loading Game Event Condition Save Data...");
669 TC_LOG_INFO(
"server.loading",
">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty.");
675 Field* fields = result->Fetch();
682 TC_LOG_ERROR(
"sql.sql",
"`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
686 GameEventConditionMap::iterator itr =
mGameEvent[event_id].conditions.find(condition);
687 if (itr !=
mGameEvent[event_id].conditions.end())
689 itr->second.done = fields[2].
GetFloat();
693 TC_LOG_ERROR(
"sql.sql",
"game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition);
699 while (result->NextRow());
705 TC_LOG_INFO(
"server.loading",
"Loading Game Event NPCflag Data...");
713 TC_LOG_INFO(
"server.loading",
">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty.");
719 Field* fields = result->Fetch();
727 TC_LOG_ERROR(
"sql.sql",
"`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
735 while (result->NextRow());
741 TC_LOG_INFO(
"server.loading",
"Loading Game Event Seasonal Quest Relations...");
749 TC_LOG_INFO(
"server.loading",
">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty.");
755 Field* fields = result->Fetch();
762 TC_LOG_ERROR(
"sql.sql",
"`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId);
768 TC_LOG_ERROR(
"sql.sql",
"`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry);
775 while (result->NextRow());
781 TC_LOG_INFO(
"server.loading",
"Loading Game Event Vendor Additions Data...");
786 QueryResult result =
WorldDatabase.
Query(
"SELECT eventEntry, guid, item, maxcount, incrtime, ExtendedCost, type FROM game_event_npc_vendor ORDER BY guid, slot ASC");
789 TC_LOG_INFO(
"server.loading",
">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty.");
795 Field* fields = result->Fetch();
801 TC_LOG_ERROR(
"sql.sql",
"`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
814 uint32 event_npc_flag = 0;
816 for (NPCFlagList::const_iterator itr = flist.begin(); itr != flist.end(); ++itr)
818 if (itr->first == guid)
820 event_npc_flag = itr->second;
834 vendors.push_back(newEntry);
838 while (result->NextRow());
844 TC_LOG_INFO(
"server.loading",
"Loading Game Event Battleground Data...");
852 TC_LOG_INFO(
"server.loading",
">> Loaded 0 battleground holidays in game events. DB table `game_event_battleground_holiday` is empty.");
858 Field* fields = result->Fetch();
864 TC_LOG_ERROR(
"sql.sql",
"`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
872 while (result->NextRow());
878 TC_LOG_INFO(
"server.loading",
"Loading Game Event Pool Data...");
884 " JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry");
887 TC_LOG_INFO(
"server.loading",
">> Loaded 0 pools for game events. DB table `game_event_pool` is empty.");
893 Field* fields = result->Fetch();
902 TC_LOG_ERROR(
"sql.sql",
"`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
908 TC_LOG_ERROR(
"sql.sql",
"Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
913 poollist.push_back(entry);
917 while (result->NextRow());
Definition: Creature.h:287
GameEventIdMap mGameEventPoolIds
Definition: GameEventMgr.h:171
Definition: GameEventMgr.h:36
GameEventDataMap mGameEvent
Definition: GameEventMgr.h:172
uint32 item
Definition: GameEventMgr.h:86
int8_t int8
Definition: Define.h:148
uint64 GetUInt64() const
Definition: Field.h:184
HolidayIds holiday_id
Definition: GameEventMgr.h:65
Definition: SharedDefines.h:3716
float GetFloat() const
Definition: Field.h:222
GameEventGuidMap mGameEventCreatureGuids
Definition: GameEventMgr.h:180
GameEventNPCFlagMap mGameEventNPCFlags
Definition: GameEventMgr.h:175
uint8 Type
Definition: GameEventMgr.h:90
Class used to access individual fields of database query result.
Definition: Field.h:56
GameEventNPCVendorMap mGameEventVendors
Definition: GameEventMgr.h:167
uint8 announce
Definition: GameEventMgr.h:70
GameEventGuidMap mGameEventGameobjectGuids
Definition: GameEventMgr.h:181
uint32 getMSTime()
Definition: Timer.h:24
GameEventState
Definition: GameEventMgr.h:29
uint32 entry
Definition: GameEventMgr.h:85
arena_t NULL
Definition: jemalloc_internal.h:624
std::unordered_map< uint32, uint16 > _questToEventLinks
Definition: GameEventMgr.h:177
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
uint8 equipment_id
Definition: GameEventMgr.h:79
uint32 ExtendedCost
Definition: GameEventMgr.h:89
time_t end
Definition: GameEventMgr.h:61
uint64 LowType
Definition: ObjectGuid.h:199
#define sObjectMgr
Definition: ObjectMgr.h:1567
uint32 length
Definition: GameEventMgr.h:64
std::list< uint32 > IdList
Definition: GameEventMgr.h:149
std::list< ObjectGuid > GuidList
Definition: ObjectGuid.h:333
std::list< QuestRelation > QuestRelList
Definition: GameEventMgr.h:156
DB2Storage< HolidaysEntry > sHolidaysStore("Holidays.db2", HolidaysEntryFormat, HOTFIX_SEL_HOLIDAYS)
uint8 GetUInt8() const
Definition: Field.h:70
std::list< NPCVendorEntry > NPCVendorList
Definition: GameEventMgr.h:158
#define sPoolMgr
Definition: PoolMgr.h:166
uint32 modelid_prev
Definition: GameEventMgr.h:78
uint32 incrtime
Definition: GameEventMgr.h:88
QuestIdToEventConditionMap mQuestToEventConditions
Definition: GameEventMgr.h:174
#define UI64FMTD
Definition: Define.h:137
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
uint32 id
Definition: GameObject.h:838
uint16_t uint16
Definition: Define.h:151
std::pair< ObjectGuid::LowType, uint64 > GuidNPCFlagPair
Definition: GameEventMgr.h:161
time_t nextstart
Definition: GameEventMgr.h:62
uint16 GetUInt16() const
Definition: Field.h:108
Definition: GameEventMgr.h:31
uint8 equipement_id_prev
Definition: GameEventMgr.h:80
GameEventState state
Definition: GameEventMgr.h:66
int32 maxcount
Definition: GameEventMgr.h:87
Definition: GameObject.h:833
uint32 occurence
Definition: GameEventMgr.h:63
Definition: GameEventMgr.h:75
Definition: GameEventMgr.h:83
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
GameEventBitmask mGameEventBattlegroundHolidays
Definition: GameEventMgr.h:173
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
std::list< ModelEquipPair > ModelEquipList
Definition: GameEventMgr.h:153
uint32 modelid
Definition: GameEventMgr.h:77
uint32 GetUInt32() const
Definition: Field.h:146
GameEventQuestMap mGameEventGameObjectQuests
Definition: GameEventMgr.h:166
int32_t int32
Definition: g3dmath.h:167
uint8_t uint8
Definition: Define.h:152
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
GameEventQuestMap mGameEventCreatureQuests
Definition: GameEventMgr.h:165
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
int16_t int16
Definition: Define.h:147
std::list< GuidNPCFlagPair > NPCFlagList
Definition: GameEventMgr.h:162
int8 GetInt8() const
Definition: Field.h:89
std::pair< uint32, uint32 > QuestRelation
Definition: GameEventMgr.h:155
Definition: GameEventMgr.h:56
std::string GetString() const
Definition: Field.h:276
std::string description
Definition: GameEventMgr.h:69
HolidayIds
Definition: SharedDefines.h:3714
GameEventModelEquipMap mGameEventModelEquip
Definition: GameEventMgr.h:168
time_t start
Definition: GameEventMgr.h:60