[1.10f / 1.13c ] Fixing Shadow Master's AI

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
Ogodei
Senior Moderator
Angel
Posts: 516
Joined: Thu Mar 10, 2016 8:31 am
Italy

Hand-picked

[1.10f / 1.13c ] Fixing Shadow Master's AI

Post by Ogodei » Tue May 03, 2016 1:27 am

Hello guys,

Before we begin, a shoutout to Rayveen who prompted me to port this tiny change to 1.13c as well.

Today I'm going to be "fixing" the Shadow Master's AI, which has two annoying traits - not bugs - that make it hard to have multiple minions with this AI.

These are:
1. If you have multiple pets using this AI, everyone tires to hit the closest monster to you.
2. When you click an enemy to attack him or to cast a skill, your minions switch target and try to help you, even if they're already engaged in combat.

I've been working on a fix for a while and tried every sort of softcoded shenanigans, but then I realized it had to be fixed through code.

I wanted this "fix" so bad that it actually gave me enough motivation to start coding and reverse engineering, so I'm both glad and proud to share it with you today :D

So, here is what we have to do, in 4 simple steps.

A. hotfix for those who tried my code edit before I fixed it: if you tried point A before I edited this article, make sure that the hex at D2Game.6FCEB73E is "7F 09", then proceed to point B.

b. Preventing your minions from always attacking your target

1.10f

Code: Select all

 6FCEB63F   74 27            JE SHORT D2Game.6FCEB668 
change to:

Code: Select all

 6FCEB63F   EB 27            JMP SHORT D2Game.6FCEB668 
1.13c

Code: Select all

 D2Game.0xAB8E2          74 27    je d2game.xxxxxx  
change to:

Code: Select all

 D2Game.0xAB8E2          EB 27    jmpd2game.xxxxxx  

c. Preventing your minions from always trying to attack the closest enemies to their owner

1.10f

Code: Select all

 6FCEB7F1   0F84 11010000    JE D2Game.6FCEB908 
change to:

Code: Select all

 6FCEB7F1   0F83 11010000    JNB D2Game.6FCEB908 
1.13c

Code: Select all

 D2Game.0xABA41  75 77    jne d2game.xxxxxx  

change to:

Code: Select all

 D2Game.0xABA41  EB77    jmp d2game.xxxxxx  


d. Softcoded - fixing melee behavior of archers and casters

The Shadow Master's AI is hardcoded to roll a chance to go in melee range and use the ''Attack'' skill ( hcIdx 0 in Skills.txt ).
I have found a way to disable that feature.

- In Monstats.txt
- Go to the row of your minion in MonStats.txt and insert the " Attack " skill with NU as mode in one of the skill columns;


In Monstats2.txt
- find the MonStat2 entry of your minion and set the MeleeRng column to a high number (in my case, I put 999).

This will prevent your archers and caster type minions from running in melee range.

With all these modifications, you'll have an unbugged Shadow Master's AI which perfectly handles the skill usage.

I would like to thank Kingpin for pointing me to the offsets of the AI table start in 1.10 :) .

Without his hint , the points a / b / c wouldn't have been possible.
Last edited by Ogodei on Thu Jan 18, 2018 12:16 pm, edited 6 times in total.

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

Re: [1.10] Fixing Shadow Master's AI

Post by devurandom » Tue May 03, 2016 6:07 am

I'm assuming this will help prevent the Shadow Master or other pets from always getting lost.

That is really nice to have. Thank You!
:)
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..

User avatar
weapon-x
Forum Legend
Arch-Angel
Posts: 1047
Joined: Wed Mar 18, 2009 4:52 am
Location: Mindanao, Philippines
Contact:
Philippines

Re: [1.10] Fixing Shadow Master's AI

Post by weapon-x » Tue Jun 14, 2016 4:21 am

thanks for sharin' bro...

cheers !
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "

~Mark Twain


User avatar
Xaphan
Hosted Forum Moderator
Arch-Angel
Posts: 1113
Joined: Fri Oct 08, 2010 10:55 am
France

Re: [1.10] Fixing Shadow Master's AI

Post by Xaphan » Sat Aug 27, 2016 1:29 am

Hey,

Just saw that in your 1st post, a. and c. are the same code edit, so one of thems is wrong :)

Other than that, thanks, this helped me to successfully have working ranged minions !

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

Hand-picked

Re: [1.10] Fixing Shadow Master's AI

Post by Ogodei » Sun Aug 28, 2016 5:39 pm

Xaphan" wrote:Hey,

Just saw that in your 1st post, a. and c. are the same code edit, so one of thems is wrong :)

Other than that, thanks, this helped me to successfully have working ranged minions !

Hello! :)

Thanks for highlighting that error, I will provide an edit to my first post as soon as I go home (sunday~monday)
I'm glad that my research on this AI has helped you: I will provide new update as soon as I discover new stuffs: My next work would be finding the coordinates of this AI warping-back function, in order to warp as close as possible to the player and not in a random part of the screen (this could help in preventing the pets from disappearing) :)

EDIT: Fixed the a. point :) thanks again Xaphan!

Theernestrain
Posts: 12
Joined: Mon Mar 12, 2018 9:39 am

Re: [1.10] Fixing Shadow Master's AI

Post by Theernestrain » Thu Mar 15, 2018 3:23 pm

Hey,

I appreciate all the tutorials you've made. You rock! I have a question about this topic though. Which .txt file do I apply the fixes? Will this fix also allow my uber diablo and uber mephisto summons to cast their skills with original animations?

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

Hand-picked

Re: [1.10] Fixing Shadow Master's AI

Post by Ogodei » Thu Mar 15, 2018 3:59 pm

Hello,

It's not a TXT but rather a DLL. The only TXT you're going to touch is Monstats2.txt in order to raise the MeleeRange attribute of your purely ranged minions. And, I don't know about Diablo and Mephisto. It may be that you missed to assign a sequence, or the proper animation in either Monstats.txt (their row) or in the MonAnim of the skill

Theernestrain
Posts: 12
Joined: Mon Mar 12, 2018 9:39 am

Re: [1.10] Fixing Shadow Master's AI

Post by Theernestrain » Mon Jan 14, 2019 8:11 pm

I've been trying to search for the code 6FCEB73E in XVI32 D2game.dll. But I cannot seem to find it. Am I looking in wrong place? I find codes like 0F84 11010000 when I use hex search function. But, there are multiples of that code.

EDIT: I seem to have gotten a little closer. I decided to use ollydbg instead of XVI32. Not the format of coding is pretty similar. But, 6FCEB73E or any of the others you listen, are non existant it appears. I used search for expression button on latest ollydbg, copied and pasted. Yet, nothing. I scrolled down manually and still not there. Not sure what needs to be done.

Bobby5454
Posts: 1
Joined: Tue Mar 24, 2020 10:42 am

Re: [1.10] Fixing Shadow Master's AI

Post by Bobby5454 » Tue Mar 24, 2020 4:49 pm

Is there a 1.13c version of this? I tried to mess around with manually finding it through comparing the bytes near the offsets on the 1.10 Game.dll to byte searching those areas on the 1.13c Game.dll, some were found, but B) and C) were just guess work. Also does this fix the Shadow Master not following the player as well as the Shadow Warrior does?

Follow Reference: When you run close to the Shadow Master it begins to follow you, but slowly somewhere along the line it just stops and keeps a distance to you, unless you are close to enemies.

User avatar
Specktro
Posts: 78
Joined: Sat Jun 10, 2017 12:49 am
Location: Rio Grande do Sul, Brasil
Brazil

Re: [1.10] Fixing Shadow Master's AI

Post by Specktro » Mon Apr 20, 2020 3:16 pm

Bobby5454 wrote:
Tue Mar 24, 2020 4:49 pm
Is there a 1.13c version of this? I tried to mess around with manually finding it through comparing the bytes near the offsets on the 1.10 Game.dll to byte searching those areas on the 1.13c Game.dll, some were found, but B) and C) were just guess work. Also does this fix the Shadow Master not following the player as well as the Shadow Warrior does?

Follow Reference: When you run close to the Shadow Master it begins to follow you, but slowly somewhere along the line it just stops and keeps a distance to you, unless you are close to enemies.
I'm trying to find this for 1.13c as well... :(
Tried using CorruptLancer Ai for my Jab-Jab mercenary, but it doesnt move on city, and on the wild it attacks monsters like crazy and go away killing in a chain like it was a player, we can just see it through map... kinda funny, but not intended..
Image
Be Xtreme!


Post Reply

Return to “Code Editing”