SpawnMonsters
Referee: create monsters at a distance from the party, in a new encounter or the open one.
Full documentation: SpawnMonsters. Wire type: spawn_monsters.
Legal session modes: battle, encounter, exploring
JSON Schema
{
"description": "Referee: create monsters at a distance from the party, in a new encounter or the open one.\n\nUse it for an encounter you decide on, like monsters an LLM referee brings in or\na scripted ambush. Use it also for monsters that arrive during a fight, like the\nanimals a lycanthrope summons. The party must be standing in a dungeon, because\nencounters take place on the dungeon grid, so the command isn't legal in `town`. It isn't\nlegal once the session has ended either, because it would start new play. Set exactly one of\n`count_dice` and `count_fixed`, or constructing the command fails validation.\n\nWhen no encounter is open, the command opens one with the monsters. When an encounter\nor a battle is open, the monsters join it as one new group at `distance_feet`:\n\n- The group rolls no surprise and no reaction. It shares the encounter's surprise and its\n stance, which is the monsters' reaction to the party. So when the party surprised the\n monsters already there, and they can't act for a round, the new group can't act either.\n- The command takes no time and runs no round. The group first acts in the next round,\n when the monster side acts.\n- The session refuses the command during a pursuit, because a pursuit runs at the pace of\n its slowest group, and a new group could change that pace.\n\nModes:\n `exploring`, `encounter`, `battle`\n\nRejections:\n - `session.command.wrong_mode` - the party is in town, or the session has ended.\n - `session.command.unknown_monster` - `template_id` matches no monster.\n - `encounter.spawn.mid_pursuit` - the monsters are pursuing the party, and no\n new group can join during a pursuit.\n\nEvents:\n `MonstersSpawnedEvent` comes first.\n\n When the command opens an encounter, the encounter's opening follows: an\n `EffectAttachedEvent` for each monster that\n regenerates, like a troll,\n `SurpriseRolledEvent`s,\n `EncounterStartedEvent`, the\n reaction roll, and a\n `StanceChangedEvent`. When the monsters'\n reaction is to attack, battle opens at once.\n\n When the monsters join an open encounter, an `EffectAttachedEvent` for each monster\n that regenerates follows instead, then an\n `EncounterGroupJoinedEvent`, which\n the players see. When the group joins a battle and its morale score is 2, a\n `MonsterFledEvent` comes last, because a\n monster with that score won't fight.",
"properties": {
"command_type": {
"const": "spawn_monsters",
"default": "spawn_monsters",
"title": "Command Type",
"type": "string",
"description": "The name that identifies the command class in serialized data. Each command class fixes\nit to a distinct snake_case string, like `\"move_party\"` or `\"open_door\"`, and constructing\nthe class sets it, so you never pass it yourself.\n`parse_command` and the\n`AnyCommand` union use it to rebuild the right class\nfrom a serialized mapping. A class's value never changes between releases."
},
"source": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Source",
"description": "Who or what issued the command on whose behalf: an authored trigger or quest id, or the\nname of one of your game's systems. The engine never reads it, so a command with a\n`source` does exactly what the same command without one does. The session logs and\nreplays it with the command, so the log alone shows why something happened. Leave it\n`None` when there's nothing to record. An empty string fails validation when the command\nis constructed."
},
"template_id": {
"title": "Template Id",
"type": "string",
"description": "Which monster to spawn, from the session's\n`effective_monsters` catalog: either\na built-in id from `load_monsters` (see the\n[monster id index](https://mmacy.github.io/osrlib-python/reference/content-ids/monsters/))\nor one the adventure bundles."
},
"count_dice": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Count Dice",
"description": "How many to spawn, as a dice expression like `\"2d6\"`, rolled on the session's\n`ENCOUNTER_STREAM`. Use it when the number should\ndepend on the seed, and use `count_fixed` when it shouldn't. Set exactly one of the two. A\nmalformed expression fails validation when the command is constructed, so the session never\nsees it. A roll below 1 counts as 1."
},
"count_fixed": {
"anyOf": [
{
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Count Fixed",
"description": "How many to spawn, as an exact number. Use it when the author chose the number. Set\nexactly one of this and `count_dice`."
},
"distance_feet": {
"minimum": 0,
"title": "Distance Feet",
"type": "integer",
"description": "How far away the monsters appear, in feet. A new encounter opens at this distance, and\na group that joins an open encounter starts at it. The distance determines whether\nmissiles reach, how long closing in takes, and whether the party can outrun the monsters.\nB/X uses 2d6 times 10 feet for a wandering encounter, so a number in that range is\ntypical. `0` puts them right next to the party."
}
},
"required": [
"template_id",
"distance_feet"
],
"title": "SpawnMonsters",
"type": "object"
}