Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ranger1 = GROUP:FindByName( "ranger1" )
- ranger2 = GROUP:FindByName( "ranger2" )
- ranger3 = GROUP:FindByName( "ranger3" )
- ranger4 = GROUP:FindByName( "ranger4" )
- ranger5 = GROUP:FindByName( "ranger5" )
- amboconvoy = GROUP:FindByName( "amboconvoy" )
- helo1 = GROUP:FindByName("helo1")
- helo2 = GROUP:FindByName("helo2")
- helo3 = GROUP:FindByName("helo3")
- helo4 = GROUP:FindByName("helo4")
- helo5 = GROUP:FindByName("helo5")
- helo6 = GROUP:FindByName("helo6")
- helo7 = GROUP:FindByName("helo7")
- helo8 = GROUP:FindByName("helo8")
- tire = STATIC:FindByName("tire")
- tireposition = tire:GetVec2()
- ZoneTable = {
- ZONE:New( "Zone1" ),
- ZONE:New( "Zone2" ),
- ZONE:New( "Zone3" ),
- ZONE:New( "Zone4" )
- --[[ ,
- ZONE:New( "Zone5" ),
- ZONE:New( "Zone6" ),
- ZONE:New( "Zone7" ),
- ZONE:New( "Zone8" ),
- ZONE:New( "Zone9" ),
- ZONE:New( "Zone10"),
- ZONE:New( "Zone11"),
- ZONE:New( "Zone12"),
- ZONE:New( "Zone13"),
- ZONE:New( "Zone14")
- --]]
- }
- insurgentspawn = false
- dropoffzone1 = ZONE:New( "dropoff1" )
- dropoffzone2 = ZONE:New( "dropoff2" )
- dropoffzone3 = ZONE:New( "dropoff3" )
- dropoffzone4 = ZONE:New( "dropoff4" )
- rangerpickup = ZONE:New( "rangerpickup" )
- bridge = ZONE:New( "bridge" )
- --[[ spawning functions outside the scheduler
- insurgentspawned = false
- pickup1status = false
- pickup2status = false
- pickup1done = false
- pickup2done = false
- pickup1notified = false
- pickup2notified = true
- unboarded = false
- --]]
- Transport1 = UNIT:FindByName( "helo1" )
- Transport2 = UNIT:FindByName( "helo2" )
- Transport3 = UNIT:FindByName( "helo3" )
- Transport4 = UNIT:FindByName( "helo4" )
- --[[if (Transport4) then
- MESSAGE:New("DEBUG: Transport4 initialized... ",10,"MOOSE Event"):ToAll()
- end
- --]]
- Transport5 = UNIT:FindByName( "helo5" )
- Transport6 = UNIT:FindByName( "helo6" )
- -- SetCargo = SET_CARGO:New():FilterPrefixes( "ranger" ):FilterStart()
- --[[
- ranger1cargo = CARGO_GROUP:New( GROUP:FindByName( "ranger1" ), "ranger Chalk #1", "ranger Team Alpha", 100 ):RespawnOnDestroyed( true )
- ranger2cargo = CARGO_GROUP:New( GROUP:FindByName( "ranger2" ), "ranger Chalk #2", "ranger Team Bravo", 100 ):RespawnOnDestroyed( true )
- ranger3cargo = CARGO_GROUP:New( GROUP:FindByName( "ranger3" ), "ranger Chalk #1", "ranger Team Charlie", 100 ):RespawnOnDestroyed( true )
- ranger4cargo = CARGO_GROUP:New( GROUP:FindByName( "ranger4" ), "ranger Chalk #1", "ranger Team Delta", 100 ):RespawnOnDestroyed( true )
- --]]
- ranger1cargo = CARGO_GROUP:New( ranger1, "Ranger1", "test", 10 )
- --if ranger1cargo then
- --MESSAGE:New("ranger1cargo initialized",10,"MOOSE Event"):ToAll()
- --end
- ranger2cargo = CARGO_GROUP:New( ranger2, "Ranger2", "test", 10 )
- ranger3cargo = CARGO_GROUP:New( ranger3, "Ranger3", "test", 10 )
- ranger4cargo = CARGO_GROUP:New( ranger4, "Ranger4", "test", 10 )
- ranger5cargo = CARGO_GROUP:New( ranger5, "Ranger5", "test", 10 )
- function unloadCargo1()
- -- MESSAGE:New("unloadCargo1 called",10,"MOOSE Event"):ToAll()
- local velocity1 = Transport1:GetVelocityKMH()
- if velocity1 < 2 then
- ranger1cargo:UnBoard()
- end
- end
- function unloadCargo2()
- -- MESSAGE:New("unloadCargo2 called",10,"MOOSE Event"):ToAll()
- local velocity2 = Transport2:GetVelocityKMH()
- if velocity2 < 2 then
- ranger2cargo:UnBoard()
- end
- end
- function unloadCargo3()
- -- MESSAGE:New("unloadCargo3 called",10,"MOOSE Event"):ToAll()
- local velocity3 = Transport3:GetVelocityKMH()
- if velocity3 < 2 then
- ranger3cargo:UnBoard()
- end
- end
- function unloadCargo4()
- -- MESSAGE:New("unloadCargo4 called",10,"MOOSE Event"):ToAll()
- local velocity4 = Transport4:GetVelocityKMH()
- if velocity4 < 2 then
- ranger4cargo:UnBoard()
- end
- end
- function unloadCargo5()
- -- MESSAGE:New("unloadCargo5 called",10,"MOOSE Event"):ToAll()
- local velocity5 = Transport5:GetVelocityKMH()
- if velocity5 < 2 then
- ranger5cargo:UnBoard()
- end
- end
- landcheck = SCHEDULER:New( nil,
- function()
- ------------------------- BOARDING CALLS
- if Transport1 and Transport1:IsAlive() then
- if Transport1:IsInZone(rangerpickup) then
- MESSAGE:New(": IN PICKUPZONE",10," "):ToAll()
- Board1 = ranger1cargo:Board(Transport1,50)
- end
- end
- if Transport2 and Transport2:IsAlive() then
- if Transport2:IsInZone(rangerpickup) then
- MESSAGE:New(": IN PICKUPZONE",10," "):ToAll()
- Board2 = ranger2cargo:Board(Transport2,50)
- end
- end
- if Transport3 and Transport3:IsAlive() then
- if Transport3:IsInZone(rangerpickup) then
- MESSAGE:New(": Transport3 IN PICKUPZONE",10," "):ToAll()
- Board3 = ranger3cargo:Board(Transport3,50)
- end
- end
- if Transport4 and Transport4:IsAlive() then
- if Transport4:IsInZone(rangerpickup) then
- MESSAGE:New(": IN PICKUPZONE",10," "):ToAll()
- Board4 = ranger4cargo:Board(Transport4,50)
- end
- end
- if Transport5 and Transport5:IsAlive() then
- if Transport5:IsInZone(rangerpickup) then
- MESSAGE:New(": IN PICKUPZONE",10," "):ToAll()
- Board5 = ranger5cargo:Board(Transport5,50)
- end
- end
- ------------------------------ UNBOARDING CALLS
- --
- if helo1 and helo1:IsCompletelyInZone( dropoffzone2 ) and ranger1cargo:IsLoaded()
- then
- unloadCargo1()
- end
- if helo2 and helo2:IsCompletelyInZone( dropoffzone2 ) and ranger2cargo:IsLoaded()
- then
- unloadCargo2()
- end
- if helo3 and helo3:IsCompletelyInZone( dropoffzone2 ) and ranger3cargo:IsLoaded()
- then
- unloadCargo3()
- end
- if helo4 and helo4:IsCompletelyInZone( dropoffzone2 ) and ranger4cargo:IsLoaded()
- then
- unloadCargo4()
- end
- if helo5 and helo5:IsCompletelyInZone( dropoffzone2 ) and ranger5cargo:IsLoaded()
- then
- unloadCargo5()
- end
- if ranger1:IsCompletelyInZone(dropoffzone2) then
- route1 = ranger1:TaskRouteToVec2(tireposition,8,FORMATION.Vee)
- --MESSAGE:New("Routing ranger1 to combat zone" ,10,"MOOSE Event"):ToAll()
- end
- if ranger2:IsCompletelyInZone(dropoffzone2) then
- route2 = ranger2:TaskRouteToVec2(tireposition,8,FORMATION.Vee)
- --MESSAGE:New("Routing ranger2 to combat zone" ,10,"MOOSE Event"):ToAll()
- end
- route3 = ranger3:TaskRouteToVec2(tireposition,8,FORMATION.Vee)
- --MESSAGE:New("Routing ranger3 to combat zone" ,10,"MOOSE Event"):ToAll()
- end
- if ranger4:IsCompletelyInZone(dropoffzone2) then
- route4 = ranger4:TaskRouteToVec2(tireposition,8,FORMATION.Vee)
- --MESSAGE:New("Routing ranger4 to combat zone" ,10,"MOOSE Event"):ToAll()
- end
- if ranger5:IsCompletelyInZone(dropoffzone2) then
- route1 = ranger5:TaskRouteToVec2(tireposition,8,FORMATION.Vee)
- --MESSAGE:New("Routing ranger5 to combat zone" ,10,"MOOSE Event"):ToAll()
- end
- end,
- {}, 0, 10
- )
- if amboconvoy:IsPartlyInZone(bridge) then
- MESSAGE:New("convoy in attack zone",10,"MOOSE Event"):ToAll()
- insurgentambushconvoy = SPAWN:New("insurgentambush"):InitLimit(9,27):InitRandomizeZones(ZoneTable):SpawnScheduled(2,1)
- insurgentambushconvoy:Spawn()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement