Making it so dodge/avoid/evade doesn't break skills

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Freddy
Posts: 37
Joined: Sat Apr 28, 2012 3:59 pm

Making it so dodge/avoid/evade doesn't break skills

Post by Freddy » Sat Apr 28, 2012 4:13 pm

If you use skills like zeal/fend or pretty much anything, if dodge or avoid or evade trigger then the attack will miss.

Shield block and assassin claw block don't behave like this.

I'm not sure exactly what part of the skill is making this happen but I did find this

http://classic.battle.net/diablo2exp/sk ... sive.shtml
Dodge/Avoid/Evade Skills
The Dodge/Avoid/Evade skills will kick-in and work if your Amazon is in the middle of an attack animation, without showing the Dodge/Avoid/Evade animation.

So the skills should just be blocking damage and not doing animations which interrupt anything if your hero is busy.

Can anyone think of a way of fixing this? such as disabling the animation if your hero is busy if this is the issue, or even basing the skill off shield block or assassin claw block or something, is that possible? Or anything anyone can think of that would fix this?

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

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Necrolis » Sat Apr 28, 2012 4:36 pm

this is a bug deep in the core of D2, its only real fix is to recode the portions of code handling server and client frame management (see some of Nefarius' posts in CE).
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

Freddy
Posts: 37
Joined: Sat Apr 28, 2012 3:59 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Freddy » Sat Apr 28, 2012 6:32 pm

I see, thank you. This is all I could find about it, but it doesn't appear to be the kind of fix I think I could make such as making a new skill based on assa claw block or something viewtopic.php?f=8&t=53570

It seems that Nefarius has managed to fix this bug, but didn't post the fix as it was alot of code. Do you know if it's available anywhere like the "Nefarius's Fixed TXT Files"?

By the way do you know if "Nefarius's Fixed TXT Files" is safe to use with 1.13d or if the patch changes since it was released will break things?

User avatar
cla$$ics
Moderator
Arch-Angel
Posts: 1320
Joined: Wed Aug 15, 2007 3:48 pm
United States of America

Hand-picked

Re: Making it so dodge/avoid/evade doesn't break skills

Post by cla$$ics » Sat Apr 28, 2012 7:55 pm

No, code fixes generally aren't available as plugins (if they were, I guarantee you they wouldn't be for 1.13 as most code editors around here work with 1.10 or 1.11, the latter of which Nefarius works extensively with)
Nefarius's Fixed Text files work for any version past 1.10.
Although done for our needs, mod-makers should like these changes, too.
11/1/08 - COTL; 5/10/09 - Angel; 11/11/09 - Archangel

User avatar
mirecek
Dark Alliance Beta Test
Arch-Angel
Posts: 1218
Joined: Sun Sep 11, 2005 10:04 am

Re: Making it so dodge/avoid/evade doesn't break skills

Post by mirecek » Sat Apr 28, 2012 8:03 pm

"Each of those few chords separated by complete silence feels like a knife wound to the heart"

There is no greater sorrow than to recall happiness in times of misery. Draconian

OrganizedChaos
Posts: 70
Joined: Sat Mar 05, 2011 10:03 am

Re: Making it so dodge/avoid/evade doesn't break skills

Post by OrganizedChaos » Sat Apr 28, 2012 8:54 pm

Nefarius has been so kind to provide this information on my inquiry of similar nature, where I asked if I can cancel out all dodge animations while keeping the desired effect:

You'll need to locate D2Game.ApplyAttackResults in the version you're working with and remove the response to three resultflags, namely:

Code: Select all
RESULTFLAG_DODGE = 0x80,
RESULTFLAG_AVOID = 0x100,
RESULTFLAG_EVADE = 0x200,


You'll find three checks there for these flags, the first two set the mode to S1, the last one just tells the client to play a sound as a response to the event.

So, according to him, it is possible and according to my logic it should normalize fend and jab and stuff. The problem on my end is I am not nearly savvy enough to implement this myself, but if someone could walk me and possibly others through it, this could be a solution to this pesky issue.

Freddy
Posts: 37
Joined: Sat Apr 28, 2012 3:59 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Freddy » Sun Apr 29, 2012 5:28 pm

So disabling the animation is enough to stop dodge, etc from making skills miss?

I have gone through all the MPQ files with an mpq editor and none of the files have the text "ApplyAttackResults" when searched through. Going through D2Game.dll with a hex editor didn't result in anything either.

OrganizedChaos
Posts: 70
Joined: Sat Mar 05, 2011 10:03 am

Re: Making it so dodge/avoid/evade doesn't break skills

Post by OrganizedChaos » Mon Apr 30, 2012 8:32 am

That's the same for me, isn't there a single person except Nefarius who knows where and how to edit this? I really don't wish to bother him again...

User avatar
Dew
Posts: 96
Joined: Fri Sep 03, 2010 7:20 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Dew » Mon Apr 30, 2012 10:53 am

Its not a txt file its in d2game.dll I'm not sure where to find it or how to apply it tho
Mod Progress= Dead
Currently working on releasing new animations
Updates Found Here

Freddy
Posts: 37
Joined: Sat Apr 28, 2012 3:59 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Freddy » Mon Apr 30, 2012 12:12 pm

I think you could apply it with a hex editor, the hex address would change depending on the version, but the hex string eg (0F 85 F4 00 00 00) which would just be changed to make the fix, should stay the same because blizzard have not edited the code related to the change we want to make throughout the different versions of D2.

Some people posting on the forum have documented the hex addresses and strings of certain things and even what to change the string to, to make certain fixes.

But as far as I know, nobody has documented anything on "ApplyAttackResults" in D2Game.dll for any version of D2 or the resultflags

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Making it so dodge/avoid/evade doesn't break skills

Post by kidpaddle94 » Mon Apr 30, 2012 12:40 pm

all needed informations there: viewtopic.php?f=8&t=49063

Freddy
Posts: 37
Joined: Sat Apr 28, 2012 3:59 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Freddy » Mon Apr 30, 2012 6:41 pm

For some reason the addresses in d2game.dll are between 77760000 and 77835FFE for me when opened in ollydb, but the addresses shown in that topic are ~6FCB9917 which means I can't find anything in that topic inside d2game.dll

I guess we need to find the function

enum eRESULTFLAG
{
....
RESULTFLAG_NOEVENTS = 32,
RESULTFLAG_DODGE = 128,
RESULTFLAG_AVOID = 256,
RESULTFLAG_EVADE = 512
....
}

and comment out "RESULTFLAG_DODGE = 128","RESULTFLAG_AVOID = 256","RESULTFLAG_EVADE = 512" or replace those lines with 00 in hex editor or even change "128, 256 and 512" with "32" if NOEVENTS lives up to its name.

OrganizedChaos
Posts: 70
Joined: Sat Mar 05, 2011 10:03 am

Re: Making it so dodge/avoid/evade doesn't break skills

Post by OrganizedChaos » Tue May 01, 2012 7:30 am

Tell me how it worked out for you later :)

User avatar
HarvestWombs
Senior Moderator
Arch-Angel
Posts: 1019
Joined: Wed May 25, 2011 11:50 pm
United States of America

Re: Making it so dodge/avoid/evade doesn't break skills

Post by HarvestWombs » Tue May 01, 2012 7:39 am

Freddy" wrote:For some reason the addresses in d2game.dll are between 77760000 and 77835FFE for me when opened in ollydb, but the addresses shown in that topic are ~6FCB9917 which means I can't find anything in that topic inside d2game.dll
The topic is for v1.11b, so you need to learn how to find the offsets for whatever version you are using.
Official Phrozen Keep Discord
Common Modding tools: link
My Resource Packs: link

Freddy
Posts: 37
Joined: Sat Apr 28, 2012 3:59 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Freddy » Tue May 08, 2012 4:17 pm

Ok, I think this will fix it:

Dodge: no more animation, no more dodge sound, and attacks don't miss, but dodge does continue to work.
Avoid: no more animation, and the character makes a hurt sound when they are avoiding, but they don't take damage.
Evade: I don't know if evade even had an animation to begin with, it doesn't seem to. I'm not sure evade needs to be changed as it only triggers when running or walking, and if you are running or walking you are not attacking so it shouldn't make your attacks miss.

This is what was changed, I don't know if there are any unintended consequences, testing was limited:
Dodge:

Code: Select all

A8 04          TEST AL,4
74 06          JE SHORT D2Game.084DDA29
81CB 80000000  OR EBX,80
For the last line the 80 was changed to 0

Avoid and evade:

Code: Select all

// BLOCKFLAG_EVADE
6FCB9A1E   TEST AL,8
6FCB9A20   JE SHORT D2Game.6FCB9A26
6FCB9A22   OR BYTE PTR DS:[EDI+5],2

// BLOCKFLAG_AVOID
6FCB9A26   TEST AL,2
6FCB9A28   JE SHORT D2Game.6FCB9A2E
6FCB9A2A   OR BYTE PTR DS:[EDI+5],1
Removed the last line for each block of code.

using a hex editor like XVI32 on d2game.dll

1.11b fixes:
dodge:
7DA25: change 80 to 00

avoid:
99A2A: change 80 4F 05 01 into 90 90 90 90

evade:
99A22: change 80 4f 05 02 into 90 90 90 90

1.13d fixes

dodge:
8BC3D: change 80 to 00

avoid:
42E32: change 80 4F 05 01 to 90 90 90 90

evade:
42E2A: change 80 4f 05 02 into 90 90 90 90

OrganizedChaos
Posts: 70
Joined: Sat Mar 05, 2011 10:03 am

Re: Making it so dodge/avoid/evade doesn't break skills

Post by OrganizedChaos » Tue May 22, 2012 6:30 am

Although took me a while to find it in my 1.13 dll, I can verify that this works well. Well done Freddy.

User avatar
mmpx222
Junior Member
Paladin
Posts: 154
Joined: Sat Apr 26, 2014 9:19 am
Korea South

Re: Making it so dodge/avoid/evade doesn't break skills

Post by mmpx222 » Wed Feb 04, 2015 2:05 pm

I've went and found offsets for 1.13c. All code tested using Jab and Fend with a 100% CTC Nova-on-hit javelin to see if the bug persists.

Dodge plays no sound/animation:

Code: Select all

D2Game.0x000DE673
81 CB 80 00 00 00 => 90 90 90 90 90 90
Avoid plays "get hurt" sound and no animation:

Code: Select all

D2Game.0x0003AF4A
80 4F 05 01 => 90 90 90 90
Evade procs while moving, and according to my experiments there is no animation for Evade in 1.13c so no need to bother.

However, I thought up an aesthetically better workaround: what if, instead of NOPing the code, we fool the game into treating BLOCKFLAG_DODGE and BLOCKFLAG_AVOID in the same manner as BLOCKFLAG_EVADE? Then players can identify when Dodge/Avoid is proccing by listening for the D/A/E "hyah!" cry -- and still have the bug fix.

Alternative hack: Dodge -> Evade

Code: Select all

D2Game.0x000DE673
81 CB 80 00 00 00 => 81 CB 00 02 00 00
Alternative hack: Avoid -> Evade

Code: Select all

D2Game.0x000DE669
81 CB 00 01 00 00 => 81 CB 00 02 00 00
D2Game.0x0003AF4A
80 4F 05 01 => 80 4F 05 02
Note that Avoid needs two code edits since the game checks this in two places.

Bare-bones testing shows this works fine--Dodge/Avoid/Evade all procs with "Hyah!" and without any animation, allowing Fend/Jab to work perfectly :)
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

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

Re: Making it so dodge/avoid/evade doesn't break skills

Post by leekun » Sat Feb 24, 2018 6:13 am

Sorry for necroing this thread, anyone has the offsets of the fix below for 1.10?
mmpx222 wrote:
Wed Feb 04, 2015 2:05 pm

Alternative hack: Dodge -> Evade

Code: Select all

D2Game.0x000DE673
81 CB 80 00 00 00 => 81 CB 00 02 00 00
Alternative hack: Avoid -> Evade

Code: Select all

D2Game.0x000DE669
81 CB 00 01 00 00 => 81 CB 00 02 00 00
D2Game.0x0003AF4A
80 4F 05 01 => 80 4F 05 02
Note that Avoid needs two code edits since the game checks this in two places.
EDIT: I still can't find them.
For some reason, v1.10 doesn't use the same bytes as the other ones...
Help would be appreciated.

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: Making it so dodge/avoid/evade doesn't break skills

Post by devurandom » Sun Feb 25, 2018 7:51 am

[1.10] Please verify... offsets un-tested

Code: Select all


Dodge 

000923D0   A8 04            TEST AL,04
000923D2   74 03            JE SHORT 000923D7
000923D4   80CB 80          OR BL,80



Evade - Avoid

0002F60C   A8 08            TEST AL,08
0002F60E   74 04            JE SHORT 0002F614
0002F610   804E 05 02       OR BYTE PTR DS:[ESI+5],02
0002F614   A8 02            TEST AL,02
0002F616   74 04            JE SHORT 0002F61C
0002F618   804E 05 01       OR BYTE PTR DS:[ESI+5],01

Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

chamsae
Posts: 1
Joined: Mon Jun 22, 2020 9:28 am
Korea South

Re: Making it so dodge/avoid/evade doesn't break skills

Post by chamsae » Tue Jun 23, 2020 2:54 pm

freddy
I can't find it in 1.13d.

User avatar
Nagahaku
Junior Member
Paladin
Posts: 119
Joined: Sat Nov 30, 2019 1:11 am

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Nagahaku » Wed Jul 22, 2020 9:47 am

This bug can be somehow fixed in txt:
add 3 new lines in states.txt, copy original 3 lines to them and rename them as "dodgenobug" or something, then use those new states in skills.txt and the bug would not appear again.
But the animation would gone as well, your ama would dodge/avoid/evade without animation.

d2dad
Posts: 5
Joined: Wed Jan 13, 2021 4:04 am
United States of America

Re: Making it so dodge/avoid/evade doesn't break skills

Post by d2dad » Wed Jan 13, 2021 4:24 am

Has anyone else tried this? I used mmpx222 's suggestion and Dodge works great! Bravo! However, Avoid does not work. No sound no Avoid. My code edit matches exactly.

EnPhreg
Posts: 6
Joined: Thu Jan 21, 2021 3:50 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by EnPhreg » Thu Feb 18, 2021 5:30 pm

mmpx222 wrote:
Wed Feb 04, 2015 2:05 pm
However, I thought up an aesthetically better workaround: what if, instead of NOPing the code, we fool the game into treating BLOCKFLAG_DODGE and BLOCKFLAG_AVOID in the same manner as BLOCKFLAG_EVADE? Then players can identify when Dodge/Avoid is proccing by listening for the D/A/E "hyah!" cry -- and still have the bug fix.

Alternative hack: Dodge -> Evade

Code: Select all

D2Game.0x000DE673
81 CB 80 00 00 00 => 81 CB 00 02 00 00
Alternative hack: Avoid -> Evade

Code: Select all

D2Game.0x000DE669
81 CB 00 01 00 00 => 81 CB 00 02 00 00
D2Game.0x0003AF4A
80 4F 05 01 => 80 4F 05 02
Note that Avoid needs two code edits since the game checks this in two places.
greetings,
i managed to find the corresponding values for dodge and avoid in the 1.14d game.exe for the positions DE669 and DE673 (from the 1.13c d2game.dll). but can't find the last value for the avoid fix at position 3AF4A.
can't find the corresponding code in the 1.14d game.exe and searched a lot for it. dodge works fine, but avoid didn't work without the second code change.
anybody knows the right position for the 3AF4A value in the 1.14d game.exe?

EnPhreg
Posts: 6
Joined: Thu Jan 21, 2021 3:50 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by EnPhreg » Tue May 04, 2021 8:36 pm

i managed to find the corresponding entries in the 1.14d game.exe
so here it comes for everybody who wants it (i also put the surrounding code in clings behind it, in case somebody can't use my code for the position, so you alternative can search direct for the code line in game.exe):

Dodge:
at position 17ecfd change 80 00 to 00 02 (A8 04 74 06 81 CB 80 00 00 00)

Avoid:
at position 17ecf4 change 01 to 02 (A8 02 74 06 81 CB 00 01 00 00)
at position 1ad84b change 01 to 02 (A8 02 74 06 66 81 4E 04 00 01)

if you use this with D2 1.14d game.exe, you will have no animation for the Dodge and Avoid actions of your amazon.
but to have also the "hyah" sound when the skills are triggered, like mentioned above in the post from mmpx222, you need to have at least 1 skill point at the Evade skill.
i also can say and have tested it, that the Dodge and Avoid skills (with changed animation to Evade) also working correct without a skill point at Evade, it's really just the "hyah" sound, why you would need a skill point at the Evade skill. so if you also want no sound for the Dodge and Avoid skills and doesn't need the Evade skill, you can left the skill without any point.
hope someone can use this information. have fun.

Question
Posts: 87
Joined: Sat Nov 28, 2009 1:53 pm

Re: Making it so dodge/avoid/evade doesn't break skills

Post by Question » Sun Sep 05, 2021 4:05 am

Nagahaku wrote:
Wed Jul 22, 2020 9:47 am
This bug can be somehow fixed in txt:
add 3 new lines in states.txt, copy original 3 lines to them and rename them as "dodgenobug" or something, then use those new states in skills.txt and the bug would not appear again.
But the animation would gone as well, your ama would dodge/avoid/evade without animation.
Tested this and can confirm it works, seems like the easiest way to fix this since you dont need code editing.

Post Reply

Return to “General Mod Making”