[1.10] Make your own Holy Shield skills for any class

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Post Reply

0
No votes
 
Total votes: 0

User avatar
kingpin
Senior Admin
Cherub
Posts: 10930
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

[1.10] Make your own Holy Shield skills for any class

Post by kingpin » Mon Jul 26, 2004 3:50 pm

Make your own Holy Shield skills

You may wonder what this is doing in CE forum? Anyone who has tried to use Holy Shield "state" on a character that isn't Paladin may have seen that it doesn't show the Holy Shield and also that we are stuck to use for Paladin the Holy Shield animation. First we will start look into what happend then using the Holy Shield skills.


Paladin Shield token HSH
Before I looked into this I didn't know that Paladin has an own shield token for Holy Shield callled HSH. I have always thougth it was an "overlay" and never pay attention to that it would be needed to have own shield animation. There are 17 different animations for HSH token as you can see down here.

The files are located in: data\global\CHARS\PA\SH

PASHHSHA1HTH.dcc
PASHHSHA11HS.dcc
PASHHSHA11HT.dcc
PASHHSHA21HS.dcc
PASHHSHA21HT.dcc
PASHHSHBL1HS.dcc
PASHHSHGH1HS.dcc
PASHHSHKK1HS.dcc
PASHHSHNU1HS.dcc
PASHHSHRN1HS.dcc
PASHHSHS11HS.dcc
PASHHSHSC1HS.dcc
PASHHSHTH1HS.dcc
PASHHSHTN1HS.dcc
PASHHSHTW1HS.dcc
PASHHSHWL1HS.dcc
PASHHSHWLHTH.dcc


If you don't like the holy shield animation you could make an own custom animation and re-name it to use same token as Holy Shield originally does.


Make Holy Shield animation available for every class
If the offsets isn't to different between the characters you can copy the HSH animation to another class to be able to it for the class.

If we take a look another class as example Sorceress we will find that Sorceress and Paladin aren't using same animation modes. So, to make Holy Shield anim work for Sorceress we would need to know what's the difference between those too.

Down here is the BUC token for sorceress.

The files are located in: data\global\CHARS\SO\SH

SOSHBUCA1HTH.dcc = PASHHSHA1HTH.dcc
SOSHBUCA11HS.dcc = PASHHSHA11HS.dcc
SOSHBUCA11HT.dcc = PASHHSHA11HT.dcc
SOSHBUCA21HS.dcc = PASHHSHA21HS.dcc
SOSHBUCA21HT.dcc = PASHHSHA21HT.dcc
SOSHBUCBLHTH.dcc = Not used by Paladin
SOSHBUCGHHTH.dcc = Not used by Paladin
SOSHBUCNUHTH.dcc = Not used by Paladin
SOSHBUCKKHTH.dcc = Not used by Paladin
SOSHBUCS1HTH.dcc = Not used by Paladin
SOSHBUCSCHTH.dcc = Not used by Paladin
SOSHBUCTH1HT.dcc = Not used by Paladin
SOSHBUCTNHTH.dcc = Not used by Paladin
SOSHBUCTWHTH.dcc = Not used by Paladin
SOSHBUCWLHTH.dcc = PASHHSHWLHTH.dcc
SOSHBUCRNHTH.dcc = Not used by Paladin


Those down here is not use by Sorceress
PASHHSHBL1HS.dcc
PASHHSHGH1HS.dcc
PASHHSHKK1HS.dcc
PASHHSHNU1HS.dcc
PASHHSHRN1HS.dcc
PASHHSHS11HS.dcc
PASHHSHSC1HS.dcc
PASHHSHTH1HS.dcc
PASHHSHTN1HS.dcc
PASHHSHTW1HS.dcc
PASHHSHWL1HS.dcc


As we can see here there are 11 modes that doesn't match Paladin and Sorceress and sorceress only need 10 of them. Since Paladin have an additional WL mode "1HS" that Sorceress are missing. Since it's only Paladin that have shield attack Sorecress are missing all animations related to one handes swing.


We will start with renaming all modes that are same for both classes.

PASHHSHA1HTH.dcc -> SOSHHSHA1HTH.dcc
PASHHSHA11HS.dcc -> SOSHHSHA11HS.dcc
PASHHSHA11HT.dcc -> SOSHHSHA11HT.dcc
PASHHSHA21HS.dcc -> SOSHHSHA21HS.dcc
PASHHSHA21HT.dcc -> SOSHHSHA21HT.dcc
PASHHSHWLHTH.dcc -> SOSHHSHWLHTH.dcc

and now we will add those modes that doesn't exist and instead use a similar mode that Sorceress have. If you want it to have the mode Paladin are using it will need a cof for it.

PASHHSHBL1HS.dcc -> SOSHHSHBLHTH.dcc
PASHHSHGH1HS.dcc -> SOSHHSHGHHTH.dcc
PASHHSHKK1HS.dcc -> SOSHHSHKKHTH.dcc
PASHHSHNU1HS.dcc -> SOSHHSHNUHTH.dcc
PASHHSHRN1HS.dcc -> SOSHHSHRNHTH.dcc
PASHHSHSC1HS.dcc -> SOSHHSHSCHTH.dcc
PASHHSHS11HS.dcc -> SOSHHSHS1HTH.dcc
PASHHSHTH1HS.dcc -> SOSHHSHTH1HT.dcc
PASHHSHTN1HS.dcc -> SOSHHSHTNHTH.dcc
PASHHSHTW1HS.dcc -> SOSHHSHTWHTH.dcc

The only we need now is to copy our new HSH token to The files are located in: data\global\CHARS\SO\SH and make a copy of Holy Shield skill and play with Sorceress using Holy Shield.


Add custom state that uses own animation mode
In d2client.dll they are handling the switch between normal animation mode and holy shield HSH animation mode. They do this switch then you have activate the state, there are a check for Holy Shield state in the code to handle this.


The code that is of interest for us is located here (in d2client.dll)

6FB5E801 6A 65 PUSH 65 ; State_id
6FB5E803 57 PUSH EDI ; ptUnit
6FB5E804 E8 09C30000 CALL <JMP.&D2Common.#10487> ; check state
6FB5E809 85C0 TEST EAX,EAX ; check state
6FB5E80B 74 13 JE SHORT D2Client.6FB5E820 ; no state active jump
6FB5E80D 6A 00 PUSH 0
6FB5E80F 55 PUSH EBP ; ptInventory
6FB5E810 E8 C3C60000 CALL <JMP.&D2Common.#10273> ; Check if shield is equipped
6FB5E815 85C0 TEST EAX,EAX ; Check shield
6FB5E817 74 07 JE SHORT D2Client.6FB5E820 ; No shield equipped, jump
6FB5E819 B8 68736820 MOV EAX,20687368 ; add HSH token
6FB5E81E EB 02 JMP SHORT D2Client.6FB5E822 ; jump to code that handle the weapon token change
[/code]


What they does here is to check if Holy Shield state is active and change the shield token to HSH


Change what shield token that is used:
Since the code for add HSH token is simply ascii code. I know someone who got a .......... and forgott how ascii worked yesterday, just ask SVR :P

We will change the shields token to TOW (tower shield) instead.

Ascii code for this:
74 = t
6F = o
77 = w

6FB5E819 B8 746F7720 MOV EAX,20776F74 ; Remember its written backwards, now then we use Holy Shield we will have the Tower animation instead of Holy Shield animation.



Write your own custom check

Original Code:

Code: Select all

6FB5E809   85C0             TEST EAX,EAX ; check state
6FB5E80B   74 13            JE SHORT D2Client.6FB5E820 ; no state active jump
6FB5E80D   6A 00            PUSH 0

Custom Code in D2Client.dll:

Code: Select all

6FB5E809   E9 46DE0000      JMP D2Client.6FB6C654 ; Jump to custom code
6FB5E80E   90               NOP

6FB6C654   85C0             TEST EAX,EAX
6FB6C656   75 2A            JNZ SHORT D2Client.6FB6C682 ; If holy shield state is active jump and let the game handle the normal check that we have moved around a bit
6FB6C658   68 DD000000      PUSH 0DD ; check custom id 221
6FB6C65D   57               PUSH EDI ; ptUnit
6FB6C65E   E8 AFE4FFFF      CALL <JMP.&D2Common.#10487> ; Check if our custom shield state is used
6FB6C663   85C0             TEST EAX,EAX ; Not used?
6FB6C665   74 16            JE SHORT D2Client.6FB6C67D ; Then jump
6FB6C667   6A 00            PUSH 0 ; 
6FB6C669   55               PUSH EBP ; ptInventory
6FB6C66A   E8 69E8FFFF      CALL <JMP.&D2Common.#10273> ; Check if shield equipped
6FB6C66F   85C0             TEST EAX,EAX ; Is equipped?
6FB6C671   74 0A            JE SHORT D2Client.6FB6C67D ; If not jump
6FB6C673   B8 746F7720      MOV EAX,20776F74 ; Change shield token to TOW
6FB6C678  ^E9 A521FFFF      JMP D2Client.6FB5E822 ; jump to code that change what token is used
6FB6C67D  ^E9 9E21FFFF      JMP D2Client.6FB5E820 ; No state active, or no shield equipped
6FB6C682   6A 00            PUSH 0
6FB6C684  ^E9 8621FFFF      JMP D2Client.6FB5E80F ; jump to code that check if shield equipped

Final Note
If you look into other monsters animations you can If you are lucky armor, shield, weapon or anything else that works for characters. Also, by change the code in here you will be able to do armor/weapon switch also. You will need to find where it do SH directory check. It's located in this code somewhere, I forgott to take note where it was located.

States.txt
You will need to make a copy of holyshield state and change it to 221 and custom name as ID. If you don't want to use 221 as ID you can offcourse use whatever you want.

Skills.txt
Make a clone of Holy Shield skill and add your cust om state to it.

That was all I think :P
Last edited by kingpin on Mon Jul 26, 2004 3:53 pm, edited 2 times in total.

User avatar
bhimaparakrama
Posts: 8
Joined: Sat Sep 06, 2003 1:59 am

Post by bhimaparakrama » Sat Apr 09, 2005 7:37 pm

kingpin,
I would like to disable the graphic change altogether, so that whatever shield the character has equipped when the holyshield state is activated will still be displayed on the character. Is this something that could be done without a massive amount of change to the code?

My goal is to make Holy Shield a passive skill that will grant the def, blocking, and smite dmg boni, without changing the shield gfx. From testing so far, I believe that the holyshield state must be used in order to make at least some of this work correctly (I have been unable to add the smite dmg without the holyshield state, and I believe that the increased blocking % does not show up on the shield without the state, either, though I might be wrong about that one). I'm afraid I don't know enough about how the code actually works to figure out how to make this change on my own. I would be grateful for any assistance you could give.

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12062
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U

Hand-picked

Re: [1.10] Make your own Holy Shield skills for any class

Post by Myhrginoc » Sat Apr 09, 2005 9:23 pm

It looks like all you need is to bypass the client-side graphics change. This should be possible by forcing that code snippet kingpin found to ignore the state check and subsequent weapon class change(last three letters of the dcc file name). The actual routine is a bit longer than he quoted:

Code: Select all

6FB5E7FC   |>  83FB 07                   CMP EBX,7
[color=#7600ff]6FB5E7FF   |.  75 1F                     JNZ SHORT D2Client.6FB5E820[/color]
6FB5E801   |.  6A 65                     PUSH 65
6FB5E803   |.  57                        PUSH EDI
6FB5E804   |.  E8 09C30000               CALL <JMP.&D2Common.#10487>
6FB5E809   |.  85C0                      TEST EAX,EAX
6FB5E80B   |.  74 13                     JE SHORT D2Client.6FB5E820
6FB5E80D   |.  6A 00                     PUSH 0
6FB5E80F   |.  55                        PUSH EBP
6FB5E810   |.  E8 C3C60000               CALL <JMP.&D2Common.#10273>
6FB5E815   |.  85C0                      TEST EAX,EAX
6FB5E817   |.  74 07                     JE SHORT D2Client.6FB5E820
6FB5E819   |.  B8 68736820               MOV EAX,20687368
6FB5E81E   |.  EB 02                     JMP SHORT D2Client.6FB5E822
6FB5E820   |>  33C0                      XOR EAX,EAX
6FB5E822   |>  8B7C24 34                 MOV EDI,DWORD PTR SS:[ESP+34]
Change line 6FB5E7FF to an unconditional jump. To do this with a hex editor, subtract off the loading address 6FAA0000, that gives us file offset 0BE7FF. You should see byte 75 there, change that to EB and give it a whirl. (The second column in the code listing is the sequence of bytes you should see in the hex editor overall.)
Last edited by Myhrginoc on Sat Apr 09, 2005 9:27 pm, edited 1 time in total.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
bhimaparakrama
Posts: 8
Joined: Sat Sep 06, 2003 1:59 am

Post by bhimaparakrama » Sat Apr 09, 2005 11:10 pm

Myhrginoc,
Thank you, that small change did the trick beautifully. I had hoped that a simple jump would solve the problem, but I didn't know where to put it. You made that about as quick and painless as it could possibly be. Thanks again!

ocarinas
Posts: 55
Joined: Sun Apr 10, 2016 4:36 am

Re: [1.10] Make your own Holy Shield skills for any class

Post by ocarinas » Mon May 15, 2017 1:21 am

Sorry for revive an old thread.

I want to make a skill that when used will check if player has 2-handed weapon equipped if yes then changes the weapon token to claymore (clm).

I tried changing things around but no luck :(

Can someone please guide me through this? and sorry for my bad english.

EDIT: I've been staring at the codes for a while now, still can't find where I suppose to edit... ;-;
EDIT2: I still can't find the offset, still need someone to shed some light on me... If not, at least someone to point a direction would be appreciated.

leekun
Dark Alliance Beta Test
Warrior
Posts: 24
Joined: Wed Jul 19, 2017 9:41 pm

Re: [1.10] Make your own Holy Shield skills for any class

Post by leekun » Thu Nov 16, 2017 7:15 am

Want to do the same thing as the guy above.
I'd appreciate if some code guru would come and shed light on us.

Post Reply

Return to “Code Editing”