Advertisement
Guest User

events.sqf

a guest
May 1st, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.73 KB | None | 0 0
  1. params ["_corner","_mazeSize"];
  2.  
  3. _pingSpelunkers = {
  4. ["Alert",["All Spelunkers have been revealed on the map!"]] remoteExec ["BIS_fnc_showNotification"];
  5. {
  6. if (side _x == west || side _x == civilian) then {
  7. createMarker [name _x,position _x];
  8. name _x setMarkerShape "ICON";
  9. name _x setMarkerType "mil_dot";
  10. name _x setMarkerText name _x;
  11. name _x setMarkerColor (["ColorBlack","ColorRed","ColorGreen","ColorBlue","ColorYellow","ColorOrange"] call BIS_fnc_selectRandom);
  12. name _x setMarkerAlpha .5;
  13. name _x spawn {
  14. sleep 10;
  15. deleteMarker _this;
  16. };
  17. };
  18. } forEach allUnits;
  19. };
  20. _pingMonsters = {
  21. ["Alert",["All Monsters have been revealed on the map!"]] remoteExec ["BIS_fnc_showNotification"];
  22. {
  23. if (side _x == east) then {
  24. createMarker [name _x,position _x];
  25. name _x setMarkerShape "ICON";
  26. name _x setMarkerType "mil_dot";
  27. name _x setMarkerText name _x;
  28. name _x setMarkerColor (["ColorBlack","ColorRed","ColorGreen","ColorBlue","ColorYellow","ColorOrange"] call BIS_fnc_selectRandom);
  29. name _x setMarkerAlpha .5;
  30. name _x spawn {
  31. sleep 10;
  32. deleteMarker _this;
  33. };
  34. };
  35. } forEach allUnits;
  36. };
  37. _spelunkersTrip = {
  38. [[],{
  39. ["Alert",["All Spelunkers have tripped!"]] call BIS_fnc_showNotification;
  40. if (vehicle player != player || !(side player == west || side player == civilian)) exitWith {};
  41. private "_rag";
  42. _rag = "Land_Can_V3_F" createVehicleLocal [0,0,0];
  43. _rag setMass 1e10;
  44. _rag attachTo [player, [0,0,0], "Spine3"];
  45. _rag setVelocity [0,0,6];
  46. player allowDamage false;
  47. detach _rag;
  48. 0 = _rag spawn {
  49. deleteVehicle _this;
  50. player allowDamage true;
  51. };
  52. }] remoteExec ["BIS_fnc_call"];
  53. };
  54. _monstersTrip = {
  55. [[],{
  56. ["Alert",["All Monsters have tripped!"]] call BIS_fnc_showNotification;
  57. if (vehicle player != player || !(side player == east)) exitWith {};
  58. private "_rag";
  59. _rag = "Land_Can_V3_F" createVehicleLocal [0,0,0];
  60. _rag setMass 1e10;
  61. _rag attachTo [player, [0,0,0], "Spine3"];
  62. _rag setVelocity [0,0,6];
  63. player allowDamage false;
  64. detach _rag;
  65. 0 = _rag spawn {
  66. deleteVehicle _this;
  67. player allowDamage true;
  68. };
  69. }] remoteExec ["BIS_fnc_call"];
  70. };
  71. _spelunkersBlackout = {
  72. [[],{
  73. ["Alert",["All Spelunkers are blind!"]] call BIS_fnc_showNotification;
  74. if (vehicle player != player || !(side player == west || side player == civilian)) exitWith {};
  75. cutText ["","BLACK OUT",.5,true];
  76. sleep 10;
  77. cutText ["","BLACK IN",.5,true];
  78. }] remoteExec ["BIS_fnc_spawn"];
  79. };
  80. _monstersBlackout = {
  81. [[],{
  82. ["Alert",["All Monsters are blind!"]] call BIS_fnc_showNotification;
  83. if (vehicle player != player || !(side player == east)) exitWith {};
  84. cutText ["","BLACK OUT",.5,true];
  85. sleep 10;
  86. cutText ["","BLACK IN",.5,true];
  87. }] remoteExec ["BIS_fnc_spawn"];
  88. };
  89. _artyStrike = {
  90. params ["_corner","_mazeSize"];
  91. ["Alert",["Artillery inbound! Check your map!"]] remoteExec ["BIS_fnc_showNotification"];
  92. _size = 50;
  93. _center = [[(_corner select 0) + (_mazeSize * 2.5),(_corner select 1) + (_mazeSize * 2),0],random (_mazeSize * 2),random 360] call BIS_fnc_relPos;
  94. createMarker ["arty",_center];
  95. "arty" setMarkerShape "ELLIPSE";
  96. "arty" setMarkerSize [_size,_size];
  97. "arty" setMarkerBrush "Solid";
  98. "arty" setMarkerColor "ColorRed";
  99. sleep 10;
  100. for "_i" from 0 to 2*_size do {
  101. createVehicle ["G_40mm_HE",[(_center select 0) + (.5*_i*cos (_i*25)),(_center select 1) + (.5*_i*sin (_i*25)),20],[],0,"CAN_COLLIDE"] setVelocity [0,0,-10];
  102. };
  103. sleep 3;
  104. deleteMarker "arty";
  105. };
  106. _spelunkerShuffle = {
  107. ["Alert",["Spelunkers' locations will be shuffled!"]] remoteExec ["BIS_fnc_showNotification"];
  108. sleep 3;
  109. _units = [];
  110. _positions = [];
  111. {
  112. if (side _x == west || side _x == civilian) then {
  113. _units pushBack _x;
  114. _positions pushBack getPos _x;
  115. };
  116. } forEach allUnits;
  117. {
  118. _pos = _positions call BIS_fnc_selectRandom;
  119. _positions = _positions - [_pos];
  120. _x setPos _pos;
  121. } forEach _units;
  122. };
  123. _monsterShuffle = {
  124. ["Alert",["Monsters' locations will be shuffled!"]] remoteExec ["BIS_fnc_showNotification"];
  125. sleep 3;
  126. _units = [];
  127. _positions = [];
  128. {
  129. if (side _x == east) then {
  130. _units pushBack _x;
  131. _positions pushBack getPos _x;
  132. };
  133. } forEach allUnits;
  134. {
  135. _pos = _positions call BIS_fnc_selectRandom;
  136. _positions = _positions - [_pos];
  137. _x setPos _pos;
  138. } forEach _units;
  139. };
  140. _allShuffle = {
  141. ["Alert",["EVERYONE'S locations will be shuffled!"]] remoteExec ["BIS_fnc_showNotification"];
  142. sleep 3;
  143. _units = [];
  144. _positions = [];
  145. {
  146. if (side _x == west || side _x == east || side _x == civilian) then {
  147. _units pushBack _x;
  148. _positions pushBack getPos _x;
  149. };
  150. } forEach allUnits;
  151. {
  152. _pos = _positions call BIS_fnc_selectRandom;
  153. _positions = _positions - [_pos];
  154. _x setPos _pos;
  155. } forEach _units;
  156. };
  157.  
  158. _topView = {
  159. [[],{
  160. if (!hasInterface) exitWith {};
  161. ["Alert",["Get ready for top down cam!"]] call BIS_fnc_showNotification;
  162. sleep 3;
  163. _marker = "VR_3DSelector_01_default_F" createVehicleLocal position player;
  164. _marker attachTo [player,[0,0,2]];
  165. _cam = "Land_HandyCam_F" createVehicleLocal [0,0,0];
  166. _cam hideObject true;
  167. _cam attachTo [player, [0,0,50]];
  168. _cam setVectorUp [0,0.99,0.01];
  169. _cam switchCamera "Internal";
  170. sleep 10;
  171. player switchCamera "Internal";
  172. deleteVehicle _cam;
  173. deleteVehicle _marker;
  174. }] remoteExec ["BIS_fnc_spawn"];
  175. };
  176.  
  177. waitUntil {time > 15 + param_spelunkerHeadstart};
  178. ["Alert",["The monsters are loose!"]] remoteExec ["BIS_fnc_showNotification"];
  179. waitUntil {time > 25 + param_spelunkerHeadstart}; //events start 10 seconds after monsters released.
  180.  
  181. while {param_eventFreq != 0} do {
  182. _event = [_pingSpelunkers,_pingMonsters,_spelunkersTrip,_monstersTrip,_spelunkersBlackout,_monstersBlackout,_artyStrike,_spelunkerShuffle,_monsterShuffle,_allShuffle,_topView] call BIS_fnc_selectRandom;
  183. [_corner,_mazeSize] spawn _event;
  184. sleep param_eventFreq;
  185. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement