diff --git a/common/patches/laurion.cpp b/common/patches/laurion.cpp index feb38f6b3..e2b0911ea 100644 --- a/common/patches/laurion.cpp +++ b/common/patches/laurion.cpp @@ -2749,6 +2749,33 @@ namespace Laurion FINISH_ENCODE(); } + ENCODE(OP_ShopPlayerBuy) + { + ENCODE_LENGTH_EXACT(Merchant_Sell_Struct); + SETUP_DIRECT_ENCODE(Merchant_Sell_Struct, structs::Merchant_Sell_Response_Struct); + + OUT(npcid); + OUT(playerid); + OUT(itemslot); + OUT(quantity); + OUT(price); + + FINISH_ENCODE(); + } + + ENCODE(OP_ShopPlayerSell) + { + ENCODE_LENGTH_EXACT(Merchant_Purchase_Struct); + SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Response_Struct); + + OUT(npcid); + eq->inventory_slot = ServerToLaurionTypelessSlot(emu->itemslot, EQ::invtype::typePossessions); + OUT(quantity); + OUT(price); + + FINISH_ENCODE(); + } + ENCODE(OP_ShopRequest) { ENCODE_LENGTH_EXACT(MerchantClick_Struct); @@ -3671,6 +3698,31 @@ namespace Laurion FINISH_DIRECT_DECODE(); } + DECODE(OP_ShopPlayerBuy) + { + DECODE_LENGTH_EXACT(structs::Merchant_Sell_Request_Struct); + SETUP_DIRECT_DECODE(Merchant_Sell_Struct, structs::Merchant_Sell_Request_Struct); + + IN(npcid); + IN(playerid); + IN(itemslot); + IN(quantity); + + FINISH_DIRECT_DECODE(); + } + + DECODE(OP_ShopPlayerSell) + { + DECODE_LENGTH_EXACT(structs::Merchant_Purchase_Request_Struct); + SETUP_DIRECT_DECODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Request_Struct); + + IN(npcid); + emu->itemslot = LaurionToServerTypelessSlot(eq->inventory_slot, invtype::typePossessions); + IN(quantity); + + FINISH_DIRECT_DECODE(); + } + DECODE(OP_ShopRequest) { DECODE_LENGTH_EXACT(structs::MerchantClickRequest_Struct); diff --git a/common/patches/laurion_ops.h b/common/patches/laurion_ops.h index d665f8e1e..0fc174a11 100644 --- a/common/patches/laurion_ops.h +++ b/common/patches/laurion_ops.h @@ -48,6 +48,8 @@ E(OP_SendMaxCharacters) E(OP_SendMembership) E(OP_SendMembershipDetails) E(OP_SendZonepoints) +E(OP_ShopPlayerBuy) +E(OP_ShopPlayerSell) E(OP_ShopRequest) E(OP_SkillUpdate) E(OP_SpecialMesg) @@ -80,6 +82,8 @@ D(OP_GroupInvite2) D(OP_MoveItem) D(OP_RemoveBlockedBuffs) D(OP_SetServerFilter) +D(OP_ShopPlayerBuy) +D(OP_ShopPlayerSell) D(OP_ShopRequest) D(OP_SpawnAppearance) D(OP_TradeSkillCombine) diff --git a/common/patches/laurion_structs.h b/common/patches/laurion_structs.h index ddd75a7b9..637c6ff69 100644 --- a/common/patches/laurion_structs.h +++ b/common/patches/laurion_structs.h @@ -952,6 +952,43 @@ namespace Laurion { struct Disciplines_Struct { uint32 values[MAX_PP_DISCIPLINES]; }; + + struct Merchant_Sell_Request_Struct { + /*000*/ uint32 npcid; // Merchant NPC's entity id + /*004*/ uint32 playerid; // Player's entity id + /*008*/ uint32 itemslot; // Merchant Slot / Item Instance ID + /*012*/ uint32 unknown12; + /*016*/ uint32 quantity; // Already sold + /*020*/ + }; + + struct Merchant_Sell_Response_Struct { + /*000*/ uint32 npcid; // Merchant NPC's entity id + /*004*/ uint32 playerid; // Player's entity id + /*008*/ uint32 itemslot; // Merchant Slot / Item Instance ID + /*012*/ uint32 unknown12; + /*016*/ uint32 quantity; // Already sold + /*020*/ uint32 unknown20; + /*024*/ uint32 price; + /*028*/ uint32 unknown28; // Normally 0, but seen 84 c5 63 00 as well + /*032*/ + }; + + struct Merchant_Purchase_Request_Struct { + /*000*/ uint32 npcid; // Merchant NPC's entity id + /*004*/ TypelessInventorySlot_Struct inventory_slot; + /*012*/ uint32 quantity; + /*016*/ + }; + + struct Merchant_Purchase_Response_Struct { + /*000*/ uint32 npcid; // Merchant NPC's entity id + /*004*/ TypelessInventorySlot_Struct inventory_slot; + /*012*/ uint32 quantity; + /*016*/ uint32 price; + /*020*/ uint32 unknown020; + /*024*/ + }; #pragma pack() }; //end namespace structs diff --git a/utils/patches/patch_Laurion.conf b/utils/patches/patch_Laurion.conf index b89301765..1e81cbd27 100644 --- a/utils/patches/patch_Laurion.conf +++ b/utils/patches/patch_Laurion.conf @@ -463,16 +463,16 @@ OP_ItemVerifyReply=0x0000 OP_ItemAdvancedLoreText=0x0000 # merchant stuff -OP_ShopPlayerSell=0x0000 +OP_ShopPlayerSell=0x6489 OP_ShopRequest=0x840 OP_ShopEnd=0x74bb OP_ShopEndConfirm=0x2ed1 -OP_ShopPlayerBuy=0x0000 -OP_ShopDelItem=0x0000 -OP_ShopSendParcel=0x0000 -OP_ShopDeleteParcel=0x0000 -OP_ShopRetrieveParcel=0x0000 -OP_ShopParcelIcon=0x0000 +OP_ShopPlayerBuy=0x625e +OP_ShopDelItem=0x4ce4 +OP_ShopSendParcel=0x0f16 +OP_ShopDeleteParcel=0x4e2a +OP_ShopRetrieveParcel=0x27d1 +OP_ShopParcelIcon=0x4f27 # tradeskill stuff: OP_ClickObject=0x687e