[
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_MAIN",
    "responses": [
      {
        "condition": { "not": { "u_has_trait": "perk_ALCHEMY1" } },
        "text": "Gain [<trait_name:perk_ALCHEMY1>]",
        "topic": "TALK_PERK_MENU_ALCHEMY1"
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_ALCHEMY1",
    "dynamic_line": "<trait_name:perk_ALCHEMY1>: \"<trait_description:perk_ALCHEMY1>\"",
    "responses": [
      {
        "text": "Select Perk.",
        "topic": "TALK_PERK_MENU_MAIN",
        "condition": { "math": [ "u_num_perks > 0" ] },
        "failure_explanation": "Requirements Not Met",
        "failure_topic": "TALK_PERK_MENU_FAIL",
        "effect": [ { "u_add_trait": "perk_ALCHEMY1" }, { "math": [ "u_num_perks--" ] } ]
      },
      { "text": "Go Back.", "topic": "TALK_PERK_MENU_MAIN" },
      { "text": "Quit.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_MAIN",
    "responses": [
      {
        "condition": { "and": [ { "u_has_trait": "perk_ALCHEMY1" }, { "not": { "u_has_trait": "perk_ALCHEMY2" } } ] },
        "text": "Gain [<trait_name:perk_ALCHEMY2>]",
        "topic": "TALK_PERK_MENU_ALCHEMY2"
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_ALCHEMY2",
    "dynamic_line": "<trait_name:perk_ALCHEMY2>: \"<trait_description:perk_ALCHEMY2>\"",
    "responses": [
      {
        "text": "Select Perk.",
        "topic": "TALK_PERK_MENU_MAIN",
        "condition": { "math": [ "u_num_perks > 0" ] },
        "failure_explanation": "Requirements Not Met",
        "failure_topic": "TALK_PERK_MENU_FAIL",
        "effect": [ { "u_add_trait": "perk_ALCHEMY2" }, { "math": [ "u_num_perks--" ] } ]
      },
      { "text": "Go Back.", "topic": "TALK_PERK_MENU_MAIN" },
      { "text": "Quit.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_MAIN",
    "responses": [
      {
        "condition": { "and": [ { "u_has_trait": "perk_ALCHEMY2" }, { "not": { "u_has_trait": "perk_ALCHEMY3" } } ] },
        "text": "Gain [<trait_name:perk_ALCHEMY3>]",
        "topic": "TALK_PERK_MENU_ALCHEMY3"
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_ALCHEMY3",
    "dynamic_line": "<trait_name:perk_ALCHEMY3>: \"<trait_description:perk_ALCHEMY3>\"",
    "responses": [
      {
        "text": "Select Perk.",
        "topic": "TALK_PERK_MENU_MAIN",
        "condition": { "math": [ "u_num_perks > 0" ] },
        "failure_explanation": "Requirements Not Met",
        "failure_topic": "TALK_PERK_MENU_FAIL",
        "effect": [ { "u_add_trait": "perk_ALCHEMY3" }, { "math": [ "u_num_perks--" ] } ]
      },
      { "text": "Go Back.", "topic": "TALK_PERK_MENU_MAIN" },
      { "text": "Quit.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_MAIN",
    "responses": [
      {
        "condition": {
          "and": [
            { "u_has_trait": "perk_ALCHEMY3" },
            { "u_know_recipe": "cold_iron_ingot" },
            { "not": { "u_has_trait": "perk_ALCHEMY3_COLD_IRON" } }
          ]
        },
        "text": "Gain [<trait_name:perk_ALCHEMY3_COLD_IRON>]",
        "topic": "TALK_PERK_MENU_ALCHEMY3_COLD_IRON"
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_ALCHEMY3_COLD_IRON",
    "dynamic_line": "<trait_name:perk_ALCHEMY3_COLD_IRON>: \"<trait_description:perk_ALCHEMY3_COLD_IRON>\"",
    "responses": [
      {
        "text": "Select Perk.",
        "topic": "TALK_PERK_MENU_MAIN",
        "condition": { "math": [ "u_num_perks > 0" ] },
        "failure_explanation": "Requirements Not Met",
        "failure_topic": "TALK_PERK_MENU_FAIL",
        "effect": [ { "u_add_trait": "perk_ALCHEMY3_COLD_IRON" }, { "math": [ "u_num_perks--" ] } ]
      },
      { "text": "Go Back.", "topic": "TALK_PERK_MENU_MAIN" },
      { "text": "Quit.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_MAIN",
    "responses": [
      {
        "condition": { "and": [ { "u_has_trait": "perk_ALCHEMY3" }, { "not": { "u_has_trait": "perk_ALCHEMY4" } } ] },
        "text": "Gain [<trait_name:perk_ALCHEMY4>]",
        "topic": "TALK_PERK_MENU_ALCHEMY4"
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_ALCHEMY4",
    "dynamic_line": "<trait_name:perk_ALCHEMY4>: \"<trait_description:perk_ALCHEMY4>\"",
    "responses": [
      {
        "text": "Select Perk.",
        "topic": "TALK_PERK_MENU_MAIN",
        "condition": { "math": [ "u_num_perks > 0" ] },
        "failure_explanation": "Requirements Not Met",
        "failure_topic": "TALK_PERK_MENU_FAIL",
        "effect": [ { "u_add_trait": "perk_ALCHEMY4" }, { "math": [ "u_num_perks--" ] } ]
      },
      { "text": "Go Back.", "topic": "TALK_PERK_MENU_MAIN" },
      { "text": "Quit.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_MAIN",
    "responses": [
      {
        "condition": { "and": [ { "u_has_trait": "perk_ALCHEMY4" }, { "not": { "u_has_trait": "perk_ALCHEMY5" } } ] },
        "text": "Gain [<trait_name:perk_ALCHEMY5>]",
        "topic": "TALK_PERK_MENU_ALCHEMY5"
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_ALCHEMY5",
    "dynamic_line": "<trait_name:perk_ALCHEMY5>: \"<trait_description:perk_ALCHEMY5>\"",
    "responses": [
      {
        "text": "Select Perk.",
        "topic": "TALK_PERK_MENU_MAIN",
        "condition": { "math": [ "u_num_perks > 0" ] },
        "failure_explanation": "Requirements Not Met",
        "failure_topic": "TALK_PERK_MENU_FAIL",
        "effect": [ { "u_add_trait": "perk_ALCHEMY5" }, { "math": [ "u_num_perks--" ] } ]
      },
      { "text": "Go Back.", "topic": "TALK_PERK_MENU_MAIN" },
      { "text": "Quit.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_MAIN",
    "responses": [
      {
        "condition": { "not": { "u_has_trait": "perk_LOW_INT_MANA" } },
        "text": "Gain [<trait_name:perk_LOW_INT_MANA>]",
        "topic": "TALK_PERK_MENU_LOW_INT_MANA"
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_LOW_INT_MANA",
    "dynamic_line": "<trait_name:perk_LOW_INT_MANA>: \"<trait_description:perk_LOW_INT_MANA>\"",
    "responses": [
      {
        "text": "Select Perk.",
        "topic": "TALK_PERK_MENU_MAIN",
        "condition": { "math": [ "u_num_perks > 0" ] },
        "failure_explanation": "Requirements Not Met",
        "failure_topic": "TALK_PERK_MENU_FAIL",
        "effect": [ { "u_add_trait": "perk_LOW_INT_MANA" }, { "math": [ "u_num_perks--" ] } ]
      },
      { "text": "Go Back.", "topic": "TALK_PERK_MENU_MAIN" },
      { "text": "Quit.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_PERK_MENU_PLAYSTYLE",
    "insert_before_standard_exits": true,
    "responses": [
      {
        "condition": { "not": { "u_has_trait": "perk_xe_vampire_killer" } },
        "text": "Gain [<trait_name:perk_xe_vampire_killer>]",
        "effect": [
          { "set_string_var": "<trait_name:perk_xe_vampire_killer>", "target_var": { "context_val": "trait_name" } },
          {
            "set_string_var": "<trait_description:perk_xe_vampire_killer>",
            "target_var": { "context_val": "trait_description" }
          },
          { "set_string_var": "perk_xe_vampire_killer", "target_var": { "context_val": "trait_id" } },
          {
            "set_string_var": "None.",
            "target_var": { "context_val": "trait_requirement_description" },
            "i18n": true
          },
          { "set_condition": "perk_condition", "condition": { "math": [ " 0 == 0" ] } }
        ],
        "topic": "TALK_PERK_MENU_SELECT_PLAYSTYLE"
      }
    ]
  }
]
