[Tutorial] Summoning minions with random 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

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

Hand-picked

[Tutorial] Summoning minions with random skills

Post by Ogodei » Fri Aug 20, 2021 6:05 pm

Hello,

Today I would like to share a simple guide on how to give more flexibility to your summoner characters.

We are going to add a skill that summons a monster that gets a random skill and uses it to fight by your side.

1) First things first, we need to create our new minion. You will need to create a new MonStats.txt row or edit an existing one so that the monster gets the ShadowMaster's AI and has its Inventory, Align, InTown and NeverCount fields set to 1.
Setting the AI as ShadowMaster is a must as this AI can use all the "AITyped" skills its unit possesses regardless of MonStats.txt itself (so, even oskills from items count).
Inventory needs to be set to 1 because it'll make the game generate an inventory for our unit.
Align and InTown need to be set to 1 because the former marks the unit as allied with the players and the latter serves the purpose of both letting players walk through it and make the minion move in town during multiplayer game session.
Last - but not least - NeverCount is a field that makes the game never take the unit into account during computations such as the remaining monsters to kill in order to clear the Den of Evil or the amount of enemy units present in a room.
As for the ShadowMaster's AIParams, you can either refer to my compendium about this AI or leave it vanilla, directly taking it from the vanilla Assassin's summon.

After having setup our unit in MonStats.txt we have to check if the vanilla unit has a running animation (like corrupt rogues).
If your minion of choice has and can use the RN animation, then skip to point 3), otherwise keep reading.

2) We will create a new MonStats2.txt row, which will be a row cloned from the original line with the addition of the parameters referring to the running animation (RN mode). We need to handle the following two fields:

Code: Select all

mRN = 1,
dRN = how many direction the unit's RN animation has (usually 8)
This is necessary because the ShadowMaster uses this mode when approaching the enemy to perform a melee attack or flee when surrounded by 6 or more enemies. If you don't enable the running animation for the unit, it will vanish upon initiating the approach or flee routines only to reappear once it has reached the destination.
After setting up the MonStats2.txt entry we need to actually make usable graphics for the unit while in RN mode. In order to do so, you have to extract the monster's animations from the MPQ Archives (D2Data.mpq if you picked a non-expansion monster or D2Exp.mpq if the monster has been introduced with the Lord of Destruction expansion set).
Once the animations are extracted and placed into the correct folder (Data\Global\Monsters\) you will then clone all the COFs concerning the walking animation (xxWLyyy , xx being the token of the monster and yyy being its weaponclass, usually HTH) and rename WL as RN , so that you end up with xxRNyyy. Do the same for the DCC files showing the WL mode in their denomination.
After you've done that, proceed to edit AnimData.d2 in the same way: clone your monster token's WL animation entry and rename it as RN. Repack your AnimData.d2 and put it inside Data\Global.

3) After we have finished with our minion and its AI and graphic settings, we need to actually create the skill that summons it, as well as a set of other spells. For the tutorial's sake we'll make things simple and create three different sets of cloned vanilla spells.
Aside from a summoning spell, easily obtainable by either cloning or editing a vanilla one, we'll be cloning a few sorceress spells and let our summoner character call succubi each with a different set of elemental spells (cold, fire, lightning).

In my case, I cloned the following spells, kept their name pointers intact but added "Minion" in front of it, so if you follow my steps we'll have:

Code: Select all

Minion Fire Bolt
Minion Charged Bolt
Minion Ice Bolt
Minion Frozen Armor
Minion Static Field
Minion Ice Blast
Minion Fire Ball
Minion Lightning
Minion Enchant
Minion Glacial Spike
Minion Thunder Storm
The first thing we need to do with these new rows is clearing the charclass field, so that they become 'monster skills' and don't bug out non-sorceress classes on game creation. We'll then set each skill's MonAnim field to the animation we want our minion to use, and that is because the ShadowMaster's AI looks at this field should the skill not be present in its unit's MonStats.txt row. In my case, I have put S2 as that's the succubus' casting animation mode.
The last step we have to do here is setting the proper AIType for each skill. I specified what each AIType does in my guide, but for the sake of simplicty:

Code: Select all

Minion Fire Bolt's AIType = 5
Minion Charged Bolt's AIType = 5
Minion Ice Bolt's AIType = 5
Minion Frozen Armor's AIType = 1
Minion Static Field's AIType = 5
Minion Ice Blast's AIType = 5
Minion Fire Ball's AIType = 5
Minion Lightning's AIType = 5
Minion Enchant's AIType = 1
Minion Glacial Spike's AIType = 5
Minion Thunder Storm's AIType = 1 [set InTown to 1 for this skill or the minion will try to cast it and fail in town]
This will make the skills of AIType 5 be considered attack skills, while those of Type 1 will be considered self-buffs.

4) After the skills are done, we will create a new dummy item that will be equipped on the monster upon summoning. We will create three different uniques based on this dummy items, and these uniques will assign different set of spells to our minion.

In my case, I cloned a ring in Misc.txt and assigned the custom item code 'xx1'. I also made sure it cannot be dropped by monsters by setting its rarity to 0 and it's required mLvl to drop to absurdly high numbers like 1000. You can do the same.
After the cloned ring has been created, we need to take a look at UniqueItems.txt and create three new rows.
The fields you need to fill here are:

Code: Select all

Version = 100
enabled = 1
rarity  = 1
nolimit = 1
lvl = 1
reqlvl = 1
code = xx1 (our dummy item)
prop1 = ease
par1 = blank
min1-max1 = -100 / -100 (it erases any str\dex requirements for the item)
then, the other properties will differ depending on the spell set. In this tutorial, we want to make three differently specialized succubi, so we'll make each dummy item assign spells from the same elemental tree via the oskill property:

Code: Select all

propX = oskill
parX = name pointer of the skill
min X - max X = maximum \ minimum level of the skill (if min = max , it's a fixed a level, else it's randomly rolled between those two params).

Once the item is ready, you can open MonEquip.txt and create a row for our minion, using the same name MonStats.txt does.

Code: Select all

monster = your minion's name from monstats.txt
oninit = 0 (monster created by skill)
level = 0 (level of the summoning skill required in order to get the item)
item1 = your item code (xx1)
loc1 = lrin (left right)
quality = 7 (unique)
and that's all about it. If you want, you can also assign a color shifting custom state like I did in the demonstration video to better highlight which minion gets which skills.




I really hope you've enjoyed it, and happy modding!

P.S : this is a very flexible method to have a wide variety of minions from the same summoning skill. You can also play around with the 'level' requirement in MonEquip and several dummy baseitems and uniques to make spell types actually scale with the summoning skill's level (for instance, you can make a minion use Ice Bolt at sLvl 1 and have that replaced with Ice Blast from sLvl 10 onwards, and so on).

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: [Tutorial] Summoning minions with random skills

Post by Myhrginoc » Sun Aug 22, 2021 10:15 pm

Very nice tutorial!! I might borrow these ideas for Awakening, since I'll have plenty of room to fill. Did you try this technique out with the opposition?
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

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

Hand-picked

Re: [Tutorial] Summoning minions with random skills

Post by Ogodei » Mon Aug 23, 2021 5:59 am

Hello and thanks! :)

I did not, the main problem being that enemies cannot use the Shadow Master's AI as it requires a player to be the owner of the unit (vanilla speaking).
All the other AIs are set to only use the skills they got from MonStats.txt (and Hireling.txt in the case of 'Hireable').

That said, there's an extra tip :) you can expand the Hireable functionality by setting their AI to ShadowMaster : if you equip them with an item that adds an oskill they'll use it as long as said skill has the correct ' AIType '.

yyyiiyyy
Posts: 2
Joined: Mon May 24, 2021 9:36 pm

Re: [Tutorial] Summoning minions with random skills

Post by yyyiiyyy » Wed Jan 12, 2022 11:40 pm

great guide, but i have a question, why not assign the skill directly in the monstat instead of using a monprop?

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

Hand-picked

Re: [Tutorial] Summoning minions with random skills

Post by Ogodei » Fri Jan 14, 2022 1:30 pm

yyyiiyyy wrote:
Wed Jan 12, 2022 11:40 pm
great guide, but i have a question, why not assign the skill directly in the monstat instead of using a monprop?
Hello :)

If you assign the skills directly in monstats every minion you summon will have every assigned skill and use them all accordingly, as the ShadowMaster's AI can use all of the skills the minion knows.

Post Reply

Return to “General Mod Making”