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
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
Code: Select all
6FCEB63F EB 27 JMP SHORT D2Game.6FCEB668
Code: Select all
D2Game.0xAB8E2 74 27 je d2game.xxxxxx
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
Code: Select all
6FCEB7F1 0F83 11010000 JNB D2Game.6FCEB908
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.