Magic Damage Type Display Color [1.10f]

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

P.J.
Posts: 66
Joined: Wed Jan 13, 2010 7:47 pm
Russia

Magic Damage Type Display Color [1.10f]

Post by P.J. » Fri Jun 02, 2017 7:22 pm

Hello

Want to change display color for magic damage from blue. Can someone point the right direction of the function?

I found 6 places in D2client.dll which can be related to this.

Code: Select all

0006BCF8   B8 01000000      MOV EAX,1
0006BCFD   EB 17            JMP SHORT 0006BD16
0006BCFF   B8 09000000      MOV EAX,9
0006BD04   EB 10            JMP SHORT 0006BD16
0006BD06   B8 03000000      MOV EAX,3
0006BD0B   EB 09            JMP SHORT 0006BD16
0006BD0D   B8 02000000      MOV EAX,2
0006BD12   EB 02            JMP SHORT 0006BD16

Code: Select all

0006DF09   B8 01000000      MOV EAX,1
0006DF0E   EB 17            JMP SHORT 0006DF27
0006DF10   B8 09000000      MOV EAX,9
0006DF15   EB 10            JMP SHORT 0006DF27
0006DF17   B8 03000000      MOV EAX,3
0006DF1C   EB 09            JMP SHORT 0006DF27
0006DF1E   B8 02000000      MOV EAX,2
0006DF23   EB 02            JMP SHORT 0006DF27

Code: Select all

0006E1C3   B8 01000000      MOV EAX,1
0006E1C8   EB 17            JMP SHORT 0006E1E1
0006E1CA   B8 09000000      MOV EAX,9
0006E1CF   EB 10            JMP SHORT 0006E1E1
0006E1D1   B8 03000000      MOV EAX,3
0006E1D6   EB 09            JMP SHORT 0006E1E1
0006E1D8   B8 02000000      MOV EAX,2
0006E1DD   EB 02            JMP SHORT 0

Code: Select all

0006EB35   B8 01000000      MOV EAX,1
0006EB3A   EB 17            JMP SHORT 0006EB53
0006EB3C   B8 09000000      MOV EAX,9
0006EB41   EB 10            JMP SHORT 0006EB53
0006EB43   B8 03000000      MOV EAX,3
0006EB48   EB 09            JMP SHORT 0006EB53
0006EB4A   B8 02000000      MOV EAX,2
0006EB4F   EB 02            JMP SHORT 0006EB53

Code: Select all

0006F0CA   B8 01000000      MOV EAX,1
0006F0CF   EB 17            JMP SHORT 0006F0E8
0006F0D1   B8 09000000      MOV EAX,9
0006F0D6   EB 10            JMP SHORT 0006F0E8
0006F0D8   B8 03000000      MOV EAX,3
0006F0DD   EB 09            JMP SHORT 0006F0E8
0006F0DF   B8 02000000      MOV EAX,2
0006F0E4   EB 02            JMP SHORT 0006F0E8

Code: Select all

00070053   B8 01000000      MOV EAX,1
00070058   EB 17            JMP SHORT 00070071
0007005A   B8 09000000      MOV EAX,9
0007005F   EB 10            JMP SHORT 00070071
00070061   B8 03000000      MOV EAX,3
00070066   EB 09            JMP SHORT 00070071
00070068   B8 02000000      MOV EAX,2
0007006D   EB 02            JMP SHORT 00070071
I assume that they are different - one for left skill, one for right, one for merc screen and etc.

User avatar
Ogodei
Senior Moderator
Angel
Posts: 516
Joined: Thu Mar 10, 2016 8:31 am
Italy

Hand-picked

Re: Magic Damage Type Display Color [1.10f]

Post by Ogodei » Sun Jun 04, 2017 11:29 am

Found it! ;)

This is the standard code in D2Client

Code: Select all


6FB0DEF3  8A8E A5010000 MOV CL,BYTE PTR DS:[ESI+1A5]
6FB0DEF9  83F8 04       CMP EAX,4
6FB0DEFC  894C24 20     MOV DWORD PTR SS:[ESP+20],ECX
6FB0DF00  77 23         JA SHORT 6FB0DF25
6FB0DF02  FF2485 68E1B0 JMP NEAR DWORD PTR DS:[EAX*4+6FB0E168]
6FB0DF09  B8 01000000   MOV EAX,1                                ; <-- Red for Fire
6FB0DF0E  EB 17         JMP SHORT 6FB0DF27
6FB0DF10  B8 09000000   MOV EAX,9                                ; <-- Yellow for Lightning
6FB0DF15  EB 10         JMP SHORT 6FB0DF27
6FB0DF17  B8 03000000   MOV EAX,3                                ; <-- Blue for Cold/Magic
6FB0DF1C  EB 09         JMP SHORT 6FB0DF27
6FB0DF1E  B8 02000000   MOV EAX,2                                ; <-- Green for Poison
6FB0DF23  EB 02         JMP SHORT 6FB0DF27
It tells the game to use blue for magic and cold elements. In order to separate them, you need to do the following:

change "MOV EAX,3" to "JMP (custom offsets)

in the place you jump:

Code: Select all

CMP EAX,2         ;              check if Magic
JE mov eax,8     ;               If Magic, then go to "Use Orange" (EAX = color) 
MOV EAX,3        ;               if not Magic, then use Blue
JMP 6FB0DF27    ;               return to the standard code
MOV EAX,8        ;               use Orange
JMP 6FB0DF27    ;               return to the standard code

P.J.
Posts: 66
Joined: Wed Jan 13, 2010 7:47 pm
Russia

Re: Magic Damage Type Display Color [1.10f]

Post by P.J. » Sun Jun 04, 2017 3:11 pm

Thanks a lot. Tested your suggestion and its work perfectly.

Probably also you know where Draw Resist function located at D2Client.6FB21570 getting color for Immune Strings (Red for fire, Blue for cold and etc) ?


P.J.
Posts: 66
Joined: Wed Jan 13, 2010 7:47 pm
Russia

Re: Magic Damage Type Display Color [1.10f]

Post by P.J. » Sun Jun 04, 2017 3:48 pm

It will not go with some additional spaces? When i done same thing for some monster names it works ok sure but mon desc was shifted to the right (Not centered with monname). Ok i think its faster to test. :)

User avatar
Ogodei
Senior Moderator
Angel
Posts: 516
Joined: Thu Mar 10, 2016 8:31 am
Italy

Hand-picked

Re: Magic Damage Type Display Color [1.10f]

Post by Ogodei » Sun Jun 04, 2017 3:58 pm

It's already shifted, unfortunately, even if you do not use CE :\ I guess that's the best way. If you want to color the name of monsters, tho, CE is the best way. There's a thread here in the Keep that you might want to check :)

viewtopic.php?f=8&t=25898&hilit=Set+Gol ... ead+bodies.

This part, posted by kingpin, handles the special checks for monsters name color

Code: Select all

6FB20F34   BD 01000000      MOV EBP,1 ; Default color for dead monsters
6FB20F39   896C24 10        MOV DWORD PTR SS:[ESP+10],EBP
6FB20F3D   8B4424 14        MOV EAX,DWORD PTR SS:[ESP+14]
6FB20F41   3D F3000000      CMP EAX,0F3 ; diablo
6FB20F46   74 2A            JE SHORT D2Client.6FB20F72
6FB20F48   3D 4D010000      CMP EAX,14D ; diabloclone
6FB20F4D   74 23            JE SHORT D2Client.6FB20F72
6FB20F4F   3D F2000000      CMP EAX,0F2 ; mephisto
6FB20F54   74 1C            JE SHORT D2Client.6FB20F72
6FB20F56   3D D3000000      CMP EAX,0D3 ; duriel
6FB20F5B   74 15            JE SHORT D2Client.6FB20F72
6FB20F5D   3D 20020000      CMP EAX,220 ; baalcrab
6FB20F62   74 0E            JE SHORT D2Client.6FB20F72
6FB20F64   3D 3A020000      CMP EAX,23A ; baalclone
6FB20F69   74 07            JE SHORT D2Client.6FB20F72
6FB20F6B   3D E5000000      CMP EAX,0E5 ; radament
6FB20F70   75 09            JNZ SHORT D2Client.6FB20F7B
6FB20F72   BD 04000000      MOV EBP,4 ; Set color to Gold

P.J.
Posts: 66
Joined: Wed Jan 13, 2010 7:47 pm
Russia

Re: Magic Damage Type Display Color [1.10f]

Post by P.J. » Tue Jun 06, 2017 9:18 pm

Ok, i was tested with changing tbl strings - works good. But as you said, if put all 6 immunities its looks shifted to the left =\
Thanks again for your help :)


EDIT: Just find out that 6FB0DF02 offset is for spells only. For normal damage with magic damage bonus its still appears blue. Tried to test other offsets from my firs post - no luck. For normal damage there is different function?

Return to “Code Editing”