From ec3fc57bdb200fd82c246c7aa16eb3c7ab2cc6a7 Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Tue, 23 Apr 2024 22:08:31 +0100 Subject: [PATCH 1/2] Update 0x3E Seems to be incorrect: ``` void __fastcall ITEMS_UpdateClientStats( D2ClientStrc *pClient, D2UnitStrc *pItem, int32_t nPacketType, int32_t nStatID, int32_t nStatValue, int nParam) { uint32_t dwUnitId; // edx D2BitBufferStrc a1; // [esp+8h] [ebp-3Ch] BYREF char Src[34]; // [esp+1Ch] [ebp-28h] BYREF *(_DWORD *)Src = 0x3E; memset(&Src[4], 0, 30); BITMANIP_Initialize(&a1, (int)&Src[2], 32); if ( pItem ) dwUnitId = pItem->dwUnitId; else dwUnitId = -1; sub_53B0E0(&a1, dwUnitId); BITMANIP_Write(&a1, (_BYTE)nPacketType != 0, 1); BITMANIP_Write(&a1, nStatID, 9); sub_53B0E0(&a1, nStatValue); if ( (unsigned __int16)nParam >= 0x100u ) { BITMANIP_Write(&a1, 1, 1); BITMANIP_Write(&a1, (unsigned __int16)nParam, 16); } else { BITMANIP_Write(&a1, 0, 1); BITMANIP_Write(&a1, (unsigned __int16)nParam, 8); } Src[1] = BITMANIP_GetSize(&a1) + 2; D2GAME_PACKETS_SendPacket_6FC3C710(pClient, Src, 34u); } ``` --- src/data/1.14d/gs2client.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/1.14d/gs2client.json b/src/data/1.14d/gs2client.json index 327004f..07c9b94 100644 --- a/src/data/1.14d/gs2client.json +++ b/src/data/1.14d/gs2client.json @@ -456,11 +456,12 @@ "D2GS_UPDATEITEMSTATS" : { "PacketId" : "0x3E", "Description" : "", - "Size" : -1, + "Size" : 34, "Structure" : [ { "BYTE" : "PacketId" }, { "BYTE" : "nFullPacketSize" }, { "BYTE" : "StatBitStream[nFullPacketSize - 2]" } + { "BYTE" : "Padding[34 - nFullPacketSize]" } ] }, "D2GS_USESTACKABLEITEM" : { From 2d25476b7be8c34482d48d29dd792350bc20703d Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Tue, 23 Apr 2024 22:09:07 +0100 Subject: [PATCH 2/2] Update gs2client.json --- src/data/1.14d/gs2client.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/1.14d/gs2client.json b/src/data/1.14d/gs2client.json index 07c9b94..c5550f4 100644 --- a/src/data/1.14d/gs2client.json +++ b/src/data/1.14d/gs2client.json @@ -460,7 +460,7 @@ "Structure" : [ { "BYTE" : "PacketId" }, { "BYTE" : "nFullPacketSize" }, - { "BYTE" : "StatBitStream[nFullPacketSize - 2]" } + { "BYTE" : "StatBitStream[nFullPacketSize - 2]" }, { "BYTE" : "Padding[34 - nFullPacketSize]" } ] },