diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h index c7a14215d..c5f0f4d8a 100644 --- a/src/game/ItemPrototype.h +++ b/src/game/ItemPrototype.h @@ -557,7 +557,7 @@ struct ItemPrototype uint32 MaxDurability; uint32 Area; // id from AreaTable.dbc uint32 Map; // id from Map.dbc - uint32 BagFamily; // id from ItemBagFamily.dbc + uint32 BagFamily; // bit string (1 << id from ItemBagFamily.dbc) uint32 TotemCategory; // id from TotemCategory.dbc _Socket Socket[MAX_ITEM_PROTO_SOCKETS]; uint32 socketBonus; // id from SpellItemEnchantment.dbc diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 21925cc29..51fc9108b 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1715,6 +1715,24 @@ void ObjectMgr::LoadItemPrototypes() if(proto->Map && !sMapStore.LookupEntry(proto->Map)) sLog.outErrorDb("Item (Entry: %u) has wrong Map (%u)",i,proto->Map); + if(proto->BagFamily) + { + // check bits + for(uint32 i = 0; i < sizeof(proto->BagFamily)*8; ++i) + { + uint32 mask = 1 << i; + if((proto->BagFamily & mask)==0) + continue; + + ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(i+1); + if(!bf) + { + sLog.outErrorDb("Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit",i); + const_cast(proto)->BagFamily &= ~mask; + } + } + } + if(proto->TotemCategory && !sTotemCategoryStore.LookupEntry(proto->TotemCategory)) sLog.outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",i,proto->TotemCategory); diff --git a/src/shared/Database/DBCStores.cpp b/src/shared/Database/DBCStores.cpp index 4c48894d8..caafdb5d9 100644 --- a/src/shared/Database/DBCStores.cpp +++ b/src/shared/Database/DBCStores.cpp @@ -77,6 +77,7 @@ DBCStorage sGtRegenHPPerSptStore(GtRegenHPPerSptf DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); DBCStorage sHolidaysStore(Holidaysfmt); DBCStorage sItemStore(Itemfmt); +DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); //DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); //DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently DBCStorage sItemExtendedCostStore(ItemExtendedCostEntryfmt); @@ -194,7 +195,7 @@ void LoadDBCStores(const std::string& dataPath) { std::string dbcPath = dataPath+"dbc/"; - const uint32 DBCFilesCount = 73; + const uint32 DBCFilesCount = 74; barGoLink bar( DBCFilesCount ); @@ -269,6 +270,7 @@ void LoadDBCStores(const std::string& dataPath) 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,sItemBagFamilyStore, dbcPath,"ItemBagFamily.dbc"); //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemExtendedCostStore, dbcPath,"ItemExtendedCost.dbc"); diff --git a/src/shared/Database/DBCStores.h b/src/shared/Database/DBCStores.h index 5a37201db..a4b68910a 100644 --- a/src/shared/Database/DBCStores.h +++ b/src/shared/Database/DBCStores.h @@ -169,6 +169,7 @@ extern DBCStorage sGtRegenHPPerSptStore; extern DBCStorage sGtRegenMPPerSptStore; extern DBCStorage sHolidaysStore; extern DBCStorage sItemStore; +extern DBCStorage sItemBagFamilyStore; //extern DBCStorage sItemDisplayInfoStore; -- not used currently extern DBCStorage sItemExtendedCostStore; extern DBCStorage sItemLimitCategoryStore; diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h index 9b825e175..ccd3835a5 100644 --- a/src/shared/Database/DBCStructure.h +++ b/src/shared/Database/DBCStructure.h @@ -901,6 +901,13 @@ struct ItemEntry uint32 Sheath; // 7 }; +struct ItemBagFamilyEntry +{ + uint32 ID; // 0 + //char* name[16] // 1-16 m_name_lang + // // 17 name flags +}; + struct ItemDisplayInfoEntry { uint32 ID; // 0 m_ID diff --git a/src/shared/Database/DBCfmt.cpp b/src/shared/Database/DBCfmt.cpp index 61eb52463..6f99b923d 100644 --- a/src/shared/Database/DBCfmt.cpp +++ b/src/shared/Database/DBCfmt.cpp @@ -55,6 +55,7 @@ const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="f"; const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char Itemfmt[]="nixiiiii"; +const char ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; //const char ItemCondExtCostsEntryfmt[]="xiii"; const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiix"; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 871f8dc6a..c28abd5de 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 "7511" + #define REVISION_NR "7512" #endif // __REVISION_NR_H__