aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/ItemHandler.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-03-17 01:53:14 +0100
committerShauren <shauren.trinity@gmail.com>2013-03-17 01:53:14 +0100
commita8aa684261529757c6fcf6dc3b71597754451858 (patch)
treed10549158b5a32d7b4ddeb45054b1c454de0ccea /src/server/game/Handlers/ItemHandler.cpp
parentdb0a0e73e41a51fbb0cb1c5b6c600ff9dcb64a7f (diff)
Core/DataStores: Implemented a generic way of sending db2 hotfixes
Diffstat (limited to 'src/server/game/Handlers/ItemHandler.cpp')
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp165
1 files changed, 0 insertions, 165 deletions
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 29af6fdc8f4..ef23c41690a 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -279,171 +279,6 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket& recvData)
_player->DestroyItem(bag, slot, true);
}
-void WorldSession::SendItemDb2Reply(uint32 entry)
-{
- WorldPacket data(SMSG_DB_REPLY, 44);
- ItemTemplate const* proto = sObjectMgr->GetItemTemplate(entry);
- if (!proto)
- {
- data << -int32(entry); // entry
- data << uint32(DB2_HASH_ITEM);
- data << uint32(time(NULL)); // hotfix date
- data << uint32(0); // size of next block
- return;
- }
-
- data << uint32(entry);
- data << uint32(DB2_HASH_ITEM);
- data << uint32(sObjectMgr->GetHotfixDate(entry, DB2_HASH_ITEM));
-
- ByteBuffer buff;
- buff << uint32(entry);
- buff << uint32(proto->Class);
- buff << uint32(proto->SubClass);
- buff << int32(proto->SoundOverrideSubclass);
- buff << uint32(proto->Material);
- buff << uint32(proto->DisplayInfoID);
- buff << uint32(proto->InventoryType);
- buff << uint32(proto->Sheath);
-
- data << uint32(buff.size());
- data.append(buff);
-
- SendPacket(&data);
-}
-
-void WorldSession::SendItemSparseDb2Reply(uint32 entry)
-{
- WorldPacket data(SMSG_DB_REPLY, 526);
- ItemTemplate const* proto = sObjectMgr->GetItemTemplate(entry);
- if (!proto)
- {
- data << -int32(entry); // entry
- data << uint32(DB2_HASH_ITEM_SPARSE);
- data << uint32(time(NULL)); // hotfix date
- data << uint32(0); // size of next block
- return;
- }
-
- data << uint32(entry);
- data << uint32(DB2_HASH_ITEM_SPARSE);
- data << uint32(sObjectMgr->GetHotfixDate(entry, DB2_HASH_ITEM_SPARSE));
-
- ByteBuffer buff;
- buff << uint32(entry);
- buff << uint32(proto->Quality);
- buff << uint32(proto->Flags);
- buff << uint32(proto->Flags2);
- buff << float(proto->Unk430_1);
- buff << float(proto->Unk430_2);
- buff << uint32(proto->BuyCount);
- buff << int32(proto->BuyPrice);
- buff << uint32(proto->SellPrice);
- buff << uint32(proto->InventoryType);
- buff << int32(proto->AllowableClass);
- buff << int32(proto->AllowableRace);
- buff << uint32(proto->ItemLevel);
- buff << uint32(proto->RequiredLevel);
- buff << uint32(proto->RequiredSkill);
- buff << uint32(proto->RequiredSkillRank);
- buff << uint32(proto->RequiredSpell);
- buff << uint32(proto->RequiredHonorRank);
- buff << uint32(proto->RequiredCityRank);
- buff << uint32(proto->RequiredReputationFaction);
- buff << uint32(proto->RequiredReputationRank);
- buff << int32(proto->MaxCount);
- buff << int32(proto->Stackable);
- buff << uint32(proto->ContainerSlots);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x)
- buff << uint32(proto->ItemStat[x].ItemStatType);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x)
- buff << int32(proto->ItemStat[x].ItemStatValue);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x)
- buff << int32(proto->ItemStat[x].ItemStatUnk1);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x)
- buff << int32(proto->ItemStat[x].ItemStatUnk2);
-
- buff << uint32(proto->ScalingStatDistribution);
- buff << uint32(proto->DamageType);
- buff << uint32(proto->Delay);
- buff << float(proto->RangedModRange);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buff << int32(proto->Spells[x].SpellId);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buff << uint32(proto->Spells[x].SpellTrigger);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buff << int32(proto->Spells[x].SpellCharges);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buff << int32(proto->Spells[x].SpellCooldown);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buff << uint32(proto->Spells[x].SpellCategory);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
- buff << int32(proto->Spells[x].SpellCategoryCooldown);
-
- buff << uint32(proto->Bonding);
-
- // item name
- std::string name = proto->Name1;
- buff << uint16(name.length());
- if (name.length())
- buff << name;
-
- for (uint32 i = 0; i < 3; ++i) // other 3 names
- buff << uint16(0);
-
- std::string desc = proto->Description;
- buff << uint16(desc.length());
- if (desc.length())
- buff << desc;
-
- buff << uint32(proto->PageText);
- buff << uint32(proto->LanguageID);
- buff << uint32(proto->PageMaterial);
- buff << uint32(proto->StartQuest);
- buff << uint32(proto->LockID);
- buff << int32(proto->Material);
- buff << uint32(proto->Sheath);
- buff << int32(proto->RandomProperty);
- buff << int32(proto->RandomSuffix);
- buff << uint32(proto->ItemSet);
-
- buff << uint32(proto->Area);
- buff << uint32(proto->Map);
- buff << uint32(proto->BagFamily);
- buff << uint32(proto->TotemCategory);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x)
- buff << uint32(proto->Socket[x].Color);
-
- for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x)
- buff << uint32(proto->Socket[x].Content);
-
- buff << uint32(proto->socketBonus);
- buff << uint32(proto->GemProperties);
- buff << float(proto->ArmorDamageModifier);
- buff << int32(proto->Duration);
- buff << uint32(proto->ItemLimitCategory);
- buff << uint32(proto->HolidayId);
- buff << float(proto->StatScalingFactor); // StatScalingFactor
- buff << uint32(proto->CurrencySubstitutionId);
- buff << uint32(proto->CurrencySubstitutionCount);
-
- data << uint32(buff.size());
- data.append(buff);
-
- SendPacket(&data);
-}
-
void WorldSession::HandleReadItem(WorldPacket& recvData)
{
uint8 bag, slot;