i am unable to handle mercenary cost ! help !

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

xmx123
Posts: 13
Joined: Mon Aug 14, 2017 2:45 pm

i am unable to handle mercenary cost ! help !

Post by xmx123 » Mon Oct 02, 2017 4:44 am

8-O
if i resurrect a dead mercenary,npc would take 50000 currency.that's too much.
i operate gold column of hireling.txt. it doesn't work.
any other ways use soft code ?? thanks

User avatar
thaison
Junior Member
Paladin
Posts: 108
Joined: Fri Apr 03, 2015 11:59 am
Location: Viet Nam
Vietnam

Re: i am unable to handle mercenary cost ! help !

Post by thaison » Tue Oct 03, 2017 6:37 am

It requires code editing, you want to do on any version

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

Re: i am unable to handle mercenary cost ! help !

Post by csguak » Sat Oct 14, 2017 5:14 am

This has been figured out.
Following code is from kidpaddie's code compilation.

Code: Select all

File E:\Diablo II\D2Common.dll
Address   Hex dump          Command                                  Comments
0002CC9F   \5F              POP EDI 
0002CCA0    5B              POP EBX
0002CCA1    0FAFC0          IMUL EAX,EAX
0002CCA4    99              CDQ
0002CCA5    29D0            SUB EAX,EDX
0002CCA7    D1F8            SAR EAX,1
0002CCA9    6BC0 0F         IMUL EAX,EAX,0F
0002CCAC    3D E0930400     CMP EAX,493E0 <--- This is Decimal 50000 <-- Compare EAX (Total hireling ressurection) to 50000...
0002CCB1    76 05           JBE SHORT 0002CCB8 <-- If the price is below 50000 then jump to 0002CCB8 and simply return the EAX value from above calculations.
0002CCB3    B8 E0930400     MOV EAX,493E0 <-- This is decimal 50000 <-- MOV into EAX the value specified here if the comparison from above turned out to be true.
0002CCB8    C2 0400         RETN 4

Return to “General Mod Making”