Advertisement
Guest User

Untitled

a guest
Jan 14th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. private ["_spawnChance", "_spawnMarker", "_spawnRadius", "_markerRadius", "_item", "_debug", "_start_time", "_loot", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_position", "_event_marker", "_loot_pos", "_debug_marker","_loot_box", "_hint", "_coords","_MainMarker_bandit_helicrash","_chopper","_wait"];
  2.  
  3. _spawnChance = 1.000; // Percentage chance of event happening
  4. _markerRadius = 350; // Radius the loot can spawn and used for the marker
  5. _debug = false; // Puts a marker exactly were the loot spawns
  6.  
  7. //_loot_amount = 75;
  8. _wait_time = 900;
  9.  
  10. // Dont mess with theses unless u know what yours doing
  11. _start_time = time;
  12. _spawnRadius = 5000;
  13. _spawnMarker = 'center';
  14.  
  15. if (isNil "EPOCH_EVENT_RUNNING") then {
  16. EPOCH_EVENT_RUNNING = false;
  17. };
  18.  
  19. // Check for another event running
  20. if (EPOCH_EVENT_RUNNING) exitWith {
  21. diag_log("Event already running");
  22. };
  23.  
  24. // Random chance of event happening
  25. _spawnRoll = random 1;
  26. if (_spawnRoll > _spawnChance and !_debug) exitWith {};
  27.  
  28. // Random location
  29. _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
  30.  
  31. diag_log(format["Creating bandit helicrash at %1", _position]);
  32.  
  33. diag_log(format["Bandit helicrash event setup, waiting for %1 seconds", _wait_time]);
  34.  
  35. //private ["_coords","_MainMarker_bandit_helicrash","_chopper","_wait"];
  36.  
  37. //Created by Falcyn [QF]
  38. /*
  39. _wait = [500,1000] call fnc_hTime;
  40. sleep _wait;
  41. */
  42. MissionGo = 1;
  43.  
  44. _position = [getMarkerPos "center",0,5500,30,0,20,0] call BIS_fnc_findSafePos;
  45.  
  46. diag_log "Bandit Helicrash Created";
  47.  
  48. // Send message to users
  49. _hint = parseText format["<t align='center' color='#00FF11' shadow='2' size='1.75'>Bandit Supply Helicopter Crash</t><br/><t align='center' color='#ffffff'>A bandit supply helicopter has crashed and the bandits are off loading their supplies. Get there and finish them off!</t>"];
  50. customRemoteMessage = ['hint', _hint];
  51. publicVariable "customRemoteMessage";
  52.  
  53. //Mission start
  54. //[nil,nil,rTitleText,"A bandit supply helicopter has crash landed! Check your map for the location!", "PLAIN",10] call RE;
  55.  
  56. Ccoords = _position;
  57. publicVariable "Ccoords";
  58. //[] execVM "debug\addmarkers.sqf";
  59.  
  60. while{MissionGo == 1} do { //refresh marker script by *hs-s.com | waTTe - www.banditparty.de
  61. _MainMarker_bandit_helicrash = createMarker ["_MainMarker_bandit_helicrash", Ccoords];
  62. _MainMarker_bandit_helicrash setMarkerColor "ColorBlue";
  63. _MainMarker_bandit_helicrash setMarkerType "mil_objective";
  64. _MainMarker_bandit_helicrash setMarkerText "Bandit supply helicopter crash";
  65. sleep 25;
  66. deleteMarker _MainMarker_bandit_helicrash;
  67. };
  68.  
  69. // Cut the grass around the loot position
  70. _clutter = createVehicle ["ClutterCutter_small_2_EP1", _position, [], 0, "CAN_COLLIDE"];
  71. _clutter setPos _position;
  72. // cut the grass end
  73.  
  74. _chopper = ["UH1H_DZE","Mi17_DZE"] call BIS_fnc_selectRandom;
  75.  
  76. _hueychop = createVehicle [_chopper,_position,[], 0, "NONE"];
  77. _hueychop setVariable ["Bandit",1,true];
  78. _hueychop setFuel 0.50;
  79. _hueychop setVehicleAmmo 0.00;
  80.  
  81. _crate1 = createVehicle ["USLaunchersBox",[(_position select 0) - 6, _position select 1,0],[], 0, "CAN_COLLIDE"];
  82. [_crate1] execVM "\z\addons\dayz_server\modules\fillboxes\fillBoxesS.sqf";
  83. _crate1 setVariable ["permaloot",true];
  84.  
  85. _crate2 = createVehicle ["USVehicleBox",[(_position select 0) + 6, _position select 1,0],[], 90, "CAN_COLLIDE"];
  86. [_crate2] execVM "\z\addons\dayz_server\modules\fillboxes\fillBoxesS.sqf";
  87. _crate2 setVariable ["permaloot",true];
  88.  
  89. _crate3 = createVehicle ["RULaunchersBox",[(_position select 0) - 14, (_position select 1) -10,0],[], 0, "CAN_COLLIDE"];
  90. [_crate3] execVM "\z\addons\dayz_server\modules\fillboxes\fillBoxesH.sqf";
  91. _crate3 setVariable ["permaLoot",true];
  92.  
  93. _aispawn = [_position,80,6,6,1] execVM "\z\addons\dayz_server\modules\addunits\add_unit_server.sqf";//AI Guards
  94. sleep 5;
  95. _aispawn = [_position,80,6,4,1] execVM "\z\addons\dayz_server\modules\addunits\add_unit_server.sqf";//AI Guards
  96. sleep 5;
  97. _aispawn = [_position,40,4,4,1] execVM "\z\addons\dayz_server\modules\addunits\add_unit_server.sqf";//AI Guards
  98.  
  99. waitUntil{{isPlayer _x && _x distance _hueychop < 30 } count playableunits > 0};
  100.  
  101. //Mission accomplished
  102. [nil,nil,rTitleText,"The helicopter has been taken by survivors!", "PLAIN",6] call RE;
  103.  
  104. // Wait
  105. sleep _wait_time;
  106.  
  107. // Clean up
  108. EPOCH_EVENT_RUNNING = false;
  109. deleteVehicle _crate1;
  110. deleteVehicle _crate2;
  111. deleteVehicle _crate3;
  112. deleteVehicle _clutter;
  113. deleteMarker _event_marker_bandit_helicrash;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement