Rebase resync

This commit is contained in:
Antz 2020-02-17 09:19:44 +00:00
parent a0797532e8
commit 1997c1e903
3106 changed files with 11118 additions and 627576 deletions

View file

@ -1,4 +1,4 @@
/*
/**
* This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
*
* This program is free software; you can redistribute it and/or modify
@ -865,29 +865,28 @@ void ObjectMgr::LoadEquipmentTemplates()
for (uint8 j = 0; j < 3; ++j)
{
if (!eqInfo->equipentry[j])
continue;
ItemEntry const *dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]);
continue;
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);
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)
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);
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;
}
}
@ -1815,8 +1814,8 @@ void ObjectMgr::LoadItemPrototypes()
for (uint32 i = 1; i < sItemStorage.GetMaxEntry(); ++i)
{
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype >(i);
ItemEntry const *dbcitem = sItemStore.LookupEntry(i);
if(!proto)
ItemEntry const* dbcitem = sItemStore.LookupEntry(i);
if (!proto)
{
/* to many errors, and possible not all items really used in game
if (dbcitem)
@ -1827,9 +1826,9 @@ void ObjectMgr::LoadItemPrototypes()
if (dbcitem)
{
if(proto->Class != dbcitem->Class)
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);
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.
@ -1841,32 +1840,32 @@ void ObjectMgr::LoadItemPrototypes()
}
*/
if(proto->Unk0 != dbcitem->Unk0)
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);
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)
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);
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)
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);
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)
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);
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)
if (proto->Sheath != dbcitem->Sheath)
{
sLog.outErrorDb("Item (Entry: %u) not correct %u sheath, must be %u (using it).",i,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;
}
}
@ -9061,9 +9060,9 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates)
}
++count;
}
while (result->NextRow());
delete result;
sLog.outString();
@ -9144,15 +9143,16 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
vList.AddItem(item_id, type, maxcount, incrtime, ExtendedCost, conditionId);
++count;
}
while (result->NextRow());
delete result;
sLog.outString();
sLog.outString(">> Loaded %u vendor %sitems", count, isTemplates ? "template " : "");
}
void ObjectMgr::LoadVendorTemplates()
{
LoadVendors("npc_vendor_template", true);
@ -9183,7 +9183,6 @@ void ObjectMgr::LoadVendorTemplates()
void ObjectMgr::LoadNpcGossips()
{
m_mCacheNpcTextIdMap.clear();
QueryResult* result = WorldDatabase.Query("SELECT npc_guid, textid FROM npc_gossip");
@ -9224,9 +9223,9 @@ void ObjectMgr::LoadNpcGossips()
m_mCacheNpcTextIdMap[guid] = textid ;
++count;
}
while (result->NextRow());
delete result;
sLog.outString();
@ -9480,6 +9479,7 @@ void ObjectMgr::LoadGossipMenuItems(std::set<uint32>& gossipScriptSet)
m_mGossipMenuItemsMap.insert(GossipMenuItemsMap::value_type(gMenuItem.menu_id, gMenuItem));
++count;
}
while (result->NextRow());