> 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/monsteraigroup.md).

# MonsterAIGroup

<mark style="color:green;">Scripted spawning of "intelligent" monster squads—similar to</mark> <mark style="color:green;"></mark><mark style="color:green;">`SetBase\`</mark><mark style="color:green;">, but each monster is assigned an AI profile directly from</mark> <mark style="color:green;"></mark><mark style="color:green;">`MonsterAIUnit.txt`</mark><mark style="color:green;">, and members of the same group recognize each other (they can heal allies, follow a leader, etc.). Used by events such as the Dark Elf invasion.</mark>

<table data-search="false"><thead><tr><th>Column</th><th>Accepted Values</th><th>Description</th></tr></thead><tbody><tr><td>Number</td><td>Number, one per group</td><td>Identifies the squad. All monsters with the same <code>Number</code> recognize each other as members of the same group.</td></tr><tr><td>Guid</td><td>Number, unique within the group</td><td>Identifies this monster within the group.</td></tr><tr><td>Monster</td><td>Monster class number</td><td>The entity that spawns.</td></tr><tr><td>Rank</td><td><code>0</code> or <code>*</code></td><td><code>0</code> = this monster is the group leader. <code>*</code> = regular member.</td></tr><tr><td>StartAI</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIUnit.txt</code></td><td>Initial AI profile assigned to this monster.</td></tr><tr><td>AI1 / AI2 / AI3</td><td>Number corresponding to an <code>Index</code> in <code>MonsterAIUnit.txt</code></td><td>Alternate AI profiles that this monster may switch to later (triggered by a "switch AI profile" action in <code>MonsterAIElement.txt</code>).</td></tr><tr><td>CreateType</td><td>Number</td><td>Method used to create/spawn the monster.</td></tr><tr><td>Map</td><td>Map number</td><td>Map where the monster spawns.</td></tr><tr><td>X / Y</td><td>Coordinates</td><td>Spawn location.</td></tr><tr><td>Dir</td><td>Number from 0 to 7, or <code>*</code></td><td>Initial facing direction. <code>*</code> = random direction.</td></tr><tr><td>RegenType</td><td>Number</td><td>Whether and how this monster respawns after death.</td></tr></tbody></table>

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

* Unlike `SetBase\`, the `Map` column is actually used here—there is no "filename determines the map" rule.
* `AI1`/`AI2`/`AI3` are not used automatically in sequence—they only become active if a `MonsterAIElement` of type "switch AI profile" explicitly references them.
