--Chariot Junction
--Sole Survivor

**** SKIP FRAMES OF ANIMATION - STARTS

--BELOW: establish the initial level rules:
if flag 1 = 0
    playercantarget 1 1 [1,2,3,4,5,6,7,8,10,11,12,13,14,15]
    playercantarget 1 2 [1,2,3,4,5,6,7,8,10,11,12,13,14,15]
    playercantarget 1 3 [1,2,3,4,5,6,7,8,10,11,12,13,14,15]
    playercantarget 1 4 [1,2,3,4,5,6,7,8,10,11,12,13,14,15]
    playercantarget 1 5 [1,2,3,4,5,6,7,8,10,11,12,13,14,15]
    playercantarget 1 6 [1,2,3,4,5,6,7,8,10,11,12,13,14,15]
    playercantarget 1 7 [1,2,3,4,5,6,7,8,10,11,12,13,14,15]
    playercantarget 1 8 [1,2,3,4,5,6,7,8,10,11,12,13,14,15]
--BELOW: Player 10 is used to by the Globex AI units:
    playercantarget 1 10 [1,2,3,4,5,6,7,8,11,12,13,14,15]
    setmaxunits 1 player 3
    setplayermoney 1 player 0
    settechlevel 1 player [0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,17,18,19,20]
    cleartasks all playernumber
end if

if flag 1 < 10
    set flag 1 + 1
    repeat this if
end if

if flag 1 = 3
--BELOW: hide the tactical window (the user should know how to use it by now):
    hide tactical
    set screensize 100 100
    fadehud in 4000
    set flag 1 to 10
    reset timer 1
end if

**** SKIP FRAMES OF ANIMATION - ENDS

**** PRIMARY SCRIPT FUNCTIONS - START

if flag 1 = 10
and timer 1 >= 2000
and soundchannel 1 is free
    set flag 1 + 1
--BELOW: turn on the part of script which will grant the player a playable unit
    set flag 3 to 1
    set flag 4 to 1
--turn on the Globex Units (Player 10) AI:
    setai 1 10 1 100
    playglobalsound 1 99 computer011
    comsatline Computer: New task confirmed. rgb(255,255,0)
    addtask all playernumber sole_survivor pending primary survive as long as possible with a single Gamma Cruiser unit.
--    highlighthud tasks
end if

--BELOW: if player has no playable units, spawn him a new Gamma Cruiser every 20 seconds:
if flag 3 = 1
and timer 3 >= 20000*1
and timer 7 >= 20000
and totalplayerunits 1 playernumber <= 0
--BELOW: by placing the word "network" in front of any QCore statement
--we make sure that the command will be executed by all active players in the game:
--    network playglobalsound 2 99 computer019
    set flag 4 to 0
    reset timer 3
    reset timer 4
    reset timer 7
--BELOW: when creating a new unit, there is no need to use the "network" prefix
--since all unit creation, state and position commands are already network based:
    createunit 1 playernumber cloakcruiser vector(1000*playernumber,0,0) 0 85 0 -1 0
    repeat this if
end if

--BELOW: reset the 20 second timer:
if flag 3 = 1
and timer 3 >= 20000*1
    reset timer 3
    repeat this if
end if

if flag 4 = 0
and flag 3 = 1
and timer 4 >= 30000
and soundchannel 1 is free
and totalplayerunits 1 playernumber <= 0
    playglobalsound 1 99 computer014
    comsatline >> New Gamma Cruiser will be granted in 20 seconds. rgb(255,255,0)
    set flag 4 to 1
    repeat this if
--    highlighthud popcap
end if

**** PRIMARY SCRIPT FUNCTIONS - END

**** AI SCRIPT FUNCTIONS - START

--If player is the host, and there are no human players in the game
--Globex AI units will be created to keep the player busy:

if flag 3 = 1
and playernumber = 1
and flag 6 = 0
and timer 5 >= 20000*1
and soundchannel 1 is free
and totalactiveunits 1 playernumber >= 1
and totalplayerunits 1 10 <= 0
and playerisactive 2 = false
and playerisactive 3 = false
and playerisactive 4 = false
and playerisactive 5 = false
and playerisactive 6 = false
and playerisactive 7 = false
and playerisactive 8 = false
--BELOW: set Flag 6 to a random number (either 1 or 2):
    set flag 6 to random(2)
    reset timer 5
    reset timer 7
    repeat this if
