Advertisement
mmmyum

NOANIM v0.5a

Apr 27th, 2013
1,280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.27 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. ////////////////////////////////////////////////////////////////////////////////////////
  7.  
  8. /////////////////////////SETUP repeat and break
  9.  
  10. private ["_espl","_sound","_pos2","_pos2cnt","_seconds","_rndLoc","_place","_position","_choice","_duration","_xpos","_ypos","_targetpos","_loc","_target","_pos","_siren","_pos1","_choise","_ray","_dblsecs","_repeat","_break"];
  11. sleep 10;
  12. _repeat = 30;                            //times to repeat
  13. _break = 120;                            //time to break between attacks
  14. _position = [13135.9, 10393.3, 1.5]; //leave this
  15. _xpos = 13135.9;
  16. _ypos = 10393.3;
  17. //repeat script
  18. diag_log format ["AIRRAID: Starting..."];
  19. sleep 2;
  20. While {_repeat > 1} do {
  21. /////////////////////////SETUP position
  22. //                                      enter positions below. format x,y,z
  23.     _rndLoc=floor(random 5);
  24.     _place=
  25.     switch (_rndLoc) do
  26.     {
  27.       case 0: {"Electro"};
  28.       case 1: {"Berezino"};
  29.       case 2: {"NEAF"};
  30.       case 3: {"Stary"};
  31.       case 4: {"Vybor"};
  32.       case 5: {"Gorka"};
  33.     };
  34.     diag_log format ["AIRRAID: Random Location: %1 | %2",_rndLoc,_place];
  35.     _position=
  36.     switch (_rndLoc) do
  37.     {
  38.       case 0: {[10480.6, 2217.8, 1.5]};
  39.       case 1: {[12043.9, 9091.3, 1.5]};
  40.       case 2: {[12073.9, 12724.3, 1.5]};
  41.       case 3: {[6143.6, 7721.5, 1.5]};
  42.       case 4: {[3815.1, 8865.0, 1.5]};
  43.       case 5: {[9659.0, 8795.3, 1.5]};
  44.     };
  45. //////////////////////////SETUP type of bombing and duration
  46. _choice = 1;
  47. _duration = 60;
  48. /////////////////////////
  49. _xpos = _position select 0;
  50. _ypos = _position select 1;
  51. _targetpos = [_xpos, _ypos, 1.5];
  52. _loc = createVehicle ["HeliHEmpty", _targetpos,[], 0, "NONE"];
  53. _target = createVehicle ["HeliHEmpty",position _loc,[], 0, "NONE"];  // target bombing
  54. sleep 2;
  55. diag_log format ["AIRRAID: INCOMING ATTACK: Sounding Siren at: %1 %2 | Repeat: %3| Type: %4 | Duration: %5",_xpos,_ypos,_repeat,_choice,_duration];
  56.  
  57.  
  58. //sound siren
  59. _pos = position _target;
  60. diag_log format ["AIRRAID: POS: %1 | TARGET: %2 | SHOULD MATCH",_pos,_targetpos];
  61. _siren = createVehicle ["HeliHEmpty",position _target,[], 0, "NONE"];
  62. [nil,_siren,rSAY,['eve', 3500]] call RE;
  63. sleep 60;
  64. _pos1 = position _siren;
  65. diag_log format ["AIRRAID: SIREN: %1 | TARGET: %2 | SHOULD MATCH APPROX",_pos1,_targetpos];
  66. [nil,_siren,rSAY,['puk', 3500]] call RE;
  67. sleep 60;
  68. [nil,_siren,rSAY,['eve', 3500]] call RE;
  69. sleep 60;
  70. [nil,_siren,rSAY,['nam', 3500]] call RE;
  71. sleep 10;
  72. [nil,_siren,rSAY,['puk', 3500]] call RE;
  73. sleep 60;
  74. [nil,_siren,rSAY,['nam', 3500]] call RE;
  75. sleep 5;
  76.  
  77. //start bombing init
  78. _choise = _choice;    // choise bombing: 1 = light 2 = medium 3 = heavy
  79. _ray = 120;          // ray of bombing
  80. _seconds = _duration; // time bombing
  81. _dblsecs = _seconds * 2;
  82. diag_log format ["AIRRAID: Bombing Area: %1 %2",_xpos,_ypos];
  83.  
  84. //start bombing
  85. _pos2 = [getPosATL _siren];
  86. While {_seconds > 1} do {
  87. _sound = createVehicle ["HeliHEmpty",position _target,[], _ray, "NONE"];
  88. [nil,_sound,rSAY,['mortar1', 3500]] call RE;
  89. _pos2 set [_seconds, getPosATL _sound];
  90. sleep 2;
  91. If (_choise == 1) then {
  92. _espl = createVehicle ["SH_105_HE",position _sound,[], 0, "NONE"];
  93. };
  94. If (_choise == 2) then {
  95. _espl = createVehicle ["SH_125_HE",position _sound,[], 0, "NONE"];
  96. };
  97. If (_choise == 3) then {
  98. _espl = createVehicle ["BO_GBU12_LGB",position _sound,[], 0, "NONE"];
  99. };
  100. _pos2 = [_dblsecs,getPosATL _espl];
  101. _pos2cnt = count _pos2;
  102. diag_log format ["AIRRAID: BOMB: %1 | TARGET: %2 | SHOULD MATCH APPROX ||| debug arraycount %3 |",str(_pos2),_targetpos,_pos2cnt];
  103. _seconds = _seconds - 1;
  104. deletevehicle _sound;
  105. };
  106.  
  107. //cleanup
  108. sleep 60;
  109. _repeat = _repeat - 1;
  110. deletevehicle _espl;
  111. deletevehicle _siren;
  112. deletevehicle _loc;
  113. deletevehicle _target;
  114. diag_log format ["AIRRAID: Going down for sleep: Repeat:%1 | Sleep:%2",_repeat,_break];
  115. sleep _break;                
  116. };
  117. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement