{
  "version": "1.1",
  "name": "NPCs: Harbor Helpers",
  "startRoom": "lesson_square",
  "author": "TAGMaker",
  "description": "Build a harbor with eight helpful character roles. Try hints, trade, healing, repairs, a guarded passage, a living rescue, a checked delivery and a patrol. Each character uses real items and remembered progress.",
  "playerAppearance": {
    "version": 1,
    "layout": "modern",
    "font": "sans",
    "colorScheme": "light",
    "textSize": 18,
    "lineHeight": 1.6,
    "readingWidth": 80,
    "quietReading": false,
    "mapMode": "discovered",
    "panels": {
      "inventory": true,
      "map": true,
      "objectives": true,
      "status": true,
      "words": true
    },
    "picture": {
      "visible": true,
      "fit": "contain",
      "focalX": 50,
      "focalY": 50
    },
    "commands": {
      "visible": true,
      "standard": [
        "look",
        "search",
        "inventory",
        "help"
      ],
      "custom": []
    },
    "words": []
  },
  "created": "2026-11-01T00:00:00.000Z",
  "modified": "2026-11-01T00:00:00.000Z",
  "files": [
    {
      "path": "rooms/lesson_square.taml",
      "content": "room lesson_square\n  exit south: lesson_pier\n  exit north: lesson_gate\n  exit east: lesson_workshop\n  name: \"Harbor Square\"\n  narrative: \"A safe harbor workshop demonstrates editable NPC roles. READ BRIEFING for the complete route. The guide, merchant and medic work here. There is no hostile combat or time limit.\"\n  description: \"The workshop is EAST, the gate NORTH and the pier SOUTH. The merchant owns one replacement fuse; the wrench and briefing are here.\"\n  hint: \"TALK MERCHANT, choose 1, TAKE WRENCH, then EAST. READ BRIEFING gives every step.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_workshop.taml",
      "content": "room lesson_workshop\n  exit west: lesson_square\n  name: \"Repair Workshop\"\n  description: \"The technician waits beside the locked supply crate. The square is WEST.\"\n  hint: \"Carry the fuse and wrench, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE, TAKE HARBOR PASS, then WEST.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_gate.taml",
      "content": "room lesson_gate\n  exit north: lesson_shelter when: lesson_harbor_gate_open\n  exit south: lesson_square\n  name: \"Harbor Gate\"\n  description: \"The gatekeeper checks a real harbor pass before admitting visitors to the shelter. The square is SOUTH.\"\n  hint: \"Carry the harbor pass. TALK GATEKEEPER and choose 1. The pass is retained.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_shelter.taml",
      "content": "room lesson_shelter\n  exit south: lesson_gate\n  name: \"Shelter\"\n  description: \"The civilian needs a safe escort to the pier. One sealed dispatch waits here. The gate is SOUTH.\"\n  hint: \"TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1. SOUTH, SOUTH, SOUTH reaches the pier.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_pier.taml",
      "content": "room lesson_pier\n  exit north: lesson_square\n  name: \"Harbor Pier\"\n  description: \"The harbor master accepts the dispatch only after the repair and living rescue agree. The square is NORTH.\"\n  hint: \"TALK HARBOR MASTER and choose 1 to accept the task. Bring the recruited civilian here, then GIVE SEALED DISPATCH TO HARBOR MASTER.\"\n  dark: false\nend"
    },
    {
      "path": "objects/lesson_briefing.taml",
      "content": "object lesson_briefing\n  name: \"briefing\"\n  description: \"HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone.\"\n  location: lesson_square\n  aliases: [\"instructions\", \"note\", \"briefing\"]\n  droppable: false\n  weight: 0.1\n  on read:\n    print \"HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone.\"\n  end\nend"
    },
    {
      "path": "objects/lesson_fuse.taml",
      "content": "object lesson_fuse\n  name: \"fuse\"\n  description: \"One physical replacement fuse held in the merchant’s finite stock. Buy it through TALK MERCHANT, then use it with the supply crate while carrying the wrench.\"\n  aliases: [\"replacement fuse\", \"fuse\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_wrench.taml",
      "content": "object lesson_wrench\n  name: \"wrench\"\n  description: \"A retained repair tool. The technician needs it, but the repair does not consume it.\"\n  location: lesson_square\n  aliases: [\"tool\", \"spanner\", \"wrench\"]\n  takeable: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_supply_crate.taml",
      "content": "object lesson_supply_crate\n  name: \"supply crate\"\n  description: \"An electrically latched supply crate. USE FUSE WITH SUPPLY CRATE while carrying the wrench and while the technician is present.\"\n  contents_v1: \"{\\\"version\\\":1,\\\"kind\\\":\\\"container\\\",\\\"open\\\":false,\\\"locked\\\":true}\"\n  location: lesson_workshop\n  aliases: [\"crate\", \"device\", \"supply crate\"]\n  droppable: false\n  use_give: true\n  container: true\n  locked: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_harbor_pass.taml",
      "content": "object lesson_harbor_pass\n  name: \"harbor pass\"\n  description: \"A physical harbor pass inside the repaired crate. The gatekeeper checks that you really carry it and retains it during passage.\"\n  contents_v1: \"{\\\"version\\\":1,\\\"placement\\\":{\\\"parentId\\\":\\\"lesson_supply_crate\\\",\\\"relation\\\":\\\"inside\\\"}}\"\n  aliases: [\"pass\", \"permit\", \"harbor pass\"]\n  takeable: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_sealed_dispatch.taml",
      "content": "object lesson_sealed_dispatch\n  name: \"sealed dispatch\"\n  description: \"One sealed dispatch requested by the harbor master. Its pickup alone does not prove delivery or rescue.\"\n  location: lesson_shelter\n  aliases: [\"dispatch\", \"parcel\", \"sealed dispatch\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_wooden_token.taml",
      "content": "object lesson_wooden_token\n  name: \"wooden token\"\n  description: \"A harmless wrong item for testing rejected handovers. It does not qualify as the dispatch.\"\n  location: lesson_square\n  aliases: [\"wrong parcel\", \"token\", \"wooden token\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\n  on give with: lesson_harbor_master kind: \"npc\":\n    print \"The harbor master refuses the wooden token. Only the sealed dispatch qualifies; you keep the token.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_guide.taml",
      "content": "npc lesson_guide\n  name: \"guide\"\n  description: \"Give saved, progressive hints and respond to real task progress.\"\n  location: lesson_square\n  mobile: false\n  follow: false\n  aliases: [\"guide\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"I can offer a hint if you need one.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_merchant.taml",
      "content": "npc lesson_merchant\n  name: \"merchant\"\n  description: \"Trade finite physical stock with checked prices and actual item ownership.\"\n  location: lesson_square\n  mobile: false\n  follow: false\n  aliases: [\"merchant\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"Choose a purchase or offer the selected trade item.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_medic.taml",
      "content": "npc lesson_medic\n  name: \"medic\"\n  description: \"Restore bounded player health after checking payment and a saved cooldown.\"\n  location: lesson_square\n  mobile: false\n  follow: false\n  aliases: [\"medic\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"I can treat your injuries.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_technician.taml",
      "content": "npc lesson_technician\n  name: \"technician\"\n  description: \"Repair a real target using a consumed material and retained tool.\"\n  location: lesson_workshop\n  mobile: false\n  follow: false\n  aliases: [\"technician\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"I can repair the selected device if you bring the right material and tool.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_gatekeeper.taml",
      "content": "npc lesson_gatekeeper\n  name: \"gatekeeper\"\n  description: \"Grant a chosen route through a real key check or earned trust.\"\n  location: lesson_gate\n  mobile: false\n  follow: false\n  aliases: [\"gatekeeper\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"Show your pass or earn my trust before passing.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_civilian.taml",
      "content": "npc lesson_civilian\n  name: \"civilian\"\n  description: \"Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.\"\n  location: lesson_shelter\n  mobile: true\n  follow: false\n  aliases: [\"civilian\"]\n  health: 60\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"Please help me reach safety.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_harbor_master.taml",
      "content": "npc lesson_harbor_master\n  name: \"harbor master\"\n  description: \"Offer a delivery task, accept its actual item and award a native Quest reward once.\"\n  location: lesson_pier\n  mobile: false\n  follow: false\n  aliases: [\"harbor master\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"Please bring me the requested item.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_sentinel.taml",
      "content": "npc lesson_sentinel\n  name: \"sentinel\"\n  description: \"Walk a native connected route, pause for interactions and investigate nearby alerts.\"\n  location: lesson_gate\n  mobile: true\n  follow: false\n  aliases: [\"sentinel\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"I am watching this area.\"\n  end\nend"
    },
    {
      "path": "scripts/lesson_nr_technician_repair.taml",
      "content": "script lesson_nr_technician_repair\n# Native visual steps are stored in the callable definition.\nend"
    },
    {
      "path": "scripts/game_start.taml",
      "content": "script on_game_start\ndamage: 40\nend"
    }
  ],
  "playerConfig": {
    "startingHealth": 100,
    "startingMoney": 10,
    "healthEnabled": true,
    "moneyEnabled": true
  },
  "story": {
    "version": 1,
    "states": [
      {
        "id": "lesson_nr_technician_repaired",
        "name": "technician (technician) repaired",
        "description": "Owned by NPC role technician.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_nr_civilian_rescued",
        "name": "civilian (civilian) rescued",
        "description": "Owned by NPC role civilian.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_nr_harbor_master_accepted",
        "name": "harbor master (harbor_master) accepted",
        "description": "Owned by NPC role harbor_master.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_nr_harbor_master_delivered",
        "name": "harbor master (harbor_master) delivered",
        "description": "Owned by NPC role harbor_master.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_harbor_gate_open",
        "name": "Harbor gate opened",
        "description": "The gatekeeper admitted a player carrying the real pass.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_workshop_complete",
        "name": "Workshop complete",
        "description": "The workshop reached its completion.",
        "type": "boolean",
        "initial": false
      }
    ],
    "rules": [],
    "features": {
      "version": 1,
      "commandContext": true,
      "npcProfiles": [
        {
          "version": 1,
          "id": "lesson_nr_guide_profile",
          "name": "guide",
          "npcId": "lesson_guide",
          "enabled": true,
          "memory": [],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": []
        },
        {
          "version": 1,
          "id": "lesson_nr_merchant_profile",
          "name": "merchant",
          "npcId": "lesson_merchant",
          "enabled": true,
          "memory": [],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [
              "lesson_fuse"
            ],
            "equipped": [],
            "equipment": [],
            "money": 100,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": []
        },
        {
          "version": 1,
          "id": "lesson_nr_medic_profile",
          "name": "medic",
          "npcId": "lesson_medic",
          "enabled": true,
          "memory": [],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": [
            {
              "id": "treat",
              "name": "Treatment",
              "enabled": true,
              "event": "manual",
              "scope": "nearby",
              "match": "all",
              "conditions": [],
              "actions": [
                {
                  "kind": "npc_control",
                  "target": "lesson_medic",
                  "operation": "heal",
                  "value": 40,
                  "cost": 2
                }
              ],
              "otherwise": [
                {
                  "kind": "message",
                  "value": "The requirements are not met yet."
                }
              ],
              "cooldown": 3,
              "maxUses": 0
            }
          ]
        },
        {
          "version": 1,
          "id": "lesson_nr_technician_profile",
          "name": "technician",
          "npcId": "lesson_technician",
          "enabled": true,
          "memory": [
            {
              "id": "repaired",
              "name": "Repair completed",
              "type": "boolean",
              "initial": false
            }
          ],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": []
        },
        {
          "version": 1,
          "id": "lesson_nr_gatekeeper_profile",
          "name": "gatekeeper",
          "npcId": "lesson_gatekeeper",
          "enabled": true,
          "memory": [],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": [
            {
              "id": "passage",
              "name": "Grant passage",
              "enabled": true,
              "event": "manual",
              "scope": "nearby",
              "match": "any",
              "conditions": [
                {
                  "kind": "inventory",
                  "target": "lesson_harbor_pass",
                  "value": true,
                  "operator": "=="
                },
                {
                  "kind": "npc_trust",
                  "target": "lesson_gatekeeper",
                  "value": 100,
                  "operator": ">="
                }
              ],
              "actions": [
                {
                  "kind": "state",
                  "target": "lesson_harbor_gate_open",
                  "value": true
                },
                {
                  "kind": "message",
                  "value": "You may pass."
                },
                {
                  "kind": "goto",
                  "target": "lesson_shelter"
                }
              ],
              "otherwise": [
                {
                  "kind": "message",
                  "value": "The requirements are not met yet."
                }
              ],
              "cooldown": 0,
              "maxUses": 0
            }
          ]
        },
        {
          "version": 1,
          "id": "lesson_nr_civilian_profile",
          "name": "civilian",
          "npcId": "lesson_civilian",
          "enabled": true,
          "memory": [
            {
              "id": "rescued",
              "name": "Reached extraction",
              "type": "boolean",
              "initial": false
            }
          ],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 60,
            "initial": "active",
            "essential": false,
            "defeat": "downed",
            "retreatAtHealth": 0,
            "rescueRoomId": "lesson_pier"
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": [
            {
              "id": "arrival",
              "name": "Record a living rescue",
              "enabled": true,
              "event": "rescue",
              "scope": "anywhere",
              "match": "all",
              "conditions": [],
              "actions": [
                {
                  "kind": "state",
                  "target": "lesson_nr_civilian_rescued",
                  "value": true
                },
                {
                  "kind": "npc_control",
                  "target": "lesson_civilian",
                  "operation": "remember",
                  "key": "rescued",
                  "value": true
                },
                {
                  "kind": "message",
                  "value": "The rescue is complete. We reached safety."
                }
              ],
              "otherwise": [
                {
                  "kind": "message",
                  "value": "The requirements are not met yet."
                }
              ],
              "cooldown": 0,
              "maxUses": 1
            }
          ]
        },
        {
          "version": 1,
          "id": "lesson_nr_harbor_master_profile",
          "name": "harbor master",
          "npcId": "lesson_harbor_master",
          "enabled": true,
          "memory": [
            {
              "id": "offered",
              "name": "Task offered",
              "type": "boolean",
              "initial": false
            },
            {
              "id": "delivered",
              "name": "Delivery accepted",
              "type": "boolean",
              "initial": false
            }
          ],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": [
            {
              "id": "offer",
              "name": "Offer the delivery",
              "enabled": true,
              "event": "manual",
              "scope": "nearby",
              "match": "all",
              "conditions": [],
              "actions": [
                {
                  "kind": "state",
                  "target": "lesson_nr_harbor_master_accepted",
                  "value": true
                },
                {
                  "kind": "npc_control",
                  "target": "lesson_harbor_master",
                  "operation": "remember",
                  "key": "offered",
                  "value": true
                },
                {
                  "kind": "message",
                  "value": "Please bring me the requested item."
                }
              ],
              "otherwise": [
                {
                  "kind": "message",
                  "value": "The requirements are not met yet."
                }
              ],
              "cooldown": 0,
              "maxUses": 0
            }
          ]
        },
        {
          "version": 1,
          "id": "lesson_nr_sentinel_profile",
          "name": "sentinel",
          "npcId": "lesson_sentinel",
          "enabled": true,
          "memory": [],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": true,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": true,
            "returnHome": true,
            "allowedRoomIds": [
              "lesson_gate",
              "lesson_square"
            ],
            "homeRoomId": "lesson_gate"
          },
          "abilities": []
        }
      ],
      "conversations": [
        {
          "id": "lesson_nr_guide_conversation",
          "name": "guide conversation",
          "enabled": true,
          "npcId": "lesson_guide",
          "startNodeId": "welcome",
          "nodes": [
            {
              "id": "welcome",
              "text": "I can offer a hint if you need one.",
              "actions": [],
              "choices": [
                {
                  "id": "hint",
                  "label": "Please give me a hint",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "npc_control",
                      "target": "lesson_guide",
                      "operation": "hint",
                      "key": "lesson_nr_guide_hint"
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "leave",
                  "label": "Goodbye",
                  "conditions": [],
                  "match": "all",
                  "actions": [],
                  "once": false,
                  "unavailable": "hidden",
                  "next": "$end"
                }
              ]
            }
          ]
        },
        {
          "id": "lesson_nr_merchant_conversation",
          "name": "merchant conversation",
          "enabled": true,
          "npcId": "lesson_merchant",
          "startNodeId": "welcome",
          "nodes": [
            {
              "id": "welcome",
              "text": "Choose a purchase or offer the selected trade item.",
              "actions": [],
              "choices": [
                {
                  "id": "buy",
                  "label": "Buy the stock item (3)",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "npc_control",
                      "target": "lesson_merchant",
                      "operation": "buy",
                      "objectId": "lesson_fuse",
                      "value": 3
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "sell",
                  "label": "Sell the selected item (0)",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "npc_control",
                      "target": "lesson_merchant",
                      "operation": "sell",
                      "objectId": "lesson_fuse",
                      "value": 0
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "leave",
                  "label": "Goodbye",
                  "conditions": [],
                  "match": "all",
                  "actions": [],
                  "once": false,
                  "unavailable": "hidden",
                  "next": "$end"
                }
              ]
            }
          ]
        },
        {
          "id": "lesson_nr_medic_conversation",
          "name": "medic conversation",
          "enabled": true,
          "npcId": "lesson_medic",
          "startNodeId": "welcome",
          "nodes": [
            {
              "id": "welcome",
              "text": "I can treat your injuries.",
              "actions": [],
              "choices": [
                {
                  "id": "treat",
                  "label": "Receive treatment (2)",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "npc_control",
                      "target": "lesson_medic",
                      "operation": "ability",
                      "abilityId": "treat"
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "leave",
                  "label": "Goodbye",
                  "conditions": [],
                  "match": "all",
                  "actions": [],
                  "once": false,
                  "unavailable": "hidden",
                  "next": "$end"
                }
              ]
            }
          ]
        },
        {
          "id": "lesson_nr_technician_conversation",
          "name": "technician conversation",
          "enabled": true,
          "npcId": "lesson_technician",
          "startNodeId": "welcome",
          "nodes": [
            {
              "id": "welcome",
              "text": "I can repair the selected device if you bring the right material and tool.",
              "actions": [],
              "choices": [
                {
                  "id": "instructions",
                  "label": "What do you need for the repair?",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "message",
                      "value": "Use the repair material with the device while carrying the retained tool. The requirements are not met yet."
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "leave",
                  "label": "Goodbye",
                  "conditions": [],
                  "match": "all",
                  "actions": [],
                  "once": false,
                  "unavailable": "hidden",
                  "next": "$end"
                }
              ]
            }
          ]
        },
        {
          "id": "lesson_nr_gatekeeper_conversation",
          "name": "gatekeeper conversation",
          "enabled": true,
          "npcId": "lesson_gatekeeper",
          "startNodeId": "welcome",
          "nodes": [
            {
              "id": "welcome",
              "text": "Show your pass or earn my trust before passing.",
              "actions": [],
              "choices": [
                {
                  "id": "pass",
                  "label": "Request passage",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "npc_control",
                      "target": "lesson_gatekeeper",
                      "operation": "ability",
                      "abilityId": "passage"
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "leave",
                  "label": "Goodbye",
                  "conditions": [],
                  "match": "all",
                  "actions": [],
                  "once": false,
                  "unavailable": "hidden",
                  "next": "$end"
                }
              ]
            }
          ]
        },
        {
          "id": "lesson_nr_civilian_conversation",
          "name": "civilian conversation",
          "enabled": true,
          "npcId": "lesson_civilian",
          "startNodeId": "welcome",
          "nodes": [
            {
              "id": "welcome",
              "text": "Please help me reach safety.",
              "actions": [],
              "choices": [
                {
                  "id": "follow",
                  "label": "Follow me to safety",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "npc_control",
                      "target": "lesson_civilian",
                      "operation": "recruit"
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "wait",
                  "label": "Wait here safely",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "npc_control",
                      "target": "lesson_civilian",
                      "operation": "wait"
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "leave",
                  "label": "Goodbye",
                  "conditions": [],
                  "match": "all",
                  "actions": [],
                  "once": false,
                  "unavailable": "hidden",
                  "next": "$end"
                }
              ]
            }
          ]
        },
        {
          "id": "lesson_nr_harbor_master_conversation",
          "name": "harbor master conversation",
          "enabled": true,
          "npcId": "lesson_harbor_master",
          "startNodeId": "welcome",
          "nodes": [
            {
              "id": "welcome",
              "text": "Please bring me the requested item.",
              "actions": [],
              "choices": [
                {
                  "id": "offer",
                  "label": "Tell me about the task",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "npc_control",
                      "target": "lesson_harbor_master",
                      "operation": "ability",
                      "abilityId": "offer"
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "leave",
                  "label": "Goodbye",
                  "conditions": [],
                  "match": "all",
                  "actions": [],
                  "once": false,
                  "unavailable": "hidden",
                  "next": "$end"
                }
              ]
            }
          ]
        },
        {
          "id": "lesson_nr_sentinel_conversation",
          "name": "sentinel conversation",
          "enabled": true,
          "npcId": "lesson_sentinel",
          "startNodeId": "welcome",
          "nodes": [
            {
              "id": "welcome",
              "text": "I am watching this area.",
              "actions": [],
              "choices": [
                {
                  "id": "status",
                  "label": "Ask about the patrol",
                  "conditions": [],
                  "match": "all",
                  "actions": [
                    {
                      "kind": "message",
                      "value": "I walk the connected route and investigate alerts in this area."
                    }
                  ],
                  "once": false,
                  "unavailable": "disabled",
                  "next": "$end"
                },
                {
                  "id": "leave",
                  "label": "Goodbye",
                  "conditions": [],
                  "match": "all",
                  "actions": [],
                  "once": false,
                  "unavailable": "hidden",
                  "next": "$end"
                }
              ]
            }
          ]
        }
      ],
      "routines": [
        {
          "id": "lesson_nr_sentinel_patrol",
          "name": "sentinel connected patrol",
          "enabled": true,
          "npcId": "lesson_sentinel",
          "activities": [
            {
              "id": "stop_1",
              "name": "Patrol stop 1",
              "enabled": true,
              "priority": 0,
              "conditions": [],
              "match": "all",
              "destinationId": "lesson_gate",
              "duration": 2,
              "actions": [],
              "completionActions": [],
              "nextActivityId": "stop_2",
              "once": false
            },
            {
              "id": "stop_2",
              "name": "Patrol stop 2",
              "enabled": true,
              "priority": 0,
              "conditions": [],
              "match": "all",
              "destinationId": "lesson_square",
              "duration": 2,
              "actions": [],
              "completionActions": [],
              "nextActivityId": "stop_1",
              "once": false
            }
          ]
        }
      ],
      "recipes": [
        {
          "id": "lesson_nr_technician_repair",
          "name": "technician repair",
          "enabled": true,
          "verbs": [
            "use"
          ],
          "unordered": true,
          "inputs": [
            {
              "objectId": "lesson_fuse",
              "disposition": "consume"
            }
          ],
          "tools": [
            "lesson_wrench"
          ],
          "target": {
            "kind": "object",
            "id": "lesson_supply_crate"
          },
          "roomId": "lesson_workshop",
          "match": "all",
          "conditions": [
            {
              "kind": "npc_available",
              "target": "lesson_technician",
              "value": true,
              "operator": "=="
            }
          ],
          "actions": [
            {
              "kind": "script",
              "target": "lesson_nr_technician_repair"
            },
            {
              "kind": "npc_control",
              "target": "lesson_technician",
              "operation": "remember",
              "key": "repaired",
              "value": true
            }
          ],
          "once": true,
          "success": "",
          "failure": "The requirements are not met yet.",
          "repeat": "That has already been completed."
        },
        {
          "id": "lesson_nr_harbor_master_handover",
          "name": "harbor master accepted delivery",
          "enabled": true,
          "verbs": [
            "give"
          ],
          "unordered": true,
          "inputs": [
            {
              "objectId": "lesson_sealed_dispatch",
              "disposition": "transfer"
            }
          ],
          "tools": [],
          "target": {
            "kind": "npc",
            "id": "lesson_harbor_master"
          },
          "match": "all",
          "conditions": [
            {
              "kind": "state",
              "target": "lesson_nr_harbor_master_accepted",
              "value": true,
              "operator": "=="
            },
            {
              "kind": "state",
              "target": "lesson_nr_technician_repaired",
              "operator": "==",
              "value": true
            },
            {
              "kind": "state",
              "target": "lesson_nr_civilian_rescued",
              "operator": "==",
              "value": true
            }
          ],
          "actions": [
            {
              "kind": "state",
              "target": "lesson_nr_harbor_master_delivered",
              "value": true
            },
            {
              "kind": "npc_control",
              "target": "lesson_harbor_master",
              "operation": "remember",
              "key": "delivered",
              "value": true
            }
          ],
          "once": true,
          "success": "The delivery is accepted. Thank you.",
          "failure": "Repair the supply crate and bring the living civilian to the pier before handing over the real sealed dispatch. No item or payment is consumed by this refusal.",
          "repeat": "That has already been completed."
        }
      ],
      "quests": [
        {
          "id": "lesson_nr_civilian_quest",
          "name": "Rescue civilian",
          "enabled": true,
          "description": "Bring civilian safely to extraction.",
          "stages": [
            {
              "id": "arrived",
              "name": "Arrive alive at extraction",
              "description": "Arrive alive at extraction",
              "prerequisites": [],
              "optional": false,
              "automatic": true,
              "conditions": [
                {
                  "kind": "state",
                  "target": "lesson_nr_civilian_rescued",
                  "value": true,
                  "operator": "=="
                }
              ],
              "match": "all",
              "completionText": "Arrive alive at extraction",
              "actions": []
            }
          ],
          "completionText": "The rescue is complete. We reached safety.",
          "completionActions": [
            {
              "kind": "score",
              "value": 0
            },
            {
              "kind": "money",
              "value": 0
            }
          ]
        },
        {
          "id": "lesson_nr_harbor_master_quest",
          "name": "Harbor service and safe arrival",
          "enabled": true,
          "description": "Repair the crate, bring the civilian safely to the pier, and make one accepted dispatch delivery.",
          "stages": [
            {
              "id": "accepted",
              "name": "Accept the delivery task",
              "description": "Accept the delivery task",
              "prerequisites": [],
              "optional": false,
              "automatic": true,
              "conditions": [
                {
                  "kind": "state",
                  "target": "lesson_nr_harbor_master_accepted",
                  "value": true,
                  "operator": "=="
                }
              ],
              "match": "all",
              "completionText": "Accept the delivery task",
              "actions": []
            },
            {
              "id": "delivered",
              "name": "Deliver the real item",
              "description": "Deliver the real item",
              "prerequisites": [
                "accepted"
              ],
              "optional": false,
              "automatic": true,
              "conditions": [
                {
                  "kind": "state",
                  "target": "lesson_nr_harbor_master_delivered",
                  "value": true,
                  "operator": "=="
                }
              ],
              "match": "all",
              "completionText": "Deliver the real item",
              "actions": []
            }
          ],
          "completionText": "Harbor Helpers service complete! Real stock, a retained tool, a repaired crate, a checked pass, a living escort and the accepted dispatch agree. You earn 100 points and five harbor coins.",
          "completionActions": [
            {
              "kind": "state",
              "target": "lesson_workshop_complete",
              "value": true
            },
            {
              "kind": "score",
              "value": 100
            },
            {
              "kind": "money",
              "value": 5
            },
            {
              "kind": "end"
            }
          ]
        }
      ],
      "hints": [
        {
          "id": "lesson_nr_guide_hint",
          "name": "guide hints",
          "enabled": true,
          "scope": {
            "kind": "room",
            "target": "lesson_square"
          },
          "priority": 0,
          "conditions": [],
          "match": "all",
          "completedConditions": [],
          "completedMatch": "all",
          "completedText": "You have already completed this task.",
          "levels": [
            {
              "level": "gentle",
              "text": "The merchant has the repair material, and the wrench stays with you.",
              "conditions": [],
              "match": "all"
            },
            {
              "level": "strong",
              "text": "Buy the fuse, use it with the supply crate in the eastern workshop, then open the crate for the harbor pass.",
              "conditions": [],
              "match": "all"
            },
            {
              "level": "solution",
              "text": "Follow the BRIEFING route: repair the crate, accept the harbor master’s task, pass the gate, recruit the civilian, and make the accepted dispatch delivery.",
              "conditions": [],
              "match": "all"
            }
          ]
        }
      ],
      "scriptFunctions": [
        {
          "version": 1,
          "id": "lesson_nr_technician_repair",
          "name": "Complete native repair",
          "description": "Owned by NPC technician.",
          "inputs": [],
          "locals": [],
          "resultType": "void",
          "mode": "visual",
          "steps": [
            {
              "id": "unlock",
              "kind": "action",
              "action": {
                "kind": "object_state",
                "target": "lesson_supply_crate",
                "property": "locked",
                "value": false
              }
            },
            {
              "id": "confirm",
              "kind": "action",
              "action": {
                "kind": "state",
                "target": "lesson_nr_technician_repaired",
                "value": true
              }
            },
            {
              "id": "message",
              "kind": "action",
              "action": {
                "kind": "message",
                "value": "The device is repaired."
              }
            }
          ]
        }
      ]
    }
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "npcs-workshop",
        "choices": {
          "square": {
            "existing": "",
            "name": "Harbor Square",
            "description": "The workshop is EAST, the gate NORTH and the pier SOUTH. The merchant owns one replacement fuse; the wrench and briefing are here."
          },
          "workshop": {
            "existing": "",
            "name": "Repair Workshop",
            "description": "The technician waits beside the locked supply crate. The square is WEST."
          },
          "gate": {
            "existing": "",
            "name": "Harbor Gate",
            "description": "The gatekeeper checks a real harbor pass before admitting visitors to the shelter. The square is SOUTH."
          },
          "shelter": {
            "existing": "",
            "name": "Shelter",
            "description": "The civilian needs a safe escort to the pier. One sealed dispatch waits here. The gate is SOUTH."
          },
          "pier": {
            "existing": "",
            "name": "Harbor Pier",
            "description": "The harbor master accepts the dispatch only after the repair and living rescue agree. The square is NORTH."
          },
          "briefing": {
            "existing": "",
            "name": "briefing",
            "description": "HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone."
          },
          "fuse": {
            "existing": "",
            "name": "fuse",
            "description": "One physical replacement fuse held in the merchant’s finite stock. Buy it through TALK MERCHANT, then use it with the supply crate while carrying the wrench."
          },
          "wrench": {
            "existing": "",
            "name": "wrench",
            "description": "A retained repair tool. The technician needs it, but the repair does not consume it."
          },
          "supply_crate": {
            "existing": "",
            "name": "supply crate",
            "description": "An electrically latched supply crate. USE FUSE WITH SUPPLY CRATE while carrying the wrench and while the technician is present."
          },
          "harbor_pass": {
            "existing": "",
            "name": "harbor pass",
            "description": "A physical harbor pass inside the repaired crate. The gatekeeper checks that you really carry it and retains it during passage."
          },
          "sealed_dispatch": {
            "existing": "",
            "name": "sealed dispatch",
            "description": "One sealed dispatch requested by the harbor master. Its pickup alone does not prove delivery or rescue."
          },
          "wooden_token": {
            "existing": "",
            "name": "wooden token",
            "description": "A harmless wrong item for testing rejected handovers. It does not qualify as the dispatch."
          },
          "guide": {
            "existing": "",
            "name": "guide",
            "description": "Give saved, progressive hints and respond to real task progress."
          },
          "merchant": {
            "existing": "",
            "name": "merchant",
            "description": "Trade finite physical stock with checked prices and actual item ownership."
          },
          "medic": {
            "existing": "",
            "name": "medic",
            "description": "Restore bounded player health after checking payment and a saved cooldown."
          },
          "technician": {
            "existing": "",
            "name": "technician",
            "description": "Repair a real target using a consumed material and retained tool."
          },
          "gatekeeper": {
            "existing": "",
            "name": "gatekeeper",
            "description": "Grant a chosen route through a real key check or earned trust."
          },
          "civilian": {
            "existing": "",
            "name": "civilian",
            "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room."
          },
          "harbor_master": {
            "existing": "",
            "name": "harbor master",
            "description": "Offer a delivery task, accept its actual item and award a native Quest reward once."
          },
          "sentinel": {
            "existing": "",
            "name": "sentinel",
            "description": "Walk a native connected route, pause for interactions and investigate nearby alerts."
          }
        },
        "values": {
          "introduction": "A safe harbor workshop demonstrates editable NPC roles. READ BRIEFING for the complete route. The guide, merchant and medic work here. There is no hostile combat or time limit.",
          "enableHealth": true,
          "enableMoney": true
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_square.taml",
          "after": {
            "path": "rooms/lesson_square.taml",
            "name": "lesson_square.taml",
            "content": "room lesson_square\n  exit south: lesson_pier\n  exit north: lesson_gate\n  exit east: lesson_workshop\n  name: \"Harbor Square\"\n  narrative: \"A safe harbor workshop demonstrates editable NPC roles. READ BRIEFING for the complete route. The guide, merchant and medic work here. There is no hostile combat or time limit.\"\n  description: \"The workshop is EAST, the gate NORTH and the pier SOUTH. The merchant owns one replacement fuse; the wrench and briefing are here.\"\n  hint: \"TALK MERCHANT, choose 1, TAKE WRENCH, then EAST. READ BRIEFING gives every step.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_workshop.taml",
          "after": {
            "path": "rooms/lesson_workshop.taml",
            "name": "lesson_workshop.taml",
            "content": "room lesson_workshop\n  exit west: lesson_square\n  name: \"Repair Workshop\"\n  description: \"The technician waits beside the locked supply crate. The square is WEST.\"\n  hint: \"Carry the fuse and wrench, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE, TAKE HARBOR PASS, then WEST.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_gate.taml",
          "after": {
            "path": "rooms/lesson_gate.taml",
            "name": "lesson_gate.taml",
            "content": "room lesson_gate\n  exit north: lesson_shelter when: lesson_harbor_gate_open\n  exit south: lesson_square\n  name: \"Harbor Gate\"\n  description: \"The gatekeeper checks a real harbor pass before admitting visitors to the shelter. The square is SOUTH.\"\n  hint: \"Carry the harbor pass. TALK GATEKEEPER and choose 1. The pass is retained.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_shelter.taml",
          "after": {
            "path": "rooms/lesson_shelter.taml",
            "name": "lesson_shelter.taml",
            "content": "room lesson_shelter\n  exit south: lesson_gate\n  name: \"Shelter\"\n  description: \"The civilian needs a safe escort to the pier. One sealed dispatch waits here. The gate is SOUTH.\"\n  hint: \"TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1. SOUTH, SOUTH, SOUTH reaches the pier.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_pier.taml",
          "after": {
            "path": "rooms/lesson_pier.taml",
            "name": "lesson_pier.taml",
            "content": "room lesson_pier\n  exit north: lesson_square\n  name: \"Harbor Pier\"\n  description: \"The harbor master accepts the dispatch only after the repair and living rescue agree. The square is NORTH.\"\n  hint: \"TALK HARBOR MASTER and choose 1 to accept the task. Bring the recruited civilian here, then GIVE SEALED DISPATCH TO HARBOR MASTER.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_briefing.taml",
          "after": {
            "path": "objects/lesson_briefing.taml",
            "name": "lesson_briefing.taml",
            "content": "object lesson_briefing\n  name: \"briefing\"\n  description: \"HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone.\"\n  location: lesson_square\n  aliases: [\"instructions\", \"note\", \"briefing\"]\n  droppable: false\n  weight: 0.1\n  on read:\n    print \"HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_fuse.taml",
          "after": {
            "path": "objects/lesson_fuse.taml",
            "name": "lesson_fuse.taml",
            "content": "object lesson_fuse\n  name: \"fuse\"\n  description: \"One physical replacement fuse held in the merchant’s finite stock. Buy it through TALK MERCHANT, then use it with the supply crate while carrying the wrench.\"\n  aliases: [\"replacement fuse\", \"fuse\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_wrench.taml",
          "after": {
            "path": "objects/lesson_wrench.taml",
            "name": "lesson_wrench.taml",
            "content": "object lesson_wrench\n  name: \"wrench\"\n  description: \"A retained repair tool. The technician needs it, but the repair does not consume it.\"\n  location: lesson_square\n  aliases: [\"tool\", \"spanner\", \"wrench\"]\n  takeable: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_supply_crate.taml",
          "after": {
            "path": "objects/lesson_supply_crate.taml",
            "name": "lesson_supply_crate.taml",
            "content": "object lesson_supply_crate\n  name: \"supply crate\"\n  description: \"An electrically latched supply crate. USE FUSE WITH SUPPLY CRATE while carrying the wrench and while the technician is present.\"\n  contents_v1: \"{\\\"version\\\":1,\\\"kind\\\":\\\"container\\\",\\\"open\\\":false,\\\"locked\\\":true}\"\n  location: lesson_workshop\n  aliases: [\"crate\", \"device\", \"supply crate\"]\n  droppable: false\n  use_give: true\n  container: true\n  locked: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_harbor_pass.taml",
          "after": {
            "path": "objects/lesson_harbor_pass.taml",
            "name": "lesson_harbor_pass.taml",
            "content": "object lesson_harbor_pass\n  name: \"harbor pass\"\n  description: \"A physical harbor pass inside the repaired crate. The gatekeeper checks that you really carry it and retains it during passage.\"\n  contents_v1: \"{\\\"version\\\":1,\\\"placement\\\":{\\\"parentId\\\":\\\"lesson_supply_crate\\\",\\\"relation\\\":\\\"inside\\\"}}\"\n  aliases: [\"pass\", \"permit\", \"harbor pass\"]\n  takeable: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_sealed_dispatch.taml",
          "after": {
            "path": "objects/lesson_sealed_dispatch.taml",
            "name": "lesson_sealed_dispatch.taml",
            "content": "object lesson_sealed_dispatch\n  name: \"sealed dispatch\"\n  description: \"One sealed dispatch requested by the harbor master. Its pickup alone does not prove delivery or rescue.\"\n  location: lesson_shelter\n  aliases: [\"dispatch\", \"parcel\", \"sealed dispatch\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_wooden_token.taml",
          "after": {
            "path": "objects/lesson_wooden_token.taml",
            "name": "lesson_wooden_token.taml",
            "content": "object lesson_wooden_token\n  name: \"wooden token\"\n  description: \"A harmless wrong item for testing rejected handovers. It does not qualify as the dispatch.\"\n  location: lesson_square\n  aliases: [\"wrong parcel\", \"token\", \"wooden token\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\n  on give with: lesson_harbor_master kind: \"npc\":\n    print \"The harbor master refuses the wooden token. Only the sealed dispatch qualifies; you keep the token.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_guide.taml",
          "after": {
            "path": "npcs/lesson_guide.taml",
            "name": "lesson_guide.taml",
            "content": "npc lesson_guide\n  name: \"guide\"\n  description: \"Give saved, progressive hints and respond to real task progress.\"\n  location: lesson_square\n  mobile: false\n  follow: false\n  aliases: [\"guide\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"I can offer a hint if you need one.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_merchant.taml",
          "after": {
            "path": "npcs/lesson_merchant.taml",
            "name": "lesson_merchant.taml",
            "content": "npc lesson_merchant\n  name: \"merchant\"\n  description: \"Trade finite physical stock with checked prices and actual item ownership.\"\n  location: lesson_square\n  mobile: false\n  follow: false\n  aliases: [\"merchant\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"Choose a purchase or offer the selected trade item.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_medic.taml",
          "after": {
            "path": "npcs/lesson_medic.taml",
            "name": "lesson_medic.taml",
            "content": "npc lesson_medic\n  name: \"medic\"\n  description: \"Restore bounded player health after checking payment and a saved cooldown.\"\n  location: lesson_square\n  mobile: false\n  follow: false\n  aliases: [\"medic\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"I can treat your injuries.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_technician.taml",
          "after": {
            "path": "npcs/lesson_technician.taml",
            "name": "lesson_technician.taml",
            "content": "npc lesson_technician\n  name: \"technician\"\n  description: \"Repair a real target using a consumed material and retained tool.\"\n  location: lesson_workshop\n  mobile: false\n  follow: false\n  aliases: [\"technician\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"I can repair the selected device if you bring the right material and tool.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_gatekeeper.taml",
          "after": {
            "path": "npcs/lesson_gatekeeper.taml",
            "name": "lesson_gatekeeper.taml",
            "content": "npc lesson_gatekeeper\n  name: \"gatekeeper\"\n  description: \"Grant a chosen route through a real key check or earned trust.\"\n  location: lesson_gate\n  mobile: false\n  follow: false\n  aliases: [\"gatekeeper\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"Show your pass or earn my trust before passing.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_civilian.taml",
          "after": {
            "path": "npcs/lesson_civilian.taml",
            "name": "lesson_civilian.taml",
            "content": "npc lesson_civilian\n  name: \"civilian\"\n  description: \"Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.\"\n  location: lesson_shelter\n  mobile: true\n  follow: false\n  aliases: [\"civilian\"]\n  health: 60\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"Please help me reach safety.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_harbor_master.taml",
          "after": {
            "path": "npcs/lesson_harbor_master.taml",
            "name": "lesson_harbor_master.taml",
            "content": "npc lesson_harbor_master\n  name: \"harbor master\"\n  description: \"Offer a delivery task, accept its actual item and award a native Quest reward once.\"\n  location: lesson_pier\n  mobile: false\n  follow: false\n  aliases: [\"harbor master\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"Please bring me the requested item.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_sentinel.taml",
          "after": {
            "path": "npcs/lesson_sentinel.taml",
            "name": "lesson_sentinel.taml",
            "content": "npc lesson_sentinel\n  name: \"sentinel\"\n  description: \"Walk a native connected route, pause for interactions and investigate nearby alerts.\"\n  location: lesson_gate\n  mobile: true\n  follow: false\n  aliases: [\"sentinel\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  on talk:\n    print \"I am watching this area.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "scripts/lesson_nr_technician_repair.taml",
          "after": {
            "path": "scripts/lesson_nr_technician_repair.taml",
            "name": "lesson_nr_technician_repair.taml",
            "content": "script lesson_nr_technician_repair\n# Native visual steps are stored in the callable definition.\nend",
            "isDirty": true
          }
        },
        {
          "path": "objects",
          "key": "lesson_briefing",
          "after": {
            "id": "lesson_briefing",
            "name": "briefing",
            "description": "HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone.",
            "article": "",
            "location": "lesson_square",
            "aliases": [
              "instructions",
              "note",
              "briefing"
            ],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": false,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": [
              {
                "id": "read",
                "event": "read",
                "withTarget": "",
                "body": "print \"HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone.\""
              }
            ]
          }
        },
        {
          "path": "objects",
          "key": "lesson_fuse",
          "after": {
            "id": "lesson_fuse",
            "name": "fuse",
            "description": "One physical replacement fuse held in the merchant’s finite stock. Buy it through TALK MERCHANT, then use it with the supply crate while carrying the wrench.",
            "article": "",
            "location": "nowhere",
            "aliases": [
              "replacement fuse",
              "fuse"
            ],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_wrench",
          "after": {
            "id": "lesson_wrench",
            "name": "wrench",
            "description": "A retained repair tool. The technician needs it, but the repair does not consume it.",
            "article": "",
            "location": "lesson_square",
            "aliases": [
              "tool",
              "spanner",
              "wrench"
            ],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": false,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_supply_crate",
          "after": {
            "id": "lesson_supply_crate",
            "name": "supply crate",
            "description": "An electrically latched supply crate. USE FUSE WITH SUPPLY CRATE while carrying the wrench and while the technician is present.",
            "article": "",
            "location": "lesson_workshop",
            "aliases": [
              "crate",
              "device",
              "supply crate"
            ],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": true,
            "container": true,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": true,
            "lockKey": "",
            "events": [],
            "contents": {
              "version": 1,
              "kind": "container",
              "open": false,
              "locked": true
            }
          }
        },
        {
          "path": "objects",
          "key": "lesson_harbor_pass",
          "after": {
            "id": "lesson_harbor_pass",
            "name": "harbor pass",
            "description": "A physical harbor pass inside the repaired crate. The gatekeeper checks that you really carry it and retains it during passage.",
            "article": "",
            "location": "nowhere",
            "aliases": [
              "pass",
              "permit",
              "harbor pass"
            ],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": false,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": [],
            "contents": {
              "version": 1,
              "placement": {
                "parentId": "lesson_supply_crate",
                "relation": "inside"
              }
            }
          }
        },
        {
          "path": "objects",
          "key": "lesson_sealed_dispatch",
          "after": {
            "id": "lesson_sealed_dispatch",
            "name": "sealed dispatch",
            "description": "One sealed dispatch requested by the harbor master. Its pickup alone does not prove delivery or rescue.",
            "article": "",
            "location": "lesson_shelter",
            "aliases": [
              "dispatch",
              "parcel",
              "sealed dispatch"
            ],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_wooden_token",
          "after": {
            "id": "lesson_wooden_token",
            "name": "wooden token",
            "description": "A harmless wrong item for testing rejected handovers. It does not qualify as the dispatch.",
            "article": "",
            "location": "lesson_square",
            "aliases": [
              "wrong parcel",
              "token",
              "wooden token"
            ],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": [
              {
                "id": "wrong_handover",
                "event": "give",
                "withTarget": "lesson_harbor_master",
                "withTargetKind": "npc",
                "body": "print \"The harbor master refuses the wooden token. Only the sealed dispatch qualifies; you keep the token.\""
              }
            ]
          }
        },
        {
          "path": "npcs",
          "key": "lesson_guide",
          "after": {
            "id": "lesson_guide",
            "name": "guide",
            "description": "Give saved, progressive hints and respond to real task progress.",
            "location": "lesson_square",
            "mobile": false,
            "aliases": [
              "guide"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"I can offer a hint if you need one.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [],
            "npcPackage": {
              "version": 1,
              "id": "lesson_guide",
              "roleId": "guide",
              "definition": {
                "version": 1,
                "id": "lesson_guide",
                "roleId": "guide",
                "name": "guide",
                "description": "Give saved, progressive hints and respond to real task progress.",
                "enabled": true,
                "inputs": [
                  {
                    "id": "home",
                    "name": "Starting room",
                    "kind": "room",
                    "value": "lesson_square",
                    "required": true
                  },
                  {
                    "id": "completed",
                    "name": "Boolean task-completed state (optional)",
                    "kind": "state",
                    "value": "",
                    "required": false
                  },
                  {
                    "id": "gentle",
                    "name": "Gentle hint",
                    "kind": "text",
                    "value": "The merchant has the repair material, and the wrench stays with you.",
                    "required": true
                  },
                  {
                    "id": "strong",
                    "name": "Stronger hint",
                    "kind": "text",
                    "value": "Buy the fuse, use it with the supply crate in the eastern workshop, then open the crate for the harbor pass.",
                    "required": true
                  },
                  {
                    "id": "solution",
                    "name": "Solution hint",
                    "kind": "text",
                    "value": "Follow the BRIEFING route: repair the crate, accept the harbor master’s task, pass the gate, recruit the civilian, and make the accepted dispatch delivery.",
                    "required": true
                  }
                ],
                "messages": {
                  "greeting": "I can offer a hint if you need one.",
                  "success": "The interaction succeeds.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "You have already completed this task."
                }
              },
              "owned": {
                "states": [],
                "rules": [],
                "scripts": [],
                "npcProfiles": [
                  "lesson_nr_guide_profile"
                ],
                "npcFactions": [],
                "conversations": [
                  "lesson_nr_guide_conversation"
                ],
                "routines": [],
                "recipes": [],
                "quests": [],
                "hints": [
                  "lesson_nr_guide_hint"
                ],
                "scriptFunctions": [],
                "mechanics": []
              },
              "baseline": {
                "version": 1,
                "npc": {
                  "id": "lesson_guide",
                  "name": "guide",
                  "description": "Give saved, progressive hints and respond to real task progress.",
                  "location": "lesson_square",
                  "mobile": false,
                  "aliases": [],
                  "onEnter": "",
                  "onExamine": "",
                  "onTalk": "print \"I can offer a hint if you need one.\"",
                  "onAttack": "",
                  "onDeath": "",
                  "onFollow": "",
                  "onAutoAttack": "",
                  "onTrustChange": "",
                  "onGive": "",
                  "onBeforeTalk": "",
                  "onAfterTalk": "",
                  "onBeforeAttack": "",
                  "onAfterAttack": "",
                  "onDamage": "",
                  "onHeal": "",
                  "onMove": "",
                  "onLeave": "",
                  "followPlayer": false,
                  "health": 100,
                  "combatSide": "neutral",
                  "autoFight": false,
                  "attackPower": 10,
                  "defense": 0,
                  "trustLevel": 50,
                  "conversationEnabled": false,
                  "convGreeting": "",
                  "convFarewell": "",
                  "convTopics": [],
                  "dialogues": []
                },
                "story": {
                  "version": 1,
                  "states": [],
                  "rules": [],
                  "features": {
                    "version": 1,
                    "npcProfiles": [
                      {
                        "version": 1,
                        "id": "lesson_nr_guide_profile",
                        "name": "guide",
                        "npcId": "lesson_guide",
                        "enabled": true,
                        "memory": [],
                        "traits": {
                          "loyalty": 50,
                          "fear": 0,
                          "suspicion": 0
                        },
                        "life": {
                          "maxHealth": 100,
                          "initial": "active",
                          "essential": false,
                          "defeat": "dead",
                          "retreatAtHealth": 0
                        },
                        "inventory": {
                          "objects": [],
                          "equipped": [],
                          "equipment": [],
                          "money": 0,
                          "dropOnDeath": false
                        },
                        "combat": {
                          "assist": "off",
                          "target": "first_enemy",
                          "interceptPercent": 50,
                          "interval": 1
                        },
                        "perception": {
                          "enabled": false,
                          "sightRange": 0,
                          "hearingRange": 0,
                          "suspicionPerSight": 10,
                          "suspicionPerNoise": 10,
                          "threshold": 50,
                          "investigate": false,
                          "returnHome": false,
                          "allowedRoomIds": []
                        },
                        "abilities": []
                      }
                    ],
                    "npcFactions": [],
                    "conversations": [
                      {
                        "id": "lesson_nr_guide_conversation",
                        "name": "guide conversation",
                        "enabled": true,
                        "npcId": "lesson_guide",
                        "startNodeId": "welcome",
                        "nodes": [
                          {
                            "id": "welcome",
                            "text": "I can offer a hint if you need one.",
                            "actions": [],
                            "choices": [
                              {
                                "id": "hint",
                                "label": "Please give me a hint",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "npc_control",
                                    "target": "lesson_guide",
                                    "operation": "hint",
                                    "key": "lesson_nr_guide_hint"
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "leave",
                                "label": "Goodbye",
                                "conditions": [],
                                "match": "all",
                                "actions": [],
                                "once": false,
                                "unavailable": "hidden",
                                "next": "$end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "routines": [],
                    "recipes": [],
                    "quests": [],
                    "hints": [
                      {
                        "id": "lesson_nr_guide_hint",
                        "name": "guide hints",
                        "enabled": true,
                        "scope": {
                          "kind": "room",
                          "target": "lesson_square"
                        },
                        "priority": 0,
                        "conditions": [],
                        "match": "all",
                        "completedConditions": [],
                        "completedMatch": "all",
                        "completedText": "You have already completed this task.",
                        "levels": [
                          {
                            "level": "gentle",
                            "text": "The merchant has the repair material, and the wrench stays with you.",
                            "conditions": [],
                            "match": "all"
                          },
                          {
                            "level": "strong",
                            "text": "Buy the fuse, use it with the supply crate in the eastern workshop, then open the crate for the harbor pass.",
                            "conditions": [],
                            "match": "all"
                          },
                          {
                            "level": "solution",
                            "text": "Follow the BRIEFING route: repair the crate, accept the harbor master’s task, pass the gate, recruit the civilian, and make the accepted dispatch delivery.",
                            "conditions": [],
                            "match": "all"
                          }
                        ]
                      }
                    ],
                    "scriptFunctions": [],
                    "mechanics": []
                  }
                },
                "scripts": [],
                "dependencies": [
                  {
                    "kind": "room",
                    "id": "lesson_square"
                  }
                ],
                "notes": [
                  "Choose the starting room and write the gentle, stronger and solution hints.",
                  "Optionally select a Boolean Story state that proves the task is finished.",
                  "TALK opens the guide; its hint choice and HINT advance the same saved native tiers. Each guide selects its own native hint even when guides share a room.",
                  "Test: TALK guide",
                  "Test: HINT"
                ],
                "roleId": "guide",
                "definition": {
                  "version": 1,
                  "id": "lesson_guide",
                  "roleId": "guide",
                  "name": "guide",
                  "description": "Give saved, progressive hints and respond to real task progress.",
                  "enabled": true,
                  "inputs": [
                    {
                      "id": "home",
                      "name": "Starting room",
                      "kind": "room",
                      "value": "lesson_square",
                      "required": true
                    },
                    {
                      "id": "completed",
                      "name": "Boolean task-completed state (optional)",
                      "kind": "state",
                      "value": "",
                      "required": false
                    },
                    {
                      "id": "gentle",
                      "name": "Gentle hint",
                      "kind": "text",
                      "value": "The merchant has the repair material, and the wrench stays with you.",
                      "required": true
                    },
                    {
                      "id": "strong",
                      "name": "Stronger hint",
                      "kind": "text",
                      "value": "Buy the fuse, use it with the supply crate in the eastern workshop, then open the crate for the harbor pass.",
                      "required": true
                    },
                    {
                      "id": "solution",
                      "name": "Solution hint",
                      "kind": "text",
                      "value": "Follow the BRIEFING route: repair the crate, accept the harbor master’s task, pass the gate, recruit the civilian, and make the accepted dispatch delivery.",
                      "required": true
                    }
                  ],
                  "messages": {
                    "greeting": "I can offer a hint if you need one.",
                    "success": "The interaction succeeds.",
                    "failure": "The requirements are not met yet.",
                    "repeat": "You have already completed this task."
                  }
                }
              }
            }
          }
        },
        {
          "path": "npcs",
          "key": "lesson_merchant",
          "after": {
            "id": "lesson_merchant",
            "name": "merchant",
            "description": "Trade finite physical stock with checked prices and actual item ownership.",
            "location": "lesson_square",
            "mobile": false,
            "aliases": [
              "merchant"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Choose a purchase or offer the selected trade item.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [],
            "npcPackage": {
              "version": 1,
              "id": "lesson_merchant",
              "roleId": "merchant",
              "definition": {
                "version": 1,
                "id": "lesson_merchant",
                "roleId": "merchant",
                "name": "merchant",
                "description": "Trade finite physical stock with checked prices and actual item ownership.",
                "enabled": true,
                "inputs": [
                  {
                    "id": "home",
                    "name": "Starting room",
                    "kind": "room",
                    "value": "lesson_square",
                    "required": true
                  },
                  {
                    "id": "stockItem",
                    "name": "Initially unplaced stock object",
                    "kind": "object",
                    "value": "lesson_fuse",
                    "required": true
                  },
                  {
                    "id": "price",
                    "name": "Purchase price",
                    "kind": "number",
                    "value": 3,
                    "required": true,
                    "min": 0,
                    "max": 1000000
                  },
                  {
                    "id": "payout",
                    "name": "Resale payout",
                    "kind": "number",
                    "value": 0,
                    "required": true,
                    "min": 0,
                    "max": 1000000
                  }
                ],
                "messages": {
                  "greeting": "Choose a purchase or offer the selected trade item.",
                  "success": "The trade is complete.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That stock is not available."
                }
              },
              "owned": {
                "states": [],
                "rules": [],
                "scripts": [],
                "npcProfiles": [
                  "lesson_nr_merchant_profile"
                ],
                "npcFactions": [],
                "conversations": [
                  "lesson_nr_merchant_conversation"
                ],
                "routines": [],
                "recipes": [],
                "quests": [],
                "hints": [],
                "scriptFunctions": [],
                "mechanics": []
              },
              "baseline": {
                "version": 1,
                "npc": {
                  "id": "lesson_merchant",
                  "name": "merchant",
                  "description": "Trade finite physical stock with checked prices and actual item ownership.",
                  "location": "lesson_square",
                  "mobile": false,
                  "aliases": [],
                  "onEnter": "",
                  "onExamine": "",
                  "onTalk": "print \"Choose a purchase or offer the selected trade item.\"",
                  "onAttack": "",
                  "onDeath": "",
                  "onFollow": "",
                  "onAutoAttack": "",
                  "onTrustChange": "",
                  "onGive": "",
                  "onBeforeTalk": "",
                  "onAfterTalk": "",
                  "onBeforeAttack": "",
                  "onAfterAttack": "",
                  "onDamage": "",
                  "onHeal": "",
                  "onMove": "",
                  "onLeave": "",
                  "followPlayer": false,
                  "health": 100,
                  "combatSide": "neutral",
                  "autoFight": false,
                  "attackPower": 10,
                  "defense": 0,
                  "trustLevel": 50,
                  "conversationEnabled": false,
                  "convGreeting": "",
                  "convFarewell": "",
                  "convTopics": [],
                  "dialogues": []
                },
                "story": {
                  "version": 1,
                  "states": [],
                  "rules": [],
                  "features": {
                    "version": 1,
                    "npcProfiles": [
                      {
                        "version": 1,
                        "id": "lesson_nr_merchant_profile",
                        "name": "merchant",
                        "npcId": "lesson_merchant",
                        "enabled": true,
                        "memory": [],
                        "traits": {
                          "loyalty": 50,
                          "fear": 0,
                          "suspicion": 0
                        },
                        "life": {
                          "maxHealth": 100,
                          "initial": "active",
                          "essential": false,
                          "defeat": "dead",
                          "retreatAtHealth": 0
                        },
                        "inventory": {
                          "objects": [
                            "lesson_fuse"
                          ],
                          "equipped": [],
                          "equipment": [],
                          "money": 100,
                          "dropOnDeath": false
                        },
                        "combat": {
                          "assist": "off",
                          "target": "first_enemy",
                          "interceptPercent": 50,
                          "interval": 1
                        },
                        "perception": {
                          "enabled": false,
                          "sightRange": 0,
                          "hearingRange": 0,
                          "suspicionPerSight": 10,
                          "suspicionPerNoise": 10,
                          "threshold": 50,
                          "investigate": false,
                          "returnHome": false,
                          "allowedRoomIds": []
                        },
                        "abilities": []
                      }
                    ],
                    "npcFactions": [],
                    "conversations": [
                      {
                        "id": "lesson_nr_merchant_conversation",
                        "name": "merchant conversation",
                        "enabled": true,
                        "npcId": "lesson_merchant",
                        "startNodeId": "welcome",
                        "nodes": [
                          {
                            "id": "welcome",
                            "text": "Choose a purchase or offer the selected trade item.",
                            "actions": [],
                            "choices": [
                              {
                                "id": "buy",
                                "label": "Buy the stock item (3)",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "npc_control",
                                    "target": "lesson_merchant",
                                    "operation": "buy",
                                    "objectId": "lesson_fuse",
                                    "value": 3
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "sell",
                                "label": "Sell the selected item (0)",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "npc_control",
                                    "target": "lesson_merchant",
                                    "operation": "sell",
                                    "objectId": "lesson_fuse",
                                    "value": 0
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "leave",
                                "label": "Goodbye",
                                "conditions": [],
                                "match": "all",
                                "actions": [],
                                "once": false,
                                "unavailable": "hidden",
                                "next": "$end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "routines": [],
                    "recipes": [],
                    "quests": [],
                    "hints": [],
                    "scriptFunctions": [],
                    "mechanics": []
                  }
                },
                "scripts": [],
                "dependencies": [
                  {
                    "kind": "object",
                    "id": "lesson_fuse"
                  },
                  {
                    "kind": "room",
                    "id": "lesson_square"
                  }
                ],
                "notes": [
                  "Choose one initially unplaced stock object and a purchase price.",
                  "Configure a resale payout at or below the purchase price to avoid an accidental money loop.",
                  "The shop owns one real stock object. A purchase requires stock, funds and inventory space before anything changes. Resale pays from the finite NPC wallet.",
                  "Test: TALK merchant",
                  "Test: Choose Buy or Sell"
                ],
                "roleId": "merchant",
                "definition": {
                  "version": 1,
                  "id": "lesson_merchant",
                  "roleId": "merchant",
                  "name": "merchant",
                  "description": "Trade finite physical stock with checked prices and actual item ownership.",
                  "enabled": true,
                  "inputs": [
                    {
                      "id": "home",
                      "name": "Starting room",
                      "kind": "room",
                      "value": "lesson_square",
                      "required": true
                    },
                    {
                      "id": "stockItem",
                      "name": "Initially unplaced stock object",
                      "kind": "object",
                      "value": "lesson_fuse",
                      "required": true
                    },
                    {
                      "id": "price",
                      "name": "Purchase price",
                      "kind": "number",
                      "value": 3,
                      "required": true,
                      "min": 0,
                      "max": 1000000
                    },
                    {
                      "id": "payout",
                      "name": "Resale payout",
                      "kind": "number",
                      "value": 0,
                      "required": true,
                      "min": 0,
                      "max": 1000000
                    }
                  ],
                  "messages": {
                    "greeting": "Choose a purchase or offer the selected trade item.",
                    "success": "The trade is complete.",
                    "failure": "The requirements are not met yet.",
                    "repeat": "That stock is not available."
                  }
                }
              }
            }
          }
        },
        {
          "path": "npcs",
          "key": "lesson_medic",
          "after": {
            "id": "lesson_medic",
            "name": "medic",
            "description": "Restore bounded player health after checking payment and a saved cooldown.",
            "location": "lesson_square",
            "mobile": false,
            "aliases": [
              "medic"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"I can treat your injuries.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [],
            "npcPackage": {
              "version": 1,
              "id": "lesson_medic",
              "roleId": "healer",
              "definition": {
                "version": 1,
                "id": "lesson_medic",
                "roleId": "healer",
                "name": "medic",
                "description": "Restore bounded player health after checking payment and a saved cooldown.",
                "enabled": true,
                "inputs": [
                  {
                    "id": "home",
                    "name": "Starting room",
                    "kind": "room",
                    "value": "lesson_square",
                    "required": true
                  },
                  {
                    "id": "healing",
                    "name": "Health restored",
                    "kind": "number",
                    "value": 40,
                    "required": true,
                    "min": 1,
                    "max": 100000
                  },
                  {
                    "id": "cost",
                    "name": "Treatment cost",
                    "kind": "number",
                    "value": 2,
                    "required": true,
                    "min": 0,
                    "max": 1000000
                  },
                  {
                    "id": "cooldown",
                    "name": "Cooldown in turns",
                    "kind": "number",
                    "value": 3,
                    "required": true,
                    "min": 0,
                    "max": 100000
                  }
                ],
                "messages": {
                  "greeting": "I can treat your injuries.",
                  "success": "Your treatment is complete.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That has already been completed."
                }
              },
              "owned": {
                "states": [],
                "rules": [],
                "scripts": [],
                "npcProfiles": [
                  "lesson_nr_medic_profile"
                ],
                "npcFactions": [],
                "conversations": [
                  "lesson_nr_medic_conversation"
                ],
                "routines": [],
                "recipes": [],
                "quests": [],
                "hints": [],
                "scriptFunctions": [],
                "mechanics": []
              },
              "baseline": {
                "version": 1,
                "npc": {
                  "id": "lesson_medic",
                  "name": "medic",
                  "description": "Restore bounded player health after checking payment and a saved cooldown.",
                  "location": "lesson_square",
                  "mobile": false,
                  "aliases": [],
                  "onEnter": "",
                  "onExamine": "",
                  "onTalk": "print \"I can treat your injuries.\"",
                  "onAttack": "",
                  "onDeath": "",
                  "onFollow": "",
                  "onAutoAttack": "",
                  "onTrustChange": "",
                  "onGive": "",
                  "onBeforeTalk": "",
                  "onAfterTalk": "",
                  "onBeforeAttack": "",
                  "onAfterAttack": "",
                  "onDamage": "",
                  "onHeal": "",
                  "onMove": "",
                  "onLeave": "",
                  "followPlayer": false,
                  "health": 100,
                  "combatSide": "neutral",
                  "autoFight": false,
                  "attackPower": 10,
                  "defense": 0,
                  "trustLevel": 50,
                  "conversationEnabled": false,
                  "convGreeting": "",
                  "convFarewell": "",
                  "convTopics": [],
                  "dialogues": []
                },
                "story": {
                  "version": 1,
                  "states": [],
                  "rules": [],
                  "features": {
                    "version": 1,
                    "npcProfiles": [
                      {
                        "version": 1,
                        "id": "lesson_nr_medic_profile",
                        "name": "medic",
                        "npcId": "lesson_medic",
                        "enabled": true,
                        "memory": [],
                        "traits": {
                          "loyalty": 50,
                          "fear": 0,
                          "suspicion": 0
                        },
                        "life": {
                          "maxHealth": 100,
                          "initial": "active",
                          "essential": false,
                          "defeat": "dead",
                          "retreatAtHealth": 0
                        },
                        "inventory": {
                          "objects": [],
                          "equipped": [],
                          "equipment": [],
                          "money": 0,
                          "dropOnDeath": false
                        },
                        "combat": {
                          "assist": "off",
                          "target": "first_enemy",
                          "interceptPercent": 50,
                          "interval": 1
                        },
                        "perception": {
                          "enabled": false,
                          "sightRange": 0,
                          "hearingRange": 0,
                          "suspicionPerSight": 10,
                          "suspicionPerNoise": 10,
                          "threshold": 50,
                          "investigate": false,
                          "returnHome": false,
                          "allowedRoomIds": []
                        },
                        "abilities": [
                          {
                            "id": "treat",
                            "name": "Treatment",
                            "enabled": true,
                            "event": "manual",
                            "scope": "nearby",
                            "match": "all",
                            "conditions": [],
                            "actions": [
                              {
                                "kind": "npc_control",
                                "target": "lesson_medic",
                                "operation": "heal",
                                "value": 40,
                                "cost": 2
                              }
                            ],
                            "otherwise": [
                              {
                                "kind": "message",
                                "value": "The requirements are not met yet."
                              }
                            ],
                            "cooldown": 3,
                            "maxUses": 0
                          }
                        ]
                      }
                    ],
                    "npcFactions": [],
                    "conversations": [
                      {
                        "id": "lesson_nr_medic_conversation",
                        "name": "medic conversation",
                        "enabled": true,
                        "npcId": "lesson_medic",
                        "startNodeId": "welcome",
                        "nodes": [
                          {
                            "id": "welcome",
                            "text": "I can treat your injuries.",
                            "actions": [],
                            "choices": [
                              {
                                "id": "treat",
                                "label": "Receive treatment (2)",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "npc_control",
                                    "target": "lesson_medic",
                                    "operation": "ability",
                                    "abilityId": "treat"
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "leave",
                                "label": "Goodbye",
                                "conditions": [],
                                "match": "all",
                                "actions": [],
                                "once": false,
                                "unavailable": "hidden",
                                "next": "$end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "routines": [],
                    "recipes": [],
                    "quests": [],
                    "hints": [],
                    "scriptFunctions": [],
                    "mechanics": []
                  }
                },
                "scripts": [],
                "dependencies": [
                  {
                    "kind": "room",
                    "id": "lesson_square"
                  }
                ],
                "notes": [
                  "Enable player health and choose the starting room.",
                  "Payment is not taken when the player is already healthy or cannot receive treatment.",
                  "Healing and payment form one checked native service. Full health does not spend payment or a successful-use cooldown.",
                  "Test: TALK medic",
                  "Test: Choose Treatment"
                ],
                "roleId": "healer",
                "definition": {
                  "version": 1,
                  "id": "lesson_medic",
                  "roleId": "healer",
                  "name": "medic",
                  "description": "Restore bounded player health after checking payment and a saved cooldown.",
                  "enabled": true,
                  "inputs": [
                    {
                      "id": "home",
                      "name": "Starting room",
                      "kind": "room",
                      "value": "lesson_square",
                      "required": true
                    },
                    {
                      "id": "healing",
                      "name": "Health restored",
                      "kind": "number",
                      "value": 40,
                      "required": true,
                      "min": 1,
                      "max": 100000
                    },
                    {
                      "id": "cost",
                      "name": "Treatment cost",
                      "kind": "number",
                      "value": 2,
                      "required": true,
                      "min": 0,
                      "max": 1000000
                    },
                    {
                      "id": "cooldown",
                      "name": "Cooldown in turns",
                      "kind": "number",
                      "value": 3,
                      "required": true,
                      "min": 0,
                      "max": 100000
                    }
                  ],
                  "messages": {
                    "greeting": "I can treat your injuries.",
                    "success": "Your treatment is complete.",
                    "failure": "The requirements are not met yet.",
                    "repeat": "That has already been completed."
                  }
                }
              }
            }
          }
        },
        {
          "path": "npcs",
          "key": "lesson_technician",
          "after": {
            "id": "lesson_technician",
            "name": "technician",
            "description": "Repair a real target using a consumed material and retained tool.",
            "location": "lesson_workshop",
            "mobile": false,
            "aliases": [
              "technician"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"I can repair the selected device if you bring the right material and tool.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [],
            "npcPackage": {
              "version": 1,
              "id": "lesson_technician",
              "roleId": "specialist",
              "definition": {
                "version": 1,
                "id": "lesson_technician",
                "roleId": "specialist",
                "name": "technician",
                "description": "Repair a real target using a consumed material and retained tool.",
                "enabled": true,
                "inputs": [
                  {
                    "id": "home",
                    "name": "Starting room",
                    "kind": "room",
                    "value": "lesson_workshop",
                    "required": true
                  },
                  {
                    "id": "target",
                    "name": "Locked container / device",
                    "kind": "object",
                    "value": "lesson_supply_crate",
                    "required": true
                  },
                  {
                    "id": "material",
                    "name": "Consumed repair material",
                    "kind": "object",
                    "value": "lesson_fuse",
                    "required": true
                  },
                  {
                    "id": "tool",
                    "name": "Retained repair tool",
                    "kind": "object",
                    "value": "lesson_wrench",
                    "required": true
                  }
                ],
                "messages": {
                  "greeting": "I can repair the selected device if you bring the right material and tool.",
                  "success": "The device is repaired.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That has already been completed."
                }
              },
              "owned": {
                "states": [
                  "lesson_nr_technician_repaired"
                ],
                "rules": [],
                "scripts": [
                  "lesson_nr_technician_repair"
                ],
                "npcProfiles": [
                  "lesson_nr_technician_profile"
                ],
                "npcFactions": [],
                "conversations": [
                  "lesson_nr_technician_conversation"
                ],
                "routines": [],
                "recipes": [
                  "lesson_nr_technician_repair"
                ],
                "quests": [],
                "hints": [],
                "scriptFunctions": [
                  "lesson_nr_technician_repair"
                ],
                "mechanics": []
              },
              "baseline": {
                "version": 1,
                "npc": {
                  "id": "lesson_technician",
                  "name": "technician",
                  "description": "Repair a real target using a consumed material and retained tool.",
                  "location": "lesson_workshop",
                  "mobile": false,
                  "aliases": [],
                  "onEnter": "",
                  "onExamine": "",
                  "onTalk": "print \"I can repair the selected device if you bring the right material and tool.\"",
                  "onAttack": "",
                  "onDeath": "",
                  "onFollow": "",
                  "onAutoAttack": "",
                  "onTrustChange": "",
                  "onGive": "",
                  "onBeforeTalk": "",
                  "onAfterTalk": "",
                  "onBeforeAttack": "",
                  "onAfterAttack": "",
                  "onDamage": "",
                  "onHeal": "",
                  "onMove": "",
                  "onLeave": "",
                  "followPlayer": false,
                  "health": 100,
                  "combatSide": "neutral",
                  "autoFight": false,
                  "attackPower": 10,
                  "defense": 0,
                  "trustLevel": 50,
                  "conversationEnabled": false,
                  "convGreeting": "",
                  "convFarewell": "",
                  "convTopics": [],
                  "dialogues": []
                },
                "story": {
                  "version": 1,
                  "states": [
                    {
                      "id": "lesson_nr_technician_repaired",
                      "name": "technician (technician) repaired",
                      "description": "Owned by NPC role technician.",
                      "type": "boolean",
                      "initial": false
                    }
                  ],
                  "rules": [],
                  "features": {
                    "version": 1,
                    "npcProfiles": [
                      {
                        "version": 1,
                        "id": "lesson_nr_technician_profile",
                        "name": "technician",
                        "npcId": "lesson_technician",
                        "enabled": true,
                        "memory": [
                          {
                            "id": "repaired",
                            "name": "Repair completed",
                            "type": "boolean",
                            "initial": false
                          }
                        ],
                        "traits": {
                          "loyalty": 50,
                          "fear": 0,
                          "suspicion": 0
                        },
                        "life": {
                          "maxHealth": 100,
                          "initial": "active",
                          "essential": false,
                          "defeat": "dead",
                          "retreatAtHealth": 0
                        },
                        "inventory": {
                          "objects": [],
                          "equipped": [],
                          "equipment": [],
                          "money": 0,
                          "dropOnDeath": false
                        },
                        "combat": {
                          "assist": "off",
                          "target": "first_enemy",
                          "interceptPercent": 50,
                          "interval": 1
                        },
                        "perception": {
                          "enabled": false,
                          "sightRange": 0,
                          "hearingRange": 0,
                          "suspicionPerSight": 10,
                          "suspicionPerNoise": 10,
                          "threshold": 50,
                          "investigate": false,
                          "returnHome": false,
                          "allowedRoomIds": []
                        },
                        "abilities": []
                      }
                    ],
                    "npcFactions": [],
                    "conversations": [
                      {
                        "id": "lesson_nr_technician_conversation",
                        "name": "technician conversation",
                        "enabled": true,
                        "npcId": "lesson_technician",
                        "startNodeId": "welcome",
                        "nodes": [
                          {
                            "id": "welcome",
                            "text": "I can repair the selected device if you bring the right material and tool.",
                            "actions": [],
                            "choices": [
                              {
                                "id": "instructions",
                                "label": "What do you need for the repair?",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "message",
                                    "value": "Use the repair material with the device while carrying the retained tool. The requirements are not met yet."
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "leave",
                                "label": "Goodbye",
                                "conditions": [],
                                "match": "all",
                                "actions": [],
                                "once": false,
                                "unavailable": "hidden",
                                "next": "$end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "routines": [],
                    "recipes": [
                      {
                        "id": "lesson_nr_technician_repair",
                        "name": "technician repair",
                        "enabled": true,
                        "verbs": [
                          "use"
                        ],
                        "unordered": true,
                        "inputs": [
                          {
                            "objectId": "lesson_fuse",
                            "disposition": "consume"
                          }
                        ],
                        "tools": [
                          "lesson_wrench"
                        ],
                        "target": {
                          "kind": "object",
                          "id": "lesson_supply_crate"
                        },
                        "roomId": "lesson_workshop",
                        "match": "all",
                        "conditions": [
                          {
                            "kind": "npc_available",
                            "target": "lesson_technician",
                            "value": true,
                            "operator": "=="
                          }
                        ],
                        "actions": [
                          {
                            "kind": "script",
                            "target": "lesson_nr_technician_repair"
                          },
                          {
                            "kind": "npc_control",
                            "target": "lesson_technician",
                            "operation": "remember",
                            "key": "repaired",
                            "value": true
                          }
                        ],
                        "once": true,
                        "success": "",
                        "failure": "The requirements are not met yet.",
                        "repeat": "That has already been completed."
                      }
                    ],
                    "quests": [],
                    "hints": [],
                    "scriptFunctions": [
                      {
                        "version": 1,
                        "id": "lesson_nr_technician_repair",
                        "name": "Complete native repair",
                        "description": "Owned by NPC technician.",
                        "inputs": [],
                        "locals": [],
                        "resultType": "void",
                        "mode": "visual",
                        "steps": [
                          {
                            "id": "unlock",
                            "kind": "action",
                            "action": {
                              "kind": "object_state",
                              "target": "lesson_supply_crate",
                              "property": "locked",
                              "value": false
                            }
                          },
                          {
                            "id": "confirm",
                            "kind": "action",
                            "action": {
                              "kind": "state",
                              "target": "lesson_nr_technician_repaired",
                              "value": true
                            }
                          },
                          {
                            "id": "message",
                            "kind": "action",
                            "action": {
                              "kind": "message",
                              "value": "The device is repaired."
                            }
                          }
                        ]
                      }
                    ],
                    "mechanics": []
                  }
                },
                "scripts": [
                  {
                    "id": "lesson_nr_technician_repair",
                    "name": "Complete native repair",
                    "description": "Owned by technician.",
                    "kind": "shared",
                    "body": "# Native visual steps are stored in the callable definition."
                  }
                ],
                "dependencies": [
                  {
                    "kind": "object",
                    "id": "lesson_fuse"
                  },
                  {
                    "kind": "object",
                    "id": "lesson_supply_crate"
                  },
                  {
                    "kind": "object",
                    "id": "lesson_wrench"
                  },
                  {
                    "kind": "room",
                    "id": "lesson_workshop"
                  }
                ],
                "notes": [
                  "Choose a locked container/device in the starting room, consumed material and retained tool.",
                  "A native Recipe checks all inputs and the specialist before consuming anything.",
                  "The native Recipe consumes only the chosen material, retains the tool and actually unlocks the selected device.",
                  "Test: USE <material> WITH <target>",
                  "Test: TALK technician"
                ],
                "roleId": "specialist",
                "definition": {
                  "version": 1,
                  "id": "lesson_technician",
                  "roleId": "specialist",
                  "name": "technician",
                  "description": "Repair a real target using a consumed material and retained tool.",
                  "enabled": true,
                  "inputs": [
                    {
                      "id": "home",
                      "name": "Starting room",
                      "kind": "room",
                      "value": "lesson_workshop",
                      "required": true
                    },
                    {
                      "id": "target",
                      "name": "Locked container / device",
                      "kind": "object",
                      "value": "lesson_supply_crate",
                      "required": true
                    },
                    {
                      "id": "material",
                      "name": "Consumed repair material",
                      "kind": "object",
                      "value": "lesson_fuse",
                      "required": true
                    },
                    {
                      "id": "tool",
                      "name": "Retained repair tool",
                      "kind": "object",
                      "value": "lesson_wrench",
                      "required": true
                    }
                  ],
                  "messages": {
                    "greeting": "I can repair the selected device if you bring the right material and tool.",
                    "success": "The device is repaired.",
                    "failure": "The requirements are not met yet.",
                    "repeat": "That has already been completed."
                  }
                }
              }
            }
          }
        },
        {
          "path": "npcs",
          "key": "lesson_gatekeeper",
          "after": {
            "id": "lesson_gatekeeper",
            "name": "gatekeeper",
            "description": "Grant a chosen route through a real key check or earned trust.",
            "location": "lesson_gate",
            "mobile": false,
            "aliases": [
              "gatekeeper"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Show your pass or earn my trust before passing.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [],
            "npcPackage": {
              "version": 1,
              "id": "lesson_gatekeeper",
              "roleId": "gatekeeper",
              "definition": {
                "version": 1,
                "id": "lesson_gatekeeper",
                "roleId": "gatekeeper",
                "name": "gatekeeper",
                "description": "Grant a chosen route through a real key check or earned trust.",
                "enabled": true,
                "inputs": [
                  {
                    "id": "home",
                    "name": "Starting room",
                    "kind": "room",
                    "value": "lesson_gate",
                    "required": true
                  },
                  {
                    "id": "key",
                    "name": "Retained pass / key",
                    "kind": "object",
                    "value": "lesson_harbor_pass",
                    "required": true
                  },
                  {
                    "id": "destination",
                    "name": "Passage destination",
                    "kind": "room",
                    "value": "lesson_shelter",
                    "required": true
                  },
                  {
                    "id": "trust",
                    "name": "Alternative required trust",
                    "kind": "number",
                    "value": 100,
                    "required": true,
                    "min": 0,
                    "max": 100
                  }
                ],
                "messages": {
                  "greeting": "Show your pass or earn my trust before passing.",
                  "success": "You may pass.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That has already been completed."
                }
              },
              "owned": {
                "states": [],
                "rules": [],
                "scripts": [],
                "npcProfiles": [
                  "lesson_nr_gatekeeper_profile"
                ],
                "npcFactions": [],
                "conversations": [
                  "lesson_nr_gatekeeper_conversation"
                ],
                "routines": [],
                "recipes": [],
                "quests": [],
                "hints": [],
                "scriptFunctions": [],
                "mechanics": []
              },
              "baseline": {
                "version": 1,
                "npc": {
                  "id": "lesson_gatekeeper",
                  "name": "gatekeeper",
                  "description": "Grant a chosen route through a real key check or earned trust.",
                  "location": "lesson_gate",
                  "mobile": false,
                  "aliases": [],
                  "onEnter": "",
                  "onExamine": "",
                  "onTalk": "print \"Show your pass or earn my trust before passing.\"",
                  "onAttack": "",
                  "onDeath": "",
                  "onFollow": "",
                  "onAutoAttack": "",
                  "onTrustChange": "",
                  "onGive": "",
                  "onBeforeTalk": "",
                  "onAfterTalk": "",
                  "onBeforeAttack": "",
                  "onAfterAttack": "",
                  "onDamage": "",
                  "onHeal": "",
                  "onMove": "",
                  "onLeave": "",
                  "followPlayer": false,
                  "health": 100,
                  "combatSide": "neutral",
                  "autoFight": false,
                  "attackPower": 10,
                  "defense": 0,
                  "trustLevel": 50,
                  "conversationEnabled": false,
                  "convGreeting": "",
                  "convFarewell": "",
                  "convTopics": [],
                  "dialogues": []
                },
                "story": {
                  "version": 1,
                  "states": [],
                  "rules": [],
                  "features": {
                    "version": 1,
                    "npcProfiles": [
                      {
                        "version": 1,
                        "id": "lesson_nr_gatekeeper_profile",
                        "name": "gatekeeper",
                        "npcId": "lesson_gatekeeper",
                        "enabled": true,
                        "memory": [],
                        "traits": {
                          "loyalty": 50,
                          "fear": 0,
                          "suspicion": 0
                        },
                        "life": {
                          "maxHealth": 100,
                          "initial": "active",
                          "essential": false,
                          "defeat": "dead",
                          "retreatAtHealth": 0
                        },
                        "inventory": {
                          "objects": [],
                          "equipped": [],
                          "equipment": [],
                          "money": 0,
                          "dropOnDeath": false
                        },
                        "combat": {
                          "assist": "off",
                          "target": "first_enemy",
                          "interceptPercent": 50,
                          "interval": 1
                        },
                        "perception": {
                          "enabled": false,
                          "sightRange": 0,
                          "hearingRange": 0,
                          "suspicionPerSight": 10,
                          "suspicionPerNoise": 10,
                          "threshold": 50,
                          "investigate": false,
                          "returnHome": false,
                          "allowedRoomIds": []
                        },
                        "abilities": [
                          {
                            "id": "passage",
                            "name": "Grant passage",
                            "enabled": true,
                            "event": "manual",
                            "scope": "nearby",
                            "match": "any",
                            "conditions": [
                              {
                                "kind": "inventory",
                                "target": "lesson_harbor_pass",
                                "value": true,
                                "operator": "=="
                              },
                              {
                                "kind": "npc_trust",
                                "target": "lesson_gatekeeper",
                                "value": 100,
                                "operator": ">="
                              }
                            ],
                            "actions": [
                              {
                                "kind": "message",
                                "value": "You may pass."
                              },
                              {
                                "kind": "goto",
                                "target": "lesson_shelter"
                              }
                            ],
                            "otherwise": [
                              {
                                "kind": "message",
                                "value": "The requirements are not met yet."
                              }
                            ],
                            "cooldown": 0,
                            "maxUses": 0
                          }
                        ]
                      }
                    ],
                    "npcFactions": [],
                    "conversations": [
                      {
                        "id": "lesson_nr_gatekeeper_conversation",
                        "name": "gatekeeper conversation",
                        "enabled": true,
                        "npcId": "lesson_gatekeeper",
                        "startNodeId": "welcome",
                        "nodes": [
                          {
                            "id": "welcome",
                            "text": "Show your pass or earn my trust before passing.",
                            "actions": [],
                            "choices": [
                              {
                                "id": "pass",
                                "label": "Request passage",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "npc_control",
                                    "target": "lesson_gatekeeper",
                                    "operation": "ability",
                                    "abilityId": "passage"
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "leave",
                                "label": "Goodbye",
                                "conditions": [],
                                "match": "all",
                                "actions": [],
                                "once": false,
                                "unavailable": "hidden",
                                "next": "$end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "routines": [],
                    "recipes": [],
                    "quests": [],
                    "hints": [],
                    "scriptFunctions": [],
                    "mechanics": []
                  }
                },
                "scripts": [],
                "dependencies": [
                  {
                    "kind": "object",
                    "id": "lesson_harbor_pass"
                  },
                  {
                    "kind": "room",
                    "id": "lesson_gate"
                  },
                  {
                    "kind": "room",
                    "id": "lesson_shelter"
                  }
                ],
                "notes": [
                  "Choose the starting room, retained pass/key and destination room or playable cell.",
                  "The player must meet one of the configured requirements before travel.",
                  "The pass/key is retained. Either possession of the selected key or sufficient actual trust permits the destination route.",
                  "Test: TALK gatekeeper",
                  "Test: Choose passage"
                ],
                "roleId": "gatekeeper",
                "definition": {
                  "version": 1,
                  "id": "lesson_gatekeeper",
                  "roleId": "gatekeeper",
                  "name": "gatekeeper",
                  "description": "Grant a chosen route through a real key check or earned trust.",
                  "enabled": true,
                  "inputs": [
                    {
                      "id": "home",
                      "name": "Starting room",
                      "kind": "room",
                      "value": "lesson_gate",
                      "required": true
                    },
                    {
                      "id": "key",
                      "name": "Retained pass / key",
                      "kind": "object",
                      "value": "lesson_harbor_pass",
                      "required": true
                    },
                    {
                      "id": "destination",
                      "name": "Passage destination",
                      "kind": "room",
                      "value": "lesson_shelter",
                      "required": true
                    },
                    {
                      "id": "trust",
                      "name": "Alternative required trust",
                      "kind": "number",
                      "value": 100,
                      "required": true,
                      "min": 0,
                      "max": 100
                    }
                  ],
                  "messages": {
                    "greeting": "Show your pass or earn my trust before passing.",
                    "success": "You may pass.",
                    "failure": "The requirements are not met yet.",
                    "repeat": "That has already been completed."
                  }
                }
              }
            }
          }
        },
        {
          "path": "npcs",
          "key": "lesson_civilian",
          "after": {
            "id": "lesson_civilian",
            "name": "civilian",
            "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.",
            "location": "lesson_shelter",
            "mobile": true,
            "aliases": [
              "civilian"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Please help me reach safety.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 60,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [],
            "npcPackage": {
              "version": 1,
              "id": "lesson_civilian",
              "roleId": "rescue",
              "definition": {
                "version": 1,
                "id": "lesson_civilian",
                "roleId": "rescue",
                "name": "civilian",
                "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.",
                "enabled": true,
                "inputs": [
                  {
                    "id": "home",
                    "name": "Starting room",
                    "kind": "room",
                    "value": "lesson_shelter",
                    "required": true
                  },
                  {
                    "id": "destination",
                    "name": "Extraction room",
                    "kind": "room",
                    "value": "lesson_pier",
                    "required": true
                  },
                  {
                    "id": "health",
                    "name": "Starting health",
                    "kind": "number",
                    "value": 60,
                    "required": true,
                    "min": 1,
                    "max": 100000
                  },
                  {
                    "id": "score",
                    "name": "Rescue score",
                    "kind": "number",
                    "value": 0,
                    "required": true,
                    "min": 0,
                    "max": 1000000
                  },
                  {
                    "id": "money",
                    "name": "Rescue currency",
                    "kind": "number",
                    "value": 0,
                    "required": true,
                    "min": 0,
                    "max": 1000000
                  }
                ],
                "messages": {
                  "greeting": "Please help me reach safety.",
                  "success": "The rescue is complete. We reached safety.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That has already been completed."
                }
              },
              "owned": {
                "states": [
                  "lesson_nr_civilian_rescued"
                ],
                "rules": [],
                "scripts": [],
                "npcProfiles": [
                  "lesson_nr_civilian_profile"
                ],
                "npcFactions": [],
                "conversations": [
                  "lesson_nr_civilian_conversation"
                ],
                "routines": [],
                "recipes": [],
                "quests": [
                  "lesson_nr_civilian_quest"
                ],
                "hints": [],
                "scriptFunctions": [],
                "mechanics": []
              },
              "baseline": {
                "version": 1,
                "npc": {
                  "id": "lesson_civilian",
                  "name": "civilian",
                  "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.",
                  "location": "lesson_shelter",
                  "mobile": true,
                  "aliases": [],
                  "onEnter": "",
                  "onExamine": "",
                  "onTalk": "print \"Please help me reach safety.\"",
                  "onAttack": "",
                  "onDeath": "",
                  "onFollow": "",
                  "onAutoAttack": "",
                  "onTrustChange": "",
                  "onGive": "",
                  "onBeforeTalk": "",
                  "onAfterTalk": "",
                  "onBeforeAttack": "",
                  "onAfterAttack": "",
                  "onDamage": "",
                  "onHeal": "",
                  "onMove": "",
                  "onLeave": "",
                  "followPlayer": false,
                  "health": 60,
                  "combatSide": "neutral",
                  "autoFight": false,
                  "attackPower": 10,
                  "defense": 0,
                  "trustLevel": 50,
                  "conversationEnabled": false,
                  "convGreeting": "",
                  "convFarewell": "",
                  "convTopics": [],
                  "dialogues": []
                },
                "story": {
                  "version": 1,
                  "states": [
                    {
                      "id": "lesson_nr_civilian_rescued",
                      "name": "civilian (civilian) rescued",
                      "description": "Owned by NPC role civilian.",
                      "type": "boolean",
                      "initial": false
                    }
                  ],
                  "rules": [],
                  "features": {
                    "version": 1,
                    "npcProfiles": [
                      {
                        "version": 1,
                        "id": "lesson_nr_civilian_profile",
                        "name": "civilian",
                        "npcId": "lesson_civilian",
                        "enabled": true,
                        "memory": [
                          {
                            "id": "rescued",
                            "name": "Reached extraction",
                            "type": "boolean",
                            "initial": false
                          }
                        ],
                        "traits": {
                          "loyalty": 50,
                          "fear": 0,
                          "suspicion": 0
                        },
                        "life": {
                          "maxHealth": 60,
                          "initial": "active",
                          "essential": false,
                          "defeat": "downed",
                          "retreatAtHealth": 0,
                          "rescueRoomId": "lesson_pier"
                        },
                        "inventory": {
                          "objects": [],
                          "equipped": [],
                          "equipment": [],
                          "money": 0,
                          "dropOnDeath": false
                        },
                        "combat": {
                          "assist": "off",
                          "target": "first_enemy",
                          "interceptPercent": 50,
                          "interval": 1
                        },
                        "perception": {
                          "enabled": false,
                          "sightRange": 0,
                          "hearingRange": 0,
                          "suspicionPerSight": 10,
                          "suspicionPerNoise": 10,
                          "threshold": 50,
                          "investigate": false,
                          "returnHome": false,
                          "allowedRoomIds": []
                        },
                        "abilities": [
                          {
                            "id": "arrival",
                            "name": "Record a living rescue",
                            "enabled": true,
                            "event": "rescue",
                            "scope": "anywhere",
                            "match": "all",
                            "conditions": [],
                            "actions": [
                              {
                                "kind": "state",
                                "target": "lesson_nr_civilian_rescued",
                                "value": true
                              },
                              {
                                "kind": "npc_control",
                                "target": "lesson_civilian",
                                "operation": "remember",
                                "key": "rescued",
                                "value": true
                              },
                              {
                                "kind": "message",
                                "value": "The rescue is complete. We reached safety."
                              }
                            ],
                            "otherwise": [
                              {
                                "kind": "message",
                                "value": "The requirements are not met yet."
                              }
                            ],
                            "cooldown": 0,
                            "maxUses": 1
                          }
                        ]
                      }
                    ],
                    "npcFactions": [],
                    "conversations": [
                      {
                        "id": "lesson_nr_civilian_conversation",
                        "name": "civilian conversation",
                        "enabled": true,
                        "npcId": "lesson_civilian",
                        "startNodeId": "welcome",
                        "nodes": [
                          {
                            "id": "welcome",
                            "text": "Please help me reach safety.",
                            "actions": [],
                            "choices": [
                              {
                                "id": "follow",
                                "label": "Follow me to safety",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "npc_control",
                                    "target": "lesson_civilian",
                                    "operation": "recruit"
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "wait",
                                "label": "Wait here safely",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "npc_control",
                                    "target": "lesson_civilian",
                                    "operation": "wait"
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "leave",
                                "label": "Goodbye",
                                "conditions": [],
                                "match": "all",
                                "actions": [],
                                "once": false,
                                "unavailable": "hidden",
                                "next": "$end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "routines": [],
                    "recipes": [],
                    "quests": [
                      {
                        "id": "lesson_nr_civilian_quest",
                        "name": "Rescue civilian",
                        "enabled": true,
                        "description": "Bring civilian safely to extraction.",
                        "stages": [
                          {
                            "id": "arrived",
                            "name": "Arrive alive at extraction",
                            "description": "Arrive alive at extraction",
                            "prerequisites": [],
                            "optional": false,
                            "automatic": true,
                            "conditions": [
                              {
                                "kind": "state",
                                "target": "lesson_nr_civilian_rescued",
                                "value": true,
                                "operator": "=="
                              }
                            ],
                            "match": "all",
                            "completionText": "Arrive alive at extraction",
                            "actions": []
                          }
                        ],
                        "completionText": "The rescue is complete. We reached safety.",
                        "completionActions": [
                          {
                            "kind": "score",
                            "value": 0
                          },
                          {
                            "kind": "money",
                            "value": 0
                          }
                        ]
                      }
                    ],
                    "hints": [],
                    "scriptFunctions": [],
                    "mechanics": []
                  }
                },
                "scripts": [],
                "dependencies": [
                  {
                    "kind": "room",
                    "id": "lesson_pier"
                  },
                  {
                    "kind": "room",
                    "id": "lesson_shelter"
                  }
                ],
                "notes": [
                  "Choose the initial room and actual extraction destination.",
                  "The rescue reward requires the living NPC to arrive; remote following flags do not prove a rescue.",
                  "The capability runtime records a rescue only on the living NPC’s actual arrival at extraction.",
                  "Test: TALK civilian",
                  "Test: Choose Follow or Wait",
                  "Test: Travel to extraction"
                ],
                "roleId": "rescue",
                "definition": {
                  "version": 1,
                  "id": "lesson_civilian",
                  "roleId": "rescue",
                  "name": "civilian",
                  "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.",
                  "enabled": true,
                  "inputs": [
                    {
                      "id": "home",
                      "name": "Starting room",
                      "kind": "room",
                      "value": "lesson_shelter",
                      "required": true
                    },
                    {
                      "id": "destination",
                      "name": "Extraction room",
                      "kind": "room",
                      "value": "lesson_pier",
                      "required": true
                    },
                    {
                      "id": "health",
                      "name": "Starting health",
                      "kind": "number",
                      "value": 60,
                      "required": true,
                      "min": 1,
                      "max": 100000
                    },
                    {
                      "id": "score",
                      "name": "Rescue score",
                      "kind": "number",
                      "value": 0,
                      "required": true,
                      "min": 0,
                      "max": 1000000
                    },
                    {
                      "id": "money",
                      "name": "Rescue currency",
                      "kind": "number",
                      "value": 0,
                      "required": true,
                      "min": 0,
                      "max": 1000000
                    }
                  ],
                  "messages": {
                    "greeting": "Please help me reach safety.",
                    "success": "The rescue is complete. We reached safety.",
                    "failure": "The requirements are not met yet.",
                    "repeat": "That has already been completed."
                  }
                }
              }
            }
          }
        },
        {
          "path": "npcs",
          "key": "lesson_harbor_master",
          "after": {
            "id": "lesson_harbor_master",
            "name": "harbor master",
            "description": "Offer a delivery task, accept its actual item and award a native Quest reward once.",
            "location": "lesson_pier",
            "mobile": false,
            "aliases": [
              "harbor master"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Please bring me the requested item.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [],
            "npcPackage": {
              "version": 1,
              "id": "lesson_harbor_master",
              "roleId": "quest_giver",
              "definition": {
                "version": 1,
                "id": "lesson_harbor_master",
                "roleId": "quest_giver",
                "name": "harbor master",
                "description": "Offer a delivery task, accept its actual item and award a native Quest reward once.",
                "enabled": true,
                "inputs": [
                  {
                    "id": "home",
                    "name": "Starting room",
                    "kind": "room",
                    "value": "lesson_pier",
                    "required": true
                  },
                  {
                    "id": "item",
                    "name": "Delivery item",
                    "kind": "object",
                    "value": "lesson_sealed_dispatch",
                    "required": true
                  },
                  {
                    "id": "questName",
                    "name": "Quest title",
                    "kind": "text",
                    "value": "Harbor service and safe arrival",
                    "required": true
                  },
                  {
                    "id": "score",
                    "name": "Completion score",
                    "kind": "number",
                    "value": 100,
                    "required": true,
                    "min": 0,
                    "max": 1000000
                  },
                  {
                    "id": "money",
                    "name": "Completion currency",
                    "kind": "number",
                    "value": 5,
                    "required": true,
                    "min": 0,
                    "max": 1000000
                  }
                ],
                "messages": {
                  "greeting": "Please bring me the requested item.",
                  "success": "The delivery is accepted. Thank you.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That has already been completed."
                }
              },
              "owned": {
                "states": [
                  "lesson_nr_harbor_master_accepted",
                  "lesson_nr_harbor_master_delivered"
                ],
                "rules": [],
                "scripts": [],
                "npcProfiles": [
                  "lesson_nr_harbor_master_profile"
                ],
                "npcFactions": [],
                "conversations": [
                  "lesson_nr_harbor_master_conversation"
                ],
                "routines": [],
                "recipes": [
                  "lesson_nr_harbor_master_handover"
                ],
                "quests": [
                  "lesson_nr_harbor_master_quest"
                ],
                "hints": [],
                "scriptFunctions": [],
                "mechanics": []
              },
              "baseline": {
                "version": 1,
                "npc": {
                  "id": "lesson_harbor_master",
                  "name": "harbor master",
                  "description": "Offer a delivery task, accept its actual item and award a native Quest reward once.",
                  "location": "lesson_pier",
                  "mobile": false,
                  "aliases": [],
                  "onEnter": "",
                  "onExamine": "",
                  "onTalk": "print \"Please bring me the requested item.\"",
                  "onAttack": "",
                  "onDeath": "",
                  "onFollow": "",
                  "onAutoAttack": "",
                  "onTrustChange": "",
                  "onGive": "",
                  "onBeforeTalk": "",
                  "onAfterTalk": "",
                  "onBeforeAttack": "",
                  "onAfterAttack": "",
                  "onDamage": "",
                  "onHeal": "",
                  "onMove": "",
                  "onLeave": "",
                  "followPlayer": false,
                  "health": 100,
                  "combatSide": "neutral",
                  "autoFight": false,
                  "attackPower": 10,
                  "defense": 0,
                  "trustLevel": 50,
                  "conversationEnabled": false,
                  "convGreeting": "",
                  "convFarewell": "",
                  "convTopics": [],
                  "dialogues": []
                },
                "story": {
                  "version": 1,
                  "states": [
                    {
                      "id": "lesson_nr_harbor_master_accepted",
                      "name": "harbor master (harbor_master) accepted",
                      "description": "Owned by NPC role harbor_master.",
                      "type": "boolean",
                      "initial": false
                    },
                    {
                      "id": "lesson_nr_harbor_master_delivered",
                      "name": "harbor master (harbor_master) delivered",
                      "description": "Owned by NPC role harbor_master.",
                      "type": "boolean",
                      "initial": false
                    }
                  ],
                  "rules": [],
                  "features": {
                    "version": 1,
                    "npcProfiles": [
                      {
                        "version": 1,
                        "id": "lesson_nr_harbor_master_profile",
                        "name": "harbor master",
                        "npcId": "lesson_harbor_master",
                        "enabled": true,
                        "memory": [
                          {
                            "id": "offered",
                            "name": "Task offered",
                            "type": "boolean",
                            "initial": false
                          },
                          {
                            "id": "delivered",
                            "name": "Delivery accepted",
                            "type": "boolean",
                            "initial": false
                          }
                        ],
                        "traits": {
                          "loyalty": 50,
                          "fear": 0,
                          "suspicion": 0
                        },
                        "life": {
                          "maxHealth": 100,
                          "initial": "active",
                          "essential": false,
                          "defeat": "dead",
                          "retreatAtHealth": 0
                        },
                        "inventory": {
                          "objects": [],
                          "equipped": [],
                          "equipment": [],
                          "money": 0,
                          "dropOnDeath": false
                        },
                        "combat": {
                          "assist": "off",
                          "target": "first_enemy",
                          "interceptPercent": 50,
                          "interval": 1
                        },
                        "perception": {
                          "enabled": false,
                          "sightRange": 0,
                          "hearingRange": 0,
                          "suspicionPerSight": 10,
                          "suspicionPerNoise": 10,
                          "threshold": 50,
                          "investigate": false,
                          "returnHome": false,
                          "allowedRoomIds": []
                        },
                        "abilities": [
                          {
                            "id": "offer",
                            "name": "Offer the delivery",
                            "enabled": true,
                            "event": "manual",
                            "scope": "nearby",
                            "match": "all",
                            "conditions": [],
                            "actions": [
                              {
                                "kind": "state",
                                "target": "lesson_nr_harbor_master_accepted",
                                "value": true
                              },
                              {
                                "kind": "npc_control",
                                "target": "lesson_harbor_master",
                                "operation": "remember",
                                "key": "offered",
                                "value": true
                              },
                              {
                                "kind": "message",
                                "value": "Please bring me the requested item."
                              }
                            ],
                            "otherwise": [
                              {
                                "kind": "message",
                                "value": "The requirements are not met yet."
                              }
                            ],
                            "cooldown": 0,
                            "maxUses": 0
                          }
                        ]
                      }
                    ],
                    "npcFactions": [],
                    "conversations": [
                      {
                        "id": "lesson_nr_harbor_master_conversation",
                        "name": "harbor master conversation",
                        "enabled": true,
                        "npcId": "lesson_harbor_master",
                        "startNodeId": "welcome",
                        "nodes": [
                          {
                            "id": "welcome",
                            "text": "Please bring me the requested item.",
                            "actions": [],
                            "choices": [
                              {
                                "id": "offer",
                                "label": "Tell me about the task",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "npc_control",
                                    "target": "lesson_harbor_master",
                                    "operation": "ability",
                                    "abilityId": "offer"
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "leave",
                                "label": "Goodbye",
                                "conditions": [],
                                "match": "all",
                                "actions": [],
                                "once": false,
                                "unavailable": "hidden",
                                "next": "$end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "routines": [],
                    "recipes": [
                      {
                        "id": "lesson_nr_harbor_master_handover",
                        "name": "harbor master accepted delivery",
                        "enabled": true,
                        "verbs": [
                          "give"
                        ],
                        "unordered": true,
                        "inputs": [
                          {
                            "objectId": "lesson_sealed_dispatch",
                            "disposition": "transfer"
                          }
                        ],
                        "tools": [],
                        "target": {
                          "kind": "npc",
                          "id": "lesson_harbor_master"
                        },
                        "match": "all",
                        "conditions": [
                          {
                            "kind": "state",
                            "target": "lesson_nr_harbor_master_accepted",
                            "value": true,
                            "operator": "=="
                          }
                        ],
                        "actions": [
                          {
                            "kind": "state",
                            "target": "lesson_nr_harbor_master_delivered",
                            "value": true
                          },
                          {
                            "kind": "npc_control",
                            "target": "lesson_harbor_master",
                            "operation": "remember",
                            "key": "delivered",
                            "value": true
                          }
                        ],
                        "once": true,
                        "success": "The delivery is accepted. Thank you.",
                        "failure": "The requirements are not met yet.",
                        "repeat": "That has already been completed."
                      }
                    ],
                    "quests": [
                      {
                        "id": "lesson_nr_harbor_master_quest",
                        "name": "Harbor service and safe arrival",
                        "enabled": true,
                        "description": "Please bring me the requested item.",
                        "stages": [
                          {
                            "id": "accepted",
                            "name": "Accept the delivery task",
                            "description": "Accept the delivery task",
                            "prerequisites": [],
                            "optional": false,
                            "automatic": true,
                            "conditions": [
                              {
                                "kind": "state",
                                "target": "lesson_nr_harbor_master_accepted",
                                "value": true,
                                "operator": "=="
                              }
                            ],
                            "match": "all",
                            "completionText": "Accept the delivery task",
                            "actions": []
                          },
                          {
                            "id": "delivered",
                            "name": "Deliver the real item",
                            "description": "Deliver the real item",
                            "prerequisites": [
                              "accepted"
                            ],
                            "optional": false,
                            "automatic": true,
                            "conditions": [
                              {
                                "kind": "state",
                                "target": "lesson_nr_harbor_master_delivered",
                                "value": true,
                                "operator": "=="
                              }
                            ],
                            "match": "all",
                            "completionText": "Deliver the real item",
                            "actions": []
                          }
                        ],
                        "completionText": "The delivery is accepted. Thank you.",
                        "completionActions": [
                          {
                            "kind": "score",
                            "value": 100
                          },
                          {
                            "kind": "money",
                            "value": 5
                          }
                        ]
                      }
                    ],
                    "hints": [],
                    "scriptFunctions": [],
                    "mechanics": []
                  }
                },
                "scripts": [],
                "dependencies": [
                  {
                    "kind": "object",
                    "id": "lesson_sealed_dispatch"
                  },
                  {
                    "kind": "room",
                    "id": "lesson_pier"
                  }
                ],
                "notes": [
                  "Choose the one physical item to deliver and the NPC starting room.",
                  "The handover must be accepted; talking or repeating a callback cannot manufacture the reward.",
                  "Give the actual sealed_dispatch to harbor master after accepting. The native Quest awards 100 score and 5 currency once.",
                  "Test: TALK harbor master",
                  "Test: GIVE <item> TO harbor master",
                  "Test: OBJECTIVES"
                ],
                "roleId": "quest_giver",
                "definition": {
                  "version": 1,
                  "id": "lesson_harbor_master",
                  "roleId": "quest_giver",
                  "name": "harbor master",
                  "description": "Offer a delivery task, accept its actual item and award a native Quest reward once.",
                  "enabled": true,
                  "inputs": [
                    {
                      "id": "home",
                      "name": "Starting room",
                      "kind": "room",
                      "value": "lesson_pier",
                      "required": true
                    },
                    {
                      "id": "item",
                      "name": "Delivery item",
                      "kind": "object",
                      "value": "lesson_sealed_dispatch",
                      "required": true
                    },
                    {
                      "id": "questName",
                      "name": "Quest title",
                      "kind": "text",
                      "value": "Harbor service and safe arrival",
                      "required": true
                    },
                    {
                      "id": "score",
                      "name": "Completion score",
                      "kind": "number",
                      "value": 100,
                      "required": true,
                      "min": 0,
                      "max": 1000000
                    },
                    {
                      "id": "money",
                      "name": "Completion currency",
                      "kind": "number",
                      "value": 5,
                      "required": true,
                      "min": 0,
                      "max": 1000000
                    }
                  ],
                  "messages": {
                    "greeting": "Please bring me the requested item.",
                    "success": "The delivery is accepted. Thank you.",
                    "failure": "The requirements are not met yet.",
                    "repeat": "That has already been completed."
                  }
                }
              }
            }
          }
        },
        {
          "path": "npcs",
          "key": "lesson_sentinel",
          "after": {
            "id": "lesson_sentinel",
            "name": "sentinel",
            "description": "Walk a native connected route, pause for interactions and investigate nearby alerts.",
            "location": "lesson_gate",
            "mobile": true,
            "aliases": [
              "sentinel"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"I am watching this area.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [],
            "npcPackage": {
              "version": 1,
              "id": "lesson_sentinel",
              "roleId": "patrol_guard",
              "definition": {
                "version": 1,
                "id": "lesson_sentinel",
                "roleId": "patrol_guard",
                "name": "sentinel",
                "description": "Walk a native connected route, pause for interactions and investigate nearby alerts.",
                "enabled": true,
                "inputs": [
                  {
                    "id": "home",
                    "name": "Starting room",
                    "kind": "room",
                    "value": "lesson_gate",
                    "required": true
                  },
                  {
                    "id": "route",
                    "name": "Patrol rooms, in order",
                    "kind": "room_list",
                    "value": "lesson_gate,lesson_square",
                    "required": true
                  },
                  {
                    "id": "turnsPerStop",
                    "name": "Turns at each stop",
                    "kind": "number",
                    "value": 2,
                    "required": true,
                    "min": 1,
                    "max": 1000
                  },
                  {
                    "id": "sight",
                    "name": "Sight range in connected rooms",
                    "kind": "number",
                    "value": 0,
                    "required": true,
                    "min": 0,
                    "max": 8
                  }
                ],
                "messages": {
                  "greeting": "I am watching this area.",
                  "success": "The interaction succeeds.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That has already been completed."
                }
              },
              "owned": {
                "states": [],
                "rules": [],
                "scripts": [],
                "npcProfiles": [
                  "lesson_nr_sentinel_profile"
                ],
                "npcFactions": [],
                "conversations": [
                  "lesson_nr_sentinel_conversation"
                ],
                "routines": [
                  "lesson_nr_sentinel_patrol"
                ],
                "recipes": [],
                "quests": [],
                "hints": [],
                "scriptFunctions": [],
                "mechanics": []
              },
              "baseline": {
                "version": 1,
                "npc": {
                  "id": "lesson_sentinel",
                  "name": "sentinel",
                  "description": "Walk a native connected route, pause for interactions and investigate nearby alerts.",
                  "location": "lesson_gate",
                  "mobile": true,
                  "aliases": [],
                  "onEnter": "",
                  "onExamine": "",
                  "onTalk": "print \"I am watching this area.\"",
                  "onAttack": "",
                  "onDeath": "",
                  "onFollow": "",
                  "onAutoAttack": "",
                  "onTrustChange": "",
                  "onGive": "",
                  "onBeforeTalk": "",
                  "onAfterTalk": "",
                  "onBeforeAttack": "",
                  "onAfterAttack": "",
                  "onDamage": "",
                  "onHeal": "",
                  "onMove": "",
                  "onLeave": "",
                  "followPlayer": false,
                  "health": 100,
                  "combatSide": "neutral",
                  "autoFight": false,
                  "attackPower": 10,
                  "defense": 0,
                  "trustLevel": 50,
                  "conversationEnabled": false,
                  "convGreeting": "",
                  "convFarewell": "",
                  "convTopics": [],
                  "dialogues": []
                },
                "story": {
                  "version": 1,
                  "states": [],
                  "rules": [],
                  "features": {
                    "version": 1,
                    "npcProfiles": [
                      {
                        "version": 1,
                        "id": "lesson_nr_sentinel_profile",
                        "name": "sentinel",
                        "npcId": "lesson_sentinel",
                        "enabled": true,
                        "memory": [],
                        "traits": {
                          "loyalty": 50,
                          "fear": 0,
                          "suspicion": 0
                        },
                        "life": {
                          "maxHealth": 100,
                          "initial": "active",
                          "essential": false,
                          "defeat": "dead",
                          "retreatAtHealth": 0
                        },
                        "inventory": {
                          "objects": [],
                          "equipped": [],
                          "equipment": [],
                          "money": 0,
                          "dropOnDeath": false
                        },
                        "combat": {
                          "assist": "off",
                          "target": "first_enemy",
                          "interceptPercent": 50,
                          "interval": 1
                        },
                        "perception": {
                          "enabled": true,
                          "sightRange": 0,
                          "hearingRange": 0,
                          "suspicionPerSight": 10,
                          "suspicionPerNoise": 10,
                          "threshold": 50,
                          "investigate": true,
                          "returnHome": true,
                          "allowedRoomIds": [
                            "lesson_gate",
                            "lesson_square"
                          ],
                          "homeRoomId": "lesson_gate"
                        },
                        "abilities": []
                      }
                    ],
                    "npcFactions": [],
                    "conversations": [
                      {
                        "id": "lesson_nr_sentinel_conversation",
                        "name": "sentinel conversation",
                        "enabled": true,
                        "npcId": "lesson_sentinel",
                        "startNodeId": "welcome",
                        "nodes": [
                          {
                            "id": "welcome",
                            "text": "I am watching this area.",
                            "actions": [],
                            "choices": [
                              {
                                "id": "status",
                                "label": "Ask about the patrol",
                                "conditions": [],
                                "match": "all",
                                "actions": [
                                  {
                                    "kind": "message",
                                    "value": "I walk the connected route and investigate alerts in this area."
                                  }
                                ],
                                "once": false,
                                "unavailable": "disabled",
                                "next": "$end"
                              },
                              {
                                "id": "leave",
                                "label": "Goodbye",
                                "conditions": [],
                                "match": "all",
                                "actions": [],
                                "once": false,
                                "unavailable": "hidden",
                                "next": "$end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "routines": [
                      {
                        "id": "lesson_nr_sentinel_patrol",
                        "name": "sentinel connected patrol",
                        "enabled": true,
                        "npcId": "lesson_sentinel",
                        "activities": [
                          {
                            "id": "stop_1",
                            "name": "Patrol stop 1",
                            "enabled": true,
                            "priority": 0,
                            "conditions": [],
                            "match": "all",
                            "destinationId": "lesson_gate",
                            "duration": 2,
                            "actions": [],
                            "completionActions": [],
                            "nextActivityId": "stop_2",
                            "once": false
                          },
                          {
                            "id": "stop_2",
                            "name": "Patrol stop 2",
                            "enabled": true,
                            "priority": 0,
                            "conditions": [],
                            "match": "all",
                            "destinationId": "lesson_square",
                            "duration": 2,
                            "actions": [],
                            "completionActions": [],
                            "nextActivityId": "stop_1",
                            "once": false
                          }
                        ]
                      }
                    ],
                    "recipes": [],
                    "quests": [],
                    "hints": [],
                    "scriptFunctions": [],
                    "mechanics": []
                  }
                },
                "scripts": [],
                "dependencies": [
                  {
                    "kind": "room",
                    "id": "lesson_gate"
                  },
                  {
                    "kind": "room",
                    "id": "lesson_square"
                  }
                ],
                "notes": [
                  "Choose at least two existing rooms in route order.",
                  "Movement uses open connections; blocked paths are reported rather than teleported through.",
                  "Test: WAIT",
                  "Test: TALK sentinel"
                ],
                "roleId": "patrol_guard",
                "definition": {
                  "version": 1,
                  "id": "lesson_sentinel",
                  "roleId": "patrol_guard",
                  "name": "sentinel",
                  "description": "Walk a native connected route, pause for interactions and investigate nearby alerts.",
                  "enabled": true,
                  "inputs": [
                    {
                      "id": "home",
                      "name": "Starting room",
                      "kind": "room",
                      "value": "lesson_gate",
                      "required": true
                    },
                    {
                      "id": "route",
                      "name": "Patrol rooms, in order",
                      "kind": "room_list",
                      "value": "lesson_gate,lesson_square",
                      "required": true
                    },
                    {
                      "id": "turnsPerStop",
                      "name": "Turns at each stop",
                      "kind": "number",
                      "value": 2,
                      "required": true,
                      "min": 1,
                      "max": 1000
                    },
                    {
                      "id": "sight",
                      "name": "Sight range in connected rooms",
                      "kind": "number",
                      "value": 0,
                      "required": true,
                      "min": 0,
                      "max": 8
                    }
                  ],
                  "messages": {
                    "greeting": "I am watching this area.",
                    "success": "The interaction succeeds.",
                    "failure": "The requirements are not met yet.",
                    "repeat": "That has already been completed."
                  }
                }
              }
            }
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_square",
          "after": {
            "id": "lesson_square",
            "name": "Harbor Square",
            "narrative": "A safe harbor workshop demonstrates editable NPC roles. READ BRIEFING for the complete route. The guide, merchant and medic work here. There is no hostile combat or time limit.",
            "description": "The workshop is EAST, the gate NORTH and the pier SOUTH. The merchant owns one replacement fuse; the wrench and briefing are here.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "TALK MERCHANT, choose 1, TAKE WRENCH, then EAST. READ BRIEFING gives every step.",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_workshop",
          "after": {
            "id": "lesson_workshop",
            "name": "Repair Workshop",
            "description": "The technician waits beside the locked supply crate. The square is WEST.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "Carry the fuse and wrench, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE, TAKE HARBOR PASS, then WEST.",
            "dark": false,
            "roomType": "regular",
            "x": 320,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_gate",
          "after": {
            "id": "lesson_gate",
            "name": "Harbor Gate",
            "description": "The gatekeeper checks a real harbor pass before admitting visitors to the shelter. The square is SOUTH.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "Carry the harbor pass. TALK GATEKEEPER and choose 1. The pass is retained.",
            "dark": false,
            "roomType": "regular",
            "x": 540,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_shelter",
          "after": {
            "id": "lesson_shelter",
            "name": "Shelter",
            "description": "The civilian needs a safe escort to the pier. One sealed dispatch waits here. The gate is SOUTH.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1. SOUTH, SOUTH, SOUTH reaches the pier.",
            "dark": false,
            "roomType": "regular",
            "x": 760,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_pier",
          "after": {
            "id": "lesson_pier",
            "name": "Harbor Pier",
            "description": "The harbor master accepts the dispatch only after the repair and living rescue agree. The square is NORTH.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "TALK HARBOR MASTER and choose 1 to accept the task. Bring the recruited civilian here, then GIVE SEALED DISPATCH TO HARBOR MASTER.",
            "dark": false,
            "roomType": "regular",
            "x": 980,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_0",
          "after": {
            "id": "lesson_route_connection_0",
            "fromRoom": "lesson_square",
            "toRoom": "lesson_workshop",
            "direction": "east",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_1",
          "after": {
            "id": "lesson_route_connection_1",
            "fromRoom": "lesson_workshop",
            "toRoom": "lesson_square",
            "direction": "west",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_2",
          "after": {
            "id": "lesson_route_connection_2",
            "fromRoom": "lesson_square",
            "toRoom": "lesson_gate",
            "direction": "north",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_3",
          "after": {
            "id": "lesson_route_connection_3",
            "fromRoom": "lesson_gate",
            "toRoom": "lesson_square",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_4",
          "after": {
            "id": "lesson_route_connection_4",
            "fromRoom": "lesson_gate",
            "toRoom": "lesson_shelter",
            "direction": "north",
            "locked": false,
            "when": "lesson_harbor_gate_open"
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_5",
          "after": {
            "id": "lesson_route_connection_5",
            "fromRoom": "lesson_shelter",
            "toRoom": "lesson_gate",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_6",
          "after": {
            "id": "lesson_route_connection_6",
            "fromRoom": "lesson_square",
            "toRoom": "lesson_pier",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_7",
          "after": {
            "id": "lesson_route_connection_7",
            "fromRoom": "lesson_pier",
            "toRoom": "lesson_square",
            "direction": "north",
            "locked": false
          }
        },
        {
          "path": "scripts",
          "key": "lesson_nr_technician_repair",
          "after": {
            "id": "lesson_nr_technician_repair",
            "name": "Complete native repair",
            "description": "Owned by technician.",
            "kind": "shared",
            "body": "# Native visual steps are stored in the callable definition."
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_nr_technician_repaired",
          "after": {
            "id": "lesson_nr_technician_repaired",
            "name": "technician (technician) repaired",
            "description": "Owned by NPC role technician.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_nr_civilian_rescued",
          "after": {
            "id": "lesson_nr_civilian_rescued",
            "name": "civilian (civilian) rescued",
            "description": "Owned by NPC role civilian.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_nr_harbor_master_accepted",
          "after": {
            "id": "lesson_nr_harbor_master_accepted",
            "name": "harbor master (harbor_master) accepted",
            "description": "Owned by NPC role harbor_master.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_nr_harbor_master_delivered",
          "after": {
            "id": "lesson_nr_harbor_master_delivered",
            "name": "harbor master (harbor_master) delivered",
            "description": "Owned by NPC role harbor_master.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_harbor_gate_open",
          "after": {
            "id": "lesson_harbor_gate_open",
            "name": "Harbor gate opened",
            "description": "The gatekeeper admitted a player carrying the real pass.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_workshop_complete",
          "after": {
            "id": "lesson_workshop_complete",
            "name": "Workshop complete",
            "description": "The workshop reached its completion.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_nr_guide_profile",
          "after": {
            "version": 1,
            "id": "lesson_nr_guide_profile",
            "name": "guide",
            "npcId": "lesson_guide",
            "enabled": true,
            "memory": [],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": []
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_nr_merchant_profile",
          "after": {
            "version": 1,
            "id": "lesson_nr_merchant_profile",
            "name": "merchant",
            "npcId": "lesson_merchant",
            "enabled": true,
            "memory": [],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [
                "lesson_fuse"
              ],
              "equipped": [],
              "equipment": [],
              "money": 100,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": []
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_nr_medic_profile",
          "after": {
            "version": 1,
            "id": "lesson_nr_medic_profile",
            "name": "medic",
            "npcId": "lesson_medic",
            "enabled": true,
            "memory": [],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": [
              {
                "id": "treat",
                "name": "Treatment",
                "enabled": true,
                "event": "manual",
                "scope": "nearby",
                "match": "all",
                "conditions": [],
                "actions": [
                  {
                    "kind": "npc_control",
                    "target": "lesson_medic",
                    "operation": "heal",
                    "value": 40,
                    "cost": 2
                  }
                ],
                "otherwise": [
                  {
                    "kind": "message",
                    "value": "The requirements are not met yet."
                  }
                ],
                "cooldown": 3,
                "maxUses": 0
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_nr_technician_profile",
          "after": {
            "version": 1,
            "id": "lesson_nr_technician_profile",
            "name": "technician",
            "npcId": "lesson_technician",
            "enabled": true,
            "memory": [
              {
                "id": "repaired",
                "name": "Repair completed",
                "type": "boolean",
                "initial": false
              }
            ],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": []
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_nr_gatekeeper_profile",
          "after": {
            "version": 1,
            "id": "lesson_nr_gatekeeper_profile",
            "name": "gatekeeper",
            "npcId": "lesson_gatekeeper",
            "enabled": true,
            "memory": [],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": [
              {
                "id": "passage",
                "name": "Grant passage",
                "enabled": true,
                "event": "manual",
                "scope": "nearby",
                "match": "any",
                "conditions": [
                  {
                    "kind": "inventory",
                    "target": "lesson_harbor_pass",
                    "value": true,
                    "operator": "=="
                  },
                  {
                    "kind": "npc_trust",
                    "target": "lesson_gatekeeper",
                    "value": 100,
                    "operator": ">="
                  }
                ],
                "actions": [
                  {
                    "kind": "state",
                    "target": "lesson_harbor_gate_open",
                    "value": true
                  },
                  {
                    "kind": "message",
                    "value": "You may pass."
                  },
                  {
                    "kind": "goto",
                    "target": "lesson_shelter"
                  }
                ],
                "otherwise": [
                  {
                    "kind": "message",
                    "value": "The requirements are not met yet."
                  }
                ],
                "cooldown": 0,
                "maxUses": 0
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_nr_civilian_profile",
          "after": {
            "version": 1,
            "id": "lesson_nr_civilian_profile",
            "name": "civilian",
            "npcId": "lesson_civilian",
            "enabled": true,
            "memory": [
              {
                "id": "rescued",
                "name": "Reached extraction",
                "type": "boolean",
                "initial": false
              }
            ],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 60,
              "initial": "active",
              "essential": false,
              "defeat": "downed",
              "retreatAtHealth": 0,
              "rescueRoomId": "lesson_pier"
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": [
              {
                "id": "arrival",
                "name": "Record a living rescue",
                "enabled": true,
                "event": "rescue",
                "scope": "anywhere",
                "match": "all",
                "conditions": [],
                "actions": [
                  {
                    "kind": "state",
                    "target": "lesson_nr_civilian_rescued",
                    "value": true
                  },
                  {
                    "kind": "npc_control",
                    "target": "lesson_civilian",
                    "operation": "remember",
                    "key": "rescued",
                    "value": true
                  },
                  {
                    "kind": "message",
                    "value": "The rescue is complete. We reached safety."
                  }
                ],
                "otherwise": [
                  {
                    "kind": "message",
                    "value": "The requirements are not met yet."
                  }
                ],
                "cooldown": 0,
                "maxUses": 1
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_nr_harbor_master_profile",
          "after": {
            "version": 1,
            "id": "lesson_nr_harbor_master_profile",
            "name": "harbor master",
            "npcId": "lesson_harbor_master",
            "enabled": true,
            "memory": [
              {
                "id": "offered",
                "name": "Task offered",
                "type": "boolean",
                "initial": false
              },
              {
                "id": "delivered",
                "name": "Delivery accepted",
                "type": "boolean",
                "initial": false
              }
            ],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": [
              {
                "id": "offer",
                "name": "Offer the delivery",
                "enabled": true,
                "event": "manual",
                "scope": "nearby",
                "match": "all",
                "conditions": [],
                "actions": [
                  {
                    "kind": "state",
                    "target": "lesson_nr_harbor_master_accepted",
                    "value": true
                  },
                  {
                    "kind": "npc_control",
                    "target": "lesson_harbor_master",
                    "operation": "remember",
                    "key": "offered",
                    "value": true
                  },
                  {
                    "kind": "message",
                    "value": "Please bring me the requested item."
                  }
                ],
                "otherwise": [
                  {
                    "kind": "message",
                    "value": "The requirements are not met yet."
                  }
                ],
                "cooldown": 0,
                "maxUses": 0
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_nr_sentinel_profile",
          "after": {
            "version": 1,
            "id": "lesson_nr_sentinel_profile",
            "name": "sentinel",
            "npcId": "lesson_sentinel",
            "enabled": true,
            "memory": [],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": true,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": true,
              "returnHome": true,
              "allowedRoomIds": [
                "lesson_gate",
                "lesson_square"
              ],
              "homeRoomId": "lesson_gate"
            },
            "abilities": []
          }
        },
        {
          "path": "manifest.story.features.conversations",
          "key": "lesson_nr_guide_conversation",
          "after": {
            "id": "lesson_nr_guide_conversation",
            "name": "guide conversation",
            "enabled": true,
            "npcId": "lesson_guide",
            "startNodeId": "welcome",
            "nodes": [
              {
                "id": "welcome",
                "text": "I can offer a hint if you need one.",
                "actions": [],
                "choices": [
                  {
                    "id": "hint",
                    "label": "Please give me a hint",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "npc_control",
                        "target": "lesson_guide",
                        "operation": "hint",
                        "key": "lesson_nr_guide_hint"
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "leave",
                    "label": "Goodbye",
                    "conditions": [],
                    "match": "all",
                    "actions": [],
                    "once": false,
                    "unavailable": "hidden",
                    "next": "$end"
                  }
                ]
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.conversations",
          "key": "lesson_nr_merchant_conversation",
          "after": {
            "id": "lesson_nr_merchant_conversation",
            "name": "merchant conversation",
            "enabled": true,
            "npcId": "lesson_merchant",
            "startNodeId": "welcome",
            "nodes": [
              {
                "id": "welcome",
                "text": "Choose a purchase or offer the selected trade item.",
                "actions": [],
                "choices": [
                  {
                    "id": "buy",
                    "label": "Buy the stock item (3)",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "npc_control",
                        "target": "lesson_merchant",
                        "operation": "buy",
                        "objectId": "lesson_fuse",
                        "value": 3
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "sell",
                    "label": "Sell the selected item (0)",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "npc_control",
                        "target": "lesson_merchant",
                        "operation": "sell",
                        "objectId": "lesson_fuse",
                        "value": 0
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "leave",
                    "label": "Goodbye",
                    "conditions": [],
                    "match": "all",
                    "actions": [],
                    "once": false,
                    "unavailable": "hidden",
                    "next": "$end"
                  }
                ]
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.conversations",
          "key": "lesson_nr_medic_conversation",
          "after": {
            "id": "lesson_nr_medic_conversation",
            "name": "medic conversation",
            "enabled": true,
            "npcId": "lesson_medic",
            "startNodeId": "welcome",
            "nodes": [
              {
                "id": "welcome",
                "text": "I can treat your injuries.",
                "actions": [],
                "choices": [
                  {
                    "id": "treat",
                    "label": "Receive treatment (2)",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "npc_control",
                        "target": "lesson_medic",
                        "operation": "ability",
                        "abilityId": "treat"
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "leave",
                    "label": "Goodbye",
                    "conditions": [],
                    "match": "all",
                    "actions": [],
                    "once": false,
                    "unavailable": "hidden",
                    "next": "$end"
                  }
                ]
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.conversations",
          "key": "lesson_nr_technician_conversation",
          "after": {
            "id": "lesson_nr_technician_conversation",
            "name": "technician conversation",
            "enabled": true,
            "npcId": "lesson_technician",
            "startNodeId": "welcome",
            "nodes": [
              {
                "id": "welcome",
                "text": "I can repair the selected device if you bring the right material and tool.",
                "actions": [],
                "choices": [
                  {
                    "id": "instructions",
                    "label": "What do you need for the repair?",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "message",
                        "value": "Use the repair material with the device while carrying the retained tool. The requirements are not met yet."
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "leave",
                    "label": "Goodbye",
                    "conditions": [],
                    "match": "all",
                    "actions": [],
                    "once": false,
                    "unavailable": "hidden",
                    "next": "$end"
                  }
                ]
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.conversations",
          "key": "lesson_nr_gatekeeper_conversation",
          "after": {
            "id": "lesson_nr_gatekeeper_conversation",
            "name": "gatekeeper conversation",
            "enabled": true,
            "npcId": "lesson_gatekeeper",
            "startNodeId": "welcome",
            "nodes": [
              {
                "id": "welcome",
                "text": "Show your pass or earn my trust before passing.",
                "actions": [],
                "choices": [
                  {
                    "id": "pass",
                    "label": "Request passage",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "npc_control",
                        "target": "lesson_gatekeeper",
                        "operation": "ability",
                        "abilityId": "passage"
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "leave",
                    "label": "Goodbye",
                    "conditions": [],
                    "match": "all",
                    "actions": [],
                    "once": false,
                    "unavailable": "hidden",
                    "next": "$end"
                  }
                ]
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.conversations",
          "key": "lesson_nr_civilian_conversation",
          "after": {
            "id": "lesson_nr_civilian_conversation",
            "name": "civilian conversation",
            "enabled": true,
            "npcId": "lesson_civilian",
            "startNodeId": "welcome",
            "nodes": [
              {
                "id": "welcome",
                "text": "Please help me reach safety.",
                "actions": [],
                "choices": [
                  {
                    "id": "follow",
                    "label": "Follow me to safety",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "npc_control",
                        "target": "lesson_civilian",
                        "operation": "recruit"
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "wait",
                    "label": "Wait here safely",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "npc_control",
                        "target": "lesson_civilian",
                        "operation": "wait"
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "leave",
                    "label": "Goodbye",
                    "conditions": [],
                    "match": "all",
                    "actions": [],
                    "once": false,
                    "unavailable": "hidden",
                    "next": "$end"
                  }
                ]
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.conversations",
          "key": "lesson_nr_harbor_master_conversation",
          "after": {
            "id": "lesson_nr_harbor_master_conversation",
            "name": "harbor master conversation",
            "enabled": true,
            "npcId": "lesson_harbor_master",
            "startNodeId": "welcome",
            "nodes": [
              {
                "id": "welcome",
                "text": "Please bring me the requested item.",
                "actions": [],
                "choices": [
                  {
                    "id": "offer",
                    "label": "Tell me about the task",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "npc_control",
                        "target": "lesson_harbor_master",
                        "operation": "ability",
                        "abilityId": "offer"
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "leave",
                    "label": "Goodbye",
                    "conditions": [],
                    "match": "all",
                    "actions": [],
                    "once": false,
                    "unavailable": "hidden",
                    "next": "$end"
                  }
                ]
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.conversations",
          "key": "lesson_nr_sentinel_conversation",
          "after": {
            "id": "lesson_nr_sentinel_conversation",
            "name": "sentinel conversation",
            "enabled": true,
            "npcId": "lesson_sentinel",
            "startNodeId": "welcome",
            "nodes": [
              {
                "id": "welcome",
                "text": "I am watching this area.",
                "actions": [],
                "choices": [
                  {
                    "id": "status",
                    "label": "Ask about the patrol",
                    "conditions": [],
                    "match": "all",
                    "actions": [
                      {
                        "kind": "message",
                        "value": "I walk the connected route and investigate alerts in this area."
                      }
                    ],
                    "once": false,
                    "unavailable": "disabled",
                    "next": "$end"
                  },
                  {
                    "id": "leave",
                    "label": "Goodbye",
                    "conditions": [],
                    "match": "all",
                    "actions": [],
                    "once": false,
                    "unavailable": "hidden",
                    "next": "$end"
                  }
                ]
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.routines",
          "key": "lesson_nr_sentinel_patrol",
          "after": {
            "id": "lesson_nr_sentinel_patrol",
            "name": "sentinel connected patrol",
            "enabled": true,
            "npcId": "lesson_sentinel",
            "activities": [
              {
                "id": "stop_1",
                "name": "Patrol stop 1",
                "enabled": true,
                "priority": 0,
                "conditions": [],
                "match": "all",
                "destinationId": "lesson_gate",
                "duration": 2,
                "actions": [],
                "completionActions": [],
                "nextActivityId": "stop_2",
                "once": false
              },
              {
                "id": "stop_2",
                "name": "Patrol stop 2",
                "enabled": true,
                "priority": 0,
                "conditions": [],
                "match": "all",
                "destinationId": "lesson_square",
                "duration": 2,
                "actions": [],
                "completionActions": [],
                "nextActivityId": "stop_1",
                "once": false
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.recipes",
          "key": "lesson_nr_technician_repair",
          "after": {
            "id": "lesson_nr_technician_repair",
            "name": "technician repair",
            "enabled": true,
            "verbs": [
              "use"
            ],
            "unordered": true,
            "inputs": [
              {
                "objectId": "lesson_fuse",
                "disposition": "consume"
              }
            ],
            "tools": [
              "lesson_wrench"
            ],
            "target": {
              "kind": "object",
              "id": "lesson_supply_crate"
            },
            "roomId": "lesson_workshop",
            "match": "all",
            "conditions": [
              {
                "kind": "npc_available",
                "target": "lesson_technician",
                "value": true,
                "operator": "=="
              }
            ],
            "actions": [
              {
                "kind": "script",
                "target": "lesson_nr_technician_repair"
              },
              {
                "kind": "npc_control",
                "target": "lesson_technician",
                "operation": "remember",
                "key": "repaired",
                "value": true
              }
            ],
            "once": true,
            "success": "",
            "failure": "The requirements are not met yet.",
            "repeat": "That has already been completed."
          }
        },
        {
          "path": "manifest.story.features.recipes",
          "key": "lesson_nr_harbor_master_handover",
          "after": {
            "id": "lesson_nr_harbor_master_handover",
            "name": "harbor master accepted delivery",
            "enabled": true,
            "verbs": [
              "give"
            ],
            "unordered": true,
            "inputs": [
              {
                "objectId": "lesson_sealed_dispatch",
                "disposition": "transfer"
              }
            ],
            "tools": [],
            "target": {
              "kind": "npc",
              "id": "lesson_harbor_master"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_nr_harbor_master_accepted",
                "value": true,
                "operator": "=="
              },
              {
                "kind": "state",
                "target": "lesson_nr_technician_repaired",
                "operator": "==",
                "value": true
              },
              {
                "kind": "state",
                "target": "lesson_nr_civilian_rescued",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_nr_harbor_master_delivered",
                "value": true
              },
              {
                "kind": "npc_control",
                "target": "lesson_harbor_master",
                "operation": "remember",
                "key": "delivered",
                "value": true
              }
            ],
            "once": true,
            "success": "The delivery is accepted. Thank you.",
            "failure": "Repair the supply crate and bring the living civilian to the pier before handing over the real sealed dispatch. No item or payment is consumed by this refusal.",
            "repeat": "That has already been completed."
          }
        },
        {
          "path": "manifest.story.features.quests",
          "key": "lesson_nr_civilian_quest",
          "after": {
            "id": "lesson_nr_civilian_quest",
            "name": "Rescue civilian",
            "enabled": true,
            "description": "Bring civilian safely to extraction.",
            "stages": [
              {
                "id": "arrived",
                "name": "Arrive alive at extraction",
                "description": "Arrive alive at extraction",
                "prerequisites": [],
                "optional": false,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "state",
                    "target": "lesson_nr_civilian_rescued",
                    "value": true,
                    "operator": "=="
                  }
                ],
                "match": "all",
                "completionText": "Arrive alive at extraction",
                "actions": []
              }
            ],
            "completionText": "The rescue is complete. We reached safety.",
            "completionActions": [
              {
                "kind": "score",
                "value": 0
              },
              {
                "kind": "money",
                "value": 0
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.quests",
          "key": "lesson_nr_harbor_master_quest",
          "after": {
            "id": "lesson_nr_harbor_master_quest",
            "name": "Harbor service and safe arrival",
            "enabled": true,
            "description": "Repair the crate, bring the civilian safely to the pier, and make one accepted dispatch delivery.",
            "stages": [
              {
                "id": "accepted",
                "name": "Accept the delivery task",
                "description": "Accept the delivery task",
                "prerequisites": [],
                "optional": false,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "state",
                    "target": "lesson_nr_harbor_master_accepted",
                    "value": true,
                    "operator": "=="
                  }
                ],
                "match": "all",
                "completionText": "Accept the delivery task",
                "actions": []
              },
              {
                "id": "delivered",
                "name": "Deliver the real item",
                "description": "Deliver the real item",
                "prerequisites": [
                  "accepted"
                ],
                "optional": false,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "state",
                    "target": "lesson_nr_harbor_master_delivered",
                    "value": true,
                    "operator": "=="
                  }
                ],
                "match": "all",
                "completionText": "Deliver the real item",
                "actions": []
              }
            ],
            "completionText": "Harbor Helpers service complete! Real stock, a retained tool, a repaired crate, a checked pass, a living escort and the accepted dispatch agree. You earn 100 points and five harbor coins.",
            "completionActions": [
              {
                "kind": "state",
                "target": "lesson_workshop_complete",
                "value": true
              },
              {
                "kind": "score",
                "value": 100
              },
              {
                "kind": "money",
                "value": 5
              },
              {
                "kind": "end"
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.hints",
          "key": "lesson_nr_guide_hint",
          "after": {
            "id": "lesson_nr_guide_hint",
            "name": "guide hints",
            "enabled": true,
            "scope": {
              "kind": "room",
              "target": "lesson_square"
            },
            "priority": 0,
            "conditions": [],
            "match": "all",
            "completedConditions": [],
            "completedMatch": "all",
            "completedText": "You have already completed this task.",
            "levels": [
              {
                "level": "gentle",
                "text": "The merchant has the repair material, and the wrench stays with you.",
                "conditions": [],
                "match": "all"
              },
              {
                "level": "strong",
                "text": "Buy the fuse, use it with the supply crate in the eastern workshop, then open the crate for the harbor pass.",
                "conditions": [],
                "match": "all"
              },
              {
                "level": "solution",
                "text": "Follow the BRIEFING route: repair the crate, accept the harbor master’s task, pass the gate, recruit the civilian, and make the accepted dispatch delivery.",
                "conditions": [],
                "match": "all"
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.scriptFunctions",
          "key": "lesson_nr_technician_repair",
          "after": {
            "version": 1,
            "id": "lesson_nr_technician_repair",
            "name": "Complete native repair",
            "description": "Owned by NPC technician.",
            "inputs": [],
            "locals": [],
            "resultType": "void",
            "mode": "visual",
            "steps": [
              {
                "id": "unlock",
                "kind": "action",
                "action": {
                  "kind": "object_state",
                  "target": "lesson_supply_crate",
                  "property": "locked",
                  "value": false
                }
              },
              {
                "id": "confirm",
                "kind": "action",
                "action": {
                  "kind": "state",
                  "target": "lesson_nr_technician_repaired",
                  "value": true
                }
              },
              {
                "id": "message",
                "kind": "action",
                "action": {
                  "kind": "message",
                  "value": "The device is repaired."
                }
              }
            ]
          }
        },
        {
          "path": "manifest.playerConfig.healthEnabled",
          "key": "$value",
          "after": true
        },
        {
          "path": "manifest.playerConfig.moneyEnabled",
          "key": "$value",
          "after": true
        },
        {
          "path": "manifest.story.features.commandContext",
          "key": "$value",
          "after": true
        }
      ]
    }
  ],
  "creatorNotes": "Build a harbor with eight helpful character roles. Try hints, trade, healing, repairs, a guarded passage, a living rescue, a checked delivery and a patrol. Each character uses real items and remembered progress. Open this recipe in Help to inspect its saved settings.",
  "mapRooms": [
    {
      "id": "lesson_square",
      "name": "Harbor Square",
      "narrative": "A safe harbor workshop demonstrates editable NPC roles. READ BRIEFING for the complete route. The guide, merchant and medic work here. There is no hostile combat or time limit.",
      "description": "The workshop is EAST, the gate NORTH and the pier SOUTH. The merchant owns one replacement fuse; the wrench and briefing are here.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "TALK MERCHANT, choose 1, TAKE WRENCH, then EAST. READ BRIEFING gives every step.",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_workshop",
      "name": "Repair Workshop",
      "description": "The technician waits beside the locked supply crate. The square is WEST.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "Carry the fuse and wrench, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE, TAKE HARBOR PASS, then WEST.",
      "dark": false,
      "roomType": "regular",
      "x": 320,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_gate",
      "name": "Harbor Gate",
      "description": "The gatekeeper checks a real harbor pass before admitting visitors to the shelter. The square is SOUTH.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "Carry the harbor pass. TALK GATEKEEPER and choose 1. The pass is retained.",
      "dark": false,
      "roomType": "regular",
      "x": 540,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_shelter",
      "name": "Shelter",
      "description": "The civilian needs a safe escort to the pier. One sealed dispatch waits here. The gate is SOUTH.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1. SOUTH, SOUTH, SOUTH reaches the pier.",
      "dark": false,
      "roomType": "regular",
      "x": 760,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_pier",
      "name": "Harbor Pier",
      "description": "The harbor master accepts the dispatch only after the repair and living rescue agree. The square is NORTH.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "TALK HARBOR MASTER and choose 1 to accept the task. Bring the recruited civilian here, then GIVE SEALED DISPATCH TO HARBOR MASTER.",
      "dark": false,
      "roomType": "regular",
      "x": 980,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    }
  ],
  "mapExits": [
    {
      "id": "lesson_route_connection_0",
      "fromRoom": "lesson_square",
      "toRoom": "lesson_workshop",
      "direction": "east",
      "locked": false
    },
    {
      "id": "lesson_route_connection_1",
      "fromRoom": "lesson_workshop",
      "toRoom": "lesson_square",
      "direction": "west",
      "locked": false
    },
    {
      "id": "lesson_route_connection_2",
      "fromRoom": "lesson_square",
      "toRoom": "lesson_gate",
      "direction": "north",
      "locked": false
    },
    {
      "id": "lesson_route_connection_3",
      "fromRoom": "lesson_gate",
      "toRoom": "lesson_square",
      "direction": "south",
      "locked": false
    },
    {
      "id": "lesson_route_connection_4",
      "fromRoom": "lesson_gate",
      "toRoom": "lesson_shelter",
      "direction": "north",
      "locked": false,
      "when": "lesson_harbor_gate_open"
    },
    {
      "id": "lesson_route_connection_5",
      "fromRoom": "lesson_shelter",
      "toRoom": "lesson_gate",
      "direction": "south",
      "locked": false
    },
    {
      "id": "lesson_route_connection_6",
      "fromRoom": "lesson_square",
      "toRoom": "lesson_pier",
      "direction": "south",
      "locked": false
    },
    {
      "id": "lesson_route_connection_7",
      "fromRoom": "lesson_pier",
      "toRoom": "lesson_square",
      "direction": "north",
      "locked": false
    }
  ],
  "objects": [
    {
      "id": "lesson_briefing",
      "name": "briefing",
      "description": "HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone.",
      "article": "",
      "location": "lesson_square",
      "aliases": [
        "instructions",
        "note",
        "briefing"
      ],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": false,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": [
        {
          "id": "read",
          "event": "read",
          "withTarget": "",
          "body": "print \"HARBOR HELPERS: At the square, TALK GUIDE and choose 1 for a real progressive hint. TALK MEDIC and choose 1 for optional treatment costing two harbor coins. TALK MERCHANT and choose 1 to buy the one physical fuse for three coins. TAKE WRENCH, EAST, USE FUSE WITH SUPPLY CRATE, OPEN SUPPLY CRATE and TAKE HARBOR PASS. Go WEST, SOUTH, TALK HARBOR MASTER and choose 1 to accept the delivery and rescue task. Return NORTH, NORTH, TALK GATEKEEPER and choose 1 to use the retained pass. In the shelter TAKE SEALED DISPATCH, TALK CIVILIAN and choose 1 to recruit the escort. Go SOUTH, SOUTH, SOUTH to the pier and GIVE SEALED DISPATCH TO HARBOR MASTER. The living civilian must actually arrive and the repair must succeed before that handover can finish the Quest. Final reward: 100 points and five harbor coins. There is no hostile combat or time limit. SAVE, LOAD and UNDO are available. The sentinel demonstrates a connected routine without threatening anyone.\""
        }
      ]
    },
    {
      "id": "lesson_fuse",
      "name": "fuse",
      "description": "One physical replacement fuse held in the merchant’s finite stock. Buy it through TALK MERCHANT, then use it with the supply crate while carrying the wrench.",
      "article": "",
      "location": "nowhere",
      "aliases": [
        "replacement fuse",
        "fuse"
      ],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_wrench",
      "name": "wrench",
      "description": "A retained repair tool. The technician needs it, but the repair does not consume it.",
      "article": "",
      "location": "lesson_square",
      "aliases": [
        "tool",
        "spanner",
        "wrench"
      ],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": false,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_supply_crate",
      "name": "supply crate",
      "description": "An electrically latched supply crate. USE FUSE WITH SUPPLY CRATE while carrying the wrench and while the technician is present.",
      "article": "",
      "location": "lesson_workshop",
      "aliases": [
        "crate",
        "device",
        "supply crate"
      ],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": true,
      "container": true,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": true,
      "lockKey": "",
      "events": [],
      "contents": {
        "version": 1,
        "kind": "container",
        "open": false,
        "locked": true
      }
    },
    {
      "id": "lesson_harbor_pass",
      "name": "harbor pass",
      "description": "A physical harbor pass inside the repaired crate. The gatekeeper checks that you really carry it and retains it during passage.",
      "article": "",
      "location": "nowhere",
      "aliases": [
        "pass",
        "permit",
        "harbor pass"
      ],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": false,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": [],
      "contents": {
        "version": 1,
        "placement": {
          "parentId": "lesson_supply_crate",
          "relation": "inside"
        }
      }
    },
    {
      "id": "lesson_sealed_dispatch",
      "name": "sealed dispatch",
      "description": "One sealed dispatch requested by the harbor master. Its pickup alone does not prove delivery or rescue.",
      "article": "",
      "location": "lesson_shelter",
      "aliases": [
        "dispatch",
        "parcel",
        "sealed dispatch"
      ],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_wooden_token",
      "name": "wooden token",
      "description": "A harmless wrong item for testing rejected handovers. It does not qualify as the dispatch.",
      "article": "",
      "location": "lesson_square",
      "aliases": [
        "wrong parcel",
        "token",
        "wooden token"
      ],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": [
        {
          "id": "wrong_handover",
          "event": "give",
          "withTarget": "lesson_harbor_master",
          "withTargetKind": "npc",
          "body": "print \"The harbor master refuses the wooden token. Only the sealed dispatch qualifies; you keep the token.\""
        }
      ]
    }
  ],
  "npcs": [
    {
      "id": "lesson_guide",
      "name": "guide",
      "description": "Give saved, progressive hints and respond to real task progress.",
      "location": "lesson_square",
      "mobile": false,
      "aliases": [
        "guide"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"I can offer a hint if you need one.\"",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [],
      "npcPackage": {
        "version": 1,
        "id": "lesson_guide",
        "roleId": "guide",
        "definition": {
          "version": 1,
          "id": "lesson_guide",
          "roleId": "guide",
          "name": "guide",
          "description": "Give saved, progressive hints and respond to real task progress.",
          "enabled": true,
          "inputs": [
            {
              "id": "home",
              "name": "Starting room",
              "kind": "room",
              "value": "lesson_square",
              "required": true
            },
            {
              "id": "completed",
              "name": "Boolean task-completed state (optional)",
              "kind": "state",
              "value": "",
              "required": false
            },
            {
              "id": "gentle",
              "name": "Gentle hint",
              "kind": "text",
              "value": "The merchant has the repair material, and the wrench stays with you.",
              "required": true
            },
            {
              "id": "strong",
              "name": "Stronger hint",
              "kind": "text",
              "value": "Buy the fuse, use it with the supply crate in the eastern workshop, then open the crate for the harbor pass.",
              "required": true
            },
            {
              "id": "solution",
              "name": "Solution hint",
              "kind": "text",
              "value": "Follow the BRIEFING route: repair the crate, accept the harbor master’s task, pass the gate, recruit the civilian, and make the accepted dispatch delivery.",
              "required": true
            }
          ],
          "messages": {
            "greeting": "I can offer a hint if you need one.",
            "success": "The interaction succeeds.",
            "failure": "The requirements are not met yet.",
            "repeat": "You have already completed this task."
          }
        },
        "owned": {
          "states": [],
          "rules": [],
          "scripts": [],
          "npcProfiles": [
            "lesson_nr_guide_profile"
          ],
          "npcFactions": [],
          "conversations": [
            "lesson_nr_guide_conversation"
          ],
          "routines": [],
          "recipes": [],
          "quests": [],
          "hints": [
            "lesson_nr_guide_hint"
          ],
          "scriptFunctions": [],
          "mechanics": []
        },
        "baseline": {
          "version": 1,
          "npc": {
            "id": "lesson_guide",
            "name": "guide",
            "description": "Give saved, progressive hints and respond to real task progress.",
            "location": "lesson_square",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"I can offer a hint if you need one.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          },
          "story": {
            "version": 1,
            "states": [],
            "rules": [],
            "features": {
              "version": 1,
              "npcProfiles": [
                {
                  "version": 1,
                  "id": "lesson_nr_guide_profile",
                  "name": "guide",
                  "npcId": "lesson_guide",
                  "enabled": true,
                  "memory": [],
                  "traits": {
                    "loyalty": 50,
                    "fear": 0,
                    "suspicion": 0
                  },
                  "life": {
                    "maxHealth": 100,
                    "initial": "active",
                    "essential": false,
                    "defeat": "dead",
                    "retreatAtHealth": 0
                  },
                  "inventory": {
                    "objects": [],
                    "equipped": [],
                    "equipment": [],
                    "money": 0,
                    "dropOnDeath": false
                  },
                  "combat": {
                    "assist": "off",
                    "target": "first_enemy",
                    "interceptPercent": 50,
                    "interval": 1
                  },
                  "perception": {
                    "enabled": false,
                    "sightRange": 0,
                    "hearingRange": 0,
                    "suspicionPerSight": 10,
                    "suspicionPerNoise": 10,
                    "threshold": 50,
                    "investigate": false,
                    "returnHome": false,
                    "allowedRoomIds": []
                  },
                  "abilities": []
                }
              ],
              "npcFactions": [],
              "conversations": [
                {
                  "id": "lesson_nr_guide_conversation",
                  "name": "guide conversation",
                  "enabled": true,
                  "npcId": "lesson_guide",
                  "startNodeId": "welcome",
                  "nodes": [
                    {
                      "id": "welcome",
                      "text": "I can offer a hint if you need one.",
                      "actions": [],
                      "choices": [
                        {
                          "id": "hint",
                          "label": "Please give me a hint",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "npc_control",
                              "target": "lesson_guide",
                              "operation": "hint",
                              "key": "lesson_nr_guide_hint"
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "leave",
                          "label": "Goodbye",
                          "conditions": [],
                          "match": "all",
                          "actions": [],
                          "once": false,
                          "unavailable": "hidden",
                          "next": "$end"
                        }
                      ]
                    }
                  ]
                }
              ],
              "routines": [],
              "recipes": [],
              "quests": [],
              "hints": [
                {
                  "id": "lesson_nr_guide_hint",
                  "name": "guide hints",
                  "enabled": true,
                  "scope": {
                    "kind": "room",
                    "target": "lesson_square"
                  },
                  "priority": 0,
                  "conditions": [],
                  "match": "all",
                  "completedConditions": [],
                  "completedMatch": "all",
                  "completedText": "You have already completed this task.",
                  "levels": [
                    {
                      "level": "gentle",
                      "text": "The merchant has the repair material, and the wrench stays with you.",
                      "conditions": [],
                      "match": "all"
                    },
                    {
                      "level": "strong",
                      "text": "Buy the fuse, use it with the supply crate in the eastern workshop, then open the crate for the harbor pass.",
                      "conditions": [],
                      "match": "all"
                    },
                    {
                      "level": "solution",
                      "text": "Follow the BRIEFING route: repair the crate, accept the harbor master’s task, pass the gate, recruit the civilian, and make the accepted dispatch delivery.",
                      "conditions": [],
                      "match": "all"
                    }
                  ]
                }
              ],
              "scriptFunctions": [],
              "mechanics": []
            }
          },
          "scripts": [],
          "dependencies": [
            {
              "kind": "room",
              "id": "lesson_square"
            }
          ],
          "notes": [
            "Choose the starting room and write the gentle, stronger and solution hints.",
            "Optionally select a Boolean Story state that proves the task is finished.",
            "TALK opens the guide; its hint choice and HINT advance the same saved native tiers. Each guide selects its own native hint even when guides share a room.",
            "Test: TALK guide",
            "Test: HINT"
          ],
          "roleId": "guide",
          "definition": {
            "version": 1,
            "id": "lesson_guide",
            "roleId": "guide",
            "name": "guide",
            "description": "Give saved, progressive hints and respond to real task progress.",
            "enabled": true,
            "inputs": [
              {
                "id": "home",
                "name": "Starting room",
                "kind": "room",
                "value": "lesson_square",
                "required": true
              },
              {
                "id": "completed",
                "name": "Boolean task-completed state (optional)",
                "kind": "state",
                "value": "",
                "required": false
              },
              {
                "id": "gentle",
                "name": "Gentle hint",
                "kind": "text",
                "value": "The merchant has the repair material, and the wrench stays with you.",
                "required": true
              },
              {
                "id": "strong",
                "name": "Stronger hint",
                "kind": "text",
                "value": "Buy the fuse, use it with the supply crate in the eastern workshop, then open the crate for the harbor pass.",
                "required": true
              },
              {
                "id": "solution",
                "name": "Solution hint",
                "kind": "text",
                "value": "Follow the BRIEFING route: repair the crate, accept the harbor master’s task, pass the gate, recruit the civilian, and make the accepted dispatch delivery.",
                "required": true
              }
            ],
            "messages": {
              "greeting": "I can offer a hint if you need one.",
              "success": "The interaction succeeds.",
              "failure": "The requirements are not met yet.",
              "repeat": "You have already completed this task."
            }
          }
        }
      }
    },
    {
      "id": "lesson_merchant",
      "name": "merchant",
      "description": "Trade finite physical stock with checked prices and actual item ownership.",
      "location": "lesson_square",
      "mobile": false,
      "aliases": [
        "merchant"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"Choose a purchase or offer the selected trade item.\"",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [],
      "npcPackage": {
        "version": 1,
        "id": "lesson_merchant",
        "roleId": "merchant",
        "definition": {
          "version": 1,
          "id": "lesson_merchant",
          "roleId": "merchant",
          "name": "merchant",
          "description": "Trade finite physical stock with checked prices and actual item ownership.",
          "enabled": true,
          "inputs": [
            {
              "id": "home",
              "name": "Starting room",
              "kind": "room",
              "value": "lesson_square",
              "required": true
            },
            {
              "id": "stockItem",
              "name": "Initially unplaced stock object",
              "kind": "object",
              "value": "lesson_fuse",
              "required": true
            },
            {
              "id": "price",
              "name": "Purchase price",
              "kind": "number",
              "value": 3,
              "required": true,
              "min": 0,
              "max": 1000000
            },
            {
              "id": "payout",
              "name": "Resale payout",
              "kind": "number",
              "value": 0,
              "required": true,
              "min": 0,
              "max": 1000000
            }
          ],
          "messages": {
            "greeting": "Choose a purchase or offer the selected trade item.",
            "success": "The trade is complete.",
            "failure": "The requirements are not met yet.",
            "repeat": "That stock is not available."
          }
        },
        "owned": {
          "states": [],
          "rules": [],
          "scripts": [],
          "npcProfiles": [
            "lesson_nr_merchant_profile"
          ],
          "npcFactions": [],
          "conversations": [
            "lesson_nr_merchant_conversation"
          ],
          "routines": [],
          "recipes": [],
          "quests": [],
          "hints": [],
          "scriptFunctions": [],
          "mechanics": []
        },
        "baseline": {
          "version": 1,
          "npc": {
            "id": "lesson_merchant",
            "name": "merchant",
            "description": "Trade finite physical stock with checked prices and actual item ownership.",
            "location": "lesson_square",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Choose a purchase or offer the selected trade item.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          },
          "story": {
            "version": 1,
            "states": [],
            "rules": [],
            "features": {
              "version": 1,
              "npcProfiles": [
                {
                  "version": 1,
                  "id": "lesson_nr_merchant_profile",
                  "name": "merchant",
                  "npcId": "lesson_merchant",
                  "enabled": true,
                  "memory": [],
                  "traits": {
                    "loyalty": 50,
                    "fear": 0,
                    "suspicion": 0
                  },
                  "life": {
                    "maxHealth": 100,
                    "initial": "active",
                    "essential": false,
                    "defeat": "dead",
                    "retreatAtHealth": 0
                  },
                  "inventory": {
                    "objects": [
                      "lesson_fuse"
                    ],
                    "equipped": [],
                    "equipment": [],
                    "money": 100,
                    "dropOnDeath": false
                  },
                  "combat": {
                    "assist": "off",
                    "target": "first_enemy",
                    "interceptPercent": 50,
                    "interval": 1
                  },
                  "perception": {
                    "enabled": false,
                    "sightRange": 0,
                    "hearingRange": 0,
                    "suspicionPerSight": 10,
                    "suspicionPerNoise": 10,
                    "threshold": 50,
                    "investigate": false,
                    "returnHome": false,
                    "allowedRoomIds": []
                  },
                  "abilities": []
                }
              ],
              "npcFactions": [],
              "conversations": [
                {
                  "id": "lesson_nr_merchant_conversation",
                  "name": "merchant conversation",
                  "enabled": true,
                  "npcId": "lesson_merchant",
                  "startNodeId": "welcome",
                  "nodes": [
                    {
                      "id": "welcome",
                      "text": "Choose a purchase or offer the selected trade item.",
                      "actions": [],
                      "choices": [
                        {
                          "id": "buy",
                          "label": "Buy the stock item (3)",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "npc_control",
                              "target": "lesson_merchant",
                              "operation": "buy",
                              "objectId": "lesson_fuse",
                              "value": 3
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "sell",
                          "label": "Sell the selected item (0)",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "npc_control",
                              "target": "lesson_merchant",
                              "operation": "sell",
                              "objectId": "lesson_fuse",
                              "value": 0
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "leave",
                          "label": "Goodbye",
                          "conditions": [],
                          "match": "all",
                          "actions": [],
                          "once": false,
                          "unavailable": "hidden",
                          "next": "$end"
                        }
                      ]
                    }
                  ]
                }
              ],
              "routines": [],
              "recipes": [],
              "quests": [],
              "hints": [],
              "scriptFunctions": [],
              "mechanics": []
            }
          },
          "scripts": [],
          "dependencies": [
            {
              "kind": "object",
              "id": "lesson_fuse"
            },
            {
              "kind": "room",
              "id": "lesson_square"
            }
          ],
          "notes": [
            "Choose one initially unplaced stock object and a purchase price.",
            "Configure a resale payout at or below the purchase price to avoid an accidental money loop.",
            "The shop owns one real stock object. A purchase requires stock, funds and inventory space before anything changes. Resale pays from the finite NPC wallet.",
            "Test: TALK merchant",
            "Test: Choose Buy or Sell"
          ],
          "roleId": "merchant",
          "definition": {
            "version": 1,
            "id": "lesson_merchant",
            "roleId": "merchant",
            "name": "merchant",
            "description": "Trade finite physical stock with checked prices and actual item ownership.",
            "enabled": true,
            "inputs": [
              {
                "id": "home",
                "name": "Starting room",
                "kind": "room",
                "value": "lesson_square",
                "required": true
              },
              {
                "id": "stockItem",
                "name": "Initially unplaced stock object",
                "kind": "object",
                "value": "lesson_fuse",
                "required": true
              },
              {
                "id": "price",
                "name": "Purchase price",
                "kind": "number",
                "value": 3,
                "required": true,
                "min": 0,
                "max": 1000000
              },
              {
                "id": "payout",
                "name": "Resale payout",
                "kind": "number",
                "value": 0,
                "required": true,
                "min": 0,
                "max": 1000000
              }
            ],
            "messages": {
              "greeting": "Choose a purchase or offer the selected trade item.",
              "success": "The trade is complete.",
              "failure": "The requirements are not met yet.",
              "repeat": "That stock is not available."
            }
          }
        }
      }
    },
    {
      "id": "lesson_medic",
      "name": "medic",
      "description": "Restore bounded player health after checking payment and a saved cooldown.",
      "location": "lesson_square",
      "mobile": false,
      "aliases": [
        "medic"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"I can treat your injuries.\"",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [],
      "npcPackage": {
        "version": 1,
        "id": "lesson_medic",
        "roleId": "healer",
        "definition": {
          "version": 1,
          "id": "lesson_medic",
          "roleId": "healer",
          "name": "medic",
          "description": "Restore bounded player health after checking payment and a saved cooldown.",
          "enabled": true,
          "inputs": [
            {
              "id": "home",
              "name": "Starting room",
              "kind": "room",
              "value": "lesson_square",
              "required": true
            },
            {
              "id": "healing",
              "name": "Health restored",
              "kind": "number",
              "value": 40,
              "required": true,
              "min": 1,
              "max": 100000
            },
            {
              "id": "cost",
              "name": "Treatment cost",
              "kind": "number",
              "value": 2,
              "required": true,
              "min": 0,
              "max": 1000000
            },
            {
              "id": "cooldown",
              "name": "Cooldown in turns",
              "kind": "number",
              "value": 3,
              "required": true,
              "min": 0,
              "max": 100000
            }
          ],
          "messages": {
            "greeting": "I can treat your injuries.",
            "success": "Your treatment is complete.",
            "failure": "The requirements are not met yet.",
            "repeat": "That has already been completed."
          }
        },
        "owned": {
          "states": [],
          "rules": [],
          "scripts": [],
          "npcProfiles": [
            "lesson_nr_medic_profile"
          ],
          "npcFactions": [],
          "conversations": [
            "lesson_nr_medic_conversation"
          ],
          "routines": [],
          "recipes": [],
          "quests": [],
          "hints": [],
          "scriptFunctions": [],
          "mechanics": []
        },
        "baseline": {
          "version": 1,
          "npc": {
            "id": "lesson_medic",
            "name": "medic",
            "description": "Restore bounded player health after checking payment and a saved cooldown.",
            "location": "lesson_square",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"I can treat your injuries.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          },
          "story": {
            "version": 1,
            "states": [],
            "rules": [],
            "features": {
              "version": 1,
              "npcProfiles": [
                {
                  "version": 1,
                  "id": "lesson_nr_medic_profile",
                  "name": "medic",
                  "npcId": "lesson_medic",
                  "enabled": true,
                  "memory": [],
                  "traits": {
                    "loyalty": 50,
                    "fear": 0,
                    "suspicion": 0
                  },
                  "life": {
                    "maxHealth": 100,
                    "initial": "active",
                    "essential": false,
                    "defeat": "dead",
                    "retreatAtHealth": 0
                  },
                  "inventory": {
                    "objects": [],
                    "equipped": [],
                    "equipment": [],
                    "money": 0,
                    "dropOnDeath": false
                  },
                  "combat": {
                    "assist": "off",
                    "target": "first_enemy",
                    "interceptPercent": 50,
                    "interval": 1
                  },
                  "perception": {
                    "enabled": false,
                    "sightRange": 0,
                    "hearingRange": 0,
                    "suspicionPerSight": 10,
                    "suspicionPerNoise": 10,
                    "threshold": 50,
                    "investigate": false,
                    "returnHome": false,
                    "allowedRoomIds": []
                  },
                  "abilities": [
                    {
                      "id": "treat",
                      "name": "Treatment",
                      "enabled": true,
                      "event": "manual",
                      "scope": "nearby",
                      "match": "all",
                      "conditions": [],
                      "actions": [
                        {
                          "kind": "npc_control",
                          "target": "lesson_medic",
                          "operation": "heal",
                          "value": 40,
                          "cost": 2
                        }
                      ],
                      "otherwise": [
                        {
                          "kind": "message",
                          "value": "The requirements are not met yet."
                        }
                      ],
                      "cooldown": 3,
                      "maxUses": 0
                    }
                  ]
                }
              ],
              "npcFactions": [],
              "conversations": [
                {
                  "id": "lesson_nr_medic_conversation",
                  "name": "medic conversation",
                  "enabled": true,
                  "npcId": "lesson_medic",
                  "startNodeId": "welcome",
                  "nodes": [
                    {
                      "id": "welcome",
                      "text": "I can treat your injuries.",
                      "actions": [],
                      "choices": [
                        {
                          "id": "treat",
                          "label": "Receive treatment (2)",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "npc_control",
                              "target": "lesson_medic",
                              "operation": "ability",
                              "abilityId": "treat"
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "leave",
                          "label": "Goodbye",
                          "conditions": [],
                          "match": "all",
                          "actions": [],
                          "once": false,
                          "unavailable": "hidden",
                          "next": "$end"
                        }
                      ]
                    }
                  ]
                }
              ],
              "routines": [],
              "recipes": [],
              "quests": [],
              "hints": [],
              "scriptFunctions": [],
              "mechanics": []
            }
          },
          "scripts": [],
          "dependencies": [
            {
              "kind": "room",
              "id": "lesson_square"
            }
          ],
          "notes": [
            "Enable player health and choose the starting room.",
            "Payment is not taken when the player is already healthy or cannot receive treatment.",
            "Healing and payment form one checked native service. Full health does not spend payment or a successful-use cooldown.",
            "Test: TALK medic",
            "Test: Choose Treatment"
          ],
          "roleId": "healer",
          "definition": {
            "version": 1,
            "id": "lesson_medic",
            "roleId": "healer",
            "name": "medic",
            "description": "Restore bounded player health after checking payment and a saved cooldown.",
            "enabled": true,
            "inputs": [
              {
                "id": "home",
                "name": "Starting room",
                "kind": "room",
                "value": "lesson_square",
                "required": true
              },
              {
                "id": "healing",
                "name": "Health restored",
                "kind": "number",
                "value": 40,
                "required": true,
                "min": 1,
                "max": 100000
              },
              {
                "id": "cost",
                "name": "Treatment cost",
                "kind": "number",
                "value": 2,
                "required": true,
                "min": 0,
                "max": 1000000
              },
              {
                "id": "cooldown",
                "name": "Cooldown in turns",
                "kind": "number",
                "value": 3,
                "required": true,
                "min": 0,
                "max": 100000
              }
            ],
            "messages": {
              "greeting": "I can treat your injuries.",
              "success": "Your treatment is complete.",
              "failure": "The requirements are not met yet.",
              "repeat": "That has already been completed."
            }
          }
        }
      }
    },
    {
      "id": "lesson_technician",
      "name": "technician",
      "description": "Repair a real target using a consumed material and retained tool.",
      "location": "lesson_workshop",
      "mobile": false,
      "aliases": [
        "technician"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"I can repair the selected device if you bring the right material and tool.\"",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [],
      "npcPackage": {
        "version": 1,
        "id": "lesson_technician",
        "roleId": "specialist",
        "definition": {
          "version": 1,
          "id": "lesson_technician",
          "roleId": "specialist",
          "name": "technician",
          "description": "Repair a real target using a consumed material and retained tool.",
          "enabled": true,
          "inputs": [
            {
              "id": "home",
              "name": "Starting room",
              "kind": "room",
              "value": "lesson_workshop",
              "required": true
            },
            {
              "id": "target",
              "name": "Locked container / device",
              "kind": "object",
              "value": "lesson_supply_crate",
              "required": true
            },
            {
              "id": "material",
              "name": "Consumed repair material",
              "kind": "object",
              "value": "lesson_fuse",
              "required": true
            },
            {
              "id": "tool",
              "name": "Retained repair tool",
              "kind": "object",
              "value": "lesson_wrench",
              "required": true
            }
          ],
          "messages": {
            "greeting": "I can repair the selected device if you bring the right material and tool.",
            "success": "The device is repaired.",
            "failure": "The requirements are not met yet.",
            "repeat": "That has already been completed."
          }
        },
        "owned": {
          "states": [
            "lesson_nr_technician_repaired"
          ],
          "rules": [],
          "scripts": [
            "lesson_nr_technician_repair"
          ],
          "npcProfiles": [
            "lesson_nr_technician_profile"
          ],
          "npcFactions": [],
          "conversations": [
            "lesson_nr_technician_conversation"
          ],
          "routines": [],
          "recipes": [
            "lesson_nr_technician_repair"
          ],
          "quests": [],
          "hints": [],
          "scriptFunctions": [
            "lesson_nr_technician_repair"
          ],
          "mechanics": []
        },
        "baseline": {
          "version": 1,
          "npc": {
            "id": "lesson_technician",
            "name": "technician",
            "description": "Repair a real target using a consumed material and retained tool.",
            "location": "lesson_workshop",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"I can repair the selected device if you bring the right material and tool.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          },
          "story": {
            "version": 1,
            "states": [
              {
                "id": "lesson_nr_technician_repaired",
                "name": "technician (technician) repaired",
                "description": "Owned by NPC role technician.",
                "type": "boolean",
                "initial": false
              }
            ],
            "rules": [],
            "features": {
              "version": 1,
              "npcProfiles": [
                {
                  "version": 1,
                  "id": "lesson_nr_technician_profile",
                  "name": "technician",
                  "npcId": "lesson_technician",
                  "enabled": true,
                  "memory": [
                    {
                      "id": "repaired",
                      "name": "Repair completed",
                      "type": "boolean",
                      "initial": false
                    }
                  ],
                  "traits": {
                    "loyalty": 50,
                    "fear": 0,
                    "suspicion": 0
                  },
                  "life": {
                    "maxHealth": 100,
                    "initial": "active",
                    "essential": false,
                    "defeat": "dead",
                    "retreatAtHealth": 0
                  },
                  "inventory": {
                    "objects": [],
                    "equipped": [],
                    "equipment": [],
                    "money": 0,
                    "dropOnDeath": false
                  },
                  "combat": {
                    "assist": "off",
                    "target": "first_enemy",
                    "interceptPercent": 50,
                    "interval": 1
                  },
                  "perception": {
                    "enabled": false,
                    "sightRange": 0,
                    "hearingRange": 0,
                    "suspicionPerSight": 10,
                    "suspicionPerNoise": 10,
                    "threshold": 50,
                    "investigate": false,
                    "returnHome": false,
                    "allowedRoomIds": []
                  },
                  "abilities": []
                }
              ],
              "npcFactions": [],
              "conversations": [
                {
                  "id": "lesson_nr_technician_conversation",
                  "name": "technician conversation",
                  "enabled": true,
                  "npcId": "lesson_technician",
                  "startNodeId": "welcome",
                  "nodes": [
                    {
                      "id": "welcome",
                      "text": "I can repair the selected device if you bring the right material and tool.",
                      "actions": [],
                      "choices": [
                        {
                          "id": "instructions",
                          "label": "What do you need for the repair?",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "message",
                              "value": "Use the repair material with the device while carrying the retained tool. The requirements are not met yet."
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "leave",
                          "label": "Goodbye",
                          "conditions": [],
                          "match": "all",
                          "actions": [],
                          "once": false,
                          "unavailable": "hidden",
                          "next": "$end"
                        }
                      ]
                    }
                  ]
                }
              ],
              "routines": [],
              "recipes": [
                {
                  "id": "lesson_nr_technician_repair",
                  "name": "technician repair",
                  "enabled": true,
                  "verbs": [
                    "use"
                  ],
                  "unordered": true,
                  "inputs": [
                    {
                      "objectId": "lesson_fuse",
                      "disposition": "consume"
                    }
                  ],
                  "tools": [
                    "lesson_wrench"
                  ],
                  "target": {
                    "kind": "object",
                    "id": "lesson_supply_crate"
                  },
                  "roomId": "lesson_workshop",
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "npc_available",
                      "target": "lesson_technician",
                      "value": true,
                      "operator": "=="
                    }
                  ],
                  "actions": [
                    {
                      "kind": "script",
                      "target": "lesson_nr_technician_repair"
                    },
                    {
                      "kind": "npc_control",
                      "target": "lesson_technician",
                      "operation": "remember",
                      "key": "repaired",
                      "value": true
                    }
                  ],
                  "once": true,
                  "success": "",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That has already been completed."
                }
              ],
              "quests": [],
              "hints": [],
              "scriptFunctions": [
                {
                  "version": 1,
                  "id": "lesson_nr_technician_repair",
                  "name": "Complete native repair",
                  "description": "Owned by NPC technician.",
                  "inputs": [],
                  "locals": [],
                  "resultType": "void",
                  "mode": "visual",
                  "steps": [
                    {
                      "id": "unlock",
                      "kind": "action",
                      "action": {
                        "kind": "object_state",
                        "target": "lesson_supply_crate",
                        "property": "locked",
                        "value": false
                      }
                    },
                    {
                      "id": "confirm",
                      "kind": "action",
                      "action": {
                        "kind": "state",
                        "target": "lesson_nr_technician_repaired",
                        "value": true
                      }
                    },
                    {
                      "id": "message",
                      "kind": "action",
                      "action": {
                        "kind": "message",
                        "value": "The device is repaired."
                      }
                    }
                  ]
                }
              ],
              "mechanics": []
            }
          },
          "scripts": [
            {
              "id": "lesson_nr_technician_repair",
              "name": "Complete native repair",
              "description": "Owned by technician.",
              "kind": "shared",
              "body": "# Native visual steps are stored in the callable definition."
            }
          ],
          "dependencies": [
            {
              "kind": "object",
              "id": "lesson_fuse"
            },
            {
              "kind": "object",
              "id": "lesson_supply_crate"
            },
            {
              "kind": "object",
              "id": "lesson_wrench"
            },
            {
              "kind": "room",
              "id": "lesson_workshop"
            }
          ],
          "notes": [
            "Choose a locked container/device in the starting room, consumed material and retained tool.",
            "A native Recipe checks all inputs and the specialist before consuming anything.",
            "The native Recipe consumes only the chosen material, retains the tool and actually unlocks the selected device.",
            "Test: USE <material> WITH <target>",
            "Test: TALK technician"
          ],
          "roleId": "specialist",
          "definition": {
            "version": 1,
            "id": "lesson_technician",
            "roleId": "specialist",
            "name": "technician",
            "description": "Repair a real target using a consumed material and retained tool.",
            "enabled": true,
            "inputs": [
              {
                "id": "home",
                "name": "Starting room",
                "kind": "room",
                "value": "lesson_workshop",
                "required": true
              },
              {
                "id": "target",
                "name": "Locked container / device",
                "kind": "object",
                "value": "lesson_supply_crate",
                "required": true
              },
              {
                "id": "material",
                "name": "Consumed repair material",
                "kind": "object",
                "value": "lesson_fuse",
                "required": true
              },
              {
                "id": "tool",
                "name": "Retained repair tool",
                "kind": "object",
                "value": "lesson_wrench",
                "required": true
              }
            ],
            "messages": {
              "greeting": "I can repair the selected device if you bring the right material and tool.",
              "success": "The device is repaired.",
              "failure": "The requirements are not met yet.",
              "repeat": "That has already been completed."
            }
          }
        }
      }
    },
    {
      "id": "lesson_gatekeeper",
      "name": "gatekeeper",
      "description": "Grant a chosen route through a real key check or earned trust.",
      "location": "lesson_gate",
      "mobile": false,
      "aliases": [
        "gatekeeper"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"Show your pass or earn my trust before passing.\"",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [],
      "npcPackage": {
        "version": 1,
        "id": "lesson_gatekeeper",
        "roleId": "gatekeeper",
        "definition": {
          "version": 1,
          "id": "lesson_gatekeeper",
          "roleId": "gatekeeper",
          "name": "gatekeeper",
          "description": "Grant a chosen route through a real key check or earned trust.",
          "enabled": true,
          "inputs": [
            {
              "id": "home",
              "name": "Starting room",
              "kind": "room",
              "value": "lesson_gate",
              "required": true
            },
            {
              "id": "key",
              "name": "Retained pass / key",
              "kind": "object",
              "value": "lesson_harbor_pass",
              "required": true
            },
            {
              "id": "destination",
              "name": "Passage destination",
              "kind": "room",
              "value": "lesson_shelter",
              "required": true
            },
            {
              "id": "trust",
              "name": "Alternative required trust",
              "kind": "number",
              "value": 100,
              "required": true,
              "min": 0,
              "max": 100
            }
          ],
          "messages": {
            "greeting": "Show your pass or earn my trust before passing.",
            "success": "You may pass.",
            "failure": "The requirements are not met yet.",
            "repeat": "That has already been completed."
          }
        },
        "owned": {
          "states": [],
          "rules": [],
          "scripts": [],
          "npcProfiles": [
            "lesson_nr_gatekeeper_profile"
          ],
          "npcFactions": [],
          "conversations": [
            "lesson_nr_gatekeeper_conversation"
          ],
          "routines": [],
          "recipes": [],
          "quests": [],
          "hints": [],
          "scriptFunctions": [],
          "mechanics": []
        },
        "baseline": {
          "version": 1,
          "npc": {
            "id": "lesson_gatekeeper",
            "name": "gatekeeper",
            "description": "Grant a chosen route through a real key check or earned trust.",
            "location": "lesson_gate",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Show your pass or earn my trust before passing.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          },
          "story": {
            "version": 1,
            "states": [],
            "rules": [],
            "features": {
              "version": 1,
              "npcProfiles": [
                {
                  "version": 1,
                  "id": "lesson_nr_gatekeeper_profile",
                  "name": "gatekeeper",
                  "npcId": "lesson_gatekeeper",
                  "enabled": true,
                  "memory": [],
                  "traits": {
                    "loyalty": 50,
                    "fear": 0,
                    "suspicion": 0
                  },
                  "life": {
                    "maxHealth": 100,
                    "initial": "active",
                    "essential": false,
                    "defeat": "dead",
                    "retreatAtHealth": 0
                  },
                  "inventory": {
                    "objects": [],
                    "equipped": [],
                    "equipment": [],
                    "money": 0,
                    "dropOnDeath": false
                  },
                  "combat": {
                    "assist": "off",
                    "target": "first_enemy",
                    "interceptPercent": 50,
                    "interval": 1
                  },
                  "perception": {
                    "enabled": false,
                    "sightRange": 0,
                    "hearingRange": 0,
                    "suspicionPerSight": 10,
                    "suspicionPerNoise": 10,
                    "threshold": 50,
                    "investigate": false,
                    "returnHome": false,
                    "allowedRoomIds": []
                  },
                  "abilities": [
                    {
                      "id": "passage",
                      "name": "Grant passage",
                      "enabled": true,
                      "event": "manual",
                      "scope": "nearby",
                      "match": "any",
                      "conditions": [
                        {
                          "kind": "inventory",
                          "target": "lesson_harbor_pass",
                          "value": true,
                          "operator": "=="
                        },
                        {
                          "kind": "npc_trust",
                          "target": "lesson_gatekeeper",
                          "value": 100,
                          "operator": ">="
                        }
                      ],
                      "actions": [
                        {
                          "kind": "message",
                          "value": "You may pass."
                        },
                        {
                          "kind": "goto",
                          "target": "lesson_shelter"
                        }
                      ],
                      "otherwise": [
                        {
                          "kind": "message",
                          "value": "The requirements are not met yet."
                        }
                      ],
                      "cooldown": 0,
                      "maxUses": 0
                    }
                  ]
                }
              ],
              "npcFactions": [],
              "conversations": [
                {
                  "id": "lesson_nr_gatekeeper_conversation",
                  "name": "gatekeeper conversation",
                  "enabled": true,
                  "npcId": "lesson_gatekeeper",
                  "startNodeId": "welcome",
                  "nodes": [
                    {
                      "id": "welcome",
                      "text": "Show your pass or earn my trust before passing.",
                      "actions": [],
                      "choices": [
                        {
                          "id": "pass",
                          "label": "Request passage",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "npc_control",
                              "target": "lesson_gatekeeper",
                              "operation": "ability",
                              "abilityId": "passage"
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "leave",
                          "label": "Goodbye",
                          "conditions": [],
                          "match": "all",
                          "actions": [],
                          "once": false,
                          "unavailable": "hidden",
                          "next": "$end"
                        }
                      ]
                    }
                  ]
                }
              ],
              "routines": [],
              "recipes": [],
              "quests": [],
              "hints": [],
              "scriptFunctions": [],
              "mechanics": []
            }
          },
          "scripts": [],
          "dependencies": [
            {
              "kind": "object",
              "id": "lesson_harbor_pass"
            },
            {
              "kind": "room",
              "id": "lesson_gate"
            },
            {
              "kind": "room",
              "id": "lesson_shelter"
            }
          ],
          "notes": [
            "Choose the starting room, retained pass/key and destination room or playable cell.",
            "The player must meet one of the configured requirements before travel.",
            "The pass/key is retained. Either possession of the selected key or sufficient actual trust permits the destination route.",
            "Test: TALK gatekeeper",
            "Test: Choose passage"
          ],
          "roleId": "gatekeeper",
          "definition": {
            "version": 1,
            "id": "lesson_gatekeeper",
            "roleId": "gatekeeper",
            "name": "gatekeeper",
            "description": "Grant a chosen route through a real key check or earned trust.",
            "enabled": true,
            "inputs": [
              {
                "id": "home",
                "name": "Starting room",
                "kind": "room",
                "value": "lesson_gate",
                "required": true
              },
              {
                "id": "key",
                "name": "Retained pass / key",
                "kind": "object",
                "value": "lesson_harbor_pass",
                "required": true
              },
              {
                "id": "destination",
                "name": "Passage destination",
                "kind": "room",
                "value": "lesson_shelter",
                "required": true
              },
              {
                "id": "trust",
                "name": "Alternative required trust",
                "kind": "number",
                "value": 100,
                "required": true,
                "min": 0,
                "max": 100
              }
            ],
            "messages": {
              "greeting": "Show your pass or earn my trust before passing.",
              "success": "You may pass.",
              "failure": "The requirements are not met yet.",
              "repeat": "That has already been completed."
            }
          }
        }
      }
    },
    {
      "id": "lesson_civilian",
      "name": "civilian",
      "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.",
      "location": "lesson_shelter",
      "mobile": true,
      "aliases": [
        "civilian"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"Please help me reach safety.\"",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 60,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [],
      "npcPackage": {
        "version": 1,
        "id": "lesson_civilian",
        "roleId": "rescue",
        "definition": {
          "version": 1,
          "id": "lesson_civilian",
          "roleId": "rescue",
          "name": "civilian",
          "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.",
          "enabled": true,
          "inputs": [
            {
              "id": "home",
              "name": "Starting room",
              "kind": "room",
              "value": "lesson_shelter",
              "required": true
            },
            {
              "id": "destination",
              "name": "Extraction room",
              "kind": "room",
              "value": "lesson_pier",
              "required": true
            },
            {
              "id": "health",
              "name": "Starting health",
              "kind": "number",
              "value": 60,
              "required": true,
              "min": 1,
              "max": 100000
            },
            {
              "id": "score",
              "name": "Rescue score",
              "kind": "number",
              "value": 0,
              "required": true,
              "min": 0,
              "max": 1000000
            },
            {
              "id": "money",
              "name": "Rescue currency",
              "kind": "number",
              "value": 0,
              "required": true,
              "min": 0,
              "max": 1000000
            }
          ],
          "messages": {
            "greeting": "Please help me reach safety.",
            "success": "The rescue is complete. We reached safety.",
            "failure": "The requirements are not met yet.",
            "repeat": "That has already been completed."
          }
        },
        "owned": {
          "states": [
            "lesson_nr_civilian_rescued"
          ],
          "rules": [],
          "scripts": [],
          "npcProfiles": [
            "lesson_nr_civilian_profile"
          ],
          "npcFactions": [],
          "conversations": [
            "lesson_nr_civilian_conversation"
          ],
          "routines": [],
          "recipes": [],
          "quests": [
            "lesson_nr_civilian_quest"
          ],
          "hints": [],
          "scriptFunctions": [],
          "mechanics": []
        },
        "baseline": {
          "version": 1,
          "npc": {
            "id": "lesson_civilian",
            "name": "civilian",
            "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.",
            "location": "lesson_shelter",
            "mobile": true,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Please help me reach safety.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 60,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          },
          "story": {
            "version": 1,
            "states": [
              {
                "id": "lesson_nr_civilian_rescued",
                "name": "civilian (civilian) rescued",
                "description": "Owned by NPC role civilian.",
                "type": "boolean",
                "initial": false
              }
            ],
            "rules": [],
            "features": {
              "version": 1,
              "npcProfiles": [
                {
                  "version": 1,
                  "id": "lesson_nr_civilian_profile",
                  "name": "civilian",
                  "npcId": "lesson_civilian",
                  "enabled": true,
                  "memory": [
                    {
                      "id": "rescued",
                      "name": "Reached extraction",
                      "type": "boolean",
                      "initial": false
                    }
                  ],
                  "traits": {
                    "loyalty": 50,
                    "fear": 0,
                    "suspicion": 0
                  },
                  "life": {
                    "maxHealth": 60,
                    "initial": "active",
                    "essential": false,
                    "defeat": "downed",
                    "retreatAtHealth": 0,
                    "rescueRoomId": "lesson_pier"
                  },
                  "inventory": {
                    "objects": [],
                    "equipped": [],
                    "equipment": [],
                    "money": 0,
                    "dropOnDeath": false
                  },
                  "combat": {
                    "assist": "off",
                    "target": "first_enemy",
                    "interceptPercent": 50,
                    "interval": 1
                  },
                  "perception": {
                    "enabled": false,
                    "sightRange": 0,
                    "hearingRange": 0,
                    "suspicionPerSight": 10,
                    "suspicionPerNoise": 10,
                    "threshold": 50,
                    "investigate": false,
                    "returnHome": false,
                    "allowedRoomIds": []
                  },
                  "abilities": [
                    {
                      "id": "arrival",
                      "name": "Record a living rescue",
                      "enabled": true,
                      "event": "rescue",
                      "scope": "anywhere",
                      "match": "all",
                      "conditions": [],
                      "actions": [
                        {
                          "kind": "state",
                          "target": "lesson_nr_civilian_rescued",
                          "value": true
                        },
                        {
                          "kind": "npc_control",
                          "target": "lesson_civilian",
                          "operation": "remember",
                          "key": "rescued",
                          "value": true
                        },
                        {
                          "kind": "message",
                          "value": "The rescue is complete. We reached safety."
                        }
                      ],
                      "otherwise": [
                        {
                          "kind": "message",
                          "value": "The requirements are not met yet."
                        }
                      ],
                      "cooldown": 0,
                      "maxUses": 1
                    }
                  ]
                }
              ],
              "npcFactions": [],
              "conversations": [
                {
                  "id": "lesson_nr_civilian_conversation",
                  "name": "civilian conversation",
                  "enabled": true,
                  "npcId": "lesson_civilian",
                  "startNodeId": "welcome",
                  "nodes": [
                    {
                      "id": "welcome",
                      "text": "Please help me reach safety.",
                      "actions": [],
                      "choices": [
                        {
                          "id": "follow",
                          "label": "Follow me to safety",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "npc_control",
                              "target": "lesson_civilian",
                              "operation": "recruit"
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "wait",
                          "label": "Wait here safely",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "npc_control",
                              "target": "lesson_civilian",
                              "operation": "wait"
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "leave",
                          "label": "Goodbye",
                          "conditions": [],
                          "match": "all",
                          "actions": [],
                          "once": false,
                          "unavailable": "hidden",
                          "next": "$end"
                        }
                      ]
                    }
                  ]
                }
              ],
              "routines": [],
              "recipes": [],
              "quests": [
                {
                  "id": "lesson_nr_civilian_quest",
                  "name": "Rescue civilian",
                  "enabled": true,
                  "description": "Bring civilian safely to extraction.",
                  "stages": [
                    {
                      "id": "arrived",
                      "name": "Arrive alive at extraction",
                      "description": "Arrive alive at extraction",
                      "prerequisites": [],
                      "optional": false,
                      "automatic": true,
                      "conditions": [
                        {
                          "kind": "state",
                          "target": "lesson_nr_civilian_rescued",
                          "value": true,
                          "operator": "=="
                        }
                      ],
                      "match": "all",
                      "completionText": "Arrive alive at extraction",
                      "actions": []
                    }
                  ],
                  "completionText": "The rescue is complete. We reached safety.",
                  "completionActions": [
                    {
                      "kind": "score",
                      "value": 0
                    },
                    {
                      "kind": "money",
                      "value": 0
                    }
                  ]
                }
              ],
              "hints": [],
              "scriptFunctions": [],
              "mechanics": []
            }
          },
          "scripts": [],
          "dependencies": [
            {
              "kind": "room",
              "id": "lesson_pier"
            },
            {
              "kind": "room",
              "id": "lesson_shelter"
            }
          ],
          "notes": [
            "Choose the initial room and actual extraction destination.",
            "The rescue reward requires the living NPC to arrive; remote following flags do not prove a rescue.",
            "The capability runtime records a rescue only on the living NPC’s actual arrival at extraction.",
            "Test: TALK civilian",
            "Test: Choose Follow or Wait",
            "Test: Travel to extraction"
          ],
          "roleId": "rescue",
          "definition": {
            "version": 1,
            "id": "lesson_civilian",
            "roleId": "rescue",
            "name": "civilian",
            "description": "Recruit an escort, wait safely and prove a living arrival at the chosen extraction room.",
            "enabled": true,
            "inputs": [
              {
                "id": "home",
                "name": "Starting room",
                "kind": "room",
                "value": "lesson_shelter",
                "required": true
              },
              {
                "id": "destination",
                "name": "Extraction room",
                "kind": "room",
                "value": "lesson_pier",
                "required": true
              },
              {
                "id": "health",
                "name": "Starting health",
                "kind": "number",
                "value": 60,
                "required": true,
                "min": 1,
                "max": 100000
              },
              {
                "id": "score",
                "name": "Rescue score",
                "kind": "number",
                "value": 0,
                "required": true,
                "min": 0,
                "max": 1000000
              },
              {
                "id": "money",
                "name": "Rescue currency",
                "kind": "number",
                "value": 0,
                "required": true,
                "min": 0,
                "max": 1000000
              }
            ],
            "messages": {
              "greeting": "Please help me reach safety.",
              "success": "The rescue is complete. We reached safety.",
              "failure": "The requirements are not met yet.",
              "repeat": "That has already been completed."
            }
          }
        }
      }
    },
    {
      "id": "lesson_harbor_master",
      "name": "harbor master",
      "description": "Offer a delivery task, accept its actual item and award a native Quest reward once.",
      "location": "lesson_pier",
      "mobile": false,
      "aliases": [
        "harbor master"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"Please bring me the requested item.\"",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [],
      "npcPackage": {
        "version": 1,
        "id": "lesson_harbor_master",
        "roleId": "quest_giver",
        "definition": {
          "version": 1,
          "id": "lesson_harbor_master",
          "roleId": "quest_giver",
          "name": "harbor master",
          "description": "Offer a delivery task, accept its actual item and award a native Quest reward once.",
          "enabled": true,
          "inputs": [
            {
              "id": "home",
              "name": "Starting room",
              "kind": "room",
              "value": "lesson_pier",
              "required": true
            },
            {
              "id": "item",
              "name": "Delivery item",
              "kind": "object",
              "value": "lesson_sealed_dispatch",
              "required": true
            },
            {
              "id": "questName",
              "name": "Quest title",
              "kind": "text",
              "value": "Harbor service and safe arrival",
              "required": true
            },
            {
              "id": "score",
              "name": "Completion score",
              "kind": "number",
              "value": 100,
              "required": true,
              "min": 0,
              "max": 1000000
            },
            {
              "id": "money",
              "name": "Completion currency",
              "kind": "number",
              "value": 5,
              "required": true,
              "min": 0,
              "max": 1000000
            }
          ],
          "messages": {
            "greeting": "Please bring me the requested item.",
            "success": "The delivery is accepted. Thank you.",
            "failure": "The requirements are not met yet.",
            "repeat": "That has already been completed."
          }
        },
        "owned": {
          "states": [
            "lesson_nr_harbor_master_accepted",
            "lesson_nr_harbor_master_delivered"
          ],
          "rules": [],
          "scripts": [],
          "npcProfiles": [
            "lesson_nr_harbor_master_profile"
          ],
          "npcFactions": [],
          "conversations": [
            "lesson_nr_harbor_master_conversation"
          ],
          "routines": [],
          "recipes": [
            "lesson_nr_harbor_master_handover"
          ],
          "quests": [
            "lesson_nr_harbor_master_quest"
          ],
          "hints": [],
          "scriptFunctions": [],
          "mechanics": []
        },
        "baseline": {
          "version": 1,
          "npc": {
            "id": "lesson_harbor_master",
            "name": "harbor master",
            "description": "Offer a delivery task, accept its actual item and award a native Quest reward once.",
            "location": "lesson_pier",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Please bring me the requested item.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          },
          "story": {
            "version": 1,
            "states": [
              {
                "id": "lesson_nr_harbor_master_accepted",
                "name": "harbor master (harbor_master) accepted",
                "description": "Owned by NPC role harbor_master.",
                "type": "boolean",
                "initial": false
              },
              {
                "id": "lesson_nr_harbor_master_delivered",
                "name": "harbor master (harbor_master) delivered",
                "description": "Owned by NPC role harbor_master.",
                "type": "boolean",
                "initial": false
              }
            ],
            "rules": [],
            "features": {
              "version": 1,
              "npcProfiles": [
                {
                  "version": 1,
                  "id": "lesson_nr_harbor_master_profile",
                  "name": "harbor master",
                  "npcId": "lesson_harbor_master",
                  "enabled": true,
                  "memory": [
                    {
                      "id": "offered",
                      "name": "Task offered",
                      "type": "boolean",
                      "initial": false
                    },
                    {
                      "id": "delivered",
                      "name": "Delivery accepted",
                      "type": "boolean",
                      "initial": false
                    }
                  ],
                  "traits": {
                    "loyalty": 50,
                    "fear": 0,
                    "suspicion": 0
                  },
                  "life": {
                    "maxHealth": 100,
                    "initial": "active",
                    "essential": false,
                    "defeat": "dead",
                    "retreatAtHealth": 0
                  },
                  "inventory": {
                    "objects": [],
                    "equipped": [],
                    "equipment": [],
                    "money": 0,
                    "dropOnDeath": false
                  },
                  "combat": {
                    "assist": "off",
                    "target": "first_enemy",
                    "interceptPercent": 50,
                    "interval": 1
                  },
                  "perception": {
                    "enabled": false,
                    "sightRange": 0,
                    "hearingRange": 0,
                    "suspicionPerSight": 10,
                    "suspicionPerNoise": 10,
                    "threshold": 50,
                    "investigate": false,
                    "returnHome": false,
                    "allowedRoomIds": []
                  },
                  "abilities": [
                    {
                      "id": "offer",
                      "name": "Offer the delivery",
                      "enabled": true,
                      "event": "manual",
                      "scope": "nearby",
                      "match": "all",
                      "conditions": [],
                      "actions": [
                        {
                          "kind": "state",
                          "target": "lesson_nr_harbor_master_accepted",
                          "value": true
                        },
                        {
                          "kind": "npc_control",
                          "target": "lesson_harbor_master",
                          "operation": "remember",
                          "key": "offered",
                          "value": true
                        },
                        {
                          "kind": "message",
                          "value": "Please bring me the requested item."
                        }
                      ],
                      "otherwise": [
                        {
                          "kind": "message",
                          "value": "The requirements are not met yet."
                        }
                      ],
                      "cooldown": 0,
                      "maxUses": 0
                    }
                  ]
                }
              ],
              "npcFactions": [],
              "conversations": [
                {
                  "id": "lesson_nr_harbor_master_conversation",
                  "name": "harbor master conversation",
                  "enabled": true,
                  "npcId": "lesson_harbor_master",
                  "startNodeId": "welcome",
                  "nodes": [
                    {
                      "id": "welcome",
                      "text": "Please bring me the requested item.",
                      "actions": [],
                      "choices": [
                        {
                          "id": "offer",
                          "label": "Tell me about the task",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "npc_control",
                              "target": "lesson_harbor_master",
                              "operation": "ability",
                              "abilityId": "offer"
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "leave",
                          "label": "Goodbye",
                          "conditions": [],
                          "match": "all",
                          "actions": [],
                          "once": false,
                          "unavailable": "hidden",
                          "next": "$end"
                        }
                      ]
                    }
                  ]
                }
              ],
              "routines": [],
              "recipes": [
                {
                  "id": "lesson_nr_harbor_master_handover",
                  "name": "harbor master accepted delivery",
                  "enabled": true,
                  "verbs": [
                    "give"
                  ],
                  "unordered": true,
                  "inputs": [
                    {
                      "objectId": "lesson_sealed_dispatch",
                      "disposition": "transfer"
                    }
                  ],
                  "tools": [],
                  "target": {
                    "kind": "npc",
                    "id": "lesson_harbor_master"
                  },
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "state",
                      "target": "lesson_nr_harbor_master_accepted",
                      "value": true,
                      "operator": "=="
                    }
                  ],
                  "actions": [
                    {
                      "kind": "state",
                      "target": "lesson_nr_harbor_master_delivered",
                      "value": true
                    },
                    {
                      "kind": "npc_control",
                      "target": "lesson_harbor_master",
                      "operation": "remember",
                      "key": "delivered",
                      "value": true
                    }
                  ],
                  "once": true,
                  "success": "The delivery is accepted. Thank you.",
                  "failure": "The requirements are not met yet.",
                  "repeat": "That has already been completed."
                }
              ],
              "quests": [
                {
                  "id": "lesson_nr_harbor_master_quest",
                  "name": "Harbor service and safe arrival",
                  "enabled": true,
                  "description": "Please bring me the requested item.",
                  "stages": [
                    {
                      "id": "accepted",
                      "name": "Accept the delivery task",
                      "description": "Accept the delivery task",
                      "prerequisites": [],
                      "optional": false,
                      "automatic": true,
                      "conditions": [
                        {
                          "kind": "state",
                          "target": "lesson_nr_harbor_master_accepted",
                          "value": true,
                          "operator": "=="
                        }
                      ],
                      "match": "all",
                      "completionText": "Accept the delivery task",
                      "actions": []
                    },
                    {
                      "id": "delivered",
                      "name": "Deliver the real item",
                      "description": "Deliver the real item",
                      "prerequisites": [
                        "accepted"
                      ],
                      "optional": false,
                      "automatic": true,
                      "conditions": [
                        {
                          "kind": "state",
                          "target": "lesson_nr_harbor_master_delivered",
                          "value": true,
                          "operator": "=="
                        }
                      ],
                      "match": "all",
                      "completionText": "Deliver the real item",
                      "actions": []
                    }
                  ],
                  "completionText": "The delivery is accepted. Thank you.",
                  "completionActions": [
                    {
                      "kind": "score",
                      "value": 100
                    },
                    {
                      "kind": "money",
                      "value": 5
                    }
                  ]
                }
              ],
              "hints": [],
              "scriptFunctions": [],
              "mechanics": []
            }
          },
          "scripts": [],
          "dependencies": [
            {
              "kind": "object",
              "id": "lesson_sealed_dispatch"
            },
            {
              "kind": "room",
              "id": "lesson_pier"
            }
          ],
          "notes": [
            "Choose the one physical item to deliver and the NPC starting room.",
            "The handover must be accepted; talking or repeating a callback cannot manufacture the reward.",
            "Give the actual sealed_dispatch to harbor master after accepting. The native Quest awards 100 score and 5 currency once.",
            "Test: TALK harbor master",
            "Test: GIVE <item> TO harbor master",
            "Test: OBJECTIVES"
          ],
          "roleId": "quest_giver",
          "definition": {
            "version": 1,
            "id": "lesson_harbor_master",
            "roleId": "quest_giver",
            "name": "harbor master",
            "description": "Offer a delivery task, accept its actual item and award a native Quest reward once.",
            "enabled": true,
            "inputs": [
              {
                "id": "home",
                "name": "Starting room",
                "kind": "room",
                "value": "lesson_pier",
                "required": true
              },
              {
                "id": "item",
                "name": "Delivery item",
                "kind": "object",
                "value": "lesson_sealed_dispatch",
                "required": true
              },
              {
                "id": "questName",
                "name": "Quest title",
                "kind": "text",
                "value": "Harbor service and safe arrival",
                "required": true
              },
              {
                "id": "score",
                "name": "Completion score",
                "kind": "number",
                "value": 100,
                "required": true,
                "min": 0,
                "max": 1000000
              },
              {
                "id": "money",
                "name": "Completion currency",
                "kind": "number",
                "value": 5,
                "required": true,
                "min": 0,
                "max": 1000000
              }
            ],
            "messages": {
              "greeting": "Please bring me the requested item.",
              "success": "The delivery is accepted. Thank you.",
              "failure": "The requirements are not met yet.",
              "repeat": "That has already been completed."
            }
          }
        }
      }
    },
    {
      "id": "lesson_sentinel",
      "name": "sentinel",
      "description": "Walk a native connected route, pause for interactions and investigate nearby alerts.",
      "location": "lesson_gate",
      "mobile": true,
      "aliases": [
        "sentinel"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"I am watching this area.\"",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [],
      "npcPackage": {
        "version": 1,
        "id": "lesson_sentinel",
        "roleId": "patrol_guard",
        "definition": {
          "version": 1,
          "id": "lesson_sentinel",
          "roleId": "patrol_guard",
          "name": "sentinel",
          "description": "Walk a native connected route, pause for interactions and investigate nearby alerts.",
          "enabled": true,
          "inputs": [
            {
              "id": "home",
              "name": "Starting room",
              "kind": "room",
              "value": "lesson_gate",
              "required": true
            },
            {
              "id": "route",
              "name": "Patrol rooms, in order",
              "kind": "room_list",
              "value": "lesson_gate,lesson_square",
              "required": true
            },
            {
              "id": "turnsPerStop",
              "name": "Turns at each stop",
              "kind": "number",
              "value": 2,
              "required": true,
              "min": 1,
              "max": 1000
            },
            {
              "id": "sight",
              "name": "Sight range in connected rooms",
              "kind": "number",
              "value": 0,
              "required": true,
              "min": 0,
              "max": 8
            }
          ],
          "messages": {
            "greeting": "I am watching this area.",
            "success": "The interaction succeeds.",
            "failure": "The requirements are not met yet.",
            "repeat": "That has already been completed."
          }
        },
        "owned": {
          "states": [],
          "rules": [],
          "scripts": [],
          "npcProfiles": [
            "lesson_nr_sentinel_profile"
          ],
          "npcFactions": [],
          "conversations": [
            "lesson_nr_sentinel_conversation"
          ],
          "routines": [
            "lesson_nr_sentinel_patrol"
          ],
          "recipes": [],
          "quests": [],
          "hints": [],
          "scriptFunctions": [],
          "mechanics": []
        },
        "baseline": {
          "version": 1,
          "npc": {
            "id": "lesson_sentinel",
            "name": "sentinel",
            "description": "Walk a native connected route, pause for interactions and investigate nearby alerts.",
            "location": "lesson_gate",
            "mobile": true,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"I am watching this area.\"",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          },
          "story": {
            "version": 1,
            "states": [],
            "rules": [],
            "features": {
              "version": 1,
              "npcProfiles": [
                {
                  "version": 1,
                  "id": "lesson_nr_sentinel_profile",
                  "name": "sentinel",
                  "npcId": "lesson_sentinel",
                  "enabled": true,
                  "memory": [],
                  "traits": {
                    "loyalty": 50,
                    "fear": 0,
                    "suspicion": 0
                  },
                  "life": {
                    "maxHealth": 100,
                    "initial": "active",
                    "essential": false,
                    "defeat": "dead",
                    "retreatAtHealth": 0
                  },
                  "inventory": {
                    "objects": [],
                    "equipped": [],
                    "equipment": [],
                    "money": 0,
                    "dropOnDeath": false
                  },
                  "combat": {
                    "assist": "off",
                    "target": "first_enemy",
                    "interceptPercent": 50,
                    "interval": 1
                  },
                  "perception": {
                    "enabled": true,
                    "sightRange": 0,
                    "hearingRange": 0,
                    "suspicionPerSight": 10,
                    "suspicionPerNoise": 10,
                    "threshold": 50,
                    "investigate": true,
                    "returnHome": true,
                    "allowedRoomIds": [
                      "lesson_gate",
                      "lesson_square"
                    ],
                    "homeRoomId": "lesson_gate"
                  },
                  "abilities": []
                }
              ],
              "npcFactions": [],
              "conversations": [
                {
                  "id": "lesson_nr_sentinel_conversation",
                  "name": "sentinel conversation",
                  "enabled": true,
                  "npcId": "lesson_sentinel",
                  "startNodeId": "welcome",
                  "nodes": [
                    {
                      "id": "welcome",
                      "text": "I am watching this area.",
                      "actions": [],
                      "choices": [
                        {
                          "id": "status",
                          "label": "Ask about the patrol",
                          "conditions": [],
                          "match": "all",
                          "actions": [
                            {
                              "kind": "message",
                              "value": "I walk the connected route and investigate alerts in this area."
                            }
                          ],
                          "once": false,
                          "unavailable": "disabled",
                          "next": "$end"
                        },
                        {
                          "id": "leave",
                          "label": "Goodbye",
                          "conditions": [],
                          "match": "all",
                          "actions": [],
                          "once": false,
                          "unavailable": "hidden",
                          "next": "$end"
                        }
                      ]
                    }
                  ]
                }
              ],
              "routines": [
                {
                  "id": "lesson_nr_sentinel_patrol",
                  "name": "sentinel connected patrol",
                  "enabled": true,
                  "npcId": "lesson_sentinel",
                  "activities": [
                    {
                      "id": "stop_1",
                      "name": "Patrol stop 1",
                      "enabled": true,
                      "priority": 0,
                      "conditions": [],
                      "match": "all",
                      "destinationId": "lesson_gate",
                      "duration": 2,
                      "actions": [],
                      "completionActions": [],
                      "nextActivityId": "stop_2",
                      "once": false
                    },
                    {
                      "id": "stop_2",
                      "name": "Patrol stop 2",
                      "enabled": true,
                      "priority": 0,
                      "conditions": [],
                      "match": "all",
                      "destinationId": "lesson_square",
                      "duration": 2,
                      "actions": [],
                      "completionActions": [],
                      "nextActivityId": "stop_1",
                      "once": false
                    }
                  ]
                }
              ],
              "recipes": [],
              "quests": [],
              "hints": [],
              "scriptFunctions": [],
              "mechanics": []
            }
          },
          "scripts": [],
          "dependencies": [
            {
              "kind": "room",
              "id": "lesson_gate"
            },
            {
              "kind": "room",
              "id": "lesson_square"
            }
          ],
          "notes": [
            "Choose at least two existing rooms in route order.",
            "Movement uses open connections; blocked paths are reported rather than teleported through.",
            "Test: WAIT",
            "Test: TALK sentinel"
          ],
          "roleId": "patrol_guard",
          "definition": {
            "version": 1,
            "id": "lesson_sentinel",
            "roleId": "patrol_guard",
            "name": "sentinel",
            "description": "Walk a native connected route, pause for interactions and investigate nearby alerts.",
            "enabled": true,
            "inputs": [
              {
                "id": "home",
                "name": "Starting room",
                "kind": "room",
                "value": "lesson_gate",
                "required": true
              },
              {
                "id": "route",
                "name": "Patrol rooms, in order",
                "kind": "room_list",
                "value": "lesson_gate,lesson_square",
                "required": true
              },
              {
                "id": "turnsPerStop",
                "name": "Turns at each stop",
                "kind": "number",
                "value": 2,
                "required": true,
                "min": 1,
                "max": 1000
              },
              {
                "id": "sight",
                "name": "Sight range in connected rooms",
                "kind": "number",
                "value": 0,
                "required": true,
                "min": 0,
                "max": 8
              }
            ],
            "messages": {
              "greeting": "I am watching this area.",
              "success": "The interaction succeeds.",
              "failure": "The requirements are not met yet.",
              "repeat": "That has already been completed."
            }
          }
        }
      }
    }
  ],
  "activeMechanics": [],
  "verbAliases": [],
  "scripts": [
    {
      "id": "lesson_nr_technician_repair",
      "name": "Complete native repair",
      "description": "Owned by technician.",
      "kind": "shared",
      "body": "# Native visual steps are stored in the callable definition."
    },
    {
      "id": "game_start",
      "name": "on_game_start",
      "description": "Sample-only injury for the healing lesson.",
      "body": "damage: 40"
    }
  ],
  "worldEvents": [],
  "customMechanicDefs": [],
  "savedMechanicTemplates": [],
  "objectiveSets": [],
  "gameOutliner": {},
  "customRoomTemplates": [],
  "customObjectTemplates": [],
  "customNpcTemplates": [],
  "customSavedScripts": [],
  "requiredCapabilities": [
    "npc-capabilities-v1",
    "story-rules-v1",
    "object-contents-v1",
    "creator-features-v1",
    "script-functions-v1"
  ]
}