end if

--BELOW: give player another cruiser to play around with:
if flag 6 >= 1
and playernumber = 1
and flag 6 < 10
and timer 7 >= 15000
and playernumber = 1
and totalplayerunits 1 playernumber <= 1
    createunit 1 playernumber cloakcruiser vector(1000*playernumber,0,0) 0 85 0 -1 0
    repeat this if
end if

--BELOW: first possible spawn point:
if flag 6 = 1
and playernumber = 1
and timer 7 >= 15000
and soundchannel 1 is free
    playglobalsound 1 99 computer018
    comsatline Computer: new threat detected. rgb(255,255,0)
    createunit 1 10 crysentos vector(399021,160267,1245) 0 82 0 -1 0
    radarbeacon 1 lastvector 60000
    set flag 6 to 10
    reset timer 6
    reset timer 7
    repeat this if
end if

--BELOW: second possible spawn point:
if flag 6 = 2
and playernumber = 1
and timer 7 >= 15000
and soundchannel 1 is free
    playglobalsound 1 99 computer018
    comsatline Computer: new threat detected. rgb(255,255,0)
    createunit 1 10 crysentos vector(166034,435445,1245) 0 82 0 -1 0
    radarbeacon 1 lastvector 60000
    set flag 6 to 10
    reset timer 6
    reset timer 7
    repeat this if
end if

if flag 6 = 10
and playernumber = 1
and totalactiveunits 1 10 >= 1
--turn on the Globex Units (Player 10) AI:
    setai 1 10 1 100
--BELOW: point the drop-cam at the enemy Space Crysentos unit:
    dropcam 1 10 1 60000 2
    set flag 6 to 0
    reset timer 5
    reset timer 6
    reset timer 7
    repeat this if
end if

if playernumber = 1
and timer 5 >= 20000*1
--turn on the Globex Units (Player 10) AI:
    setai 1 10 1 100
    reset timer 5
    repeat this if
end if

**** AI SCRIPT FUNCTIONS - END

**** NOT SO IMPORTANT VOICE SAMPLES - START

if soundchannel 2 is free
and playernumber = 1
and sinceenemyjump <= 10000
and timer 8 >= 15000
    network playglobalsound 2 99 computer022
    network comsatline Computer: New jump signature detected. rgb(255,255,0)
    reset timer 8
    repeat this if
end if

**** NOT SO IMPORTANT VOICE SAMPLES - END

**************** 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_verylargespace
set landdeform off
set landheightmap heightmap_verylargespace
set shadows off		--this will make sure no unit shows are shown during gameplay
set unplayableareacheck off		--this will allow all units to exist far beyond the playable area
set heightmapdata off	--space heightmaps are blank, thus there is no need to process them for data
set playerlosscount off	--make sure player defeats are not counted on the QL ladder

set minnewfogdistance 1000000000
set maxviewdistance 1000000000

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

--BELOW: we load the main Quantum Space resource pack which contains
--models, textures, sounds and all other resources related to the space levels:
load resourcepack http://internallink2/ql_quantumspace.cct slot2 quantum_space

replace loadingscreen loadingscreen_chariot

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 basic variables

load basic models

--BELOW: a "red" variation of the radar is used
load minimap minimapred
processtexture inner_radar inner_radar_red
processtexture radarring_a radarring_a_red
processtexture radarring_b radarring_b_red
processtexture minimapcamerabox minimapcamerabox_white

--BELOW: since we are using a "red" tint on the radar
--we change the radar mini-map color of Player 2 to a lighter shade of red:
set minimapplayercolor 2 rgb(252,118,118)

--BELOW: move the sky-clouds so high up that they are not seen
movemodel sky01 vector(0,0,3000000000)
movemodel sky02 vector(0,0,3000000000)

**** LINKED SCRIPT - STARTS

--NOTICE: all Quantum Space levels feed their modification data from a single Space Unit Database script
--(feel free to load the script in your browser via the http:// link below in order to study it's data)

--BELOW: First we stream the script:
load media http://quantumlegacy.com/sdk/scripts/quantumspace/spaceunitdatabase.txt slot1 quantum_space

--Then we process it (notice that as always, the ".txt " suffix is left out):
process script spaceunitdatabase

--BELOW: SDK Dev-Only: as an alternate method, instead of streaming the above public script
--the internal development script can be processed via the command:
--process script txtSpaceUnitDatabase

**** LINKED SCRIPT - ENDS

--BELOW: this version of the space sky-box will spin in the opposite direction:
createmodel player9 skybox_spacereverse vector(175792,206215,0) -157 9384.3135 [1]

--BELOW: replace the default "blue space" texture with another variation
processtexture texture_space texture_space7

createmodel player9 planet_star vector(446535,439752,-25372) 117 1 [1]

--BELOW: this statement will replace the Saltus star texture with the alternate version
--if this line is used, the alternate texture will be used at all times regardless of the unit's temporal mod
processtexture chrome_star chrome_star_temporalmod2

--BELOW: the "Green Devron" variation planet (which uses the Saltus planet model):
createmodel player9 planet_saltus vector(150798,428381,-90355) 69 5.5116 [1]

--BELOW: the alternate textures need to be processed after the "Devron" model is created:
**** ALTERNATE DEVRON PLANET BEGINS
processtexture chrome_planet texture_devron_alternate
processtexture texture_planetclouds planetdemon_sky
processtexture flare_planethalo hellskitchen_halo
**** ALTERNATE DEVRON PLANET ENDS

--BELOW: this time around, the alternate "temporal mod 2" textures need to be processed
--before the actual planet model is created (otherwise, the "temporal mod 2" variable will not take effect)
**** ALTERNATE DEMON PLANET BEGINS
processtexture chrome_planet_temporalmod2 texture_demonplanet_alternate
processtexture texture_planetclouds_temporalmod2 planetdemon_sky
processtexture flare_planethalo_temporalmod2 planetdemon_halo
**** ALTERNATE DEMON PLANET ENDS

**** DIRECT-X 5 FIX - STARTS
--BELOW: a problem has been identified with most video cards which are only capable of
--running QL in the outdated "Direct X 5.0+" video render mode, when attempting to display
--the layer of "clouds" on any of the Quantum Space planets (in the game model: "planet_saltus")
--as a temporary fix, the cloud layer is simply replaced with a blank texture (thus making it invisible
--and in turn removing the undesired broken texture video effect).
--The below IF statement should not affect most players who will run QL in either OpenGL or Direct X 7.0+
if renderer = directx5
--BELOW: replace the clouds used by the planets in this level with a blank-transparent texture
    processtexture texture_planetclouds blankalphatexture
    processtexture texture_planetclouds_temporalmod2 blankalphatexture
end if
**** DIRECT-X 5 FIX - ENDS

--BELOW: temporal mod 2 variation of the Saltus model, which will use the
--already processed (above) alternate textures:
createmodel player9 planet_saltus vector(384569,151119,-90356) -89 5.5118 [2]

createmodel player17 spaceresource vector(363476,493044,0) -90 1 [1]
createmodel player17 spaceresource vector(485895,378238,0) 91 1 [1]
createmodel player17 spaceresource vector(227083,317888,0) -132 1 [1]
createmodel player17 spaceresource vector(303352,229237,0) 1 1 [1]
createmodel player17 spaceresource vector(457045,253537,0) 163 1 [1]
createmodel player17 spaceresource vector(268258,73549,0) -82 1 [1]
createmodel player17 spaceresource vector(67739,332035,0) -16 1 [1]
createmodel player17 spaceresource vector(277659,470907,0) 163 1 [1]
createmodel player17 spaceresource vector(79983,57652,0) 168 1 [1]
createmodel player17 spaceresource vector(68281,484439,0) 176 1 [1]
createmodel player17 spaceresource vector(466100,59789,0) 137 1 [1]
createmodel player17 spaceresource vector(152040,167176,0) -87 1 [1]

positioncamera vector(4.48940e5,2.54305e5,-100.0000) vector(0.0000,0.0000,51.4351) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000)

new database entry
cloakcruiser
affect all temporal mods
fullname Cloak Cruiser
price 2200
buildtime 35000
unitflagrequired 1
techlevel 12
unitscale 1
healthratio 5
modeltype 2
deathtype 2
armor 1000
damage 200		--more damage (standard damage was 75)
speed1 650*4	--four times the regular Gamma Cruiser speed
speed2 60
speed3 400
weapondistance 300%		--adjust the max see/fire distance by 200%
gridtype -5
initialstate 82
cantarget [1,2,3,10]
canattack [1,2,3,10,50]
candeploy yes
power 100
sounds deploy ["transport01_02"]
sounds undeploy ["transport01_02"]
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"]
addspecial 1    --is a radar
addspecial 3    --can't be sold
addspecial 59    --create a radar beacon when entered the world
addspecial 70    --is a cloaking device
addspecial 72    --is a spy-type building
addspecial 81    --affect only friendly units
affectradius 9000        --distance where the cloak effects
deploydelay 3400
undeploydelay 3000
animationtype 2        --has custom animation
animation 0 0 250 no yes yes        --idle
animation 3 250 500 no no no        --move forward
animation 700 500 750 no no no    --before stops
animation 20 900 1000 no no no    --deploy
animation 21 1000 1100 yes no yes    --in deployment
animation 22 1100 1200 no no no    --undeploy
healthanimation <=0 double_shockwave_explosion 20000
#end

new database entry
crysentos
affect all temporal mods
fullname Celestial Crysentos
price 3500
buildtime 50000
unitflagrequired 1
techlevel 7
unitscale 1
healthratio 6
modeltype 2
armor 5000
damage 40
speed1 500*3
speed2 60
speed3 400
weapondistance 150%		--adjust the max see/fire distance by 50%
initialstate 82
gridtype -2
canbuild 3 [777] ["agathon"]    --state 777 means: all states
cantarget [1,2,3,4,10]
canattack [1,2,3,4,10,50]
lifetime 50
sounds created ["crysentos_created1","crysentos_created2","crysentos_created3","crysentos_created1","crysentos_created2","crysentos_created3","crysentos_created4"]
sounds selected ["crysentos_selected1","crysentos_selected2","crysentos_created3","crysentos_selected1","crysentos_selected2","crysentos_selected3","crysentos_selected1","crysentos_selected2","crysentos_selected4"]
sounds move ["crysentos_move1","crysentos_move2","crysentos_move3","crysentos_move1","crysentos_move2","crysentos_move3","crysentos_move4"]
sounds attack ["crysentos_attack1","crysentos_attack2","crysentos_attack3","crysentos_attack1","crysentos_attack2","crysentos_attack3","crysentos_attack4"]
--addspecial 7    --fire weapons in chain-fire
--addspecial 33    --only accept resources when weapons are more than half-empty
--addspecial 35    --reload own weapons INSTEAD of accepting resource money
addspecial 200    --animate weapon models
animationtype 2        --has custom animation
animation 0 0 150 yes yes yes        --idle
animation 3 150 300 no no no    --move forward
animation 700 300 450 no no no    --before stops
--animation 800 100 150 yes yes yes    --fire weapon
--canreceive 5        --can receive weapon-reload resource from Sentos
--BELOW: we override Crysento's weapons allowing them to auto-reload every second
weapon projectile_vr_streamrocket snd_streamrocket 1 1 5000 0 20 1000 1000 20 200 12000 90 90 20
weapon projectile_vr_streamrocket snd_streamrocket 1 1 5000 0 20 1000 1000 20 200 12000 90 90 20
healthanimation <=0 double_shockwave_explosion 20000
#end

process database

--BELOW: generic camera position:
positioncamera vector(4.48940e5,2.54305e5,-100.0000) vector(0.0000,0.0000,51.4351) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000)

