[
  {
    "id": "MISSION_FREE_MERCHANTS_HUB_DELIVERY_1",
    "//": "Breadcrumb quest from Free Merchants -> Hub 01.  Bring a hard drive to Hub 01 from the refugee center and then return.",
    "type": "mission_definition",
    "name": { "str": "Unknown Recipient" },
    "description": "Deliver the FEMA hard drive to the strange group that Smokes mentioned.  Return to the evacuation center when the data's been delivered.",
    "goal": "MGOAL_CONDITION",
    "difficulty": 5,
    "start": {
      "effect": [ { "u_spawn_item": "fema_data", "count": 1 } ],
      "assign_mission_target": {
        "om_terrain": "robofachq_surface_entrance",
        "om_special": "hub_01",
        "reveal_radius": 1,
        "random": true,
        "search_range": 500
      }
    },
    "end": {
      "effect": { "arithmetic": [ { "global_val": "var", "var_name": "free_merchants_hub_trade_route" }, "=", { "const": 1 } ] }
    },
    "goal_condition": { "u_has_var": "completed_free_merchants_hub_delivery_1", "type": "dialogue", "context": "intercom", "value": "yes" },
    "value": 5000,
    "origins": [ "ORIGIN_SECONDARY" ],
    "dialogue": {
      "describe": "…",
      "offer": "…",
      "accepted": "…",
      "rejected": "…",
      "advice": "…",
      "inquire": "Got the hard drive delivered?",
      "success": "Oh, good.  I'm glad you're alright; I had no idea what to make of them.  Well, one less thing to worry about.",
      "success_lie": "What good does this do us?",
      "failure": "At least you came back alive.  Don't sweat it too much - it's no skin off my back.  If they want it that bad, they can come get another copy themselves."
    }
  },
  {
    "id": "MISSION_FREE_MERCHANTS_EVAC_1",
    "type": "mission_definition",
    "name": { "str": "Clear Back Bay" },
    "description": "Clear out the barricaded back area in the refugee center and lay the former leader of the Free Merchants to rest, in exchange for the local currency: Free Merchant certified notes.",
    "goal": "MGOAL_KILL_MONSTER",
    "difficulty": 2,
    "value": 50000,
    "start": {
      "assign_mission_target": {
        "//": "om_special does nothing because we are at the evac_center. I added this to make the linter happy.",
        "om_special": "evac_center",
        "om_terrain": "evac_center_9",
        "reveal_radius": 1
      },
      "update_mapgen": {
        "om_terrain": "evac_center_9",
        "place_monster": [ { "group": "GROUP_REFUGEE_BOSS_ZOMBIE", "name": "Sean McLaughlin", "x": 10, "y": 10, "target": true } ]
      }
    },
    "end": {
      "effect": [
        { "u_spawn_item": "FMCNote", "count": 25 },
        { "u_add_var": "FMShopkeep_Mission1", "type": "mission", "context": "flag", "value": "yes" },
        { "u_adjust_var": "refugee_happiness", "type": "counter", "context": "refugee_center", "adjustment": 3 }
      ],
      "update_mapgen": {
        "om_terrain": "evac_center_9",
        "set": [ { "square": "terrain", "id": "t_floor", "x": 0, "y": 23, "x2": 1, "y2": 23 } ]
      }
    },
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_FREE_MERCHANTS_EVAC_2",
    "dialogue": {
      "describe": "We need help…",
      "offer": "If you really want to lend a hand we could use your help clearing out the dead in the back bay.  Fearful of going outside during the first days of the Cataclysm we ended up throwing our dead and the zombies we managed to kill in the sealed back bay.  Our promising leader at the time even fell… he turned into something different.  Kill all of them and make sure they won't bother us again.  We can't pay much, besides some of our own internal money which isn't good for that much yet, but it would help us to reclaim the bay.",
      "accepted": "Please be careful, we don't need any more deaths.",
      "rejected": "Come back when you get a chance, we really need to start reclaiming the region.",
      "advice": "If you can, get a friend or two to help you.",
      "inquire": "Will they be bothering us any longer?",
      "success": "Thank you, having that big of a threat close to home was nerve wracking.  Here's some of our local certified notes, we've been paying these to our workers in exchange for supplies.  They're getting some value in the center as a trade item, I'm afraid they're all we have to spare at the moment.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    }
  },
  {
    "id": "MISSION_FREE_MERCHANTS_EVAC_2",
    "type": "mission_definition",
    "name": { "str": "Missing Caravan" },
    "description": "Investigate the last known location of a disappeared scavenger trading party, and eliminate any bandits or raiders in the vicinity in exchange for <reward_count:FMCNote> certified notes.",
    "goal": "MGOAL_ASSASSINATE",
    "difficulty": 5,
    "value": 5000,
    "start": {
      "assign_mission_target": { "om_terrain": "field", "reveal_radius": 1, "random": true, "search_range": 80 },
      "update_mapgen": {
        "rows": [
          "                        ",
          "                        ",
          "                        ",
          "      ggggggggggggg     ",
          "      ggggggggggggg     ",
          "      gg....R...ggg     ",
          "      gg........ggg     ",
          "      gg.......Rggg     ",
          "      gg.F..a...ggg     ",
          "      gg........ggg     ",
          "      gg........ggg     ",
          "      gg........ggg     ",
          "      gg........ggg     ",
          "      gg........ggg     ",
          "      ggggggggggggg     ",
          "      ggggggggggggg     ",
          "                        ",
          "                        ",
          "                        ",
          "            b b         ",
          "           b bb         ",
          "             b          ",
          "                        ",
          "                        "
        ],
        "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ],
        "terrain": {
          "g": "t_region_groundcover",
          ".": "t_region_groundcover_barren",
          "a": "t_region_groundcover_barren",
          "b": "t_region_groundcover_barren",
          "R": "t_region_groundcover_barren",
          "F": "t_region_groundcover_barren"
        },
        "furniture": { "a": "f_ash" },
        "traps": { "F": "tr_fur_rollmat", "R": "tr_rollmat" },
        "fields": { "b": { "field": "fd_blood", "intensity": 1 } },
        "place_loot": [
          { "group": "cannedfood", "x": [ 6, 18 ], "y": [ 3, 15 ], "chance": 100 },
          { "group": "alcohol_bottled_canned", "x": [ 6, 18 ], "y": [ 3, 15 ], "repeat": 2, "chance": 75 },
          { "group": "trash_forest", "x": [ 6, 18 ], "y": [ 3, 15 ], "repeat": 2, "chance": 75 },
          { "group": "stash_drugs", "x": [ 6, 18 ], "y": [ 3, 15 ], "chance": 75 },
          { "group": "dresser", "x": [ 9, 10 ], "y": [ 10, 14 ], "chance": 75 },
          { "group": "softdrugs", "x": [ 9, 10 ], "y": [ 10, 14 ], "chance": 50 },
          { "group": "camping", "x": [ 9, 10 ], "y": [ 10, 14 ], "chance": 75 },
          { "group": "casings", "x": [ 10, 15 ], "y": [ 15, 18 ], "repeat": 5, "chance": 100 },
          { "item": "corpse", "x": 13, "y": 19, "chance": 100 },
          { "item": "corpse", "x": 12, "y": 20, "chance": 100 }
        ],
        "place_npcs": [
          { "class": "bandit", "x": 15, "y": 7 },
          { "class": "thug", "x": 12, "y": 5 },
          { "class": "bandit", "x": 9, "y": 8, "target": true }
        ],
        "place_vehicles": [
          { "vehicle": "cube_van", "x": 12, "y": 12 },
          { "vehicle": "quad_bike", "x": 18, "y": 7, "rotation": 270, "fuel": 500, "status": -1, "chance": 100 },
          { "vehicle": "motorcycle", "x": 10, "y": 3, "rotation": 315, "fuel": 500, "status": -1, "chance": 100 },
          { "vehicle": "motorcycle", "x": 7, "y": 7, "rotation": 90, "fuel": 500, "status": -1, "chance": 100 }
        ]
      }
    },
    "end": {
      "effect": [
        { "u_spawn_item": "FMCNote", "count": 30 },
        { "u_add_var": "FMShopkeep_Mission2", "type": "mission", "context": "flag", "value": "yes" }
      ]
    },
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_FREE_MERCHANTS_EVAC_3",
    "dialogue": {
      "describe": "We need help…",
      "offer": "This is a bit more involved than the last request, we recently lost a scavenger party coming to trade with us and would like you to investigate.  We strongly suspect a raider band or horde caught them off-guard.  I can give you the coordinates of their last radio message but little else.  In either case, deal with the threat so that the scavengers can continue to pass through in relative safety.  The best reward I can offer is a claim to the supplies they were carrying, plus thirty certified notes - that's our own internal money, good for trading and such.",
      "accepted": "Our community survives on trade, we appreciate it.",
      "rejected": "Come back when you get a chance, we really need to start reclaiming the region.",
      "advice": "If you can, get a friend or two to help you.",
      "inquire": "Have you dealt with them?",
      "success": "Thank you, the world is a better place without them.  Two of our more skilled individuals accepted the assistance of the Old Guard in setting up an outpost while you were out.  We didn't have many other options, refugees are still streaming in and we don't know what else to do with our limited food supply.  If you get a chance, you should see if they need your assistance in the future…",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    }
  },
  {
    "id": "MISSION_FREE_MERCHANTS_EVAC_3",
    "type": "mission_definition",
    "name": { "str": "Retrieve Prospectus" },
    "description": "Visit the farming commune and bring the foreman's prospectus back to the refugee center, for <reward_count:FMCNote> certified notes.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "commune_prospectus",
    "start": {
      "assign_mission_target": { "om_terrain": "ranch_camp_67", "om_special": "ranch_camp", "reveal_radius": 1, "search_range": 200 },
      "update_mapgen": {
        "place_npcs": [
          { "class": "ranch_foreman", "x": 16, "y": 15, "target": true, "add_trait": "NPC_MISSION_LEV_1" },
          { "class": "ranch_construction_1", "x": 9, "y": 17 }
        ]
      },
      "effect": [ { "u_add_var": "tacoma_started", "type": "knowledge", "context": "flag", "value": "yes" } ]
    },
    "end": {
      "effect": [
        { "u_spawn_item": "FMCNote", "count": 50 },
        { "u_add_var": "FMShopkeep_Mission3", "type": "mission", "context": "flag", "value": "yes" }
      ],
      "update_mapgen": {
        "om_terrain": "evac_center_8",
        "set": [
          { "point": "terrain", "id": "t_gates_mech_control_lab", "x": 17, "y": 1 },
          { "point": "terrain", "id": "t_gates_mech_control_lab", "x": 17, "y": 3 }
        ]
      }
    },
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_FREE_MERCHANTS_EVAC_4",
    "dialogue": {
      "describe": "We need help…",
      "offer": "We recently set out some skilled people to start an outpost, to secure us some food supplies in a safer location.  The new outpost that we've started could use your assistance.  I need you to get the foreman's prospectus before we begin to send additional refugees to the farming commune.  Consult with the foreman to get more detailed tasks.  We've got 50 Certified Notes for you if you can do this for us.",
      "accepted": "I'm sure the outpost will expand quickly with your assistance.",
      "rejected": "Come back when you get a chance, we really need to start reclaiming the region.",
      "advice": "Just follow your map.",
      "inquire": "Do you have the prospectus?",
      "success": "With this we'll be able to convince others to invest in the commune.  Thank you, here's your money.  We also managed to get a manual crank hooked up to the garage in the back, so feel free to make use of that - you've been a great help to us.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    }
  },
  {
    "id": "MISSION_FREE_MERCHANTS_EVAC_4",
    "type": "mission_definition",
    "name": { "str": "Solar Power" },
    "description": "Deliver 10 solar panel arrays to help the Free Merchants set up a renewable power grid, in exchange for a handsome reward.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 400000,
    "item": "ground_solar_panel",
    "count": 10,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_FREE_MERCHANTS_EVAC_5",
    "end": {
      "effect": [
        { "u_spawn_item": "FMCNote", "count": 100 },
        { "u_add_var": "FMShopkeep_Mission4", "type": "mission", "context": "flag", "value": "yes" }
      ]
    },
    "dialogue": {
      "describe": "We need help…",
      "offer": "We are starting to build new infrastructure here and would like to get a few new electrical systems online… unfortunately our existing system relies on an array of something called RTGs.  Running generators isn't a viable option underground, of course.  We have a big flat roof up top, and if we had a few solar panel arrays we could use them to top up our usage.  We could pay you pretty handsomely to bring us, say, ten solar panel arrays?",
      "accepted": "If you can do this for us our survival options would vastly increase.",
      "rejected": "Come back when you get a chance, we really need to start reclaiming the region.",
      "advice": "Solar panel arrays are pretty common on solar farms and on rooftops.",
      "inquire": "How is the search going?",
      "success": "Great, I know it isn't much but we hope to continue to expand thanks to your help.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    }
  },
  {
    "id": "MISSION_FREE_MERCHANTS_EVAC_5",
    "type": "mission_definition",
    "name": { "str": "In a Pickle" },
    "description": "Deliver 100 0.5L glass jars to the Free Merchants to kickstart their food storage plans.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 3,
    "value": 400000,
    "item": "jar_glass_sealed",
    "count": 100,
    "end": {
      "effect": [
        { "u_spawn_item": "FMCNote", "count": 25 },
        { "u_add_var": "FMShopkeep_Mission5", "type": "mission", "context": "flag", "value": "yes" }
      ]
    },
    "origins": [ "ORIGIN_SECONDARY" ],
    "dialogue": {
      "describe": "We need help…",
      "offer": "While we've managed to secure day to day food supplies, it's very much hand to mouth.  Our reserves would barely last a few days if something kept our people locked in.  We need a stockpile to avoid that.  Thanks to our outpost we have a bit of meat and vegetables coming in, but we need a better way to preserve them.  Some of our people know enough about food canning that if we had a good stock of canning jars, we could make pickles and canned meats to get us set for the winter.  I'll pay you a premium rate if you can bring us around a hundred jars to get us started.",
      "accepted": "It'll take a load off my shoulders if I can finally stop worrying about this.",
      "rejected": "We'll hold for the moment, but I'll get an ulcer if I have to keep worrying.  If you reconsider let me know.",
      "advice": "Grocery stores, house kitchens, there's plenty of places to look.",
      "inquire": "How is the search going?",
      "success": "That's one less thing to worry about.  Glad to have someone like you on our side.  Here's 25 merch, and the broker will buy any further glass jars you can find - at a reduced price, we can't keep up the premium rate.  Actually, the broker was saying they had some jobs like this for you, and that it might be easier to just go straight through their office if you want more work.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    }
  },
  {
    "id": "TALK_FREE_MERCHANTS_MERCHANT_Robofac",
    "type": "talk_topic",
    "dynamic_line": "Well, we had an odd group come by maybe two days after the power grid went off.  Two armed guards wearing brown uniforms, and what looked like a government doctor, had a hazmat suit on.  Everyone had masks they never took off.  They looked organized… maybe a military remnant from somewhere close by.",
    "responses": [
      { "text": "What were they here for?", "topic": "TALK_FREE_MERCHANTS_MERCHANT_Robofac1" },
      { "text": "That's fine for now.", "topic": "TALK_FREE_MERCHANTS_MERCHANT_Talk" }
    ]
  },
  {
    "id": "TALK_FREE_MERCHANTS_MERCHANT_Robofac1",
    "type": "talk_topic",
    "dynamic_line": "The doctor paid us in advance to get some old FEMA info from our computers here, and told us to deliver the data to an isolated building afterwards.  We still haven't done that.  I'm half worried it might have been some kind of trap, or trick.",
    "responses": [
      { "text": "Where's that building at, exactly?", "topic": "TALK_FREE_MERCHANTS_MERCHANT_Robofac2" },
      { "text": "You seem right to be suspicious.", "topic": "TALK_FREE_MERCHANTS_MERCHANT_Talk" }
    ]
  },
  {
    "id": "TALK_FREE_MERCHANTS_MERCHANT_Robofac2",
    "type": "talk_topic",
    "dynamic_line": "I could share the dropoff location if you want to bring the drive there for us, but whatever's there, I'm not sure it's worth all the trouble.  I'll reward you for your trouble.",
    "responses": [
      {
        "text": "That seems fine to me.  I'll take your drive for you.",
        "topic": "TALK_FREE_MERCHANTS_MERCHANT_Robofac_Start",
        "effect": [
          { "add_mission": "MISSION_FREE_MERCHANTS_HUB_DELIVERY_1" },
          {
            "u_add_var": "u_hub01_breadcrumb_accepted",
            "type": "general",
            "context": "free_merchants",
            "value": "yes"
          }
        ]
      },
      {
        "text": "Actually, I can see why you haven't done it yet.  Hold that thought for now.",
        "topic": "TALK_FREE_MERCHANTS_MERCHANT_Talk"
      }
    ]
  },
  {
    "id": "TALK_FREE_MERCHANTS_MERCHANT_Robofac_Start",
    "type": "talk_topic",
    "dynamic_line": "I was hoping you'd say that.  It's an old isolated building not too far from here; you should probably just leave the drive to whoever's there and be on your way.  And like I said, be careful approaching the place.  I wouldn't like leading you straight into your death.",
    "responses": [
      { "text": "Don't worry, I'll be careful.  I'll let you know when it's done.", "topic": "TALK_DONE" },
      { "text": "I'm sure I'll manage.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FREE_MERCHANTS_MERCHANT_BorisCleanup",
    "dynamic_line": "Hmm.\"  Smokes looks thoughtful, rubbing his chin.  \"Well, most of the people downstairs aren't willing to come up for things like that, and a lot of folks that are up here have a lot of bad memories from that.  You could try asking around some of the people we have upstairs, but it'll be tough.  If you have some merch you could spare, though, I could get some people off guard duty and into your little crew for some hazard pay.  You might also have luck asking the Old Guard rep in the southwest bay, near the library - I hear they've got some volunteers lately.",
    "responses": [
      {
        "text": "[5 merch] Five merch for someone sounds fair to me.",
        "condition": { "u_has_items": { "item": "FMCNote", "count": 5 } },
        "effect": [
          { "u_adjust_var": "Boris_mission_1", "type": "mission", "context": "cleanup_promises", "adjustment": 1 },
          { "npc_add_var": "cleanup_asked", "type": "mission", "context": "Boris_mission_1", "value": "yes" },
          { "u_consume_item": "FMCNote", "count": 5, "popup": true }
        ],
        "topic": "TALK_FREE_MERCHANTS_MERCHANT_BorisCleanup1"
      },
      {
        "text": "[10 merch] How about ten merch to do it?",
        "condition": { "u_has_items": { "item": "FMCNote", "count": 10 } },
        "effect": [
          { "u_adjust_var": "Boris_mission_1", "type": "mission", "context": "cleanup_promises", "adjustment": 3 },
          { "npc_add_var": "cleanup_asked", "type": "mission", "context": "Boris_mission_1", "value": "yes" },
          { "u_consume_item": "FMCNote", "count": 10, "popup": true }
        ],
        "topic": "TALK_FREE_MERCHANTS_MERCHANT_BorisCleanup2"
      },
      {
        "text": "Thanks for the advice.  Maybe I'll come back with some more merch.",
        "topic": "TALK_FREE_MERCHANTS_MERCHANT_Talk"
      }
    ]
  },
  {
    "id": "TALK_FREE_MERCHANTS_MERCHANT_BorisCleanup1",
    "type": "talk_topic",
    "dynamic_line": "That's enough to get someone off guard duty, yeah.  Hand it here and I'll set it up.\"  The money exchanges hands.  \"Right.  I haven't updated this list in a while, so some people are still assigned to watch the back bay, which is technically a free shift now.  I'll let one of them know about what's up and they can spend the time helping to clean up back there.  Hope it helps.",
    "responses": [ { "text": "Thank you!", "topic": "TALK_FREE_MERCHANTS_MERCHANT_Talk" } ]
  },
  {
    "id": "TALK_FREE_MERCHANTS_MERCHANT_BorisCleanup2",
    "type": "talk_topic",
    "dynamic_line": "Woah, you're really intent, hey?  That's a lot for most people here.\"  The money exchanges hands.  \"That's enough to get two people off guard duty for an afternoon, even with all the ugliness back there.  And you know what?  I'll help out, too, so make that three.  I can appreciate someone who's willing to put their money where their mouth is.",
    "responses": [ { "text": "Thank you very much!", "topic": "TALK_FREE_MERCHANTS_MERCHANT_Talk" } ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FREE_MERCHANTS_MERCHANT_DavePermission",
    "dynamic_line": "*looks at you cautiously.  \"He hasn't been bothering you, has he?  Dave's usually pretty harmless.\"",
    "responses": [
      {
        "text": "He wants permission to build himself a little shelter outside of your lobby, somewhere out of the way.  He'd need access to your washrooms and things, but you could clear him out of this space.",
        "topic": "TALK_FREE_MERCHANTS_MERCHANT_DavePermission2"
      },
      { "text": "Forget I said anything.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FREE_MERCHANTS_MERCHANT_DavePermission2",
    "dynamic_line": "Sure, sounds great on paper, but *where*?  We aren't swimming in real estate here, the place is seriously overcrowded.  And I won't have him living out of a soggy cardboard box on the doorstep, it's an even worse look than the lobby.",
    "responses": [
      {
        "text": "What about the rooftop?  There's a stair access there, I can see it from outside, and he'd probably be able to do a bit of a lookout job.",
        "topic": "TALK_FREE_MERCHANTS_MERCHANT_DavePermission3"
      },
      { "text": "Forget I said anything.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FREE_MERCHANTS_MERCHANT_DavePermission3",
    "dynamic_line": "*rubs his chin.  \"It's probably technically a fire hazard, but there's not much to light up there besides what Dave brings.  And a few of the guards are pretty attached to him, so we could maybe send folks up to keep an eye on him and make sure he's doing okay.  That wouldn't interfere with comings and goings, either.\"  He pauses a moment, looking at his ledger as if it contains answers.  \"You know what?  Sure.  If Dave is okay with it, I can talk the others into letting him have rooftop access to build himself a little shelter, as long as he continues to keep it clean up there like he has in here.\"",
    "speaker_effect": { "effect": { "u_add_var": "Dave_Permission", "type": "mission", "value": "yes" } },
    "responses": [ { "text": "Thanks.  I'll go let him know.", "topic": "TALK_DONE" } ]
  }
]
