[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("MultiObjectiveContainer")
ScriptCB_DoFile("ObjectiveAssault")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("ObjectiveGoto")
ScriptCB_DoFile("ObjectiveCTF")
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_DoFile("Ambush")
ScriptCB_DoFile("setup_teams")
-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
WOK = 3;
GEO = 4;
-- These variables do not change
ATT = REP;
DEF = CIS;
AmbushTeam = 5
ATM = AmbushTeam
AmbushTeam2 = 6
DRD = AmbushTeam2
AmbushTeam3 = 7
CLN = AmbushTeam3
function ScriptPostLoad()
SetAIDifficulty(0, 2, "hard")
AllowAISpawn(ATT, true)
AllowAISpawn(DEF, true)
AllowAISpawn(WOK, false)
AllowAISpawn(GEO, false)
ScriptCB_SetGameRules("campaign")
onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ShowPopup("level.geo1.hints.hints")
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)
end
end)
KillObject ("cp3")
KillObject ("zem_cp_droiddispenser3")
KillObject ("zem_cp_droiddispenser2")
KillObject ("zem_cp_droiddispenser1")
KillObject ("zem_cp_droiddispenser")
PlayAnimation("gunship3")
SetProperty ("cp7","Team",4)
SetProperty("cp1", "MaxHealth", 999999)
SetProperty("cp1", "CurHealth", 999999)
SetProperty("cp4", "MaxHealth", 999999)
SetProperty("cp4", "CurHealth", 999999)
SetProperty("zem_cp_droiddispensercp6", "MaxHealth", 999999)
SetProperty("zem_cp_droiddispensercp6", "CurHealth", 999999)
SetProperty("tan4_prop_Console1", "MaxHealth", 999999)
SetProperty("tan4_prop_Console1", "CurHealth", 999999)
SetProperty("pol1_prop_control_console", "MaxHealth", 999999)
SetProperty("pol1_prop_control_console", "CurHealth", 999999)
--Destroy the turrets
Objective1= ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.FMB.firsttext", popupText = "level.FMB.pop.firstpopuptext"}
Dclass = TargetType:New{classname = "tur_bldg_spa_imp_beam", killLimit = 2}
Objective1:AddTarget(Dclass)
Objective1.OnStart = function(self)
Objective1.Dclass_cpGoal1 = AddAIGoal(ATT, "Follow", 100, 0)
Objective1.Dclass_cpGoal2 = AddAIGoal(DEF, "Destroy", 100, 0)
end
Objective1.OnComplete = function(self)
DeleteAIGoal(Objective1.Dclass_cpGoal2)
AllowAISpawn(GEO, true)
AddAIGoal(GEO, "Deathmatch", 100)
end
--kill the Acklays
Objective2= ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.FMB.10text", popupText = "level.FMB.pop.10popuptext"}
Dclass = TargetType:New{classname = "geo_inf_acklay", killLimit = 2}
Objective2:AddTarget(Dclass)
Objective2.OnStart = function(self)
end
Objective2.OnComplete = function(self)
AllowAISpawn(WOK, true)
AddAIGoal(WOK, "Deathmatch", 100)
PlayAnimation("Laatc")
PlayAnimation("Laatc2")
PlayAnimation("center")
PlayAnimation("gunship1")
PlayAnimation("anim")
UnlockHeroForTeam(ATT)
SetProperty("cp1", "MaxHealth", 12000)
SetProperty("cp1", "CurHealth", 12000)
SetProperty("cp4", "MaxHealth", 12000)
SetProperty("cp4", "CurHealth", 12000)
SetProperty("zem_cp_droiddispensercp6", "MaxHealth", 12000)
SetProperty("zem_cp_droiddispensercp6", "CurHealth", 12000)
end
--Kill the droid thingys
Objective3= ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.FMB.secondtext", popupText = "level.FMB.pop.secondpoputext"}
Dclass = TargetType:New{classname = "zem_cp_droiddispenser", killLimit = 3}
Objective3:AddTarget(Dclass)
Objective3.OnStart = function(self)
Objective2.Dclass_cpGoal2 = AddAIGoal(DEF, "Deathmatch", 100)
end
Objective3.OnComplete = function(self)
SetProperty("tan4_prop_Console1", "MaxHealth", 600)
SetProperty("tan4_prop_Console1", "CurHealth", 600)
end
--Destory the tantive console
Dobjekt = Target:New{name = "tan4_prop_Console1"}
Dobjekt.OnDestroy = function(self)
end
Objective4 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.FMB.thirdtext", popupText = "level.FMB.pop.thirdpopuptext"}
Objective4:AddTarget(Dobjekt)
Objective4.OnStart = function(self)
end
Objective4.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
PlayAnimation("doorright")
PlayAnimation("doorleft")
PlayAnimation("door1")
RespawnObject("cp3")
RespawnObject("zem_cp_droiddispenser3")
SetupAmbushTrigger("droidambush_region", "droidambush_spawn", 4, 6)
end
--Capture cp 3
Objective5CP = CommandPost:New{name = "cp3"}
Objective5 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "level,FMB.fourthtext", popupText = "level.FMB.pop.fourthpopuptext", AIGoalWeight = 0}
Objective5:AddCommandPost(Objective5CP)
Objective5:AddHint("level.geo1.hints.capture_cp")
Objective5.OnStart = function(self)
AICanCaptureCP("cp3", ATT, false)
AICanCaptureCP("cp3", DEF, true)
end
Objective5.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
SetProperty("cp3", "Team", 1)
SetProperty("cp3", "CaptureRegion", "")
RespawnObject("zem_cp_droiddispenser2")
RespawnObject("zem_cp_droiddispenser1")
RespawnObject("zem_cp_droiddispenser")
SetProperty("pol1_prop_control_console", "MaxHealth", 900)
SetProperty("pol1_prop_control_console", "CurHealth", 900)
end
--objective: assault
Dobjekt = Target:New{name = "pol1_prop_control_console"}
Dobjekt.OnDestroy = function(self)
end
Objective6 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.FMB.5text", popupText = "level.FMB.pop.5popuptext"}
Objective6:AddTarget(Dobjekt)
Objective6.OnStart = function(self)
end
Objective6.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
end
--objective: assault
Dobjekt = Target:New{name = "zem_cp_droiddispenser3"}
Dobjekt.OnDestroy = function(self)
end
Objective7 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.FMB.6text", popupText = "level.FMB.pop.6popuptext"}
Objective7:AddTarget(Dobjekt)
Objective7.OnStart = function(self)
end
Objective7.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
end
--Go to the region
Objective8 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "level.FMB.7text", popupText = "level.FMB.pop.7popuptext",
regionName = "goto1", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}
Objective8:AddHint("level.geo1.hints.movement")
Objective8:AddHint("level.geo1.hints.obj_markers")
Objective8:AddHint("level.geo1.hints.review_objectives")
Objective8:AddHint("level.geo1.hints.sprint")
Objective8.OnStart = function(self)
MapAddEntityMarker("goto1", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)
end
Objective8.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("goto1")
AllowAISpawn(DEF, false)
Ambush("ambushpath", 1, 5)
end
--Kill the mandalorian
Objective9= ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "level.FMB.8text", popupText = "level.FMB.pop.8popuptext"}
Dclass = TargetType:New{classname = "cis_hero", killLimit = 1}
Objective9:AddTarget(Dclass)
Objective9.OnStart = function(self)
end
Objective9.OnComplete = function(self)
PlayAnimation("pl1")
PlayAnimation("gun")
SetupAmbushTrigger("clnambush", "cln_spawn", 11, 7)
end
--Go to the region2
Objective10 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "level.FMB.11text", popupText = "level.FMB.pop.11popuptext",
regionName = "goto2", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 1}
Objective10:AddHint("level.geo1.hints.movement")
Objective10:AddHint("level.geo1.hints.obj_markers")
Objective10:AddHint("level.geo1.hints.review_objectives")
Objective10:AddHint("level.geo1.hints.sprint")
Objective10.OnStart = function(self)
MapAddEntityMarker("goto2", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)
end
Objective10.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("goto2")
PlayAnimation("gun2")
end
end
function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 3)
StartTimer(beginobjectivestimer)
end
function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 9}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:AddObjectiveSet(Objective2)
objectiveSequence:AddObjectiveSet(Objective3)
objectiveSequence:AddObjectiveSet(Objective4)
objectiveSequence:AddObjectiveSet(Objective5)
objectiveSequence:AddObjectiveSet(Objective6)
objectiveSequence:AddObjectiveSet(Objective7)
objectiveSequence:AddObjectiveSet(Objective8)
objectiveSequence:AddObjectiveSet(Objective9)
objectiveSequence:AddObjectiveSet(Objective10)
objectiveSequence:Start()
end
---------------------------------------------------------------------------
-- 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()
SetUberMode(1);
ReadDataFile("ingame.lvl")
ReadDataFile("dc:Load\\FMBscreen.lvl")
SetMaxFlyHeight(100)
SetMaxPlayerFlyHeight (100)
SetMemoryPoolSize ("ClothData",400)
SetMemoryPoolSize ("Combo",500) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",1000) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",1000) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",1000) -- should be ~1x #combo
SetMemoryPoolSize ("EntityCloth",400)
SetMemoryPoolSize ("Music", 200)
ReadDataFile("sound\\fel.lvl;fel1cw")
ReadDataFile("dc:sound\\ABC.lvl;ABCcw")
ReadDataFile("SIDE\\geo.lvl",
"geo_inf_acklay")
ReadDataFile("dc:SIDE\\turFMB.lvl",
"tur_bldg_recoilless_fel_auto",
"tur_bldg_spa_imp_recoilless",
"tur_bldg_chaingun_roof")
ReadDataFile("dc:SIDE\\spaFMB.lvl")
ReadDataFile("dc:SIDE\\PloKoon.lvl",
"rep_hero_PloKoon")
ReadDataFile("dc:SIDE\\Republic.lvl")
ReadDataFile("dc:SIDE\\327th.lvl",
"rep_327th_clon1",
"rep_327th_clon2",
"rep_327th_clon3",
"rep_327th_clon4",
"rep_327th_clon5",
"rep_327th_clon6",
"rep_327th_clon7",
"rep_327th_clon8",
"rep_327th_clon9")
ReadDataFile("dc:SIDE\\fed.lvl",
"cis_droid1",
"cis_droid2",
"cis_droid4",
"cis_droid5",
"cis_hero")
ReadDataFile("dc:SIDE\\veh.lvl",
"cis_hover_aat",
"rep_fly_gunship",
"rep_hover_fightertank")
SetupTeams{
rep = {
team = REP,
units = 10,
reinforcements = -1,
soldier = { "rep_327th_clon1",1,2},
pilot = { "rep_327th_clon2",1,2},
assault = { "rep_327th_clon3",1,2},
sniper = { "rep_327th_clon4",1,2},
marine = { "rep_327th_clon5",1,2},
engineer = { "rep_327th_clon6",1,2},
officer = { "rep_327th_clon7",0,0},
special = { "rep_327th_clon8",0,0},
commander = { "rep_327th_clon9",1,1},
},
cis = {
team = CIS,
units = 45,
reinforcements = -1,
soldier = { "cis_droid1",9, 55},
assault = { "cis_droid2",1, 6},
engineer = { "cis_droid4",1, 6},
officer = {"cis_droid5",1, 10},
},
geo = {
team = GEO,
units = 1,
reinforcements = 2,
soldier = {"geo_inf_acklay", 2, 2},
},
atm = {
team = ATM,
units = 1,
reinforcements = -1,
soldier = {"cis_hero", 1, 1},
},
drd = {
team = DRD,
units = 4,
reinforcements = -1,
soldier = {"cis_droid5", 4, 4},
},
cln = {
team = CLN,
units = 11,
reinforcements = -1,
soldier = {"rep_327th_clon2", 5, 5},
pilot = {"rep_327th_clon3", 5, 5},
assault = {"rep_327th_clon8", 1, 1},
}
}
SetTeamName(ATM, CIS)
SetTeamAsEnemy(ATM, REP)
SetTeamAsEnemy(REP, ATM)
SetTeamAsFriend(CIS, ATM)
SetTeamAsFriend(ATM, CIS)
ClearAIGoals(ATM)
AddAIGoal(ATM, "Deathmatch", 100)
SetTeamName(DRD, CIS)
SetTeamAsEnemy(DRD, REP)
SetTeamAsEnemy(REP, DRD)
SetTeamAsFriend(CIS, DRD)
SetTeamAsFriend(DRD, CIS)
ClearAIGoals(DRD)
AddAIGoal(DRD, "Deathmatch", 100)
SetTeamName(CLN, REP)
SetTeamAsEnemy(CLN, CIS)
SetTeamAsEnemy(CIS, CLN)
SetTeamAsFriend(REP, CLN)
SetTeamAsFriend(CLN, REP)
ClearAIGoals(CLN)
AddAIGoal(CLN, "Deathmatch", 100)
SetHeroClass(CIS, "cis_hero")
SetHeroClass(REP, "rep_hero_PloKoon")
SetTeamName(3, "locals")
SetTeamIcon(3, "all_icon")
AddUnitClass(3, "rep_327th_clon3",20)
AddUnitClass(3, "rep_327th_clon5",20)
SetUnitCount(3, 40)
SetTeamAsFriend(ATT,3)
SetTeamAsFriend(3,ATT)
SetTeamAsEnemy(DEF,3)
SetTeamAsEnemy(3,DEF)
SetTeamName(4, "locals")
SetTeamIcon(4, "all_icon")
AddUnitClass(4, "geo_inf_acklay",2)
SetUnitCount(4, 2)
SetTeamAsFriend(DEF,4)
SetTeamAsFriend(4,DEF)
SetTeamAsEnemy(ATT,4)
SetTeamAsEnemy(4,ATT)
-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 9) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 9) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(2, 9) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 9) -- 2 attes with 3 leg pairs each
local weaponcnt = 2404
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 1000)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 2000)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:ABC\\FMB.lvl", "FMB_conquest")
SetDenseEnvironment("false")
-- Sound Stats
voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)
voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)
OpenAudioStream("sound\\global.lvl", "cw_music")
OpenAudioStream("dc:sound\\ABC.lvl", "ABC_stream")
OpenAudioStream("sound\\fel.lvl", "fel1")
OpenAudioStream("sound\\fel.lvl", "fel1")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
-- OpenAudioStream("sound\\fel.lvl", "fel1_emt")
SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)
SetOutOfBoundsVoiceOver(1, "Repleaving")
SetOutOfBoundsVoiceOver(2, "Cisleaving")
SetAmbientMusic(REP, 1.0, "rep_fel_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_fel_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2,"rep_fel_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_fel_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_fel_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2,"cis_fel_amb_end", 2,1)
SetVictoryMusic(REP, "rep_fel_amb_victory")
SetDefeatMusic (REP, "rep_fel_amb_defeat")
SetVictoryMusic(CIS, "cis_fel_amb_victory")
SetDefeatMusic (CIS, "cis_fel_amb_defeat")
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")
AddCameraShot(0.405418, 0.018834, -0.912953, 0.042412, 156.734161, 6.037713, 180.226318);
end
[/code]