Welcome
Welcome to <strong>Diablo: The Hell Forums</strong>.

You are currently viewing our boards as a guest. If you want to have access to the forum, read topics, post message, upload files and all the functions this forum provides, you have to register. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Help with "Berserk" skill modding

Everything about D1 & HF modding, but not TH...

Moderator: Archer

Help with "Berserk" skill modding

Postby Ogodei » Sat Jun 06, 2015 1:13 pm

Hello guys :) recently I decided to mod Diablo 1 Hellfire through Code Edits : i'm following a tutorial found on Khanduras.net (Notes from TheDark's development, I think) in order to modify the Berserk skill so that berserked monsters become friendly towards the character . The problem is that they keep attacking each other. I tried to find a way to solve this problem, but even the tutorial doesn't seem to offer me an answer : Here is what it's written :

Golems and Charmed monsters are no longer a possible target for Golems and Charmed monsters:

file offset 0003BE90

:0043CA90 010000 ...
:0043CA93 8B869C000000 mov eax, dword ptr [esi+0000009C]
:0043CA99 A820 test al, 20
:0043CA9B 753F jne 0043CADC
:0043CA9D F6C408 test ah, 08
:0043CAA0 753A jne 0043CADC
changed into
:0043CA90 8B869C000000 mov eax, dword ptr [esi+0000009C]
:0043CA96 A920080000 test eax, 00000820
:0043CA9B 754E jne 0043CAEB jmp for Golem and Charmed monsters
:0043CA9D 9090909090 5*nop

file offset 0003BECC

:0043CACC 8B4DE4 mov ecx, dword ptr [ebp-1C]
:0043CACF E89DFDFFFF call 0043C871 check for "Golem Shooter"
:0043CAD4 85C0 test eax, eax
:0043CAD6 0F84DF000000 je 0043CBBB if not, dont target this monster
:0043CADC 8B869C000000 mov eax, dword ptr [esi+0000009C]
:0043CAE2 A820 test al, 20
:0043CAE4 7512 jne 0043CAF8
:0043CAE6 F6C408 test ah, 08
:0043CAE9 750D jne 0043CAF8
:0043CAEB F68724DD690020 test byte ptr [edi+0069DD24], 20
:0043CAF2 0F84C3000000 je 0043CBBB
changed into
:0043CACC ...
:0043CADC F68724DD690020 test byte ptr [edi+0069DD24], 20
:0043CAE3 0F84D2000000 je 0043CBBB
:0043CAE9 EB0D jmp 0043CAF8 target Golem or Charmed monsters
:0043CAEB F68724DD690020 test byte ptr [edi+0069DD24], 20
:0043CAF2 0F85C3000000 jne 0043CBBB dont target Golem or Charmed monsters
:0043CAF8


I suspect the problem resides in the empty 0043CAF8 line, since it's empty : doing all these modifications with the exception of that line makes the game crash. I thought that you could help me with this issue :) any advice?

P.s : I'm at the very beginning, therefore i'm only following tutorials for now. My knowledge of ASM is equal to 0 and with C++ i can only make some basic program like area-perimeter calculators (not to mention HEX knowledge...).
Ogodei
Spectre
 
Posts: 5
Joined: Thu Feb 19, 2015 12:50 pm

 

Re: Help with "Berserk" skill modding

Postby quixotic-cynic » Mon Jun 08, 2015 4:33 pm

Hi,

Reading TheDarkNotes can be tricky as I suspect they were never intended to act as a reference for new modders.

It would seem the dots mean 1 of two things: (1) nothing (i.e. set the bytes as "nop"s) or (2) leave as before. Have you tried both of these options?

Edit: Reading the code again, I would say (2) was more likely since that is quite a lot of bytes to leave as nops.

Thanks & regards,
--QC
quixotic-cynic
Spectre
 
Posts: 7
Joined: Mon Jun 08, 2015 4:29 pm

Re: Help with "Berserk" skill modding

Postby Ogodei » Mon Jun 08, 2015 10:44 pm

Yes! you were right. The dots were to be interpreted as nop's. It works. Thanks a lot to have helped me with this issue.

I'll post the code here in case someone else wants to have friendly monsters [Keep in mind that this is Hellfire v1.01, it's not likely to work with either Diablo 1 or Hellfire 1.00 i think]

step 1) Offset 0003BCFA
you have to start from F6 and overwrite as follows :
A9 20 08 00 00 0F 85 21 01 00 00 90 90 --> with this edit, you are telling Charmed monsters not to attack you

step 2) Offset 0003BE90
you have to start from "01 00 00" :
Find "75 3F" and replace it with "75 4E"

Offset 0003BECC
Here you have to start from "8B 4D E4" and overwrite everything with "90" until you find "8B 86 9C" ;
After you've found it, you'll have to overwrite as follows

"F6 87 24 DD 69 00 20 0F 84 D2 00 00 00 EB 0D F6 87 24 DD 69 00 20 0F 85 C3 00 00 00"

with this second edit, you tell charmed monsters to be friendly towards one another and to attack only the non-charmed monsters.

I would like to thank the authors of TheDark Notes for having inspired this change and for the help they have provided us with their notes :)
Ogodei
Spectre
 
Posts: 5
Joined: Thu Feb 19, 2015 12:50 pm

Re: Help with "Berserk" skill modding

Postby quixotic-cynic » Tue Jun 09, 2015 10:53 am

Hello Ogodei,

Glad you got it working. I'm also grateful to the authors of TheDarkNotes for giving us pointers.

I've made a modding toolkit in Java (no GUI yet) for Diablo 1.09. If I expand it to Hellfire I'll put this change in, so thanks for re-working it out.

Thanks & regards,
--QC
quixotic-cynic
Spectre
 
Posts: 7
Joined: Mon Jun 08, 2015 4:29 pm

Re: Help with "Berserk" skill modding

Postby Ogodei » Sun Jul 24, 2016 6:03 pm

Hello everyone :)

I'm sorry to revive such an old post, but, since the topic is the same, i didn't feel like creating a new one, in order not to pollute the forum.
After a very long gap, i went back to D1 modding, and managed to modify the Berserk spell as I wanted. There's only one thing left, which is creating a different outline border (maybe golden, instead of red) for your "minions" (monsters you subjugate through Berserk). Does anyone have an idea on how to achieve it? I'd be okay even if someone only tells me the address that handle the selection borders.

I found out that in Hellfire v1.01 there is a block of code which handles the highlighting of the "minions", which is :

Code: Select all
00408361   75 08                               JNZ SHORT Hellfire.0040836B <- highlight?
00408363   8BCE                                MOV ECX,ESI
00408365   890D 2C164D00                       MOV DWORD PTR DS:[4D162C],ECX
0040836B   3BCE                                CMP ECX,ESI
0040836D   0F85 55080000                       JNZ Hellfire.00408BC8


If you change the two JNZ's into JE , the "minions" border will become intermittent, but it's not what I'd like to achieve ... There is another block of code I noticed:

Code: Select all

00408BAE   F6C4 08                                 TEST AH,8            
00408BB1   75 15                                     JNZ SHORT Hellfire.00408BC8      
00408BB3   830D 2C164D00 FF                  OR DWORD PTR DS:[4D162C]
00408BBA   EB 0C                                     JMP SHORT Hellfire.00408BC8      
00408BBC   893D 50164D00                       MOV DWORD PTR DS:[4D1650],EDI
00408BC2   8915 54164D00                       MOV DWORD PTR DS:[4D1654],EDX
00408BC8   5F                                         POP EDI
00408BC9   5E                                         POP ESI
00408BCA   5B                                         POP EBX
00408BCB   C9                                         LEAVE
00408BCC   C3                                         RETN


If you change "75 15" to "74 15" you become unable to select your "minions" , but you can attack the normal monsters and bosses like before.
I hope these two codes are enough for everyone willing to help me :)

Thanks a lot in advance!
Ogodei
Spectre
 
Posts: 5
Joined: Thu Feb 19, 2015 12:50 pm

[Solved] Berserk Skill modding

Postby Ogodei » Wed Sep 07, 2016 11:48 pm

Hello :) I'm back. I usually try to mod something from time to time. This time, though, I learned a bit of asm-logic by trying to debug and mod Diablo 2 :)

Here's my result: https://youtu.be/BhR8uSpmy48


I still have to find a way to add a check on that spell, in order not to have an unlimited number of minions.
Ogodei
Spectre
 
Posts: 5
Joined: Thu Feb 19, 2015 12:50 pm


Return to Abyss

Who is online

Users browsing this forum: No registered users and 1 guest

suspicion-preferred