diff --git a/Ops/Auftrag/Airforce/Auftrag - 090 - Freighttransport Plane/Auftrag - 090 - Freighttransport Plane.lua b/Ops/Auftrag/Airforce/Auftrag - 090 - Freighttransport Plane/Auftrag - 090 - Freighttransport Plane.lua new file mode 100644 index 0000000000..c24de9a1b4 --- /dev/null +++ b/Ops/Auftrag/Airforce/Auftrag - 090 - Freighttransport Plane/Auftrag - 090 - Freighttransport Plane.lua @@ -0,0 +1,44 @@ +--- +-- AUFTRAG: Freighttransport Plane +-- +-- A C-130J is tasked to transport cargo from Krasnodar to Krymsk. +-- The aircraft will load four ammo boxes into its internal storage. +-- +-- These ammo boxes have to be within a 40 m radius from the plane +-- before the mission can start. +-- +-- The mission is successful if at least one cargo item makes it +-- to its destination airbase. +-- +-- If the mission is successful, the delivered cargo will be marked +-- by blue smoke. This is just an example how you can access the +-- cargo objects at their final destination. +--- + +-- Create a FLIGHTGROUP object of the C-130 +local c130=FLIGHTGROUP:New("C-130 Krasnodar") + +-- Define the set of cargo that we want to tansport +local cargoset=SET_STATIC:New() +cargoset:FilterPrefixes("Cargo C-130 Krasnodar") +cargoset:FilterOnce() + +-- Create a mission to transport the cargo to Krymsk airbase +local mission=AUFTRAG:NewFREIGHTTRANSPORT(cargoset, AIRBASE:FindByName(AIRBASE.Caucasus.Krymsk)) + +-- Assign mission to C-130 +c130:AddMission(mission) + +-- Do something with the cargo, once it has been delivered +function mission:OnAfterSuccess(From, Event, To) + + local cargoset=mission:GetCargoSet() + + local function smoke(_static) + local static=_static --Wrapper.Static#STATIC + static:SmokeBlue() + end + + cargoset:ForEach(smoke) + +end diff --git a/Ops/Auftrag/Airforce/Auftrag - 090 - Freighttransport Plane/Auftrag - 090 - Freighttransport Plane.miz b/Ops/Auftrag/Airforce/Auftrag - 090 - Freighttransport Plane/Auftrag - 090 - Freighttransport Plane.miz new file mode 100644 index 0000000000..7737c43cab Binary files /dev/null and b/Ops/Auftrag/Airforce/Auftrag - 090 - Freighttransport Plane/Auftrag - 090 - Freighttransport Plane.miz differ