Advertisement
Morbo513

asdasdasd

Mar 27th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 6.18 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>7) 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 = 8;
  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. // Classname of helicopter to spawn
  33. private _type = "rhs_mi8mt_vdv";
  34. // Classname of helicopter crew members.
  35. // OPFOR:  O_Helipilot_F
  36. // BLUFOR: B_Helipilot_F
  37. // INDFOR: I_Helipilot_F - Helicopter Pilot
  38. private _crew = "O_Helipilot_F";
  39. // Classname of Dismounts Squad Leader
  40. // OPFOR:  "O_Soldier_SL_F"
  41. // BLUFOR: "B_Soldier_SL_F"
  42. // INDFOR: "I_Soldier_SL_F"
  43. private _sl = "O_Soldier_SL_F";
  44. // Classname of Dismounts AR
  45. // OPFOR:  "O_Soldier_AR_F"
  46. // BLUFOR: "B_Soldier_AR_F"
  47. // INDFOR: "I_Soldier_AR_F"
  48. private _ar = "O_Soldier_AR_F";
  49. // Classname of Dismounts Rifleman AT
  50. // OPFOR:  "O_Soldier_LAT_F"
  51. // BLUFOR: "B_Soldier_LAT_F"
  52. // INDFOR: "I_Soldier_LAT_F"
  53. private _rat = "O_Soldier_LAT_F";
  54. // Classname of Dismounts Rifleman
  55. // OPFOR:  "O_Soldier_F"
  56. // BLUFOR: "B_Soldier_F"
  57. // INDFOR: "I_Soldier_F"
  58. private _r = "O_Soldier_F";
  59.  
  60. // Markers to select from randomly when spawning QRF.
  61. // Place down 3 markers with these as their VariableNames - Don't include the ""s. Reduce the Alpha of
  62. // the markers to 0 once you're done testing.
  63. private _pos_Spawn = getMarkerPos selectrandom ["QRF_H1_S","QRF_H2_S","QRF_H3_S"];
  64.  
  65. // 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
  66. // Time in seconds
  67. //sleep 180;
  68.  
  69. // Uncomment if you want to send a hint on successful roll, for testing purposes
  70. //hint "QRF (Helicopter) spawned!";
  71.  
  72. // (Easy) customisation end
  73. // ----------------------------------------------------------------------------------------------------------------
  74.  
  75.  
  76. // Get position slightly away from selected spawn-point (to avoid badshit). Infantry and crew will spawn here.
  77. private _pos_Ispawn = [_pos_Spawn,20,0] call BIS_fnc_relPos;
  78.  
  79. // Create invisible helipad for helicopter to land on and as point-of-reference for waypoint creation
  80. private _H_LZ = "Land_HelipadEmpty_F" createVehicle [0,0,0];
  81.  
  82. // Get random position 200-300m away in random direction from randomly selected player - depends on alias_hunt.sqf
  83. private _pos_H_LZ = [hunt_alias, 200, 300, 10, 0, 10, 0] call BIS_fnc_findSafePos;
  84. //pos_H1_LZ = [hunt_alias,200+random 100, random 360] call BIS_fnc_relPos;
  85. _H_LZ setpos _pos_H_LZ;
  86.  
  87. // Create Helicopter at Spawn Marker
  88. private _H = createVehicle [_type,_pos_Spawn,[],0,"NONE"];
  89. // Create Pilots' group
  90. private _H_G = createGroup [_side2, true];
  91. // Create group leader (Pilot of the helicopter) and move into pilot's seat
  92. private _H_U = _H_G createUnit [_crew, _pos_Ispawn, [], 0, "NONE"];
  93. private _H_L = group _H_U selectLeader _H_U;
  94. _H_U moveindriver _H;
  95. // Create crew and move into helicopter
  96. private _Hcounter = 0;
  97. while {_Hcounter < _crewno} do {
  98.     _newHC = _crew createUnit [_pos_Ispawn, _H_G, "this moveinAny _H;"];
  99.     _Hcounter = _Hcounter + 1;
  100. };
  101.  
  102. _H engineOn false;
  103. // Orient helicopter to LZ
  104. private _H_DIR = _H getDir _H_LZ;
  105. _H setDir _H_DIR;  
  106. _H setPos [(getPos _H) select 0, (getPos _H) select 1, 10];
  107.  
  108. // Set Pilot behaviour
  109. _H_G setCombatMode "BLUE";
  110. _H_G setBehaviour "CARELESS";
  111. _H_G setSpeedMode "FULL";
  112.  
  113. // Create helicopter group's first waypoint at generated LZ
  114. private _H_W1 = _H_G addWaypoint [_pos_Spawn, 0];
  115. _H_W1 setWaypointType "HOLD";
  116. _H_W1 waypointAttachVehicle _H;
  117.  
  118. private _H_W2 = _H_G addWaypoint [getPos _H_LZ, 0];
  119. _H_W2 setWaypointType "TR UNLOAD";
  120. // Pilot behaviour to S&D-friendly settings on completion (?)
  121. _H_W2 setWaypointStatements ["true",""];
  122.  
  123. if (_sad) then {
  124. // Create helicopters's search-and-destroy waypoint at selected player
  125. private _H_W3 = _H_G addWaypoint [getPosATL hunt_alias, 0];
  126. _H_W3 setWaypointType "SAD";
  127. // H1_W2 setWaypointBehaviour "AWARE";
  128. _H_W3 setWaypointSpeed "LIMITED";
  129. _H_W3 setWaypointStatements ["True",""];
  130. }
  131. else
  132. {// Create Helicopter's egress waypoint at its spawn-point, and deletes the helicopter upon it being reached.
  133. private _H_W3 = _H_G addWaypoint [_pos_Spawn, 0];
  134. _H_W3 setWaypointType "MOVE";
  135. _H_W3 setWaypointStatements ["True","deleteVehicle driver _H; deletevehicle crew _H; deleteGroup _H_G;"];
  136. };
  137.  
  138. // Create Infantry Group
  139. private _I_G = createGroup [_side2, true]; // explicitly mark for cleanup
  140. private _I_U = _I_G createUnit [_sl, _pos_Ispawn, [], 0, "NONE"];
  141. private _I_L = group _I_U selectLeader _I_U;
  142. private _counter = 0;
  143. while {_counter < _dismounts} do {
  144.     _newUnit = selectrandom [_r,_r,_r,_r,_r,_ar,_rat] createUnit [_pos_Ispawn, _I_G];
  145.     _counter = _counter + 1;
  146. };
  147.  
  148.  
  149. // Create Infantry "GETIN" waypoint at Helicopter
  150. private _I_W1 = _I_G addWaypoint [getPosATL _H, 0];
  151. _I_W1 setWaypointType "GETIN";
  152. _I_W1 waypointAttachVehicle _H;
  153.  
  154.  
  155. // Create Infantry "GETOUT" waypoint at generated LZ
  156. private _I_W2 = _I_G addWaypoint [getPos _H_LZ, 0];
  157. _I_W2 setWaypointType "GETOUT";
  158.  
  159.  
  160. // Create infantry S&D waypoint at selected player's pos
  161. private _I_W3 = _I_G addWaypoint [getPosATL hunt_alias, 0];
  162. _I_W3 setWaypointType "SAD";
  163. _I_W3 setWaypointStatements ["true",""];
  164.  
  165. // Transfer all AI to HC
  166. [true] call potato_zeusHC_fnc_transferGroupsToHC;
  167.  
  168. sleep _sleeptime;
  169. // Delete _H "HOLD" waypoint; Switch on the engine and set altitude
  170. deleteWaypoint [_H_G, 1];
  171. _H engineOn True;
  172. _H flyinheight 20;
  173.  
  174. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement