--Sector 185 - BETA PRACTICE EDITION
--unlimited money and high pop cap

clear resources from last level
show loading video

*****     BELOW: BETA TESTER and MOD user test     *****
*****     BELOW: BETA TESTER and MOD user test     *****
if timer 1 >= 0
    settechlevel 1 1 [0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,17,18,19,20]
    settechlevel 1 2 [0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,17,18,19,20]
    settechlevel 1 3 [0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,17,18,19,20]
    settechlevel 1 4 [0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,17,18,19,20]
end if

if theBetaTesterList.findpos(sPlayer1Name) = 0
and theModList.findpos(sPlayer1Name) = 0
and theAdminList.findpos(sPlayer1Name) = 0
    removetechlevel 1 playernumber 19
    removetechlevel 1 playernumber 20
end if
*****     ABOVE: BETA TESTER and MOD user test     *****
*****     ABOVE: BETA TESTER and MOD user test     *****

if timer 1 >= 0
    reset timer 1
    reset timer 5
    reset timer 9
end if

--below: auto money
if timer 9 >= 10000
and aTime[1].aPlayer[playernumber].themoney < 10000
    setplayermoney 1 1 +500
    playglobalsound 2 99 moneydrop01
    reset timer 9
    repeat this if
end if

if timer 1 >= 10000
    setmaxunits 1 1 99
    reset timer 1
    set flag 1 to 1
    cleartasks 1 p1real
    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
    addtask 1 p1real hold_sector pending secondary attack enemy units north of your position
end if

if flag 1 = 1
and timer 1 >= 100
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 ** Welcome to the Practice Map. rgb(0,255,0)
    set flag 1 to 3
    reset timer 1
end if

if flag 1 = 3
and timer 1 >= 5000
and soundchannel 1 is free
    playglobalsound 3 99 threebeeps01
    comsatline ** Use your high unit-cap and unlimited money to eradicate the enemy north of your position. But watch out, they will regenerate after you defeat them. rgb(0,255,0)
    set flag 1 to 4
    reset timer 1
end if

if flag 1 = 4
and timer 1 >= 3000
and soundchannel 1 is free
    highlighthud tasks
    playglobalsound 1 99 computer011
    comsatline Computer: New task confirmed. rgb(255,255,0)
    set flag 1 to 5
    reset timer 1
end if
 
--BELOW: REGENERATE THE ENEMY
if timer 5 >= 30000
and flag 5 = 0
and totalplayerunits 1 2 <= 0
    set flag 5 to 1
    reset timer 5
    playglobalsound 1 99 computer009
    comsatline Computer: objective complete. rgb(255,255,0)
    repeat this if
end if

if timer 5 >= 30000
and flag 5 = 0
    reset timer 5
    repeat this if
end if

if timer 5 >= 30000
and flag 5 = 1
and totalplayerunits 1 2 <= 0
    createunit 1 2 sdfdestroyer vector(54509,40895,1318) -176.0833 82 0 -1 0
    createunit 1 2 goldenboy vector(58073,46536,1506) -176.7089 82 0 -1 0
    createunit 1 2 goldenboy vector(50584,45958,1319) -176.7089 82 0 -1 0
    createunit 1 2 gammacruiser vector(55409,48115,1464) -176.7089 82 0 -1 0
    createunit 1 2 gammacruiser vector(52977,47962,1413) -176.7089 82 0 -1 0
    createunit 1 2 bowgerus vector(58586,41625,2076) -176.7087 82 0 -1 0
    createunit 1 2 bowgerus vector(50504,40825,1999) -176.6539 82 0 -1 0
    createunit 1 2 bowgerus vector(57946,49301,1732) -176.7089 82 0 -1 0
    createunit 1 2 bowgerus vector(50566,48702,1586) -176.7089 82 0 -1 0
    createunit 1 2 crysentos vector(60696,46576,1643) -176.7089 82 0 -1 0
    createunit 1 2 crysentos vector(47946,45665,1321) -176.7089 82 0 -1 0
    createunit 1 2 crysentos vector(54290,46258,2257) -176.7089 82 0 -1 0
    radarbeacon 1 lastvector 60000
    playglobalsound 1 99 computer018
    comsatline Computer: new threat detected. rgb(255,255,0)
    reset timer 5
    set flag 5 to 2
    repeat this if
end if

if timer 5 >= 30000
and flag 5 >= 1
and totalplayerunits 1 2 >= 1
    reset timer 5
    set flag 5 to 0
    repeat this if
end if
--ABOVE: REGENERATE THE ENEMY

**************** CORE LEVEL CREATION STARTS **************
**************** CORE LEVEL CREATION STARTS **************
**************** CORE LEVEL CREATION STARTS **************

total memory cleanup
set activeworld 1
resetworld 1

load basic configuration

set landpatch land01_gauntlet01
set landdeform off
set landheightmap heightmap_land01_gauntlet01
set landtexture void

set minnewfogdistance 50000
set maxviewdistance 80000

--total memory cleanup
**** 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

copymodel gammacruiser  goldenboycuiser

new database entry
goldenboy
affect all temporal mods
fullname GoldenBoy Cruiser
price 2200
buildtime 35000
unitflagrequired 1
techlevel 11
unitscale 1.5		--unit is 1.5 times bigger
healthratio 5
modeltype 2
armor 3000		--more armor
damage 100		--unit does more damage
speed1 450
speed2 60
speed3 160
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		--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
healthanimation <=0 mammothhazard 0		--hazard cloud will form upon death
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 experiment hazardous offense /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 swarms of smaller units, defense turrets, other cruisers /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 database

copyobject shadow~gammacruiser shadow~goldenboycruiser
 
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

--PRE-BUFFERING OF UNITS
if displayextramodels
    createmodel player0 ftacollector 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 radartower vector(-15000,-15000,-10000) 0 0 [1]
    createmodel player0 flakturret vector(-16000,-16000,-10000) 0 0 [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]

positioncamera vector(5.16982e4,1.39969e5,-100.0000) vector(0.0000,0.0000,176.0635) vector(0.0000,-3.10000e4,5.92906e3) vector(0.0000,0.0000,0.0000)

clear startingunit
add startingunit epsilon omnithias

set maxplayers 1

--ENEMY PLAYER
createmodel player2 sdfdestroyer vector(54509,40895,1318) -176.0833 1.0000 [1]
createmodel player2 advocate vector(58073,46536,1506) -176.7089 1.0000 [1]
createmodel player2 advocate vector(50584,45958,1319) -176.7089 1.0000 [1]
createmodel player2 advocate vector(55409,48115,1464) -176.7089 1.0000 [1]
createmodel player2 advocate vector(52977,47962,1413) -176.7089 1.0000 [1]
createmodel player2 bowgerus vector(58586,41625,2076) -176.7087 1.0000 [1]
createmodel player2 bowgerus vector(50504,40825,1999) -176.6539 1.0000 [1]
createmodel player2 tryphon vector(57946,49301,1732) -176.7089 1.5000 [1]
createmodel player2 tryphon vector(50566,48702,1586) -176.7089 1.5000 [1]
createmodel player2 gammacruiser vector(60696,46576,1643) -176.7089 1.5000 [1]
createmodel player2 gammacruiser vector(47946,45665,1321) -176.7089 1.5000 [1]
createmodel player2 crysentos vector(54290,46258,2257) -176.7089 1.0000 [1]

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

-- **** GENERAL BLAIR SAMPLES ****

if soundchannel 1 is free
and unitstate 1 < 80
and playermoney < 300
    playglobalsound 1 99 snd_blair_lowmoney1
    comsatline >> Col. Blair: We are running low on funds. See if you can create new Collector units and scout the area for more resources. rgb(255,255,255)
    reset timer 1
end if

if soundchannel 1 is free
and hasunit chopper01
and unitstate 2 < 80
and unithealth 2 < 80%
    playglobalsound 1 99 snd_blair_lowcollectorhealth1
    comsatline >> Col. Blair: Our Collector is taking damage. Pull our forces back to provide some cover. rgb(255,255,255)
    reset timer 1
end if

if soundchannel 1 is free
and unitstate 1 < 80
and unithealth 1 < 80%
    playglobalsound 1 99 snd_blair_lowdropshiphealth1
    comsatline >> Col. Blair: The drop-ship is under attack. We need reinforcements back here. rgb(255,255,255)
    reset timer 1
end if

if soundchannel 1 is free
and unitstate 1 < 80
and unithealth 1 < 30%
    playglobalsound 1 99 snd_blair_lowdropshiphealth2
    comsatline >> Col. Blair: Commander, the drop-ship is almost destroyed. I dont know what you are doing, but consider putting it on hold and building us more reinforcements. rgb(255,255,255)
    reset timer 1
    changetask 1 p1real defend_dropship failed
    set flag 1 to 92
end if

if soundchannel 1 is free
and unithealth 1 <= 0%
    playglobalsound 1 99 snd_blair_dropshipdead2
    comsatline >> Col. Blair: Weve lost our drop-ship. I hope you are happy. I will raise HQ on COM-SAT and tell them the bad news. rgb(255,255,255)
    reset timer 1
end if

if soundchannel 1 is free
and sinceenemyjump <= 10000
    playglobalsound 1 99 snd_blair_enemyjump1
    comsatline >> Col. Blair: New jump signature detected. Stay sharp. rgb(255,255,255)
    reset timer 1
end if

if soundchannel 1 is free
and playerlosses >= 1
    playglobalsound 1 99 snd_blair_lost1
    comsatline >> Col. Blair: Good work Commander. Weve lost. Our forces have been defeated, and we have nothing to show for it. I hope this is some sort of sick joke, that way, I can make sure you are relieved of your duties, and are never in position to endanger my troops again. Ill see you back at our head quarters. Blair out. rgb(255,255,255)
    reset timer 1
end if

if soundchannel 1 is free
and playerwins >= 1
    playglobalsound 1 99 snd_blair_won3
    comsatline >> Col. Blair: Oh, Ill bet he didnt see the one coming! Good work commander. But its not game-over yet. Radar indicates possible enemy units in our vicinity. Stand fast. rgb(255,255,255)
    reset timer 1
end if

-- **** GENERAL BLAIR SAMPLES END****

if flag 1 = 92
and timer 1 >= 3000
and soundchannel 1 is free
    playglobalsound 2 99 computer015
    comsatline Computer: Mission failed. rgb(255,255,0)
    highlighthud tasks
    set flag 1 to 93
    reset timer 1
end if

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

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

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

*** GENERAL COMPUTER VOICE START

if soundchannel 1 is free
if flag 19 = 0
and unitstate 1 < 80
and timer 19 >= 60000
and playerpower < 0
    set flag 19 to random(2)
    reset timer 19
    repeat this if
end if

if flag 19 = 1
    playglobalsound 2 99 computer025
    comsatline Computer: Low Power. rgb(255,255,0)
    highlighthud power
    set flag 19 to 3
    repeat this if
end if

if flag 19 = 2
    playglobalsound 2 99 computer026
    comsatline Computer: New generators required. rgb(255,255,0)
    highlighthud power
    set flag 19 to 3
    repeat this if
end if

if flag 19 = 3
and playerpower > 1
    set flag 19 to 0
    repeat this if
end if

if soundchannel 1 is free
and unitstate 1 < 80
and unithealth 1 < 90%
    playglobalsound 2 99 computer034
    comsatline Computer: Drop-ship under fire. rgb(255,255,0)
    reset timer 1
end if

if soundchannel 1 is free
and unitstate 1 < 80
and unithealth 1 < 70%
    playglobalsound 2 99 computer034
    comsatline Computer: Drop-ship under fire. rgb(255,255,0)
    reset timer 1
end if

if soundchannel 1 is free
and unitstate 1 < 80
and unithealth 1 < 50%
    playglobalsound 2 99 computer034
    comsatline Computer: Drop-ship under fire. rgb(255,255,0)
    reset timer 1
end if

if soundchannel 1 is free
and unitstate 1 < 80
and unithealth 1 < 30%
    playglobalsound 2 99 computer034
    comsatline Computer: Drop-ship under fire. rgb(255,255,0)
    reset timer 1
end if

*** GENERAL COMPUTER VOICE END

