{
  "schema": "v2.dialogue.tree.v1",
  "dialogueId": "dlg.asha_storm.market_intro",
  "formatVersion": 1,
  "title": "Asha Storm Market Intro",
  "startNodeId": "n.start",
  "participants": [
    {
      "id": "speaker.player",
      "role": "player",
      "displayNameLineId": "loc.dialogue.speaker.player"
    },
    {
      "id": "npc.asha_storm",
      "role": "npc",
      "characterId": "Fighter.AshaStorm",
      "displayNameLineId": "loc.dialogue.character.asha_storm.name"
    }
  ],
  "variables": {
    "local": [
      {
        "name": "asked_for_route",
        "type": "bool",
        "default": false
      }
    ],
    "persistent": [
      {
        "scope": "npc.asha_storm",
        "name": "market_intro_completed",
        "type": "bool",
        "default": false
      }
    ],
    "globalReads": ["story.market_unlocked", "world.time_of_day"]
  },
  "nodes": [
    {
      "id": "n.start",
      "kind": "text",
      "speakerId": "npc.asha_storm",
      "lineId": "loc.dialogue.asha.market_intro.start",
      "voiceCue": "/Game/V2/Audio/Voice/Dialogue/Asha/MarketIntro_Start.MarketIntro_Start",
      "subtitleTimingId": "sub.dialogue.asha.market_intro.start",
      "tags": ["greeting", "hub"]
    },
    {
      "id": "n.player_choice",
      "kind": "choice",
      "speakerId": "speaker.player",
      "promptLineId": "loc.dialogue.player.market_intro.prompt",
      "choiceOrder": "authored"
    },
    {
      "id": "n.route_available",
      "kind": "condition",
      "predicate": {
        "all": [
          {
            "ref": "quest_state",
            "questId": "Quest.MarketRoutes",
            "state": "inactive"
          },
          {
            "ref": "global_story_variable",
            "name": "story.market_unlocked",
            "equals": true
          }
        ]
      }
    },
    {
      "id": "n.grant_route",
      "kind": "action",
      "actions": [
        {
          "ref": "set_variable",
          "scope": "local",
          "name": "asked_for_route",
          "value": true
        },
        {
          "ref": "start_quest",
          "questId": "Quest.MarketRoutes"
        },
        {
          "ref": "emit_event",
          "topic": "v2.dialogue.choice.selected",
          "payload": {
            "dialogue_id": "dlg.asha_storm.market_intro",
            "choice_id": "choice.ask_route"
          }
        }
      ]
    },
    {
      "id": "n.ambient_variant",
      "kind": "random",
      "seedScope": "dialogueVisit",
      "recordSelection": true
    },
    {
      "id": "n.route_response",
      "kind": "text",
      "speakerId": "npc.asha_storm",
      "lineId": "loc.dialogue.asha.market_intro.route_response",
      "voiceCue": "/Game/V2/Audio/Voice/Dialogue/Asha/MarketIntro_Route.MarketIntro_Route",
      "subtitleTimingId": "sub.dialogue.asha.market_intro.route_response",
      "tags": ["quest", "route"]
    },
    {
      "id": "n.route_repeat",
      "kind": "text",
      "speakerId": "npc.asha_storm",
      "lineId": "loc.dialogue.asha.market_intro.route_repeat",
      "voiceCue": "/Game/V2/Audio/Voice/Dialogue/Asha/MarketIntro_RouteRepeat.MarketIntro_RouteRepeat",
      "subtitleTimingId": "sub.dialogue.asha.market_intro.route_repeat",
      "tags": ["quest", "repeat"]
    },
    {
      "id": "n.ambient_day",
      "kind": "text",
      "speakerId": "npc.asha_storm",
      "lineId": "loc.dialogue.asha.market_intro.ambient_day",
      "voiceCue": "/Game/V2/Audio/Voice/Dialogue/Asha/MarketIntro_AmbientDay.MarketIntro_AmbientDay",
      "subtitleTimingId": "sub.dialogue.asha.market_intro.ambient_day",
      "tags": ["ambient", "day"]
    },
    {
      "id": "n.ambient_evening",
      "kind": "text",
      "speakerId": "npc.asha_storm",
      "lineId": "loc.dialogue.asha.market_intro.ambient_evening",
      "voiceCue": "/Game/V2/Audio/Voice/Dialogue/Asha/MarketIntro_AmbientEvening.MarketIntro_AmbientEvening",
      "subtitleTimingId": "sub.dialogue.asha.market_intro.ambient_evening",
      "tags": ["ambient", "evening"]
    },
    {
      "id": "n.relationship_check",
      "kind": "condition",
      "predicate": {
        "any": [
          {
            "ref": "relationship_value",
            "targetId": "npc.asha_storm",
            "operator": ">=",
            "value": 25
          },
          {
            "ref": "choice_history",
            "choiceId": "choice.ask_route",
            "seen": true
          }
        ]
      }
    },
    {
      "id": "n.trusted_action",
      "kind": "action",
      "actions": [
        {
          "ref": "modify_relationship",
          "targetId": "npc.asha_storm",
          "delta": 1
        },
        {
          "ref": "play_animation",
          "participantId": "npc.asha_storm",
          "animationId": "Anim.Dialogue.Asha.PointToMarket"
        },
        {
          "ref": "grant_item",
          "itemId": "Item.MarketToken",
          "quantity": 1
        },
        {
          "ref": "spawn_entity",
          "entityId": "Entity.MarketGuideMarker",
          "spawnPointId": "Spawn.Market.RouteGuide",
          "count": 1
        }
      ]
    },
    {
      "id": "n.end",
      "kind": "text",
      "speakerId": "npc.asha_storm",
      "lineId": "loc.dialogue.asha.market_intro.end",
      "voiceCue": "/Game/V2/Audio/Voice/Dialogue/Asha/MarketIntro_End.MarketIntro_End",
      "subtitleTimingId": "sub.dialogue.asha.market_intro.end",
      "terminal": true,
      "tags": ["farewell"]
    }
  ],
  "edges": [
    {
      "id": "e.start.to_choice",
      "from": "n.start",
      "to": "n.player_choice",
      "priority": 0,
      "conditions": []
    },
    {
      "id": "e.choice.ask_route",
      "from": "n.player_choice",
      "to": "n.route_available",
      "priority": 0,
      "choiceId": "choice.ask_route",
      "choiceLineId": "loc.dialogue.player.market_intro.choice.ask_route",
      "choiceTags": ["quest"],
      "conditions": [
        {
          "ref": "inventory_count",
          "itemId": "Item.MarketMap",
          "operator": "<",
          "value": 1
        }
      ]
    },
    {
      "id": "e.choice.small_talk",
      "from": "n.player_choice",
      "to": "n.ambient_variant",
      "priority": 1,
      "choiceId": "choice.small_talk",
      "choiceLineId": "loc.dialogue.player.market_intro.choice.small_talk",
      "choiceTags": ["ambient"],
      "conditions": [
        {
          "ref": "player_stat",
          "statId": "Stat.Social",
          "operator": ">=",
          "value": 1
        }
      ]
    },
    {
      "id": "e.route_available.true",
      "from": "n.route_available",
      "to": "n.grant_route",
      "priority": 0,
      "conditions": []
    },
    {
      "id": "e.route_available.false",
      "from": "n.route_available",
      "to": "n.route_repeat",
      "priority": 1,
      "conditions": [
        {
          "ref": "persistent_variable",
          "scope": "npc.asha_storm",
          "name": "market_intro_completed",
          "equals": true
        }
      ]
    },
    {
      "id": "e.grant_route.to_response",
      "from": "n.grant_route",
      "to": "n.route_response",
      "priority": 0,
      "conditions": []
    },
    {
      "id": "e.ambient.day",
      "from": "n.ambient_variant",
      "to": "n.ambient_day",
      "priority": 0,
      "weight": 60,
      "conditions": [
        {
          "ref": "time_of_day",
          "range": "day"
        }
      ]
    },
    {
      "id": "e.ambient.evening",
      "from": "n.ambient_variant",
      "to": "n.ambient_evening",
      "priority": 1,
      "weight": 40,
      "conditions": [
        {
          "ref": "time_of_day",
          "range": "evening"
        },
        {
          "ref": "local_variable",
          "name": "asked_for_route",
          "equals": false
        }
      ]
    },
    {
      "id": "e.route_response.to_relationship_check",
      "from": "n.route_response",
      "to": "n.relationship_check",
      "priority": 0,
      "conditions": []
    },
    {
      "id": "e.relationship.trusted",
      "from": "n.relationship_check",
      "to": "n.trusted_action",
      "priority": 0,
      "conditions": []
    },
    {
      "id": "e.relationship.default",
      "from": "n.relationship_check",
      "to": "n.end",
      "priority": 1,
      "conditions": []
    },
    {
      "id": "e.trusted.to_end",
      "from": "n.trusted_action",
      "to": "n.end",
      "priority": 0,
      "conditions": []
    },
    {
      "id": "e.route_repeat.to_end",
      "from": "n.route_repeat",
      "to": "n.end",
      "priority": 0,
      "conditions": []
    },
    {
      "id": "e.ambient_day.to_end",
      "from": "n.ambient_day",
      "to": "n.end",
      "priority": 0,
      "conditions": []
    },
    {
      "id": "e.ambient_evening.to_end",
      "from": "n.ambient_evening",
      "to": "n.end",
      "priority": 0,
      "conditions": []
    }
  ],
  "localization": {
    "sourceLocale": "en-US",
    "requiredLineIds": [
      "loc.dialogue.speaker.player",
      "loc.dialogue.character.asha_storm.name",
      "loc.dialogue.asha.market_intro.start",
      "loc.dialogue.player.market_intro.prompt",
      "loc.dialogue.player.market_intro.choice.ask_route",
      "loc.dialogue.player.market_intro.choice.small_talk",
      "loc.dialogue.asha.market_intro.route_response",
      "loc.dialogue.asha.market_intro.route_repeat",
      "loc.dialogue.asha.market_intro.ambient_day",
      "loc.dialogue.asha.market_intro.ambient_evening",
      "loc.dialogue.asha.market_intro.end"
    ]
  },
  "voice": {
    "voiceBankRoot": "/Game/V2/Audio/Voice/Dialogue",
    "requiredCueFields": ["voiceCue", "subtitleTimingId"],
    "fallbackPolicy": "localized_subtitle"
  },
  "metadata": {
    "authoringOwner": "Narrative",
    "reviewStatus": "schema-fixture",
    "defaultPriority": "normal",
    "tags": ["hub", "asha_storm", "market"]
  }
}
