Hidden/Spoiler:
[code]SetupAmbushTrigger("dropshipambush", "dropship_spawn", 6, dropshipspawn)
DeactivateRegion("dropshipambush")--this part is further up before the objectives are run
Objective2 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF, text = "level.IC0.obj.2", popupText = "level.IC0.obj.pop.2"}
Objective2:AddTarget(Mainframe01)
Objective2:AddTarget(Mainframe02)
Objective2.OnSingleTargetDestroyed = function(self, target)
local numTargets = self:GetNumSingleTargets()
if numTargets > 0 then
ShowMessageText(MainframeString .. (numTargets + 1), 1)
ScriptCB_SndPlaySound("MYG_obj_04")
end
end
Objective2.OnStart = function(self)
SetProperty("turret1", "MaxHealth", 1000)
SetProperty("turret1", "CurHealth", 1000)
SetProperty("turret2", "MaxHealth", 1000)
SetProperty("turret2", "CurHealth", 1000)
Objective2.atkGoal1 = AddAIGoal(ATT, "Destroy", 3000, "turret1")
Objective2.atkGoal2 = AddAIGoal(ATT, "Destroy", 3000, "turret2")
Objective2.defGoal1 = AddAIGoal(DEF, "Defend", 3000, "turret1")
Objective2.defGoal2 = AddAIGoal(DEF, "Defend", 3000, "turret2")
ShowMessageText("level.IC0.obj.c2c", 1)
dropship_land = CreateTimer("land")
SetTimerValue(land, 30)
end
Objective2.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
ShowMessageText("level.IC0.obj.c2c", 1)
PlayAnimationFromTo("dropshipnew",0.0,30)
StartTimer(land)
OnTimerElapse(
function(timer)
ActivateRegion("dropshipambush")
ShowTimer(nil)
end,
land
)
--Deleting Goals
DeleteAIGoal(Objective2.atkGoal1)
DeleteAIGoal(Objective2.atkGoal2)
DeleteAIGoal(Objective2.defGoal1)
DeleteAIGoal(Objective2.defGoal2)
ATT_ReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, ATT_ReinforcementCount + 20)
if self.winningTeam == DEF then
ScriptCB_SndPlaySound("MYG_obj_15")
else
ScriptCB_SndPlaySound("MYG_obj_18")
end
end[/code]
DeactivateRegion("dropshipambush")--this part is further up before the objectives are run
Objective2 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF, text = "level.IC0.obj.2", popupText = "level.IC0.obj.pop.2"}
Objective2:AddTarget(Mainframe01)
Objective2:AddTarget(Mainframe02)
Objective2.OnSingleTargetDestroyed = function(self, target)
local numTargets = self:GetNumSingleTargets()
if numTargets > 0 then
ShowMessageText(MainframeString .. (numTargets + 1), 1)
ScriptCB_SndPlaySound("MYG_obj_04")
end
end
Objective2.OnStart = function(self)
SetProperty("turret1", "MaxHealth", 1000)
SetProperty("turret1", "CurHealth", 1000)
SetProperty("turret2", "MaxHealth", 1000)
SetProperty("turret2", "CurHealth", 1000)
Objective2.atkGoal1 = AddAIGoal(ATT, "Destroy", 3000, "turret1")
Objective2.atkGoal2 = AddAIGoal(ATT, "Destroy", 3000, "turret2")
Objective2.defGoal1 = AddAIGoal(DEF, "Defend", 3000, "turret1")
Objective2.defGoal2 = AddAIGoal(DEF, "Defend", 3000, "turret2")
ShowMessageText("level.IC0.obj.c2c", 1)
dropship_land = CreateTimer("land")
SetTimerValue(land, 30)
end
Objective2.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
ShowMessageText("level.IC0.obj.c2c", 1)
PlayAnimationFromTo("dropshipnew",0.0,30)
StartTimer(land)
OnTimerElapse(
function(timer)
ActivateRegion("dropshipambush")
ShowTimer(nil)
end,
land
)
--Deleting Goals
DeleteAIGoal(Objective2.atkGoal1)
DeleteAIGoal(Objective2.atkGoal2)
DeleteAIGoal(Objective2.defGoal1)
DeleteAIGoal(Objective2.defGoal2)
ATT_ReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, ATT_ReinforcementCount + 20)
if self.winningTeam == DEF then
ScriptCB_SndPlaySound("MYG_obj_15")
else
ScriptCB_SndPlaySound("MYG_obj_18")
end
end[/code]





