> For the complete documentation index, see [llms.txt](https://changelog.matrixemulator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://changelog.matrixemulator.com/welcome/server/muserver/data/monster/monsterai/monsteraiunit.md).

# MonsterAIUnit

<mark style="color:green;">An "AI profile" that can be assigned to a monster—links a state machine (</mark><mark style="color:green;">`MonsterAIAutomata.txt`</mark><mark style="color:green;">) to the concrete actions the monster performs in each situation (</mark><mark style="color:green;">`MonsterAIElement.txt`</mark><mark style="color:green;">).</mark>

<table data-search="false"><thead><tr><th>Column</th><th>Accepted Values</th><th>Description</th></tr></thead><tbody><tr><td>Index</td><td>Number, one per AI profile</td><td>Identifies this AI profile. This is the number used by <code>MonsterAIGroup.txt</code> to determine which AI a spawned monster will follow.</td></tr><tr><td>Name</td><td>Text enclosed in quotes</td><td>Profile name, used for identification only.</td></tr><tr><td>DelayTime</td><td>Number, in milliseconds</td><td>Interval between AI evaluations for this monster.</td></tr><tr><td>Automata</td><td>Number corresponding to a <code>Number</code> in <code>MonsterAIAutomata.txt</code></td><td>Specifies which state machine (Idle, Chase, Attack, Flee, etc.) this profile uses.</td></tr><tr><td>AIClassNormal</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIElement.txt</code>, or <code>*</code></td><td>Action executed while in the "Normal/Idle" state.</td></tr><tr><td>AIClassMove</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIElement.txt</code>, or <code>*</code></td><td>Action executed while in the "Move" state.</td></tr><tr><td>AIClassAttack</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIElement.txt</code>, or <code>*</code></td><td>Action executed while in the "Attack" state.</td></tr><tr><td>AIClassHeal</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIElement.txt</code>, or <code>*</code></td><td>Action executed while in the "Heal" state.</td></tr><tr><td>AIClassAvoid</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIElement.txt</code>, or <code>*</code></td><td>Action executed while in the "Flee/Avoid" state.</td></tr><tr><td>AIClassHelp</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIElement.txt</code>, or <code>*</code></td><td>Action executed while in the "Help/Support" state.</td></tr><tr><td>AIClassSpecial</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIElement.txt</code>, or <code>*</code></td><td>Action executed while in the "Special" state (summoning, teleporting, switching AI profiles, etc.).</td></tr><tr><td>AIClassEvent</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIElement.txt</code>, or <code>*</code></td><td>Action executed while in the "Event" state.</td></tr></tbody></table>

### <mark style="color:yellow;">Notes</mark>

* A `*` in an action slot means that this AI profile does not define a specific action for that state.
* This file only defines the monster's "toolkit"—`MonsterAIAutomata.txt`, referenced by `Automata`, determines when the monster changes states.
* Regular monsters defined through `Monster.txt`/standard `SetBase\` files do not use this system—it is intended for monsters explicitly configured through `MonsterAIGroup.txt` (scripted squads, such as Dark Elf invasions).
