Objective5 = ObjectiveCTF:New{teamATT = ATT, teamDEF = DEF, captureLimit = 1, popupText = "level.THF.objectives.campaign.5b_popup", text = "level.THF.objectives.campaign.5b"}
Objective5:AddFlag{name = "yav_flag_bomb", captureRegion = "bombcapture"}
Objective5.OnStart = function(self)
CreateEntity("yav_flag_bomb", GetPathPoint("bombspawn", 0), "yav_flag_bomb")
SetProperty ("yav_flag_bomb", "AllowAIPickUp", 0)
Flag_capture_on = OnFlagPickUp(
function(Flag, carrier)
if IsCharacterHuman(carrier) then
--ShowMessageText("level.dea1.objectives.campaign.4_pickup", ATT)
MapAddEntityMarker("turret", "hud_objective_icon_circle", 4.0, ATT, "YELLOW", true)
ScriptCB_PlayInGameMusic("rep_cor_amb_holocron_return_01")
end
end,
"yav_flag_bomb"
)
Flag_capture_off = OnFlagDrop(
function(Flag, carrier)
if IsCharacterHuman(carrier) then
MapRemoveEntityMarker("turret")
--ShowMessageText("level.dea1.objectives.campaign.4_drop", ATT)
end
end,
"yav_flag_bomb"
)
DEFGoal = AddAIGoal (DEF, "Defend" , 50, "yav_flag_bomb")
ATTGoal1 = AddAIGoal (ATT, "Defend" , 30, "yav_flag_bomb")
ATTGoal2 = AddAIGoal (ATT, "Defend" , 60, "turret")
objectiveSequence.delayNextSetTime = 0.5
ScriptCB_SndPlaySound("cor_obj_33")
ScriptCB_PlayInGameMusic("rep_cor_objComplete_01")
-- Music Timer --
music01Timer = CreateTimer("music01")
SetTimerValue(music01Timer, 13.0)
StartTimer(music01Timer)
OnTimerElapse(
function(timer)
ScriptCB_StopInGameMusic("rep_cor_objComplete_01")
ScriptCB_PlayInGameMusic("rep_cor_amb_holocron_retrieve_01")
DestroyTimer(Timer)
end,
music01Timer
)
end
Objective5.OnComplete = function (self)
ScriptCB_PlayInGameMusic("rep_cor_amb_holocron_return_01")
DeleteAIGoal(DEFGoal)
DeleteAIGoal(ATT1Goal)
DeleteAIGoal(ATT2Goal)
MapRemoveEntityMarker("turret")
ReleaseFlagPickUp(Flag_capture_on)
ReleaseFlagDrop(Flag_capture_off)
OBJ5_ReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, OBJ5_ReinforcementCount + 30)
UnlockHeroForTeam(ATT)
ShowMessageText("game.objectives.complete", ATT)
bomb_timer = CreateTimer("bomb_timer")
SetTimerValue(bomb_timer, 10.0)
StartTimer(bomb_timer)
ShowTimer("bomb_timer")
OnTimerElapse(
function(timer)
ShowTimer(nil)
SetProperty ("turret", "CurHealth",0)
KillObject ("turret")
SetProperty ("turret1", "CurHealth",0)
KillObject ("turret1")
end,
bomb_timer
)
end
end