--ambush
--Qsik
--8-24-06

**************** CORE LEVEL CREATION STARTS **************
**************** CORE LEVEL CREATION STARTS **************
**************** CORE LEVEL CREATION STARTS **************
clear resources from last level

total memory cleanup
set activeworld 1
resetworld 1

load basic configuration

set landpatch land_fatalcause_31a
set landdeform off
set landheightmap heightmap_fatalcause31a

set minnewfogdistance 50000
set maxviewdistance 80000

**** RESOURCE PACK FILES START
if highmodeldetail
    load resourcepack http://internallink1/ql_highres_modelspack.cct slot1 highres_models
end if
if lowmodeldetail
    load resourcepack http://internallink1/ql_lowres_modelspack.cct slot1 lowres_models
end if

if highterraindetail
    load resourcepack http://internallink2/ql_highresterrain_fatalcause31a.cct slot2 highres_terrain
    load media http://quantumlegacy.net/devteam/skytutorial/night/default_ql_level_backdrop.jpg slot1 sky1
end if
if mediumterraindetail
    load resourcepack http://internallink2/ql_medresterrain_fatalcause31a.cct slot2 medres_terrain
    load media http://quantumlegacy.net/devteam/skytutorial/night/default_ql_level_backdrop_1024.jpg slot1 sky2
end if
if lowterraindetail
    load resourcepack http://internallink2/ql_lowresterrain_fatalcause31a.cct slot2 lowres_terrain
end if

load texturepack http://internallink1/ql_mega_texturepack.cct slot3 textures

load resourcepack http://internallink1/ql_soundpack_blairgeneral.cct slot4 character_speech
load resourcepack http://internallink1/ql_soundpack_computer.cct slot5 computer_speech
load resourcepack http://internallink1/ql_soundpack_unitvoices.cct slot6 unit_speech

load resourcepack http://internallink1/ql_musicpack1.cct slot10 music_pack1
load resourcepack http://internallink1/ql_musicpack2.cct slot11 music_pack2
if nonwebversion
    load resourcepack http://internallink1/ql_musicpack3.cct slot12 music_pack3
end if

createmodel player17 resourcepod vector(91269,69187,900) -11.2348 1.0000 [1]
createmodel player17 resourcepod vector(125749,43617,1062) 151.3463 1.0000 [1]
createmodel player17 resourcepod vector(47519,49250,1009) 15.3200 1.0000 [1]
createmodel player17 resourcepod vector(58069,100027,1258) -45.6204 1.0000 [1]
createmodel player17 resourcepod vector(152321,123338,2023) -146.5395 1.0000 [1]

**** RESOURCE PACK FILES END

--NIGHT SKY: FINAL
set skycolor rgb(2,7,29)

set weather rain
prepare landpatch

load basic variables

load basic models
load minimap

movemodel sky01 vector(0,0,30000)
movemodel sky02 vector(0,0,30000)

if displayextramodels
createmodel player16 s_tree02 vector(45274,10528,-2391) 78.5949 10.5809 [1]
createmodel player16 s_tree01 vector(138866,11913,-3897) 115.6008 11.3906 [1]
createmodel player16 s_tree02 vector(185522,83468,1904) 163.7160 7.4120 [1]
createmodel player16 s_tree02 vector(186906,137497,1980) -165.3351 8.3531 [1]
createmodel player16 s_tree01 vector(149123,217927,-7096) -116.4490 12.9227 [1]
createmodel player16 s_tree02 vector(17435,182521,2508) -18.0229 9.0428 [1]
createmodel player16 s_tree02 vector(28650,113440,2514) 37.5273 8.1722 [1]
createmodel player16 s_tree01 vector(10407,67638,-14) 40.1162 7.9581 [1]
createmodel player16 s_tree02 vector(68799,217123,-1425) -48.8089 11.0523 [1]
--last batch of "patch trees" below
createmodel player16 s_tree02 vector(91217,86906,918) -52.9820 4.0429 [1]
createmodel player16 s_tree01 vector(140797,134324,2088) -146.8343 5.0039 [1]
createmodel player16 s_tree01 vector(49806,133116,2619) -4.4790 4.8231 [1]
end if

if displayextramodels and highterraindetail
createmodel player16 s_tree01 vector(-21719,221998,-4691) -60.3022 11.1639 [1]
createmodel player16 s_tree01 vector(-28098,69163,-6791) 179.3978 11.9371 [1]
createmodel player16 s_tree01 vector(-18549,-26688,-6311) -159.3472 13.7827 [1]
createmodel player16 s_tree02 vector(120194,-35447,-8763) 142.1678 13.7827 [1]
createmodel player16 s_tree02 vector(222009,-21740,-3476) 159.5930 12.5297 [1]
createmodel player16 s_tree01 vector(231875,136156,-5772) 35.4622 12.3311 [1]
createmodel player16 s_tree02 vector(203606,205186,-2016) -41.3528 10.1073 [1]
end if

set activeworld 1

positioncamera vector(1.48241e5,1.24339e5,-100.0000) vector(0.0000,0.0000,9.8436) vector(0.0000,-2.70000e4,1.61157e4) vector(0.0000,0.0000,0.0000)

clear startingunit
add startingunit epsilon

set maxplayers 1

createmodel player3 gammacruiser vector(169305,122363,2674) 9.8436 1.0000 [1]

**************** CORE LEVEL CREATION ENDS **************
**************** CORE LEVEL CREATION ENDS **************
**************** CORE LEVEL CREATION ENDS **************
if timer 1 >= 0
    playercantarget 1 1 [1,2]
    playercantarget 1 2 [1,3]
    playercantarget 1 3 [2]
    playercanselect 1 1 [1,3,7]
    set ambientlight rgb(110,110,255)
    set light rgb(0,0,100)
    cleartasks 1 1
    set flag 1 to 1
    set flag 2 to 0
    reset timer 1
    reset timer 2
    reset timer 38
end if

if gamedifficulty = easy
    settechlevel 1 1  [0,1,2,3,4,5,6,7,9,11,14]
    setmaxunits 1 1 30
    setplayermoney 1 1 9000
end if

if gamedifficulty = medium
    settechlevel 1 1  [0,1,2,3,4,5,6,7,9,11,14]
    setmaxunits 1 1 25
    setplayermoney 1 1 6000
end if

if gamedifficulty = hard
    settechlevel 1 1  [0,1,2,3,4,5,6,7,9,11,14]
    setmaxunits 1 1 25
    setplayermoney 1 1 3000
end if

if flag 1 = 1
and timer 1 >= 10000
and soundchannel 1 is free
    playglobalsound 1 99 computer030
    comsatline Computer: Battle control, online. rgb(255,255,0)
    set flag 1 to 2 
    reset timer 1
end if

if flag 1 = 2
and timer 1 >= 5000
and soundchannel 1 is free
   playglobalsound 3 99 threebeeps01
   comsatline >> Col. Blair: Commander, you have been sent here to escort transport Delta to the adjacent sector. We are not anticipating any problems, the mission should go smoothly without interruptions. rgb(255,255,255)
   set flag 1 to 3
   reset timer 1
end if

if flag 1 = 3
and timer 1 >= 15000
and soundchannel 1 is free
   cleartasks 1 1
   addtask 1 1 defend_dropship pending primary escort and protect transport Delta
   addtask 1 p1real hold_sector pending secondary establish a base
   playglobalsound 1 99 computer011
   comsatline Computer: New task confirmed. rgb(255,255,0)
   highlighthud tasks
   set flag 1 to 4
   reset timer 1
end if

if flag 1 = 4
and timer 1 >= 3000
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Commander, I suggest we set up a base and send some offensive units over to transport Delta just in case. You have 4 minutes to set up before transport Delta is ready to go. rgb(255,255,255)
    set flag 1 to 5
    reset timer 1
end if

if flag 1 = 5
and timer 1 >= 240000
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: We are ready to go Colonel. Thank you for your help, but we don't think it will be needed. rgb(0,255,0)
    set flag 1 to 6
    reset timer 1
end if

if flag 1 = 6
and timer 1 >= 10000
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Alright commander, I am marking transport Delta's path with a checkpoint. Move to the checkpoint on your screen now. rgb(255,255,255)
    set flag 1 to 7
    reset timer 1
end if

if flag 1 = 7 
and timer 1 >= 3000
and soundchannel 1 is free
    createunit 1 6 checkpoint01 vector(147059,114887,1716) 0 14 0 -1 0
    playglobalsound 1 99 computer006
    comsatline Computer: New checkpoint detected. rgb(255,255,0)
    radarbeacon 1 lastvector 10000
    set flag 1 to 8
    reset timer 1
end if

if flag 1 = 8
and timer 1 <= 1000000
and distancebetween 1 6 1 1 3 any <= 2000
and soundchannel 1 is free
    setunitstate 1 6 1 69 0 -1
    playglobalsound 1 99 computer007
    comsatline Computer: Checkpoint reached. rgb(255,255,0)
    set flag 1 to 9
    reset timer 1
end if

if flag 1 = 9
and timer 1 >= 3000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: Colonel, we are picking up Globex scouts on radar! They will be here in seconds! rgb(0,255,0)
    set flag 1 to 10
    reset timer 1
end if

if flag 1 = 10
and timer 1 >= 8000
and gamedifficulty = easy
and soundchannel 1 is free
    createunit 1 2 forsydon vector(146633,117390,1975) 0 82 0 -1 0
    createunit 1 2 forsydon vector(147463,119332,2030) 0 82 0 -1 0
    createunit 1 2 forsydon vector(145120,118746,2068) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 11
    reset timer 1
end if

if flag 1 = 10
and timer 1 >= 8000
and gamedifficulty = medium
and soundchannel 1 is free
    createunit 1 2 tryphon vector(146633,117390,1975) 0 82 0 -1 0
    createunit 1 2 tryphon vector(147463,119332,2030) 0 82 0 -1 0
    createunit 1 2 tryphon vector(145120,118746,2068) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 11
    reset timer 1
end if

if flag 1 = 10
and timer 1 >= 8000
and gamedifficulty = hard
and soundchannel 1 is free
    createunit 1 2 bowgerus vector(146633,117390,1975) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(147463,119332,2030) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(145120,118746,2068) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 11
    reset timer 1
end if

if flag 1 = 11
and timer 1 >= 3000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: What the...!? Commander, protect that transport at all costs! rgb(255,255,255)
    set flag 1 to 12
    reset timer 1
end if

if flag 1 = 12
and timer 1 >= 7000
and playerhasunit 1 3 gammacruiser
and playerhasnounit 1 2 forsydon
and playerhasnounit 1 2 tryphon
and playerhasnounit 1 2 bowgerus
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01   
    comsatline >> Col. Blair: Carry on commander, but be wary and proceed with caution. rgb(255,255,255)
    set flag 1 to 13
    reset timer 1
end if

if flag 1 = 13
and timer 1 >= 3000
and soundchannel 1 is free
    createunit 1 6 checkpoint01 vector(106213,106723,2453) 0 14 0 -1 0
    playglobalsound 1 99 computer006  
    comsatline Computer: New checkpoint detected. rgb(255,255,0)
    radarbeacon 1 lastvector 10000
    set flag 1 to 14
    reset timer 1
end if

if flag 1 = 14
and timer 1 <= 1000000
and distancebetween 1 6 1 1 3 any <= 2000
and soundchannel 1 is free
    setunitstate 1 6 1 69 0 -1
    playglobalsound 1 99 computer007
    comsatline Computer: Checkpoint reached. rgb(255,255,0)
    set flag 1 to 15
    reset timer 1
end if

if flag 1 = 15
and timer 1 >= 3000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: Colonel, more Globex units! rgb(0,255,0)
    set flag 1 to 16
    reset timer 1
end if 

if flag 1 = 16
and timer 1 >= 5000
and gamedifficulty = easy
and soundchannel 1 is free
    createunit 1 2 forsydon vector(105980,109477,2705) 0 82 0 -1 0
    createunit 1 2 forsydon vector(107023,111035,2849) 0 82 0 -1 0
    createunit 1 2 forsydon vector(107964,112889,3019) 0 82 0 -1 0
    createunit 1 2 forsydon vector(104688,110528,2741) 0 82 0 -1 0
    createunit 1 2 forsydon vector(103422,111853,2809) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 17
    reset timer 1
end if

if flag 1 = 16
and timer 1 >= 5000
and gamedifficulty = medium
and soundchannel 1 is free
    createunit 1 2 tryphon vector(105980,109477,2705) 0 82 0 -1 0
    createunit 1 2 tryphon vector(107023,111035,2849) 0 82 0 -1 0
    createunit 1 2 tryphon vector(107964,112889,3019) 0 82 0 -1 0
    createunit 1 2 tryphon vector(104688,110528,2741) 0 82 0 -1 0
    createunit 1 2 tryphon vector(103422,111853,2809) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 17
    reset timer 1
end if

if flag 1 = 16
and timer 1 >= 5000
and gamedifficulty = hard
and soundchannel 1 is free
    createunit 1 2 bowgerus vector(105980,109477,2705) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(107023,111035,2849) 0 82 0 -1 0
    createunit 1 2 tryphon vector(107964,112889,3019) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(104688,110528,2741) 0 82 0 -1 0
    createunit 1 2 tryphon vector(103422,111853,2809) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 17
    reset timer 1
end if

if flag 1 = 17
and timer 1 >= 3000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01 
    comsatline >> Col. Blair: What the hell!? Why is Globex attacking us!? rgb(255,255,255)
    set flag 1 to 18
    reset timer 1
end if

if flag 1 = 18
and timer 1 >= 9000
and playerhasunit 1 3 gammacruiser
and playerhasnounit 1 2 forsydon 
and playerhasnounit 1 2 tryphon
and playerhasnounit 1 2 bowgerus
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Nice save commander, now let's hurry to get transport Delta to the adjacent sector so we can get the hell out of here! rgb(255,255,255)
    set flag 1 to 19
    reset timer 1 
end if

if flag 1 = 19
and timer 1 >= 10000
and soundchannel 1 is free
    createunit 1 6 checkpoint01 vector(60199,100216,1259) 0 14 0 -1 0
    playglobalsound 1 99 computer006  
    comsatline Computer: New checkpoint detected. rgb(255,255,0)
    radarbeacon 1 lastvector 10000
    set flag 1 to 20
    reset timer 1
end if

if flag 1 = 20
and timer 1 <= 1000000
and distancebetween 1 6 1 1 3 any <= 2000
and soundchannel 1 is free
    setunitstate 1 6 1 69 0 -1
    playglobalsound 1 99 computer007
    comsatline Computer: Checkpoint reached. rgb(255,255,0)
    set flag 1 to 21
    reset timer 1
end if

if flag 1 = 21
and timer 1 >= 3000
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: Another wave of units! rgb(0,255,0)
    set flag 1 to 22
    reset timer 1
end if

if flag 1 = 22
and timer 1 >= 3000
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Commander, you know what to do. rgb(255,255,255)
    set flag 1 to 23
    reset timer 1
end if

if flag 1 = 23
and timer 1 >= 3000
and gamedifficulty = easy
and soundchannel 1 is free
    createunit 1 2 omnithias vector(59598,105249,2733) 0 82 0 -1 0
    createunit 1 2 forsydon vector(59125,108610,1812) 0 82 0 -1 0
    createunit 1 2 forsydon vector(61372,106420,1703) 0 82 0 -1 0
    createunit 1 2 forsydon vector(57845,105582,1692) 0 82 0 -1 0
    createunit 1 2 forsydon vector(59986,103601,1581) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 24
    reset timer 1
end if

if flag 1 = 23
and timer 1 >= 3000
and gamedifficulty = medium
and soundchannel 1 is free
    createunit 1 2 omnithias vector(59598,105249,2733) 0 82 0 -1 0
    createunit 1 2 tryphon vector(59125,108610,1812) 0 82 0 -1 0
    createunit 1 2 tryphon vector(61372,106420,1703) 0 82 0 -1 0
    createunit 1 2 tryphon vector(57845,105582,1692) 0 82 0 -1 0
    createunit 1 2 tryphon vector(59986,103601,1581) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 24
    reset timer 1
end if

if flag 1 = 23
and timer 1 >= 3000
and gamedifficulty = hard
and soundchannel 1 is free
    createunit 1 2 omnithias vector(59598,105249,2733) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(59125,108610,1812) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(61372,106420,1703) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(57845,105582,1692) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(59986,103601,1581) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 24
    reset timer 1
end if

if flag 1 = 24
and timer 1 >= 15000
and playerhasunit 1 3 gammacruiser
and playerhasnounit 1 2 omnithias
and playerhasnounit 1 2 forsydon
and playerhasnounit 1 2 tryphon
and playerhasnounit 1 2 bowgerus
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Move quickly commander, our mission here is almost complete! rgb(255,255,255)
    set flag 1 to 25
    reset timer 1
end if 

if flag 1 = 25
and timer 1 >= 6000
and soundchannel 1 is free
    createunit 1 6 checkpoint01 vector(64916,57298,1223) 0 14 0 -1 0
    playglobalsound 1 99 computer006  
    comsatline Computer: New checkpoint detected. rgb(255,255,0)
    radarbeacon 1 lastvector 10000
    set flag 1 to 26
    reset timer 1
end if

if flag 1 = 26
and timer 1 <= 1000000
and distancebetween 1 6 1 1 3 any <= 2000
and soundchannel 1 is free
    setunitstate 1 6 1 69 0 -1
    playglobalsound 1 99 computer007
    comsatline Computer: Checkpoint reached. rgb(255,255,0)
    set flag 1 to 27
    reset timer 1
end if

if flag 1 = 27
and timer 1 >= 3000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: Colonel, just take care of this last wave of enemy units and you will be home-free! rgb(0,255,0)
    set flag 1 to 28
    reset timer 1
end if

if flag 1 = 28
and timer 1 >= 9000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: You heard them commander, we can go home after we protect them from this last attack. rgb(255,255,255)
    set flag 1 to 29
    reset timer 1
end if

if flag 1 = 29
and timer 1 >= 8000
and gamedifficulty = easy
and soundchannel 1 is free
    createunit 1 2 omnithias vector(59009,63656,2517) 0 82 0 -1 0
    createunit 1 2 omnithias vector(60506,56177,2611) 0 82 0 -1 0
    createunit 1 2 forsydon vector(59424,61976,1462) 0 82 0 -1 0
    createunit 1 2 forsydon vector(60690,64348,1414) 0 82 0 -1 0
    createunit 1 2 forsydon vector(58465,68257,1408) 0 82 0 -1 0
    createunit 1 2 forsydon vector(56806,64274,1452) 0 82 0 -1 0
    createunit 1 2 forsydon vector(60032,59526,1493) 0 82 0 -1 0
    createunit 1 2 forsydon vector(62484,57619,1481) 0 82 0 -1 0
    createunit 1 2 forsydon vector(58499,56730,1549) 0 82 0 -1 0
    createunit 1 2 forsydon vector(60835,54268,1554) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 30
    reset timer 1
