diff options
author | Shauren <shauren.trinity@gmail.com> | 2015-03-22 12:40:02 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2015-03-22 12:40:02 +0100 |
commit | 87afdc7101ed869ab3a742b9a63d6e8cf436d7c5 (patch) | |
tree | a14e3d67dcab37d8388b2726fd0773fb68393d9f /src | |
parent | 8e48ef7863c5018aa185913ce6a616e46ef5b17e (diff) |
Core/PacketIO: Restored missing code in Player::SendEquipError
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Item/Item.h | 6 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 46 | ||||
-rw-r--r-- | src/server/game/Server/Packets/ItemPackets.cpp | 13 |
3 files changed, 50 insertions, 15 deletions
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 8514643cfad..810bbdac704 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -119,8 +119,9 @@ enum InventoryResult EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, // You can't do that while in an arena match EQUIP_ERR_TRADE_BOUND_ITEM = 79, // You can't trade a soulbound item. EQUIP_ERR_CANT_EQUIP_RATING = 80, // You don't have the personal, team, or battleground rating required to buy that item - EQUIP_ERR_NO_OUTPUT = 81, + EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81, EQUIP_ERR_NOT_SAME_ACCOUNT = 82, // Account-bound items can only be given to your own characters. + EQUIP_ERR_NO_OUTPUT = 83, EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 84, // You can only carry %d %s EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 85, // You can only equip %d |4item:items in the %s category EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, // Your level is too high to use that item @@ -131,6 +132,9 @@ enum InventoryResult EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 91, // Your inventory is full. Your satchel has been delivered to your mailbox. EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 92, // Your level is too low to use that item EQUIP_ERR_CANT_BUY_QUANTITY = 93, // You can't buy the specified quantity of that item. + EQUIP_ERR_ITEM_IS_BATTLE_PAY_LOCKED = 94, // Your purchased item is still waiting to be unlocked + EQUIP_ERR_REAGENT_BANK_FULL = 95, // Your reagent bank is full + EQUIP_ERR_REAGENT_BANK_LOCKED = 96 }; enum BuyResult diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0f5a36e14b4..98945400ded 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12898,21 +12898,43 @@ void Player::SendEquipError(InventoryResult msg, Item* item1 /*= nullptr*/, Item WorldPackets::Item::InventoryChangeFailure failure; failure.BagResult = msg; - if (item1) + if (msg != EQUIP_ERR_OK) { - failure.Item[0] = item1->GetGUID(); - failure.Level = uint32(item1->GetRequiredLevel()); - } + if (item1) + failure.Item[0] = item1->GetGUID(); + + if (item2) + failure.Item[1] = item2->GetGUID(); - if (item2) - failure.Item[1] = item2->GetGUID(); + failure.ContainerBSlot = 0; // bag equip slot, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 - /// @todo: fill remaining values: - /// ContainerBSlot - /// SrcContainer - /// DstContainer - /// SrcSlot - /// LimitCategory + switch (msg) + { + case EQUIP_ERR_CANT_EQUIP_LEVEL_I: + case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW: + { + failure.Level = uint32(item1 ? item1->GetRequiredLevel() : 0); + break; + } + case EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM: // no idea about this one... + { + //failure.SrcContainer + //failure.SrcSlot + //failure.DstContainer + break; + } + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS: + { + ItemTemplate const* proto = item1 ? item1->GetTemplate() : sObjectMgr->GetItemTemplate(itemId); + failure.LimitCategory = proto ? proto->GetItemLimitCategory() : 0; + break; + } + default: + break; + } + } SendDirectMessage(failure.Write()); } diff --git a/src/server/game/Server/Packets/ItemPackets.cpp b/src/server/game/Server/Packets/ItemPackets.cpp index e9a0c213aee..57620737190 100644 --- a/src/server/game/Server/Packets/ItemPackets.cpp +++ b/src/server/game/Server/Packets/ItemPackets.cpp @@ -208,7 +208,7 @@ WorldPacket const* WorldPackets::Item::InventoryChangeFailure::Write() _worldPacket << int8(BagResult); _worldPacket << Item[0]; _worldPacket << Item[1]; - _worldPacket << uint8(ContainerBSlot); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 + _worldPacket << uint8(ContainerBSlot); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_WRONG_BAG_TYPE_2 switch (BagResult) { @@ -216,7 +216,16 @@ WorldPacket const* WorldPackets::Item::InventoryChangeFailure::Write() case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW: _worldPacket << int32(Level); break; - /// @todo: add more cases + case EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM: + _worldPacket << SrcContainer; + _worldPacket << int32(SrcSlot); + _worldPacket << DstContainer; + break; + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS: + _worldPacket << int32(LimitCategory); + break; default: break; } |