Hidden/Spoiler:
--
-- 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;
-- These variables do not change
ATT = REP;
DEF = CIS;
function ScriptPostLoad()
SetAIDifficulty(0, 2, "hard")
EnableSPScriptedHeroes()
ScriptCB_SetGameRules("campaign")
DisableAIAutoBalance()
KillObject ("cp3")
KillObject ("cp1")
KillObject ("cp2")
KillObject ("tankdrop1")
onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)
ShowMessageText("changeme", ATT)
end
end)
--Get to the rally becon
Objective1 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "level.LPR.campaign.regroup1", popupText = "level.LPR.campaign.popup1",
regionName = "goto1", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}
Objective1.OnStart = function(self)
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, false)
att_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj1_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("rep_walk_atte_beacon", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)
end
Objective1.OnComplete = function(self)
DeleteAIGoal(att_obj1_aigoal)
DeleteAIGoal(def_obj1_aigoal)
RespawnObject("cp3")
RespawnObject("cp2")
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("rep_walk_atte_beacon")
ATTReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, ATTReinforcementCount + 15)
end
--Hold the rally point--
Objective2CP = CommandPost:New{name = "cp3"}
Objective2 = ObjectiveConquest:New{teamATT = DEF, teamDEF = ATT, textDEF = "level.LPR.campaign.regroupend1", popupText = "level.LPR.campaign.popup2", timeLimit = 120}
Objective2:AddCommandPost(Objective2CP)
Objective2.OnStart = function (self)
DEFGoal = AddAIGoal (DEF,"Conquest", 100, "cp3")
ATTGoal = AddAIGoal (ATT,"Defend", 100, "cp3")
MapAddEntityMarker("cp3", "hud_objective_icon_circle", 4.0, ATT, "YELLOW", true)
SetProperty ("cp3", "AISpawnWeight", 100)
SetProperty ("cp2", "AISpawnWeight", 100)
KillObject ("cp4")
AllowAISpawn(ATT, true)
AllowAISpawn(DEF, true)
end
Objective2.OnComplete = function (self)
MapRemoveEntityMarker("cp3")
ATTReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, ATTReinforcementCount + 15)
DeleteAIGoal(DEFGoal)
DeleteAIGoal(ATTGoal)
end
-- Aquire Objective 3 -------------------------------------------------------------
-- Get the radio working and call for backup--
Objective3 = ObjectiveCTF:New{teamATT = ATT, teamDEF = DEF, captureLimit = 1, text = "level.LPR.campaign.capture1", popupText = "level.LPR.campaign.popup3"}
Objective3:AddFlag{name = "pol_icon_disk", captureRegion = "Team1_Capture",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0}
Objective3.OnStart = function (self)
AICanCaptureCP("cp3", DEF, false)
disk_capture_on = OnFlagPickUp(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapAddEntityMarker("cp3", "hud_objective_icon_circle", 4.0, ATT, "YELLOW", true)
end
end,
"pol_icon_disk"
)
disk_capture_off = OnFlagDrop(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapRemoveEntityMarker("cp3")
end
end,
"pol_icon_disk"
)
SetProperty ("cp3", "AISpawnWeight", 100)
DEFGoal = AddAIGoal (DEF, "Deathmatch" , 100)
ATTGoal = AddAIGoal (ATT, "Defend" , 100, "cp3")
AMBGoal = AddAIGoal (AMB, "Deathmatch", 1)
-- spawn Holodisk
Holocron1Spawn = GetPathPoint("HolodiskSpawn", 0) --gets the path point
CreateEntity("pol_icon_disk", Holocron1Spawn, "pol_icon_disk") --spawns the disk
SetProperty ("pol_icon_disk", "AllowAIPickUp", 0)
end
Objective3.OnComplete = function (self)
DeleteAIGoal(DEFGoal)
DeleteAIGoal(ATTGoal)
ReleaseFlagPickUp(disk_capture_on)
ReleaseFlagDrop(disk_capture_off)
OBJ2_ReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, OBJ2_ReinforcementCount + 40)
ShowMessageText("game.objectives.complete", ATT)
if self.winningTeam == self.teamDEF then
end
end
end
function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 2)
StartTimer(beginobjectivestimer)
end
function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 5}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:AddObjectiveSet(Objective2)
objectiveSequence:AddObjectiveSet(Objective3)
objectiveSequence:Start()
end
-- 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;
-- These variables do not change
ATT = REP;
DEF = CIS;
function ScriptPostLoad()
SetAIDifficulty(0, 2, "hard")
EnableSPScriptedHeroes()
ScriptCB_SetGameRules("campaign")
DisableAIAutoBalance()
KillObject ("cp3")
KillObject ("cp1")
KillObject ("cp2")
KillObject ("tankdrop1")
onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)
ShowMessageText("changeme", ATT)
end
end)
--Get to the rally becon
Objective1 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "level.LPR.campaign.regroup1", popupText = "level.LPR.campaign.popup1",
regionName = "goto1", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}
Objective1.OnStart = function(self)
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, false)
att_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj1_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("rep_walk_atte_beacon", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)
end
Objective1.OnComplete = function(self)
DeleteAIGoal(att_obj1_aigoal)
DeleteAIGoal(def_obj1_aigoal)
RespawnObject("cp3")
RespawnObject("cp2")
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("rep_walk_atte_beacon")
ATTReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, ATTReinforcementCount + 15)
end
--Hold the rally point--
Objective2CP = CommandPost:New{name = "cp3"}
Objective2 = ObjectiveConquest:New{teamATT = DEF, teamDEF = ATT, textDEF = "level.LPR.campaign.regroupend1", popupText = "level.LPR.campaign.popup2", timeLimit = 120}
Objective2:AddCommandPost(Objective2CP)
Objective2.OnStart = function (self)
DEFGoal = AddAIGoal (DEF,"Conquest", 100, "cp3")
ATTGoal = AddAIGoal (ATT,"Defend", 100, "cp3")
MapAddEntityMarker("cp3", "hud_objective_icon_circle", 4.0, ATT, "YELLOW", true)
SetProperty ("cp3", "AISpawnWeight", 100)
SetProperty ("cp2", "AISpawnWeight", 100)
KillObject ("cp4")
AllowAISpawn(ATT, true)
AllowAISpawn(DEF, true)
end
Objective2.OnComplete = function (self)
MapRemoveEntityMarker("cp3")
ATTReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, ATTReinforcementCount + 15)
DeleteAIGoal(DEFGoal)
DeleteAIGoal(ATTGoal)
end
-- Aquire Objective 3 -------------------------------------------------------------
-- Get the radio working and call for backup--
Objective3 = ObjectiveCTF:New{teamATT = ATT, teamDEF = DEF, captureLimit = 1, text = "level.LPR.campaign.capture1", popupText = "level.LPR.campaign.popup3"}
Objective3:AddFlag{name = "pol_icon_disk", captureRegion = "Team1_Capture",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0}
Objective3.OnStart = function (self)
AICanCaptureCP("cp3", DEF, false)
disk_capture_on = OnFlagPickUp(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapAddEntityMarker("cp3", "hud_objective_icon_circle", 4.0, ATT, "YELLOW", true)
end
end,
"pol_icon_disk"
)
disk_capture_off = OnFlagDrop(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapRemoveEntityMarker("cp3")
end
end,
"pol_icon_disk"
)
SetProperty ("cp3", "AISpawnWeight", 100)
DEFGoal = AddAIGoal (DEF, "Deathmatch" , 100)
ATTGoal = AddAIGoal (ATT, "Defend" , 100, "cp3")
AMBGoal = AddAIGoal (AMB, "Deathmatch", 1)
-- spawn Holodisk
Holocron1Spawn = GetPathPoint("HolodiskSpawn", 0) --gets the path point
CreateEntity("pol_icon_disk", Holocron1Spawn, "pol_icon_disk") --spawns the disk
SetProperty ("pol_icon_disk", "AllowAIPickUp", 0)
end
Objective3.OnComplete = function (self)
DeleteAIGoal(DEFGoal)
DeleteAIGoal(ATTGoal)
ReleaseFlagPickUp(disk_capture_on)
ReleaseFlagDrop(disk_capture_off)
OBJ2_ReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, OBJ2_ReinforcementCount + 40)
ShowMessageText("game.objectives.complete", ATT)
if self.winningTeam == self.teamDEF then
end
end
end
function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 2)
StartTimer(beginobjectivestimer)
end
function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 5}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:AddObjectiveSet(Objective2)
objectiveSequence:AddObjectiveSet(Objective3)
objectiveSequence:Start()
end