end if

if flag 1 = 29
and timer 1 >= 8000
and gamedifficulty = medium
and soundchannel 1 is free
    createunit 1 2 omnithias vector(59009,63656,2517) 0 82 0 -1 0
    createunit 1 2 omnithias vector(60506,56177,2611) 0 82 0 -1 0
    createunit 1 2 tryphon vector(59424,61976,1462) 0 82 0 -1 0
    createunit 1 2 tryphon vector(60690,64348,1414) 0 82 0 -1 0
    createunit 1 2 tryphon vector(58465,68257,1408) 0 82 0 -1 0
    createunit 1 2 tryphon vector(56806,64274,1452) 0 82 0 -1 0
    createunit 1 2 tryphon vector(60032,59526,1493) 0 82 0 -1 0
    createunit 1 2 tryphon vector(62484,57619,1481) 0 82 0 -1 0
    createunit 1 2 tryphon vector(58499,56730,1549) 0 82 0 -1 0
    createunit 1 2 tryphon vector(60835,54268,1554) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 30
    reset timer 1
end if

if flag 1 = 29
and timer 1 >= 8000
and gamedifficulty = hard
and soundchannel 1 is free
    createunit 1 2 omnithias vector(59009,63656,2517) 0 82 0 -1 0
    createunit 1 2 omnithias vector(60506,56177,2611) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(59424,61976,1462) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(60690,64348,1414) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(58465,68257,1408) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(56806,64274,1452) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(60032,59526,1493) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(62484,57619,1481) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(58499,56730,1549) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(60835,54268,1554) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 1 100 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 30
    reset timer 1
end if

if flag 1 = 30
and timer 1 >= 3000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Seems Globex is desperate to prevent transport Delta from getting to FTA command...I wonder why. rgb(255,255,255)
    set flag 1 to 31
    reset timer 1
end if 

if flag 1 = 31
and timer 1 >= 10000
and playerhasunit 1 3 gammacruiser
and playerhasnounit 1 2 omnithias
and playerhasnounit 1 2 forsydon
and playerhasnounit 1 2 tryphon
and playerhasnounit 1 2 bowgerus
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: You've repelled their attack commander, now transport Delta can get to the adjacent sector and we can get out of here. rgb(255,255,255)
    set flag 1 to 32
    reset timer 1
end if 

if flag 1 = 32
and timer 1 >= 10000
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: Thanks for the escort Colonel, see you later. rgb(0,255,0)
    set flag 1 to 33
    reset timer 1
end if

if flag 1 = 33
and timer 1 >= 3000
    createunit 1 7 turbine vector(71235,33617,1499) 0 82 0 -1 0
    createunit 1 7 turbine vector(67085,32967,1473) 0 82 0 -1 0
    createunit 1 7 ftatransportgate vector(69044,33127,1469) 0 82 0 -1 0
    set flag 1 to 34
    reset timer 1
end if

if flag 1 = 34 
and timer 1 >=3000
and playerhasunit 1 1 epsilon
and playerhasnounit 1 3 gammacruiser
and soundchannel 1 is free   
    setunitstate 1 7 1 69 0 -1
    setunitstate 1 7 2 69 0 -1
    setunitstate 1 7 3 69 0 -1
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Let's go home commander. rgb(255,255,255)
    set flag 1 to 35
    reset timer 1
end if

if flag 1 = 35 
and timer 1 >=5000
and soundchannel 1 is free   
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Wait...we're picking up some radar signatures...it's a huge Globex force! Commander, call back all forces and make as many defensive units as possible, this is gonna get ugly! rgb(255,255,255)
    set flag 1 to 36
    reset timer 1
end if

if flag 1 = 36
and timer 1 >= 15000
and soundchannel 1 is free
    changetask 1 1 defend_dropship complete
    changetask 1 1 hold_sector complete
    playglobalsound 1 99 computer009
    comsatline Computer: Objective complete. rgb(255,255,0)
    highlighthud tasks
    set flag 1 to 37
    reset timer 1
end if

if flag 1 = 37
and timer 1 >=1000
and soundchannel 1 is free
    addtask 1 1 defend_dropship pending primary protect Epsilon at all costs
    addtask 1 p1real hold_sector pending secondary defend the base at all costs
    playglobalsound 1 99 computer008
    comsatline Computer: New objective detected. rgb(255,255,0)
    highlighthud tasks
    set flag 1 to 38
    reset timer 1
end if

if flag 1 = 38
and timer 1 >= 3000
and gamedifficulty = easy
and soundchannel 1 is free 
    createunit 1 2 omnithias vector(163499,148057,4107) 0 82 0 -1 0
    createunit 1 2 omnithias vector(169721,150638,4251) 0 82 0 -1 0
    createunit 1 2 omnithias vector(157380,148062,4282) 0 82 0 -1 0
    createunit 1 2 forsydon vector(155480,148109,3372) 0 82 0 -1 0
    createunit 1 2 forsydon vector(162921,152299,3376) 0 82 0 -1 0
    createunit 1 2 forsydon vector(165546,149887,3164) 0 82 0 -1 0
    createunit 1 2 forsydon vector(163794,146642,3009) 0 82 0 -1 0
    createunit 1 2 forsydon vector(171580,152608,3232) 0 82 0 -1 0
    createunit 1 2 forsydon vector(170055,149073,3099) 0 82 0 -1 0
    createunit 1 2 forsydon vector(167579,151331,3230) 0 82 0 -1 0
    createunit 1 2 forsydon vector(159029,148955,3205) 0 82 0 -1 0
    createunit 1 2 forsydon vector(157803,146447,3095) 0 82 0 -1 0    
    createunit 1 2 forsydon vector(156991,151638,3454) 0 82 0 -1 0
    createunit 1 2 forsydon vector(169140,154082,3843) 0 82 0 -1 0
    createunit 1 2 forsydon vector(155456,148968,3323) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 0
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb(255,255,0)
    set flag 1 to 39
    reset timer 1
end if

if flag 1 = 38
and timer 1 >= 3000
and gamedifficulty = medium
and soundchannel 1 is free 
    createunit 1 2 omnithias vector(163499,148057,4107) 0 82 0 -1 0
    createunit 1 2 omnithias vector(169721,150638,4251) 0 82 0 -1 0
    createunit 1 2 omnithias vector(157380,148062,4282) 0 82 0 -1 0
    createunit 1 2 tryphon vector(155480,148109,3372) 0 82 0 -1 0
    createunit 1 2 tryphon vector(162921,152299,3376) 0 82 0 -1 0
    createunit 1 2 tryphon vector(165546,149887,3164) 0 82 0 -1 0
    createunit 1 2 tryphon vector(163794,146642,3009) 0 82 0 -1 0
    createunit 1 2 tryphon vector(171580,152608,3232) 0 82 0 -1 0
    createunit 1 2 tryphon vector(170055,149073,3099) 0 82 0 -1 0
    createunit 1 2 tryphon vector(167579,151331,3230) 0 82 0 -1 0
    createunit 1 2 tryphon vector(159029,148955,3205) 0 82 0 -1 0
    createunit 1 2 tryphon vector(157803,146447,3095) 0 82 0 -1 0    
    createunit 1 2 tryphon vector(156991,151638,3454) 0 82 0 -1 0
    createunit 1 2 tryphon vector(169140,154082,3843) 0 82 0 -1 0
    createunit 1 2 tryphon vector(155456,148968,3323) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 0
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb (255,255,0)
    set flag 1 to 39
    reset timer 1
end if

if flag 1 = 38
and timer 1 >= 3000
and gamedifficulty = hard
and soundchannel 1 is free 
    createunit 1 2 omnithias vector(163499,148057,4107) 0 82 0 -1 0
    createunit 1 2 omnithias vector(169721,150638,4251) 0 82 0 -1 0
    createunit 1 2 omnithias vector(157380,148062,4282) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(155480,148109,3372) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(162921,152299,3376) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(165546,149887,3164) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(163794,146642,3009) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(171580,152608,3232) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(170055,149073,3099) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(167579,151331,3230) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(159029,148955,3205) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(157803,146447,3095) 0 82 0 -1 0    
    createunit 1 2 bowgerus vector(156991,151638,3454) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(169140,154082,3843) 0 82 0 -1 0
    createunit 1 2 bowgerus vector(155456,148968,3323) 0 82 0 -1 0
    radarbeacon 1 lastvector 10000
    setai 1 2 0 
    playglobalsound 1 99 computer018
    comsatline Computer: New threat detected. rgb (255,255,0)
    set flag 1 to 39
    reset timer 1
end if

if flag 1 = 39
and timer 1 >= 3000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Globex General: All FTA units in the area, stand down! Give us your transport with stolen Globex data or be destroyed! rgb(255,0,0)
    set flag 1 to 40
    reset timer 1
end if

