---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptInit()
-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2
AddMissionObjective(IMP, "red", "level Korriban.capture and hold command posts");
AddMissionObjective(IMP, "orange", "level Korriban.watch for rebels");
AddMissionObjective(ALL, "red", "level Korriban watch for rebels");
AddMissionObjective(ALL, "orange", "level Korriban capture and hold command posts");
ReadDataFile("sound\\bes.lvl;bes2cw")
ReadDataFile("dc:sound\\hot.lvl;hot1gcw")
ReadDataFile("dc:sound\\tat.lvl;tat1cw")
ReadDataFile("dc:sound\\kas.lvl;kas1cw")
ReadDataFile("dc:sound\\nab.lvl;nab1gcw")
ReadDataFile("sound\\bes.lvl;bes2gcw")
ReadDataFile("SIDE\\rep.lvl",
"rep_bldg_forwardcenter",
"rep_fly_assault_dome",
"rep_fly_gunship",
"rep_fly_gunship_dome",
"rep_fly_jedifighter_dome",
"rep_inf_basic",
"rep_inf_macewindu",
"rep_inf_jet_trooper",
"rep_hover_fightertank",
"rep_hover_speederbike",
"rep_walk_atte")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_basic_tie",
"imp_inf_darthvader",
"imp_walk_atst",
"imp_hover_fightertank",
"imp_walk_atat",
"imp_hover_speederbike",
"imp_inf_dark_trooper");
ReadDataFile("SIDE\\all.lvl",
"all_fly_xwing",
"all_hover_combatspeeder",
"all_inf_basicdesert",
"all_inf_lukeskywalker",
"all_inf_smuggler")
ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter",
"cis_fly_maf",
"cis_hover_aat",
"cis_hover_stap",
"cis_inf_basic",
"cis_inf_countdooku",
"cis_tread_hailfire",
"cis_walk_spider",
"cis_inf_droideka");
SetAttackingTeam(ATT);
-- Alliance Stats
SetTeamName(ALL, "republic")
SetTeamIcon(ALL, "rep_icon")
AddUnitClass(ALL, "rep_inf_clone_trooper",27)
AddUnitClass(ALL, "rep_inf_arc_trooper",5)
AddUnitClass(ALL, "rep_inf_clone_pilot",6)
AddUnitClass(ALL, "rep_inf_clone_sharpshooter",6)
AddUnitClass(ALL, "rep_inf_jet_trooper",3)
SetHeroClass(ALL, "rep_inf_macewindu")
-- Sound Stats
OpenAudioStream("sound\\bes.lvl", "bes2cw_music");
OpenAudioStream("sound\\gcw.lvl", "gcw_vo");
OpenAudioStream("sound\\gcw.lvl", "gcw_tac_vo");
OpenAudioStream("sound\\cw.lvl", "cw_vo");
OpenAudioStream("sound\\cw.lvl", "cw_tac_vo");
OpenAudioStream("sound\\bes.lvl", "bes2");
OpenAudioStream("sound\\bes.lvl", "bes2");
SetBleedingVoiceOver(Rep, Rep, "rep_off_com_report_us_overwhelmed", 1);
SetBleedingVoiceOver(Rep, IMP, "rep_off_com_report_enemy_losing", 1);
SetBleedingVoiceOver(IMP, Rep, "imp_off_com_report_enemy_losing", 1);
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1);
SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1);
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1);
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1);
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1);
SetOutOfBoundsVoiceOver(2, "impleaving");
SetOutOfBoundsVoiceOver(1, "allleaving");
SetAmbientMusic(REP, 1.0, "rep_bes_amb_start", 0,1);
SetAmbientMusic(REP, 0.99, "rep_bes_amb_middle", 1,1);
SetAmbientMusic(REP, 0.1,"rep_bes_amb_end", 2,1);
SetAmbientMusic(CIS, 1.0, "cis_bes_amb_start", 0,1);
SetAmbientMusic(CIS, 0.99, "cis_bes_amb_middle", 1,1);
SetAmbientMusic(CIS, 0.1,"cis_bes_amb_end", 2,1);
SetVictoryMusic(ALL, "all_end_amb_victory");
SetDefeatMusic (ALL, "all_end_amb_defeat");
SetVictoryMusic(IMP, "imp_end_amb_victory");
SetDefeatMusic (IMP, "imp_end_amb_defeat");