1.14d Remove Experience Penalties

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

1
100%
 
Total votes: 1

User avatar
Wissle
Posts: 7
Joined: Tue Nov 04, 2008 4:17 pm

1.14d Remove Experience Penalties

Post by Wissle » Thu Jul 20, 2017 3:46 pm

I was looking for the code to remove the experience penalties for killing monsters that are based on character and monster level following the information here viewtopic.php?t=16356

I found the following code (File Offset 17E2F0)
(Here's a side by side comparison, you can skip all the code blocks here if you want
https://www.diffchecker.com/vKCkOp5y )

[code]
Executable modules, item 1
Base = 00400000 (main)
Name = Game
File version = 1.14.3.71
Path = Game.exe

CPU Disasm
Address Hex dump Command Comments
0057E2F0 /$ 56 PUSH ESI
0057E2F1 |. 8BF0 MOV ESI,EAX
0057E2F3 |. 3BF2 CMP ESI,EDX ; ESI= mlvl, EDX= clvl
0057E2F5 7F 27 JG SHORT 0057E31E ; Jump if mlvl > clvl
0057E2F7 |. 2BD6 SUB EDX,ESI
0057E2F9 |. 83FA 0B CMP EDX,0B
0057E2FC |. 7C 05 JL SHORT 0057E303
0057E2FE |. BA 0A000000 MOV EDX,0A
0057E303 8B1495 68166E00 MOV EDX,DWORD PTR DS:[EDX*4+6E1668]
0057E30A 81FA 00010000 CMP EDX,100 ; Compare XP rate read from table to 100 (dec 256)
0057E310 |. /74 32 JE SHORT 0057E344 ; If equal, jump out of here, apply no penalty
0057E312 |. 68 00010000 PUSH 100 ; Arg1 = 100
0057E317 |. E8 4450F0FF CALL 00483360
0057E31C |. 5E POP ESI
0057E31D |. C3 RETN
0057E31E 83FA 19 CMP EDX,19 ; LVL 25 check
0057E321 7C 0C JL SHORT 0057E32F
0057E323 |. 85F6 TEST ESI,ESI
0057E325 |. 7E 08 JLE SHORT 0057E32F
0057E327 |. 56 PUSH ESI ; /Arg1 => ARG.EAX
0057E328 |. E8 3350F0FF CALL 00483360 ; \Game.00483360
0057E32D |. 5E POP ESI
0057E32E |. C3 RETN
0057E32F |> 2BF2 SUB ESI,EDX
0057E331 |. 83FE 0B CMP ESI,0B
0057E334 |. 7C 05 JL SHORT 0057E33B
0057E336 |. BE 0A000000 MOV ESI,0A
0057E33B 8B14B5 94166E00 MOV EDX,DWORD PTR DS:[ESI*4+6E1694]
0057E342 |.^ EB C6 JMP SHORT 0057E30A
0057E344 |> 8BC1 MOV EAX,ECX
0057E346 |. 5E POP ESI
0057E347 \. C3 RETN
[/code]


I'm thinking to change this I would just change two of these jumps to ignore the penalty code like this

[code]
Address Hex dump Command Comments
0057E2F5 7F 27 JG SHORT 0057E31E ; Jump if mlvl > clvl
->
0057E2F5 90 NOP ; Never jump, ignore levels
0057E2F6 90 NOP

Address Hex dump Command Comments
0057E310 |. /74 32 JE SHORT 0057E344 ; If equal, jump out of here, apply no penalty
->
0057E310 EB 32 JMP SHORT 0057E344 ; ALWAYS jump out of here, apply no penalty
[/code]

Which would make the full code as follows in runtime
[code]
CPU Disasm
Address Hex dump Command Comments
0057E2F0 /$ 56 PUSH ESI
0057E2F1 |. 8BF0 MOV ESI,EAX
0057E2F3 |. 3BF2 CMP ESI,EDX ; ESI= mlvl, EDX= clvl
0057E2F5 90 NOP ; Never jump, ignore levels
0057E2F6 90 NOP
0057E2F7 |. 2BD6 SUB EDX,ESI
0057E2F9 |. 83FA 0B CMP EDX,0B
0057E2FC |. 7C 05 JL SHORT 0057E303
0057E2FE |. BA 0A000000 MOV EDX,0A
0057E303 8B1495 68166E00 MOV EDX,DWORD PTR DS:[EDX*4+6E1668]
0057E30A 81FA 00010000 CMP EDX,100 ; Compare XP rate read from table to 100 (dec 256)
0057E310 EB 32 JMP SHORT 0057E344 ; ALWAYS jump out of here, apply no penalty
0057E312 |. 68 00010000 PUSH 100 ; Arg1 = 100
0057E317 |. E8 4450F0FF CALL 00483360
0057E31C |. 5E POP ESI
0057E31D |. C3 RETN
0057E31E 83FA 19 CMP EDX,19 ; LVL 25 check
0057E321 7C 0C JL SHORT 0057E32F
0057E323 |. 85F6 TEST ESI,ESI
0057E325 |. 7E 08 JLE SHORT 0057E32F
0057E327 |. 56 PUSH ESI ; /Arg1 => ARG.EAX
0057E328 |. E8 3350F0FF CALL 00483360 ; \Game.00483360
0057E32D |. 5E POP ESI
0057E32E |. C3 RETN
0057E32F |> 2BF2 SUB ESI,EDX
0057E331 |. 83FE 0B CMP ESI,0B
0057E334 |. 7C 05 JL SHORT 0057E33B
0057E336 |. BE 0A000000 MOV ESI,0A
0057E33B 8B14B5 94166E00 MOV EDX,DWORD PTR DS:[ESI*4+6E1694]
0057E342 |.^ EB C6 JMP SHORT 0057E30A
0057E344 |> 8BC1 MOV EAX,ECX
0057E346 |. 5E POP ESI
0057E347 \. C3 RETN
[/code]


Here's a side by side comparison
https://www.diffchecker.com/vKCkOp5y

And that seems to work, I would just like to make sure I'm not missing something that could end up breaking with this approach. Anyone see any possible problems by proceeding so?

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

Re: 1.14d Remove Experience Penalties

Post by devurandom » Thu Jul 20, 2017 10:20 pm

should be ok.
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..

Post Reply

Return to “Code Editing”