Advertisement
Guest User

zen insurgency modded

a guest
Oct 3rd, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.18 KB | None | 0 0
  1. {
  2. if (_forEachIndex > 0) then {
  3. deleteVehicle _x;
  4. };
  5. } forEach units player;
  6. call compileFinal preprocessFileLineNumbers "FAR_revive\FAR_revive_init.sqf";
  7. #include "Zen_FrameworkFunctions\Zen_InitHeader.sqf"
  8. #include "JIPSync.sqf"
  9.  
  10. /*
  11. -Add the action to the flag pole.
  12. -The action will only be available if the MHQ is alive and isn't moving.
  13. -The action will teleport the player to the vehicle's position and if there's room, move him into the cargo area of the MHQ.
  14. - Note: I never use 0 as the speed check because I don't trust it to be EXACTLY 0, at any given time, though it'd probably suffice... but just to be safe
  15. */
  16.  
  17. // Add VAS to Respawned Vehicles
  18. if (!(isNull player)) then {
  19. Fnc_MPAddVASAction = {
  20. _this addAction["<t color='#ff1111'>Virtual Ammobox</t>","VAS\open.sqf"];
  21. };
  22. };
  23.  
  24. // Pole teleportation action
  25. _id = mypole addaction ["Teleport To MHQ1",{(_this select 1)setPos getPos MHQ1;(_this select 1) moveInCargo MHQ1; },nil,6,false,true,"","alive MHQ1&& {speed MHQ1< 1}"];
  26. _id2 = mypole addaction ["Teleport To MHQ2",{(_this select 1)setPos getPos MHQ2;(_this select 1) moveInCargo MHQ2; },nil,6,false,true,"","alive MHQ2 && {speed MHQ2 < 1}"];
  27. _id3 = mypole addaction ["Teleport To MHQ3",{(_this select 1)setPos getPos MHQ3;(_this select 1) moveInCargo MHQ3; },nil,6,false,true,"","alive MHQ3 && {speed MHQ3 < 1}"];
  28.  
  29.  
  30. // ZEN Insurgency by WmD CallMeSarge
  31. // Version = <the date here>
  32. // Tested with ArmA 3 -- <version number>
  33.  
  34. // for sorting out loadouts and debugging
  35. player addAction ["Store Loadout Data", {copyToClipboard str ([(_this select 0)] call Zen_GetUnitLoadout);}];
  36.  
  37. #define RESPAWN_TIME 5
  38. #define RESPAWN_BASE _startPos = ["respawn1", [5, 15]] call Zen_FindGroundPosition; \
  39. _unit setPosATL _startPos; \
  40. _unit setDir random 360; \
  41.  
  42.  
  43. // This will fade in from black, edit the number to change the length of the fade
  44. titleText ["ZEN Insurgency Chernarus", "BLACK FADED", 0.3];
  45. // SQF functions cannot continue running after loading a saved game, do not delete this line
  46. enableSaving [false, false];
  47.  
  48. // Zen told me that if I don't advertise my mission's features, no one will!
  49. player createDiaryRecord ["Diary", ["Credits", "This mission would not have been created without substantial help from Zenophon, author of the framework. Thank you for offering so much guidance and fixing all my broken code! Beerkan was a great help in getting Iceman77's teleport and respawn scripts working properly. The Bluefor base is the FOB IronHeart base template by TehFocus. Thanks to the always excellent Tonic for the VAS script. Thanks to Farooq for the revive script. Thanks to Chains for all the advice, and Gen, John, Snob and Kelly for play testing. This mission is a WmD joint. "]];
  50. player createDiaryRecord ["Diary", ["Mission", "Based at a CIA black site in the Ukraine, the Pro Russian unrest has been disruptive to regular rendition operations. In an attempt to create a degree of compartmentalised freedom for autonomous action, an agreement has been struck with the Oligarch of a company with significant holdings in the area. Our new orders are to clear out the insurgents and secure the area. This is deniable, but well paid extra curricular work, and since half of the guys here are PMC anyway, we figured you might be interested... <br/> The insurgents are recieving support from Russia, if you get the opportunity to engage Russian forces, then take them out - stupid fuck's shouldn't be this side of the damn border anyway. Resupply Convoys, Armor and Air units, and Ammo caches are all targets of opportunity - destroying these will slow the insurgency down over the long term."]];
  51. player createDiaryRecord ["Diary", ["Features", "Random objectives of different types<br/>Towns defended by insurgents with random loadouts<br/>Random chance of vehicle spawning in towns<br/>Random civilian cars in towns<br/>Cleanup of far away enemies and dead objects<br/>Random time of day and weather<br/>Repacking magazines<br/>Giving magazines to team members with an easy action<br/>Teleport to one of 3 MHQ units from the flapole<br/>VAS added to MHQs<br/>Farooqs revive script"]];
  52.  
  53. #define WMDLOADOUT2 [loadout2]
  54. // keep control over your mission by handling respawn yourself
  55. f_HandleRespawn = {
  56. if (time < 5) exitWith {};
  57. private ["_players", "_body"];
  58.  
  59. _players = _this select 0;
  60. _body = _this select 1;
  61.  
  62. if (player == _players) then {
  63. titleText ["Still Alive", "BLACK FADED", 0.2];
  64. };
  65.  
  66. 0 = [_players] call Zen_AddGiveMagazine;
  67. 0 = [_players] call Zen_AddRepackMagazines;
  68. 0 = [_players, WMDLOADOUT2] call Zen_GiveLoadoutCustom;
  69. 0 = [_players] call Zen_AddFastRope;
  70.  
  71. 0 = _body spawn {
  72. sleep 300;
  73. deleteVehicle _this;
  74. };
  75. };
  76. // All clients stop executing here, do not delete this line
  77. if (!isServer) exitWith {};
  78.  
  79. // Execution stops until the mission begins (past briefing), do not delete this line
  80. sleep 1.5;
  81.  
  82. // Enter the mission code here
  83.  
  84. //BASIC OPFOR LOADOUT
  85. loadout1 = [
  86. [["uniform", ["U_B_fleece","U_B_ODTAN_Tshirt","U_B_PCUODs","U_BG_Guerrilla_6_1","U_O_GhillieSuit","U_B_Wood_PCUs"]],
  87. ["vest", ["V_ArmorVest_AOR2_2", "V_HarnessOSpec_gry", "V_PlateCarrier_wood", "V_PlateCarrier_wood_L", "V_TacVest_camo"]],
  88. ["backpack", ["B_AssaultPack_rgr", "B_Kitbag_Base", "B_Carryall_wood", "B_Medbag_OD", "B_FieldPack_Wood"]],
  89. ["headgear", ["", "H_Watchcap_khk", "H_Shemag_olive", "H_Beret_blk", "H_Beret_red", ""]],
  90. ["assignedItems", ["ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGoggles"]],
  91. ["weapons",[[["hlc_rifle_aks74", "launch_SUD_RPG7V"],["hlc_rifle_aks74u", "launch_SUD_Igla"], "hlc_rifle_ak74","hlc_rifle_rpk", "hlc_rifle_aks74_GL", "hlc_rifle_saiga12k", "hlc_rifle_ak12"],"kae_makarov","Binocular"]],
  92. ["magazines",[[[["hlc_30Rnd_545x39_t_ak", 9],["SUD_PG7VL", 4]],[["hlc_30Rnd_545x39_t_ak", 9],["SUD_9m39", 4]],["hlc_30Rnd_545x39_t_ak", 9],["hlc_45Rnd_762x39_t_rpk", 4],["hlc_30Rnd_545x39_t_ak", 8],["hlc_10rnd_12g_buck_S12", 4],["hlc_30Rnd_545x39_t_ak", 8]], ["Kae_8Rnd_9x18_Mak", 4], ["HandGrenade", 2],["hlc_VOG25_AK", 4], [["SmokeShellOrange", 2], ["SmokeShellBlue", 2]]]],
  93. ["items", ["FirstAidKit", "FirstAidKit"]],
  94. ["primaryAttachments", ["muzzle_snds_H","acc_pointer_IR",["hlc_optic_kobra", "HLC_Optic_1p29","FHQ_optic_ACOG"]]],
  95. ["goggles", ["G_Balaclava_oli","G_Bandanna_oli","G_Bandanna_aviator",""]]
  96. // ["secondaryAttachments",[]],
  97. // ["handgunAttachments",[]]
  98. ]] call Zen_CreateLoadout;
  99.  
  100. //BLUEFOR LOADOUT
  101. loadout2 = [
  102. [["uniform", ["C_AOR2_T","U_B_C01_Tsirt","U_B_BLK_Tshirt","U_B_woodtanR_CombatUniformTshirt","U_B_AOR2_OD_CombatUniform","U_B_BLKOCP_CombatUniform"]],
  103. ["vest", ["V_PlateCarrier_blk", "V_PlateCarrier_wood_L", "V_ArmorVest_AOR1", "V_ArmorVest_Ranger", "V_ArmorVest_AOR1_2", "V_ChestRig_L"]],
  104. ["backpack", ["B_AssaultPack_MARPAT_Wood", "B_Carryall_wood", "B_FieldPack_Wood", "B_Medbag_OD"]],
  105. ["headgear", ["H_Booniehat_WOOD", "H_PASGT_BLK", "H_PASGT_OD","H_PASGT_COYO","H_PASGT_TAN", "H_AOR1", "H_DELTAHELM_NV", "ESS_CAP_OD", "R_CAP_BLK", "R_CAP_OD_US","CAP_OD_US","H_BandMask_reaper","H_BandMask_demon"]],
  106. ["assignedItems", ["ItemMap","ItemCompass","ItemWatch","ItemRadio","NVGoggles"]],
  107. ["weapons",[[["hlc_rifle_bcmjack", "launch_SUD_CarlGustaf"],["hlc_rifle_RU5562", "launch_SUD_Stinger"], "hlc_rifle_vendimus","hlc_lmg_M60E4", "hlc_rifle_m14sopmod", "bpx_uts15", "hlc_rifle_psg1"],"hgun_Pistol_heavy_02_Yorris_F","Binocular"]],
  108. ["magazines",[[[["30Rnd_556x45_Stanag_Tracer_Yellow", 9],["SUD_HEAT751", 4]],[["30Rnd_556x45_Stanag_Tracer_Yellow", 9],["SUD_FIM92", 4]],["29rnd_300BLK_STANAG_T", 9],["hlc_100Rnd_762x51_T_M60E4", 4],["hlc_20rnd_762x51_T_M14", 6],["BPX_UTS15_Pellets", 8],["hlc_20rnd_762x51_T_G3", 8]], ["6Rnd_45ACP_Cylinder", 4], ["HandGrenade", 2],["1Rnd_HE_Grenade_shell", 2], [["SmokeShellOrange", 2], ["SmokeShellBlue", 2]]]],
  109. ["items", ["FirstAidKit", "FirstAidKit"]],
  110. ["primaryAttachments", ["muzzle_snds_H","acc_pointer_IR",["FHQ_optic_ACOG", "FHQ_optic_HWS_G33"]]],
  111. ["goggles", ["G_Shades_Black","G_Shades_Red","G_Spectacles","G_Combat","G_Lowprofile","G_Spectacles_Tinted", "US_ESS_Glasses", "US_ESS_Glasses_TAN", "SPMED_GEAR_Glasses", "SPGEAR_Glasses"]]
  112. // ["secondaryAttachments",[]],
  113. // ["handgunAttachments",[]]
  114. ]] call Zen_CreateLoadout;
  115.  
  116. //OPFOR CREW LOADOUT
  117. loadout3 = [
  118. [["uniform", ["OVERALL_SAGEBLKboots"]],
  119. ["vest", ["V_TacVest_oli"]],
  120. ["backpack", [""]],
  121. ["headgear", ["H_sud_ussr_crew_helmet"]],
  122. ["assignedItems", ["ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGoggles"]],
  123. ["weapons", [["hlc_rifle_aks74","hlc_rifle_saiga12k"],"kae_makarov","Binocular"]],
  124. ["magazines", [[["hlc_30Rnd_545x39_t_ak", 9], ["hlc_10rnd_12g_buck_S12", 9]], ["Kae_8Rnd_9x18_Mak", 4], ["HandGrenade", 2], [["SmokeShell", 4], ["SmokeShellBlue", 2]]]],
  125. ["items", ["FirstAidKit", "FirstAidKit"]],
  126. ["primaryAttachments", ["muzzle_snds_H","acc_pointer_IR",["hlc_optic_kobra", "HLC_Optic_1p29",""]]],
  127. ["goggles", ["G_Balaclava_oli","G_Bandanna_oli","G_Bandanna_aviator"]]
  128. // ["secondaryAttachments",[]],
  129. // ["handgunAttachments",[]]
  130. ]] call Zen_CreateLoadout;
  131.  
  132. //ELITE OPFOR LOADOUT
  133. loadout4 = [
  134. [["uniform", ["kae_RU_Uniform_Armoured"]],
  135. ["vest", ["kae_RU_ChestRig"]],
  136. ["backpack", ["B_AssaultPack_Type2camo", "B_Alicepack"]],
  137. ["headgear", ["kae_RU_Helmet"]],
  138. ["assignedItems", ["ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGoggles"]],
  139. ["weapons", [[["hlc_rifle_ak12", "launch_SUD_RPG7V"],["LMG_SUD_PK", "launch_SUD_Igla"],["hlc_rifle_ak12", "launch_SUD_RPG7V"], "hlc_rifle_akmgl"],"hgun_Pistol_heavy_02_F","Rangefinder"]],
  140. ["magazines", [[[["hlc_30Rnd_545x39_t_ak", 9],["SUD_PG7VL", 4]],[["SUD_100Rnd_762x54_PK", 3],["SUD_9m39", 4]],[["hlc_30Rnd_545x39_t_ak", 9],["SUD_PG7VL", 4]],["hlc_45Rnd_762x39_t_rpk", 4]], ["6Rnd_45ACP_Cylinder", 4], ["HandGrenade", 2], [["hlc_VOG25_AK", 4], ["hlc_VOG25_AK", 2]]]],
  141. ["items", ["FirstAidKit", "FirstAidKit"]],
  142. ["primaryAttachments", ["muzzle_snds_H","acc_pointer_IR",["FHQ_optic_AC12136", "FHQ_optic_ACOG","FHQ_optic_HWS_G33"]]],
  143. ["goggles", []]
  144. // ["secondaryAttachments",[]],
  145. // ["handgunAttachments",[]]
  146. ]] call Zen_CreateLoadout;
  147.  
  148. #define WMDLOADOUT1 [loadout1]
  149. #define WMDLOADOUT2 [loadout2]
  150. #define WMDLOADOUT3 [loadout3]
  151. #define WMDLOADOUT4 [loadout4]
  152.  
  153.  
  154. // These constants make it easy to change every occurrence of the value later
  155. #define ENEMY_SIDE EAST
  156. #define AI_SKILL "Infantry"
  157. #define ELITE_SKILL "SOF"
  158.  
  159. //hide markers
  160. "SM1" setMarkerAlpha 0;
  161. "SM2" setMarkerAlpha 0;
  162. "SM3" setMarkerAlpha 0;
  163. "SM4" setMarkerAlpha 0;
  164. "SM5" setMarkerAlpha 0;
  165. "SM6" setMarkerAlpha 0;
  166. "SM7" setMarkerAlpha 0;
  167. "SM8" setMarkerAlpha 0;
  168. "SM9" setMarkerAlpha 0;
  169. "SM10" setMarkerAlpha 0;
  170. "SM11" setMarkerAlpha 0;
  171. "SM12" setMarkerAlpha 0;
  172. "mkConvoy1" setMarkerAlpha 0;
  173. "mkConvoy2" setMarkerAlpha 0;
  174. "mkConvoy3" setMarkerAlpha 0;
  175.  
  176.  
  177. // Set random weather and random time between 9 am and 5 pm
  178. 0 = [["overcast", random 0.3, random 0.7, 60*45], ["fog", random 0.3, random 0.3, 60*15], ["date", random 60, 4 + random 14]] spawn Zen_SetWeather;
  179. sleep 1.0;
  180.  
  181. // Overide co-op play view distance, which is too low
  182. // [totalViewDistance = 4000, objectViewDistance = 1200]
  183. 0 = [4000, 1200] call Zen_SetViewDistance;
  184.  
  185.  
  186. // Town array is now a series of 50x50m grids placed in the editor
  187. _townMkArray = [];
  188. for "_i" from 1 to 55 do {
  189. _townMkArray pushBack ("infmk" + str _i);
  190. };
  191.  
  192. {
  193. // You can also make them checkered/striped etc. with different commands
  194. _x setMarkerColor "colorRed";
  195.  
  196. } forEach _townMkArray;
  197.  
  198. // Schedule the first side objective
  199. _sideObjTime = time + (60*([10, 30] call Zen_FindInRange));
  200.  
  201. // Holds arrays of groups in each town
  202. _townPatrolsArray = [];
  203.  
  204. // Holds all the markers where AI have been spawned
  205. // _townMkArray is now all markers where AI have not spawned
  206. _townMkArraySpawned = [];
  207.  
  208. // Assume the only Blufor units are the players
  209. _players = ([west] call Zen_ConvertToObjectArray);
  210.  
  211. // some weather management
  212. _fogTime = 60*30;
  213. _overcastTime = 60*60;
  214. _fogStart = time;
  215. _overcastStart = time;
  216.  
  217. // set up JIP and respawning
  218. Zen_JIP_Args_Server = [time, overcast, overcastForecast, _overcastStart, _overcastTime, fog, fogForecast, _fogStart, _fogTime, 3000, _players];
  219.  
  220. {
  221. _x addMPEventHandler ["MPRespawn", f_HandleRespawn];
  222. } forEach _players;
  223.  
  224. 0 = [_players] call Zen_AddGiveMagazine;
  225. 0 = [_players] call Zen_AddRepackMagazines;
  226. 0 = [_players, WMDLOADOUT2] call Zen_GiveLoadoutCustom;
  227. 0 = [_players] call Zen_AddFastRope;
  228.  
  229.  
  230.  
  231. // Infinite loop that runs every ten seconds
  232. while {true} do {
  233. {
  234. // Redefine the players array to account for respawn/JIP
  235. _players = [west] call Zen_ConvertToObjectArray;
  236. _players = [_players, "!(isPlayer _x)"] call Zen_ArrayFilterCondition;
  237.  
  238. // Only spawns patrols if at least one player is within 700 meters
  239. if !([_players, getMarkerpos _x, [700, 700], 0, "Ellipse"] call Zen_AreNotInArea) then {
  240. // Holds groups that patrol this marker
  241. _groupsArray = [];
  242. _groupsArray2 = [];
  243.  
  244. // Spawn 2 or 4 groups per marker depending on player count
  245. for "_i" from 1 to (if (count _players > 4) then {4} else {2}) do {
  246. _spawnPos = [_x] call Zen_FindGroundPosition;
  247. _enemyGroup = [_spawnPos, ENEMY_SIDE, AI_SKILL, [4,8], "men", "SUD_USSR"] call Zen_SpawnInfantry;
  248. _enemyGroupG = [_spawnPos, ENEMY_SIDE, AI_SKILL, [1,1], "men", "SUD_USSR"] call Zen_SpawnInfantryGarrison;
  249. 0 = [_groupsArray, _enemyGroup, _enemyGroupG] call Zen_ArrayAppend;
  250. };
  251.  
  252. // Pick a Random Vehicle
  253. _vehArray = ["SUD_BTR60", "SUD_T72B", "SUD_BRDM2", "UAZ_MG", "SUD_BMP2", "UAZ_SPG9", "UAZ_MG", "UAZ_AGS30", "UAZ_SPG9"];
  254. _selectedVeh = [_vehArray] call Zen_ArrayGetRandom;
  255.  
  256.  
  257. // Spawn VEHICLES
  258. if (random 1 > 0.33) then {
  259. _spawnPos2 = [_x] call Zen_FindGroundPosition;
  260. _spawnedVehicle = [_spawnPos2, _selectedVeh] call Zen_SpawnVehicle;
  261. _crewGroup = [_spawnedVehicle, ENEMY_SIDE] call Zen_SpawnVehicleCrew;
  262. 0 = [_groupsArray2, _crewGroup] call Zen_ArrayAppend;
  263. };
  264.  
  265.  
  266. // Pick random CIVVYS
  267. _CivArray = ["RDS_Citizen1","RDS_Citizen2","RDS_Citizen3","RDS_Citizen4","RDS_Woodlander3","RDS_SchoolTeacher"];
  268. _selectedCiv = [_CivArray] call Zen_ArrayGetRandom;
  269. _CivArray2 = ["RDS_Priest","RDS_Villager1","RDS_Villager2","RDS_Villager3","RDS_Villager4","RDS_Woodlander2"];
  270. _selectedCiv2 = [_CivArray2] call Zen_ArrayGetRandom;
  271.  
  272. // Spawn Civvy
  273. if (random 1 > 0.1) then {
  274. _spawnPos3 = [_x] call Zen_FindGroundPosition;
  275. _spawnedGroup = [_spawnPos3, [_selectedCiv, _selectedCiv2]] call Zen_SpawnGroup;
  276. };
  277.  
  278. // Pick a Random civvy Vehicle
  279. _CivvehArray = ["RDS_Gaz24_Civ_03","RDS_Gaz24_Civ_01","RDS_Golf4_Civ_01","RDS_Ikarus_Civ_01","RDS_S1203_Civ_01","RDS_Lada_Civ_01","RDS_Lada_Civ_05","RDS_Lada_Civ_02"];
  280. _CivselectedVeh = [_CivvehArray] call Zen_ArrayGetRandom;
  281.  
  282.  
  283. // Spawn Civvy VEHICLES
  284. for "_i" from 1 to 2 do {
  285. _spawnPos4 = [_x] call Zen_FindGroundPosition;
  286. _CivspawnedVehicle = [_spawnPos4, _CivselectedVeh] call Zen_SpawnVehicle;
  287. };
  288.  
  289.  
  290.  
  291. // Equip and patrol the units in their marker
  292. 0 = [_groupsArray, WMDLOADOUT1] call Zen_GiveLoadoutCustom;
  293. 0 = [_groupsArray, _x] spawn Zen_OrderInfantryPatrol;
  294. 0 = [_groupsArray] call Zen_TrackInfantry;
  295. 0 = [_groupsArray2, WMDLOADOUT3] call Zen_GiveLoadoutCustom;
  296. 0 = [_groupsArray2, _x] spawn Zen_OrderInfantryPatrol;
  297. 0 = [_groupsArray2] call Zen_TrackInfantry;
  298.  
  299.  
  300. // Update the spawned and not spawned arrays
  301. 0 = [_townPatrolsArray, _groupsArray] call Zen_ArrayAppend;
  302. 0 = [_townMkArraySpawned, _x] call Zen_ArrayAppend;
  303. _townMkArray set [_forEachIndex, 0];
  304. };
  305. } forEach _townMkArray;
  306.  
  307. // Remove towns where AI have spawned
  308. _townMkArray = _townMkArray - [0];
  309.  
  310. {
  311. // _townMkArraySpawned lines up with _townPatrolsArray
  312. // _groupsArray is the array of groups patrolling the current town
  313. _groupsArray = [(_townPatrolsArray select _forEachIndex)] call Zen_ArrayRemoveDead;
  314.  
  315. // Checks if the enemy is gone or dead
  316. if ([_groupsArray, _x] call Zen_AreNotInArea) then {
  317. _x setMarkerColor "colorGreen";
  318. diag_log (format["Marker %1 clear, changing color to green", _x]);
  319.  
  320. // 0 the indexes for this town
  321. _townMkArraySpawned set [_forEachIndex, 0];
  322. _townPatrolsArray set [_forEachIndex, 0];
  323.  
  324. // Anything else to be done upon clearing the area
  325. };
  326. } forEach _townMkArraySpawned;
  327.  
  328. // Remove cleared towns from the arrays
  329. _townMkArraySpawned = _townMkArraySpawned - [0];
  330. _townPatrolsArray = _townPatrolsArray - [0];
  331.  
  332. // Check if the clock is past when the side objective is scheduled
  333. if (time > _sideObjTime) then {
  334. _markerArray = ["SM1","SM2","SM3","SM4","SM5","SM6","SM7","SM8","SM9","SM10","SM11","SM12"];
  335. _selectedmarker = [_markerArray] call Zen_ArrayGetRandom;
  336.  
  337.  
  338. // Random objectives array
  339. _objectiveTypes = ["mortar", "box", "custom"];
  340. _randomObjectiveType = [_objectiveTypes] call Zen_ArrayGetRandom;
  341. _objectiveVeh = ["SUD_ZSU","SUD_BMP2","SUD_T72B","O_Heli_Attack_02_black_F"];
  342. _randomObjectiveVeh = [_objectiveVeh] call Zen_ArrayGetRandom;
  343. _objectiveConStart = ["mkConvoy1","mkConvoy2","mkConvoy3"];
  344. _randomObjectiveCon = [_objectiveConStart] call Zen_ArrayGetRandom;
  345. _extraArgs = [];
  346.  
  347. switch (_randomObjectiveType) do {
  348. case "convoy": {
  349. _extraArgs = [_randomObjectiveCon, "normal"];
  350. };
  351. case "custom": {
  352. _extraArgs = [_randomObjectiveVeh];
  353. };
  354. };
  355.  
  356. // create an objective for the selected marker
  357. _objPos = [_selectedmarker] call Zen_FindGroundPosition;
  358.  
  359. // Create the objective and reset the timer
  360. _Objective1 = ([_objPos, _players, ENEMY_SIDE, _randomObjectiveType, "eliminate"] + _extraArgs) call Zen_CreateObjective;
  361. if (_randomObjectiveType == "custom") then {
  362. {
  363. 0 = [_x] call Zen_SpawnVehicleCrew;
  364. } forEach (_Objective1 select 0);
  365. };
  366. // This is the first and only object spawned
  367. _objectiveVehicle = (_Objective1 select 0) select 0;
  368.  
  369. if (_objectiveVehicle isKindOf "Air") then {
  370. 0 = [_objectiveVehicle, _objPos] spawn Zen_OrderAircraftPatrol;
  371. } else {
  372. 0 = [_objectiveVehicle, _objPos] spawn Zen_OrderVehiclePatrol;
  373. };
  374.  
  375. _sideObjTime = time + (60*([10, 30] call Zen_FindInRange));
  376.  
  377. // Spawn and patrol a few guards
  378. _objGuards = [_objPos, ENEMY_SIDE, ELITE_SKILL, [4,8],"men", "SUD_USSR"] call Zen_SpawnInfantry;
  379. 0 = [_objGuards, WMDLOADOUT4] call Zen_GiveLoadoutCustom;
  380. 0 = [_objGuards, _objPos, [10, 75]] spawn Zen_OrderInfantryPatrol;
  381.  
  382. };
  383.  
  384. sleep 10;
  385. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement