item_damagetargetac non functional? (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

Post Reply
User avatar
PureRage
Forum Regular
Angel
Posts: 570
Joined: Fri Jan 08, 2010 9:02 am
Location: Newcastle, England
Great Britain

item_damagetargetac non functional? (1.10f)

Post by PureRage » Mon Feb 22, 2016 12:32 pm

Just curious. I tried searching the forums but only came up with 1 topic that seemed semi related here: viewtopic.php?f=4&t=28950&hilit=damagetargetac

The stat seems to not function in game as far as testing goes (giving it to a monster results in no change in player AC when hit). I quickly ran through D2Game and found the following 2 pieces of code that seem to be related:

D2Game:

Code: Select all

6FC5FF6B  |. 52             PUSH EDX                                 ; /Arg2
6FC5FF6C  |. 56             PUSH ESI                                 ; |Arg1
6FC5FF6D  |. 8BD7           MOV EDX,EDI                              ; |
6FC5FF6F  |. E8 6CF5FFFF    CALL D2Game.6FC5F4E0                     ; \D2Game.6FC5F4E0
6FC5FF74  |. 833E 01        CMP DWORD PTR DS:[ESI],1
6FC5FF77  |. 75 34          JNZ SHORT D2Game.6FC5FFAD
6FC5FF79  |. 56             PUSH ESI
6FC5FF7A  |. E8 B1B80B00    CALL <JMP.&D2Common.#11067>      ;check for hireling ID (0 if not hireling)
6FC5FF7F  |. 85C0           TEST EAX,EAX
6FC5FF81  |. 75 2A          JNZ SHORT D2Game.6FC5FFAD                ; skip below stat stuff if hireling?
6FC5FF83  |. 50             PUSH EAX
6FC5FF84  |. 6A 78          PUSH 78                                 ;DamageAC Stat
6FC5FF86  |. 57             PUSH EDI
6FC5FF87  |. E8 06B70B00    CALL <JMP.&D2Common.#10519>       ;get stat value (base+item)
6FC5FF8C  |. 8BD8           MOV EBX,EAX
6FC5FF8E  |. 85DB           TEST EBX,EBX
6FC5FF90  |. 74 1B          JE SHORT D2Game.6FC5FFAD
6FC5FF92  |. 6A 00          PUSH 0
6FC5FF94  |. 6A 1F          PUSH 1F                                 ; AC stat
6FC5FF96  |. 56             PUSH ESI
6FC5FF97  |. E8 F6B60B00    CALL <JMP.&D2Common.#10519>          ;get stat value (base+items)
6FC5FF9C  |. 03C3           ADD EAX,EBX
6FC5FF9E  |. 79 02          JNS SHORT D2Game.6FC5FFA2
6FC5FFA0  |. 33C0           XOR EAX,EAX
6FC5FFA2  |> 6A 00          PUSH 0
6FC5FFA4  |. 50             PUSH EAX
6FC5FFA5  |. 6A 1F          PUSH 1F                                 ; AC Stat
6FC5FFA7  |. 56             PUSH ESI
6FC5FFA8  |. E8 FBB80B00    CALL <JMP.&D2Common.#10517>                ;set stat value
6FC5FFAD  |> F64424 10 01   TEST BYTE PTR SS:[ESP+10],1
6FC5FFB2  |. 75 0F          JNZ SHORT D2Game.6FC5FFC3
6FC5FFB4  |. 8B8424 A000000>MOV EAX,DWORD PTR SS:[ESP+A0]
6FC5FFBB  |. 85C0           TEST EAX,EAX
6FC5FFBD  |. 0F84 92000000  JE D2Game.6FC60055
6FC5FFC3  |> F64424 1C 01   TEST BYTE PTR SS:[ESP+1C],1
6FC5FFC8  |. 0F84 87000000  JE D2Game.6FC60055
6FC5FFCE  |. 57             PUSH EDI
6FC5FFCF  |. E8 D6B60B00    CALL <JMP.&D2Common.#10342>
6FC5FFD4  |. 8BE8           MOV EBP,EAX
6FC5FFD6  |. 85ED           TEST EBP,EBP
6FC5FFD8  |. 74 69          JE SHORT D2Game.6FC60043
6FC5FFDA  |. 8B07           MOV EAX,DWORD PTR DS:[EDI]
6FC5FFDC  |. 83F8 02        CMP EAX,2
6FC5FFDF  |. 74 1F          JE SHORT D2Game.6FC60000
6FC5FFE1  |. 83F8 03        CMP EAX,3
6FC5FFE4  |. 7E 05          JLE SHORT D2Game.6FC5FFEB
6FC5FFE6  |. 83F8 05        CMP EAX,5
6FC5FFE9  |. 7E 15          JLE SHORT D2Game.6FC60000
6FC5FFEB  |> 8B47 2C        MOV EAX,DWORD PTR DS:[EDI+2C]
6FC5FFEE  |. 85C0           TEST EAX,EAX
6FC5FFF0  |. 74 0A          JE SHORT D2Game.6FC5FFFC

Code: Select all

6FCBE7E0  /$ 81EC 1C040000  SUB ESP,41C
6FCBE7E6  |. 53             PUSH EBX
6FCBE7E7  |. 56             PUSH ESI
6FCBE7E8  |. 8BF2           MOV ESI,EDX
6FCBE7EA  |. 894C24 20      MOV DWORD PTR SS:[ESP+20],ECX
6FCBE7EE  |. 85F6           TEST ESI,ESI
6FCBE7F0  |. 0F84 C30B0000  JE D2Game.6FCBF3B9
6FCBE7F6  |. 8B9C24 2804000>MOV EBX,DWORD PTR SS:[ESP+428]
6FCBE7FD  |. 85DB           TEST EBX,EBX
6FCBE7FF  |. 0F84 B40B0000  JE D2Game.6FCBF3B9
6FCBE805  |. 8A8424 3404000>MOV AL,BYTE PTR SS:[ESP+434]
6FCBE80C  |. 84C0           TEST AL,AL
6FCBE80E  |. 75 08          JNZ SHORT D2Game.6FCBE818
6FCBE810  |. C68424 3404000>MOV BYTE PTR SS:[ESP+434],80
6FCBE818  |> 8B9424 3004000>MOV EDX,DWORD PTR SS:[ESP+430]
6FCBE81F  |. 55             PUSH EBP
6FCBE820  |. 57             PUSH EDI
6FCBE821  |. 8BCE           MOV ECX,ESI
6FCBE823  |. E8 D8E0FBFF    CALL D2Game.6FC7C900
6FCBE828  |. 8BBC24 3404000>MOV EDI,DWORD PTR SS:[ESP+434]
6FCBE82F  |. 8B06           MOV EAX,DWORD PTR DS:[ESI]
6FCBE831  |. 8B2B           MOV EBP,DWORD PTR DS:[EBX]
6FCBE833  |. 894424 24      MOV DWORD PTR SS:[ESP+24],EAX
6FCBE837  |. 8B17           MOV EDX,DWORD PTR DS:[EDI]
6FCBE839  |. 83CA 20        OR EDX,20
6FCBE83C  |. 85C0           TEST EAX,EAX
6FCBE83E  |. 8917           MOV DWORD PTR DS:[EDI],EDX
6FCBE840  |. 74 0F          JE SHORT D2Game.6FCBE851
6FCBE842  |. 56             PUSH ESI
6FCBE843  |. E8 58D50500    CALL <JMP.&D2Common.#10562>
6FCBE848  |. 83F8 02        CMP EAX,2
6FCBE84B  |. 0F85 13010000  JNZ D2Game.6FCBE964
6FCBE851  |> 83FD 01        CMP EBP,1
6FCBE854  |. 0F85 0A010000  JNZ D2Game.6FCBE964
6FCBE85A  |. 6A 00          PUSH 0
6FCBE85C  |. 6A 78          PUSH 78                                 ;DamageAC Stat
6FCBE85E  |. 56             PUSH ESI
6FCBE85F  |. E8 16D10500    CALL <JMP.&D2Common.#10520>              ;get stat value (base+items)
6FCBE864  |. 8BE8           MOV EBP,EAX
6FCBE866  |. 85ED           TEST EBP,EBP
6FCBE868  |. 74 1B          JE SHORT D2Game.6FCBE885
6FCBE86A  |. 6A 00          PUSH 0
6FCBE86C  |. 6A 1F          PUSH 1F                                 ;AC Stat
6FCBE86E  |. 53             PUSH EBX
6FCBE86F  |. E8 1ECE0500    CALL <JMP.&D2Common.#10519>            ;get stat value (base+items)
6FCBE874  |. 03C5           ADD EAX,EBP
6FCBE876  |. 79 02          JNS SHORT D2Game.6FCBE87A
6FCBE878  |. 33C0           XOR EAX,EAX
6FCBE87A  |> 6A 00          PUSH 0
6FCBE87C  |. 50             PUSH EAX
6FCBE87D  |. 6A 1F          PUSH 1F                                 ;AC Stat
6FCBE87F  |. 53             PUSH EBX
6FCBE880  |. E8 23D00500    CALL <JMP.&D2Common.#10517>                   ;set stat value  (seems to be end of related code)
6FCBE885  |> 53             PUSH EBX
6FCBE886  |. E8 21D50500    CALL <JMP.&D2Common.#11058>           ;check if unit is a demon
6FCBE88B  |. 85C0           TEST EAX,EAX
6FCBE88D  |. 74 11          JE SHORT D2Game.6FCBE8A0
6FCBE88F  |. 6A 00          PUSH 0
6FCBE891  |. 6A 79          PUSH 79                                 ;DMG vs demon Stat (so finished with damageac stat)
6FCBE893  |. 56             PUSH ESI

I haven't done any testing or looked too deeply into it as it was mostly just to see if I could find a starting point to work from tonight. Has anyone played around with this stat or fixed it? I couldn't find anything obvious in D2Common, but I just took a quick look. The surrounding code may not be related. I just copy/pasted around the section in case there is something there that someone can spot as an obvious error. I'll look more deeply into it when I get home this evening and report back if nobody else has looked into it yet.

Any help is appreciated as always.

Edit: Can't find info on D2Common.#10562 or D2Common.#10342.

Edit2:
D2Common.#10520 and D2Common.#10519 are documented to do the same thing. (get a stat value)
However, D2Common.#10520 is used rather than D2Common.#10519 for the damageac stat in the second code section, but D2Common.#10519 is used in the first section.
Could D2Common.#10520 be returning the value of the stat as a negative?

Edit3: changing damageac stat following function to D2Common.#10520 still had no effect. So I guess it's not returning as negative.
In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as "A bad move".
Douglas Adams

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

Hand-picked

Re: item_damagetargetac non functional? (1.10f)

Post by kingpin » Mon Feb 22, 2016 9:06 pm

Following functions is this:

D2Common.10342 D2GetRoomFromUnit

STDCALL_FUNCTION(DRLGRoom*, D2Common2866, (Unit* ptUnit));

D2Common.10562 D2GetAlignment

STDCALL_FUNCTION(DWORD, D2Common2942, (Unit* ptUnit));

Also, to use the stat you need use stat -x -x

User avatar
PureRage
Forum Regular
Angel
Posts: 570
Joined: Fri Jan 08, 2010 9:02 am
Location: Newcastle, England
Great Britain

Re: item_damagetargetac non functional? (1.10f)

Post by PureRage » Mon Feb 22, 2016 9:44 pm

I tried -30 -30 and 30 30. Both showed no effect in game when used as monprop. Is it just a client display issue? (I searched D2Client for the stat but couldn't find anything that stood out))

I wanted to spend some time on this tonight but a friend came to visit so I've not had a chance yet. Does it work for you using -x values as monprop? It could be related to another issue I've come across with the stupidity stat and dim vision from non hard pointed dim vision necro not working. I'm having a hard time pinning down those issues though as not all the edits made to the .dlls are mine and only mine are documented :(
In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as "A bad move".
Douglas Adams

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

Hand-picked

Re: item_damagetargetac non functional? (1.10f)

Post by kingpin » Mon Feb 22, 2016 10:56 pm

PureRage" wrote:I tried -30 -30 and 30 30. Both showed no effect in game when used as monprop. Is it just a client display issue? (I searched D2Client for the stat but couldn't find anything that stood out))

I wanted to spend some time on this tonight but a friend came to visit so I've not had a chance yet. Does it work for you using -x values as monprop? It could be related to another issue I've come across with the stupidity stat and dim vision from non hard pointed dim vision necro not working. I'm having a hard time pinning down those issues though as not all the edits made to the .dlls are mine and only mine are documented :(
stat is an itemstat, not saved stat as far as I can remember. As stat not saved on unit, it wont work as monprop, as it expect to read stat from an item. What you can do is add an item to the monster, that have damageac stat as autostat for the item.

User avatar
PureRage
Forum Regular
Angel
Posts: 570
Joined: Fri Jan 08, 2010 9:02 am
Location: Newcastle, England
Great Britain

Re: item_damagetargetac non functional? (1.10f)

Post by PureRage » Tue Feb 23, 2016 2:58 am

Ty, I'll try with a range 0 aura :)

Edit: Tried adding it to might and granting might to fallens via monprop
Might:
Ast3 = item_damagetargetac
Ast3 calc: -30
No effect when hit by fallens (Def remains static)

As an item given to fallen1: inventory set to 1, added dmg-ac -30 -30 to a unique cap and equipped it via monequip.txt. Confirmed item was equipped by giving it a visible aura on equip
No effect from being hit by fallen.

Stat seems non functional for me.
In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as "A bad move".
Douglas Adams

Post Reply

Return to “Code Editing”