Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///// ///// ///// ///// ///// ///// ///// ///// /////
- /////////////////////////////////////////////////////////////////////////////////////
- ///////////////mmmyum's random animated air raid dayz////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////
- // README
- // change setup to suit your needs
- // read further comments if you'd like to customize further
- //
- //special thanks to arma scripters maxjoiner and darkxess from armaholic, and the opendayz community!//
- //
- //mmmyum
- //
- ///////////////////////////////////////////////////INITIALIZE
- private ["_preWaypointPos","_spawnMarker","_spawnRadius","_x","_wp","_espl","_sound","_duration","_aispawncoords","_aispawn","_rndSel","_loc","_city","_z","_xx","_y","_coords","_target","_posdebug","_heliModel","_heliStart","_safetyPoint","_bomberName","_positionLand","_startTime","_bomber","_landingzone2","_aigroup2","_helipilot2","_wp2","_pos","_siren","_pos1","_bombardStart","_bombardDone","_wp3","_posBomb","_repeat","_break","_choice","_rmodyn","_preWaypoints","_sounddist","_ray","_xypossir","_pos2","_targetpos","_pos2cnt","_seconds","_dblsecs","_nul","_playNum","_sirenSound"];
- _loc = ["BalottaAirstrip",1.5,4829.9868,2450.1104];
- _city = "BalottaAirstrip";
- _xx = 4829.9868;
- _y = 2450.1104;
- _z = 1.5;
- _coords = [_xx,_y,_z];
- diag_log format ["RANDOM WORLDSPACE: Initializing defaults... %1 | %2 %3 %4|",_city,_xx,_y,_z];
- sleep 1;
- ////////////////////////////////////////////////////SETUP SETUP SETUP//SETUP SETUP SETUP//SETUP SETUP SETUP//SETUP SETUP SETUP//SETUP SETUP SETUP
- _repeat = 30; //times to repeat
- _break = 300; //time to break between attacks, in seconds
- _choice = 1; //type of bombing 1 light, 2 medium, 3 heavy
- _duration = 60; //how long the bombing should last - really how many bombs are dropped assuming 1 per cycle
- _rmodyn = false; //1 if you have rmod, 0 if you don't (mv22 mi24 vs uh1h and mi17)
- _preWaypoints = 0; //untested, add waypoints before arriving at location.
- _sounddist = 1500; //distance sounds are audible at
- _ray = 120; //ray of bombing
- _seconds = _duration; // time bombing dont change me
- _dblsecs = _seconds * 2;
- ////////////////////////////////////////////////////END SETUP//END SETUP//END SETUP//END SETUP//END SETUP//END SETUP//END SETUP//END SETUP
- //selector
- While {_repeat > 1} do {
- _duration = 60; //how long the bombing should last - really how many bombs are dropped assuming 1 per cycle
- _rndSel=floor(random 49); //select random number 0-49, then set loc based on the case number//change locations if you'd like, format ["name",z,x,y]
- _loc=
- switch (_rndSel) do {
- case 0: {["BalottaAirstrip",1.5,4829.9868,2450.1104]};
- case 1: {["Berenzino",1.5,12954.624,9783.1533]};
- case 2: {["Bereznio2",1.5,12043.963,9091.3477]};
- case 3: {["BlackMountain",1.5,10276.416,12049.6640]};
- case 4: {["Bor",1.5,3320.1643,3938.3496]};
- case 5: {["Cherno",1.5,6743.8853,2581.1865]};
- case 6: {["DevilsCastle",1.5,6891.9189,11438.73]};
- case 7: {["DonsCamp",1.5,7788.2856,12613.048]};
- case 8: {["Drozhino",1.5,3442.2849,4955.7129]};
- case 9: {["Dubrovka",1.5,10445.011,9868.9912]};
- case 10: {["Electro",1.5,10480.69,2217.8027]};
- case 11: {["Factory",1.5,13060.078,7094.0596]};
- case 12: {["Gorka",1.5,9659.084,8795.334]};
- case 13: {["Grishno",1.5,5979.6953,10343.341]};
- case 14: {["Guglovo",1.5,8517.8682,6676.3276]};
- case 15: {["Gvozdno",1.5,8614.4316,11868.967]};
- case 16: {["Kabanino",1.5,5318.8369,8602.6328]};
- case 17: {["Kamyshovo",1.5,12127.406,3496.2185]};
- case 18: {["Khelm",1.5,12290.833,10904.328]};
- case 19: {["Komarovo",1.5,3654.0908,2475.9468]};
- case 20: {["Kozlovka",1.5,4483.6777,4616.1675]};
- case 21: {["Krastonav",1.5,11212.624,12256.609]};
- case 22: {["Lopatino",1.5,2780.3135,10018.82]};
- case 23: {["Moglievka",1.5,7544.5845,5148.7822]};
- case 24: {["Msta",1.5,11275.323,5495.4053]};
- case 25: {["Myshkino",1.5,2019.2487,7327.7178]};
- case 26: {["Nadezhdino",1.5,5846.4434,4706.708]};
- case 27: {["NEAF",1.5,12073.906,12724.305]};
- case 28: {["Nizhnoye",1.5,13002.393,8285.8574]};
- case 29: {["NovySobor",1.5,7074.4854,7683.4883]};
- case 30: {["NWAF",1.5,4480.0781,10375.544]};
- case 31: {["Orlovets",1.5,12146.174,7266.5801]};
- case 32: {["Pavlovo",1.5,1693.9392,3845.0657]};
- case 33: {["Petrovka",1.5,5014.1143,12493.039]};
- case 34: {["Pogorevka",1.5,4473.5957,6411.3198]};
- case 35: {["Polana",1.5,10753.393,8132.6606]};
- case 36: {["Prigorodki",1.5,7976.5557,3299.5386]};
- case 37: {["Pulkovo",1.5,4915.0903,5605.6401]};
- case 38: {["Pusta",1.5,9156.2549,3897.7598]};
- case 39: {["Pustoshka",1.5,3072.9629,7945.4404]};
- case 40: {["Rogovo",1.5,4808.0024,6805.0518]};
- case 41: {["Shakhovka",1.5,9654.5244,6555.2583]};
- case 42: {["Solnichny",1.5,13454.279,6233.647]};
- case 43: {["Soosnovka",1.5,2528.7561,6354.9839]};
- case 44: {["Staroye",1.5,10140.659,5434.4302]};
- case 45: {["StarySobor",1.5,6143.6167,7721.5176]};
- case 46: {["Tulga",1.5,12803.296,4450.7466]};
- case 47: {["Vybor",1.5,3815.0635,8865.0938]};
- case 48: {["Vyshnoye",1.5,6590.3159,6029.1128]};
- case 49: {["Zelenogorsk",1.5,2758.7144,5304.3457]};
- };
- _city = _loc select 0;
- _z = _loc select 1;
- _xx = _loc select 2;
- _y = _loc select 3;
- _coords = [_xx,_y,_z]; ////////////////////////////////////////////////does this need spaces?
- diag_log format ["RANDOM WORLDSPACE: %1 | %2",_city,_coords];
- sleep 1;
- diag_log format ["RANDOM WORLDSPACE SELECTED: %1 | City: %2 | Coords: %3 %4 |||Try %5",_rndSel,_city,_xx,_y,_repeat];
- //_repeat = _repeat - 1;/////////////////////////////////////////not sure why this was here
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //above ---- the worldpace is selected, coordinates stored in _coords = [_xx,_y,_z]/////////////////////////////////////////////////////////
- //below ---- chopper is created, flies to waypoint _coords while sirens play, hangs around till bombs are done flies off and is deleted/////////////
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //CREATE TARGET///////////////
- _loc = createVehicle ["HeliHEmpty", _coords,[], 0, "NONE"];
- _target = createVehicle ["HeliHEmpty",position _loc,[], 0, "NONE"];
- _posdebug = position _target;
- diag_log format ["AIRRAID: SEL: %1 | TARGET: %2 | SHOULD MATCH APPROX",_posdebug,_coords];
- /////above is the target to bomb
- sleep 2;
- //Random Heli-Type
- //if (_rmodyn) then {
- // _heliModel = ["Mi24_D","MV22"] call BIS_fnc_selectRandom;
- //} else {
- // _heliModel = ["UH1H_DZ","Mi17_DZ"] call BIS_fnc_selectRandom;
- //};
- _heliModel = "UH1H_DZ";
- //Random-Startpositions, Adjust this for other Maps then Chernarus //////////////////////////////mmmyum - change me to where you want heli to start, ie over carrier?
- _heliStart = [[6993.7007,173.05298,300],[1623.715,218.18848,300]] call BIS_fnc_selectRandom;
- //A Backup Waypoint, if not Chernarus, set some Coordinates far up in the north (behind all possible Crashsites)////again, change to whereever you would like
- _safetyPoint = [7492.6675, 15263.042];
- _bomberName = getText (configFile >> "CfgVehicles" >> _heliModel >> "displayName");
- diag_log(format["AIRRAID: BOMBER: %1 | Lift Off at %2 | with Backup WP %3",_bomberName,str(_heliStart),str(_safetyPoint)]);
- diag_log(format["AIRRAID: BOMBER: %1 | TYPE: %2 |",_bomberName,_heliModel]);
- _positionLand = [position _target,0,200,5,0,2000,0] call BIS_fnc_findSafePos; //set chopper destination
- diag_log(format["AIRRAID: BOMBER: %1 started flying from %2 to %3 NOW!(TIME:%4|)", _bomberName, str(_heliStart), str(_positionLand), round(time)]);
- //Spawn the AI-Heli flying in the air
- _startTime = time;
- _bomber = createVehicle [_heliModel,_heliStart, [], 0, "FLY"];
- //Make sure its not destroyed by the Hacker-Killing-Cleanup (Thanks to Sarge for the hint)
- _bomber setVariable["Sarge",1,true]; //I'm unsure what do to here, so I'm leaving it
- _bomber engineOn true;
- _bomber flyInHeight 350;
- _bomber forceSpeed 250;
- //_bomber setspeedmode "LIMITED";
- //Create an Invisibile Landingpad at the Crashside-Coordinates
- _landingzone2 = createVehicle ["HeliHEmpty", [_positionLand select 0, _positionLand select 1,0], [], 0, "CAN_COLLIDE"]; //_targets x,y
- _landingzone2 setVariable["Sarge",1];
- diag_log(format["AIRRAID: BOMBER: LANDINGZONE: %1 | BOMBER POS: %2 | POS LAND: %3",str(getPosATL _landingzone2),str(getPosATL _bomber),str(_positionLand)]);
- //Only a Woman could crash a Heli this way...
- _aigroup2 = creategroup civilian;
- _helipilot2 = _aigroup2 createUnit ["SurvivorW2_DZ",getPos _bomber,[],0,"FORM"];
- _helipilot2 moveindriver _bomber;
- _helipilot2 assignAsDriver _bomber;
- sleep 0.5;
- if(_preWaypoints > 0) then {
- for "_x" from 1 to _preWaypoints do {
- _preWaypointPos = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
- };
- diag_log(format["AIRRAID: BOMBER: Adding Pre-POC-Waypoint #%1 on %2", _x,str(_preWaypointPos)]);
- _wp = _aigroup2 addWaypoint [_preWaypointPos, 0];
- _wp setWaypointType "MOVE";
- //_wp setWaypointBehaviour "CARELESS";
- };
- _wp2 = _aigroup2 addWaypoint [position _target, 0];
- _wp2 setWaypointType "MOVE";
- //_wp2 setWaypointBehaviour "CARELESS";
- //Get some more Speed when close to the Crashpoint and go on even if Heli died or hit the ground
- waituntil {(_bomber distance _positionLand) <= 2500};
- _bomber flyInHeight 300;
- _bomber forceSpeed 260;
- _bomber setspeedmode "NORMAL";
- ///////////////////////////////////////////////////////////////////START SIRENS/////////////////////////////////////////////////////
- _xypossir = position _target;
- diag_log format ["AIRRAID: INCOMING ATTACK: Sounding Siren at: %1 %2 | Repeat: %3| Type: %4 | Duration: %5",_xypossir,_wp2,_repeat,_choice,_duration];
- //sounds
- _pos = position _target;
- diag_log format ["AIRRAID: POS: %1 | TARGET: %2 | SHOULD MATCH",_pos,_coords];
- _siren = createVehicle ["HeliHEmpty",position _target,[], 0, "NONE"];
- //_sirenSound = createSoundSource ["nam", position _target, [], 5];
- _siren = [objNull, _target, rSAY, ["puk", 1500]] call RE;
- //_siren say ["eve",_sounddist]; // siren sound
- sleep 20;
- //_siren say ["puk",_sounddist]; // siren sound
- //sleep 60;
- _pos1 = position _siren;
- diag_log format ["AIRRAID: SIREN: %1 | TARGET: %2 | SHOULD MATCH APPROX",_pos1,_coords];
- diag_log(format["AIRRAID: BOMBER: %1 is at %2!, ", _bomberName, str(getPosATL _bomber)]);
- //_siren say ["eve",_sounddist]; // siren sound
- //sleep 30;
- //_siren say ["nam",_sounddist]; // siren sound
- //sleep 30;
- //_siren say ["puk",_sounddist];
- //sleep 30; // wait a while
- //_siren say ["nam",_sounddist];
- //sleep 30; //thats enough warning
- _playNum = 30;
- while {_playNum > 0} do {
- //if (isPlayer _x AND (_x distance _siren) < 1500) then {
- _nul = [nil, _siren, rSAY, ["nam", 1500]] call RE; // This is a RPC sound call for the sound
- //} foreach playableUnits;
- sleep 10;
- 10 fadeSound 1; // Fades sound in over time
- diag_log(format["AIRRAID: Playing Siren at %1 | Siren Nam 1500",str(getPosATL _siren)]);
- _playNum = _playNum - 1;
- };
- //[objNull, _siren, rSAY, ["puk", 1500]] call RE;
- ////////////////////////////////////////DEBUG //worries that that this will stop the script calling the says with the sleep sections.
- ////////////////////////////////////////////////maybe it will just make it play sirens for my set amount of time, then it will move on down the list
- //waituntil {(_bomber distance _positionLand) <= 1500};
- _bomber flyInHeight 300;
- _bomber forceSpeed 180;
- _bomber setspeedmode "NORMAL";
- diag_log(format["AIRRAID: BOMBER: %1 is at %2!, ", _bomberName, str(getPosATL _bomber)]);
- //_siren say ["nam",_sounddist];
- sleep 20;
- //waituntil {(_bomber distance _positionLand) <= 700};
- _bomber flyInHeight 300;
- _bomber forceSpeed 120;
- _bomber setspeedmode "NORMAL";
- _bombardStart = true; //set var so we know to start bombing (heli is in position)
- //_siren say ["puk",_sounddist];
- diag_log(format["AIRRAID: BOMBER: %1 Bombing Initialize: arrived at %2!, ", _bomberName, str(getPosATL _bomber)]);
- ///////////////////////////////////////////////////START BOMBING////////////////////////////////////////////////////////////////////
- diag_log format ["AIRRAID: Bombing Area: %1",_xypossir];
- //bomb while _duration > 1
- _pos2 = [getPosATL _siren];
- While {_duration > 1} do {
- _sound = createVehicle ["HeliHEmpty",position _target,[], _ray, "NONE"];
- _sound say ["mortar1",_sounddist];
- _pos2 set [_seconds, getPosATL _sound];
- sleep 2;
- If (_choice == 1) then {
- _espl = createVehicle ["SH_105_HE",position _sound,[], 0, "NONE"];
- };
- If (_choice == 2) then {
- _espl = createVehicle ["SH_125_HE",position _sound,[], 0, "NONE"];
- };
- If (_choice == 3) then {
- _espl = createVehicle ["BO_GBU12_LGB",position _sound,[], 0, "NONE"];
- };
- _pos2 = [_dblsecs,getPosATL _espl];
- _targetpos = getPosATL _sound;
- _pos2cnt = count _pos2;
- diag_log format ["AIRRAID: BOMB: %1 | TARGET: %2 | SHOULD MATCH APPROX ||| debug arraycount %3 |",str(_pos2),_targetpos,_pos2cnt];
- _duration = _duration - 1;
- deletevehicle _sound;
- }; // Close while loop. loop while _duration >1
- _bombardDone = true; //set done bombing
- ///////////////////////////////////////////////////END SIRENS AND BOMBING, HELI LOWER TO GROUND, (SPAWN AIs), FLY AWAY//////////////////////////////////////////////////////////////
- waituntil {_bombardDone}; ///////////////////hover over town until town is bombed to shit
- _bomber flyInHeight 15;
- _bomber forceSpeed 140;
- _bomber setspeedmode "NORMAL";
- diag_log(format["AIRRAID: BOMBER: %1 has Completed Bombing at %2!, ", _bomberName, str(getPosATL _bomber)]);
- if (_repeat > 25) then {
- _aispawncoords = position _bomber;
- diag_log(format["AIRRAID: BOMBER: AISPAWN: %1 ",_aispawncoords]);
- _aispawn = [[_aispawncoords select 0,_aispawncoords select 1,0],5000,20,6] execVM "units\add_unit_server.sqf"; //whole map waypoints//mmmyum//spawn ais (probably shouldn't run this every time)////
- };
- //Giving the crashed Heli some time to leave
- sleep 15;
- //Adding a last Waypoint up in the North, to send bomber away after completion. Chane this location (_safetypoint) to where you want the AI to seem to originate from
- _wp3 = _aigroup2 addWaypoint [_safetyPoint, 0];
- _wp3 setWaypointType "MOVE";
- _wp3 setWaypointBehaviour "CARELESS";
- //Get position of the helis
- _posBomb = [getpos _bomber select 0, getpos _bomber select 1,0];
- sleep 2;
- _bomber forceSpeed 200;
- _bomber flyInHeight 300;
- _bomber setspeedmode "NORMAL";
- diag_log(format["AIRRAID: BOMBER: %1 Leaving Area %2!, ", _bomberName, str(getPosATL _bomber)]);
- //////////////////////////////////////////////////////////CLEAN UP//CLEAN UP//CLEAN UP//
- sleep 15;
- waituntil {(_bomber distance _safetyPoint) <= 2000};
- //_bomber set damage 1;
- //_bomber set fuel 0;
- _bomber setspeedmode "NORMAL";
- sleep 3;
- deletevehicle _bomber;
- deletevehicle _landingzone2;
- deletevehicle _helipilot2;
- _repeat = _repeat - 1;
- deletevehicle _siren;
- deletevehicle _loc;
- deletevehicle _target;
- diag_log format ["AIRRAID: Going down for sleep: Repeat:%1 | Sleep:%2",_repeat,_break];
- sleep _break;
- }; //close while loop. loop - while _repeat > 1
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement