[1.13c] No equipment loss on death

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Post Reply
User avatar
jessedazebra
Junior Member
Paladin
Posts: 108
Joined: Sun Nov 11, 2012 9:46 am
Russia

[1.13c] No equipment loss on death

Post by jessedazebra » Wed Jan 23, 2019 7:10 pm

Hi everyone,

A while ago I found a great plugin which allows you not to lose your equipment when you die. But unfortunately it's been made only for 1.13d and 1.14d, so I asked author if there will be a port for 1.13c, so he replied "Highly unlikely", but gave me some hints on how to make it work.

So, I got it working and wanted to share this great thing with everyone. I take no credits of course, all code edits has been made by Snake, I only ported it to 1.13c.

Code: Select all

[1.13c] - D2Game.0x793FC

000793CF   8BC3             MOV EAX,EBX
000793D1   E8 4A06FDFF      CALL 00049A20
000793D6   50               PUSH EAX
000793D7   55               PUSH EBP
000793D8   E8 2F10F9FF      CALL 0000A40C
000793DD   8DB7 D0000000    LEA ESI,DWORD PTR DS:[EDI+D0]
000793E3   8BFD             MOV EDI,EBP
000793E5   E8 266D0600      CALL 000E0110
000793EA   6A 11            PUSH 11
000793EC   55               PUSH EBP
000793ED   E8 B010F9FF      CALL 0000A4A2
000793F2   6A 01            PUSH 1
000793F4   6A 07            PUSH 7
000793F6   55               PUSH EBP
000793F7   E8 CE0FF9FF      CALL 0000A3CA
000793FC   8B95 C8000000    MOV EDX,DWORD PTR SS:[EBP+C8]

Change

000793FC   8B95 C8000000    MOV EDX,DWORD PTR SS:[EBP+C8]

to

000793FC   E9 F6020000    JMP 000796F7
Image

User avatar
huohuowu2
Junior Member
Paladin
Posts: 144
Joined: Sat Feb 28, 2015 4:20 am
China

Re: [1.13c] No equipment loss on death

Post by huohuowu2 » Wed Jan 23, 2019 8:08 pm

nice man,thank you.
Are these codes easy to find at 1.10?

User avatar
jessedazebra
Junior Member
Paladin
Posts: 108
Joined: Sun Nov 11, 2012 9:46 am
Russia

Re: [1.13c] No equipment loss on death

Post by jessedazebra » Wed Jan 23, 2019 8:52 pm

huohuowu2 wrote:
Wed Jan 23, 2019 8:08 pm
nice man,thank you.
Are these codes easy to find at 1.10?
I don't know, they might even look different, I'm not sure. You need someone who works with 1.10, not a noob like me. :P
EDIT: Well, most likely it's what I was looking for:

Code: Select all

0004FEAE   8BCE             MOV ECX,ESI
0004FEB0   E8 2B3DFBFF      CALL 00003BE0
0004FEB5   50               PUSH EAX
0004FEB6   57               PUSH EDI
0004FEB7   E8 F2C20900      CALL 000EC1AE
0004FEBC   8D95 D0000000    LEA EDX,DWORD PTR SS:[EBP+D0]
0004FEC2   8BCF             MOV ECX,EDI
0004FEC4   E8 67B70300      CALL 0008B630
0004FEC9   6A 11            PUSH 11
0004FECB   57               PUSH EDI
0004FECC   E8 6DBA0900      CALL 000EB93E
0004FED1   6A 01            PUSH 1
0004FED3   6A 07            PUSH 7
0004FED5   57               PUSH EDI
0004FED6   E8 91B90900      CALL 000EB86C
0004FEDB   8B8F C4000000    MOV ECX,DWORD PTR DS:[EDI+C4]
And the next step is to find where to jump...
EDIT2: Anyway, I can't track where to jump. There's a lot of similar stuff. I think it should be near the code above, but I might be wrong.
You can try to find something similar to this (it's for 1.13c):

Code: Select all

000796F7   5F               POP EDI
000796F8   5E               POP ESI
000796F9   8BC5             MOV EAX,EBP
000796FB   5D               POP EBP
000796FC   5B               POP EBX
000796FD   83C4 18          ADD ESP,18
00079700   C2 1400          RETN 14
and jump onto #000796F7
Just try to use Search for -> Sequence of commands in olly
You can try to find sequence of:
ADD ESP,18
RETN 14
But it might look different in 1.10, who knows..
Image

User avatar
huohuowu2
Junior Member
Paladin
Posts: 144
Joined: Sat Feb 28, 2015 4:20 am
China

Re: [1.13c] No equipment loss on death

Post by huohuowu2 » Wed Jan 23, 2019 10:14 pm

you right.I find the codes.but don't know where to jump.

User avatar
jessedazebra
Junior Member
Paladin
Posts: 108
Joined: Sun Nov 11, 2012 9:46 am
Russia

Re: [1.13c] No equipment loss on death

Post by jessedazebra » Wed Jan 23, 2019 10:52 pm

huohuowu2 wrote:
Wed Jan 23, 2019 10:14 pm
you right.I find the codes.but don't know where to jump.
You can try to find it with the method I mentioned above. I'd suggest you to try every similar part of code and test it in the game, until you find the right one. I would test it myself, but I can't switch on 1.10.
Or maybe someone who has experience of modding 1.10 will tell you where to jump.
Image

User avatar
thaison
Dark Alliance Beta Test
Crusader
Posts: 81
Joined: Fri Apr 03, 2015 11:59 am
Location: Viet Nam
Vietnam

Re: [1.13c] No equipment loss on death

Post by thaison » Fri Jan 25, 2019 1:02 am

For 1.10:
[D2Game.dll - 0x4FBD0]

Origin:

Code: Select all

6FC7FBD0  /$ 81EC A4000000  SUB ESP,0A4
Change:

Code: Select all

6FC7FBD0     C2 0C00        RETN 0C
6FC7FBD3     90             NOP
6FC7FBD4     90             NOP
6FC7FBD5     90             NOP

FearedBliss
Posts: 76
Joined: Sat Oct 16, 2010 4:29 pm

Re: [1.13c] No equipment loss on death

Post by FearedBliss » Sun Jan 27, 2019 5:50 pm

@thaison I was gonna port it to 1.10f now haha but you beat me to it ;D. Thanks.

EDIT: I looked at your solution (Thaison) and it works fine. It's easier than the original solution since you are just returning immediately when the function is called rather than letting part of the code in that function run.

User avatar
prawn
Junior Member
Paladin
Posts: 108
Joined: Sat Oct 27, 2012 12:21 am
Great Britain

Re: [1.13c] No equipment loss on death

Post by prawn » Sun Jan 27, 2019 9:47 pm

thaison wrote:
Fri Jan 25, 2019 1:02 am
For 1.10:
[D2Game.dll - 0x4FBD0]

Origin:

Code: Select all

6FC7FBD0  /$ 81EC A4000000  SUB ESP,0A4
Change:

Code: Select all

6FC7FBD0     C2 0C00        RETN 0C
6FC7FBD3     90             NOP
6FC7FBD4     90             NOP
6FC7FBD5     90             NOP
Brilliant works like a charm! Thanks thaison and jessedazebra

updawg
Posts: 14
Joined: Thu Mar 08, 2012 3:28 pm

Re: [1.13c] No equipment loss on death

Post by updawg » Tue Jan 29, 2019 5:09 pm

Just to mention as I think this mod is implemented in Median XL and people have mentioned that there is a bug associated with this type of mod. Every time you die you have to rebind your equipment for item effects to actually work. Not sure if that is the case here but I thought I would mentioned it.

User avatar
csguak
Posts: 54
Joined: Fri Jul 06, 2012 7:15 am
Location: USA

Re: [1.13c] No equipment loss on death

Post by csguak » Mon Mar 11, 2019 7:31 am

Hello, thank you so much for this! Saves sooo much time in so many occasions.

However, is there anyway to remove the dead bodies? They are unclickable lol

Edit:
Kidpaddle's max corpse count doesn't fix the issue.
"Player Corpse - maximum or disable"

D2Game.dll - 79234 '[Increase the maximum]'

03B29234 83F8 0F CMP EAX,0F <----- 0F is 15 corpses max. I tried setting it to 0, but didn't work.

;Change the 0F to your new value

///

D2Game.dll - 79237 '[Disable corpses]'

03B29234 83F8 0F CMP EAX,0F
03B29237 76 13 JBE SHORT D2Game.03B2924C

TO

03B29234 83F8 0F CMP EAX,0F
03B29237 90 NOP
03B29238 90 NOP

;This disable corpses from spawning. (which will make gear drops like in hardcore by the way)

The new change is unaffected by the MAX Corpse count change.
Disabling corpse works, but it drops all gear on the field.

Our new corpse seems to be a special spawn.

User avatar
thaison
Dark Alliance Beta Test
Crusader
Posts: 81
Joined: Fri Apr 03, 2015 11:59 am
Location: Viet Nam
Vietnam

Re: [1.13c] No equipment loss on death

Post by thaison » Tue Mar 12, 2019 11:31 am

For 1.13c:
[D2Game.dll - 0x79210]

Origin:

Code: Select all

6FC99210     83EC 18        SUB ESP, 18
Change:

Code: Select all

6FC99210     C2 0C00        RETN 0C

Znich
Posts: 3
Joined: Tue Jan 08, 2019 8:09 am
Belarus

Re: [1.13c] No equipment loss on death

Post by Znich » Tue Mar 12, 2019 1:15 pm

My solution for 1.13c:

[D2Game.dll - 0x7922F]
Change to:

Code: Select all

6FC9922F             E9 C3040000            JMP 6FC996F7

User avatar
devurandom
Forum Regular
Angel
Posts: 793
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: [1.13c] No equipment loss on death

Post by devurandom » Tue Mar 12, 2019 9:02 pm

thaison wrote:
Tue Mar 12, 2019 11:31 am
For 1.13c:
[D2Game.dll - 0x79210]

Origin:

Code: Select all

6FC99210     83EC 18        SUB ESP, 18
Change:

Code: Select all

6FC99210     C2 0C00        RETN 0C
This would corrupt the stack

For 1.10 the function is __fastcall pushes 3 args to the stack and retn is 0x0C
For 1.13 the function is __stdcall pushes 5 args to the stack and retn is 0x14

Znich wrote:
Tue Mar 12, 2019 1:15 pm
My solution for 1.13c:

[D2Game.dll - 0x7922F]
Change to:

Code: Select all

6FC9922F             E9 C3040000            JMP 6FC996F7
This would corrupt the stack too, because the function overwritten has an argument pushed to the stack that's not handled.


The return type for 6FC99210 function [1.13c] is BOOL even though its not evaluated.

Both Methods do the same thing, pick one or the other. - Neither one has been tested against the equipment binding issue mentioned above by csguak.

[1.13c]

Method 1

Code: Select all

6FC99210    83EC 18     SUB ESP,18                    ; D2Game.6FC99210(guessed Arg1,Arg2,Arg3,Arg4,Arg5)
6FC99213    53          PUSH EBX
6FC99214    55          PUSH EBP

Change To:

6FC99210    31C0        XOR EAX,EAX                   ; D2Game.6FC99210(guessed Arg1,Arg2,Arg3,Arg4,Arg5)
6FC99212    C2 1400     RETN 14

Method 2

Code: Select all

6FC99237    76 13       JBE SHORT 6FC9924C

Change To:

6FC99237    EB 08       JMP SHORT 6FC99241
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

fty
Posts: 8
Joined: Thu Aug 19, 2010 8:34 am

Re: [1.13c] No equipment loss on death

Post by fty » Sat May 04, 2019 7:32 pm

devurandom wrote:
Tue Mar 12, 2019 9:02 pm
Both Methods do the same thing, pick one or the other. - Neither one has been tested against the equipment binding issue mentioned above by csguak.

[1.13c]

Method 1

Code: Select all

6FC99210    83EC 18     SUB ESP,18                    ; D2Game.6FC99210(guessed Arg1,Arg2,Arg3,Arg4,Arg5)
6FC99213    53          PUSH EBX
6FC99214    55          PUSH EBP

Change To:

6FC99210    31C0        XOR EAX,EAX                   ; D2Game.6FC99210(guessed Arg1,Arg2,Arg3,Arg4,Arg5)
6FC99212    C2 1400     RETN 14

Method 2

Code: Select all

6FC99237    76 13       JBE SHORT 6FC9924C

Change To:

6FC99237    EB 08       JMP SHORT 6FC99241
Just tried Method 2. Works like a charm. Thank you very much! :beer:

User avatar
b1n
Posts: 58
Joined: Mon Jul 18, 2016 10:55 pm
Contact:

Re: [1.13c] No equipment loss on death

Post by b1n » Tue Sep 10, 2019 5:17 am

Someone tested the equipament binding issue mentioned by updawg ?
I would like this feature to work like this: no equipaments on the dead body, but you can recover exp and maybe your gold by getting your body back
b1n

User avatar
csguak
Posts: 54
Joined: Fri Jul 06, 2012 7:15 am
Location: USA

Re: [1.13c] No equipment loss on death

Post by csguak » Thu Sep 12, 2019 4:57 am

b1n wrote:
Tue Sep 10, 2019 5:17 am
no equipaments on the dead body, but you can recover exp and maybe your gold by getting your body back
What a great suggestion! I would love this too. Because right now, the body just disappear into thin air...(method 2)

Post Reply

Return to “Code Editing”