Advertisement
Morbo513

aaaaaaaaaaaaaaaaaaaaaaa

Mar 29th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.08 KB | None | 0 0
  1. // USAGE
  2. //
  3. //
  4. //
  5. //
  6.  
  7. if(!isServer) exitWith {};
  8. _random = selectrandom [1,2,3,4,5,6,7];
  9.  
  10. // Reduce for greater chance of QRF being spawned upon condition being met
  11. if (_random>4) then
  12. {
  13. // Uncomment if you want a hint for failed roll for testing
  14. hint "Helicopter Roll failed!";
  15.  
  16. }else{// <Don't touch this gubbin
  17.  
  18. // TRUE if you want helicopter to Search & Destroy after dropping troops. FALSE if you want it to bugger off and cease existing after dropping troops.
  19. private _sad = false;
  20. // Number of passengers - Not including their SL! - Setting this to 8 will result in 9 passengers for example.
  21. private _dismounts = 19;
  22. // Number of crew members - Not including the Pilot! - Setting this to 3 will result in the Pilot + Copilot and 2 gunners.
  23. private _crewno = 3;
  24. // Time to allow passengers to board. Setting this too low may result in the passengers being left behind.
  25. private _sleeptime = 25;
  26. // Side of group, crew and dismounts
  27. // BLUFOR: "WEST"/WEST
  28. // OPFOR: "EAST"/EAST
  29. // INDFOR: "GUER"/GUER
  30. private _side = "EAST";
  31. private _side2 = EAST;
  32.  
  33. // Classname of helicopter to spawn
  34. private _type = "rhs_mi8mt_vdv";
  35.  
  36. // For each of the following, simply change the first letter in the classname to reflect the desired side.
  37. // Eg. "O_Helipilot_F" becomes "B_Helipilot_F" for a BLUFOR pilot.
  38. // Prefixes are O_ (Opfor), I_ (Indfor), B_ (Blufor).
  39. // Classname of helicopter crew members.
  40. private _crew = "O_Helipilot_F";
  41. // Classname of Dismounts Squad Leader
  42. private _sl = "O_Soldier_SL_F";
  43. // Classname of Dismounts AR
  44. private _ar = "O_Soldier_AR_F";
  45. // Classname of Dismounts Rifleman AT
  46. private _rat = "O_Soldier_LAT_F";
  47. // Classname of Dismounts Rifleman
  48. private _r = "O_Soldier_F";
  49.  
  50. // Markers to select from randomly when spawning QRF.
  51. // Place down 3 markers with these as their VariableNames - Don't include the ""s. Reduce the Alpha of
  52. // the markers to 0 once you're done testing.
  53. private _pos_Spawn = getMarkerPos selectrandom ["QRF_H1_S","QRF_H2_S","QRF_H3_S"];
  54. // Uncomment if you want a timer before the QRF is spawned and dispatched. Useful for missions in a smaller AO/more linear route for players
  55. // Time in seconds
  56. //sleep 180;
  57.  
  58. // Uncomment if you want to send a hint on successful roll, for testing purposes
  59. hint "QRF (Helicopter) spawned!";
  60.  
  61. // (Easy) customisation end
  62. // ----------------------------------------------------------------------------------------------------------------
  63.  
  64. // Move helicopter spawn-point 1m off ground
  65. _pos_Spawn vectorAdd [0,0,3];
  66.  
  67. // Get position slightly away from selected spawn-point (to avoid badshit). Infantry and crew will spawn here.
  68. private _pos_Ispawn = [_pos_Spawn,20,0] call BIS_fnc_relPos;
  69.  
  70. // Create invisible helipad for helicopter to land on and as point-of-reference for waypoint creation
  71. private _H_LZ = "Land_HelipadEmpty_F" createVehicle [0,0,0];
  72.  
  73. // Get random position 200-300m away in random direction from randomly selected player - depends on alias_hunt.sqf
  74. private _k = getpos _this;
  75. private _pos_H_LZ = [_k, 200, 300, 10, 0, 10, 0] call BIS_fnc_findSafePos;
  76. //pos_H1_LZ = [hunt_alias,200+random 100, random 360] call BIS_fnc_relPos;
  77. _H_LZ setpos _pos_H_LZ;
  78.  
  79. // Create Helicopter at Spawn Marker
  80. private _H = createVehicle [_type,_pos_Spawn,[],0,"CAN_COLLIDE"];
  81. // Create Pilots' group
  82. private _H_G = createGroup [_side2, true];
  83. // Create group leader (Pilot of the helicopter) and move into pilot's seat
  84. private _H_U = _H_G createUnit [_crew, _pos_Ispawn, [], 0, "NONE"];
  85. private _H_L = group _H_U selectLeader _H_U;
  86. _H_U moveindriver _H;
  87. // Create crew and move into helicopter
  88. private _Hcounter = 0;
  89. while {_Hcounter < _crewno} do {
  90. _newHC = _crew createUnit [_pos_Ispawn, _H_G, "this moveinAny _H;"];
  91. _Hcounter = _Hcounter + 1;
  92. };
  93.  
  94. _H engineOn false;
  95. // Orient helicopter to LZ
  96. private _H_DIR = _H getDir _H_LZ;
  97. _H setDir _H_DIR;
  98. _H setPos [(getPos _H) select 0, (getPos _H) select 1, 10];
  99.  
  100. // Set Pilot behaviour
  101. _H_G setCombatMode "BLUE";
  102. _H_G setBehaviour "CARELESS";
  103. _H_G setSpeedMode "FULL";
  104.  
  105. // Create helicopter group's first waypoint at generated LZ
  106. private _H_W1 = _H_G addWaypoint [_pos_Spawn, 0];
  107. _H_W1 setWaypointType "HOLD";
  108. _H_W1 waypointAttachVehicle _H;
  109.  
  110. private _H_W2 = _H_G addWaypoint [getPos _H_LZ, 0];
  111. _H_W2 setWaypointType "TR UNLOAD";
  112. // Pilot behaviour to S&D-friendly settings on completion (?)
  113. _H_W2 setWaypointStatements ["true",""];
  114.  
  115. if (_sad) then {
  116. // Create helicopters's search-and-destroy waypoint at selected player
  117. private _H_W3 = _H_G addWaypoint [_k, 0];
  118. _H_W3 setWaypointType "SAD";
  119. // H1_W2 setWaypointBehaviour "AWARE";
  120. _H_W3 setWaypointSpeed "LIMITED";
  121. _H_W3 setWaypointStatements ["True",""];
  122. }
  123. else
  124. {// Create Helicopter's egress waypoint at its spawn-point, and deletes the helicopter upon it being reached.
  125. private _H_W3 = _H_G addWaypoint [_pos_Spawn, 0];
  126. _H_W3 setWaypointType "MOVE";
  127. _H_W3 setWaypointStatements ["True","deleteVehicle driver _H; deletevehicle crew _H; deleteGroup _H_G;"];
  128. };
  129.  
  130. // Create Infantry Group
  131. private _I_G = createGroup [_side2, true]; // explicitly mark for cleanup
  132. private _I_U = _I_G createUnit [_sl, _pos_Ispawn, [], 0, "NONE"];
  133. private _I_L = group _I_U selectLeader _I_U;
  134. private _counter = 0;
  135. while {_counter < _dismounts} do {
  136. _newUnit = selectrandom [_r,_r,_r,_r,_r,_ar,_rat] createUnit [_pos_Ispawn, _I_G];
  137. _counter = _counter + 1;
  138. };
  139.  
  140.  
  141. // Create Infantry "GETIN" waypoint at Helicopter
  142. private _I_W1 = _I_G addWaypoint [getPosATL _H, 0];
  143. _I_W1 setWaypointType "GETIN";
  144. _I_W1 waypointAttachVehicle _H;
  145.  
  146.  
  147. // Create Infantry "GETOUT" waypoint at generated LZ
  148. private _I_W2 = _I_G addWaypoint [getPos _H_LZ, 0];
  149. _I_W2 setWaypointType "GETOUT";
  150.  
  151.  
  152. // Create infantry S&D waypoint at selected player's pos
  153. private _I_W3 = _I_G addWaypoint [_k, 0];
  154. _I_W3 setWaypointType "SAD";
  155. _I_W3 setWaypointStatements ["true",""];
  156. _I_W3 waypointAttachVehicle _this;
  157.  
  158. // Transfer all AI to HC
  159. [true] call potato_zeusHC_fnc_transferGroupsToHC;
  160.  
  161. sleep _sleeptime;
  162. // Delete _H "HOLD" waypoint; Switch on the engine and set altitude
  163. deleteWaypoint [_H_G, 1];
  164. _H engineOn True;
  165. _H flyinheight 20;
  166.  
  167. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement