diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/AI/SmartScripts/SmartScriptMgr.h | 2 | ||||
| -rw-r--r-- | src/game/DataStores/DBCStores.cpp | 3 | ||||
| -rw-r--r-- | src/game/DataStores/DBCStores.h | 1 | ||||
| -rw-r--r-- | src/game/DataStores/DBCStructure.h | 12 | ||||
| -rw-r--r-- | src/game/DataStores/DBCfmt.h | 1 | ||||
| -rw-r--r-- | src/game/Globals/ObjectMgr.cpp | 70 | ||||
| -rw-r--r-- | src/game/Spells/Spell.cpp | 4 | ||||
| -rw-r--r-- | src/game/World/World.cpp | 3 | ||||
| -rw-r--r-- | src/game/World/World.h | 1 | ||||
| -rw-r--r-- | src/worldserver/worldserver.conf.dist | 10 |
10 files changed, 14 insertions, 93 deletions
diff --git a/src/game/AI/SmartScripts/SmartScriptMgr.h b/src/game/AI/SmartScripts/SmartScriptMgr.h index 66b713d594..3b02da9c64 100644 --- a/src/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/game/AI/SmartScripts/SmartScriptMgr.h @@ -1731,7 +1731,7 @@ class SmartAIMgr bool IsItemValid(SmartScriptHolder const& e, uint32 entry) { - if (!sItemStore.LookupEntry(entry)) + if (!sObjectMgr->GetItemTemplate(entry)) { sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Item entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry); return false; diff --git a/src/game/DataStores/DBCStores.cpp b/src/game/DataStores/DBCStores.cpp index 63a8e9b460..d92d3f78a2 100644 --- a/src/game/DataStores/DBCStores.cpp +++ b/src/game/DataStores/DBCStores.cpp @@ -99,7 +99,6 @@ DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore(GtRegenMPPerSptf DBCStorage <HolidaysEntry> sHolidaysStore(Holidaysfmt); -DBCStorage <ItemEntry> sItemStore(Itemfmt); DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore(ItemBagFamilyfmt); //DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); @@ -332,7 +331,6 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sItemStore, dbcPath, "Item.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemDisplayInfoStore, dbcPath, "ItemDisplayInfo.dbc"); //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemCondExtCostsStore, dbcPath, "ItemCondExtCosts.dbc"); @@ -615,7 +613,6 @@ void LoadDBCStores(const std::string& dataPath) if (!sAreaTableStore.LookupEntry(4987) || // last area added in 3.3.5a !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.5a - !sItemStore.LookupEntry(56806) || // last gem property added in 3.3.5a !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a !sMapStore.LookupEntry(724) || // last map added in 3.3.5a !sSpellStore.LookupEntry(80864) ) // last client known item added in 3.3.5a diff --git a/src/game/DataStores/DBCStores.h b/src/game/DataStores/DBCStores.h index a8ca942fdc..5b241f6fcb 100644 --- a/src/game/DataStores/DBCStores.h +++ b/src/game/DataStores/DBCStores.h @@ -100,7 +100,6 @@ extern DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore; extern DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore; extern DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore; extern DBCStorage <HolidaysEntry> sHolidaysStore; -extern DBCStorage <ItemEntry> sItemStore; extern DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore; extern DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore; extern DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore; diff --git a/src/game/DataStores/DBCStructure.h b/src/game/DataStores/DBCStructure.h index ed2eb5ae34..e43351b9dd 100644 --- a/src/game/DataStores/DBCStructure.h +++ b/src/game/DataStores/DBCStructure.h @@ -1092,18 +1092,6 @@ struct HolidaysEntry //uint32 flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) }; -struct ItemEntry -{ - uint32 ID; // 0 - uint32 Class; // 1 - uint32 SubClass; // 2 some items have strange subclasses - int32 SoundOverrideSubclass; // 3 - int32 Material; // 4 - uint32 DisplayId; // 5 - uint32 InventoryType; // 6 - uint32 Sheath; // 7 -}; - struct ItemBagFamilyEntry { uint32 ID; // 0 diff --git a/src/game/DataStores/DBCfmt.h b/src/game/DataStores/DBCfmt.h index bef062b8ac..8e1a6c3395 100644 --- a/src/game/DataStores/DBCfmt.h +++ b/src/game/DataStores/DBCfmt.h @@ -58,7 +58,6 @@ char const GtOCTRegenHPfmt[] = "f"; char const GtRegenHPPerSptfmt[] = "f"; char const GtRegenMPPerSptfmt[] = "f"; char const Holidaysfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; -char const Itemfmt[] = "niiiiiii"; char const ItemBagFamilyfmt[] = "nxxxxxxxxxxxxxxxxx"; char const ItemDisplayTemplateEntryfmt[] = "nxxxxsxxxxxxxxxxxxxxxxxxx"; //char const ItemCondExtCostsEntryfmt[] = "xiii"; diff --git a/src/game/Globals/ObjectMgr.cpp b/src/game/Globals/ObjectMgr.cpp index 5fd95b9839..c82ad20e9c 100644 --- a/src/game/Globals/ObjectMgr.cpp +++ b/src/game/Globals/ObjectMgr.cpp @@ -1171,9 +1171,9 @@ void ObjectMgr::LoadEquipmentTemplates() if (!equipmentInfo.ItemEntry[i]) continue; - ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]); + const ItemTemplate* item = GetItemTemplate(equipmentInfo.ItemEntry[i]); - if (!dbcItem) + if (!item) { sLog->outErrorDb("Unknown item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u, forced to 0.", equipmentInfo.ItemEntry[i], i+1, entry); @@ -1181,15 +1181,15 @@ void ObjectMgr::LoadEquipmentTemplates() continue; } - if (dbcItem->InventoryType != INVTYPE_WEAPON && - dbcItem->InventoryType != INVTYPE_SHIELD && - dbcItem->InventoryType != INVTYPE_RANGED && - dbcItem->InventoryType != INVTYPE_2HWEAPON && - dbcItem->InventoryType != INVTYPE_WEAPONMAINHAND && - dbcItem->InventoryType != INVTYPE_WEAPONOFFHAND && - dbcItem->InventoryType != INVTYPE_HOLDABLE && - dbcItem->InventoryType != INVTYPE_THROWN && - dbcItem->InventoryType != INVTYPE_RANGEDRIGHT) + if (item->InventoryType != INVTYPE_WEAPON && + item->InventoryType != INVTYPE_SHIELD && + item->InventoryType != INVTYPE_RANGED && + item->InventoryType != INVTYPE_2HWEAPON && + item->InventoryType != INVTYPE_WEAPONMAINHAND && + item->InventoryType != INVTYPE_WEAPONOFFHAND && + item->InventoryType != INVTYPE_HOLDABLE && + item->InventoryType != INVTYPE_THROWN && + item->InventoryType != INVTYPE_RANGEDRIGHT) { sLog->outErrorDb("Item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u is not equipable in a hand, forced to 0.", equipmentInfo.ItemEntry[i], i+1, entry); @@ -2266,7 +2266,6 @@ void ObjectMgr::LoadItemTemplates() _itemTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; - bool enforceDBCAttributes = sWorld->getBoolConfig(CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES); do { @@ -2383,53 +2382,6 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.FlagsCu = fields[137].GetUInt32(); // Checks - - ItemEntry const* dbcitem = sItemStore.LookupEntry(entry); - - if (dbcitem) - { - if (itemTemplate.Class != dbcitem->Class) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct class %u, must be %u .", entry, itemTemplate.Class, dbcitem->Class); - if (enforceDBCAttributes) - itemTemplate.Class = dbcitem->Class; - } - - if (itemTemplate.SoundOverrideSubclass != dbcitem->SoundOverrideSubclass) - { - sLog->outError("Item (Entry: %u) does not have a correct SoundOverrideSubclass (%i), must be %i .", entry, itemTemplate.SoundOverrideSubclass, dbcitem->SoundOverrideSubclass); - if (enforceDBCAttributes) - itemTemplate.SoundOverrideSubclass = dbcitem->SoundOverrideSubclass; - } - if (itemTemplate.Material != dbcitem->Material) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct material (%i), must be %i .", entry, itemTemplate.Material, dbcitem->Material); - if (enforceDBCAttributes) - itemTemplate.Material = dbcitem->Material; - } - if (itemTemplate.InventoryType != dbcitem->InventoryType) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct inventory type (%u), must be %u .", entry, itemTemplate.InventoryType, dbcitem->InventoryType); - if (enforceDBCAttributes) - itemTemplate.InventoryType = dbcitem->InventoryType; - } - if (itemTemplate.DisplayInfoID != dbcitem->DisplayId) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct display id (%u), must be %u .", entry, itemTemplate.DisplayInfoID, dbcitem->DisplayId); - if (enforceDBCAttributes) - itemTemplate.DisplayInfoID = dbcitem->DisplayId; - } - if (itemTemplate.Sheath != dbcitem->Sheath) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", entry, itemTemplate.Sheath, dbcitem->Sheath); - if (enforceDBCAttributes) - itemTemplate.Sheath = dbcitem->Sheath; - } - - } - else - sLog->outErrorDb("Item (Entry: %u) does not exist in item.dbc! (not correct id?).", entry); - if (itemTemplate.Class >= MAX_ITEM_CLASS) { sLog->outErrorDb("Item (Entry: %u) has wrong Class value (%u)", entry, itemTemplate.Class); diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 8f57b8fc1e..8bf57153b9 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -4573,14 +4573,14 @@ void Spell::WriteAmmoToPacket(WorldPacket* data) { if (uint32 item_id = m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i)) { - if (ItemEntry const* itemEntry = sItemStore.LookupEntry(item_id)) + if (ItemTemplate const* itemEntry = sObjectMgr->GetItemTemplate(item_id)) { if (itemEntry->Class == ITEM_CLASS_WEAPON) { switch (itemEntry->SubClass) { case ITEM_SUBCLASS_WEAPON_THROWN: - ammoDisplayID = itemEntry->DisplayId; + ammoDisplayID = itemEntry->DisplayInfoID; ammoInventoryType = itemEntry->InventoryType; break; case ITEM_SUBCLASS_WEAPON_BOW: diff --git a/src/game/World/World.cpp b/src/game/World/World.cpp index 5e9c2392b1..3ec460da9e 100644 --- a/src/game/World/World.cpp +++ b/src/game/World/World.cpp @@ -1225,9 +1225,6 @@ void World::LoadConfigSettings(bool reload) // Dungeon finder m_int_configs[CONFIG_LFG_OPTIONSMASK] = sConfigMgr->GetIntDefault("DungeonFinder.OptionsMask", 3); - // DBC_ItemAttributes - m_bool_configs[CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES] = sConfigMgr->GetBoolDefault("DBC.EnforceItemAttributes", true); - // Max instances per hour m_int_configs[CONFIG_MAX_INSTANCES_PER_HOUR] = sConfigMgr->GetIntDefault("AccountInstancesPerHour", 5); diff --git a/src/game/World/World.h b/src/game/World/World.h index 58a14dd4d5..6408e0d2dd 100644 --- a/src/game/World/World.h +++ b/src/game/World/World.h @@ -148,7 +148,6 @@ enum WorldBoolConfigs CONFIG_AUTOBROADCAST, CONFIG_ALLOW_TICKETS, CONFIG_DELETE_CHARACTER_TICKET_TRACE, - CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES, CONFIG_PRESERVE_CUSTOM_CHANNELS, CONFIG_WINTERGRASP_ENABLE, CONFIG_PDUMP_NO_PATHS, diff --git a/src/worldserver/worldserver.conf.dist b/src/worldserver/worldserver.conf.dist index 5ad7a5bc3b..66fa7fb615 100644 --- a/src/worldserver/worldserver.conf.dist +++ b/src/worldserver/worldserver.conf.dist @@ -1434,16 +1434,6 @@ DeletedCharacterTicketTrace = 0 DungeonFinder.OptionsMask = 1 - -# -# DBC.EnforceItemAttributes -# Description: Disallow overriding item attributes stored in DBC files with values from the -# database. -# Default: 1 - (Enabled, Enforce DBC values) -# 0 - (Disabled, Use database values) - -DBC.EnforceItemAttributes = 1 - # # AccountInstancesPerHour # Description: Controls the max amount of different instances player can enter within hour |
