Objective3 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "level.mls.obj.3_popup", popupText = "level.mls.obj.3",
regionName = "gotocrash", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}
Objective3.OnStart = function(self)
MapAddEntityMarker("cp6", "hud_objective_icon", 5.0, ATT, "BLUE", true)
SetProperty("cp6", "Team", 5)
SetProperty("cp1", "Allycount", 0)
SetProperty("cp5", "Allycount", 0)
SetProperty("cp8", "Allycount", 0)
AllowAISpawn(5, true)
AllowAISpawn(3, false)
def_obj3_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
t5_obj3_aigoal = AddAIGoal(5, "Defend", 250, "cp6")
end
Objective3.OnComplete = function(self)
DeleteAIGoal(def_obj3_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("cp6")
AICanCaptureCP("cp6", DEF, true)
AICanCaptureCP("cp6", 3, true)
AICanCaptureCP("cp6", 5, true)
end
--defend the cave
Objective4CP = CommandPost:New{name = "cp6"}
Objective4 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "level.mls.obj.4", popupText = "level.mls.obj.4_popup", AIGoalWeight = 0, timeLimit = 120, timeLimitWinningTeam = ATT}--set back to 120
Objective4:AddCommandPost(Objective4CP)
Objective4.OnStart = function(self)
SetProperty("cp6", "Team", 1)
SetProperty("cp6", "Allypath", "cp6_spawn")
SetProperty("camcpb1", "Team", 4)
cp_obj4_aigoal = AddAIGoal(4, "Defend", 200, "cp6")
cp_obj4_aigoal2 = AddAIGoal(DEF, "Defend", 250, "cp6")
end
Objective4.OnComplete = function(self)
SetProperty("cp1", "Allycount", 65536)
SetProperty("cp5", "Allycount", 65536)
SetProperty("cp8", "Allycount", 65536)
AllowAISpawn(3, true)
DeleteAIGoal(cp_obj4_aigoal)
DeleteAIGoal(cp_obj4_aigoal2)
ShowMessageText("game.objectives.complete", ATT)
SetProperty("camcpb1", "Team", DEF)
SetProperty("cp6", "Team", 1)
AICanCaptureCP("cp6", DEF, false)
AICanCaptureCP("cp6", 3, false)
AICanCaptureCP("cp6", 4, false)
AICanCaptureCP("cp6", 5, false)
end