Diablo 1 Modding attempt : "Berserk" skill

Offtopic
Post Reply
User avatar
Ogodei
Posts: 111
Joined: 11 Jul, 2014 12:42

Diablo 1 Modding attempt : "Berserk" skill

Post by Ogodei »

Hello guys. Recently I started to follow some tutorials (or, i should say, Code editing notes) found on Khanduras.net which report the various code edits made during the development of "Diablo The Dark" mod. I focused my attention on the "berserk" skill (they call it "Charm", though) . I managed to follow the instructions in order to make the affected monsters ("Charmed",as they say) to be friendly towards me, but they keep attacking each other. If I follow the instructions to set the "charmed" monsters to be friendly towards one another, the game crashes as soon as I set foot in a dungeon level, no matter which. Here is what i've done :

A) These are the lines i managed to modify, as the Notes report :

Characters are no longer a possible target for Charmed monsters, as is already the case for Golems:

file offset 0003BCFA

:0043C8FA F6C408 test ah, 08
:0043C8FD 7508 jne 0043C907 jmp for Charmed monsters
:0043C8FF A820 test al, 20
:0043C901 0F851F010000 jne 0043CA26 jmp for Golem

changed into
:0043C8FA A920080000 test eax, 00000820
:0043C8FF 0F8521010000 jne 0043CA26 jmp for Golem and Charmed monsters
:0043C905 9090 2*nop


B) This is what causes the game to crash, and I really don't know why :

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


Anyone's got an idea about how to correctly set these modifications? And, in case you're not familiar with Hellfire modding (I'm working on HF v1.01) could you please suggest me how to recreate the Berserk(or "Charm") spell in Diablo 1?
User avatar
Noktis
Site Admin
Posts: 1251
Joined: 29 Jan, 2008 13:39
Location: Polska
Contact:

Post by Noktis »

User avatar
Ogodei
Posts: 111
Joined: 11 Jul, 2014 12:42

Post by Ogodei »

Mmmmh, I think this is more difficult than I thought . For now i managed to follow Labiri's tutorial on how to add more free space. Maybe it will be useful for this spell...
User avatar
Ogodei
Posts: 111
Joined: 11 Jul, 2014 12:42

Post by Ogodei »

Solved , the [...] reported in the code i copied are meant to be replaced with nop's [90's]. I asked for help in TheHell forum, and a member suggested me to try this way.

I will post the modified code here, in case someone else wants to have friendly monsters.

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"
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 78 guests