if flag 1 = 40
and timer 1 >= 10000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: This is Colonel Seth Blair of the Free Trade Alliance...transport with stolen data my ass, you probably came to destroy us and take over this sector! rgb(255,255,255)
    set flag 1 to 41
    reset timer 1
end if

if flag 1 = 41
and timer 1 >= 10000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Globex General: Correct Colonel, even though an FTA transport did steal some secret Globex data, we also came here to take over this sector! rgb(255,0,0)
    set flag 1 to 42
    reset timer 1
end if

if flag 1 = 42
and timer 1 >= 12000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: We will never give in to your demands! Do your worst, we will hold this sector or die trying! rgb(255,255,255)
    set flag 1 to 43
    reset timer 1
end if

if flag 1 = 43
and timer 1 >= 8000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Globex General: That's exactly what we intend to do, heh heh. But if dying is what you want, we'll gladly give it to you! rgb(255,0,0)
    set flag 1 to 44
    reset timer 1
end if

if flag 1 = 44
and timer 1 >= 12000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: What the hell!? Damn it! Commander, prepare for battle! rgb(255,255,255)
    set flag 1 to 45
    reset timer 1
end if

if flag 1 = 45
and timer 1 >= 10000
and soundchannel1 is free
    setai 1 2 1 100
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Here they come! rgb(255,255,255)
    setai 1 2 1 100
    set flag 1 to 46
    reset timer 1
end if

if flag 1 = 46
and timer 1 >= 3000
and soundchannel 1 is free
and playerhasnounit 1 2 omnithias
and playerhasnounit 1 2 forsydon
and playerhasnounit 1 2 tryphon
and playerhasnounit 1 2 bowgerus
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: I can't believe you actually did it! Great work commander, now lets go home. rgb(255,255,255)
    set flag 1 to 47
    reset timer 1 
end if

if flag 1 = 47
and timer 1 >= 7000
and soundchannel 1 is free     
    changetask 1 1 defend_dropship complete 
    changetask 1 1 hold_sector complete
    playglobalsound 1 99 computer016
    comsatline Computer: Mission successful. rgb(255,255,0)
    highlighthud tasks
end if

if flag 40 = 5
and playerhasnounit 1 1 epsilon
and soundchannel 1 is free
    playglobalsound 1 99 snd_blair_lost2
    comsatline >> Col. Blair: As far as I'm concerned, you were given a simple task: not let our forces be destroyed at the hands of the enemy. And you, blew it. I have nothing more to say to you at this point. You will hear the rest in my official report. Good day Commander. rgb(255,255,255)
    set flag 40 to 6
end if

if flag 40 = 6
and soundchannel 1 is free
    changetask 1 1 defend_dropship failed
    changetask 1 1 hold_sector failed
    playglobalsound 1 99 computer 015
    comsatline Computer: Mission Failed. rgb(255,255,0)
    highlighthud tasks
    comsatline ** Mission FAILED. Press Menu and Exit when ready. rgb(0,255,0)
end if
    
if flag 2 = 0
and unitstate 1 3 1 < 80
and unithealth 1 3 1 < 95%
    set flag 2 to 1
    reset timer 2
    repeat this if
end if

if flag 2 = 1
and unitstate 1 3 1 < 80
and unithealth 1 3 1 < 95%
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: We're taking some light damage Colonel! rgb(0,255,0)
    set flag 2 to 2
    reset timer 2
    repeat this if
end if

if flag 2 = 2
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Commander, transport Delta needs some support. Make some units and send them over, quickly! rgb(255,255,255)
    set flag 2 to 3
    reset timer 2
    repeat this if
end if

if flag 2 = 3
and unitstate 1 3 1 < 80
and unithealth 1 3 1 < 70%
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: We need some reinforcements over here! rgb(0,255,0)
    set flag 2 to 4
    reset timer 2
    repeat this if
end if

if flag 2 = 4
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Commander, get moving! We cannot afford to lose transport Delta! rgb(255,255,255)
    set flag 2 to 5
    reset timer 2    
    repeat this if
end if

if flag 2 = 5
and unitstate 1 3 1 < 80
and unithealth 1 3 1 < 50%
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: Colonel! We need some support, now!!! rgb(0,255,0)
    set flag 2 to 6
    reset timer 2
    repeat this if
end if

if flag 2 = 6
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Commander! Where are those units!? Get moving!!! rgb(255,255,255)
    set flag 2 to 7
    reset timer 2
    repeat this if
end if

if flag 2 = 7
and unitstate 1 3 1 < 80
and unithealth 1 3 1 < 30%
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Transport Delta: Colonel we're almost at critical...where's are help!? rgb(0,255,0)
    set flag 2 to 8
    reset timer 2
    repeat this if
end if

