Kyromyr/D2DropFilter

Game version?

Opened this issue · 3 comments

Hey this looks pretty similar to what I want to do. I'm trying to log all the items that drop. What version of the game are your memory addresses for? Like D2PTR(D2CLIENT, D2CLIENT_6FB09087, 0x59087).

I guess I can go check that address in 1.14d (but I'm on my phone right now, lol wow I'm lazy). Anyways if it isn't for 1.14d could you post some of the asm for that function so I know what to search for?

This is for 1.13c. The asm you're looking for looks like this:

D2Client.dll+5907E - 83 3E 04 - cmp dword ptr [esi],04 { 4 }
D2Client.dll+59081 - 0F85 92030000 - jne D2Client.dll+59419
D2Client.dll+59087 - 83 FD 20 - cmp ebp,20 { 32 }
D2Client.dll+5908A - 0F8D 89030000 - jnl D2Client.dll+59419
D2Client.dll+59090 - 8B 44 24 48 - mov eax,[esp+48]
D2Client.dll+59094 - 8D 6C ED 00 - lea ebp,[ebp+ebp*8+00]
D2Client.dll+59098 - C1 E5 05 - shl ebp,05 { 5 }
D2Client.dll+5909B - 81 C5 F8FEFA04 - add ebp,D2Client.dll+11FEF8 { [00000000] }

Hmm, I wonder if they used a different compiler in 1.14. They did combine a bunch of the DLLs into one Game.exe module.

I wasn't able to find much of those instructions strung together anywhere. For example there was no "shl ebp,05" anywhere in Game.exe.

Ah well. Did you find this snippet yourself? Any recollection of how? I don't need to filter items out, I really just need to hook anywhere that I could get a reference to the item that's being generated/dropped.

Thanks for the quick reply.

I did not find this, no. The original DropFilter was made by Whist and I modified it to suit my needs.

For recording drops, you could iterate over all items in range of the client and check if they have the NEWITEM2 flag set. If you're familiar with AutoIt3 you can look at how I implemented the D2Stats drop notifier.

Drop notifier: https://github.com/Kyromyr/D2Stats/blob/master/D2Stats.au3#L806
Item flags: https://d2mods.info/forum/viewtopic.php?t=28187