**************** CORE LEVEL CREATION STARTS **************
**************** CORE LEVEL CREATION STARTS **************
**************** CORE LEVEL CREATION STARTS **************
**************** CORE LEVEL CREATION STARTS **************
if timer 1 >= 0
    setplayermoney 1 player 15000
    setmaxmoney 1 player 20000
    setmaxunits 1 player 25
    addtask 1 p1real defend_dropship pending primary protect your drop-ship at all costs
    addtask 1 p1real hold_sector pending secondary establish a base, and defend this sector
against enemy forces
    setlevelname The Beginning 1.1
end if

if timer 1 >=0
playercantarget 1 1 [1,2,3,4,5,6,7,9,10]
playercantarget 1 3 [1]
playercantarget 1 5 [2]
playercantarget 1 6 [2]
playercantarget 1 7 [1]
playercantarget 1 8 [2]
playercantarget 2 1 [1,2,3,4,5,6,7,9,10]
playercantarget 2 3 [1]
playercantarget 2 5 [2]
playercantarget 2 6 [2]
playercantarget 2 7 [1]
playercantarget 2 8 [2]
end if

--BELOW we set the tech level so the Super-Mega weapons and Crysentos are excluded.

if timer 1 >=0 
    settechlevel 1 playernumber [0,1,2,4,5,6,11]
end if

--BELOW:BASIC MULTI-LEVEL 

clear resources from last level

L--below: we tell QL that 2 sectors will be used
--thus making this a multi-sector level
set totalsectors 2

if timer 1 >= 0
--below: sector the description for the sector jump in the format of: sectorjumpdescription timeperiod description
    sectorjumpdescription ALL sector-jump detected. location:
--below: the name of each sector, which will be stated after the description line above
    sectorname 1 sector 182
    sectorname 2 sector 184
--below: assign temporal mod to both sectors
--in this case, both sectors will have the mod of: 1
    settemporalmod 1 1 all
    settemporalmod 2 1 all
--below: hide the tactical window (the user should know how to use it by now):
    hide tactical
end if

--*********************************************                                                                       --*********************************************
--******** MAIN LEVEL CREATION *********                                                                        --******** MAIN LEVEL CREATION *********
--*********************************************                                                                       --*********************************************

--*********************************************                                                                       --*********************************************
--******** MAIN LEVEL CREATION *********                                                                        --******** MAIN LEVEL CREATION *********
--*********************************************                                                                       --*********************************************

total memory cleanup
set activeworld 1
resetworld 1

load basic configuration

set landpatch land01_gauntlet01
set landdeform off
set landheightmap heightmap_land01_gauntlet01

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_gauntlet.cct slot2 highres_terrain
end if
if mediumterraindetail
    load resourcepack http://internallink2/ql_medresterrain_gauntlet.cct slot2 medres_terrain
end if
if lowterraindetail
    load resourcepack http://internallink2/ql_lowresterrain_gauntlet.cct slot2 lowres_terrain
end if

prepare landpatch

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

**** RESOURCE PACK FILES END


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

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_tree01 vector(42277,5678,5802) 49.1531 7.8785 [1]
    createmodel player16 s_tree02 vector(9237,8989,5305) 52.1373 8.2402 [1]
    createmodel player16 s_tree01 vector(93644,7278,6176) 109.6968 6.6984 [1]
    createmodel player16 s_tree02 vector(89593,58163,6560) -153.4665 7.3682 [1]
    createmodel player16 s_tree01 vector(11336,52367,6596) 13.1747 7.4308 [1]
    createmodel player16 s_tree02 vector(20895,89737,5604) 61.6005 6.6041 [1]
    createmodel player16 s_tree02 vector(56054,84618,6220) -63.2465 4.4209 [1]
    createmodel player16 s_tree01 vector(83539,97381,3808) 108.4044 5.4805 [1]
    createmodel player16 s_tree01 vector(14167,126122,4603) -15.2061 7.4120 [1]
    createmodel player16 s_tree02 vector(65926,138017,2252) -112.1612 3.0452 [1]
    createmodel player16 s_tree02 vector(90036,161644,2110) -129.4645 6.1509 [1]
    createmodel player16 s_tree01 vector(46884,185268,598) -59.1424 6.6041 [1]
    createmodel player16 s_tree02 vector(10497,170268,6046) -3.8664 7.4734 [1]
    createmodel player16 s_tree01 vector(73820,194137,5297) -112.9796 7.3861 [1]
end if

if displayextramodels and highterraindetail
    createmodel player16 s_tree01 vector(-28224,-11550,-498) 34.2304 8.1050 [1]
    createmodel player16 s_tree02 vector(-23205,50852,-254) 1.0456 7.5178 [1]
    createmodel player16 s_tree01 vector(-33746,124664,-498) 90.4073 7.5178 [1]
    createmodel player16 s_tree01 vector(-13758,211992,-498) -69.7759 8.0904 [1]
    createmodel player16 s_tree02 vector(137160,94064,-254) 144.9643 7.5937 [1]
    createmodel player16 s_tree02 vector(134645,39216,-254) -125.1091 6.8344 [1]
    createmodel player16 s_tree01 vector(95164,-29119,-498) 112.5991 6.7660 [1]
end if

createmodel player17 resourcepod vector(63908,33841,814) 111.7321 1.0000 [1]
createmodel player17 resourcepod vector(73895,55185,2001) -108.8966 1.0000 [1]
createmodel player17 resourcepod vector(34644,83958,2365) 21.1525 1.0000 [1]

--below pods are only for multiplayer
createmodel player17 resourcepod vector(61984,115026,2238) -138.3424 1.0000 [1]
createmodel player17 resourcepod vector(43461,170011,433) -68.0440 1.0000 [1]
createmodel player17 resourcepod vector(77905,134459,1623) -116.7129 1.0000 [1]
createmodel player17 resourcepod vector(25333,120552,7543) -111.9873 1.0000 [1]
createmodel player17 resourcepod vector(76878,183906,6419) -111.3562 1.0000 [1]

set activeworld 1

positioncamera vector(1.01761e5,8.64233e4,-100.0000) vector(0.0000,0.0000,12.4016) vector(0.0000,-6.50000e4,1.17554e4) vector(0.0000,0.0000,0.0000)

clear startingunit

******************************
******************************
**** SECOND SECTOR ****
******************************
******************************

set activeworld 2

clear startingunit

load basic configuration
load basic models

set landpatch land01_allthings11
set landdeform off
set landheightmap heightmap_spring2k4_newland04

set minnewfogdistance 50000
set maxviewdistance 80000

**** RESOURCE PACK FILES START
if highterraindetail
load resourcepack http://internallink1/ql_highresterrain_allthings11.cct slot2 highres_terrain
end if
if mediumterraindetail
load resourcepack http://internallink1/ql_medresterrain_allthings11.cct slot2 medres_terrain
end if
if lowterraindetail
load resourcepack http://internallink1/ql_lowresterrain_allthings11.cct slot2 lowres_terrain
end if

prepare landpatch

**** RESOURCE PACK FILES END

--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)

set activeworld 1

--set screensize 100 0
--fadehud instantout
set maxplayers 1

--*********************************************                                                                       --*********************************************
--******** MAIN LEVEL CREATION *********                                                                        --******** MAIN LEVEL CREATION *********
--*********************************************                                                                       --*********************************************

-BELOW: PRE-BUFFERING OF UNITS

if displayextramodels
createmodel player0 omnithias vector(-10000,-10000,-10000) 0 0 [1]
createmodel player0 turbine vector(-11000,-11000,-10000) 0 0 [1]
createmodel player0 bladescout vector(-12000,-12000,-10000) 0 0 [1]
createmodel player0 interceptor vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 advocate vector(-14000,-14000,-10000) 0 0 [1]
createmodel player0 milanos vector(-15000,-15000,-10000) 0 0 [1]
createmodel player0 flakturret vector(-16000,-16000,-10000) 0 0 [1]
createmodel player0 mammothturbine vector(-17000,-17000,-10000) 0 0 [1]
createmodel player0 sios vector(-18000,-18000,-10000) 0 0 [1]
createmodel player0 tryphon vector(-19000,-19000,-10000) 0 0 [1]
createmodel player0 epsilon vector(-10000,-10000,-10000) 0 0 [1]
createmodel player0 bowgerus vector(-11000,-11000,-10000) 0 0 [1]
createmodel player0 atanos vector(-12000,-12000,-10000) 0 0 [1]
createmodel player0 etros vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 gammacruiser vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 sdfdestroyer vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 centuras vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 centuras vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 centuras vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 centuras vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 centuras vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 centuras vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 centuras vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 centuras vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 ftaquantumgate vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 rotiris vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 paytos vector(-13000,-13000,-10000) 0 0 [1]
createmodel player0 goldenboy vector(-13000,-13000,-10000) 0 0 [1]
end if

**************** CORE LEVEL CREATION ENDS **************
**************** CORE LEVEL CREATION ENDS **************
**************** CORE LEVEL CREATION ENDS **************

**************** MAIN LEVEL CREATION BEGINS **************  
**************** MAIN LEVEL CREATION BEGINS **************  
**************** MAIN LEVEL CREATION BEGINS **************  

--BELOW:BASIC LEVEL BODY

--BELOW: CUTSCENE BEGINS

if timer 1 >= 0
    createunit 1 1 promethius vector(97423,55810,5893) -18 1 [1]
    set flag 3 + 1
end if

--BELOW:CODE COPIED FROM MILE'S LEVELS.
--******** FIRST CUTSCENE
--******** FIRST CUTSCENE
if playerhasunit 1 1 promethius
    playglobalsound 1 99 computer001
    
comsatline Computer: Approach vector confirmed. rgb(0,255,0)
-- ***** camera start *****
cutscene clear
cutscene fadehud instantout 0
cutscene lock keybaord
cutscene lock mouse
-- ***** units move start *****
unitcutscene 1 clear
--below: instead of specifying the unit number, we'll bind the cutscene
--to the first Promethius unit that the player 1 has
unitcutscene 1 bindtounit 1 promethius
unitcutscene 1 setunitstate 87

-- Player: 1 Unit: 1
unitcutscene 1 moveunit [0.0402,0.8375,-0.5450,0.0000,-0.9150,0.2500,0.3167,0.0000,0.4015,0.4859,0.7764,0.0000,31917.5898,191153.8750,41952.0195,1.0000] 0
cutscene movecamera [-0.7017,-0.2839,-0.6534,0.0000,-0.1859,-0.8124,0.5526,0.0000,-0.6877,0.5093,0.5173,0.0000,33645.2930,193119.4375,46444.9727,1.0000] 0

cutscene set screensize 100 70

unitcutscene 1 moveunit [0.3861,0.7705,0.5073,0.0000,-0.9150,0.2500,0.3167,0.0000,0.1172,-0.5864,0.8015,0.0000,49894.5742,186241.9063,35730.4688,1.0000] 10000
cutscene movecamera [-0.6591,-0.7364,0.1526,0.0000,0.4391,-0.2121,0.8730,0.0000,-0.6105,0.6424,0.4632,0.0000,45356.4570,191679.0313,40139.4375,1.0000] 10000
unitcutscene 1 moveunit [0.0158,0.8065,-0.5910,0.0000,-0.9150,0.2500,0.3167,0.0000,0.4032,0.5358,0.7419,0.0000,89303.2578,175474.4531,22091.7441,1.0000] 7000
cutscene movecamera [-0.7450,-0.2456,-0.6203,0.0000,-0.4168,-0.5547,0.7201,0.0000,-0.5209,0.7950,0.3109,0.0000,85587.9531,182855.0469,25087.4199,1.0000] 7000
unitcutscene 1 moveunit [0.0756,0.9884,-0.1320,0.0000,-0.9916,0.0884,0.0942,0.0000,0.1048,0.1238,0.9868,0.0000,105565.4609,171030.9844,16463.6895,1.0000] 2000
cutscene movecamera [-0.7922,0.3981,0.4625,0.0000,0.2734,-0.4461,0.8522,0.0000,0.5456,0.8016,0.2445,0.0000,112781.5469,178700.5156,19316.0938,1.0000] 2000
unitcutscene 1 moveunit [0.9913,0.0661,-0.1135,0.0000,-0.0793,0.9901,-0.1158,0.0000,0.1048,0.1238,0.9868,0.0000,110872.1563,170557.5938,15959.6875,1.0000] 3000
cutscene movecamera [-0.7172,0.6958,-0.0385,0.0000,-0.1970,-0.1494,0.9690,0.0000,0.6685,0.7025,0.2442,0.0000,118575.8281,175211.7969,19288.9648,1.0000] 3000

---after turn

-- Player: 1 Unit: 1
unitcutscene 1 moveunit [0.7746,0.2905,-0.5618,0.0000,-0.2603,0.9560,0.1354,0.0000,0.5764,0.0413,0.8161,0.0000,115507.9844,151926.6563,13898.3916,1.0000] 6000
cutscene movecamera [-0.4156,0.8443,0.3381,0.0000,-0.0561,-0.3949,0.9170,0.0000,0.9078,0.3622,0.2115,0.0000,120952.0234,159260.5469,16563.0430,1.0000] 6000
unitcutscene 1 moveunit [0.7229,-0.2993,0.6227,0.0000,0.3319,0.9409,0.0670,0.0000,-0.6060,0.1582,0.7796,0.0000,112191.0000,136876.7813,12602.2090,1.0000] 7000
cutscene movecamera [-0.9256,0.1495,-0.3478,0.0000,-0.3688,-0.1487,0.9175,0.0000,0.0854,0.9775,0.1928,0.0000,111683.7891,145421.3438,15029.7109,1.0000] 6000
unitcutscene 1 moveunit [0.8768,-0.1029,-0.4697,0.0000,0.1710,0.9797,0.1046,0.0000,0.4494,-0.1720,0.8766,0.0000,107172.2188,108128.0938,9533.4023,1.0000] 7000
cutscene movecamera [-0.8558,0.3307,0.3977,0.0000,0.3112,-0.2848,0.9066,0.0000,0.4131,0.8997,0.1408,0.0000,111810.3594,114194.0781,10854.1172,1.0000] 6000
unitcutscene 1 moveunit [0.7474,-0.2468,0.6169,0.0000,0.1949,0.9691,0.1515,0.0000,-0.6351,0.0070,0.7724,0.0000,100182.0703,68089.7031,5259.4419,1.0000] 5000
cutscene movecamera [0.8574,0.2671,-0.4398,0.0000,0.3746,0.2621,0.8894,0.0000,0.3528,-0.9274,0.1246,0.0000,110942.9063,43967.4922,9572.9287,1.0000] 8000

unitcutscene 1 moveunit [0.9496,-0.3135,0.0000,0.0000,0.3135,0.9496,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,97422.8594,55809.7891,1640.7014,1.0000] 6000
cutscene movecamera [0.9110,0.4124,0.0000,0.0000,-0.0632,0.1396,0.9882,0.0000,0.4076,-0.9002,0.1533,0.0000,109432.6875,39008.8047,7169.1436,1.0000] 6000

cutscene positioncamera vector(9.01054e4,8.17004e4,-100.0000) vector(0.0000,0.0000,24.3572) vector(0.0000,-4.68620e4,7.26914e3) vector(0.0000,0.0000,0.0000)

-- ***** camera end *****
cutscene unlock keybaord
cutscene unlock mouse
cutscene set screensize 100 100
cutscene fadehud in 2000
cutscene set flag 2 to 3
cutscene start
-- ***** units move end *****
unitcutscene 1 setunitstate 75
unitcutscene 1 start
    reset timer 1
    reset timer 2
--below: hide the tactical window (the user should know how to use it by now)
    hide tactical
    set flag 3 + 1
    set flag 1 + 1
end if
*************************************************************
*********************ENTRY CUTSCENE END************
*************************************************************
 
if flag 3 = 1
and timer 1 >= 1000
    reset timer 1
repeat if

if timer 1 >= 50000
    createunit 1 1 promethius  vector(76522,55795,3234) -142 4.8094 [1]
end if

if playerhasunit 1 1 promethius
    network playglobalsound 1 99 computer012
    network comsatline Computer: Sector sync confirmed. rgb(0,255,0)
    set flag 1 + 1
    reset timer 1
end if

if playerhasunit 1 1 promethius
and timer 1 >= 500
and soundchannel 1 is free
    playglobalsound 1 99 computer031
    comsatline Computer: Weather conditions stable. rgb(0,255,0)
    set flag 1 + 1
    reset timer 1
end if

if playerhasunit 1 1 milanos
and soundchannel 1 is free
    network playglobalsound 1 99 computer030
    network comsatline Computer: Battle control, online. rgb(0,255,0)
    set flag 1 + 1
    reset timer 1
    set flag 2 + 1
end if


if playerhasunit 1 1 promethius
and flag 3 = 2
    comsatline Col.Reeves:All right commander! We've been dispatched to spy on the testing of this new Quantum Gate. We're also here to serve as protection. rgb(255,255,0)  
    set flag 1 to 5
    reset timer 1 
    reset timer 2
    set flag 3 + 1
end if   

if playerhasunit 1 1 promethius
and totalplayerunits 1 1 >= 3
    comsatline Computer:Unaffiliated Units Detected. ETA 7 minutes. Unidentified energy signatures. rgb(0,255,0) 
    set flag 17 + 1
    resert timer 1
end if  

if timer 1 >= 280000
and flag 17 = 1
    playglobalsound 1 99 computer027
    
comsatline Computer: Proceed with caution. rgb(0,255,0)
    reset timer 1
    set flag 17 + 1
end if

if flag 17 = 2
and timer 1 >= 214000
and timer 2 >= 490000
    addtast 1 p1real destroy_enemy_base pending primary Destroy all enemy units
    network highlighthud tasks
    playglobalsound 1 99 computer011
    comsatline Computer: New task confirmed. rgb(0,255,0)
end if

if flag 17 = 2
and timer 1 >= 210000
and timer 2 >= 490000
    comsatline Col.Reeves:They're not supposed to be here! rgb(255,255,0)  
    network playglobalsound 1 99 computer018
    network comsatline Computer: New threat detected. rgb(0,255,0)
    createunit 1 7 omnithias vector(60078,54881,3277) -165 61 0 -1 0
    createunit 1 7 milanos vector(54339,56329,1708) -165 80 0 -1 0
    createunit 1 7 milanos vector(51478,59724,1811) -165 80 0 -1 0
    createunit 1 7 milanos vector(50782,57065,1708) -165 80 0 -1 0
    createunit 1 7 goldenboy vector(52063,52814,1574) -165 80 0 -1 0
    createunit 1 7 tryphon vector(61290,60292,2348) -165 80 0 -1 0
    createunit 1 7 tryphon vector(53678,62134,2560) -165 80 0 -1 0
    createunit 1 7 tryphon vector(57844,61200,2452) -165 80 0 -1 0
    createunit 1 7 goldenboy vector(58900,58212,1972) -165 80 0 -1 0
    createunit 1 7 bowgerus vector(64437,51833,2323) 77 -165 61 0 -1 0
    createunit 1 7 atanos vector(63285,61936,2244) 85 -165 80 0 -1 0
    createunit 1 7 bowgerus vector(80596,72243,7646) -165 61 0 -1 0
    radarbeacon 1 vector(60078,54881,3277) 10000
    set flag 17 + 1
    set flag 29 + 1
end if

if timer 1 >= 8000
and timer 2 >= 490000 
and flag 17 = 3
    set flag 3 + 1
end if

if totalplayerunits 1 7 >= 6
and timer 1 >= 35000
and timer 2 >= 490000 
and flag 17 = 3
and flag 29 = 1
    set flag 28 + 1
end if

if totalplayerunits 1 7 <= 6 
and timer 1 >= 35000
and timer 2 >= 515000 
and flag 17 = 3
and flag 29 = 1
and flag 28 = 1
    playglobalsound 1 99 computer019
    
comsatline Computer: New radar signature detected. rgb(0,255,0)
    comsatline Col.Reeves: It's a trap! rgb(255,255,0)
    createunit 1 7 omnithias vector(66753,43688,3059) 158 61 0 -1 0
    createunit 1 7 rotiris vector(70598,48211,1860) 158 80 0 -1 0
    createunit 1 7 rotiris vector(67387,49823,1905) 158 80 0 -1 0  
    createunit 1 7 rotiris vector(69077,49021,1892) 158 80 0 -1 0
    createunit 1 7 bowgerus vector(73080,43158,2226) 158 61 0 -1 0
    createunit 1 7 bowgerus vector(64363,51907,2338) 158 61 0 -1 0
    createunit 1 7 milanos vector(68924,38522,1392) 158 80 0 -1 0
    createunit 1 7 milanos vector(65988,38615,1447) 158 80 0 -1 0
    radarbeacon 1 vector(66753,43688,3059) 10000
    setai 1 7 1 100
    reset timer 1
    set flag 18 + 1
    reset timer 3
end if  

if flag 18 = 1
and timer 1 >= 5000
    playglobalsound 1 99 computer011
    comsatline Computer: New task confirmed. rgb(0,255,0)
    addtast 1 p1real defend_sector pending primary Defend this sector against all enemy units
end if

if playerhasnounit 1 7 milanos
and playerhasunit 1 7 omnithias
and playerhasunit 1 7 tryphon
and playerhasunit 1 7 bowgerus
and playerhasunit 1 7 rotiris
and timer 3 >= 40000
and flag 18 = 1
    createunit 1 7 milanos vector(68924,38522,1392) 158 80 0 -1 0
    createunit 1 7 milanos vector(65988,38615,1447) 158 80 0 -1 0
    createunit 1 7 milanos vector(54339,56329,1708) -165 80 0 -1 0
    createunit 1 7 milanos vector(51478,59724,1811) -165 80 0 -1 0
    createunit 1 7 milanos vector(50782,57065,1708) -165 80 0 -1 0
    reset timer 3
repeat if

if playerhasunit 1 7 milanos
and playerhasunit 1 7 omnithias
and playerhasnounit 1 7 rotiris
and timer 7 >= 40000
and flag 18 = 1
    createunit 1 7 rotiris vector(70598,48211,1860) 158 80 0 -1 0
    createunit 1 7 rotiris vector(67387,49823,1905) 158 80 0 -1 0  
    createunit 1 7 rotiris vector(69077,49021,1892) 158 80 0 -1 0
    reset timer 3
repeat if

if playerhasunit 1 7 omnithias
and playerhasnounit 1 7 bowgerus
and flag 18 = 1
and timer 18 >= 40000
    createunit 1 7 bowgerus vector(73080,43158,2226) 158 61 0 -1 0
    reset timer 3
repeat if

if timer 2 >= 500000
and totalplayerunits 1 1 >= 1
and flag 18 = 1
    setai 1 7 1 100
    repeat this if
    reset timer 1
end if

if totalplayerunits 1 7 <= 6 
and timer 1 >= 30000 
and timer 2 >= 510000
and flag 17 = 3
and flag 18 = 1
    comsatline Computer: Additional Enemy Units detected. ETA to contact:1 minute. rgb(0,255,0) 
    network playglobalsound 1 99 computer018
    network comsatline Computer: New threat detected. rgb(0,255,0)
    
comsatline Col.Reeves What are those!? rgb(255,255,0)
    createunit 1 7 goldenboy vector(52055,90720,7903) 44 61 0 -1 0 
    createunit 1 7 goldenboy vector(52594,92743,7996) 44 61 0 -1 0 
    createunit 1 7 goldenboy vector(53121,94746,8041) 44 61 0 -1 0 
    createunit 1 7 goldenboy vector(53564,97075,7849) 44 61 0 -1 0 
    radarbeacon 1 vector(53121,94746,8041) 10000
    changetask 1 playernumber destroy_enemy_base complete
    network highlighthud tasks
    set flag 17 + 1
    reset timer 1
end if  

if totalplayerunits 1 7 = 0 
and timer 1 >= 60000 
and timer 2 >= 560000
and flag 17 = 4
    comsatline Computer: Enemy FTA class units detected. Unknown trajectory. rgb(0,255,0)
    comsatline Col.Reeves:Well, I suggest you start re-building. There may be more trouble headed this way. rgb(255,255,0)
    reset timer 1
    set flag 17 + 1
end if  

if totalplayerunits 1 1 >= 10 
and flag 17 = 5
and timer 1 >= 120000
and timer 2 >= 680000 
    createunit 1 3 epsilon vector(61779,111220,2563) -158 61 0 -1 0 
    radarbeacon 1 vector(61779,111220,2563) 10000
    playglobalsound 1 99 computer011
    comsatline Computer: New task confirmed. rgb(0,255,255)
    addtask 1 p1real attack_enemy pending primary regain control of the sector by attacking the enemy forces. 
    comsatline Col.Reeves: Destroy that dropship! rgb(255,255,0)
    highlighthud tasks
    reset timer 1 
    set flag 19 to 20
    set flag 17 + 1
end if

if flag 19 = 20
and timer 13 >= 40000
and totalplayerunits 1 3 < 12
and flag 17 = 6
    set flag 4 to random(4)
    set flag 19 to 21
    reset timer 13
    repeat this if
    setai 1 3 1 100
end if

if flag 19 = 20
and timer 13 >= 45000
    reset timer 13
    repeat this if
end if

if flag 19 = 21
and timer 13 >= 100
and flag 4 = 1
    createunit 1 3 advocate vector(71231,104407,3144) 27 80 0 -1 0
    createunit 1 3 advocate vector(70208,98985,4157) 27 80 0 -1 0
    set flag 19 to 20
    reset timer 13
    repeat this if
end if

if flag 19 = 21
and timer 13 >= 100
and flag 4 = 2
    createunit 1 3 interceptor vector(76288,98238,2745) 27 80 0 -1 0
    createunit 1 3 interceptor vector(59056,108111,4320) -158 80 0 -1 0
    createunit 1 3 interceptor vector(72123,96242,2828) 27 80 0 -1 0
    set flag 19 to 20
    reset timer 13
    repeat this if
end if

if flag 19 = 21
and timer 13 >= 100
and flag 4 = 3
    createunit 1 3 interceptor vector(76288,98238,2745) 27 80 0 -1 0
    createunit 1 3 interceptor vector(59056,108111,4320) -158 80 0 -1 0
    createunit 1 3 interceptor vector(72123,96242,2828) 27 80 0 -1 0
    set flag 19 to 20
    reset timer 13
    repeat this if
end if

if flag 19 = 21
and timer 13 >= 100
and flag 4 = 4
    createunit 1 3 interceptor vector(59056,108111,4320) -158 80 0 -1 0
    createunit 1 3 interceptor vector(72123,96242,2828) 27 80 0 -1 0
    createunit 1 3 gammacruiser vector(76413,92939,3479) 27 80 0 -1 0
    set flag 19 to 20
    reset timer 13
    repeat this if
end if

if totalplayerunits 1 3 >= 9 
and flag 17 = 6
and timer 1 >= 90000
and timer 2 >= 690000
and playerhasunit 1 3 epsilon
    comsatline Col.Reeves: I thought I told you to destroy that damned dropship! rgb(255,255,0)
end if

if totalplayerunits 1 3 <= 7
and timer 1 >= 30000
and timer 2 >= 680000
and playerhasnounit 1 3 epsilon
and flag 17 = 6
    changetask 1 playernumber attack_enemy complete
    set flag 19 to 30
    set flag 17 + 1
    reset timer 1
end if

if totalplayerunits 1 3 = 0
    set flag 16 = 1
    reset timer 1
end if

if totalplayerunits 1 3 <= 1
and timer 1 >= 30000
and timer 2 >= 700000
and flag 17 = 7
and flag 16 = 1
    settechlevel 1 playernumber [0,1,2,4,5,6,9,11]
    comsatline Col.Reeves: Commander! I'm giving you the specs to a more powerful defense turret called the Atanos. Build some and place them around your dropship. Make sure you have enough power to operate them. rgb(255,255,0)
    addtask 1 p1real build_atanos pending secondary build an atanos death tower and have enough power to operate it
    set flag 16 + 1
end if

if playerhasunit 1 1 atanos
and timer 1 >= 90000
and timer 2 >= 760000
and playerpower >= 50
and flag 16 = 2
    comsatline Col.Reeves: Good Job Commander! rgb(255,255,0)
    changetask 1 playernumber build_atanos complete
    set flag 17 + 1
    reset timer 1
end if

if timer 1 >= 5000 
and timer 2 >= 800000 
and flag 17 = 8
and playerhasunit 1 1 atanos
    comsatline Computer: Adittional Enemy Units Detected. ETA, 1 minute. rgb(0,255,0)
    reset timer 1
end if

if timer 1 >= 20000 
and timer 2 >= 800000 
and flag 17 = 8
    comsatline Col.Reeves Looks like HQ sent some backup. However, since we're not "officially" supposed to be here I highly doubt they'd send anything to be a major help. But, I'll take what I can get. rgb(255,255,0)
    createunit 1 1 bowgerus vector(73080,43158,2226) 158 61 0 -1 0
    createunit 1 1 bowgerus vector(64363,51907,2338) 158 61 0 -1 0
end if

if timer 1 >= 60000
and timer 2 >= 860000 
and flag 17 = 8
    playglobalsound 1 99 computer023
    
comsatline Computer: Transport detected. rgb(255,255,0)
    createunit 1 7 advocate vector(24659,38739,7681) -173 80 0 -1 0
    createunit 1 7 advocate vector(23169,40135,7148) -173 80 0 -1 0 
    createunit 1 7 advocate vector(22070,37571,7242) -173 80 0 -1 0
    createunit 1 7 gammacruiser vector(24417,42179,7353) -173 80 0 -1 0
    createunit 1 7 gammacruiser vector(21308,39143,5847) -173 80 0 -1 0
    createunit 1 7 interceptor vector(61779,111220,2563) -158 80 0 -1 0
    createunit 1 7 interceptor vector(61854,116979,2303) -158 80 0 -1 0
    createunit 1 7 interceptor vector(58892,114006,2357) -158 80 0 -1 0
    createunit 1 7 bladescout vector(62011,107057,2994) -158 80 0 -1 0 
    createunit 1 7 bladescout vector(65963,106641,3011) -158 80 0 -1 0 
    createunit 1 7 bladescout vector(59056,108111,3153) -158 80 0 -1 0
    createunit 1 7 flakturret vector(20928,51454,1328) -158 80 0 -1 0
    createunit 1 7 flakturret vector(22628,54736,1437) -158 80 0 -1 0
    createunit 1 7 farseer vector(25965,53829,1498) -158 80 0 -1 0 
    createunit 1 7 mammothturbine vector(21641,28812,6415) -163 80 0 -1 0
    createunit 1 7 bladescout vector(23776,34429,6976) -171 80 0 -1 0
    createunit 1 7 epsilon vector(27447,36857,7080) -171 61 0 -1 0
    createunit 1 7 gammacruiser vector(81375,74373,7975) -135 80 0 -1 0
    createunit 1 7 goldenboy vector(82709,76253,7977) -135 80 0 -1 0] 
    createunit 1 7 goldenboy vector(84437,77885,8001) -135 80 0 -1 0
    createunit 1 7 goldenboy vector(78921,73379,8311) -135 80 0 -1 0
    radarbeacon 1 vector(27447,36857,7080) 10000
    reset timer 1
    setai 1 7 1 100
    set flag 21 to 1
end if  

if flag 21 = 1
and timer 1 >= 60000
and totalplayerunits 1 7 = 0
and flag 17 = 8
    network playglobalsound 1 99 computer018
    network comsatline Computer: New threat detected. rgb(0,255,0)
    comsatline :Col.Reeves:No! Get us over there! rgb(255,255,0) 
    set flag 13 to 1
end if

if flag 13 = 1
    playglobalsound 1 99 computer_global_156
    
comsatline Computer: Adjacent sector activity detected. rgb(255,255,0)
    reset timer 1
    reset timer 4
    set flag 13 to 2
    radarbeacon 1 vector(66474,53859,9980) 15000
    jump sector
end if  

if currentsector is 2
    reset timer 1
    set flag 17 + 1
end if

**************************Gate Derstruction**************************
**************************Gate Derstruction**************************
**************************Gate Derstruction**************************
if timer 1 >= 0
    createunit 2 4 ftaquantumgate vector(66474,53859,9980) -15 1 [1]
    createunit 2 1 radartower vector(52567,61084,9596) 3 1 [1]
    createunit 2 1 turbine vector(54604,60637,9616) 1 1 [1]
    createunit 2 1 turbine vector(56667,60335,9630) -6 1 [1]
    createunit 2 6 copterstation vector(55203,57612,9780) -3 1 [1]
    createunit 2 6 bladescout vector(66965,60827,9951) 167 1.5000 [1]
    createunit 2 6 bladescout vector(65321,61120,9960) 167 1.5000 [1]
    createunit 2 6 bladescout vector(63756,61433,9983) 167 1.5000 [1]
    createunit 2 6 bladescout vector(62188,61792,10005) 169 1.5000 [1]
    createunit 2 6 turbine vector(69225,51022,10154) 21 1 [1]
    createunit 2 6 turbine vector(69846,54443,9966) 21 1 [1]
    createunit 2 6 turbine vector(68181,57520,9785) 21 1 [1]
    createunit 2 6 turbine vector(64631,58249,9742) 21 1 [1]
    createunit 2 6 epsilon vector(50254,55072,11140) 125 1 [1]
    createunit 2 6 epsilon vector(71049,52301,11346) -105 1 [1]
    createunit 2 6 epsilon vector(70681,56958,11072) -60 1 [1]
