/*
Mission Template by MK
*/
private ["_missName","_coords","_crash","_crate","_crate1","_crate2"];
//Name of the Mission -> CHANGE
_missName = "MISSION NAME";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result -> DO NOT CHANGE
_coords = call DZMSFindPos;
//White message, when mission starts -> CHANGE
[nil,nil,rTitleText,"EXAMPLE TEXT!", "PLAIN",10] call RE;
//DZMSAddMinMarker is a simple script that adds a marker to the location -> DO NOT CHANGE
[_coords,_missName] ExecVM DZMSAddMinMarker;
//We create the scenery -> CHANGE
//_uniqueName = createVehicle ["VEH_NAME",[COORDS+COORD ADJUSTMENT (X), COORDS-COORD ADJUSTMENT (Y),COORDS(Z / Height - mostly 0)],[], 0, "CAN_COLLIDE"];
_base1 = createVehicle ["Land_kulna",[(_coords select 0) + 5.4585, (_coords select 1) - 2.885,0],[], 0, "CAN_COLLIDE"];
//Set Facing Direction
_base1 setDir -28.282881;
//Set Position (Must not be same as in createVehicle, can be different)
_base1 setPos [(_coords select 0) + 5.4585, (_coords select 1) - 2.885,0];
//DZMSProtectObj prevents it from disappearing -> CHANGE
[_base1,_uniqueName] call DZMSProtectObj;
//Add and fill the boxes -> CHANGE
_crate = createVehicle ["USLaunchersBox",[(_coords select 0) + 3, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate,"supply"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[_coords,3,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMinor"] call DZMSWaitMissionComp;
//Let everyone know the mission is over -> CHANGE
[nil,nil,rTitleText,"EXAMPLE TEXT 2!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Minor SM6 Weapons Truck Mission has Ended."];
deleteMarker "DZMSMinMarker";
deleteMarker "DZMSMinDot";
//Let the timer know the mission is over
DZMSMinDone = true;