diff --git a/sql/mangos.sql b/sql/mangos.sql index c9d23fbec..93e2382f2 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, - `required_7390_01_mangos_areatrigger_teleport` bit(1) default NULL + `required_7393_01_mangos_game_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -1072,6 +1072,7 @@ CREATE TABLE `game_event` ( `end_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute end date, the event will never start afler', `occurence` bigint(20) unsigned NOT NULL default '86400' COMMENT 'Delay in hours between occurences of the event', `length` bigint(20) unsigned NOT NULL default '43200' COMMENT 'Length in hours of the event', + `holiday` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Client side holiday id', `description` varchar(255) default NULL COMMENT 'Description of the event displayed in console', PRIMARY KEY (`entry`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/sql/updates/7393_01_mangos_game_event.sql b/sql/updates/7393_01_mangos_game_event.sql new file mode 100644 index 000000000..24e576462 --- /dev/null +++ b/sql/updates/7393_01_mangos_game_event.sql @@ -0,0 +1,4 @@ +ALTER TABLE db_version CHANGE COLUMN required_7390_01_mangos_areatrigger_teleport required_7393_01_mangos_game_event bit; + +ALTER TABLE game_event + ADD COLUMN holiday mediumint(8) unsigned NOT NULL default '0' COMMENT 'Client side holiday id' AFTER length; diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 4d541d014..d7399a86f 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -193,6 +193,7 @@ pkgdata_DATA = \ 7382_01_mangos_creature_template.sql \ 7388_01_mangos_mangos_string.sql \ 7390_01_mangos_areatrigger_teleport.sql \ + 7393_01_mangos_game_event.sql \ README ## Additional files to include when running 'make dist' @@ -366,4 +367,5 @@ EXTRA_DIST = \ 7382_01_mangos_creature_template.sql \ 7388_01_mangos_mangos_string.sql \ 7390_01_mangos_areatrigger_teleport.sql \ + 7393_01_mangos_game_event.sql \ README diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 0f61962ce..df209edf9 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -21,10 +21,10 @@ #include "Player.h" #include "WorldPacket.h" #include "Database/DBCEnums.h" +#include "GameEventMgr.h" #include "ObjectMgr.h" #include "Guild.h" #include "Database/DatabaseEnv.h" -#include "GameEvent.h" #include "World.h" #include "SpellMgr.h" #include "ArenaTeam.h" @@ -607,7 +607,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if(Player::GetDrunkenstateByValue(GetPlayer()->GetDrunkValue()) != DRUNKEN_SMASHED) continue; // TODO: hardcoding eventid is bad, it can differ from DB to DB - maye implement something using HolidayNames.dbc? - if(!gameeventmgr.IsActiveEvent(26)) + if(!IsHolidayActive(HOLIDAY_BREWFEST)) continue; } // miscvalue1 is the ingame fallheight*100 as stored in dbc diff --git a/src/game/GameEvent.cpp b/src/game/GameEventMgr.cpp similarity index 89% rename from src/game/GameEvent.cpp rename to src/game/GameEventMgr.cpp index 2504f454f..e2b7386a8 100644 --- a/src/game/GameEvent.cpp +++ b/src/game/GameEventMgr.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "GameEvent.h" +#include "GameEventMgr.h" #include "World.h" #include "ObjectMgr.h" #include "PoolHandler.h" @@ -26,9 +26,9 @@ #include "MapManager.h" #include "Policies/SingletonImp.h" -INSTANTIATE_SINGLETON_1(GameEvent); +INSTANTIATE_SINGLETON_1(GameEventMgr); -bool GameEvent::CheckOneGameEvent(uint16 entry) const +bool GameEventMgr::CheckOneGameEvent(uint16 entry) const { // Get the event information time_t currenttime = time(NULL); @@ -39,7 +39,7 @@ bool GameEvent::CheckOneGameEvent(uint16 entry) const return false; } -uint32 GameEvent::NextCheck(uint16 entry) const +uint32 GameEventMgr::NextCheck(uint16 entry) const { time_t currenttime = time(NULL); @@ -65,7 +65,7 @@ uint32 GameEvent::NextCheck(uint16 entry) const return delay; } -void GameEvent::StartEvent( uint16 event_id, bool overwrite ) +void GameEventMgr::StartEvent( uint16 event_id, bool overwrite ) { AddActiveEvent(event_id); ApplyNewEvent(event_id); @@ -77,7 +77,7 @@ void GameEvent::StartEvent( uint16 event_id, bool overwrite ) } } -void GameEvent::StopEvent( uint16 event_id, bool overwrite ) +void GameEventMgr::StopEvent( uint16 event_id, bool overwrite ) { RemoveActiveEvent(event_id); UnApplyEvent(event_id); @@ -89,7 +89,7 @@ void GameEvent::StopEvent( uint16 event_id, bool overwrite ) } } -void GameEvent::LoadFromDB() +void GameEventMgr::LoadFromDB() { { QueryResult *result = WorldDatabase.Query("SELECT MAX(entry) FROM game_event"); @@ -108,7 +108,7 @@ void GameEvent::LoadFromDB() mGameEvent.resize(max_event_id+1); } - QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,description FROM game_event"); + QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description FROM game_event"); if( !result ) { mGameEvent.clear(); @@ -142,6 +142,8 @@ void GameEvent::LoadFromDB() pGameEvent.end = time_t(endtime); pGameEvent.occurence = fields[3].GetUInt32(); pGameEvent.length = fields[4].GetUInt32(); + pGameEvent.holiday_id = fields[5].GetUInt32(); + if(pGameEvent.length==0) // length>0 is validity check { @@ -149,7 +151,16 @@ void GameEvent::LoadFromDB() continue; } - pGameEvent.description = fields[5].GetCppString(); + if(pGameEvent.holiday_id) + { + if(!sHolidaysStore.LookupEntry(pGameEvent.holiday_id)) + { + sLog.outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id); + pGameEvent.holiday_id = 0; + } + } + + pGameEvent.description = fields[6].GetCppString(); } while( result->NextRow() ); delete result; @@ -405,7 +416,7 @@ void GameEvent::LoadFromDB() } } -uint32 GameEvent::Initialize() // return the next event delay in ms +uint32 GameEventMgr::Initialize() // return the next event delay in ms { m_ActiveEvents.clear(); uint32 delay = Update(); @@ -414,7 +425,7 @@ uint32 GameEvent::Initialize() // return the next e return delay; } -uint32 GameEvent::Update() // return the next event delay in ms +uint32 GameEventMgr::Update() // return the next event delay in ms { uint32 nextEventDelay = max_ge_check_delay; // 1 day uint32 calcDelay; @@ -450,7 +461,7 @@ uint32 GameEvent::Update() // return the next e return (nextEventDelay + 1) * IN_MILISECONDS; // Add 1 second to be sure event has started/stopped at next call } -void GameEvent::UnApplyEvent(uint16 event_id) +void GameEventMgr::UnApplyEvent(uint16 event_id) { sLog.outString("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); // un-spawn positive event tagged objects @@ -464,7 +475,7 @@ void GameEvent::UnApplyEvent(uint16 event_id) UpdateEventQuests(event_id, false); } -void GameEvent::ApplyNewEvent(uint16 event_id) +void GameEventMgr::ApplyNewEvent(uint16 event_id) { switch(sWorld.getConfig(CONFIG_EVENT_ANNOUNCE)) { @@ -487,13 +498,13 @@ void GameEvent::ApplyNewEvent(uint16 event_id) UpdateEventQuests(event_id, true); } -void GameEvent::GameEventSpawn(int16 event_id) +void GameEventMgr::GameEventSpawn(int16 event_id) { int32 internal_event_id = mGameEvent.size() + event_id - 1; if(internal_event_id < 0 || internal_event_id >= mGameEventCreatureGuids.size()) { - sLog.outError("GameEvent::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: %u)",internal_event_id,mGameEventCreatureGuids.size()); + sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: %u)",internal_event_id,mGameEventCreatureGuids.size()); return; } @@ -526,7 +537,7 @@ void GameEvent::GameEventSpawn(int16 event_id) if(internal_event_id < 0 || internal_event_id >= mGameEventGameobjectGuids.size()) { - sLog.outError("GameEvent::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %u)",internal_event_id,mGameEventGameobjectGuids.size()); + sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %u)",internal_event_id,mGameEventGameobjectGuids.size()); return; } @@ -560,7 +571,7 @@ void GameEvent::GameEventSpawn(int16 event_id) if(internal_event_id < 0 || internal_event_id >= mGameEventPoolIds.size()) { - sLog.outError("GameEvent::GameEventSpawn attempt access to out of range mGameEventPoolIds element %i (size: %u)",internal_event_id,mGameEventPoolIds.size()); + sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %i (size: %u)",internal_event_id,mGameEventPoolIds.size()); return; } @@ -570,13 +581,13 @@ void GameEvent::GameEventSpawn(int16 event_id) } } -void GameEvent::GameEventUnspawn(int16 event_id) +void GameEventMgr::GameEventUnspawn(int16 event_id) { int32 internal_event_id = mGameEvent.size() + event_id - 1; if(internal_event_id < 0 || internal_event_id >= mGameEventCreatureGuids.size()) { - sLog.outError("GameEvent::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: %u)",internal_event_id,mGameEventCreatureGuids.size()); + sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: %u)",internal_event_id,mGameEventCreatureGuids.size()); return; } @@ -597,7 +608,7 @@ void GameEvent::GameEventUnspawn(int16 event_id) if(internal_event_id < 0 || internal_event_id >= mGameEventGameobjectGuids.size()) { - sLog.outError("GameEvent::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %u)",internal_event_id,mGameEventGameobjectGuids.size()); + sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %u)",internal_event_id,mGameEventGameobjectGuids.size()); return; } @@ -614,7 +625,7 @@ void GameEvent::GameEventUnspawn(int16 event_id) } if(internal_event_id < 0 || internal_event_id >= mGameEventPoolIds.size()) { - sLog.outError("GameEvent::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %i (size: %u)",internal_event_id,mGameEventPoolIds.size()); + sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %i (size: %u)",internal_event_id,mGameEventPoolIds.size()); return; } @@ -624,7 +635,7 @@ void GameEvent::GameEventUnspawn(int16 event_id) } } -void GameEvent::ChangeEquipOrModel(int16 event_id, bool activate) +void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) { for(ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin();itr != mGameEventModelEquip[event_id].end();++itr) { @@ -703,7 +714,7 @@ void GameEvent::ChangeEquipOrModel(int16 event_id, bool activate) } } -void GameEvent::UpdateEventQuests(uint16 event_id, bool Activate) +void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate) { QuestRelList::iterator itr; for (itr = mGameEventQuests[event_id].begin();itr != mGameEventQuests[event_id].end();++itr) @@ -729,7 +740,19 @@ void GameEvent::UpdateEventQuests(uint16 event_id, bool Activate) } } -GameEvent::GameEvent() +GameEventMgr::GameEventMgr() { isSystemInit = false; } + +MANGOS_DLL_SPEC bool IsHolidayActive( HolidayIds id ) +{ + GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap(); + GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList(); + + for(GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr) + if(events[id].holiday_id==id) + return true; + + return false; +} \ No newline at end of file diff --git a/src/game/GameEvent.h b/src/game/GameEventMgr.h similarity index 90% rename from src/game/GameEvent.h rename to src/game/GameEventMgr.h index e1752a952..2710c987c 100644 --- a/src/game/GameEvent.h +++ b/src/game/GameEventMgr.h @@ -16,15 +16,18 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef MANGOS_GAMEEVENT_H -#define MANGOS_GAMEEVENT_H +#ifndef MANGOS_GAMEEVENT_MGR_H +#define MANGOS_GAMEEVENT_MGR_H +#include "Common.h" +#include "SharedDefines.h" #include "Platform/Define.h" -#include "Creature.h" -#include "GameObject.h" #define max_ge_check_delay 86400 // 1 day in seconds +class Creature; +class GameObject; + struct GameEventData { GameEventData() : start(1),end(0),occurence(0),length(0) {} @@ -32,6 +35,7 @@ struct GameEventData time_t end; uint32 occurence; uint32 length; + uint32 holiday_id; std::string description; bool isValid() const { return length > 0; } @@ -45,11 +49,11 @@ struct ModelEquip uint32 equipement_id_prev; }; -class GameEvent +class GameEventMgr { public: - GameEvent(); - ~GameEvent() {}; + GameEventMgr(); + ~GameEventMgr() {}; typedef std::set ActiveEvents; typedef std::vector GameEventDataMap; ActiveEvents const& GetActiveEventList() const { return m_ActiveEvents; } @@ -92,5 +96,8 @@ class GameEvent bool isSystemInit; }; -#define gameeventmgr MaNGOS::Singleton::Instance() +#define gameeventmgr MaNGOS::Singleton::Instance() + +MANGOS_DLL_SPEC bool IsHolidayActive(HolidayIds id); + #endif diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 3e623a5ac..be925db6b 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -31,7 +31,7 @@ #include "MapManager.h" #include "Language.h" #include "World.h" -#include "GameEvent.h" +#include "GameEventMgr.h" #include "SpellMgr.h" #include "PoolHandler.h" #include "AccountMgr.h" @@ -162,7 +162,7 @@ bool ChatHandler::HandleTargetObjectCommand(const char* args) { Player* pl = m_session->GetPlayer(); QueryResult *result; - GameEvent::ActiveEvents const& activeEventsList = gameeventmgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& activeEventsList = gameeventmgr.GetActiveEventList(); if(*args) { int32 id = atoi((char*)args); @@ -185,7 +185,7 @@ bool ChatHandler::HandleTargetObjectCommand(const char* args) eventFilter << " AND (event IS NULL "; bool initString = true; - for (GameEvent::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr) + for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr) { if (initString) { @@ -3617,8 +3617,8 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) uint32 counter = 0; - GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap(); - GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); + GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap(); + GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); for(uint32 id = 0; id < events.size(); ++id ) { @@ -3651,12 +3651,12 @@ bool ChatHandler::HandleEventActiveListCommand(const char* /*args*/) { uint32 counter = 0; - GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap(); - GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); + GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap(); + GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); char const* active = GetMangosString(LANG_ACTIVE); - for(GameEvent::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr ) + for(GameEventMgr::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr ) { uint32 event_id = *itr; GameEventData const& eventData = events[event_id]; @@ -3687,7 +3687,7 @@ bool ChatHandler::HandleEventInfoCommand(const char* args) uint32 event_id = atoi(cId); - GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap(); + GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap(); if(event_id >=events.size()) { @@ -3704,7 +3704,7 @@ bool ChatHandler::HandleEventInfoCommand(const char* args) return false; } - GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); bool active = activeEvents.find(event_id) != activeEvents.end(); char const* activeStr = active ? GetMangosString(LANG_ACTIVE) : ""; @@ -3736,7 +3736,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args) int32 event_id = atoi(cId); - GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap(); + GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap(); if(event_id < 1 || event_id >=events.size()) { @@ -3753,7 +3753,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args) return false; } - GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); if(activeEvents.find(event_id) != activeEvents.end()) { PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE,event_id); @@ -3777,7 +3777,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args) int32 event_id = atoi(cId); - GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap(); + GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap(); if(event_id < 1 || event_id >=events.size()) { @@ -3794,7 +3794,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args) return false; } - GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); + GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList(); if(activeEvents.find(event_id) == activeEvents.end()) { diff --git a/src/game/Makefile.am b/src/game/Makefile.am index 2b10e7b6e..f769811b9 100644 --- a/src/game/Makefile.am +++ b/src/game/Makefile.am @@ -109,8 +109,8 @@ libmangosgame_a_SOURCES = \ FleeingMovementGenerator.cpp \ FleeingMovementGenerator.h \ Formulas.h \ - GameEvent.cpp \ - GameEvent.h \ + GameEventMgr.cpp \ + GameEventMgr.h \ GameObject.cpp \ GameObject.h \ GlobalEvents.cpp \ diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 948f7d06a..282da0002 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -35,7 +35,7 @@ #include "Transports.h" #include "ProgressBar.h" #include "Language.h" -#include "GameEvent.h" +#include "GameEventMgr.h" #include "Spell.h" #include "Chat.h" #include "AccountMgr.h" @@ -6684,7 +6684,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val } case CONDITION_ACTIVE_EVENT: { - GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap(); + GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap(); if(value1 >=events.size() || !events[value1].isValid()) { sLog.outErrorDb("Active event condition requires existed event id (%u), skipped", value1); diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 496eefa4d..7a27b0f03 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -1591,6 +1591,31 @@ enum CreatureEliteType CREATURE_UNKNOWN = 5 // found in 2.2.3 for 2 mobs }; +// values based at Holidays.dbc +enum HolidayIds +{ + HOLIDAY_FIREWORKS_SPECTACULAR = 62, + HOLIDAY_FEAST_OF_WINTER_VEIL = 141, + HOLIDAY_NOBLEGARDEN = 181, + HOLIDAY_CHILDRENS_WEEK = 201, + HOLIDAY_CALL_TO_ARMS_AV = 283, + HOLIDAY_CALL_TO_ARMS_WG = 284, + HOLIDAY_CALL_TO_ARMS_AB = 285, + HOLIDAY_FISHING_EXTRAVAGANZA = 301, + HOLIDAY_HARVEST_FESTIVAL = 321, + HOLIDAY_HALLOWS_END = 324, + HOLIDAY_LUNAR_FESTIVAL = 327, + HOLIDAY_LOVE_IS_IN_THE_AIR = 335, + HOLIDAY_FIRE_FESTIVAL = 341, + HOLIDAY_CALL_TO_ARMS_ES = 353, + HOLIDAY_BREWFEST = 372, + HOLIDAY_DARKMOON_FAIRE_ELWYNN = 374, + HOLIDAY_DARKMOON_FAIRE_THUNDER = 375, + HOLIDAY_DARKMOON_FAIRE_SHATTRATH = 376, + HOLIDAY_CALL_TO_ARMS_SA = 400, + HOLIDAY_WOTLK_LAUNCH = 406 +}; + // values based at QuestInfo.dbc enum QuestTypes { diff --git a/src/game/World.cpp b/src/game/World.cpp index 0f3f1086f..269c38118 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -52,7 +52,7 @@ #include "WaypointMovementGenerator.h" #include "VMapFactory.h" #include "GlobalEvents.h" -#include "GameEvent.h" +#include "GameEventMgr.h" #include "PoolHandler.h" #include "Database/DatabaseImpl.h" #include "GridNotifiersImpl.h" diff --git a/src/shared/Database/DBCStores.cpp b/src/shared/Database/DBCStores.cpp index f2be6e577..671efa5ea 100644 --- a/src/shared/Database/DBCStores.cpp +++ b/src/shared/Database/DBCStores.cpp @@ -75,6 +75,7 @@ DBCStorage sGtOCTRegenHPStore(GtOCTRegenHPfmt); //DBCStorage sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently DBCStorage sGtRegenHPPerSptStore(GtRegenHPPerSptfmt); DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); +DBCStorage sHolidaysStore(Holidaysfmt); DBCStorage sItemStore(Itemfmt); //DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); //DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently @@ -193,7 +194,7 @@ void LoadDBCStores(const std::string& dataPath) { std::string dbcPath = dataPath+"dbc/"; - const uint32 DBCFilesCount = 72; + const uint32 DBCFilesCount = 73; barGoLink bar( DBCFilesCount ); @@ -266,6 +267,7 @@ void LoadDBCStores(const std::string& dataPath) //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenHPPerSptStore, dbcPath,"gtRegenHPPerSpt.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenMPPerSptStore, dbcPath,"gtRegenMPPerSpt.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sHolidaysStore, dbcPath,"Holidays.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemStore, dbcPath,"Item.dbc"); //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc"); diff --git a/src/shared/Database/DBCStores.h b/src/shared/Database/DBCStores.h index dd25b2ed6..5a37201db 100644 --- a/src/shared/Database/DBCStores.h +++ b/src/shared/Database/DBCStores.h @@ -167,6 +167,7 @@ extern DBCStorage sGtOCTRegenHPStore; //extern DBCStorage sGtOCTRegenMPStore; -- not used currently extern DBCStorage sGtRegenHPPerSptStore; extern DBCStorage sGtRegenMPPerSptStore; +extern DBCStorage sHolidaysStore; extern DBCStorage sItemStore; //extern DBCStorage sItemDisplayInfoStore; -- not used currently extern DBCStorage sItemExtendedCostStore; diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h index bcb1d22b6..9f8154554 100644 --- a/src/shared/Database/DBCStructure.h +++ b/src/shared/Database/DBCStructure.h @@ -854,6 +854,40 @@ struct GtRegenMPPerSptEntry float ratio; }; +/* no used +struct HolidayDescriptionsEntry +{ + uint32 ID; // 0, this is NOT holiday id + //char* name[16] // 1-16 m_name_lang + // 17 name flags +}; +*/ + +/* no used +struct HolidayNamesEntry +{ + uint32 ID; // 0, this is NOT holiday id + //char* name[16] // 1-16 m_name_lang + // 17 name flags +}; +*/ + +struct HolidaysEntry +{ + uint32 ID; // 0, holiday id + //uint32 unk1; // 1 + //uint32 unk2; // 2 + //uint32 unk3[8] // 3-10, empty fields + //uint32 unk11[13] // 11-23, some unknown data (bit strings?) + //uint32 unk11[13] // 24-36, some empty fields (continue prev?) + //uint32 unk11[12] // 37-48, counters? + //uint32 holidayNameId; // 49, id for HolidayNames.dbc + //uint32 holidayDescriptionId; // 50, id for HolidayDescriptions.dbc + //uint32 unk51; // 51 + //uint32 unk52; // 52 + //uint32 unk53; // 53 +}; + struct ItemEntry { uint32 ID; // 0 diff --git a/src/shared/Database/DBCfmt.cpp b/src/shared/Database/DBCfmt.cpp index 310d4241c..30c720870 100644 --- a/src/shared/Database/DBCfmt.cpp +++ b/src/shared/Database/DBCfmt.cpp @@ -53,6 +53,7 @@ const char GtOCTRegenHPfmt[]="f"; //const char GtOCTRegenMPfmt[]="f"; const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="f"; +const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char Itemfmt[]="nixiiiii"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; //const char ItemCondExtCostsEntryfmt[]="xiii"; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ad8269a8f..2f255c5e6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7392" + #define REVISION_NR "7393" #endif // __REVISION_NR_H__ diff --git a/win/VC71/game.vcproj b/win/VC71/game.vcproj index 0643908d5..da274a1f5 100644 --- a/win/VC71/game.vcproj +++ b/win/VC71/game.vcproj @@ -276,10 +276,10 @@ RelativePath="..\..\src\game\DuelHandler.cpp"> + RelativePath="..\..\src\game\GameEventMgr.cpp"> + RelativePath="..\..\src\game\GameEventMgr.h"> diff --git a/win/VC80/game.vcproj b/win/VC80/game.vcproj index 0ac846d64..7e4cc1413 100644 --- a/win/VC80/game.vcproj +++ b/win/VC80/game.vcproj @@ -539,11 +539,11 @@ >