--BELOW: specific camera positions for each of the players:
positioncamera1 vector(4.48940e5,2.54305e5,-100.0000) vector(0.0000,0.0000,51.4351) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000)
positioncamera2 vector(2.72845e5,7.29763e4,-100.0000) vector(0.0000,0.0000,-14.6638) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000)
positioncamera3 vector(1.52146e5,1.62294e5,-100.0000) vector(0.0000,0.0000,-91.7187) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000)
positioncamera4 vector(2.20755e5,3.17314e5,-100.0000) vector(0.0000,0.0000,-137.4330) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000
positioncamera5 vector(4.80732e5,3.80230e5,-100.0000) vector(0.0000,0.0000,155.0756) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000)
positioncamera6 vector(7.87592e4,4.32274e5,-100.0000) vector(0.0000,0.0000,-122.4572) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000
positioncamera7 vector(3.06342e5,2.28941e5,-100.0000) vector(0.0000,0.0000,-98.6562) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000)
positioncamera8 vector(4.55319e5,2.54944e5,-100.0000) vector(0.0000,0.0000,-161.3032) vector(0.0000,-2.70000e4,9.12500e3) vector(0.0000,0.0000,0.0000

set screensize 100 0
fadehud instantout

--BELOW: make sure the user is granted no starting or bunus units
--all units will be given to the player by the QCore IF statements
clear startingunit
clear bonusunit

--BELOW: this is an 6 player game:
set maxplayers 6

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

--------------
-- MUSIC
--------------

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

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

**** PLAYER SCORES CALCULATIONS - START
**** PLAYER SCORES CALCULATIONS - START

--BELOW: a core-level function will turn on tracking for
--individual unit and structure kills done by each player
--(by default, this function is turned OFF)
--later on, we can access this info via the syntax: playerunitkills[playernumber]
set unitkilltracking on

--BELOW: if the player clicks the "Recon" HUD button
--the game scores will be updated
--the "show" part of the statement indicates that this IF
--statement should only be triggered when the "Recon" window
--is shown to the player. If the word "show" is missing from the
--command, then the IF statement will be triggered by any HUD
--button which relates to the "Recon" window.
if lastbuttonclicked recon show
--BELOW: we clear the info from the last HUD button click
--otherwise this IF statement will be executed again:
    clear lastbuttonclicked
    set flag 99 to 1
    repeat this if
    reset timer 99
end if

--BELOW: the scores will also be generated automatically every
--60 seconds:
if timer 99 >= 60000
    set flag 99 to 1
    reset timer 99
    repeat this if
end if

--BELOW: notice that the recon info on the player scores is created
--locally (the "network" prefix is not used)
if flag 99 = 1
    set flag 99 to 0
--BELOW: we update the names of active players
    update playernames
--notice that later on (below) we will reference each of the player
--names via the syntax: playername[playernumber]
--BELOW: we update the player-unit-kills
    update playerunitkills
--BELOW: clear the recon text and create the new info
    clear recontext
    recontext
    recontext @SOLE @SURVIVOR - @PLAYER @SCORES
    recontext
    recontext playername[1] - Player 1 - Kills: playerunitkills[1]
    recontext playername[2] - Player 2 - Kills: playerunitkills[2]
    recontext playername[3] - Player 3 - Kills: playerunitkills[3]
    recontext playername[4] - Player 4 - Kills: playerunitkills[4]
    recontext playername[5] - Player 5 - Kills: playerunitkills[5]
    recontext playername[6] - Player 6 - Kills: playerunitkills[6]
--    recontext playername[7] - Player 7 - Kills: playerunitkills[7]
--    recontext playername[8] - Player 8 - Kills: playerunitkills[8]
    recontext
    recontext Globex AI - Kills: playerunitkills[10]
    recontext
--BELOW: make sure that the recon text is refreshed, even if the recon
--window is already visible:
    refreshrecontext
    repeat this if
end if

--BELOW: since the scores and info are generated locally, it will
--be possible for recently joined players to not have the updated
--player-unit-kills info. Because of this, Player 1 (host) will force
--and update of the individual player scores every 60 seconds:
if timer 100 >= 60000
and playernumber = 1
--BELOW: we update the player-unit-kills, which can then be referenced
--using the syntax: playerunitkills[playernumber]
    update playerunitkills
--BELOW: we send the player-unit-kills stats to each of the active players in the game via the "network" prefix
--the syntax of the command is: set playerunitkills time playernumber numberofkills
    network set playerunitkills 1 1 playerunitkills[1]
    network set playerunitkills 1 2 playerunitkills[2]
    network set playerunitkills 1 3 playerunitkills[3]
    network set playerunitkills 1 4 playerunitkills[4]
    network set playerunitkills 1 5 playerunitkills[5]
    network set playerunitkills 1 6 playerunitkills[6]
    network set playerunitkills 1 7 playerunitkills[7]
    network set playerunitkills 1 8 playerunitkills[8]
    network set playerunitkills 1 10 playerunitkills[10]
    reset timer 100
    repeat this if
end if

**** PLAYER SCORES CALCULATIONS - ENDS
**** PLAYER SCORES CALCULATIONS - ENDS

***** ALERTS AND SOUNDS - START
***** ALERTS AND SOUNDS - START

if flag 1 = 11
and timer 1 >= 5000
and soundchannel 1 is free
--BELOW: flag 2 will hold a random number between 1 and 10
    set flag 2 to random(10)
    set flag 1 + 1
    reset timer 1
end if

--BELOW: standard intro line
if flag 1 = 12
and flag 2 <> 1
and soundchannel 1 is free
    playglobalsound 1 99 blairss001
    comsatline >> Col. Blair: Welcome back Commander ... It is time to prove your skills in the Sole Survivor! rgb(255,255,255)
    set flag 1 + 1
end if

--BELOW: the player has a 1 in 10 chance of hearing the following line:
if flag 1 = 12
and flag 2 = 1
and soundchannel 1 is free
    playglobalsound 1 99 blairss002
    comsatline >> Col. Blair: Commander ... welcome to the Sole Survivor! ... God I love saying that! rgb(255,255,255)
    set flag 1 + 1
end if

--BELOW: standard intro line
if flag 1 = 13
and soundchannel 1 is free
    playglobalsound 1 99 blairss003
    comsatline >> Col. Blair: I am going to assume you know what you're doing ... if not, head on over to the Tasks menu of your HUD, and I will run through the basics once more. rgb(255,255,255)
    set flag 1 + 1
end if

if flag 1 = 14
and soundchannel 1 is free
    highlighthud tasks
    set flag 1 + 1
end if

--BELOW: Blair tell player more about the level:
if timer 99 >= 5000
and flag 1 >= 14
and lastbuttonclicked tasks show
--BELOW: we clear the info from the last HUD button click
--otherwise this IF statement will be executed again:
    clear lastbuttonclicked
    set flag 1 to 20
    reset timer 99
    repeat this if
end if

if flag 1 = 20
and soundchannel 1 is free
    playglobalsound 1 99 blairss004
    comsatline >> Col. Blair: Alright Commander ... the rules are simple ... your only task is to survive! You will be granted a single modified cruiser, and it is your job to kill the enemy, before they kill you. rgb(255,255,255)
    set flag 1 + 1
end if

if flag 1 = 21
and soundchannel 1 is free
    playglobalsound 1 99 blairss005
    comsatline >> Col. Blair: The Recon menu will keep track of everyone's score. Just make sure you do not end up at the bottom of the ladder. You have nothing to lose Commander ... except the small shreds of dignity you have left. rgb(255,255,255)
    set flag 1 + 1
    highlighthud recon
end if

--BELOW: the sample is only played the player is a host:
if flag 1 = 22
and playernumber = 1
and soundchannel 1 is free
    playglobalsound 1 99 blairss006
    comsatline >> Col. Blair: One more thing ... if no other human opponents join the mission, the Globex drones will do their best to keep you busy ... and since they will have the upper hand, you will granted an addition cruiser. rgb(255,255,255)
    set flag 1 + 1
end if

if flag 1 = 22
and playernumber <> 1
and soundchannel 1 is free
    set flag 1 + 1
end if

--BELOW: standard last line said by Blair:
if flag 1 = 23
and flag 2 <> 1
and soundchannel 1 is free
    playglobalsound 1 99 blairss007
    comsatline >> Col. Blair: Now ... let's see what you've made of! ... Blair out. rgb(255,255,255)
    set flag 1 + 1
end if

--BELOW: once again, the player has 1 in 10 chance in hearing the following line:
if flag 1 = 23
and flag 2 = 1
and timer 1 >= 100
and soundchannel 1 is free
    playglobalsound 1 99 blairss008
    comsatline >> Col. Blair: And now, let's GET READY TO SOLE SURVIVE! rgb(255,255,255)
    set flag 1 + 1
    reset timer 1
end if

if flag 1 = 24
and flag 2 = 1
and timer 1 >= 9000
and soundchannel 1 is free
    playglobalsound 1 99 blairss009
    comsatline >> Col. Blair: Alright I admit ... that sounded pretty awful ... in fact, I am going to make a personal note to never say that again ... Blair out. rgb(255,255,255)
    set flag 1 + 1
    reset timer 1
end if

***** ALERTS AND SOUNDS - END
***** ALERTS AND SOUNDS - END
