Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // USAGE
- //
- //
- //
- //
- if(!isServer) exitWith {};
- _random = selectrandom [1,2,3,4,5,6,7];
- // Reduce for greater chance of QRF being spawned upon condition being met
- if (_random>7) then
- {
- // Uncomment if you want a hint for failed roll for testing
- //hint "Helicopter Roll failed!";
- }else{// <Don't touch this gubbin
- // 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.
- private _sad = false;
- // Number of passengers - Not including their SL! - Setting this to 8 will result in 9 passengers for example.
- private _dismounts = 8;
- // Number of crew members - Not including the Pilot! - Setting this to 3 will result in the Pilot + Copilot and 2 gunners.
- private _crewno = 3;
- // Time to allow passengers to board. Setting this too low may result in the passengers being left behind.
- private _sleeptime = 25;
- // Side of group, crew and dismounts
- // BLUFOR: "WEST"/WEST
- // OPFOR: "EAST"/EAST
- // INDFOR: "GUER"/GUER
- private _side = "EAST";
- private _side2 = EAST;
- // Classname of helicopter to spawn
- private _type = "rhs_mi8mt_vdv";
- // Classname of helicopter crew members.
- // OPFOR: O_Helipilot_F
- // BLUFOR: B_Helipilot_F
- // INDFOR: I_Helipilot_F - Helicopter Pilot
- private _crew = "O_Helipilot_F";
- // Classname of Dismounts Squad Leader
- // OPFOR: "O_Soldier_SL_F"
- // BLUFOR: "B_Soldier_SL_F"
- // INDFOR: "I_Soldier_SL_F"
- private _sl = "O_Soldier_SL_F";
- // Classname of Dismounts AR
- // OPFOR: "O_Soldier_AR_F"
- // BLUFOR: "B_Soldier_AR_F"
- // INDFOR: "I_Soldier_AR_F"
- private _ar = "O_Soldier_AR_F";
- // Classname of Dismounts Rifleman AT
- // OPFOR: "O_Soldier_LAT_F"
- // BLUFOR: "B_Soldier_LAT_F"
- // INDFOR: "I_Soldier_LAT_F"
- private _rat = "O_Soldier_LAT_F";
- // Classname of Dismounts Rifleman
- // OPFOR: "O_Soldier_F"
- // BLUFOR: "B_Soldier_F"
- // INDFOR: "I_Soldier_F"
- private _r = "O_Soldier_F";
- // Markers to select from randomly when spawning QRF.
- // Place down 3 markers with these as their VariableNames - Don't include the ""s. Reduce the Alpha of
- // the markers to 0 once you're done testing.
- private _pos_Spawn = getMarkerPos selectrandom ["QRF_H1_S","QRF_H2_S","QRF_H3_S"];
- // 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
- // Time in seconds
- //sleep 180;
- // Uncomment if you want to send a hint on successful roll, for testing purposes
- //hint "QRF (Helicopter) spawned!";
- // (Easy) customisation end
- // ----------------------------------------------------------------------------------------------------------------
- // Get position slightly away from selected spawn-point (to avoid badshit). Infantry and crew will spawn here.
- private _pos_Ispawn = [_pos_Spawn,20,0] call BIS_fnc_relPos;
- // Create invisible helipad for helicopter to land on and as point-of-reference for waypoint creation
- private _H_LZ = "Land_HelipadEmpty_F" createVehicle [0,0,0];
- // Get random position 200-300m away in random direction from randomly selected player - depends on alias_hunt.sqf
- private _pos_H_LZ = [hunt_alias, 200, 300, 10, 0, 10, 0] call BIS_fnc_findSafePos;
- //pos_H1_LZ = [hunt_alias,200+random 100, random 360] call BIS_fnc_relPos;
- _H_LZ setpos _pos_H_LZ;
- // Create Helicopter at Spawn Marker
- private _H = createVehicle [_type,_pos_Spawn,[],0,"NONE"];
- // Create Pilots' group
- private _H_G = createGroup [_side2, true];
- // Create group leader (Pilot of the helicopter) and move into pilot's seat
- private _H_U = _H_G createUnit [_crew, _pos_Ispawn, [], 0, "NONE"];
- private _H_L = group _H_U selectLeader _H_U;
- _H_U moveindriver _H;
- // Create crew and move into helicopter
- private _Hcounter = 0;
- while {_Hcounter < _crewno} do {
- _newHC = _crew createUnit [_pos_Ispawn, _H_G, "this moveinAny _H;"];
- _Hcounter = _Hcounter + 1;
- };
- _H engineOn false;
- // Orient helicopter to LZ
- private _H_DIR = _H getDir _H_LZ;
- _H setDir _H_DIR;
- _H setPos [(getPos _H) select 0, (getPos _H) select 1, 10];
- // Set Pilot behaviour
- _H_G setCombatMode "BLUE";
- _H_G setBehaviour "CARELESS";
- _H_G setSpeedMode "FULL";
- // Create helicopter group's first waypoint at generated LZ
- private _H_W1 = _H_G addWaypoint [_pos_Spawn, 0];
- _H_W1 setWaypointType "HOLD";
- _H_W1 waypointAttachVehicle _H;
- private _H_W2 = _H_G addWaypoint [getPos _H_LZ, 0];
- _H_W2 setWaypointType "TR UNLOAD";
- // Pilot behaviour to S&D-friendly settings on completion (?)
- _H_W2 setWaypointStatements ["true",""];
- if (_sad) then {
- // Create helicopters's search-and-destroy waypoint at selected player
- private _H_W3 = _H_G addWaypoint [getPosATL hunt_alias, 0];
- _H_W3 setWaypointType "SAD";
- // H1_W2 setWaypointBehaviour "AWARE";
- _H_W3 setWaypointSpeed "LIMITED";
- _H_W3 setWaypointStatements ["True",""];
- }
- else
- {// Create Helicopter's egress waypoint at its spawn-point, and deletes the helicopter upon it being reached.
- private _H_W3 = _H_G addWaypoint [_pos_Spawn, 0];
- _H_W3 setWaypointType "MOVE";
- _H_W3 setWaypointStatements ["True","deleteVehicle driver _H; deletevehicle crew _H; deleteGroup _H_G;"];
- };
- // Create Infantry Group
- private _I_G = createGroup [_side2, true]; // explicitly mark for cleanup
- private _I_U = _I_G createUnit [_sl, _pos_Ispawn, [], 0, "NONE"];
- private _I_L = group _I_U selectLeader _I_U;
- private _counter = 0;
- while {_counter < _dismounts} do {
- _newUnit = selectrandom [_r,_r,_r,_r,_r,_ar,_rat] createUnit [_pos_Ispawn, _I_G];
- _counter = _counter + 1;
- };
- // Create Infantry "GETIN" waypoint at Helicopter
- private _I_W1 = _I_G addWaypoint [getPosATL _H, 0];
- _I_W1 setWaypointType "GETIN";
- _I_W1 waypointAttachVehicle _H;
- // Create Infantry "GETOUT" waypoint at generated LZ
- private _I_W2 = _I_G addWaypoint [getPos _H_LZ, 0];
- _I_W2 setWaypointType "GETOUT";
- // Create infantry S&D waypoint at selected player's pos
- private _I_W3 = _I_G addWaypoint [getPosATL hunt_alias, 0];
- _I_W3 setWaypointType "SAD";
- _I_W3 setWaypointStatements ["true",""];
- // Transfer all AI to HC
- [true] call potato_zeusHC_fnc_transferGroupsToHC;
- sleep _sleeptime;
- // Delete _H "HOLD" waypoint; Switch on the engine and set altitude
- deleteWaypoint [_H_G, 1];
- _H engineOn True;
- _H flyinheight 20;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement