Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_aiunit","_xpos","_ypos","_unitpos","_aiGroup","_wppos","_wpradius","_wpnum","_levelnum","_numunits","_rndLOut","_ailoadout","_wp","_aispawnpos","_aiwep1","_aiammo1","_aiwep2","_aiammo2","_spawnChance", "_spawnMarker", "_spawnRadius", "_markerRadius", "_item", "_debug", "_start_time", "_loot", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_position", "_event_marker_dropzone_dropzone", "_loot_pos", "_debug_marker","_loot_box","_hint", "_cleanheli","_drop","_helipos","_gunner2","_gunner","_playerPresent","_skillarray","_aicskill","_aiskin","_aigear","_helipatrol","_gear","_skin","_backpack","_mags","_gun","_triggerdis","_startingpos","_aiweapon","_mission","_heli_class","_startPos","_helicopter","_unitGroup","_pilot","_skill","_paranumber","_position","_wp1"];
- _spawnChance = 1.000; // Percentage chance of event happening
- _markerRadius = 350; // Radius the loot can spawn and used for the marker
- _debug = false; // Puts a marker exactly were the loot spawns
- _wait_time = 600;
- // Dont mess with theses unless u know what yours doing
- _start_time = time;
- _spawnRadius = 5000;
- _spawnMarker = 'center';
- if (isNil "EPOCH_EVENT_RUNNING") then {
- EPOCH_EVENT_RUNNING = false;
- };
- // Check for another event running
- if (EPOCH_EVENT_RUNNING) exitWith {
- diag_log("Event already running");
- };
- // Random chance of event happening
- _spawnRoll = random 1;
- if (_spawnRoll > _spawnChance and !_debug) exitWith {};
- // Random location
- _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
- diag_log(format["Spawning C-130 drop zone event at %1", _position]);
- _event_marker_dropzone_c130 = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
- _event_marker_dropzone_c130 setMarkerColor "ColorGreen";
- _event_marker_dropzone_c130 setMarkerType "mil_objective";
- _event_marker_dropzone_c130 setMarkerText "UH60 Drop Zone";
- _loot_pos = [_position,0,(_markerRadius - 100),10,0,2000,0] call BIS_fnc_findSafePos;
- diag_log(format["Creating UH60 drop zone at %1", _loot_pos]);
- // Send message to users
- _hint = parseText format["<t align='center' color='#00FF11' shadow='2' size='1.75'>Airborne Troops</t><br/><t align='center' color='#ffffff'>The US Army has sent in the 101st Airborne to eliminate the Bandit threat. They are dropping in via UH60!</t>"];
- customRemoteMessage = ['hint', _hint];
- publicVariable "customRemoteMessage";
- diag_log(format["UH60 Drop zone event setup, waiting for %1 seconds", _wait_time]);
- _startingpos = [10371.9, 15375, 0];
- _heli_class = "UH60M_EP1";
- _paranumber = 10;
- _skill = 1;
- _gun = "Random";
- _mags = 4;
- _backpack = "";
- _skin = "Soldier1_DZ";
- _gear = "Random";
- _helipatrol = True;
- //if (count _this > 12) then {
- // _mission = _this select 12;
- //} else {
- // _mission = False;
- //};
- //_delay = _this select 12;
- _aiweapon = [];
- _aigear = [];
- _aiskin = "";
- _aicskill = [];
- _skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
- // wait for player to come into area.
- //diag_log "Drop zone: Paradrop Waiting for player";
- //waitUntil
- //{
- // sleep 10;
- // _playerPresent = false;
- // {if((isPlayer _x) AND (_x distance [(_position select 0),(_position select 1),0] <= _triggerdis)) then {_playerPresent = true};}forEach playableUnits;
- // (_playerPresent)
- //};
- //Delay before chopper spawns in.
- //sleep _delay;
- //Spawing in Chopper and crew
- diag_log format ["UH60 Drop zone: Spawning a %1 with %2 units to be paradropped at %3",_heli_class,_paranumber,_position];
- _unitGroup = createGroup west;
- _pilot = _unitGroup createUnit ["Rocket_DZ", [0,0,0], [], 1, "NONE"];
- [_pilot] joinSilent _unitGroup;
- ai_air_units = (ai_air_units +1);
- 10371.9, 15375
- _helicopter = createVehicle [_heli_class, [(_startingpos select 0),(_startingpos select 1), 100], [], 0, "FLY"];
- _helicopter setFuel 1;
- _helicopter engineOn true;
- _helicopter setVehicleAmmo 1;
- _helicopter flyInHeight 150;
- _helicopter addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
- _pilot assignAsDriver _helicopter;
- _pilot moveInDriver _helicopter;
- _gunner = _unitGroup createUnit ["Soldier1_DZ", [0,0,0], [], 1, "NONE"];
- _gunner assignAsGunner _helicopter;
- _gunner moveInTurret [_helicopter,[0]];
- [_gunner] joinSilent _unitGroup;
- ai_air_units = (ai_air_units +1);
- _gunner2 = _unitGroup createUnit ["Soldier1_DZ", [0,0,0], [], 1, "NONE"];
- _gunner2 assignAsGunner _helicopter;
- _gunner2 moveInTurret [_helicopter,[1]];
- [_gunner2] joinSilent _unitGroup;
- ai_air_units = (ai_air_units +1);
- {_pilot setSkill [_x,1]} forEach _skillarray;
- {_gunner setSkill [_x,0.7]} forEach _skillarray;
- {_gunner2 setSkill [_x,0.7]} forEach _skillarray;
- {_x addweapon "Makarov";_x addmagazine "8Rnd_9x18_Makarov";_x addmagazine "8Rnd_9x18_Makarov";} forEach (units _unitgroup);
- PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_helicopter];
- [_helicopter] spawn veh_monitor;
- _unitGroup allowFleeing 0;
- _unitGroup setBehaviour "STEALTH";
- //_unitGroup setBehaviour "CARELESS";
- _unitGroup setSpeedMode "FULL";
- _unitGroup setCombatMode "RED";
- // Add waypoints to the chopper group.
- _wp = _unitGroup addWaypoint [[(_position select 0), (_position select 1)], 0];
- _wp setWaypointType "MOVE";
- _wp setWaypointCompletionRadius 100;
- _drop = True;
- _helipos = getpos _helicopter;
- while {(alive _helicopter) AND (_drop)} do {
- private ["_magazine","_weapon","_weaponandmag","_chute","_para","_pgroup"];
- sleep 1;
- _helipos = getpos _helicopter;
- if (_helipos distance [(_position select 0),(_position select 1),100] <= 250) then {
- _pgroup = createGroup west;
- for "_x" from 1 to _paranumber do {
- _helipos = getpos _helicopter;
- switch (_gun) do {
- _rndLOut=floor(random 7);
- _ailoadout=
- //_aiweapon =
- switch (_rndLOut) do
- {
- case 0: {["AK_47_M","30Rnd_762x39_AK47","MakarovSD","8Rnd_9x18_Makarov"]};
- case 1: {["M4A1_RCO_GL","30Rnd_762x39_AK47","M9SD","15Rnd_9x19_M9SD"]};
- case 2: {["Sa58P_EP1","30Rnd_762x39_SA58","MakarovSD","8Rnd_9x18_Makarov"]};
- case 3: {["Sa58V_CCO_EP1","30Rnd_762x39_SA58","M9SD","15Rnd_9x19_M9SD"]};
- case 4: {["Sa58V_EP1","30Rnd_762x39_SA58","MakarovSD","8Rnd_9x18_Makarov"]};
- case 5: {["M4SPR","30Rnd_556x45_Stanag","M9SD","15Rnd_9x19_M9SD"]};
- case 6: {["M4A1_HWS_GL_SD_Camo","30Rnd_556x45_StanagSD","MakarovSD","8Rnd_9x18_Makarov"]};
- };
- };
- //_weaponandmag = _aiweapon call BIS_fnc_selectRandom;
- /*_weaponandmag = _aiweapon
- _weapon = _weaponandmag select 0;
- _magazine = _weaponandmag select 1;
- switch (_gear) do {
- case 0 : {_aigear = ai_gear0;};
- case 1 : {_aigear = ai_gear1;};
- case 2 : {_aigear = ai_gear2;};
- case 3 : {_aigear = ai_gear3;};
- case 4 : {_aigear = ai_gear4;};
- case "Random" : {_aigear = ai_gear_random call BIS_fnc_selectRandom;};
- };
- _gearmagazines = _aigear select 0;
- _geartools = _aigear select 1; */
- if (_skin == "") then {
- _aiskin = ai_skin call BIS_fnc_selectRandom;
- } else {
- _aiskin = _skin
- };
- _para = _pgroup createUnit [_aiskin, [0,0,0], [], 1, "PRIVATE"];
- if (_backpack == "") then {
- _aipack = ai_packs call BIS_fnc_selectRandom;
- } else {
- _aipack = _backpack
- };
- _para enableAI "TARGET";
- _para enableAI "AUTOTARGET";
- _para enableAI "MOVE";
- _para enableAI "ANIM";
- _para enableAI "FSM";
- _para setCombatMode ai_combatmode;
- _para setBehaviour ai_behaviour;
- _para allowDammage true;
- //clear default weapons / ammo
- removeAllWeapons _aiunit;
- //add random selection
- _aiwep1 = _ailoadout select 0;
- _aiammo1 = _ailoadout select 1;
- _aiwep2 = _ailoadout select 2;
- _aiammo2 = _ailoadout select 3;
- _aiunit addweapon _aiwep1;
- _aiunit addMagazine _aiammo1;
- _aiunit addMagazine _aiammo1;
- _aiunit addMagazine _aiammo1;
- _aiunit addweapon _aiwep2;
- _aiunit addMagazine _aiammo2;
- _aiunit addMagazine _aiammo2;
- _aiunit removeWeapon "ItemRadio";
- //add some garbage
- if (x == 1) then {
- _aiunit addMagazine "SmokeShellGreen";
- _aiunit addMagazine "HandGrenade_West";
- _aiunit addMagazine "FoodCanBakedBeans";
- _aiunit addMagazine "ItemSodaCoke";
- _aiunit addMagazine "ItemPainkiller";
- _aiunit addMagazine "ItemHeatPack";
- _aiunit addMagazine "ItemEpinephrine";
- _aiunit addMagazine "ItemMorphine";
- };
- if (x == 2) then {
- _aiunit addMagazine "ItemHeatPack";
- _aiunit addMagazine "ItemPainkiller";
- _aiunit addMagazine "ItemEpinephrine";
- _aiunit addMagazine "ItemMorphine";
- };
- if (x >= 3) then {
- _aiunit addMagazine "ItemHeatPack";
- _aiunit addMagazine "ItemBandage";
- };
- //set skills
- _aiunit setSkill ["aimingAccuracy",0.6];
- _aiunit setSkill ["aimingShake",0.7];
- _aiunit setSkill ["aimingSpeed",0.8];
- _aiunit setSkill ["endurance",0.9];
- _aiunit setSkill ["spotDistance",0.8];
- _aiunit setSkill ["spotTime",0.7];
- _aiunit setSkill ["courage",0.9];
- _aiunit setSkill ["reloadSpeed",0.8];
- _aiunit setSkill ["commanding",1];
- _aiunit setSkill ["general",1];
- //sleep 0.5;
- /*
- removeAllWeapons _para;
- removeAllItems _para;
- _para addweapon _aiweapon;
- for "_i" from 1 to _mags do {_para addMagazine _magazine;};
- _para addBackpack _aipack;
- {_para addMagazine _x} forEach _gearmagazines;
- {_para addweapon _x} forEach _geartools; */
- ai_ground_units = (ai_ground_units + 1);
- _para addEventHandler ["Killed",{[_this select 0, _this select 1, "ground"] call on_kill;}];
- _chute = createVehicle ["ParachuteEast", [(_helipos select 0), (_helipos select 1), (_helipos select 2)], [], 0, "NONE"];
- _para moveInDriver _chute;
- [_para] joinSilent _pgroup;
- sleep 1.5;
- };
- _drop = false;
- _pgroup selectLeader ((units _pgroup) select 0);
- diag_log format ["UH60 Drop zone: Spawned in %1 ai units for paradrop",_paranumber];
- [_pgroup, _position,_mission] call group_waypoints;
- };
- };
- if (_helipatrol) then {
- _wp1 = _unitGroup addWaypoint [[(_position select 0),(_position select 1)], 100];
- _wp1 setWaypointType "SAD";
- _wp1 setWaypointCompletionRadius 150;
- _unitGroup setBehaviour "AWARE";
- _unitGroup setSpeedMode "FULL";
- _unitGroup setCombatMode "RED";
- {_x addEventHandler ["Killed",{[_this select 0, _this select 1, "air"] call on_kill;}];} forEach (units _unitgroup);
- } else {
- {_x doMove [(_startingpos select 0), (_startingpos select 1), 100]} forEach (units _unitGroup);
- _unitGroup setBehaviour "CARELESS";
- _unitGroup setSpeedMode "FULL";
- _unitGroup setCombatMode "RED";
- _cleanheli = True;
- while {_cleanheli} do {
- sleep 20;
- _helipos1 = getpos _helicopter;
- if ((_helipos1 distance [(_startingpos select 0),(_startingpos select 1),100] <= 200) OR (!alive _helicopter)) then {
- deleteVehicle _helicopter;
- {deleteVehicle _x} forEach (units _unitgroup);
- sleep 10;
- deleteGroup _unitGroup;
- ai_air_units = (ai_air_units -3);
- diag_log "WAI: Paradrop cleaned up";
- _cleanheli = False;
- };
- };
- };
- // Wait
- sleep _wait_time;
- // Clean up
- EPOCH_EVENT_RUNNING = false;
- deleteMarker _event_marker_dropzone_uh60;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement