[
  {
    "type": "effect_on_condition",
    "id": "EOC_PLAYER_IN_FORGE",
    "recurrence": "30 minutes",
    "condition": {
      "or": [
        { "u_at_om_location": "forge_x0y0z0" },
        { "u_at_om_location": "forge_x1y0z0" },
        { "u_at_om_location": "forge_x2y0z0" },
        { "u_at_om_location": "forge_x3y0z0" },
        { "u_at_om_location": "forge_x0y1z0" },
        { "u_at_om_location": "forge_x1y1z0" },
        { "u_at_om_location": "forge_x2y1z0" },
        { "u_at_om_location": "forge_x3y1z0" },
        { "u_at_om_location": "forge_x0y2z0" },
        { "u_at_om_location": "forge_x1y2z0" },
        { "u_at_om_location": "forge_x2y2z0" },
        { "u_at_om_location": "forge_x3y2z0" },
        { "u_at_om_location": "forge_x0y3z0" },
        { "u_at_om_location": "forge_x1y3z0" },
        { "u_at_om_location": "forge_x2y3z0" },
        { "u_at_om_location": "forge_x3y3z0" },
        { "u_at_om_location": "forge_x0y0z1" },
        { "u_at_om_location": "forge_x1y0z1" },
        { "u_at_om_location": "forge_x2y0z1" },
        { "u_at_om_location": "forge_x3y0z1" },
        { "u_at_om_location": "forge_x0y1z1" },
        { "u_at_om_location": "forge_x1y1z1" },
        { "u_at_om_location": "forge_x2y1z1" },
        { "u_at_om_location": "forge_x3y1z1" },
        { "u_at_om_location": "forge_x0y2z1" },
        { "u_at_om_location": "forge_x1y2z1" },
        { "u_at_om_location": "forge_x2y2z1" },
        { "u_at_om_location": "forge_x3y2z1" },
        { "u_at_om_location": "forge_x0y3z1" },
        { "u_at_om_location": "forge_x1y3z1" },
        { "u_at_om_location": "forge_x2y3z1" },
        { "u_at_om_location": "forge_x3y3z1" },
        { "u_at_om_location": "forge_x0y0z2" },
        { "u_at_om_location": "forge_x1y0z2" },
        { "u_at_om_location": "forge_x2y0z2" },
        { "u_at_om_location": "forge_x3y0z2" },
        { "u_at_om_location": "forge_x0y1z2" },
        { "u_at_om_location": "forge_x1y1z2" },
        { "u_at_om_location": "forge_x2y1z2" },
        { "u_at_om_location": "forge_x3y1z2" },
        { "u_at_om_location": "forge_x0y2z2" },
        { "u_at_om_location": "forge_x1y2z2" },
        { "u_at_om_location": "forge_x2y2z2" },
        { "u_at_om_location": "forge_x3y2z2" },
        { "u_at_om_location": "forge_x0y3z2" },
        { "u_at_om_location": "forge_x1y3z2" },
        { "u_at_om_location": "forge_x2y3z2" },
        { "u_at_om_location": "forge_x3y3z2" },
        { "u_at_om_location": "forge_x0y0z3" },
        { "u_at_om_location": "forge_x1y0z3" },
        { "u_at_om_location": "forge_x2y0z3" },
        { "u_at_om_location": "forge_x3y0z3" },
        { "u_at_om_location": "forge_x0y1z3" },
        { "u_at_om_location": "forge_x1y1z3" },
        { "u_at_om_location": "forge_x2y1z3" },
        { "u_at_om_location": "forge_x3y1z3" },
        { "u_at_om_location": "forge_x0y2z3" },
        { "u_at_om_location": "forge_x1y2z3" },
        { "u_at_om_location": "forge_x2y2z3" },
        { "u_at_om_location": "forge_x3y2z3" },
        { "u_at_om_location": "forge_x0y3z3" },
        { "u_at_om_location": "forge_x1y3z3" },
        { "u_at_om_location": "forge_x2y3z3" },
        { "u_at_om_location": "forge_x3y3z3" },
        { "u_at_om_location": "forge_x0y0z4" },
        { "u_at_om_location": "forge_x1y0z4" },
        { "u_at_om_location": "forge_x2y0z4" },
        { "u_at_om_location": "forge_x3y0z4" },
        { "u_at_om_location": "forge_x0y1z4" },
        { "u_at_om_location": "forge_x1y1z4" },
        { "u_at_om_location": "forge_x2y1z4" },
        { "u_at_om_location": "forge_x3y1z4" },
        { "u_at_om_location": "forge_x0y2z4" },
        { "u_at_om_location": "forge_x1y2z4" },
        { "u_at_om_location": "forge_x2y2z4" },
        { "u_at_om_location": "forge_x3y2z4" },
        { "u_at_om_location": "forge_x0y3z4" },
        { "u_at_om_location": "forge_x1y3z4" },
        { "u_at_om_location": "forge_x2y3z4" },
        { "u_at_om_location": "forge_x3y3z4" }
      ]
    },
    "effect": { "u_add_effect": "safe_shoppers", "duration": "60 minutes", "intensity": 1 }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_FORGE_GAME_LOAD",
    "eoc_type": "EVENT",
    "required_event": "game_load",
    "effect": { "run_eocs": [ "EOC_PLAYER_IN_FORGE" ] }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ENTER_FORGE",
    "effect": { "run_eocs": [ "EOC_FIND_FORGE_GATE", "EOC_PLAYER_IN_FORGE" ] }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_FIND_FORGE_GATE",
    "condition": { "math": [ "searched_forge != 1" ] },
    "effect": [
      {
        "u_location_variable": { "global_val": "loc_forge_of_wonders" },
        "target_params": { "om_terrain": "forge_x2y2z1", "z": 0 },
        "furniture": "f_magiclysm_greater_translocator_gate",
        "target_max_radius": 26
      },
      { "math": [ "searched_forge = 1" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VALIDATE_FORGE",
    "condition": { "math": [ "has_var(loc_forge_of_wonders)" ] },
    "false_effect": [
      { "u_message": "MANUALLY FINDING THE FORGE AS A FALLBACK (PRESS SPACE).", "popup": true },
      {
        "u_location_variable": { "global_val": "loc_forge_of_wonders" },
        "target_params": { "om_terrain": "forge_x2y2z1", "z": 0 },
        "furniture": "f_magiclysm_greater_translocator_gate",
        "target_max_radius": 26
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_FORGE_TELEPORT",
    "condition": { "and": [ "u_can_see", { "not": { "or": [ { "u_has_trait": "MUTE" }, { "u_has_trait": "ILLITERATE" } ] } } ] },
    "false_effect": { "u_message": "You need to be able to see, read, and speak to recite the incantation." },
    "effect": [
      { "run_eocs": "EOC_VALIDATE_FORGE" },
      { "u_consume_item": "forge_warp_scroll" },
      { "u_spawn_item": "forge_return_warp_scroll", "suppress_message": true },
      { "u_location_variable": { "u_val": "forge_return_point" }, "min_radius": 0, "max_radius": 0 },
      { "u_teleport": { "global_val": "loc_forge_of_wonders" } },
      {
        "u_message": "As you recite the incantation the runes on the scroll begin to shift.  And in the blink of an eye you are suddenly somewhere else.",
        "type": "good"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_FORGE_RETURN_TELEPORT",
    "condition": { "and": [ "u_can_see", { "not": { "or": [ { "u_has_trait": "MUTE" }, { "u_has_trait": "ILLITERATE" } ] } } ] },
    "false_effect": { "u_message": "You need to be able to see, read, and speak to recite the incantation." },
    "effect": [
      { "u_teleport": { "u_val": "forge_return_point" } },
      { "u_consume_item": "forge_return_warp_scroll" },
      {
        "u_message": "As you recite the incantation the scroll burns away in your hands.  And in the blink of an eye you are suddenly somewhere else.",
        "type": "good"
      }
    ]
  }
]
