Advertisement
squeezer2k

Airraid

May 6th, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 8.84 KB | None | 0 0
  1. ////////////////////////////////////////////////////////////////////////////////////////
  2. //      DayZ Air Raid written by                                                    //
  3. //              mmmyum    with    work    from                                      //
  4. // sirens: http://www.armaholic.com/page.php?id=12598 by DarkXess                    //
  5. // bombs: http://www.armaholic.com/page.php?id=15612 by Maxjoiner                    //
  6. //      modified by squeezer                                                          //
  7. ////////////////////////////////////////////////////////////////////////////////////////
  8.  
  9. /////////////////////////SETUP repeat and break
  10.  
  11. private ["_espl","_sound","_pos2","_pos2cnt","_seconds","_rndLoc","_place","_position","_choice","_duration","_xpos","_ypos","_targetpos","_loc","_target","_pos","_siren","_pos1","_choise","_ray","_dblsecs","_repeat","_break"];
  12. sleep 10;
  13. _repeat = 30;                            //times to repeat
  14. _break = 120;                            //time to break between attacks
  15. _position = [13135.9, 10393.3, 1.5]; //leave this
  16. _xpos = 13135.9;
  17. _ypos = 10393.3;
  18. _ray = 120;
  19. //repeat script
  20. diag_log format ["AIRRAID: Starting..."];
  21. sleep 2;
  22. While {_repeat > 1} do {
  23. /////////////////////////SETUP position
  24. //                                      enter positions below. format x,y,z
  25.     _rndLoc=floor(random 49);
  26.     _place=
  27.     switch (_rndLoc) do
  28.     {
  29.       case 0: {"BalottaAirstrip"};
  30.       case 1: {"Berenzino"};
  31.       case 2: {"Bereznio2"};
  32.       case 3: {"BlackMountain"};
  33.       case 4: {"Bor"};
  34.       case 5: {"Cherno"};
  35.       case 6: {"DevilsCastle"};
  36.       case 7: {"DonsCamp"};
  37.       case 8: {"Drozhino"};
  38.       case 9: {"Dubrovka"};
  39.       case 10: {"Electro"};
  40.       case 11: {"Factory"};
  41.       case 12: {"Gorka"};
  42.       case 13: {"Grishno"};
  43.       case 14: {"Guglovo"};
  44.       case 15: {"Gvozdno"};
  45.       case 16: {"Kabanino"};
  46.       case 17: {"Kamyshovo"};
  47.       case 18: {"Khelm"};
  48.       case 19: {"Komarovo"};
  49.       case 20: {"Kozlovka"};
  50.       case 21: {"Krastonav"};
  51.       case 22: {"Lopatino"};
  52.       case 23: {"Moglievka"};
  53.       case 24: {"Msta"};
  54.       case 25: {"Myshkino"};
  55.       case 26: {"Nadezhdino"};
  56.       case 27: {"NEAF"};
  57.       case 28: {"Nizhnoye"};
  58.       case 29: {"NovySobor"};
  59.       case 30: {"NWAF"};
  60.       case 31: {"Orlovets"};
  61.       case 32: {"Pavlovo"};
  62.       case 33: {"Petrovka"};
  63.       case 34: {"Pogorevka"};
  64.       case 35: {"Polana"};
  65.       case 36: {"Prigorodki"};
  66.       case 37: {"Pulkovo"};
  67.       case 38: {"Pusta"};
  68.       case 39: {"Pustoshka"};
  69.       case 40: {"Rogovo"};
  70.       case 41: {"Shakhovka"};
  71.       case 42: {"Solnichny"};
  72.       case 43: {"Soosnovka"};
  73.       case 44: {"Staroye"};
  74.       case 45: {"StarySobor"};
  75.       case 46: {"Tulga"};
  76.       case 47: {"Vybor"};
  77.       case 48: {"Vyshnoye"};
  78.       case 49: {"Zelenogorsk"};
  79.     };
  80.     diag_log format ["AIRRAID: Random Location: %1 | %2",_rndLoc,_place];
  81.     _position=
  82.     switch (_rndLoc) do
  83.     {
  84.       case 0: {[4829.9868, 2450.1104, 1.5]};
  85.       case 1: {[12954.624, 9783.1533, 1.5]};
  86.       case 2: {[12043.963, 9091.3477, 1.5]};
  87.       case 3: {[10276.416, 12049.6640, 1.5]};
  88.       case 4: {[3320.1643, 3938.3496, 1.5]};
  89.       case 5: {[6743.8853, 2581.1865, 1.5]};
  90.       case 6: {[6891.9189, 11438.73, 1.5]};
  91.       case 7: {[7788.2856, 12613.048, 1.5]};
  92.       case 8: {[3442.2849, 4955.7129, 1.5]};
  93.       case 9: {[10445.011, 9868.9912, 1.5]};
  94.       case 10: {[10480.69, 2217.8027, 1.5]};
  95.       case 11: {[13060.078, 7094.0596, 1.5]};
  96.       case 12: {[9659.084, 8795.334, 1.5]};
  97.       case 13: {[5979.6953, 10343.341, 1.5]};
  98.       case 14: {[8517.8682, 6676.3276, 1.5]};
  99.       case 15: {[8614.4316, 11868.967, 1.5]};
  100.       case 16: {[5318.8369, 8602.6328, 1.5]};
  101.       case 17: {[12127.406, 3496.2185, 1.5]};
  102.       case 18: {[12290.833, 10904.328, 1.5]};
  103.       case 19: {[3654.0908, 2475.9468, 1.5]};
  104.       case 20: {[4483.6777, 4616.1675, 1.5]};
  105.       case 21: {[11212.624, 12256.609, 1.5]};
  106.       case 22: {[2780.3135, 10018.82, 1.5]};
  107.       case 23: {[7544.5845, 5148.7822, 1.5]};
  108.       case 24: {[11275.323, 5495.4053, 1.5]};
  109.       case 25: {[2019.2487, 7327.7178, 1.5]};
  110.       case 26: {[5846.4434, 4706.708, 1.5]};
  111.       case 27: {[12073.906, 12724.305, 1.5]};
  112.       case 28: {[13002.393, 8285.8574, 1.5]};
  113.       case 29: {[7074.4854, 7683.4883, 1.5]};
  114.       case 30: {[4480.0781, 10375.544, 1.5]};
  115.       case 31: {[12146.174, 7266.5801, 1.5]};
  116.       case 32: {[1693.9392, 3845.0657, 1.5]};
  117.       case 33: {[5014.1143, 12493.039, 1.5]};
  118.       case 34: {[4473.5957, 6411.3198, 1.5]};
  119.       case 35: {[10753.393, 8132.6606, 1.5]};
  120.       case 36: {[7976.5557, 3299.5386, 1.5]};
  121.       case 37: {[4915.0903, 5605.6401, 1.5]};
  122.       case 38: {[9156.2549, 3897.7598, 1.5]};
  123.       case 39: {[3072.9629, 7945.4404, 1.5]};
  124.       case 40: {[4808.0024, 6805.0518, 1.5]};
  125.       case 41: {[9654.5244, 6555.2583, 1.5]};
  126.       case 42: {[13454.279, 6233.647, 1.5]};
  127.       case 43: {[2528.7561, 6354.9839, 1.5]};
  128.       case 44: {[10140.659, 5434.4302, 1.5]};
  129.       case 45: {[6143.6167, 7721.5176, 1.5]};
  130.       case 46: {[12803.296, 4450.7466, 1.5]};
  131.       case 47: {[3815.0635, 8865.0938, 1.5]};
  132.       case 48: {[6590.3159, 6029.1128, 1.5]};
  133.       case 49: {[2758.7144, 5304.3457, 1.5]};
  134.     };
  135.     _ray =
  136.     switch (_rndLoc) do
  137.     {
  138.       case 0: {120};
  139.       case 1: {120};
  140.       case 2: {120};
  141.       case 3: {120};
  142.       case 4: {120};
  143.       case 5: {120};
  144.       case 6: {120};
  145.       case 7: {120};
  146.       case 8: {120};
  147.       case 9: {120};
  148.       case 10: {120};
  149.       case 11: {120};
  150.       case 12: {120};
  151.       case 13: {120};
  152.       case 14: {120};
  153.       case 15: {120};
  154.       case 16: {120};
  155.       case 17: {120};
  156.       case 18: {120};
  157.       case 19: {120};
  158.       case 20: {120};
  159.       case 21: {120};
  160.       case 22: {120};
  161.       case 23: {120};
  162.       case 24: {120};
  163.       case 25: {120};
  164.       case 26: {120};
  165.       case 27: {120};
  166.       case 28: {120};
  167.       case 29: {120};
  168.       case 30: {120};
  169.       case 31: {120};
  170.       case 32: {120};
  171.       case 33: {120};
  172.       case 34: {120};
  173.       case 35: {120};
  174.       case 36: {120};
  175.       case 37: {120};
  176.       case 38: {120};
  177.       case 39: {120};
  178.       case 40: {120};
  179.       case 41: {120};
  180.       case 42: {120};
  181.       case 43: {120};
  182.       case 44: {120};
  183.       case 45: {120};
  184.       case 46: {120};
  185.       case 47: {120};
  186.       case 48: {120};
  187.       case 49: {120};      
  188.     };
  189. //////////////////////////SETUP type of bombing and duration
  190. _choice = 1;
  191. _duration = 60;
  192. /////////////////////////
  193. _xpos = _position select 0;
  194. _ypos = _position select 1;
  195. _targetpos = [_xpos, _ypos, 1.5];
  196. _loc = createVehicle ["HeliHEmpty", _targetpos,[], 0, "NONE"];
  197. _target = createVehicle ["HeliHEmpty",position _loc,[], 0, "NONE"];  // target bombing
  198. sleep 2;
  199. diag_log format ["AIRRAID: INCOMING ATTACK: Sounding Siren at: %1 %2 | Repeat: %3| Type: %4 | Duration: %5",_xpos,_ypos,_repeat,_choice,_duration];
  200.  
  201.  
  202. //sound siren
  203. _pos = position _target;
  204. diag_log format ["AIRRAID: POS: %1 | TARGET: %2 | SHOULD MATCH",_pos,_targetpos];
  205. _siren = createVehicle ["HeliHEmpty",position _target,[], 0, "NONE"];
  206. [nil,_siren,rSAY,['eve', 3500]] call RE;
  207. sleep 60;
  208. _pos1 = position _siren;
  209. diag_log format ["AIRRAID: SIREN: %1 | TARGET: %2 | SHOULD MATCH APPROX",_pos1,_targetpos];
  210. [nil,_siren,rSAY,['puk', 3500]] call RE;
  211. sleep 60;
  212. [nil,_siren,rSAY,['eve', 3500]] call RE;
  213. sleep 60;
  214. [nil,_siren,rSAY,['nam', 3500]] call RE;
  215. sleep 10;
  216. [nil,_siren,rSAY,['puk', 3500]] call RE;
  217. sleep 60;
  218. [nil,_siren,rSAY,['nam', 3500]] call RE;
  219. sleep 5;
  220.  
  221. //start bombing init
  222. _choise = _choice;    // choise bombing: 1 = light 2 = medium 3 = heavy
  223. //_ray = 120;
  224. _seconds = _duration; // time bombing
  225. _dblsecs = _seconds * 2;
  226. diag_log format ["AIRRAID: Bombing Area: %1 %2",_xpos,_ypos];
  227.  
  228. //start bombing
  229. _pos2 = [getPosATL _siren];
  230. While {_seconds > 1} do {
  231. _sound = createVehicle ["HeliHEmpty",position _target,[], _ray, "NONE"];
  232. [nil,_sound,rSAY,['mortar1', 3500]] call RE;
  233. _pos2 set [_seconds, getPosATL _sound];
  234. sleep 2;
  235. If (_choise == 1) then {
  236. _espl = createVehicle ["SH_105_HE",position _sound,[], 0, "NONE"];
  237. };
  238. If (_choise == 2) then {
  239. _espl = createVehicle ["SH_125_HE",position _sound,[], 0, "NONE"];
  240. };
  241. If (_choise == 3) then {
  242. _espl = createVehicle ["BO_GBU12_LGB",position _sound,[], 0, "NONE"];
  243. };
  244. _pos2 = [_dblsecs,getPosATL _espl];
  245. _pos2cnt = count _pos2;
  246. diag_log format ["AIRRAID: BOMB: %1 | TARGET: %2 | SHOULD MATCH APPROX ||| debug arraycount %3 |",str(_pos2),_targetpos,_pos2cnt];
  247. _seconds = _seconds - 1;
  248. deletevehicle _sound;
  249. };
  250.  
  251. //cleanup
  252. sleep 60;
  253. _repeat = _repeat - 1;
  254. deletevehicle _espl;
  255. deletevehicle _siren;
  256. deletevehicle _loc;
  257. deletevehicle _target;
  258. diag_log format ["AIRRAID: Going down for sleep: Repeat:%1 | Sleep:%2",_repeat,_break];
  259. sleep _break;                
  260. };
  261. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement