From 417c7c83196aba0c4afdefd75c3edaba91337a88 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 6 Mar 2009 19:36:47 -0600 Subject: [7393] Implement access to client side holiday ids. Author: VladimirMangos * src/game/GameEvent.* renamed to src/game/GameEventMgr.* for consistence * `game_event` now have new `holiday` field for store client side holiday id associated with game event * Added new enum HolidayIds with existed at this moment holiday ids. * New function "bool IsHolidayActive(HolidayIds id)" added accessabel from scripts for active holidays check. --HG-- branch : trunk --- src/shared/Database/DBCStores.cpp | 4 +++- src/shared/Database/DBCStores.h | 1 + src/shared/Database/DBCStructure.h | 34 ++++++++++++++++++++++++++++++++++ src/shared/Database/DBCfmt.cpp | 1 + src/shared/revision_nr.h | 2 +- 5 files changed, 40 insertions(+), 2 deletions(-) (limited to 'src/shared') diff --git a/src/shared/Database/DBCStores.cpp b/src/shared/Database/DBCStores.cpp index 515b17b495b..23a2b8e6cd5 100644 --- a/src/shared/Database/DBCStores.cpp +++ b/src/shared/Database/DBCStores.cpp @@ -77,6 +77,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 @@ -195,7 +196,7 @@ void LoadDBCStores(const std::string& dataPath) { std::string dbcPath = dataPath+"dbc/"; - const uint32 DBCFilesCount = 72; + const uint32 DBCFilesCount = 73; barGoLink bar( DBCFilesCount ); @@ -268,6 +269,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 6b5f5990eea..f915a613b71 100644 --- a/src/shared/Database/DBCStores.h +++ b/src/shared/Database/DBCStores.h @@ -169,6 +169,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 60411ae1583..8f2fa87e17f 100644 --- a/src/shared/Database/DBCStructure.h +++ b/src/shared/Database/DBCStructure.h @@ -861,6 +861,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 0420c2b9a85..62a69610ebd 100644 --- a/src/shared/Database/DBCfmt.cpp +++ b/src/shared/Database/DBCfmt.cpp @@ -55,6 +55,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 ad8269a8f66..2f255c5e69b 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__ -- cgit v1.2.3