[code]--Objective 1--
--OBJECTIVE 1 TDM - Kill all the Sith.
Objective1 = Objective:New{teamATT = ATT, teamDEF = DEF, text ="level.IC1.obj.1", popupText = "level.IC1.obj.pop.1"}
Objective1.OnStart = function (self)
objectiveSequence.delayNextSetTime = 0.5
ATTKillAllJedi = AddAIGoal (ATT, "deathmatch",100)
DEFKillAllJedi = AddAIGoal (DEF, "deathmatch",100)
BossGoal = AddAIGoal(STH, "Deathmatch", 100)
Ambush("darkjedispawn", 2, STH)
MapAddClassMarker("kor_inf_darkjedi", "hud_objective_icon_circle", 3.5, ATT, "YELLOW", true)
boss_count = 2
Objective1KillSith = OnObjectKillTeam(
function(object, killer)
if boss_count > 0 then
boss_count = boss_count - 1
end
if boss_count == 1 then
ShowMessageText ("level.IC1.obj.count.1", ATT)
elseif boss_count == 0 then
ShowMessageText ("level.IC1.obj1.count.0", ATT)
Objective1:Complete(ATT)
ReleaseObjectKill(Objective1KillSith)
end
end,
STH
)
end
Objective1.OnComplete = function(self)
DeleteAIGoal(ATTKillAllJedi)
DeleteAIGoal(DEFKillAllJedi)
DeleteAIGoal(BossGoal)
ShowMessageText("game.objectives.complete", ATT)
if self.winningTeam == DEF then
ScriptCB_SndPlaySound("MYG_obj_15")
else
ScriptCB_SndPlaySound("MYG_obj_03")
end
ATT_ReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, ATT_ReinforcementCount + 10)
end
--End Objective1--[/code]