[
  {
    "type": "npc",
    "id": "NPC_scrap_trader",
    "class": "SCRAP_MERCHANT",
    "gender": "male",
    "name_suffix": "scrapper",
    "attitude": 0,
    "mission": 3,
    "chat": "TALK_NPC_SCRAP_TRADER",
    "faction": "wasteland_scavengers",
    "mission_offered": "MISSION_SCRAP_TRADER_GET_25_MAGNETRON"
  },
  {
    "type": "npc_class",
    "id": "SCRAP_MERCHANT",
    "name": { "str": "Merchant" },
    "job_description": "I'm a local shopkeeper.",
    "common": false,
    "sells_belongings": false,
    "bonus_str": 4,
    "traits": [
      { "group": "Appearance_demographics" },
      { "trait": "STRONGBACK" },
      { "trait": "OUTDOORSMAN" },
      { "trait": "STRONGSTOMACH" },
      { "trait": "PAINRESIST" },
      { "trait": "NIGHTVISION" },
      { "trait": "QUICK" },
      { "trait": "GOODCARDIO" },
      { "trait": "TOUGH" },
      { "trait": "ADRENALINE" },
      { "trait": "NARCOLEPTIC" },
      { "trait": "PROJUNK" },
      { "trait": "MOODSWINGS" },
      { "trait": "NO_BASH" },
      { "trait": "RETURN_TO_START_POS" }
    ],
    "skills": [
      { "skill": "ALL", "level": { "sum": [ { "dice": [ 1, 2 ] }, { "constant": -1 } ] } },
      { "skill": "unarmed", "bonus": { "rng": [ 0, 3 ] } },
      { "skill": "bashing", "bonus": { "rng": [ 0, 3 ] } },
      { "skill": "melee", "bonus": { "rng": [ 0, 3 ] } },
      { "skill": "dodge", "bonus": { "rng": [ 0, 3 ] } },
      { "skill": "rifle", "bonus": { "rng": [ 2, 5 ] } },
      { "skill": "gun", "bonus": { "rng": [ 2, 5 ] } },
      { "skill": "fabrication", "bonus": { "rng": [ 2, 5 ] } },
      { "skill": "mechanics", "bonus": { "rng": [ 6, 8 ] } },
      { "skill": "driving", "bonus": { "rng": [ 5, 6 ] } },
      { "skill": "swimming", "bonus": { "rng": [ 3, 5 ] } },
      { "skill": "survival", "bonus": { "rng": [ 0, 3 ] } },
      { "skill": "cooking", "bonus": { "rng": [ 3, 5 ] } }
    ],
    "worn_override": "SCRAP_MERCHANT_worn",
    "weapon_override": "SCRAP_MERCHANT_weapon",
    "carry_override": "SCRAP_MERCHANT_carried",
    "shopkeeper_item_group": [
      { "group": "SCRAPPER_Shop", "rigid": true },
      {
        "group": "SCRAPPER_Shop_Specialty_Metals",
        "rigid": true,
        "condition": { "npc_has_var": "specific_metal_tradeable", "type": "dialogue", "context": "trade", "value": "yes" }
      },
      {
        "group": "no_sell",
        "rigid": true,
        "condition": { "compare_num": [ { "npc_val": "var", "var_name": "NEVER" }, "==", { "const": 1 } ] },
        "refusal": "<npcname> will never sell this"
      }
    ],
    "shopkeeper_consumption_rates": "basic_shop_rates",
    "shopkeeper_price_rules": [
      { "item": "scrap", "price": 200, "fixed_adj": 0 },
      { "item": "nuts_bolts", "price": 500, "fixed_adj": 0 },
      { "item": "sheet_metal_small", "price": 400, "fixed_adj": 0 },
      { "item": "steel_chunk", "price": 400, "fixed_adj": 0 },
      { "item": "steel_lump", "price": 600, "fixed_adj": 0 },
      { "item": "sheet_metal", "price": 500, "fixed_adj": 0 },
      { "item": "lc_steel_lump", "price": 1200, "fixed_adj": 0 },
      { "item": "mc_steel_lump", "price": 1600, "fixed_adj": 0 },
      { "item": "hc_steel_lump", "price": 2000, "fixed_adj": 0 },
      { "item": "scrap_aluminum", "price": 30, "fixed_adj": 0 },
      { "item": "scrap_bronze", "price": 500, "fixed_adj": 0 },
      { "item": "bismuth", "price": 2000, "fixed_adj": 0 },
      { "item": "zinc_metal", "price": 2000, "fixed_adj": 0 },
      { "item": "lead", "price": 2400, "fixed_adj": 0 },
      { "item": "scrap_copper", "price": 140, "fixed_adj": 0 },
      { "item": "tin", "price": 3600, "fixed_adj": 0 },
      { "item": "magnesium", "price": 2000, "fixed_adj": 0 },
      { "item": "silver_small", "price": 5600, "fixed_adj": 0 },
      { "item": "gold_small", "price": 20000, "fixed_adj": 0 },
      { "item": "platinum_small", "price": 30000, "fixed_adj": 0 }
    ]
  },
  {
    "type": "item_group",
    "id": "SCRAP_MERCHANT_worn",
    "subtype": "collection",
    "items": [
      { "item": "glasses_safety" },
      { "item": "helmet_liner" },
      { "item": "hat_hard" },
      { "item": "turtleneck_shirt" },
      { "item": "jacket_jean" },
      { "item": "vest" },
      { "item": "boxer_briefs" },
      { "item": "jeans" },
      { "item": "gloves_work" },
      { "item": "socks" },
      { "item": "boots" },
      { "item": "gold_ring" },
      { "item": "tool_belt" },
      { "item": "spearsling" },
      { "group": "modular_ar15", "ammo-item": "223", "charges": 30, "container-item": "back_holster" }
    ]
  },
  {
    "type": "item_group",
    "id": "SCRAP_MERCHANT_carried",
    "subtype": "collection",
    "items": [
      { "item": "flashlight", "charges": [ 0, 300 ] },
      { "item": "multitool" },
      { "item": "hammer" },
      { "item": "boltcutters" },
      { "item": "homemade_grenade", "count": [ 0, 2 ] }
    ]
  },
  {
    "type": "item_group",
    "id": "SCRAP_MERCHANT_weapon",
    "subtype": "collection",
    "items": [ { "item": "heavy_crowbar" } ]
  },
  {
    "type": "item_group",
    "id": "no_sell",
    "subtype": "collection",
    "items": [
      { "item": "cash_register", "count": 0 },
      { "item": "wheel_wide", "count": 0 },
      { "group": "SUS_fridge_survivor", "count": 0 },
      { "group": "SUS_utensils", "count": 0 },
      { "item": "microwave", "count": 0 },
      { "group": "used_1st_aid", "count": 0 },
      { "item": "coffee", "count": 0 },
      { "item": "hd_tow_cable", "count": 0 },
      { "item": "roadmap", "count": 0 },
      { "item": "folding_poncho", "count": 0 },
      { "item": "rope_6", "count": 0 },
      { "item": "handflare", "count": 0 },
      { "item": "sm_extinguisher", "count": 0 },
      { "item": "towel", "count": 0 }
    ]
  },
  {
    "type": "item_group",
    "id": "SCRAPPER_Shop",
    "subtype": "collection",
    "items": [
      { "item": "scrap", "count": [ 125, 250 ] },
      { "item": "nuts_bolts", "count": [ 10, 25 ] },
      { "item": "sheet_metal_small", "count": [ 50, 100 ] },
      { "item": "steel_chunk", "count": [ 100, 200 ] },
      { "item": "steel_lump", "count": [ 50, 100 ] },
      { "item": "sheet_metal", "count": [ 25, 50 ] },
      { "item": "lc_steel_lump", "count": [ 25, 50 ] },
      { "item": "mc_steel_lump", "count": [ 25, 50 ] },
      { "item": "hc_steel_lump", "count": [ 25, 50 ] }
    ]
  },
  {
    "type": "item_group",
    "id": "SCRAPPER_Shop_Specialty_Metals",
    "subtype": "collection",
    "items": [
      { "item": "scrap_aluminum", "count": [ 100, 200 ] },
      { "item": "scrap_bronze", "count": [ 20, 50 ] },
      { "item": "bismuth", "count": [ 0, 3 ], "container-item": "bag_zipper", "charges": 100 },
      { "item": "zinc_metal", "count": [ 0, 3 ], "container-item": "jar_glass_sealed", "charges": 100 },
      { "item": "lead", "count": [ 0, 3 ], "container-item": "bag_zipper", "charges": 100 },
      { "item": "scrap_copper", "count": [ 100, 200 ] },
      { "item": "tin", "count": [ 0, 3 ], "container-item": "bag_zipper", "charges": 100 },
      { "item": "magnesium", "count": [ 0, 3 ], "container-item": "bag_zipper", "charges": 100 },
      { "item": "silver_small", "count": [ 0, 3 ], "container-item": "bag_zipper", "charges": 100 },
      { "item": "gold_small", "count": [ 0, 3 ], "container-item": "bag_zipper", "charges": 100 },
      { "item": "platinum_small", "count": [ 0, 3 ], "container-item": "jar_glass_sealed", "charges": 100 }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_NPC_SCRAP_TRADER",
    "dynamic_line": {
      "npc_has_var": "talked_to_trader",
      "type": "dialogue",
      "context": "first_meeting",
      "value": "yes",
      "yes": "Hello there.  Nice to see you, <name_g>.",
      "no": "Haven't seen another face in quite a while.  Not a living one, at least.  State your business.  Maybe you got some use for some of this scrap metal?"
    },
    "speaker_effect": { "effect": { "npc_add_var": "talked_to_trader", "type": "dialogue", "context": "first_meeting", "value": "yes" } },
    "responses": [
      {
        "text": "Nice to meet you.",
        "topic": "TALK_NPC_SCRAP_TRADER_INTRO",
        "condition": { "not": { "npc_has_var": "talked_to_trader", "type": "dialogue", "context": "first_meeting", "value": "yes" } }
      },
      {
        "text": "Hands up, <name_b>!",
        "trial": { "type": "INTIMIDATE", "difficulty": 30 },
        "success": { "topic": "TALK_WEAPON_DROPPED", "effect": "drop_weapon", "opinion": { "trust": -4, "fear": 3 } },
        "failure": { "topic": "TALK_DONE", "effect": "hostile" },
        "condition": { "not": { "npc_has_var": "talked_to_trader", "type": "dialogue", "context": "first_meeting", "value": "yes" } }
      },
      {
        "text": "Pleasure to see you again, <name_g>.",
        "topic": "TALK_NPC_SCRAP_TRADER_INTRO",
        "condition": { "npc_has_var": "talked_to_trader", "type": "dialogue", "context": "first_meeting", "value": "yes" }
      },
      { "text": "See ya.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_NPC_SCRAP_TRADER_INTRO",
    "dynamic_line": "Do you need something?",
    "responses": [
      { "text": "What's your story?", "topic": "TALK_NPC_SCRAP_TRADER_STORY" },
      { "text": "Why stay here of all places?", "topic": "TALK_NPC_SCRAP_TRADER_FORT" },
      { "text": "Can I buy anything?", "topic": "TALK_SCRAP_TRADER_BULK_SELL" },
      {
        "text": "Any jobs you need done?",
        "condition": { "and": [ { "not": "has_assigned_mission" }, { "not": "has_many_assigned_missions" } ] },
        "topic": "TALK_MISSION_LIST"
      },
      { "text": "Nah, see ya.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_NPC_SCRAP_TRADER_STORY",
    "dynamic_line": "Well, I held a modest job here as a scrap yard worker.  Business was fair most days, but when <the_cataclysm> hit, I was on a solo shift.  With all the craziness going on in the cities and whatnot, I decided to just stay here for while.  I figure someone might find a use for the leftover metal lying around, so I started selling it to anyone who passed by.",
    "responses": [ { "text": "Hmm.", "topic": "TALK_NONE" } ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_NPC_SCRAP_TRADER_FORT",
    "dynamic_line": "Like I said, I was already here when the dead got pissed off.  This place had some barbed wire, metalworking tools, and plenty of stuff to make weapons out of.  Even the walls are my own making.",
    "responses": [
      { "text": "Interesting.", "topic": "TALK_NONE" },
      { "text": "Think I could stay here?", "topic": "TALK_NPC_SCRAP_TRADER_HOME_STAY" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_NPC_SCRAP_TRADER_HOME_STAY",
    "dynamic_line": "Sure, I'm fine with it.  There's a spare bed in the shed next door for anyone who needs it.  Just don't hog it.  Someone else might come along.",
    "responses": [ { "text": "Thanks, <name_g>.", "topic": "TALK_NPC_SCRAP_TRADER_INTRO" } ]
  },
  {
    "id": "TALK_SCRAP_TRADER_BULK_SELL",
    "//": "this is all the dialogue related to buying bulk metal or scrap.",
    "type": "talk_topic",
    "dynamic_line": [ "Sure thing.  I've got a few things on hand.  What'll ya have?" ],
    "responses": [
      { "text": "Nevermind.", "topic": "TALK_NONE" },
      {
        "text": "Let's take a look at your stock.",
        "topic": "TALK_SCRAP_TRADER_BULK_SELL_END",
        "effect": "start_trade"
      }
    ]
  },
  {
    "id": "TALK_SCRAP_TRADER_BULK_SELL_END",
    "type": "talk_topic",
    "dynamic_line": [ "Anything else you need?" ],
    "responses": [
      { "text": "No, that's all.", "topic": "TALK_DONE" },
      { "text": "Find anything good?", "topic": "TALK_SCRAP_TRADER_ASK_INTERVAL" },
      { "text": "Can I have another look?", "topic": "TALK_SCRAP_TRADER_BULK_SELL_END", "effect": "start_trade" }
    ]
  },
  {
    "id": "TALK_SCRAP_TRADER_ASK_INTERVAL",
    "type": "talk_topic",
    "dynamic_line": "Nope, although I have a really good claim by the river.  Gonna go fetch them soon, be right back in <interval>.",
    "responses": [ { "text": "Well, good luck.", "topic": "TALK_NPC_SCRAP_TRADER" } ]
  }
]
