SpawnMonsters
Referee: spawn monsters and open an encounter at a distance.
Full documentation: SpawnMonsters. Wire type: spawn_monsters.
Legal session modes: battle, encounter, exploring, town
JSON Schema
{
"description": "Referee: spawn monsters and open an encounter at a distance.\n\nThe party must be standing in a dungeon with no encounter already open, because\nencounters live on the dungeon grid. Spawning is the one referee power a\nterminal session withholds: an encounter is play, and a session that has\nended opens no new play state, so this is illegal in `game_over` and\n`victory` alike. Exactly one of `count_dice` or `count_fixed` is required.\n\nModes:\n `town`, `exploring`, `encounter`, `battle`\n\nRejections:\n - `session.command.unknown_monster` - `template_id` names no monster.\n - `session.command.encounter_in_progress` - an encounter or battle is\n already open.\n - `session.command.not_in_dungeon` - the party is not on a dungeon cell.\n\nEvents:\n `MonstersSpawnedEvent`, then\n the encounter opening:\n `SurpriseRolledEvent`s,\n `EncounterStartedEvent`, the\n reaction roll, and\n `StanceChangedEvent`. An attacks\n stance opens battle at once.",
"properties": {
"command_type": {
"const": "spawn_monsters",
"default": "spawn_monsters",
"title": "Command Type",
"type": "string",
"description": "The wire discriminator. Each subclass fixes it to its own snake_case literal, like\n`\"move_party\"` or `\"open_door\"`, so you never set it yourself: constructing the subclass\ndoes. It's what `parse_command` and the\n`AnyCommand` union read to rebuild the right class\nfrom a serialized mapping, and it stays the same across releases."
},
"source": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Source",
"description": "An annotation naming the authored object (a trigger or quest id) or the game\nsystem on whose behalf the command was issued. Execution never reads it: a stamped\ncommand does exactly what the same command unstamped does. It is logged and replayed\nwith the command, so the log alone answers \"why did this happen\". Absent is `None`,\nand the empty string is not a value."
},
"template_id": {
"title": "Template Id",
"type": "string",
"description": "Which monster to spawn, from the session's\n`effective_monsters` catalog: either\na shipped id from `load_monsters` (see the monster id\nindex) or 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 encounter stream. Use\nthis when the count should vary with the seed, and use `count_fixed` when it shouldn't.\nExactly one of the two is required, and a malformed expression is refused when the command\nis constructed, before the session ever sees it. A roll below 1 is treated 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 this for keyed content whose count the author\nchose. Exactly one of this and `count_dice` is required."
},
"distance_feet": {
"minimum": 0,
"title": "Distance Feet",
"type": "integer",
"description": "How far away the monsters appear, in feet. This is the distance the encounter opens at,\nwhich decides whether missiles reach, how long closing takes, and whether the party can\noutrun a pursuit. B/X rolls 2d6 x 10 feet for a wandering encounter, so a number in that\nrange reads as ordinary. `0` puts them in the party's face."
}
},
"required": [
"template_id",
"distance_feet"
],
"title": "SpawnMonsters",
"type": "object"
}