Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InfantryTypes = { "altnode1", "crusader", "templar" }
- Objectives = function()
- MainObjective = player.AddPrimaryObjective("Capture the alien artifact.")
- Camera.Position = Actor1022.CenterPosition
- end
- IntroductionInfo = function()
- UserInterface.SetMissionText("An artifact of alien origin has been detected nearby, explore the area and recapture our M.C.V.")
- Trigger.AfterDelay(DateTime.Seconds(15), CleanMissionText)
- end
- MCVFoundMessage = function()
- UserInterface.SetMissionText("M.C.V. located, Nod did not try to hide it, I am estimating a low probability of encountering an ambush.")
- Trigger.AfterDelay(DateTime.Seconds(15), CleanMissionText)
- end
- NodWarnedMessage = function()
- UserInterface.SetMissionText("As expected, the M.C.V. has a tracker, Nod has been notified of our presence, establish a base and capture the alien artifact.")
- Trigger.AfterDelay(DateTime.Seconds(15), CleanMissionText)
- Trigger.AfterDelay(DateTime.Seconds(15), ProduceInfantry)
- end
- IdlingUnits = { }
- AttackGroupSize = 3
- ProduceInfantry = function()
- local delay = Utils.RandomInteger(DateTime.Seconds(3), DateTime.Seconds(9))
- local toBuild = { Utils.Random(InfantryTypes) }
- ai.Build(toBuild, function(unit)
- IdlingUnits[#IdlingUnits + 1] = unit[1]
- Trigger.AfterDelay(delay, ProduceInfantry)
- if #IdlingUnits >= (AttackGroupSize) then
- SendAttack()
- end
- end)
- end
- SendAttack = function()
- local units = { }
- units = SetupAttackGroup()
- Utils.Do(units, function(unit)
- IdleHunt(unit)
- end)
- end
- IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
- SetupAttackGroup = function()
- local units = { }
- for i = 0, AttackGroupSize, 1 do
- if #IdlingUnits == 0 then
- Media.DisplayMessage("" .. #IdlingUnits)
- return units
- end
- local number = Utils.RandomInteger(1, #IdlingUnits)
- if IdlingUnits[number] and not IdlingUnits[number].IsDead then
- units[i] = IdlingUnits[number]
- table.remove(IdlingUnits, number)
- end
- end
- return units
- end
- CleanMissionText = function()
- UserInterface.SetMissionText("")
- end
- Militants = {Actor502, Actor503, Actor504}
- MilitantPatrolPath = { Actor1207, Actor1208, Actor1209, Actor1210, Actor1211, Actor1212}
- WorldLoaded = function()
- player = Player.GetPlayer("Cabal")
- ai = Player.GetPlayer("Nod1")
- Objectives()
- IntroductionInfo()
- Trigger.OnEnteredProximityTrigger(Actor1023.CenterPosition, WDist.New(1024 * 15), function(a, id)
- if a.Owner == player then
- Trigger.RemoveProximityTrigger(id)
- baseCamera = Actor.Create("camera", true, { Owner = player, Location = Actor1023.Location })
- MCVFoundMessage()
- end
- end)
- Trigger.OnKilledOrCaptured(Actor1023, function() NodWarnedMessage()
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement