Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.80 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_airdrop
  4. Author: Larry Lancelot (concept by RyanTT but that script is broken af)
  5. TODO: Find a better way of waiting for the box to drop
  6. Pilot to have more speed so he doesn't collide with the box and blow up, maybe remove collisions with helo or grab position then wait ??
  7. Chaser Helis
  8. Maybe change checks to waitUntil if players are not met
  9. */
  10.  
  11. //Setup our variables
  12. diag_log "Started the airdrop";
  13. private ["_spawnPos","_mainVehicle","_wp","_main","_drop"];
  14. uiSleep (60*45);
  15. uiSleep random(1200);
  16. //config
  17. _spawnPos = [6304.292,9650.939,99.1];
  18. _mainVehicle = "B_Heli_Transport_03_unarmed_F";
  19. _dropPoints = [[5233.613,18424.145,2],[6651.447,12605.252,2],[12795.358,19671.498,2.115]];
  20. _dummyBox = "Land_Cargo20_blue_F";
  21. _main = "CargoNet_01_box_F";
  22. _endPos = [1082.097,1910.592, 0];
  23. _copsNeeded = 3;
  24. _civsNeeded = 7;
  25. //Declare Vars
  26. _dropZone = _dropPoints call BIS_fnc_selectRandom;
  27. _loop = false;
  28. //Checks
  29. if ({side _x isEqualTo west} count playableUnits < _copsNeeded) exitWith {[] execVM "\life_server\Functions\Larry\fn_airdrop.sqf";};
  30. if ({side _x isEqualTo civilian} count playableUnits < _civsNeeded) exitWith {[] execVM "\life_server\Functions\Larry\fn_airdrop.sqf";};
  31. //Alert the peeps
  32. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>A supply drop is inbound in 20 minutes. You will be notified of the location soon</t>"] remoteexec ["life_fnc_broadcast",RANY];
  33. uiSleep (60*5);
  34. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>A supply drop is inbound in 15 minutes. Your map has been updated of the location</t>"] remoteexec ["life_fnc_broadcast",RANY];
  35. createMarker ["Airdrop",_dropZone];
  36. "Airdrop" setMarkerType "Mil_Dot";
  37. "Airdrop" setMarkerColor "ColorRed";
  38. "Airdrop" SetMarkerText "Airdrop Drop Point";
  39.  
  40. createMarker ["AirdropKos",_dropZone];
  41. "AirdropKos" setMarkerColor "ColorRed";
  42. "AirdropKos" setMarkerType "Empty";
  43. "AirdropKos" setMarkerShape "ELLIPSE";
  44. "AirdropKos" setMarkerSize [500,500];
  45. "AirdropKos" setMarkerBrush "DiagGrid";
  46.  
  47. uiSleep (60*5);
  48. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>A supply drop is inbound in 10 minutes. Check your map for the location</t>"] remoteexec ["life_fnc_broadcast",RANY];
  49. uiSleep (60*5);
  50. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>A supply drop is inbound in 5 minutes. Check your map for the location</t>"] remoteexec ["life_fnc_broadcast",RANY];
  51. uiSleep (60*4);
  52. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>A supply drop is inbound in 1 minutes. Check your map for the location</t>"] remoteexec ["life_fnc_broadcast",RANY];
  53. uiSleep(30);
  54. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>Supply Drop is on it's way. Remember the marker on the map is KOS so be ready for a fight</t>"] remoteexec ["life_fnc_broadcast",RANY];
  55. //Create stuffs
  56. _vehMain = createVehicle [_mainVehicle, _spawnPos, [], 0, "FLY"];
  57. _crew = [_spawnPos, east, ["O_G_Soldier_SL_F"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;
  58. {_x moveInDriver _vehMain} forEach units _crew;
  59. _crew addWaypoint [_dropZone, 0, 1];
  60. [_crew, 1] setWaypointSpeed "NORMAL";
  61. _vehMain flyInHeight 100;
  62.  
  63. _firstBox = createVehicle [_dummyBox ,_spawnPos, [], 0, "CAN_COLLIDE"];
  64. _firstBox attachTo [_vehMain,[0,0,-3.5]];
  65. _firstBox setDir 90;
  66.  
  67. //Tracking Marker
  68. createMarker ["airbox_marker", _dropZone];
  69. "airDrop_marker" setMarkerType "Mil_Destroy";
  70. "airDrop_marker" setMarkerColor "ColorBlue";
  71. "airDrop_marker" setMarkerText "Airdrop Box";
  72. _loop = true
  73. while {_loop = true} do { "airDrop_marker" setMarkerPos getPos _drop;sleep 1; };
  74.  
  75. //When the helo gets close to the marker start the box dropping
  76. waitUntil {_dropZone distance _vehMain < 90};
  77. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>Supplies have been dropped. You have 20 minutes before the box explodes</t>"] remoteexec ["life_fnc_broadcast",RANY];
  78. deleteVehicle _firstBox;
  79. _drop = createVehicle [_dummyBox , _spawnPos, [], 0, "CAN_COLLIDE"];
  80. _para = createVehicle ["O_Parachute_02_F", [getPos _vehMain select 0, getPos _vehMain select 1, getPos _vehMain select 2], [], 0, ""];
  81. _para setPosATL (_vehMain modelToWorld[0,0,100]);
  82. _para attachTo [_vehMain,[0,0,-10]];
  83. detach _para;
  84. _drop attachTo [_para,[0,0,-2]];
  85. _drop setDir 90;
  86. //SMOKE, SOUNDS, FLARES!!
  87. _smoke="SmokeShellGreen" createVehicle [getpos _drop select 0, getpos _drop select 1,0];
  88. _smoke attachTo [_drop,[0,0,0]];
  89. _light = "Chemlight_green" createVehicle getPos _drop;
  90. _light attachTo [_drop,[0,0,0]];
  91. _flare = "F_40mm_Green" createVehicle getPos _drop;
  92. _flare attachTo [_drop,[0,0,0]];
  93. playSound3D ["a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", _drop];
  94. uiSleep 20;
  95. //check if the stupid pilot blew shit up or goto new wp.
  96. _damage = getDammage _vehMain;
  97. if (_damage > 0.01) then {deleteVehicle _vehMain;};
  98. _crew addWaypoint [_endPos, 1, 2];
  99. [_crew, 2] setWaypointSpeed "NORMAL";
  100. _vehMain flyInHeight 500;
  101.  
  102. detach _drop;
  103. _drop setPos [getPos _drop select 0, getPos _drop select 1, (getPos _drop select 2)+0.5];
  104. playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", _drop];
  105. uiSleep 6;
  106. "M_NLAW_AT_F" createVehicle [getPos _drop select 0, getPos _drop select 1, 0]; //Boom
  107. _pos_drop = getPos _drop;
  108. deleteVehicle _drop;
  109. uiSleep 0.5;
  110. _box = createVehicle [_main , _pos_drop, [], 0, "CAN_COLLIDE"];
  111. _box allowDamage false;
  112. _smoke="SmokeShellGreen" createVehicle [getpos _box select 0,getpos _box select 1,0];
  113. _flare = "F_40mm_Green" createVehicle getPos _drop;
  114. _light attachTo [_box,[0,0,0]];
  115. _flare attachTo [_box,[0,0,0]];
  116.  
  117.  
  118. //Weapon arrays
  119. _num = random (2); //Number chosen so it can select the same type of mag and weapon
  120. _special = [["muzzle_snds_93mmg", 1],["muzzle_snds_B", 2]];
  121. _specialArr = [["arifle_MX_SW_F",5],["LMG_Mk200_F", 3],["srifle_EBR_F",5]];
  122. _magArr = [["100Rnd_65x39_caseless_mag", 10],["200Rnd_65x39_cased_Box", 15],["20Rnd_762x51_Mag",20]];
  123. _rifleArr1 = [["arifle_MX_F", 15],["arifle_Katiba_F", 15]];
  124. _magArr1 = [["30Rnd_65x39_caseless_mag", 50],["30Rnd_65x39_caseless_green", 30]];
  125.  
  126. //Select from arrays
  127. _specialItem = _special call BIS_fnc_selectRandom;
  128. _specialRifle = _specialArr select _num;
  129. _sMag = _magARR select _num;
  130. _rifle = _rifleArr1 call BIS_fnc_selectRandom;
  131. _mags = _magArr1 call BIS_fnc_selectRandom;
  132.  
  133. //Add cargo to box
  134. _box addItemCargoGlobal _specialItem;
  135. _box addItemCargoGlobal _specialRifle;
  136. _box addItemCargoGlobal _sMag;
  137. _box addItemCargoGlobal _rifle;
  138. _box addItemCargoGlobal _mags;
  139.  
  140. //Time until the box is destroyed
  141. uiSleep (60*2);
  142. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>Supply Drop will self destruct in 20 minutes</t>"] remoteexec ["life_fnc_broadcast",RANY];
  143. uiSleep (60*15);
  144. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>Supply Drop will self destruct in 5 minutes</t>"] remoteexec ["life_fnc_broadcast",RANY];
  145. uiSleep (60*4);
  146. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>Supply Drop will self destruct in 1 minute</t>"] remoteexec ["life_fnc_broadcast",RANY];
  147. uiSleep (30);
  148. _loop = false;
  149. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>Supply Drop will self destruct in 30 secconds</t>"] remoteexec ["life_fnc_broadcast",RANY];
  150.  
  151. //Cleanup
  152. uiSleep (30);
  153. "M_NLAW_AT_F" createVehicle [getPos _box select 0, getPos _box select 1, 0]; //Because it looks nicer
  154. deleteVehicle _vehMain;
  155. deleteVehicle _box;
  156. [3,"<t size='1.3'><t color='#FF0000'>Supply Drop</t></t><br/><br/><t size='1'>Supply Drop has been destroyed. Supply Drop mission has ended. Good work everyone</t>"] remoteexec ["life_fnc_broadcast",RANY];
  157.  
  158. uiSleep (60*120); //Time before it's run again aka cooldown
  159. [] execVM "\life_server\Functions\Larry\fn_airdrop.sqf";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement