aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIntel <chemicstry@gmail.com>2014-11-27 13:44:51 +0200
committerIntel <chemicstry@gmail.com>2014-11-27 13:45:05 +0200
commit60de2169a90c74e0fccfc6a9ec518b98c5c7260c (patch)
tree2b5b404f390cdfc36367ce4679992662a3d4c846
parent708e36c920cb337eb39b020937d417b02a37d4a8 (diff)
Core/Packets: Fixed Item.db2 and Item-sparse.db2 query replies
-rw-r--r--src/server/game/DataStores/DB2Utility.cpp44
-rw-r--r--src/server/game/Entities/Item/ItemPrototype.h6
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp3
-rw-r--r--src/server/game/Handlers/QueryHandler.cpp3
4 files changed, 22 insertions, 34 deletions
diff --git a/src/server/game/DataStores/DB2Utility.cpp b/src/server/game/DataStores/DB2Utility.cpp
index 37b7fb949db..a835547b640 100644
--- a/src/server/game/DataStores/DB2Utility.cpp
+++ b/src/server/game/DataStores/DB2Utility.cpp
@@ -42,15 +42,15 @@ void DB2Utilities::WriteItemDbReply(DB2Storage<ItemEntry> const& /*store*/, uint
buffer << uint32(proto->Class);
buffer << uint32(proto->SubClass);
buffer << int32(proto->SoundOverrideSubclass);
- buffer << uint32(proto->Material);
- buffer << uint32(proto->DisplayInfoID);
+ buffer << int32(proto->Material);
buffer << uint32(proto->InventoryType);
buffer << uint32(proto->Sheath);
+ buffer << uint32(proto->FileDataID);
+ buffer << uint32(proto->GroupSoundsID);
}
void DB2Utilities::WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& /*store*/, uint32 id, uint32 locale, ByteBuffer& buffer)
{
- /* TODO: 6.x update
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(id);
ASSERT(proto);
@@ -58,10 +58,12 @@ void DB2Utilities::WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& /*s
buffer << uint32(proto->ItemId);
buffer << uint32(proto->Quality);
- buffer << uint32(proto->Flags);
- buffer << uint32(proto->Flags2);
- buffer << float(proto->Unk430_1);
- buffer << float(proto->Unk430_2);
+
+ for (uint32 i = 0; i < MAX_ITEM_PROTO_FLAGS; ++i)
+ buffer << uint32(proto->Flags[i]);
+
+ buffer << float(proto->Unk1);
+ buffer << float(proto->Unk2);
buffer << uint32(proto->BuyCount);
buffer << int32(proto->BuyPrice);
buffer << uint32(proto->SellPrice);
@@ -97,25 +99,6 @@ void DB2Utilities::WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& /*s
buffer << uint32(proto->DamageType);
buffer << uint32(proto->Delay);
buffer << float(proto->RangedModRange);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buffer << int32(proto->Spells[x].SpellId);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buffer << uint32(proto->Spells[x].SpellTrigger);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buffer << int32(proto->Spells[x].SpellCharges);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buffer << int32(proto->Spells[x].SpellCooldown);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buffer << uint32(proto->Spells[x].SpellCategory);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buffer << int32(proto->Spells[x].SpellCategoryCooldown);
-
buffer << uint32(proto->Bonding);
// item name
@@ -145,8 +128,8 @@ void DB2Utilities::WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& /*s
buffer << uint32(proto->LockID);
buffer << int32(proto->Material);
buffer << uint32(proto->Sheath);
- buffer << int32(proto->RandomProperty);
- buffer << int32(proto->RandomSuffix);
+ buffer << uint32(proto->RandomProperty);
+ buffer << uint32(proto->RandomSuffix);
buffer << uint32(proto->ItemSet);
buffer << uint32(proto->Area);
@@ -157,9 +140,6 @@ void DB2Utilities::WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& /*s
for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x)
buffer << uint32(proto->Socket[x].Color);
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x)
- buffer << uint32(proto->Socket[x].Content);
-
buffer << uint32(proto->socketBonus);
buffer << uint32(proto->GemProperties);
buffer << float(proto->ArmorDamageModifier);
@@ -169,5 +149,5 @@ void DB2Utilities::WriteItemSparseDbReply(DB2Storage<ItemSparseEntry> const& /*s
buffer << float(proto->StatScalingFactor); // StatScalingFactor
buffer << uint32(proto->CurrencySubstitutionId);
buffer << uint32(proto->CurrencySubstitutionCount);
- */
+ buffer << uint32(proto->ItemNameDescriptionID);
}
diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h
index e28e8a21678..fe6051b4f9c 100644
--- a/src/server/game/Entities/Item/ItemPrototype.h
+++ b/src/server/game/Entities/Item/ItemPrototype.h
@@ -611,6 +611,7 @@ struct ItemEffect
#pragma pack(pop)
#endif
+#define MAX_ITEM_PROTO_FLAGS 3
#define MAX_ITEM_PROTO_DAMAGES 2 // changed in 3.1.0
#define MAX_ITEM_PROTO_SOCKETS 3
#define MAX_ITEM_PROTO_STATS 10
@@ -623,8 +624,10 @@ struct ItemTemplate
int32 SoundOverrideSubclass; // < 0: id from ItemSubClass.dbc, used to override weapon sound from actual SubClass
std::string Name1;
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
+ uint32 FileDataID;
+ uint32 GroupSoundsID;
uint32 Quality;
- uint32 Flags[3];
+ uint32 Flags[MAX_ITEM_PROTO_FLAGS];
float Unk1;
float Unk2;
uint32 BuyCount;
@@ -678,6 +681,7 @@ struct ItemTemplate
float StatScalingFactor;
uint32 CurrencySubstitutionId; // May be used instead of a currency
uint32 CurrencySubstitutionCount;
+ uint32 ItemNameDescriptionID;
// extra fields, not part of db2 files
float DamageMin;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 52cc9fec2bd..1dca8e91562 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2509,6 +2509,8 @@ void ObjectMgr::LoadItemTemplates()
itemTemplate.SoundOverrideSubclass = db2Data->SoundOverrideSubclass;
itemTemplate.Name1 = sparse->Name->Str[sWorld->GetDefaultDbcLocale()];
itemTemplate.DisplayInfoID = GetItemDisplayID(db2Data->FileDataID);
+ itemTemplate.FileDataID = db2Data->FileDataID;
+ itemTemplate.GroupSoundsID = db2Data->GroupSoundsID;
itemTemplate.Quality = sparse->Quality;
memcpy(itemTemplate.Flags, sparse->Flags, sizeof(itemTemplate.Flags));
itemTemplate.Unk1 = sparse->Unk1;
@@ -2587,6 +2589,7 @@ void ObjectMgr::LoadItemTemplates()
itemTemplate.StatScalingFactor = sparse->StatScalingFactor;
itemTemplate.CurrencySubstitutionId = sparse->CurrencySubstitutionID;
itemTemplate.CurrencySubstitutionCount = sparse->CurrencySubstitutionCount;
+ itemTemplate.ItemNameDescriptionID = sparse->ItemNameDescriptionID;
itemTemplate.ScriptId = 0;
itemTemplate.FoodType = 0;
itemTemplate.MinMoneyLoot = 0;
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index 6cb1bfe15bc..81dc9e6cec0 100644
--- a/src/server/game/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -437,7 +437,7 @@ void WorldSession::HandleDBQueryBulk(WorldPackets::Query::DBQueryBulk& packet)
DB2StorageBase const* store = GetDB2Storage(packet.TableHash);
if (!store)
{
- TC_LOG_ERROR("network", "CMSG_REQUEST_HOTFIX: Received unknown hotfix type: %u", packet.TableHash);
+ TC_LOG_ERROR("network", "CMSG_DB_QUERY_BULK: Received unknown hotfix type: %u", packet.TableHash);
return;
}
@@ -455,6 +455,7 @@ void WorldSession::HandleDBQueryBulk(WorldPackets::Query::DBQueryBulk& packet)
}
else
{
+ TC_LOG_ERROR("network", "CMSG_DB_QUERY_BULK: Entry %u does not exist in datastore: %u", rec.RecordID, packet.TableHash);
response.RecordID = -rec.RecordID;
response.Timestamp = time(NULL);
}