The DruidWolf's AI Micro-Compendium

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

Hand-picked

The DruidWolf's AI Micro-Compendium

Post by Ogodei » Fri Jul 20, 2018 8:04 am

Hello :)

I analyzed the code that handles the DruidWolf's AI. Here are my findings:

This AI is not one, but actually consists of two different AI's: There's one AI specifically made for the monster ID #420, which is the Spirit Wolf (the level 6 pet) and one that handles the other non-specific ID's (including the Dire Wolves, the level 18 pets).

1. Spirit Wolf

The Spirit Wolf has a fancy way to warp at the owner: when he exceeds the hardcoded distance of 50 sub tiles, the Wolf will cast Skill1 on him (so make sure this is a teleport skill).

This is, instead, what the AIParams do:

Code: Select all

AIParam1 : Difficulty dependant, Stall Time during attacks: This needs to match the A1 animation of your minion's dcc file, or it will produce odd results like attacking twice with a single skill.

AIParam2: Difficulty dependant, Chance to Randomly walk for 10 sub tiles when the enemy attacked by both the player and the AI dies.

AIParam3: Difficulty dependant, Combat leash: Disengage to follow the owner when the distance from him exceeds this param.

AIParam4 : Difficulty dependant, AI Radius for searching targets.

AIParam5: Difficulty dependant, Fast Leash: When the owner's distance exceeds this AIParam, the wolves will gain a 100% speed bonus, use RN mode and run to the owner.
2. Dire Wolf and other custom pets

Even the Dire Wolf and the other non-hardcoded custom pets will inherit the fancy way of the Spirit Wolf for warping at the owner, but there is a difference. Even if the distance is always hardcoded and consists in 50 sub tiles, the AI will not use Skill1, but Skill2.

Skill1 Is reserved for the corpse-eating skill which is Fenris Rage. For this purpose, please keep in mind that in the fenris_rage state ID (#138) is hardcoded as the AI will constantly check for this state before even attempting to eat a corpse.

This is what the non-hardcoded-to-ID AIParams do:

Code: Select all

AIParam1 : Difficulty dependant, Stall Time during attacks: This needs to match the A1 animation of your minion's dcc file, or it will produce odd results like attacking twice with a single skill.

AIParam2: Difficulty dependant, Chance to Randomly walk for 10 sub tiles when the enemy attacked by both the player and the AI dies.

AIParam3: Difficulty dependant, Chance to eat nearby corpses by using Skill1. (the wolves won't act as Regurgitators, meaning they won't approach corpses: the corpse therefore needs to be in the same position or very close to the wolf for this param to sort any effect if it rolls). 

AIParam4: Difficulty dependant, AI Radius for searching targets.

AIParam5: Difficulty dependant, Combat Fast leash: Disengage to follow the owner when the distance from him exceeds this param. Dire Wolves gain +100% speed bonus and use RN mode to catch up with the owner.

Post Reply

Return to “General Mod Making”