if flag 2 = 8
and soundchannel1 is free
    playglobalsound 3 99 threebeeps01
    comsatline >> Col. Blair: Commander, move your ass or the council will have mine!!! rgb(255,255,255)
    set flag 2 to 9
    reset timer 2
    repeat this if
end if

if flag 2 = 9
and playerhasnounit 1 3 gammacruiser
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01 
    comsatline >> Col. Blair: You lost transport Delta!!! Now the council will have my ass and you will be relieved of your command! I am shocked by your absurd stupidity...I hope we will never meet again!!! rgb(255,255,255)
    set flag 2 to 10
    reset timer 2
end if

if flag 2 = 10
and timer 2 >= 15000
and soundchannel1 is free
    changetask 1 1 defend_dropship failed
    playglobalsound 1 99 computer 015
    comsatline Computer: Mission Failed. rgb(255,255,0)
    highlighthud tasks
    comsatline ** Mission FAILED. Press Menu and Exit when ready. rgb(0,255,0)
end if
 
**************** START LIGHTNING ****************

if flag 38 = 4
and timer 38 >= 0
    set light rgb(0,0,100)
    set flag 38 to 0
    reset timer 38
    force events
    repeat this if
end if
if flag 38 = 3
and timer 38 >= 0
    set light rgb(1,1,255)
    set flag 38 + 1
    reset timer 38
    force events
    repeat this if
end if
if flag 38 = 2
and timer 38 >= 0
    set light rgb(1,1,150)
    set flag 38 + 1
    reset timer 38
    force events
    repeat this if
end if
if flag 38 = 1
and timer 38 >= 0
    set light rgb(0,0,100)
    set flag 38 + 1
    reset timer 38
    force events
    repeat this if
end if
if flag 38 = 0
and timer 38 >= 15000+(random(7)*1000)
    playglobalsound 3 99 thunder1 thunder2
    set light rgb(1,1,255)
    set flag 38 + 1
    reset timer 38
    force events
    repeat this if
end if

**************** END LIGHTENING ****************

**************** MUSIC ****************

if soundchannel 8 is free
    addmusic ql_track_6a
    addmusic ql_track_9a
    addmusic ql_track_10a
    addmusic ql_track_8c
    addmusic ql_track_6c
    addmusic ql_track_10b
    addmusic ql_track_9b
    addmusic ql_track_12b
    addmusic ql_track_11b
    addmusic ql_track_8a
    addmusic ql_track_6b
    addmusic ql_track_10c
    addmusic ql_track_12a
    addmusic ql_track_8b
    addmusic ql_track_11a
    pause between tracks 10000
end if

**************** END MUSIC ****************

**************** COMPUTER VOICES ****************

if timer 39 >= 0
    reset timer 39
endif

if timer 40 >= 0
    set flag 40 to 0
    reset timer 40
endif

if unitstate 1 1 1 < 80
and timer 39 >= 180000
and playerpower < 200
and playerpower > 0
and soundchannel 1 is free
    playglobalsound 2 99 computer025
    comsatline Computer: Low Power. rgb(255,255,0)
    highlighthud power
    reset timer 39
    repeat this if
end if

if unitstate 1 1 1 < 80
and timer 40 >= 60000
and playerpower <= 0
and soundchannel 1 is free
    playglobalsound 2 99 computer026
    comsatline Computer: New generators required. rgb(255,255,0)
    highlighthud power
    reset timer 40
    repeat this if
end if

if flag 40 = 0
and unitstate 1 1 1 < 80
and unithealth 1 1 1 < 95%
    set flag 40 to 1
    repeat this if
end if

if flag 40 = 1
and unitstate 1 1 1 < 80
and unithealth 1 1 1 < 95%
and soundchannel 1 is free
    playglobalsound 2 99 computer034
    comsatline Computer: Drop-ship under fire. rgb(255,255,0)
    set flag 40 to 2
    repeat this if
end if

if flag 40 = 2
and unitstate 1 1 1 < 80
and unithealth 1 1 1 < 70%
and soundchannel 1 is free
    playglobalsound 2 99 computer034
    comsatline Computer: Drop-ship under fire. rgb(255,255,0)
    set flag 40 to 3
    repeat this if
end if

if flag 40 = 3
and unitstate 1 1 1 < 80
and unithealth 1 1 1 < 50%
and soundchannel 1 is free
    playglobalsound 2 99 computer034
    comsatline Computer: Drop-ship under fire. rgb(255,255,0)
    set flag 40 to 4
    repeat this if
end if

if flag 40 = 4
and unitstate 1 1 1 < 80
and unithealth 1 1 1 < 30%
and soundchannel 1 is free
    playglobalsound 2 99 computer034
    comsatline Computer: Drop-ship under fire. rgb(255,255,0)
    set flag 40 to 5
    repeat this if
end if

**************** END COMPUTER VOICES ****************