end if

if flag 17 = 9
and currentsector is 2
and timer 1 >= 3000
    playglobalsound 1 99 computer032
    
comsatline Computer: LRM detected! rgb(255,255,0)
    reset timer 1
    set flag 17 + 1
    setunithealth 2 4 all 0%
    setunithealth 2 1 all 0%
    setunithealth 2 6 all 0%
end if


**************************END**************************
**************************END**************************
**************************END**************************

if totalplayerunits 2 4 = 0
and timer 1 >= 6000
and playerhasnounit 2 4 ftaquantumgate
and playerhasunit 1 1 promethius
    comstaline Computer:Quantum Gate Destroyed. rgb(0,255,0) 
    playglobalsound 1 99 computer021
    
comsatline Computer: Temporial incursion detected. rgb(0,255,0)
    setunitstate 1 6 all 0 0 0%
    reset timer 1
    set flag 15 to 1
end if  

if timer 1 >= 10000
and totalplayerunits 2 4 = 0
and flag 15 = 1
    playglobalsound 1 99 computer_global_148
    
comsatline Computer: Phase variants detected. rgb(0,255,0)
    reset timer 1
    set flag 15 + 1
end if  

if timer 1 >= 10000
and totalplayerunits 2 4 = 0
and flag 15 = 2
    playglobalsound 1 99 computer_global_150
    
comsatline Computer: Space time fluxuations detected. rb (0,255,0)
    set flag 14 to 1
    set flag 15 + 1
    set flag 17 + 1
    jump sector
    reset timer 1
end if  

if timer 1 >= 8000
and totalplayerunits 2 4 = 0
and flag 14 = 1
and flag 15 = 3
and timer 2 >= 1000000
    setunitstate 1 8 all 75 0 0%
    setunitstate 1 6 all 75 0 0%
    reset timer 1
    set flag 17 + 1
end if

if timer 1 >= 22000
and totalplayerunits 2 4 = 0
and flag 14 = 1
and flag 15 = 3
    playglobalsound 1 99 computer_global_162
    
comsatline Computer: Warning. Defence force presence detected. rgb(255,255,0)
    createunit 1 5 sdfdestroyer vector(78921,73379,8311) -135 61 0 -1 0
    reset timer 1
    set flag 14 to 2
end if

if timer 1 >= 20000
and totalplayerunits 2 4 = 0
and flag 14 = 2
and flag 15 = 3
    comsatline Col.Reeves: Commander, we have failed this day. Let's get out of here before SDF starts asking us why the hell we were here in the first place. rgb(255,255,0) 
    reset timer 1
    set flag 14 + 1
end if


**************** MAIN LEVEL CREATION ENDS ************** 
**************** MAIN LEVEL CREATION ENDS ************** 
**************** MAIN LEVEL CREATION ENDS ************** 


**************** BASIC OUTCOME SCRIPT END ************** 
**************** BASIC OUTCOME SCRIPT END ************** 


****************MISCALANEOUS THINGS
--------------
-- MUSIC
--------------

if soundchannel 8 is free
and timer 20 >= 20000
    addmusic ql_track_6a
    addmusic ql_track_10a
    addmusic ql_track_8a
    addmusic ql_track_11a
    addmusic ql_track_12b
    addmusic ql_track_9a
    addmusic ql_track_6c
    addmusic ql_track_10b
    addmusic ql_track_8b
    addmusic ql_track_12a
    addmusic ql_track_6b
    addmusic ql_track_11b
    addmusic ql_track_9b
    addmusic ql_track_8c
    addmusic ql_track_10c
    pause between tracks 5000
    randomize music
    reset timer 20
end if

--------------
-- MUSIC END
--------------

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

--BELOW. Thanks to K776 we now have a code for basic computer voices that'll work as long as we don't use flags and timers 39 and 40.

if timer 39 >= 0
    reset timer 39
end if

if timer 40 >= 0
    reset timer 40
end if

if unitstate 1 1 2 < 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(0,255,0)
    highlighthud power
    reset timer 39
    repeat this if
end if

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

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

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

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

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

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

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

if totalplayerunits 1 1 = 25
    playglobalsound 1 99 computer103
    
comsatline Computer: Sector unit limit has been reached.g rb (0,255,0)
end if
if

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

**************** WIN OUTCOME ************** 

if flag 14 = 3
and playerhasunit 1 5 sdfdestroyer
and playerhasunit 1 1 promethius
and timer 1 >= 10000
    network playglobalsound 1 99 computer016
    network comsatline Computer: Mission successful. rgb(0,255,0)
    changetask 1 playernumber defend_dropship complete
    changetask 1 playernumber defend_sector complete
    network highlighthud tasks
    set flag 20 to 8
end if

if flag 20 = 8
and soundchannel 1 is free
    network playglobalsound 1 99 computer049
    network comsatline Computer: Excelent work Commander. rgb(0,255,0)
    set flag 20 to 10
end if

if flag 20 = 10
and soundchannel 1 is free
    network playglobalsound 3 99 threebeeps01
    network comsatline ** Mission Complete. Press Menu and Exit when ready. rgb(0,255,0)
    highlighthud menu
    reset timer 1
    stop all
end if

**************** WIN OUTCOME END **************

**************** FAILURE OUTCOME **************

if playerhasnounit 1 1 promethius
and totalplayerunits 1 3 >= 1
    set flag 1 to 911
end if

if playerhasnounit 1 1 promethius
and totalplayerunits 1 7 >= 1
    set flag 1 to 911
end if

if flag 1 = 911
and soundchannel 1 is free
    playglobalsound 1 99 computer015
    comsatline Computer: Mission failed. rgb(0,255,0)
    reset timer 1
    set flag 1 + 1
end if

if flag 1 = 912
and soundchannel 1 is free
playglobalsound 1 99 computer017
comsatline Computer: You've been relieved of your command. rgb(0,255,0)
    set flag 1 + 1
end if

if flag 1 = 913
and soundchannel 1 is free
    changetask 1 playernumber defend_dropship failed
    network highlighthud tasks
    reset timer 1
end if

if flag 1 = 913
and soundchannel 1 is free
and totalplayerunits 1 7 <= 6
    changetask 1 playernumber destroy_enemy_base failed
    network highlighthud tasks
    reset timer 1
    set flag 1 + 1
end if

if flag 1 = 914
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline ** Mission FAILED. Press Menu and Exit when ready. rgb(0,255,0)
    highlighthud menu
    reset timer 1
end if

**************** FAILURE OUTCOME END **************
**************** FAILURE OUTCOME END **************
**************** FAILURE OUTCOME END **************

*************************************************************
**********NEW UNIT CREATION**********
************************************************************

**************************************************************
****** CREATION OF THE: GOLDENBOY CRUISER ****** 
**************************************************************
--Thanks to Miles, we have a working Goldeboy code. I changed a few of the parameters.

copymodel gammacruiser goldenboy

new database entry
goldenboy
affect all temporal mods
fullname GoldenBoy Cruiser
price 2200
buildtime 35000
unitflagrequired 1
techlevel 11
unitscale 1.5
healthratio 5
modeltype 2
armor 2500 --Can't make it too powerful
damage 80
speed1 500 --Bit faster
speed2 65
speed3 165
forcetemporalmod 2
initialstate 82
cantarget [1,2,3,10]
canattack [1,2,3,10,50]
gridtype -5
sounds created ["transportgamma_acreated1","transportgamma_aattack3"]
sounds selected ["transportgamma_aattack2","transportgamma_aattack3"]
sounds move ["transportgamma_amove1","transportgamma_amove2","transportgamma_amove3"]
sounds attack ["transportgamma_aattack1","transportgamma_aattack4"]
sounds deploy ["transport01_02"]
sounds undeploy ["transport01_02"]
animationtype 2 
animation 0 0 250 no yes yes 
animation 3 250 500 no no no 
animation 700 500 750 no no no 
healthanimation <=0 mammothhazard 0 
healthanimation <=20 smoke_and_fire 10000
healthanimation <=50 slight_smoke 10000
#end

process database


new tactical entry
goldenboy
@name DB:fullname /n /n @primary @function /n Unknown /n /n @flaws /n extremely low speed /n /n @good @against /n low and medium flying units, all structures, drop-ships /n /n @counter @with /n Unknown /n /n #DETAILED #INFO /n /n @armor /n DB:armor /n /n @speed /n DB:speed1 kpq /n /n @primary @weapon /n high-damage plasma torpedo /n /n @damage @yield /n DB:damage /n /n @unable @to @target /n high flying units /n /n @hover @distance /n high
#end

process tactical database


copyobject shadow~gammacruiser shadow~goldenboy

--and now, the new GoldenBoy Cruiser is complete! Howard:Thank's Miles.

**************************************************************
****** CREATION OF THE: GOLDENBOY CRUISER END ****** 
**************************************************************

**************************************************************
****** CREATION OF THE PROMETHIUS ****** 
**************************************************************

copymodel omnithias promethius


new database entry
promethius
affect all temporal mods
fullname Globex Drop-Ship Prometheus
price 4500
buildtime 50000
unitflagrequired 1
techlevel 0
unitscale 1.1
healthratio 6
modeltype 1
armor 3800
damage 35 -- MORE DAMAGE
speed1 750 --FASTER
speed2 120
speed3 480
initialstate 60
initialblend 100
cantarget [1,2,3,4,5,10]
canattack [1,2,3,4,5,10,50]
candeploy yes
unitflag [1]
unitflagstate [21]
canbuild 1 [21] ["payatos"]
canreceive 1
power +250gridtype -5
deathtype 4
lifetime 0
sounds selected ["transport01_aselected1","transport01_aselected2"]
sounds move ["transport01_amove1","transport01_amove2"]
sounds deploy ["transport01_adeploy1"]
sounds indeployment ["machine01_01"]
sounds undeploy ["transport01_aundeploy1"]
deploydelay 5000
undeploydelay 5000
animationtype 2
animation 0 0 100 yes yes yes
animation 20 100 250 no no no
animation 22 250 400 no no no
animation 3 400 450 no no no
animation 700 450 550 no no no
healthanimation <=0 smoke_trail 120000
healthanimation <=20 smoke_and_fire 10000
healthanimation <=50 slight_smoke 10000
#end

process database

new tactical entry
globex drop-ship promethius
@name DB:fullname /n /n @primary @function /n replication of new units /n /n @flaws extremely low speed and medium damage/n extremely low speed and low damage /n /n @good @against need for replication/n need for replication /n /n @counter @with /n any offensive unit /n /n #DETAILED #INFO /n /n @armor /n DB:armor /n /n @speed /n DB:speed1 kpq /n /n @primary @weapon /n twin mounted polaron beams /n /n @damage @yield /n DB:damage /n /n @unable @to @target /n high flying units /n /n @hover @distance /n high
#end

process tactical database


copyobject shadow~omnithias shadow~promethius

**************************************************************
****** CREATION OF THE PROMETHIUS END ****** 
**************************************************************

*************************************************************
**********NEW UNIT CREATION END**********
************************************************************


********************************************SCRIPT END*****************************************