mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[0114] Updated "item_template" Thanks Fabi Fix some DBC problems, some clean.
Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
parent
a6b1264405
commit
73ec9c2ce4
14 changed files with 170 additions and 348 deletions
|
|
@ -844,29 +844,29 @@ void ObjectMgr::LoadEquipmentTemplates()
|
|||
if (!eqInfo->equipentry[j])
|
||||
continue;
|
||||
|
||||
//ItemEntry const *dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]);
|
||||
ItemEntry const *dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]);
|
||||
|
||||
//if (!dbcitem)
|
||||
//{
|
||||
// sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i);
|
||||
// const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
|
||||
// continue;
|
||||
//}
|
||||
if (!dbcitem)
|
||||
{
|
||||
sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i);
|
||||
const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
|
||||
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 &&
|
||||
// dbcitem->InventoryType != INVTYPE_RELIC)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (entry=%u) in creature_equip_template.equipentry%u for entry = %u is not equipable in a hand, forced to 0.", eqInfo->equipentry[j], j+1, i);
|
||||
// const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
|
||||
//}
|
||||
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 &&
|
||||
dbcitem->InventoryType != INVTYPE_RELIC)
|
||||
{
|
||||
sLog.outErrorDb("Item (entry=%u) in creature_equip_template.equipentry%u for entry = %u is not equipable in a hand, forced to 0.", eqInfo->equipentry[j], j+1, i);
|
||||
const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1795,7 +1795,7 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
|
||||
{
|
||||
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype >(i);
|
||||
//ItemEntry const *dbcitem = sItemStore.LookupEntry(i);
|
||||
ItemEntry const *dbcitem = sItemStore.LookupEntry(i);
|
||||
if(!proto)
|
||||
{
|
||||
/* to many errors, and possible not all items really used in game
|
||||
|
|
@ -1805,13 +1805,13 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
continue;
|
||||
}
|
||||
|
||||
if(true/*dbcitem*/)
|
||||
if (dbcitem)
|
||||
{
|
||||
//if(proto->Class != dbcitem->Class)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct class %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class);
|
||||
// // It safe let use Class from DB
|
||||
//}
|
||||
if(proto->Class != dbcitem->Class)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct class %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class);
|
||||
// It safe let use Class from DB
|
||||
}
|
||||
/* disabled: have some strange wrong cases for Subclass values.
|
||||
for enable also uncomment Subclass field in ItemEntry structure and in Itemfmt[]
|
||||
if(proto->SubClass != dbcitem->SubClass)
|
||||
|
|
@ -1821,34 +1821,34 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
}
|
||||
*/
|
||||
|
||||
//if(proto->Unk0 != dbcitem->Unk0)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %i Unk0, must be %i (still using DB value).",i,proto->Unk0,dbcitem->Unk0);
|
||||
// // It safe let use Unk0 from DB
|
||||
//}
|
||||
if(proto->Unk0 != dbcitem->Unk0)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %i Unk0, must be %i (still using DB value).",i,proto->Unk0,dbcitem->Unk0);
|
||||
// It safe let use Unk0 from DB
|
||||
}
|
||||
|
||||
//if(proto->Material != dbcitem->Material)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %i material, must be %i (still using DB value).",i,proto->Material,dbcitem->Material);
|
||||
// // It safe let use Material from DB
|
||||
//}
|
||||
if(proto->Material != dbcitem->Material)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %i material, must be %i (still using DB value).",i,proto->Material,dbcitem->Material);
|
||||
// It safe let use Material from DB
|
||||
}
|
||||
|
||||
//if(proto->InventoryType != dbcitem->InventoryType)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %u inventory type, must be %u (still using DB value).",i,proto->InventoryType,dbcitem->InventoryType);
|
||||
// // It safe let use InventoryType from DB
|
||||
//}
|
||||
if(proto->InventoryType != dbcitem->InventoryType)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %u inventory type, must be %u (still using DB value).",i,proto->InventoryType,dbcitem->InventoryType);
|
||||
// It safe let use InventoryType from DB
|
||||
}
|
||||
|
||||
//if(proto->DisplayInfoID != dbcitem->DisplayId)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %u display id, must be %u (using it).",i,proto->DisplayInfoID,dbcitem->DisplayId);
|
||||
// const_cast<ItemPrototype*>(proto)->DisplayInfoID = dbcitem->DisplayId;
|
||||
//}
|
||||
//if(proto->Sheath != dbcitem->Sheath)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %u sheath, must be %u (using it).",i,proto->Sheath,dbcitem->Sheath);
|
||||
// const_cast<ItemPrototype*>(proto)->Sheath = dbcitem->Sheath;
|
||||
//}
|
||||
if(proto->DisplayInfoID != dbcitem->DisplayId)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %u display id, must be %u (using it).",i,proto->DisplayInfoID,dbcitem->DisplayId);
|
||||
const_cast<ItemPrototype*>(proto)->DisplayInfoID = dbcitem->DisplayId;
|
||||
}
|
||||
if(proto->Sheath != dbcitem->Sheath)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %u sheath, must be %u (using it).",i,proto->Sheath,dbcitem->Sheath);
|
||||
const_cast<ItemPrototype*>(proto)->Sheath = dbcitem->Sheath;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2018,12 +2018,6 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
}
|
||||
}
|
||||
|
||||
if (proto->StatsCount > MAX_ITEM_PROTO_STATS)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", i, proto->StatsCount, MAX_ITEM_PROTO_STATS);
|
||||
const_cast<ItemPrototype*>(proto)->StatsCount = MAX_ITEM_PROTO_STATS;
|
||||
}
|
||||
|
||||
for (int j = 0; j < MAX_ITEM_PROTO_STATS; ++j)
|
||||
{
|
||||
// for ItemStatValue != 0
|
||||
|
|
@ -2044,13 +2038,10 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < MAX_ITEM_PROTO_DAMAGES; ++j)
|
||||
if (proto->DamageType >= MAX_SPELL_SCHOOL)
|
||||
{
|
||||
if (proto->Damage[j].DamageType >= MAX_SPELL_SCHOOL)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) has wrong dmg_type%d (%u)", i, j + 1, proto->Damage[j].DamageType);
|
||||
const_cast<ItemPrototype*>(proto)->Damage[j].DamageType = 0;
|
||||
}
|
||||
sLog.outErrorDb("Item (Entry: %u) has wrong damagetype (%u)", i, proto->DamageType);
|
||||
const_cast<ItemPrototype*>(proto)->DamageType = 0;
|
||||
}
|
||||
|
||||
// special format
|
||||
|
|
@ -2219,15 +2210,15 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
continue;
|
||||
}
|
||||
|
||||
//if(BAG_FAMILY_MASK_CURRENCY_TOKENS & mask)
|
||||
//{
|
||||
// CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(proto->ItemId);
|
||||
// if(!ctEntry)
|
||||
// {
|
||||
// sLog.outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit",i);
|
||||
// const_cast<ItemPrototype*>(proto)->BagFamily &= ~mask;
|
||||
// }
|
||||
//}
|
||||
/*if(BAG_FAMILY_MASK_CURRENCY_TOKENS & mask)
|
||||
{
|
||||
CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(proto->ItemId);
|
||||
if(!ctEntry)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit",i);
|
||||
const_cast<ItemPrototype*>(proto)->BagFamily &= ~mask;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue