aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Item/Item.h24
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp4
-rwxr-xr-xsrc/server/game/Handlers/ItemHandler.cpp16
3 files changed, 25 insertions, 19 deletions
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index 2f9d10bb9d5..64b74539727 100755
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -164,14 +164,15 @@ enum EnchantmentSlot
PRISMATIC_ENCHANTMENT_SLOT = 6, // added at apply special permanent enchantment
//TODO: 7,
//TODO: 8,
- MAX_INSPECTED_ENCHANTMENT_SLOT = 9,
-
- PROP_ENCHANTMENT_SLOT_0 = 7, // used with RandomSuffix
- PROP_ENCHANTMENT_SLOT_1 = 8, // used with RandomSuffix
- PROP_ENCHANTMENT_SLOT_2 = 9, // used with RandomSuffix and RandomProperty
- PROP_ENCHANTMENT_SLOT_3 = 10, // used with RandomProperty
- PROP_ENCHANTMENT_SLOT_4 = 11, // used with RandomProperty
- MAX_ENCHANTMENT_SLOT = 12
+ TRANSMOGRIFY_ENCHANTMENT_SLOT = 9,
+ MAX_INSPECTED_ENCHANTMENT_SLOT = 10,
+
+ PROP_ENCHANTMENT_SLOT_0 = 10, // used with RandomSuffix
+ PROP_ENCHANTMENT_SLOT_1 = 11, // used with RandomSuffix
+ PROP_ENCHANTMENT_SLOT_2 = 12, // used with RandomSuffix and RandomProperty
+ PROP_ENCHANTMENT_SLOT_3 = 13, // used with RandomProperty
+ PROP_ENCHANTMENT_SLOT_4 = 14, // used with RandomProperty
+ MAX_ENCHANTMENT_SLOT = 15
};
#define MAX_VISIBLE_ITEM_OFFSET 2 // 2 fields per visible item (entry+enchantment)
@@ -350,6 +351,13 @@ class Item : public Object
bool CanTransmogrify() const;
static bool CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* transmogrifier);
+ uint32 GetVisibleEntry() const
+ {
+ if (uint32 transmogrification = GetEnchantmentId(TRANSMOGRIFY_ENCHANTMENT_SLOT))
+ return transmogrification;
+ return GetEntry();
+ }
+
private:
std::string m_text;
uint8 m_slot;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index f3375fb115e..f729fe1502f 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -12357,7 +12357,7 @@ void Player::SetVisibleItemSlot(uint8 slot, Item* pItem)
{
if (pItem)
{
- SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry());
+ SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetVisibleEntry());
SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, pItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT));
SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, pItem->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT));
}
@@ -25717,7 +25717,7 @@ uint8 Player::AddVoidStorageItem(const VoidStorageItem& item)
GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL);
return -1;
}
-
+
_voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemEntry,
item.CreatorGuid, item.ItemRandomPropertyId, item.ItemSuffixFactor);
return slot;
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 0b21363a783..b36ca5853cf 100755
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -746,7 +746,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
VendorItemData const* vendorItems = vendor->GetVendorItems();
uint8 rawItemCount = vendorItems ? vendorItems->GetItemCount() : 0;
- //if (rawItemCount > 300),
+ //if (rawItemCount > 300),
// rawItemCount = 300; // client cap but uint8 max value is 255
ByteBuffer itemsData(32 * rawItemCount);
@@ -783,7 +783,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
if (leftInStock == 0)
continue;
}
-
+
int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0;
uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem);
@@ -1464,7 +1464,6 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData)
Player* player = GetPlayer();
// Read data
-
uint32 count = recvData.ReadBits(22);
if (count < EQUIPMENT_SLOT_START || count >= EQUIPMENT_SLOT_END)
@@ -1477,7 +1476,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData)
ObjectGuid* itemGuids = new ObjectGuid[count];
uint32* newEntries = new uint32[count];
uint32* slots = new uint32[count];
-
+
for (uint8 i = 0; i < count; ++i)
{
itemGuids[i][0] = recvData.ReadBit();
@@ -1592,8 +1591,8 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData)
if (!newEntries[i]) // reset look
{
- player->SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slots[i] * 2), itemTransmogrified->GetEntry());
- itemTransmogrified->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_10_1, 0);
+ itemTransmogrified->ClearEnchantment(TRANSMOGRIFY_ENCHANTMENT_SLOT);
+ player->SetVisibleItemSlot(slots[i], itemTransmogrified);
}
else
{
@@ -1604,9 +1603,8 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData)
}
// All okay, proceed
-
- player->SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slots[i] * 2), newEntries[i]);
- itemTransmogrified->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_10_1, newEntries[i]);
+ itemTransmogrified->SetEnchantment(TRANSMOGRIFY_ENCHANTMENT_SLOT, newEntries[i], 0, 0);
+ player->SetVisibleItemSlot(slots[i], itemTransmogrified);
itemTransmogrified->UpdatePlayedTime(player);