Advertisement
Guest User

Untitled

a guest
Aug 31st, 2014
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.55 KB | None | 0 0
  1. #include "Zen_FrameworkFunctions\Zen_InitHeader.sqf"
  2.  
  3. // <Redacted> by Zenophon
  4. // Version = 5/25/14
  5. // Tested with ArmA 3 1.18
  6.  
  7. #define AI_SKILL "infantry"
  8. #define HELI_HEIGHT 300
  9.  
  10. #define SET_CHANCE(X) if (random 1 > 0.5) then { \
  11. X = true; \
  12. } else { \
  13. X = false; \
  14. }; \
  15.  
  16. #define ADD_DESTROY_NEAR_EH(X) X addEventHandler ["handleDamage", {{_x setDamage 1;} forEach (nearestObjects [getPosATL (_this select 0), [], 15]); (_this select 0) removeAllEventHandlers "handleDamage";}]; \
  17.  
  18. titleText [format["Aboard a UH-80\nAltitude: %1m\nInbound for parachute insertion", HELI_HEIGHT], "BLACK FADED", 0.25];
  19. enableSaving [false, false];
  20.  
  21. player createDiaryRecord ["Diary", ["Execution", "You will insert at low altitude by parachute south of Selakano. This area in marked in blue on the map.<br/><br/>Optionally, move to Junction 1 on foot and plant a satchel charge there. No patrols are expected in that rural area.<br/><br/>Recon Selakano in force, eliminating any Opfor silently. Make contact with any resistance fighters if possible.<br/><br/>Recon the airfield and secure the Mi-48. It is lightly guarded, but make sure you take out its pilots.<br/><br/>Optionally, plant a satchel charge on the pump at the gas station.<br/><br/>Give Echo the go-code to assault Feres. This action will be available when you clear Selakano completely. You can assist Echo and sweep Feres yourself.<br/><br/>Steal the Mi-48 itself. The pilot has been trained to fly it, so you will be the gunner. Order the pilot to fly the helicopter, and use its cannon and missiles to destroy both junctions and any Opfor you find.<br/><br/>The pilot will land the Mi-48 near extraction once you are done. Plant another satchel charge on the Mi-48 itself, then extract by submarine at the small beach."]];
  22. player createDiaryRecord ["Diary", ["Mission", "Your primary objective is simple: destroy two power line junctions that lead from the turbine generators to the main power lines leading north. Unfortunately, it is not matter of just walking up to them and planting explosives. In order to have any chance of a safe infiltration and escape, you need to clear the two towns in the south of the AO, Feres and Selakano. UAV intel and resistance communications indicate a small Opfor presence in Feres; nothing that Echo can't handle. We're not too sure about Selakano though, as most of the town was destroyed by artillery fire. You need to recon Selakano once you get on the ground. There might be resistance or Opfor there; even both if the resistance is disguised as civilians. Panagia to the north is an entirely different story. There are at least several Opfor squads and MRAP's in Panagia itself, and it is backed up by armor and a mechanized infantry platoon to the north.<br/><br/>Resistance reports have confirmed an excellent opportunity. A lightly guarded Opfor Mi-48 Kajman is being stationed at the small airfield between Feres and Selakano. This is were the pilot comes in: you need to steal that Mi-48 and use it against the Opfor. With the element of surprise and its massive firepower, you can decimate the garrison at Panagia and any reinforcements. The power line junctions will also be easy to destroy from the air. Once you are finished with the Mi-48, you will land and sabotage it, then proceed to extraction.<br/><br/>You also have some secondary objects to deal with. First, you can destroy the first junction, west of Selakano using a satchel charge before or after you secure Selakano and Feres; this will help us keep the initiative when you steal the Mi-48. Second, destroy the gas station south of the airfield. It is a minor target, but the more chaos the better. Third, you can assist Echo in their assault on Feres. A search of the town may yield some extra chances for intel or sabotage. Finally, you can use the Mi-48 to destroy the Opfor at Panagia itself. This will cripple their response even more and help Echo escape."]];
  23. player createDiaryRecord ["Diary", ["Forces", "Your part of the operation will be conducted by two teams. Your team, lieutenant, will consist of only one more man, a pilot loaned to us from 160th SOAR. We'll go over why you need a pilot soon; however, your main role is recon and protecting the pilot. Your callsign is Sierra, and, as the senior officer on the ground, you will be in direct contact with HQ for your part of the operation.<br/><br/>The other team, callsign Echo, is one our assault teams; they will be assisting you in dealing with infantry threats in the AO. They will be acting at their own discretion for most of the operation, until you give them the order to assault. We will go over the details and go-codes later."]];
  24. player createDiaryRecord ["Diary", ["Situation", "<Redacted>"]];
  25.  
  26. if (!isServer) exitWith {};
  27.  
  28. {_x setMarkerAlpha 0;} forEach ["mkReinfSpawn", "mkJ1Patrol", "mkAirFieldPatrol", "mkFieldPatrol"];
  29. private ["_resistanceGroup", "_ammoBox", "_officerGroup", "_selakanoOpfor", "_selakanoResistance", "_feresStash", "_feresOfficer"];
  30.  
  31. Event_Arguments_Array = [];
  32. Event_Queue_Array = [["f_EventAction_PilotDead", false]];
  33.  
  34. f_HandleEventQueue = {
  35. while {true} do {
  36. sleep 5;
  37. {
  38. if (_x select 1) then {
  39. _eventName = (_x select 0);
  40. _qualifier = [_eventName, "@$"] call Zen_StringGetDelimitedPart;
  41. _functionName = _eventName;
  42. if (count toArray _qualifier > 0) then {
  43. _functionName = [_eventName, "@" + _qualifier + "$", ""] call Zen_StringFindReplace;
  44. };
  45.  
  46. _argsIndex = [Event_Arguments_Array, _eventName, 0] call Zen_ArrayGetNestedIndex;
  47. _args = (Event_Arguments_Array select _argsIndex) select 1;
  48. 0 = _args spawn (missionNamespace getVariable _functionName);
  49. 0 = [Event_Arguments_Array, _argsIndex] call Zen_ArrayRemoveIndex;
  50. Event_Queue_Array set [_forEachIndex, 0];
  51. };
  52. } forEach Event_Queue_Array;
  53. Event_Queue_Array = Event_Queue_Array - [0];
  54. };
  55. };
  56.  
  57. f_EventTrigger_Generic = {
  58. _nestedArray = [Event_Queue_Array, _this, 0] call Zen_ArrayGetNestedValue;
  59. if (count _nestedArray > 0) then {
  60. _nestedArray set [1, true];
  61. };
  62. };
  63.  
  64. f_RemoveEvent = {
  65. {
  66. _index = [_x, _this, 0] call Zen_ArrayGetNestedIndex;
  67. if (_index != -1) then {
  68. 0 = [_x, _index] call Zen_ArrayRemoveIndex;
  69. };
  70. } forEach [Event_Arguments_Array, Event_Queue_Array];
  71. };
  72.  
  73. f_EventIsQueued = {
  74. (([Event_Queue_Array, _this, 0] call Zen_ArrayGetNestedIndex) > -1)
  75. };
  76.  
  77. // params: "task"
  78. f_EventTrigger_PilotDead = {
  79. waitUntil {
  80. sleep 10;
  81. !(alive pilot)
  82. };
  83.  
  84. if (alive X) then {
  85. 0 = [Event_Arguments_Array, ["f_EventAction_PilotDead", _this]] call Zen_ArrayAppend;
  86. 0 = "f_EventAction_PilotDead" call f_EventTrigger_Generic;
  87. };
  88. };
  89.  
  90. // params: addAction args
  91. f_EventTrigger_Action = {
  92. 0 = [Event_Arguments_Array, ["f_EventAction_Action", _this]] call Zen_ArrayAppend;
  93. 0 = [Event_Queue_Array, ["f_EventAction_Action", true]] call Zen_ArrayAppend;
  94. };
  95.  
  96. // params: addAction args, (3) == ["task", "message"]
  97. f_EventAction_Action = {
  98. (_this select 0) removeAction (_this select 2);
  99. hint ((_this select 3) select 1);
  100. 0 = [((_this select 3) select 0), "succeeded"] call Zen_UpdateTask;
  101. };
  102.  
  103. // params: "task"
  104. f_EventAction_PilotDead = {
  105. 0 = [_this, "failed"] call Zen_UpdateTask;
  106. sleep 5;
  107. 0 = "endLose" call BIS_fnc_EndMission;
  108. };
  109.  
  110. f_EventAction_SpawnFeres = {
  111. _feresGarrison = [];
  112. for "_i" from 1 to (round (2 + random 1)) do {
  113. _spawnPos = ["mkFeres", 0, [], 1, [1, 100]] call Zen_FindGroundPosition;
  114. _opforGroup = [_spawnPos, east, AI_SKILL, [2, 4]] call Zen_SpawnInfantry;
  115. 0 = [_opforGroup] call Zen_GiveLoadoutOpfor;
  116. 0 = [_feresGarrison, _opforGroup] call Zen_ArrayAppend;
  117. };
  118.  
  119. 0 = [_feresGarrison, "mkFeres"] spawn Zen_OrderInfantryPatrol;
  120. };
  121.  
  122. f_EventAction_SpawnPanagai = {
  123. _panagiaInfantry = [];
  124. for "_i" from 1 to 3 do {
  125. _spawnPos = ["mkPanagia", 0, [], 1, [1, 100]] call Zen_FindGroundPosition;
  126. _opforGroup = [_spawnPos, east, AI_SKILL, [4, 8]] call Zen_SpawnInfantry;
  127. 0 = [_opforGroup] call Zen_GiveLoadoutOpfor;
  128. 0 = [_panagiaInfantry, _opforGroup] call Zen_ArrayAppend;
  129. };
  130.  
  131. for "_i" from 1 to 2 do {
  132. _spawnPos = ["mkPanagia", 0, [], 1, [1, 100]] call Zen_FindGroundPosition;
  133. _opforCar = [_spawnPos, ["o_mrap_02_f", "o_mrap_02_gmg_f", "o_mrap_02_hmg_f"]] call Zen_SpawnGroundVehicle;
  134. };
  135.  
  136. 0 = [_panagiaInfantry, "mkPanagia"] spawn Zen_OrderInfantryPatrol;
  137. };
  138.  
  139. f_EventAction_SpawnReinf = {
  140. _stopReinf = [X, "The Opfor have mobilized heavy armor and mechanized infantry to respond to your attack. Cripple and destroy as many vehicles as possible.", "Stop Reinforcements", "mkReinfRoute", false, "", "Task_Stop_Reinf"] call Zen_InvokeTask;
  141.  
  142. _spawnPos = ["mkReinfSpawn", 0, [], 1, [1, 200]] call Zen_FindGroundPosition;
  143. _tank = [_spawnPos, "O_MBT_02_cannon_F"] call Zen_SpawnGroundVehicle;
  144. _reinfVehs = [_tank];
  145.  
  146. for "_i" from 1 to 2 do {
  147. _spawnPos = ["mkReinfSpawn", 0, [], 1, [1, 200]] call Zen_FindGroundPosition;
  148. _opforApc = [_spawnPos, ["O_APC_Tracked_02_cannon_F", "O_APC_Wheeled_02_rcws_F"]] call Zen_SpawnGroundVehicle;
  149. _opforGroup = [_spawnPos, east, AI_SKILL, [5,7]] call Zen_SpawnInfantry;
  150.  
  151. 0 = [_reinfVehs, _opforApc] call Zen_ArrayAppendNested;
  152.  
  153. 0 = [_opforGroup, _opforApc] call Zen_MoveInVehicle;
  154. 0 = [_opforApc, "mkFeres", _opforGroup] spawn Zen_OrderInsertion;
  155. };
  156.  
  157. 0 = [_tank, "mkFeres"] spawn Zen_OrderVehicleMove;
  158. 0 = [_reinfVehs, _stopReinf, "succeeded"] spawn Zen_TriggerAreDead;
  159. };
  160.  
  161. // ["selakanoTask", "feresTask", "stealTask"] // "pass" == not clear
  162. f_EventAction_StoleMI_48 = {
  163. 0 = [(_this select 2), "succeeded"] call Zen_UpdateTask;
  164.  
  165. if (((_this select 1) == "pass") || {!([(_this select 0), (_this select 1)] call Zen_AreTasksComplete)}) then {
  166. 0 = "f_EventAction_SpawnReinf" call f_EventTrigger_Generic;
  167.  
  168. [west, "HQ"] sideChat "Sierra, HQ, Opfor in Feres are alerted to the Mi-48 taking off.";
  169. sleep 10;
  170. [west, "HQ"] sideChat "Once they figure out that their boys aren't piloting it, Opfor heavy armor is going to show up, over.";
  171. sleep 14;
  172. X sideChat "HQ, Sierra, roger that, we'll be ready for them, out."; \
  173. sleep 6;
  174. };
  175. };
  176.  
  177. f_AssaultFeres = {
  178. (_this select 0) removeAction (_this select 2);
  179. _echo = group Y;
  180. _assaultPos = [(getMarkerPos "mkFeres"), [400, 500], [], 1, 0, [135, 160]] call Zen_FindGroundPosition;
  181. 0 = [_echo, _assaultPos] call Zen_MoveAsSet;
  182. 0 = [_echo, "mkFeres", [], 0, "full"] spawn Zen_OrderInfantryPatrol;
  183.  
  184. X sideChat "Echo, Sierra, begin your assault now, over.";
  185. sleep 7;
  186. (leader _echo) sideChat "Sierra, Echo, wilco, out.";
  187. };
  188.  
  189. // Debug
  190. f_KillOpforFeres = {
  191. {
  192. _x setDamage 1;
  193. } forEach (["mkFeres", [], east] call Zen_GetAllInArea);
  194. };
  195.  
  196. _idArray = [];
  197. _cfgIds = configFile >> "CfgIdentities";
  198. for "_i" from 0 to ((count _cfgIds) - 1) do {
  199. _configPath = _cfgIds select _i;
  200. _identity = configName _configPath;
  201. _name = getText (_configPath >> "name");
  202. _nameSound = getText (_configPath >> "nameSound");
  203. if ((_name == _nameSound) && !(_identity in _idArray)) then {
  204. _idArray set [(count _idArray), _identity];
  205. };
  206. };
  207.  
  208. _idArray = [_idArray] call Zen_ArrayRemoveDuplicates;
  209. _idArray = [_idArray] call Zen_ArraySortRandom;
  210.  
  211. {
  212. _name = _idArray select _forEachIndex;
  213. _x setIdentity _name;
  214. } forEach ([pilot] + units group Y);
  215.  
  216. _gasStation = ([0,0,0] nearestObject 417717);
  217. _J1Obj = ([0,0,0] nearestObject 1603022);
  218. _J2Obj = ([0,0,0] nearestObject 1603184);
  219.  
  220. sleep 1;
  221.  
  222. MI_48 lock 3;
  223. MI_48 addAction ["Get in Mi-48 as gunner", {(_this select 1) action ["GetInGunner", (_this select 0)];}, 0, 2, false, true, "", "!(_this in _target) && {(_target distance _this) < 9}"];
  224.  
  225. SET_CHANCE(_selakanoOpfor)
  226. SET_CHANCE(_selakanoResistance)
  227. SET_CHANCE(_feresStash)
  228. SET_CHANCE(_feresOfficer)
  229.  
  230. #include "Loadouts.sqf"
  231.  
  232. _groupPlayer = group X;
  233. _groupEcho = group Y;
  234.  
  235. _groupPlayer setGroupID ["Sierra"];
  236. _groupEcho setGroupID ["Echo"];
  237.  
  238. 0 = [["date", random 60, 21 + random 3], ["fog", 0.3 + random 0.4, 0.1, 60*30], ["overcast", random 0.3, random 1, 60*70]] spawn Zen_SetWeather;
  239.  
  240. _heliSpawn = [getMarkerPos "mkInsertion", [2000, 2500], [], 0, 0, [135, 225]] call Zen_FindGroundPosition;
  241. _insertionHeli = [_heliSpawn, "b_heli_transport_01_f", HELI_HEIGHT] call Zen_SpawnHelicopter;
  242. 0 = [_groupPlayer, _insertionHeli] call Zen_MoveInVehicle;
  243.  
  244. _insertionHeli lock 2;
  245.  
  246. 0 = [X] call Zen_AddRepackMagazines;
  247. 0 = [X] call Zen_AddGiveMagazine;
  248. 0 = [[_groupPlayer, _groupEcho], 1] call Zen_SetAISkill;
  249. 0 = [X, "SOF Marksman"] call Zen_GiveLoadoutCustom;
  250. 0 = [Pilot, "SOF Rifleman"] call Zen_GiveLoadoutCustom;
  251. 0 = [_groupEcho, ["SOF TL", "SOF Rifleman", "SOF AR", "SOF Marksman", "SOF Medic"]] call Zen_GiveLoadoutCustom;
  252.  
  253. _flyOverPos = [_insertionHeli, "mkInsertion", 1000] call Zen_ExtendRay;
  254. _h_flyOver = [_insertionHeli, _flyOverPos, "full", HELI_HEIGHT] spawn Zen_OrderVehicleMove;
  255.  
  256. _protectPilot = [X, "Protect the pilot at all costs. You need him to steal the Opfor Mi-48.", "Protect Pilot"] call Zen_InvokeTask;
  257. _h_pilot = [_protectPilot] spawn f_EventTrigger_PilotDead;
  258.  
  259. _destroyWindPower = [X, "Eliminate energy flow from all wind power sources on the peninsula.", "Cripple Wind Power"] call Zen_InvokeTask;
  260.  
  261. _destroyJunc1 = [X, "Eliminate the secondary junction near Selakano. You can use the Mi-48 or plant satchel charges on foot. The latter is significantly quieter.", "Destroy Junction 1", "mkJ1", false, _destroyWindPower] call Zen_InvokeTask;
  262.  
  263. _destroyJunc2 = [X, "Eliminate the primary power line junction near Panagia. You will have to use the Mi-48 for this one. The Opfor garrison at Panagia is too strong.", "Destroy Junction 2", "mkJ2", false, _destroyWindPower] call Zen_InvokeTask;
  264.  
  265. _stealMi_48 = [X, "Have the pilot steal it to use against the Opfor. Do not steal it until Feres is secure, or the Opfor will call for reinforcements. As the gunner, you need to destroy the junctions and any Opfor targets you encounter.", "Steal the Mi-48", MI_48] call Zen_InvokeTask;
  266.  
  267. _secureMi_48 = [X, "Eliminate any guards or crew near the Mi-48. If you do not kill the crew and you are detected, they may take off and attack you in the Mi-48.", "Secure the Mi-48", 0, false, _stealMi_48] call Zen_InvokeTask;
  268.  
  269. _tempSupport = ["sh_155mm_amos", 20, 1, 1, 1, "mkDestroySelakano", 1] call Zen_CreateFireSupport;
  270. 0 = ["mkDestroySelakano", _tempSupport] spawn Zen_InvokeFireSupport;
  271.  
  272. for "_i" from 1 to 100 do {
  273. _spawnPos = ["mkDestroySelakano"] call Zen_FindGroundPosition;
  274. {
  275. _x setDamage 1;
  276. } forEach (nearestObjects [_spawnPos, [], 20]);
  277. };
  278.  
  279. 0 = [_tempSupport] call Zen_RemoveFireSupport;
  280.  
  281. sleep 5;
  282. Pilot groupChat "I hope HQ knows what they're doing. I didn't sign up to be a black ops superhero.";
  283. sleep 10;
  284. X groupChat "Desperate times, huh? Just stick behind me until we get to the helicopter.";
  285. sleep 8;
  286. Pilot groupChat "That I can do.";
  287.  
  288. waitUntil {
  289. sleep 0.25;
  290. ([X, "mkInsertion"] call Zen_AreInArea)
  291. };
  292.  
  293. _insertionHeli animateDoor ["door_r", 1];
  294. sleep 2;
  295. pilot allowDamage false;
  296. _insertionHeli lock 0;
  297.  
  298. {
  299. removeBackpack _x;
  300. _x addBackpack "b_parachute";
  301. _x action ["eject", _insertionHeli];
  302. _x leaveVehicle _insertionHeli;
  303. unassignVehicle _x;
  304. sleep 1;
  305. } forEach (units _groupPlayer);
  306.  
  307. terminate _h_flyOver;
  308. _flyOverPos = [_insertionHeli, _heliSpawn, 1000] call Zen_ExtendRay;
  309. _h_flyOver = [_insertionHeli, _flyOverPos, "full", HELI_HEIGHT] spawn Zen_OrderVehicleMove;
  310.  
  311. waitUntil {
  312. sleep 2;
  313. (isTouchingGround X)
  314. };
  315.  
  316. _rendezvous = [X, "Rendezvous with the pilot so you can begin the mission.", "Regroup", 0, true] call Zen_InvokeTask;
  317.  
  318. waitUntil {
  319. sleep 2;
  320. ((Pilot distance X) < 10)
  321. };
  322.  
  323. terminate _h_flyOver;
  324. {
  325. deleteVehicle _x;
  326. } forEach (crew _insertionHeli + [_insertionHeli]);
  327.  
  328. Pilot allowDamage true;
  329. 0 = [_rendezvous, "succeeded"] call Zen_UpdateTask;
  330.  
  331. sleep 2;
  332. _clearSelakano = [X, "Observe the town of Selakano for signs of Opfor patrols or resistance presence. Once your recon is complete, move in and eliminate any threats.", "Secure Selakano", "mkSelakano", true] call Zen_InvokeTask;
  333.  
  334. sleep 2;
  335. _meetResistance = [X, "There might be some resistance fighters in Selakano. Try to find them after you secure the area. They might have important intel.", "Find Resistance", 0, false, _clearSelakano] call Zen_InvokeTask;
  336.  
  337. sleep 2;
  338. _destroyGasStation = [X, "Plant a satchel charge on the pump at the gas station. More chaos will only help our operation succeed.", "Destroy Gas Station (opt.)", "mkGasStation"] call Zen_InvokeTask;
  339.  
  340. _gasStation addAction ["Plant Time-Delayed Demolitions Charge", f_EventTrigger_Action, [_destroyGasStation, "Explosives Armed"]];
  341. _J1Obj addAction ["Plant Time-Delayed Demolitions Charge", f_EventTrigger_Action, [_destroyJunc1, "Explosives Armed"]];
  342.  
  343. _h_J1 = [_J1Obj, _destroyJunc1, "succeeded"] spawn Zen_TriggerAreDead;
  344. _h_J2 = [_J2Obj, _destroyJunc2, "succeeded"] spawn Zen_TriggerAreDead;
  345.  
  346. _J1ProxyObj = ["mkJ1", "Land_Loudspeakers_F"] call Zen_SpawnVehicle;
  347. _J2ProxyObj = ["mkJ2", "Land_Loudspeakers_F"] call Zen_SpawnVehicle;
  348.  
  349. _J1ProxyObj hideObject true;
  350. _J2ProxyObj hideObject true;
  351.  
  352. ADD_DESTROY_NEAR_EH(_J1ProxyObj)
  353. ADD_DESTROY_NEAR_EH(_J2ProxyObj)
  354.  
  355. {
  356. _spawnPos = [_x] call Zen_FindGroundPosition;
  357. _guardGroup = [_spawnPos, east, AI_SKILL, [2,4]] call Zen_SpawnInfantry;
  358. 0 = [_guardGroup, _x] spawn Zen_OrderInfantryPatrol;
  359. } forEach ["mkJ1Patrol", "mkAirFieldPatrol", "mkFieldPatrol"];
  360.  
  361. _spawnPos = [MI_48, 7 + random 10, random 360] call Zen_ExtendPosition;
  362. _MI_48_guard = [_spawnPos, east, AI_SKILL, 1] call Zen_SpawnInfantry;
  363.  
  364. _spawnPos = [MI_48, 7 + random 10, random 360] call Zen_ExtendPosition;
  365. _MI_48_pilots = [_spawnPos, east, AI_SKILL, 2] call Zen_SpawnInfantry;
  366.  
  367. 0 = [_MI_48_guard] call Zen_GiveLoadoutOpfor;
  368. 0 = [_MI_48_pilots, "Helicopter Pilot"] call Zen_GiveLoadoutOpfor;
  369.  
  370. 0 = [_MI_48_guard, MI_48, [15, 35]] spawn Zen_OrderInfantryPatrol;
  371. _h_MI_48_guards = [[_MI_48_guard, _MI_48_pilots], _secureMi_48, "succeeded"] spawn Zen_TriggerAreDead;
  372.  
  373. _selakanoGroups = [];
  374. if (_selakanoOpfor) then {
  375. for "_i" from 1 to 1 do {
  376. _spawnPos = ["mkSelakano", 0, [], 1, [1, 100]] call Zen_FindGroundPosition;
  377. _guardGroup = [_spawnPos, east, AI_SKILL, [2, 3]] call Zen_SpawnInfantry;
  378. 0 = [_selakanoGroups, _guardGroup] call Zen_ArrayAppend;
  379. };
  380.  
  381. 0 = [_selakanoGroups, "mkSelakano"] spawn Zen_OrderInfantryPatrol;
  382. };
  383.  
  384. if (_selakanoResistance) then {
  385. _spawnPos = ["mkSelakano", 0, [], 1, [1, 100]] call Zen_FindGroundPosition;
  386. _resistanceGroup = [_spawnPos, west, AI_SKILL, 1, "men", "blu_g_f"] call Zen_SpawnInfantry;
  387. {_x setCaptive true; _x allowDamage false;} forEach units _resistanceGroup;
  388. 0 = [_resistanceGroup, "civilian"] call Zen_GiveLoadoutBlufor;
  389. _resistanceGroup setGroupId ["Resistance"];
  390. };
  391.  
  392. 0 = [Event_Arguments_Array, ["f_EventAction_SpawnPanagai", []], ["f_EventAction_SpawnReinf", []], ["f_EventAction_StoleMI_48", [_clearSelakano, "pass", _stealMi_48]], ["f_EventAction_SpawnFeres", []]] call Zen_ArrayAppend;
  393. 0 = [Event_Queue_Array, ["f_EventAction_SpawnPanagai", false], ["f_EventAction_SpawnReinf", false], ["f_EventAction_StoleMI_48", false], ["f_EventAction_SpawnFeres", false]] call Zen_ArrayAppend;
  394.  
  395. 0 = [] spawn f_HandleEventQueue;
  396.  
  397. 0 = [] spawn {
  398. while {true} do {
  399. sleep 10;
  400. if ((X in MI_48) && (((getPosATL MI_48) select 2) > 5)) exitWith {
  401. 0 = "f_EventAction_StoleMI_48" call f_EventTrigger_Generic;
  402. };
  403. };
  404. };
  405.  
  406. _selakanoGroups = [_selakanoGroups] call Zen_ConvertToObjectArray;
  407.  
  408. waitUntil {
  409. sleep 5;
  410.  
  411. if (([X, "mkFeres"] call Zen_Find2dDistance) < 600) then {
  412. 0 = "f_EventAction_SpawnFeres" call f_EventTrigger_Generic;
  413. };
  414.  
  415. if (([X, "mkPanagia"] call Zen_Find2dDistance) < 1000) then {
  416. 0 = "f_EventAction_SpawnPanagai" call f_EventTrigger_Generic;
  417. };
  418.  
  419. (if (_selakanoOpfor) then {
  420. ((({alive _x} count _selakanoGroups) == 0) && ([X, "mkSelakano"] call Zen_AreInArea))
  421. } else {
  422. ([X, "mkSelakano"] call Zen_AreInArea)
  423. })
  424. };
  425.  
  426. "mkSelakano" setMarkerColor "colorBlack";
  427. 0 = [_clearSelakano, "succeeded"] call Zen_UpdateTask;
  428.  
  429. sleep 10;
  430. if !(_selakanoResistance) then {
  431. player groupChat "There's no signs of the resistance here. They must have moved on.";
  432. sleep 10;
  433. if (_selakanoOpfor) then {
  434. Pilot groupChat "Let's get out of here before reinforcements show up.";
  435. sleep 7;
  436. };
  437.  
  438. 0 = [_meetResistance, "canceled"] call Zen_UpdateTask;
  439. } else {
  440. _h_meetResist = [_resistanceGroup, X, "full"] spawn Zen_OrderInfantryMove;
  441. Pilot groupChat "I thought I saw some civilian wandering around. Maybe that's the guy you're supposed to meet.";
  442.  
  443. waitUntil {
  444. sleep 2;
  445. ((scriptDone _h_meetResist) && (([_resistanceGroup, X] call Zen_Find2dDistance) < 5))
  446. };
  447.  
  448. (leader _resistanceGroup) sideChat "I am glad I have found you, Americans. I have important documents and a message from our cell leader.";
  449. sleep 12;
  450. X sideChat "What's the message?";
  451. sleep 4;
  452. (leader _resistanceGroup) sideChat "Here, take these papers first. <Redacted>";
  453. sleep 10;
  454. X sideChat "Thanks, this will be very useful. You resistance guys don't get enough credit for your work.";
  455. sleep 10;
  456. (leader _resistanceGroup) sideChat "<Redacted>";
  457. sleep 12;
  458. X sideChat "<Redacted>";
  459. sleep 11;
  460. (leader _resistanceGroup) sideChat "<Redacted>";
  461. sleep 16;
  462. (leader _resistanceGroup) sideChat "<Redacted>";
  463. sleep 11;
  464. X sideChat "<Redacted>";
  465. sleep 10;
  466. X sideChat "<Redacted>";
  467. sleep 9;
  468. (leader _resistanceGroup) sideChat "I must leave now, I can smell those CSAT bastards from here. Good luck, Americans.";
  469. sleep 11;
  470.  
  471. 0 = [_meetResistance, "succeeded"] call Zen_UpdateTask;
  472. 0 = [_resistanceGroup, "mkInsertion", "full"] spawn Zen_OrderInfantryMove;
  473. };
  474.  
  475. 0 = "f_EventAction_SpawnFeres" call f_EventTrigger_Generic;
  476.  
  477. if (_feresStash) then {
  478. _spawnPos = ["mkFeres", 0, [], 1, [1, 100]] call Zen_FindGroundPosition;
  479. _ammoBox = [_spawnPos, east] call Zen_SpawnAmmoBox;
  480. };
  481.  
  482. if (_feresOfficer) then {
  483. _spawnPos = ["mkFeres", 0, [], 1, [1, 100]] call Zen_FindGroundPosition;
  484. _officerGroup = [_spawnPos, east, "officer", 1] call Zen_SpawnInfantry;
  485. 0 = [_officerGroup, "Officer"] call Zen_GiveLoadoutOpfor;
  486. };
  487.  
  488. sleep 2;
  489. _secureFeres = [X, "Wait until Echo secures Feres. You can also help them or do it all yourself.", "Secure Feres", "mkFeres", true] call Zen_InvokeTask;
  490.  
  491. sleep 2;
  492. _assistEcho = [X, "Help Echo clear Feres of Opfor patrols. There might also be some objectives of opportunity there.", "Assist Echo", 0, false, _secureFeres] call Zen_InvokeTask;
  493.  
  494. sleep 2;
  495. _assaultAction = player addAction ["Give Go-Code to Assault Feres", f_AssaultFeres];
  496.  
  497. sleep 5;
  498. _h_feresClear = [(["mkFeres", [], east] call Zen_GetAllInArea), [_groupEcho, _groupPlayer], _secureFeres, "succeeded", "mkFeres"] spawn Zen_TriggerAreaSecure;
  499. _secondaryFeres = "";
  500.  
  501. _stealMi_48_Event_Data = [Event_Arguments_Array, "f_EventAction_StoleMI_48", 0] call Zen_ArrayGetNestedValue;
  502. _stealMi_48_Event_Data set [2, _secureFeres];
  503.  
  504. waitUntil {
  505. sleep 5;
  506.  
  507. if (([X, "mkFeres"] call Zen_AreInArea) && (_secondaryFeres == "")) then {
  508. 0 = [_assistEcho, "succeeded"] call Zen_UpdateTask;
  509. _secondaryFeres = [X, "Search Feres briefly for any secondary objectives, such as weapons caches or intel. Move on to your main objectives if you do not find anything.", "Search Feres", 0, false, _secureFeres] call Zen_InvokeTask;
  510.  
  511. if (_feresStash) then {
  512. _ammoBox addAction ["Plant Time-Delayed Demolitions Charge", f_EventTrigger_Action, [_secondaryFeres, "Explosives Armed"]];
  513. };
  514.  
  515. if (_feresOfficer) then {
  516. (leader _officerGroup) addAction ["Search for Intel", f_EventTrigger_Action, [_secondaryFeres, "Intel Retrieved"]];
  517. };
  518.  
  519. if (!_feresStash && !_feresOfficer) then {
  520. 0 = _secondaryFeres spawn {
  521. sleep 180;
  522. 0 = [_this, "canceled"] call Zen_UpdateTask;
  523. };
  524. };
  525. };
  526.  
  527. if (([X, "mkPanagia"] call Zen_Find2dDistance) < 1000) then {
  528. 0 = "f_EventAction_SpawnPanagai" call f_EventTrigger_Generic;
  529. };
  530.  
  531. (scriptDone _h_feresClear)
  532. };
  533.  
  534. "mkFeres" setMarkerColor "colorBlufor";
  535. if !([_assistEcho] call Zen_AreTasksComplete) then {
  536. 0 = [_assistEcho, "canceled"] call Zen_UpdateTask;
  537. };
  538.  
  539. 0 = [] spawn {
  540. _startPos = ["mkPanagia", 100, [], 1, [1, 100], [45, 135]] call Zen_FindGroundPosition;
  541. _endPos = ["mkFeres", 100, [], 1, [1, 100], [-45, 45]] call Zen_FindGroundPosition;
  542.  
  543. _opforCar = [_startPos, "o_mrap_02_f"] call Zen_SpawnVehicle;
  544. _opforReinfGroup = [_opforCar, east, AI_SKILL, 4] call Zen_SpawnInfantry;
  545. 0 = [_opforReinfGroup, _opforCar, "all"] call Zen_MoveInVehicle;
  546. _h_insertion = [_opforCar, _endPos, "all"] spawn Zen_OrderVehicleMove;
  547.  
  548. waitUntil {
  549. sleep 2;
  550. (scriptDone _h_insertion)
  551. };
  552.  
  553. {unassignVehicle _x;} forEach units _opforReinfGroup;
  554. sleep 5;
  555. 0 = [_opforReinfGroup, "mkFeres"] spawn Zen_OrderInfantryPatrol;
  556. };
  557.  
  558. if !(scriptDone _h_MI_48_guards) then {
  559. 0 = [_MI_48_pilots, MI_48, "all"] call Zen_MoveInVehicle;
  560. 0 = [MI_48, (getMarkerPos "mkFeres"), 600] spawn Zen_OrderAircraftPatrol;
  561. MI_48 disableTIEquipment true;
  562.  
  563. [west, "HQ"] sideChat "Sierra, HQ, Opfor are alerted to your presence. They are scrambling the MI-48. Get to extraction now!";
  564. sleep 12;
  565. X sideChat "HQ, Sierra, negative, we can still complete. There might be AA weapons in Feres.";
  566. sleep 11;
  567. [west, "HQ"] sideChat "Dammit Sierra, a whole armored platoon is mobilizing to your north. Get the hell out of there!";
  568. sleep 11;
  569. X sideChat "Roger HQ, Sierra moving to extraction.";
  570. sleep 8;
  571. (leader _groupEcho) sideChat "HQ, Echo, we're oscar mike to extraction, out.";
  572. 0 = [_groupEcho, "mkInsertEcho", "full"] spawn Zen_OrderInfantryMove;
  573.  
  574. sleep 5;
  575. _killMI_48 = [X, "The Opfor pilots have taken off in their Mi-48. Eliminate it if you can, but your main goal is to escape to extraction.", "Destroy the Mi-48 (opt.)"] call Zen_InvokeTask;
  576.  
  577. sleep 2;
  578. 0 = "f_EventAction_SpawnReinf" call f_EventTrigger_Generic;
  579.  
  580. sleep 2;
  581. _extract = [X, "Move to the extract point as quickly as possible. You need to escape from the Mi-48 and Opfor armor.", "Get to Extraction", "mkExtraction", true] call Zen_InvokeTask;
  582.  
  583. waitUntil {
  584. sleep 3;
  585. (([X, "mkExtraction"] call Zen_Find2dDistance) < 15)
  586. };
  587.  
  588. 0 = "endFail" call BIS_fnc_EndMission;
  589. if (true) exitWith {};
  590. };
  591.  
  592. 0 = "f_EventAction_SpawnPanagai" call f_EventTrigger_Generic;
  593.  
  594. sleep 2;
  595. _hitPanagia = [X, "Attack and damage the Opfor garrison at Panagia with the Mi-48. You do not need to eliminate all targets. Just do enough damage to make them combat ineffective.", "Attack Panagia (opt.)", "mkPanagia"] call Zen_InvokeTask;
  596.  
  597. _panagiaGarrison = ["mkPanagia", [], east] call Zen_GetAllInArea;
  598. _h_panagiaHit = [_panagiaGarrison, _hitPanagia, "succeeded", round (count _panagiaGarrison / 2)] spawn Zen_TriggerAreDead;
  599.  
  600. waitUntil {
  601. sleep 4;
  602. ((scriptDone _h_panagiaHit) || (scriptDone _h_J2))
  603. };
  604.  
  605. 0 = [_groupEcho, "mkInsertEcho", "full"] spawn Zen_OrderInfantryMove;
  606. 0 = "f_EventAction_SpawnReinf" call f_EventTrigger_Generic;
  607.  
  608. waitUntil {
  609. sleep 5;
  610. if (scriptDone _h_panagiaHit) then {
  611. "mkPanagia" setMarkerColor "colorBlack";
  612. };
  613.  
  614. ((scriptDone _h_J2) && (["Task_Stop_Reinf"] call Zen_AreTasksComplete) && (scriptDone _h_J1))
  615. };
  616.  
  617. sleep 10;
  618. Pilot groupChat "Okay, Sir, we've destroyed everything we need to. I'm landing near the extraction point.";
  619.  
  620. [Pilot] join grpNull;
  621.  
  622. sleep 2;
  623. _taskLand = [X, "Allow the pilot to land the Mi-48 near extraction. Then get out and place a satchel charge on it before heading to extraction.", "Destroy Mi-48", 0, true, _stealMi_48] call Zen_InvokeTask;
  624.  
  625. _landPos = ["mkExtraction", [150, 225], [], 1, 0, [180, 260]] call Zen_FindGroundPosition;
  626. 0 = [MI_48, _landPos, "full", 35] spawn Zen_OrderHelicopterLand;
  627.  
  628. MI_48 addAction ["Plant Time-Delayed Demolitions Charge", f_EventTrigger_Action, [_taskLand, "Explosives Armed"], 2, false, true, "", "!(_target in _this) && {(_target distance _this) < 4}"];
  629.  
  630. waitUntil {
  631. sleep 2;
  632. (isTouchingGround MI_48)
  633. };
  634.  
  635. MI_48 lock 0;
  636. player action ["Eject", MI_48];
  637. Pilot action ["Eject", MI_48];
  638.  
  639. sleep 2;
  640. MI_48 lock 2;
  641.  
  642. [Pilot] joinSilent X;
  643. terminate _h_pilot;
  644. 0 = [_protectPilot, "succeeded"] call Zen_UpdateTask;
  645.  
  646. sleep 2;
  647. _extract = [X, "You have successfully completed all your primary objectives. Move to the extraction point to finish the mission.", "Move to Extraction", "mkExtraction", true] call Zen_InvokeTask;
  648.  
  649. _h_extract = [_groupPlayer, _extract, "succeeded", "mkExtraction", "all"] spawn Zen_TriggerAreNear;
  650.  
  651. waitUntil {
  652. sleep 5;
  653. (scriptDone _h_extract)
  654. };
  655.  
  656. {
  657. if !([_x] call Zen_AreTasksComplete) then {
  658. sleep 1;
  659. 0 = [_x, "canceled"] call Zen_UpdateTask;
  660. };
  661. } forEach ([X] call Zen_GetUnitTasks);
  662.  
  663. sleep 6;
  664.  
  665. 0 = "endWin" call BIS_fnc_EndMission;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement