Mac Full Mercenary Equipment Slots - Initial Version Ready

This forum is dedicated to platform-specific issues, discussions and tools relating to D2 modding for the Mac.

Moderator: Contrail

Post Reply

1
100%
 
Total votes: 1

User avatar
Contrail
Retired staff
Paladin
Posts: 169
Joined: Sun Jul 13, 2003 1:37 am
Location: Austin, TX
Contact:

Mac Full Mercenary Equipment Slots - Initial Version Ready

Post by Contrail » Mon Oct 15, 2007 4:17 am

I'm making decent progress on making it possible for mercenaries on the Mac to have a full set of equipment slots. I've found the code that checks the item types of the equipment you're trying to equip the merc with. Currently I'm trying to figure out what the best change to the checks would be. I also need to find a way to deal with the second ring slot properly. I'm not planning on changing what weapon combinations the mercs can have at this stage, it would be a bit more complicated than I want to deal with right now.

Update: :mrgreen: I've got an initial version working with all slots functional, including both ring slots, although if the merc has two rings equipped and you try to give the merc a different one, it will always replace the ring in the second slot. And again, the weapon restrictions on each merc type remains in place.

For the code edits to work correctly, a new hireling inventory image needs to be added and changes need to be made to inventory.txt. These can be taken directly from one of the PC hireling plugins.

The offsets given are for the 1.10b version of Diablo II (Carbon).

Code: Select all

000878e4:  38800033	li	r4,51
...
000878f4:  40820020	bne-	0x87914
...
000878fc:  3880002D	li	r4,45
...
0008790c:  40820008	bne-	0x87914


0008a5c8:  38800033	li	r4,51
...
0008a5d8:  40820028	bne-	0x8a600
...
0008a5e0:  3880002D	li	r4,45
...
0008a5f0:  40820010	bne-	0x8a600


0029db68:  38800033	li	r4,51
...
0029db78:  40820020	bne-	0x29db98
...
0029db80:  3880002D	li	r4,45
...
0029db90:  40820008	bne-	0x29db98


0029dff0:  40820010	bne-	0x29e000
0029dff4:  7f24cb78	mr	r4,r25
0029dff8:  38600000	li	r3,0
0029dffc:  4bf02af5	bl	0x1a0af0
0029e000:  83d90060	lwz	r30,96(r25)
0029e004:  281e0000	cmplwi	r30,0
0029e008:  4082000c	bne-	0x29e014
0029e00c:  38600000	li	r3,0
0029e010:  48000324	b	0x29e334
0029e014:  7f43d378	mr	r3,r26
0029e018:  38810039	addi	r4,SP,57
0029e01c:  38a10038	addi	r5,SP,56
0029e020:  4bf1d511	bl	0x1bb530
0029e024:  88810039	lbz	r4,57(SP)
0029e028:  7fc3f378	mr	r3,r30
0029e02c:  4bf00a45	bl	0x19ea70
0029e030:  88810038	lbz	r4,56(SP)
0029e034:  7c7c1b78	mr	r28,r3
0029e038:  7fc3f378	mr	r3,r30
0029e03c:  4bf00a35	bl	0x19ea70
0029e040:  7c7b1b78	mr	r27,r3
0029e044:  88010039	lbz	r0,57(SP)
0029e048:  2c000006	cmplwi	r0,6
0029e04c:  4082000c	bne-	0x29e058
0029e050:  2c1c0000	cmplwi	r28,0
0029e054:  40820034	bne-	0x29e088
0029e058:  28190000	cmplwi	r25,0
0029e05c:  4182000c	beq-	0x29e068
0029e060:  80190004	lwz	r0,4(r25)
0029e064:  48000008	b	0x29e06c
0029e068:  3800ffff	li	r0,-1
0029e06c:  28000167	cmplwi	r0,359
0029e070:  40820020	bne-	0x29e090
0029e074:  7f43d378	mr	r3,r26
0029e078:  38800002	li	r4,2
0029e07c:  4bf17d35	bl	0x1b5db0
The last chunk is so large because I had to do more than a little rearranging to make room for the checks necessary to enable the second ring slot. I could've jumped to empty space instead, but in this case it wasn't saving me much room and I want to save what empty space there is in the file for when it's truly necessary.

Edit: Fixed up some of the offsets in the last section and corrected a typo caused by late night posting that would mess things up a bit.

- Contrail
Last edited by Contrail on Wed Oct 17, 2007 11:04 pm, edited 3 times in total.

User avatar
Hans
Dark Alliance Beta Test
Dominion
Posts: 6438
Joined: Sat Oct 02, 2004 5:14 pm
Location: Toronto, Ontario, Canada

Post by Hans » Wed Oct 17, 2007 6:25 pm

Great job Contrail. :rightthumb:
"Hi. My name is Hans, and I am addicted to a game that is not yet been made" - Card carrying member of D3 Addictions Anonymous, since June 2008.
Card carrying member of Mentaldom, since May 2006 - Zy-El Hardcore.
"German pornstar/Bee Gee lookalike" & "The Blacksmith"
Trying to picture Hans as a Dominion...nah it isn't working sorry. It's the mustache that gets me every time - Al-T.
"All men play on 127" O-H - Hans
"Okay, time out. This is Zy-El. The mod of total excess. Since when would any Zy-El lover do only what's necessary?" - Metropolis Man
Zy-El Wiki|New Zy-El Website

User avatar
Nameless
Forum Legend
Power
Posts: 3357
Joined: Tue Feb 14, 2006 6:38 am

Post by Nameless » Thu Dec 20, 2007 1:21 pm

In ES on the PC, Act 2 and 5 mercs can also equip a shield together with a 1h weapons (Javlin or Sword respectively, AFAIK the Barb merc can't use a 2h sword with 1 hand). I wonder if you could add that as well.

User avatar
Contrail
Retired staff
Paladin
Posts: 169
Joined: Sun Jul 13, 2003 1:37 am
Location: Austin, TX
Contact:

Re: Mac Full Mercenary Equipment Slots - Initial Version Rea

Post by Contrail » Thu Dec 20, 2007 5:21 pm

It's possible. The tricky bit will be to properly handle cases where you're switching the merc from using a one-handed weapon and shield to using a two-handed weapon. I'll look into the exact details and see what I can come up with after the holidays.

- Contrail

User avatar
Sir Xavius
Junior Member
Paladin
Posts: 177
Joined: Mon Oct 04, 2004 6:27 pm
United States of America

Re: Mac Full Mercenary Equipment Slots - Initial Version Rea

Post by Sir Xavius » Wed Jan 09, 2008 8:11 pm

After a long vacation away from the phrozenkeep, i've come back to find that mac modding is still alive and well. Thanks to you, Contrail! O-H

If you can this up and running, you'll be a hero among those few of us out here who still enjoy modded versions of D2LOD on our Macs. How do we get such a fine freebie?

BTW, i am an artist with extensive electronic art experience. Do you need a pic for the hireling equip page? If i can help, what exactly should be included?

User avatar
novadragon
Posts: 9
Joined: Mon Sep 03, 2007 5:26 pm

Post by novadragon » Thu Jun 19, 2008 5:56 pm

I'm not great with computers but I know how to mod diablo 2 by changing the txt files in the patch mpq... However I have absolutely no idea what this code edit is. Could anyone tell me how I can do this to change my mercenary equipment slots?

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Post by Necrolis » Thu Jun 19, 2008 6:38 pm

This is a mac code edit, you have to tamper with the (carbon) using a mac dissasem tool, or if your feeling lucky a hex tool. The mac functions list or quest sticky has a list of some useful tools, beyond that i can help you no more(i'm an x86 programmer :P)
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
novadragon
Posts: 9
Joined: Mon Sep 03, 2007 5:26 pm

Post by novadragon » Fri Jun 20, 2008 5:23 pm

Sorry again, but where can I find this code editing tool?

User avatar
Contrail
Retired staff
Paladin
Posts: 169
Joined: Sun Jul 13, 2003 1:37 am
Location: Austin, TX
Contact:

Post by Contrail » Sat Jun 21, 2008 6:31 pm

novadragon";p="392205" wrote:Sorry again, but where can I find this code editing tool?
HexEdit is the tool I use when editing the Mac D2 application file.

- Contrail

User avatar
novadragon
Posts: 9
Joined: Mon Sep 03, 2007 5:26 pm

Post by novadragon » Mon Jun 23, 2008 2:45 am

So I simply have to use hexedit to open the diablo II Patch (Carbon), find the offsets listed and change the codes to the ones that Contrail has posted? Btw where can I find a clean diablo II patch mpq? Right now I have version 1.12 installed.

Post Reply

Return to “Mac Modding”