Objective8 = ObjectiveCTF:New{teamATT = ATT, teamDEF = DEF, captureLimit = 1, text = "level.GA3.objectives.campaign.8", AIGoalWeight = 0}
Objective8:AddFlag{name = "flag", homeRegion = "", captureRegion = "cp1_capture", capRegionMarker = "hud_objective_icon", capRegionMarkerScale = 3.0, mapIcon = "flag_icon", mapIconScale = 2.0}
Objective8.OnStart = function(self)
SetProperty("flag", "GeometryName", "com_icon_republic_flag")
SetProperty("flag", "CarriedGeometryName", "com_icon_republic_flag_carried")
flag_capture_on = OnFlagPickUp(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapAddEntityMarker("cp1", "hud_objective_icon", 4.0, ATT, "YELLOW", true)
end
end,
"flag"
)
flag_capture_off = OnFlagDrop(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapRemoveEntityMarker("cp1")
end
end,
"flag"
)
end
Objective8.OnComplete = function (self)
ShowMessageText("game.objectives.complete", ATT)
ReleaseFlagPickUp(flag_capture_on)
ReleaseFlagDrop(flag_capture_off)
MapRemoveEntityMarker("cp1")
end