Advertisement
Guest User

Cordon and Kick

a guest
May 17th, 2018
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 4.31 KB | None | 0 0
  1. //
  2. // Cordon and Kick for ARMA 3 KP Liberation
  3. // by xhrit
  4. // v0.1
  5. //
  6.  
  7. // this secondary objective sends you to the location of a suspected
  8. // terror cell operating in an allied city and tasks you
  9. // to recover evidence relating to their operations
  10. // it should cost influence to start, and reward ammo or intel if successful
  11.  
  12. // added mission to Missionframework/scripts/client/ui/secondary_ui.sqf
  13. // added mission text to MissionFramework/stringtable.xml for STR_SECONDARY_MISSION3, STR_SECONDARY_BRIEFING3, STR_SECONDARY_CORDON_AND_KICK
  14. // STR_NOTIFICATION_CAK_STARTED, STR_NOTIFICATION_CAK_FAILED, STR_NOTIFICATION_CAK_SUCCESS
  15. // added mission cost to GRLIB_secondary_missions_costs in MissionFramework/kp_liberation_confir.sqf
  16. // added mission thumbnail to res/secondary/cordon_and_kick.jpg
  17. // added mission to init_server.sqf
  18. // added mission to start_secondary_remote_call.sqf
  19. // added lib_intel_sar_succeeded to liberation_notifications.hpp
  20. // TODO : add case 9 and 10 to remote_call_intel
  21. // TODO : adjust mission starting cost & reward
  22.  
  23. diag_log "[KP LIBERATION] [DEBUG] begin cordon and kick mission";
  24.  
  25. // get random blue sector
  26. _allBluesectors = blufor_sectors;
  27. if (count blufor_sectors == 0) exitWith { diag_log "[KP LIBERATION] [ERROR] Could not select a blufor sector."; };
  28. _rndBluesector = selectRandom _allBluesectors;
  29.  
  30. // get random house in city
  31. private _allBuildings = nearestTerrainObjects [markerpos _rndBluesector, [], 250, false, true] select { !(_x buildingPos -1 isEqualTo []) };
  32. if (count _allBuildings == 0) exitWith { diag_log "[KP LIBERATION] [ERROR] Could not select a house in selected blufor sector."; };
  33. _rndBuilding = selectRandom _allBuildings;
  34. // _buildingposition = selectRandom (_rndBuilding buildingPos -1);
  35.  
  36. // get random position inside house
  37. _buildingpositions = [_rndBuilding] call BIS_fnc_buildingPositions;
  38. if (count _buildingpositions == 0) exitWith { diag_log "[KP LIBERATION] [ERROR] Could not select a position in selected house."; };
  39. _buildingposition = selectRandom _buildingpositions;
  40. _dir = direction _rndBuilding;
  41.  
  42. // spawn intel in house
  43. private _intelobject = (selectRandom [GRLIB_intel_file, GRLIB_intel_laptop]) createVehicle _buildingposition;
  44. _intelobject setPosATL [_buildingposition select 0, _buildingposition select 1, (_buildingposition select 2) - 0.15];
  45. _intelobject enableSimulationGlobal false;
  46. _intelobject allowDamage false;
  47. _intelobject setdir ( _dir );
  48.  
  49. // spawn terror cell to defend it
  50. private _grp = [ position _rndBuilding ] call F_spawnGuerillaGroup;
  51.  
  52. // chance to spawn IEDs on nearby roads
  53. _ieds = 1 + random 5;
  54. diag_log "[KP LIBERATION] [CORDON_AND_KICK] Spawnining %1 ieds", _ieds;
  55. [_rndBluesector, _ieds] spawn manage_asymIED;
  56.  
  57. // TODO: chance to spawn a number of ambushes in a different building in town
  58. // [_rndBluesector] spawn asym_sector_ambush;
  59.  
  60. // TODO: chance to spawn terror patrols in tacticals on outskirts of town
  61.  
  62. // TODO: chance to spawn reinforcements
  63.  
  64. // spawn markers and flag mission as in-progress
  65. secondary_objective_position = position _rndBuilding;
  66. secondary_objective_position_marker = [(((secondary_objective_position select 0) + 50) - random 100),(((secondary_objective_position select 1) + 50) - random 100),0];
  67. publicVariable "secondary_objective_position_marker";
  68. sleep 1;
  69. GRLIB_secondary_in_progress = 3; publicVariable "GRLIB_secondary_in_progress";
  70. _mission_in_progress = true;
  71. [9] remoteExec ["remote_call_intel"];
  72.  
  73. // track mission end
  74. while { _mission_in_progress } do {
  75.     // victory condition 1 : terror cell is destroyed
  76.     if ( count (units _grp) < 1 ) then {
  77.         _mission_in_progress = false;
  78.         [10] remoteExec ["remote_call_intel"];
  79.     };
  80.     // TODO: mission fail conditions
  81.     // terror cell should have a chance to try and escape if more then half are dead
  82.     // if the cell moves far enough away from the city, the mission should fail.
  83.     // also the intel should be destructable, and if lost then the mission should fail.
  84. };
  85.  
  86. diag_log "[KP LIBERATION] [DEBUG] end cordon and kick mission";
  87.  
  88. // give reward and clear quest marker
  89. sleep 20;
  90. deleteMarker _cell_marker;
  91. // combat_readiness = round (combat_readiness * 0.85);
  92. stats_secondary_objectives = stats_secondary_objectives + 1;
  93. // [10] remoteExec ["remote_call_intel"];
  94. GRLIB_secondary_in_progress = -1; publicVariable "GRLIB_secondary_in_progress";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement