[code]
function ScriptPostLoad()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}
cp9 = CommandPost:New{name = "cp9"}
DisableAIAutoBalance()
--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}
--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
--conquest:AddCommandPost(cp4) THIS ONE STAYS OUT
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)
--Trying to make it so that everyone spawns on one side of the gate until it is destroyed.
--Going to try this approach. The command posts are active but AI cannot spawn. This is short-term, maybe.
SetProperty("cp6", "AISpawnWeight", "0")
SetProperty("cp7", "AISpawnWeight", "0")
SetProperty("cp8", "AISpawnWeight", "0")
BlockPlanningGraphArcs("connection15gate")
conquest.OnStart = function(self)
conquest.goal1 = AddAIGoal(CIS, "Defend", 5, "thegate")
conquest.goal2 = AddAIGoal(REP, "Destroy", 300, "thegate")
end
conquest:Start()
SetUberMode(1);
SetProperty("thegate", "MaxHealth", 68000)
SetProperty("thegate", "CurHealth", 68000)
OnObjectKillName(GateDown, "thegate");
OnFinishCaptureName(LastStand, "cp6");
OnFinishCaptureName(LastStand, "cp7");
EnableSPHeroRules()
end
function LastStand()
if GetObjectTeam("cp6") == ATT and GetObjectTeam("cp7") == ATT then
--Tell the humans where to go next.
ShowMessageText("level.dda.objectives.laststand1",1)
ShowMessageText("level.dda.objectives.laststand2",2)
--Let's muck around with the spawn weights to produce a better final battle sequence.
SetProperty("cp6", "AISpawnWeight", "500") --FOR THE REPUBLIIIIIC
SetProperty("cp7", "AISpawnWeight", "500") --ALSO FOR THE REPUBLIIIICCCC
SetProperty("cp8", "AISpawnWeight", "750") --For the CIS...
--And it's actually pretty vital that they try and fight over this particular CP.
SetProperty("cp8", "Value_DEF_CIS", "2000")
SetProperty("cp8", "Value_ATK_Republic", "2000")
--To avoid the Battle of Thermopylae...
SetReinforcementCount(DEF, -1)
SetUnitCount(DEF, 35)
else
ShowMessageText("level.dda.objectives.pushback1",1)
ShowMessageText("level.dda.objectives.pushback2",2)
end
end
[/code]