Today I'm sharing with you a small code edit I made. This edit revolves around extending ArmTypes.txt so that new player token creators will be able to show more armors on their characters instead of being limited to "lit, med, hvy"
As many of you probably know, especially if you are on Discord, I'm going to make a full implementation of Diablo 1 inside Diablo 2, so the sample screenshots you will find below are taken from my mod.
Now, let's move to the tutorial!
We need to analyze this line, inside D2Client.dll
Code: Select all
6FB5E740 8B0485 5030BC MOV EAX,DWORD PTR DS:[EAX*4+6FBC3050] ; ASCII "lit med hvy "
After some tests, I noticed that changing the 3 letter strings there also affects how the datas must be written in and read by the game from ArmType.txt . So, for instance, if you change "Lit" to "Cus" inside the code, you will also have to edit ArmType's "lit" row in order to rename it to "Cus".
But, why limit ourselves to uselessly renamed armor codes? I'm going to show you how to add new strings to the table, basically expanding ArmTypes.txt
First of all, it's better not to touch vanilla tables, as if we go on decyphering the hex stuffs in the image I posted above we find other tables that we really don't want to mess up with (like character modes and such).
So, what to do now? Simple, let's move the table elsewhere!
change the [EAX*4+6FBC3050] to [EAX*4+ (custom address)]
in your custom address, you need to first replicate the lit med hvy order, so that vanilla armors don't get screwed.
The correct form to write this is:
code | 20 | code | 20 | code | 20 code | 20 code | 20 | code | 20 | (as shown by the image above, in the hex window)
In order to translate letters to hex, you can use CTRL+E in olly or another text - to - hex tool you can find online.
Once you've done, save your D2Client.dll and proceed to edit ArmTypes.txt by adding new rows containing your custom codes. It would be wise to make the order of your code match the order of ArmTypes.txt.
In the end, you have to create or edit armors in order to show your custom graphics. Keep in mind that Armors.txt use hcIdx instead of names. You can notice it even in vanilla, as ArmType is made up by "lit" , "med", "hvy", which translate to 0 , 1 and 2 in Armors
Here are some examples: