MISSION_TEMPLATE

name:       "Harmony Patrol"
type:       PATROL
system:     Solus
region:     Solus
degrees:    true

alias:      { name: A1,  code: player_carrier    }
alias:      { name: A2,  code: player_squadron   }
alias:      { name: FC1, elem: "Solus-Kalon"     }
alias:      { name: FC2, elem: "Kalon-Solus"     }
alias:      { name: HS,  elem: "Harmony Station" }

callsign:   { name: Player,  iff: 1 }
callsign:   { name: Alpha,   iff: 2 }
callsign:   { name: Bravo,   iff: 2 }
callsign:   { name: Charlie, iff: 2 }
callsign:   { name: Echo,    iff: 2 }

ward: HS

element: {
   name:    Player,
   design:  Falcon,
   squadron: A2,
   commander: A1,
   region:  Solus,
   rloc:    { ref: A1, dex: 20e3, dex_var: 1e3 },
   mission: escort_freight,

   player:  1,
   alert:   true,
   count:   2,
   iff:     1,

   navpt:   { cmd: vector, rloc: { ref: FC1, dex: 25e3, dex_var:   0, az: 180, az_var: 10, el_var: 0 }, speed: 500, rgn: Solus }, // 1
   navpt:   { cmd: vector, rloc: { ref: FC2, dex: 30e3, dex_var:   0, az:   0, az_var: 30, el_var: 0 }, speed: 500, rgn: Kalon }, // 2
   navpt:   { cmd: defend, rloc: { ref: HS,  dex: 40e3, dex_var: 5e3, az:   0, az_var: 20, el_var: 2 }, speed: 500, rgn: Kalon }, // 3
   navpt:   { cmd: defend, rloc: { ref: HS,  dex: 40e3, dex_var: 5e3, az: 270, az_var: 20, el_var: 2 }, speed: 500, rgn: Kalon }, // 4
   navpt:   { cmd: defend, rloc: { ref: HS,  dex: 40e3, dex_var: 5e3, az: 180, az_var: 20, el_var: 2 }, speed: 500, rgn: Kalon }, // 5
   navpt:   { cmd: defend, rloc: { ref: HS,  dex: 40e3, dex_var: 5e3, az:  90, az_var: 20, el_var: 2 }, speed: 500, rgn: Kalon }, // 6

   navpt:   { cmd: vector, rloc: { ref: FC2, dex: 25e3, dex_var: 1e3, az: 180, az_var:  5, el_var: 0 }, speed: 500, rgn: Kalon }, // 7
   navpt:   { cmd: vector, rloc: { ref: A1,  dex: 60e3, dex_var: 5e3, az: 150, az_var:  5, el_var: 0 }, speed: 500, rgn: Solus }, // 8
   navpt:   { cmd: rtb,    rloc: { ref: A1,  dex: 20e3,               az: 180, az_var:  0, el_var: 0 }, speed: 250, rgn: Solus }, // 9
 
   objective: { cmd: patrol, tgt_desc: "inbound enemy units" },
   objective: { cmd: defend, tgt: HS },
   objective: { cmd: rtb },

   loadout: { ship: -1, name: "ACM Medium Range" },
}

optional: {
    min: 1,
    max: 2,

    element: {
       name:    Alpha,
       design:  Viper,
       region:  Kalon,
       rloc:    { ref: HS, dex: 135e3, az: 200, az_var: 30 },
       count:   2,
       iff:     2,
       loadout: { ship: -1, name: "ACM Medium Range" },
       intel:   known,

       navpt:   { cmd: intercept, tgt: Player, rloc: { ref: "Player:4", dex: 40e3, az: 200, az_var: 30 }, speed: 300, rgn: Kalon },
    },

    element: {
       name:    Bravo,
       design:  Razor,
       region:  Kalon,
       rloc:    { ref: HS, dex: 140e3, az: 180, az_var: 45 },
       count:   3,
       iff:     2,
       loadout: { ship: -1, name: "Hvy Ship Strike" },
       intel:   secret,

       navpt:   { cmd: assault, tgt: Ward1, rloc: { ref: "Player:5", dex: 20e3, az: 180, az_var: 20, el_var: 0 }, speed: 200, rgn: Kalon },
    },
}

optional: {
    min: 1,
    max: 2,

    element: {
       name:    Charlie,
       design:  Viper,
       region:  Kalon,
       rloc:    { ref: HS, dex: 135e3, az: 200, az_var: 30 },
       count:   2,
       iff:     2,
       loadout: { ship: -1, name: "ACM Medium Range" },
       intel:   known,

       navpt:   { cmd: intercept, tgt: Player, rloc: { ref: "Player:3", dex: 40e3, az: 200, az_var: 30 }, speed: 300, rgn: Kalon },
    },

    element: {
       name:    Echo,
       design:  Razor,
       region:  Kalon,
       rloc:    { ref: HS, dex: 140e3, az: 180, az_var: 45 },
       count:   3,
       iff:     2,
       loadout: { ship: -1, name: "Hvy Ship Strike" },
       intel:   secret,

       navpt:   { cmd: assault, tgt: Ward2, rloc: { ref: "Player:4", dex: 20e3, az: 180, az_var: 20, el_var: 0 }, speed: 200, rgn: Kalon   },
    },
}

element: {
   name:    Wolf1,
   design:  Wolf,
   iff:     2,
   region:  Jalah,
   loc:     (250e3, 250e3, 0),
   intel:   secret,
   hold:    60,

   objective: { cmd: assault, tgt: HS, rgn: Kalon },
}

element: {
   name:    Wolf2,
   design:  Wolf,
   iff:     2,
   region:  Jalah,
   loc:     (280e3, 280e3, 0),
   intel:   secret,
   hold:    60,

   objective: { cmd: assault, tgt: HS, rgn: Kalon },
}

event: {
   id:              1,
   event:           Hold,
   event_ship:      Wolf1,
   event_param:     0,

   trigger:         Navpoint,
   trigger_ship:    Player,
   trigger_param:   2,
}

event: {
   id:              2,
   event:           Hold,
   event_ship:      Wolf2,
   event_param:     0,

   trigger:         Navpoint,
   trigger_ship:    Player,
   trigger_param:   2,
}

event: {
   id:              10,
   event:           Message,
   event_ship:      Player,
   event_source:    HS,
   sound:           "Vox/Misc/A02-01.ogg",
   event_message:   "Mayday! Mayday! We are under attack!",

   trigger:         Navpoint,
   trigger_ship:    Player,
   trigger_param:   2,
   delay:           120,
}

event: {
   id:              20,
   event:           Jump,
   event_ship:      Stalwart,
   event_target:    Kalon,

   trigger:         Event,
   trigger_param:   10,
   delay:           15,
}

event: {
   id:              21,
   event:           Objective,
   event_ship:      Stalwart,
   event_param:     10,
   event_target:    Wolf1,

   trigger:         Event,
   trigger_param:   20,
   delay:           15,
}
