This issue keeps getting reported here and there over the years of Median, so I decided to make up a quick fix. As you may or may not know yet, the game experiences a display bug when you reach 32,768 life, mana or stamina. The display rolls over, leading to false & misleading display. Furthermore, in the case of mana, it causes problems when using spells (as the client skill handler checks the mana costs too, leading to uncastable spells). This library once injected into your game should allow you to reach up to 65k life/mana/stamina without experiencing any display overflow.
This fix will only work in single player, as it's a server<->client fix and cannot be applied to the realm. The plugin also comes with no injection method, use PlugY's dll loader feature. (If you don't know what I'm talking about, I won't bother to explain, would be nice if someone could write a quick tutorial to do this)
Enjoy.
Click Here To Download
For those that may be ineterested into implementing this, or fully expand the packet code to handle full values, or whatever, here are the places to patch. 6 places to patch. Changing the bits to read/write to 16 instead of 15 bits will allow values up to 65k to be displayed correctly. Expanding it beyond that requires completely rewriting both the sending & receiving code of the packet handlers (D2GS Srv2Clt Packet 0x95)
D2Game.dll (Base Address @ 0x6FC20000)
Code: Select all
6FCAB81A |. 6A 0F PUSH 0F ; bits to write
6FCAB81C |. 50 PUSH EAX ; value to write
6FCAB81D |. 8D4C24 18 LEA ECX,DWORD PTR SS:[ESP+18]
6FCAB821 |. 51 PUSH ECX ; pStream
6FCAB822 |. E8 A7EAF7FF CALL <JMP.&Fog.#10128> ; call Fog.WriteBitStream
Code: Select all
6FCAB82C |. 6A 0F PUSH 0F ; bits to write
6FCAB82E |. 52 PUSH EDX ; value to write
6FCAB82F |. 8D4424 18 LEA EAX,DWORD PTR SS:[ESP+18]
6FCAB833 |. 50 PUSH EAX ; pStream
6FCAB834 |. E8 95EAF7FF CALL <JMP.&Fog.#10128> ; call Fog.WriteBitStream
Code: Select all
6FCAB83E |. 6A 0F PUSH 0F ; bits to write
6FCAB840 |. 51 PUSH ECX ; value to write
6FCAB841 |. 8D5424 18 LEA EDX,DWORD PTR SS:[ESP+18]
6FCAB845 |. 52 PUSH EDX ; pStream
6FCAB846 |. E8 83EAF7FF CALL <JMP.&Fog.#10128> ; call Fog.WriteBitStream
D2Client.dll (Base Address @ 0x6FAB0000)
Code: Select all
6FB5C1CE 6A 0F PUSH 0F ; bits to read
6FB5C1D0 8D4424 04 LEA EAX,DWORD PTR SS:[ESP+4]
6FB5C1D4 50 PUSH EAX ; pStream
6FB5C1D5 E8 D6FDF5FF CALL <JMP.&Fog.#10130> ; call Fog.ReadBitStream
Code: Select all
6FB5C1DA 6A 0F PUSH 0F ; bits to read
6FB5C1DC 8D4C24 04 LEA ECX,DWORD PTR SS:[ESP+4]
6FB5C1E0 51 PUSH ECX ; pStream
6FB5C1E1 66:8946 01 MOV WORD PTR DS:[ESI+1],AX
6FB5C1E5 E8 C6FDF5FF CALL <JMP.&Fog.#10130> ; call Fog.ReadBitStream
Code: Select all
6FB5C1EA 6A 0F PUSH 0F ; bits to read
6FB5C1EC 8D5424 04 LEA EDX,DWORD PTR SS:[ESP+4]
6FB5C1F0 52 PUSH EDX ; pStream
6FB5C1F1 66:8946 03 MOV WORD PTR DS:[ESI+3],AX
6FB5C1F5 E8 B6FDF5FF CALL <JMP.&Fog.#10130> ; call Fog.ReadBitStream
D2Template patching sample source code (D2Patch.h)
Code: Select all
static const DLLPatchStrc gptTemplatePatches[] =
{
/*
All your patches should be added here
Keep it organized to save yourself some headache
*/
{D2DLL_D2GAME, 0x8B81B, 0x01, (DWORD)0x00000010, FALSE},
{D2DLL_D2GAME, 0x8B82D, 0x01, (DWORD)0x00000010, FALSE},
{D2DLL_D2GAME, 0x8B83F, 0x01, (DWORD)0x00000010, FALSE},
{D2DLL_D2CLIENT, 0xAC1CF, 0x01, (DWORD)0x00000010, FALSE},
{D2DLL_D2CLIENT, 0xAC1DB, 0x01, (DWORD)0x00000010, FALSE},
{D2DLL_D2CLIENT, 0xAC1EB, 0x01, (DWORD)0x00000010, FALSE},
{D2DLL_INVALID} // this must be the last entry in the array
};