Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- if (_forEachIndex > 0) then {
- deleteVehicle _x;
- };
- } forEach units player;
- call compileFinal preprocessFileLineNumbers "FAR_revive\FAR_revive_init.sqf";
- #include "Zen_FrameworkFunctions\Zen_InitHeader.sqf"
- #include "JIPSync.sqf"
- /*
- -Add the action to the flag pole.
- -The action will only be available if the MHQ is alive and isn't moving.
- -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.
- - 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
- */
- // Add VAS to Respawned Vehicles
- if (!(isNull player)) then {
- Fnc_MPAddVASAction = {
- _this addAction["<t color='#ff1111'>Virtual Ammobox</t>","VAS\open.sqf"];
- };
- };
- // Pole teleportation action
- _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}"];
- _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}"];
- _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}"];
- // ZEN Insurgency by WmD CallMeSarge
- // Version = <the date here>
- // Tested with ArmA 3 -- <version number>
- // for sorting out loadouts and debugging
- player addAction ["Store Loadout Data", {copyToClipboard str ([(_this select 0)] call Zen_GetUnitLoadout);}];
- #define RESPAWN_TIME 5
- #define RESPAWN_BASE _startPos = ["respawn1", [5, 15]] call Zen_FindGroundPosition; \
- _unit setPosATL _startPos; \
- _unit setDir random 360; \
- // This will fade in from black, edit the number to change the length of the fade
- titleText ["ZEN Insurgency Chernarus", "BLACK FADED", 0.3];
- // SQF functions cannot continue running after loading a saved game, do not delete this line
- enableSaving [false, false];
- // Zen told me that if I don't advertise my mission's features, no one will!
- 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. "]];
- 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."]];
- 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"]];
- #define WMDLOADOUT2 [loadout2]
- // keep control over your mission by handling respawn yourself
- f_HandleRespawn = {
- if (time < 5) exitWith {};
- private ["_players", "_body"];
- _players = _this select 0;
- _body = _this select 1;
- if (player == _players) then {
- titleText ["Still Alive", "BLACK FADED", 0.2];
- };
- 0 = [_players] call Zen_AddGiveMagazine;
- 0 = [_players] call Zen_AddRepackMagazines;
- 0 = [_players, WMDLOADOUT2] call Zen_GiveLoadoutCustom;
- 0 = [_players] call Zen_AddFastRope;
- 0 = _body spawn {
- sleep 300;
- deleteVehicle _this;
- };
- };
- // All clients stop executing here, do not delete this line
- if (!isServer) exitWith {};
- // Execution stops until the mission begins (past briefing), do not delete this line
- sleep 1.5;
- // Enter the mission code here
- //BASIC OPFOR LOADOUT
- loadout1 = [
- [["uniform", ["U_B_fleece","U_B_ODTAN_Tshirt","U_B_PCUODs","U_BG_Guerrilla_6_1","U_O_GhillieSuit","U_B_Wood_PCUs"]],
- ["vest", ["V_ArmorVest_AOR2_2", "V_HarnessOSpec_gry", "V_PlateCarrier_wood", "V_PlateCarrier_wood_L", "V_TacVest_camo"]],
- ["backpack", ["B_AssaultPack_rgr", "B_Kitbag_Base", "B_Carryall_wood", "B_Medbag_OD", "B_FieldPack_Wood"]],
- ["headgear", ["", "H_Watchcap_khk", "H_Shemag_olive", "H_Beret_blk", "H_Beret_red", ""]],
- ["assignedItems", ["ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGoggles"]],
- ["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"]],
- ["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]]]],
- ["items", ["FirstAidKit", "FirstAidKit"]],
- ["primaryAttachments", ["muzzle_snds_H","acc_pointer_IR",["hlc_optic_kobra", "HLC_Optic_1p29","FHQ_optic_ACOG"]]],
- ["goggles", ["G_Balaclava_oli","G_Bandanna_oli","G_Bandanna_aviator",""]]
- // ["secondaryAttachments",[]],
- // ["handgunAttachments",[]]
- ]] call Zen_CreateLoadout;
- //BLUEFOR LOADOUT
- loadout2 = [
- [["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"]],
- ["vest", ["V_PlateCarrier_blk", "V_PlateCarrier_wood_L", "V_ArmorVest_AOR1", "V_ArmorVest_Ranger", "V_ArmorVest_AOR1_2", "V_ChestRig_L"]],
- ["backpack", ["B_AssaultPack_MARPAT_Wood", "B_Carryall_wood", "B_FieldPack_Wood", "B_Medbag_OD"]],
- ["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"]],
- ["assignedItems", ["ItemMap","ItemCompass","ItemWatch","ItemRadio","NVGoggles"]],
- ["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"]],
- ["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]]]],
- ["items", ["FirstAidKit", "FirstAidKit"]],
- ["primaryAttachments", ["muzzle_snds_H","acc_pointer_IR",["FHQ_optic_ACOG", "FHQ_optic_HWS_G33"]]],
- ["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"]]
- // ["secondaryAttachments",[]],
- // ["handgunAttachments",[]]
- ]] call Zen_CreateLoadout;
- //OPFOR CREW LOADOUT
- loadout3 = [
- [["uniform", ["OVERALL_SAGEBLKboots"]],
- ["vest", ["V_TacVest_oli"]],
- ["backpack", [""]],
- ["headgear", ["H_sud_ussr_crew_helmet"]],
- ["assignedItems", ["ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGoggles"]],
- ["weapons", [["hlc_rifle_aks74","hlc_rifle_saiga12k"],"kae_makarov","Binocular"]],
- ["magazines", [[["hlc_30Rnd_545x39_t_ak", 9], ["hlc_10rnd_12g_buck_S12", 9]], ["Kae_8Rnd_9x18_Mak", 4], ["HandGrenade", 2], [["SmokeShell", 4], ["SmokeShellBlue", 2]]]],
- ["items", ["FirstAidKit", "FirstAidKit"]],
- ["primaryAttachments", ["muzzle_snds_H","acc_pointer_IR",["hlc_optic_kobra", "HLC_Optic_1p29",""]]],
- ["goggles", ["G_Balaclava_oli","G_Bandanna_oli","G_Bandanna_aviator"]]
- // ["secondaryAttachments",[]],
- // ["handgunAttachments",[]]
- ]] call Zen_CreateLoadout;
- //ELITE OPFOR LOADOUT
- loadout4 = [
- [["uniform", ["kae_RU_Uniform_Armoured"]],
- ["vest", ["kae_RU_ChestRig"]],
- ["backpack", ["B_AssaultPack_Type2camo", "B_Alicepack"]],
- ["headgear", ["kae_RU_Helmet"]],
- ["assignedItems", ["ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGoggles"]],
- ["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"]],
- ["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]]]],
- ["items", ["FirstAidKit", "FirstAidKit"]],
- ["primaryAttachments", ["muzzle_snds_H","acc_pointer_IR",["FHQ_optic_AC12136", "FHQ_optic_ACOG","FHQ_optic_HWS_G33"]]],
- ["goggles", []]
- // ["secondaryAttachments",[]],
- // ["handgunAttachments",[]]
- ]] call Zen_CreateLoadout;
- #define WMDLOADOUT1 [loadout1]
- #define WMDLOADOUT2 [loadout2]
- #define WMDLOADOUT3 [loadout3]
- #define WMDLOADOUT4 [loadout4]
- // These constants make it easy to change every occurrence of the value later
- #define ENEMY_SIDE EAST
- #define AI_SKILL "Infantry"
- #define ELITE_SKILL "SOF"
- //hide markers
- "SM1" setMarkerAlpha 0;
- "SM2" setMarkerAlpha 0;
- "SM3" setMarkerAlpha 0;
- "SM4" setMarkerAlpha 0;
- "SM5" setMarkerAlpha 0;
- "SM6" setMarkerAlpha 0;
- "SM7" setMarkerAlpha 0;
- "SM8" setMarkerAlpha 0;
- "SM9" setMarkerAlpha 0;
- "SM10" setMarkerAlpha 0;
- "SM11" setMarkerAlpha 0;
- "SM12" setMarkerAlpha 0;
- "mkConvoy1" setMarkerAlpha 0;
- "mkConvoy2" setMarkerAlpha 0;
- "mkConvoy3" setMarkerAlpha 0;
- // Set random weather and random time between 9 am and 5 pm
- 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;
- sleep 1.0;
- // Overide co-op play view distance, which is too low
- // [totalViewDistance = 4000, objectViewDistance = 1200]
- 0 = [4000, 1200] call Zen_SetViewDistance;
- // Town array is now a series of 50x50m grids placed in the editor
- _townMkArray = [];
- for "_i" from 1 to 55 do {
- _townMkArray pushBack ("infmk" + str _i);
- };
- {
- // You can also make them checkered/striped etc. with different commands
- _x setMarkerColor "colorRed";
- } forEach _townMkArray;
- // Schedule the first side objective
- _sideObjTime = time + (60*([10, 30] call Zen_FindInRange));
- // Holds arrays of groups in each town
- _townPatrolsArray = [];
- // Holds all the markers where AI have been spawned
- // _townMkArray is now all markers where AI have not spawned
- _townMkArraySpawned = [];
- // Assume the only Blufor units are the players
- _players = ([west] call Zen_ConvertToObjectArray);
- // some weather management
- _fogTime = 60*30;
- _overcastTime = 60*60;
- _fogStart = time;
- _overcastStart = time;
- // set up JIP and respawning
- Zen_JIP_Args_Server = [time, overcast, overcastForecast, _overcastStart, _overcastTime, fog, fogForecast, _fogStart, _fogTime, 3000, _players];
- {
- _x addMPEventHandler ["MPRespawn", f_HandleRespawn];
- } forEach _players;
- 0 = [_players] call Zen_AddGiveMagazine;
- 0 = [_players] call Zen_AddRepackMagazines;
- 0 = [_players, WMDLOADOUT2] call Zen_GiveLoadoutCustom;
- 0 = [_players] call Zen_AddFastRope;
- // Infinite loop that runs every ten seconds
- while {true} do {
- {
- // Redefine the players array to account for respawn/JIP
- _players = [west] call Zen_ConvertToObjectArray;
- _players = [_players, "!(isPlayer _x)"] call Zen_ArrayFilterCondition;
- // Only spawns patrols if at least one player is within 700 meters
- if !([_players, getMarkerpos _x, [700, 700], 0, "Ellipse"] call Zen_AreNotInArea) then {
- // Holds groups that patrol this marker
- _groupsArray = [];
- _groupsArray2 = [];
- // Spawn 2 or 4 groups per marker depending on player count
- for "_i" from 1 to (if (count _players > 4) then {4} else {2}) do {
- _spawnPos = [_x] call Zen_FindGroundPosition;
- _enemyGroup = [_spawnPos, ENEMY_SIDE, AI_SKILL, [4,8], "men", "SUD_USSR"] call Zen_SpawnInfantry;
- _enemyGroupG = [_spawnPos, ENEMY_SIDE, AI_SKILL, [1,1], "men", "SUD_USSR"] call Zen_SpawnInfantryGarrison;
- 0 = [_groupsArray, _enemyGroup, _enemyGroupG] call Zen_ArrayAppend;
- };
- // Pick a Random Vehicle
- _vehArray = ["SUD_BTR60", "SUD_T72B", "SUD_BRDM2", "UAZ_MG", "SUD_BMP2", "UAZ_SPG9", "UAZ_MG", "UAZ_AGS30", "UAZ_SPG9"];
- _selectedVeh = [_vehArray] call Zen_ArrayGetRandom;
- // Spawn VEHICLES
- if (random 1 > 0.33) then {
- _spawnPos2 = [_x] call Zen_FindGroundPosition;
- _spawnedVehicle = [_spawnPos2, _selectedVeh] call Zen_SpawnVehicle;
- _crewGroup = [_spawnedVehicle, ENEMY_SIDE] call Zen_SpawnVehicleCrew;
- 0 = [_groupsArray2, _crewGroup] call Zen_ArrayAppend;
- };
- // Pick random CIVVYS
- _CivArray = ["RDS_Citizen1","RDS_Citizen2","RDS_Citizen3","RDS_Citizen4","RDS_Woodlander3","RDS_SchoolTeacher"];
- _selectedCiv = [_CivArray] call Zen_ArrayGetRandom;
- _CivArray2 = ["RDS_Priest","RDS_Villager1","RDS_Villager2","RDS_Villager3","RDS_Villager4","RDS_Woodlander2"];
- _selectedCiv2 = [_CivArray2] call Zen_ArrayGetRandom;
- // Spawn Civvy
- if (random 1 > 0.1) then {
- _spawnPos3 = [_x] call Zen_FindGroundPosition;
- _spawnedGroup = [_spawnPos3, [_selectedCiv, _selectedCiv2]] call Zen_SpawnGroup;
- };
- // Pick a Random civvy Vehicle
- _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"];
- _CivselectedVeh = [_CivvehArray] call Zen_ArrayGetRandom;
- // Spawn Civvy VEHICLES
- for "_i" from 1 to 2 do {
- _spawnPos4 = [_x] call Zen_FindGroundPosition;
- _CivspawnedVehicle = [_spawnPos4, _CivselectedVeh] call Zen_SpawnVehicle;
- };
- // Equip and patrol the units in their marker
- 0 = [_groupsArray, WMDLOADOUT1] call Zen_GiveLoadoutCustom;
- 0 = [_groupsArray, _x] spawn Zen_OrderInfantryPatrol;
- 0 = [_groupsArray] call Zen_TrackInfantry;
- 0 = [_groupsArray2, WMDLOADOUT3] call Zen_GiveLoadoutCustom;
- 0 = [_groupsArray2, _x] spawn Zen_OrderInfantryPatrol;
- 0 = [_groupsArray2] call Zen_TrackInfantry;
- // Update the spawned and not spawned arrays
- 0 = [_townPatrolsArray, _groupsArray] call Zen_ArrayAppend;
- 0 = [_townMkArraySpawned, _x] call Zen_ArrayAppend;
- _townMkArray set [_forEachIndex, 0];
- };
- } forEach _townMkArray;
- // Remove towns where AI have spawned
- _townMkArray = _townMkArray - [0];
- {
- // _townMkArraySpawned lines up with _townPatrolsArray
- // _groupsArray is the array of groups patrolling the current town
- _groupsArray = [(_townPatrolsArray select _forEachIndex)] call Zen_ArrayRemoveDead;
- // Checks if the enemy is gone or dead
- if ([_groupsArray, _x] call Zen_AreNotInArea) then {
- _x setMarkerColor "colorGreen";
- diag_log (format["Marker %1 clear, changing color to green", _x]);
- // 0 the indexes for this town
- _townMkArraySpawned set [_forEachIndex, 0];
- _townPatrolsArray set [_forEachIndex, 0];
- // Anything else to be done upon clearing the area
- };
- } forEach _townMkArraySpawned;
- // Remove cleared towns from the arrays
- _townMkArraySpawned = _townMkArraySpawned - [0];
- _townPatrolsArray = _townPatrolsArray - [0];
- // Check if the clock is past when the side objective is scheduled
- if (time > _sideObjTime) then {
- _markerArray = ["SM1","SM2","SM3","SM4","SM5","SM6","SM7","SM8","SM9","SM10","SM11","SM12"];
- _selectedmarker = [_markerArray] call Zen_ArrayGetRandom;
- // Random objectives array
- _objectiveTypes = ["mortar", "box", "custom"];
- _randomObjectiveType = [_objectiveTypes] call Zen_ArrayGetRandom;
- _objectiveVeh = ["SUD_ZSU","SUD_BMP2","SUD_T72B","O_Heli_Attack_02_black_F"];
- _randomObjectiveVeh = [_objectiveVeh] call Zen_ArrayGetRandom;
- _objectiveConStart = ["mkConvoy1","mkConvoy2","mkConvoy3"];
- _randomObjectiveCon = [_objectiveConStart] call Zen_ArrayGetRandom;
- _extraArgs = [];
- switch (_randomObjectiveType) do {
- case "convoy": {
- _extraArgs = [_randomObjectiveCon, "normal"];
- };
- case "custom": {
- _extraArgs = [_randomObjectiveVeh];
- };
- };
- // create an objective for the selected marker
- _objPos = [_selectedmarker] call Zen_FindGroundPosition;
- // Create the objective and reset the timer
- _Objective1 = ([_objPos, _players, ENEMY_SIDE, _randomObjectiveType, "eliminate"] + _extraArgs) call Zen_CreateObjective;
- if (_randomObjectiveType == "custom") then {
- {
- 0 = [_x] call Zen_SpawnVehicleCrew;
- } forEach (_Objective1 select 0);
- };
- // This is the first and only object spawned
- _objectiveVehicle = (_Objective1 select 0) select 0;
- if (_objectiveVehicle isKindOf "Air") then {
- 0 = [_objectiveVehicle, _objPos] spawn Zen_OrderAircraftPatrol;
- } else {
- 0 = [_objectiveVehicle, _objPos] spawn Zen_OrderVehiclePatrol;
- };
- _sideObjTime = time + (60*([10, 30] call Zen_FindInRange));
- // Spawn and patrol a few guards
- _objGuards = [_objPos, ENEMY_SIDE, ELITE_SKILL, [4,8],"men", "SUD_USSR"] call Zen_SpawnInfantry;
- 0 = [_objGuards, WMDLOADOUT4] call Zen_GiveLoadoutCustom;
- 0 = [_objGuards, _objPos, [10, 75]] spawn Zen_OrderInfantryPatrol;
- };
- sleep 10;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement