Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Filename: fn_crashdrop.sqf
- Author: Kellojo
- Description: Heli crash and drop script main function - Part of the ETG script collection
- Link: http://www.armaholic.com/page.php?id=29519
- */
- _mode = [_this, 0, 0, [0]] call BIS_fnc_param;
- _time = 3600; //Time between every heli crash/supply drop in seconds (integer)
- _markertp = ""; //Type of marker? (https://community.bistudio.com/wiki/cfgMarkers) (string - leave empty if no marker is wanted) ie- "n_service";
- _fire = true; //Should fire be around the helicrashsite ? (true/false)
- _ai = false; //AI? (true/false)
- _mapcenter = [5880.1313, 8889.1045,10]; //Edit this coordinate it should be roughly the center of the map you are playing on (this one is for Altis)
- _centerrad = 13000; //Radius around the _CenterOfMap (make sure its covering the whole map - Integer)
- _rpt = true; //Writes debug information to the rpt file. (true/false)
- _MaxAmmount = 5; //Ammount of Magazines and Items that can spawn at one lootpile
- _MaxItem = 10; //Max ammount of individual items
- _MaxMag = 10; //Max ammount of individual magazines
- _MaxWeap = 10; //Max ammount of individual weapons
- _MaxBpack = 10;
- //Add or remove item classnames to the array to add them to the loot table
- _Backpacks = ['B_AssaultPack_khk','B_AssaultPack_dgtl','B_AssaultPack_rgr','B_AssaultPack_sgg','B_AssaultPack_blk','B_AssaultPack_cbr','B_AssaultPack_mcamo','B_Kitbag_mcamo','B_Kitbag_sgg','B_Kitbag_cbr','B_Bergen_sgg','B_Bergen_mcamo','B_Bergen_rgr','B_Bergen_blk','B_FieldPack_blk','B_FieldPack_ocamo','B_FieldPack_oucamo','B_FieldPack_cbr','B_Carryall_ocamo','B_Carryall_oucamo','B_Carryall_mcamo','B_Carryall_oli','B_Carryall_khk','B_Carryall_cbr','B_OutdoorPack_blk','B_OutdoorPack_tan','B_OutdoorPack_blu','B_HuntingBackpack'];
- _Weapons = ['hgun_ACPC2_F','hgun_P07_F','hgun_Pistol_heavy_01_F','hgun_Pistol_heavy_02_F','hgun_Pistol_Signal_F','hgun_Rook40_F','CUP_hgun_Colt1911','CUP_hgun_Compact','CUP_hgun_Makarov','CUP_hgun_MicroUzi','CUP_hgun_TaurusTracker455','CUP_hgun_TaurusTracker455_gold','CUP_hgun_M9','CUP_hgun_SA61','CUP_hgun_Duty','CUP_hgun_Phantom','CUP_hgun_PB6P9','CUP_hgun_Glock17','hgun_PDW2000_F','SMG_01_F','SMG_02_F','CUP_smg_MP5SD6','CUP_smg_MP5A5','CUP_smg_EVO','CUP_smg_bizon','arifle_MX_SW_Black_F','arifle_MX_SW_F','LMG_Mk200_F','LMG_Zafir_F','MMG_01_hex_F','MMG_01_tan_F','MMG_02_black_F','MMG_02_camo_F','MMG_02_sand_F','CUP_lmg_M249_para','CUP_lmg_Mk48_des','CUP_lmg_Mk48_wdl','CUP_lmg_L110A1','CUP_lmg_Pecheneg','CUP_lmg_UK59','CUP_lmg_L7A2','CUP_lmg_M240','CUP_lmg_M249','CUP_lmg_PKM','arifle_Katiba_C_F','arifle_Katiba_F','arifle_Katiba_GL_F','arifle_Mk20_F','arifle_Mk20_GL_F','arifle_Mk20_GL_plain_F','arifle_Mk20_plain_F','arifle_Mk20C_F','arifle_Mk20C_plain_F','arifle_MX_Black_F','arifle_MX_F','arifle_MX_GL_Black_F','arifle_MX_GL_F','arifle_MXC_Black_F','arifle_MXC_F','arifle_SDAR_F','arifle_TRG20_F','arifle_TRG21_F','arifle_TRG21_GL_F','CUP_arifle_FNFAL_railed','CUP_arifle_AK74','CUP_arifle_AK74M','CUP_arifle_AK74_GL','CUP_arifle_AKS','CUP_arifle_AKS_Gold','CUP_arifle_AKS74','CUP_arifle_AKS74U','CUP_arifle_AK107','CUP_arifle_AK107_GL','CUP_arifle_AKM','CUP_arifle_CZ805_A1','CUP_arifle_CZ805_GL','CUP_arifle_CZ805_A2','CUP_arifle_CZ805_B','CUP_arifle_CZ805_B_GL','CUP_arifle_G36A','CUP_arifle_G36A_camo','CUP_arifle_G36K','CUP_arifle_G36K_camo','CUP_arifle_G36C','CUP_arifle_G36C_camo','CUP_arifle_L85A2','CUP_arifle_L85A2_GL','CUP_arifle_M16A2','CUP_arifle_M16A4_Base','CUP_arifle_M16A4_GL','CUP_arifle_M4A1_BUIS_GL','CUP_arifle_M4A1_BUIS_camo_GL','CUP_arifle_M4A1_BUIS_desert_GL','CUP_arifle_M4A1','CUP_arifle_M4A1_camo','CUP_arifle_M4A1_black','CUP_arifle_M4A1_desert','CUP_arifle_M4A3_desert','CUP_arifle_Sa58P','CUP_arifle_Sa58V','CUP_arifle_Sa58RIS1','CUP_arifle_Sa58RIS2','CUP_arifle_Sa58RIS2_gl','CUP_arifle_Sa58P_des','CUP_arifle_Sa58V_camo','CUP_arifle_Sa58RIS1_des','CUP_arifle_Sa58RIS2_camo','CUP_arifle_Mk16_STD','CUP_arifle_Mk16_STD_FG','CUP_arifle_Mk16_STD_EGLM','CUP_arifle_Mk16_CQC','CUP_arifle_Mk16_CQC_FG','CUP_arifle_Mk16_CQC_EGLM','CUP_arifle_Mk16_SV','CUP_arifle_Mk17_CQC','CUP_arifle_Mk17_CQC_FG','CUP_arifle_Mk17_CQC_EGLM','CUP_arifle_Mk17_STD','CUP_arifle_Mk17_STD_FG','CUP_arifle_Mk17_STD_SFG','CUP_arifle_Mk17_STD_EGLM','CUP_arifle_Mk20','CUP_arifle_XM8_Carbine','CUP_arifle_XM8_Carbine_GL','CUP_arifle_xm8_sharpshooter','CUP_arifle_XM8_Compact','CUP_arifle_XM8_Compact_Rail','CUP_arifle_XM8_Railed','CUP_arifle_XM8_Carbine_FG','arifle_MXM_Black_F','arifle_MXM_F','srifle_DMR_01_F','srifle_DMR_02_camo_F','srifle_DMR_02_F','srifle_DMR_02_sniper_F','srifle_DMR_03_F','srifle_DMR_03_khaki_F','srifle_DMR_03_multicam_F','srifle_DMR_03_tan_F','srifle_DMR_03_woodland_F','srifle_DMR_04_F','srifle_DMR_04_Tan_F','srifle_DMR_05_blk_F','srifle_DMR_05_hex_F','srifle_DMR_05_tan_f','srifle_DMR_06_camo_F','srifle_DMR_06_olive_F','srifle_EBR_F','srifle_GM6_camo_F','srifle_GM6_F','srifle_LRR_camo_F','srifle_LRR_F','CUP_srifle_SVD_wdl_ghillie','CUP_srifle_SVD_des_ghillie_pso','CUP_srifle_DMR','CUP_srifle_ksvk','CUP_srifle_M110','CUP_srifle_M14','CUP_srifle_M24_des','CUP_srifle_M24_wdl','CUP_srifle_M24_ghillie','CUP_srifle_SVD','CUP_srifle_SVD_des','CUP_srifle_VSSVintorez','CUP_srifle_CZ750','CUP_srifle_M107_Base','CUP_srifle_Mk12SPR','CUP_srifle_AS50','CUP_srifle_AWM_des','CUP_srifle_AWM_wdl','CUP_srifle_CZ550','CUP_srifle_LeeEnfield','CUP_srifle_M40A3','CUP_sgun_AA12','CUP_sgun_M1014','CUP_sgun_Saiga12K','CUP_glaunch_M32','CUP_glaunch_M79','CUP_glaunch_Mk13'];
- _Items = ['rzinfection_antivirus_pills','rzinfection_antivirus_injector','Exile_Item_Defibrillator','optic_tws','CUP_muzzle_snds_AWM','CUP_muzzle_snds_SCAR_H','CUP_muzzle_mfsup_SCAR_H','CUP_muzzle_snds_XM8','CUP_muzzle_snds_G36_black','CUP_muzzle_snds_G36_desert','CUP_muzzle_snds_L85','CUP_muzzle_snds_M16_camo','CUP_muzzle_snds_M16','CUP_muzzle_snds_SCAR_L','CUP_muzzle_mfsup_SCAR_L','CUP_muzzle_PBS4','CUP_muzzle_PB6P9','CUP_muzzle_Bizon','CUP_muzzle_snds_M110','CUP_muzzle_snds_M14','CUP_muzzle_snds_M9','CUP_muzzle_snds_MicroUzi','muzzle_snds_338_black','muzzle_snds_338_green','muzzle_snds_338_sand','muzzle_snds_93mmg','muzzle_snds_93mmg_tan','muzzle_snds_acp','muzzle_snds_B','muzzle_snds_H','muzzle_snds_H_MG','muzzle_snds_H_SW','muzzle_snds_L','muzzle_snds_M','bipod_01_F_blk','bipod_01_F_mtp','bipod_01_F_snd','bipod_02_F_blk','bipod_02_F_hex','bipod_02_F_tan','bipod_03_F_blk','bipod_03_F_oli','acc_flashlight','acc_pointer_IR','CUP_acc_Glock17_Flashlight','CUP_acc_ANPEQ_15','CUP_acc_ANPEQ_2','CUP_acc_Flashlight','CUP_acc_Flashlight_wdl','CUP_acc_Flashlight_desert','CUP_acc_XM8_light_module','CUP_acc_ANPEQ_2_camo','CUP_acc_ANPEQ_2_desert','CUP_acc_ANPEQ_2_grey','CUP_acc_CZ_M3X','H_Cap_blk','H_Cap_blk_Raven','H_Cap_blu','H_Cap_brn_SPECOPS','H_Cap_grn','H_Cap_headphones','H_Cap_khaki_specops_UK','H_Cap_oli','H_Cap_press','H_Cap_red','H_Cap_tan','H_Cap_tan_specops_US','H_Watchcap_blk','H_Watchcap_camo','H_Watchcap_khk','H_Watchcap_sgg','H_MilCap_blue','H_MilCap_dgtl','H_MilCap_mcamo','H_MilCap_ocamo','H_MilCap_oucamo','H_MilCap_rucamo','H_Bandanna_camo','H_Bandanna_cbr','H_Bandanna_gry','H_Bandanna_khk','H_Bandanna_khk_hs','H_Bandanna_mcamo','H_Bandanna_sgg','H_Bandanna_surfer','H_Booniehat_dgtl','H_Booniehat_dirty','H_Booniehat_grn','H_Booniehat_indp','H_Booniehat_khk','H_Booniehat_khk_hs','H_Booniehat_mcamo','H_Booniehat_tan','H_Hat_blue','H_Hat_brown','H_Hat_camo','H_Hat_checker','H_Hat_grey','H_Hat_tan','H_StrawHat','H_StrawHat_dark','H_Beret_02','H_Beret_blk','H_Beret_blk_POLICE','H_Beret_brn_SF','H_Beret_Colonel','H_Beret_grn','H_Beret_grn_SF','H_Beret_ocamo','H_Beret_red','H_Shemag_khk','H_Shemag_olive','H_Shemag_olive_hs','H_Shemag_tan','H_ShemagOpen_khk','H_ShemagOpen_tan','H_TurbanO_blk','H_HelmetB','H_HelmetB_black','H_HelmetB_camo','H_HelmetB_desert','H_HelmetB_grass','H_HelmetB_light','H_HelmetB_light_black','H_HelmetB_light_desert','H_HelmetB_light_grass','H_HelmetB_light_sand','H_HelmetB_light_snakeskin','H_HelmetB_paint','H_HelmetB_plain_blk','H_HelmetB_sand','H_HelmetB_snakeskin','H_HelmetCrew_B','H_HelmetCrew_I','H_HelmetCrew_O','H_HelmetIA','H_HelmetIA_camo','H_HelmetIA_net','H_HelmetLeaderO_ocamo','H_HelmetLeaderO_oucamo','H_HelmetO_ocamo','H_HelmetO_oucamo','H_HelmetSpecB','H_HelmetSpecB_blk','H_HelmetSpecB_paint1','H_HelmetSpecB_paint2','H_HelmetSpecO_blk','H_HelmetSpecO_ocamo','H_CrewHelmetHeli_B','H_CrewHelmetHeli_I','H_CrewHelmetHeli_O','H_HelmetCrew_I','H_HelmetCrew_B','H_HelmetCrew_O','H_PilotHelmetHeli_B','H_PilotHelmetHeli_I','H_PilotHelmetHeli_O','V_Press_F','V_Rangemaster_belt','V_TacVest_blk','V_TacVest_blk_POLICE','V_TacVest_brn','V_TacVest_camo','V_TacVest_khk','V_TacVest_oli','V_TacVestCamo_khk','V_TacVestIR_blk','V_I_G_resistanceLeader_F','V_BandollierB_blk','V_BandollierB_cbr','V_BandollierB_khk','V_BandollierB_oli','V_BandollierB_rgr','V_Chestrig_blk','V_Chestrig_khk','V_Chestrig_oli','V_Chestrig_rgr','V_HarnessO_brn','V_HarnessO_gry','V_HarnessOGL_brn','V_HarnessOGL_gry','V_HarnessOSpec_brn','V_HarnessOSpec_gry','V_PlateCarrier1_blk','V_PlateCarrier1_rgr','V_PlateCarrier2_rgr','V_PlateCarrier3_rgr','V_PlateCarrierGL_blk','V_PlateCarrierGL_mtp','V_PlateCarrierGL_rgr','V_PlateCarrierH_CTRG','V_PlateCarrierIA1_dgtl','V_PlateCarrierIA2_dgtl','V_PlateCarrierIAGL_dgtl','V_PlateCarrierIAGL_oli','V_PlateCarrierL_CTRG','V_PlateCarrierSpec_blk','V_PlateCarrierSpec_mtp','V_PlateCarrierSpec_rgr','U_C_Journalist','U_C_Poloshirt_blue','U_C_Poloshirt_burgundy','U_C_Poloshirt_salmon','U_C_Poloshirt_stripped','U_C_Poloshirt_tricolour','U_C_Poor_1','U_C_Poor_2','U_C_Poor_shorts_1','U_C_Scientist','U_OrestesBody','U_Rangemaster','U_NikosAgedBody','U_NikosBody','U_Competitor','U_B_CombatUniform_mcam','U_B_CombatUniform_mcam_tshirt','U_B_CombatUniform_mcam_vest','U_B_CombatUniform_mcam_worn','U_B_CTRG_1','U_B_CTRG_2','U_B_CTRG_3','U_I_CombatUniform','U_I_CombatUniform_shortsleeve','U_I_CombatUniform_tshirt','U_I_OfficerUniform','U_O_CombatUniform_ocamo','U_O_CombatUniform_oucamo','U_O_OfficerUniform_ocamo','U_B_SpecopsUniform_sgg','U_O_SpecopsUniform_blk','U_O_SpecopsUniform_ocamo','U_I_G_Story_Protagonist_F','Exile_Uniform_Woodland','U_C_HunterBody_grn','U_IG_Guerilla1_1','U_IG_Guerilla2_1','U_IG_Guerilla2_2','U_IG_Guerilla2_3','U_IG_Guerilla3_1','U_BG_Guerilla2_1','U_IG_Guerilla3_2','U_BG_Guerrilla_6_1','U_BG_Guerilla1_1','U_BG_Guerilla2_2','U_BG_Guerilla2_3','U_BG_Guerilla3_1','U_BG_leader','U_IG_leader','U_I_G_resistanceLeader_F','U_B_FullGhillie_ard','U_B_FullGhillie_lsh','U_B_FullGhillie_sard','U_B_GhillieSuit','U_I_FullGhillie_ard','U_I_FullGhillie_lsh','U_I_FullGhillie_sard','U_I_GhillieSuit','U_O_FullGhillie_ard','U_O_FullGhillie_lsh','U_O_FullGhillie_sard','U_O_GhillieSuit','U_I_Wetsuit','U_O_Wetsuit','U_B_Wetsuit','U_B_survival_uniform','U_B_HeliPilotCoveralls','U_I_HeliPilotCoveralls','U_B_PilotCoveralls','U_I_pilotCoveralls','U_O_PilotCoveralls','optic_Aco','optic_ACO_grn','optic_ACO_grn_smg','optic_Aco_smg','optic_AMS','optic_AMS_khk','optic_AMS_snd','optic_Arco','optic_DMS','optic_Hamr','optic_Holosight','optic_Holosight_smg','optic_KHS_blk','optic_KHS_hex','optic_KHS_old','optic_KHS_tan','optic_LRPS','optic_MRCO','optic_MRD','optic_Nightstalker','optic_NVS','optic_SOS','optic_tws','optic_tws_mg','optic_Yorris'];
- _magazines = ['Exile_Item_BBQSandwich','Exile_Item_Catfood','Exile_Item_ChristmasTinner','Exile_Item_GloriousKnakworst','Exile_Item_SausageGravy','Exile_Item_Surstromming','Exile_Item_Surstromming_Cooked','Exile_Item_PlasticBottleEmpty','Exile_Item_PlasticBottleDirtyWater','Exile_Item_PlasticBottleSaltWater','Exile_Item_PlasticBottleFreshWater','Exile_Item_Energydrink','Exile_Item_Beer','Exile_Item_JunkMetal','Exile_Item_LightBulb','Exile_Item_MetalBoard','Exile_Item_MetalPole','Exile_Item_Rope','Exile_Item_PortableGeneratorKit','Exile_Item_SafeKit','Exile_Item_FuelCanisterFull','Exile_Item_FuelCanisterEmpty','Exile_Item_ExtensionCord','Exile_Item_Flag','Exile_Item_FortificationUpgrade','Exile_Item_DuctTape','Exile_Item_CamoTentKit','Exile_Item_CampFireKit','Exile_Item_InstaDoc','Exile_Item_WoodLog','Exile_Item_WoodPlank','Exile_Item_WoodFloorKit','Exile_Item_WoodGateKit'];
- _aiunits = ["O_recon_medic_F", "O_Soldier_lite_F","O_Soldier_GL_F","O_Soldier_A_F","O_Soldier_lite_F"]; //Add or remove unit classnames for more or less ai
- //random timer + calls in new drop/crash
- if (_mode == 1) exitwith {
- sleep (round (random _time));
- [2] call fn_crashdrop;
- };
- //creates a drop/crash
- if (_mode == 2) exitwith {
- //Get data
- _cord1 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
- sleep 0.5;
- _cord2 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
- sleep 0.5;
- _cord3 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
- sleep 0.5;
- _cord4 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
- sleep 0.5;
- _cord5 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
- //Spawn heli & cargo
- _veh = [[0,0,0], 180,"I_Heli_Transport_02_F",WEST] call bis_fnc_spawnvehicle;
- // _cargo = "B_CargoNet_01_ammo_F" createVehicle [0,0,0];
- _grp = group (_veh select 0);
- veh = _veh;
- cargo = _cargo;
- clearMagazineCargoGlobal _cargo;
- clearWeaponCargoGlobal _cargo;
- clearItemCargoGlobal _cargo;
- clearBackpackCargoGlobal _cargo;
- {
- _x disableAI "AUTOTARGET";
- _x disableAI "TARGET";
- _x disableAI "SUPPRESSION";
- removeBackpackGlobal _x;
- removeAllWeapons _x;
- } forEach units (_veh select 4);
- /* //Spawn loot
- _weapc = 0;
- _weapcount = round (random _MaxWeap);
- while {_weapc < _weapcount} do {
- sleep 0.1;
- _weapc = _weapc + 1;
- _curi = _Weapons call BIS_fnc_selectRandom;
- _ammount = 1;
- _mag = getArray (configFile / "CfgWeapons" / _curi / "magazines");
- _cargo addWeaponCargoGlobal [_curi,_ammount];
- _cargo addMagazineCargoGlobal [(_mag select 0),round random 8];
- };
- _magc = 0;
- _magcount = round (random _MaxMag);
- while {_magc < _magcount} do {
- sleep 0.1;
- _magc = _magc + 1;
- _curi = _magazines call BIS_fnc_selectRandom;
- _cargo addMagazineCargoGlobal [_curi,round (random 5)];
- };
- _ic = 0;
- _ic = round (random _MaxItem);
- while {_ic < _ic} do {
- sleep 0.1;
- _ic = _ic + 1;
- _curi = _Items call BIS_fnc_selectRandom;
- _ammount = 1;
- _cargo addItemCargoGlobal [_curi,_ammount];
- };
- _bpackc = 0;
- _backcount = round (random _MaxBpack);
- while {_bpackc < _backcount} do {
- sleep 0.1;
- _bpackc = _bpackc + 1;
- _curi = _Backpacks call BIS_fnc_selectRandom;
- _ammount = 1;
- _cargo addBackpackCargoGlobal [_curi,_ammount];
- };
- (_veh select 0) setSlingLoad _cargo;
- */
- //Set waypoints
- ETG_tvehdrop = false;
- ETG_tvehcrash = false;
- _wp = _grp addWaypoint [_cord1, 0];
- _wp setWaypointType "move";
- _wp setWaypointBehaviour "CARELESS";
- (_veh select 0) flyInHeight 220;
- [_grp,1]setWaypointSpeed "FULL";
- _wp = _grp addWaypoint [_cord2, 0];
- _wp setWaypointType "move";
- _wp setWaypointBehaviour "CARELESS";
- _wp setWaypointStatements ['true', "ETG_tvehdrop = true;"];
- _wp = _grp addWaypoint [_cord3, 0];
- _wp setWaypointType "move";
- _wp setWaypointBehaviour "CARELESS";
- _wp = _grp addWaypoint [_cord4, 0];
- _wp setWaypointType "move";
- _wp setWaypointBehaviour "CARELESS";
- _wp = _grp addWaypoint [_cord5, 0];
- _wp setWaypointType "move";
- _wp setWaypointBehaviour "CARELESS";
- _wp setWaypointStatements ['true', "ETG_tvehcrash = true;"];
- waituntil {ETG_tvehdrop};
- /*
- //Unload
- (_veh select 0) flyInHeight 60; // was 90
- (_veh select 0) setSlingLoad objNull;
- _chute = "B_Parachute_02_F" createVehicle position _cargo;
- _cargo attachTo [_chute,[0, 0, -1.2]];
- _smoke = "SmokeShellRed" createVehicle position _cargo;
- _smoke attachto [_cargo,[0,0,0]];
- sleep 10;
- _smoke setDamage 1;
- deleteVehicle _smoke;
- _smoke = "SmokeShellRed" createVehicle position _cargo;
- _smoke attachto [_cargo,[0,0,0]];
- waituntil {(getPos _cargo select 2) < 4};
- detach _cargo;
- sleep 4;
- deleteVehicle _chute;
- _smoke = "SmokeShellRed" createVehicle position _cargo;
- _smoke attachto [_cargo,[0,0,0]];
- if (_rpt) then {
- diag_log "###ETG Heli Crash and Drop Script by Kellojo###";
- diag_log format ["###Cargodrop position: %1",position _cargo];
- diag_log "###End###";
- };
- if !(isNil "_markertp") then {
- _marker = createMarker ["",position _cargo];
- _marker setMarkerType _markertp;
- };
- if (_ai) then {
- _hcunits = [position _cargo, EAST, _aiunits,[],[],[],[],[],180] call BIS_fnc_spawnGroup;
- _hcg = group (leader _hcunits);
- _hcg addWaypoint [position _cargo, 0];
- [_hcg, 0] setWaypointType "GUARD";
- [_hcg, 0] setWaypointBehaviour "AWARE";
- {
- removeBackpackGlobal _x;
- removeAllWeapons _x;
- _curW = _weapons call BIS_fnc_selectRandom;
- [_x,_curW, 5] call BIS_fnc_addWeapon;
- } forEach units _hcunits;
- };
- */
- //Wait for crash & crash
- waituntil {ETG_tvehcrash || (getDammage (_veh select 0) > 0.2)};
- (_veh select 0) setDamage 1;
- waituntil {(getPos (_veh select 0) select 2) < 1};
- sleep 10;
- _crashpos = position (_veh select 0);
- _crashrot = getDir (_veh select 0);
- sleep 2;
- deleteVehicle (_veh select 0);
- if !(isNil "_markertp") then {
- _marker = createMarker ["",_crashpos];
- _marker setMarkerType _markertp;
- };
- _cheli = createVehicle ["Land_Wreck_Heli_Attack_01_F",_crashpos,[], 0, "can_collide"];
- _cheli setDir _crashrot;
- _cheli setPos [position _cheli select 0,position _cheli select 1, 0.1];
- _cheli setVectorUp surfaceNormal position _cheli;
- _smokeeff = createVehicle ["test_EmptyObjectForSmoke",position _cheli,[], 0, "can_collide"];
- _smokeeff attachTo [_cheli, [0.5, -2, 1] ];
- _fireeff = createVehicle ["Campfire_burning_F",_crashpos,[], 0, "can_collide"];
- if (_ai) then {
- _hcunits = [position _cheli, EAST, _aiunits,[],[],[],[],[],180] call BIS_fnc_spawnGroup;
- _hcg = group (leader _hcunits);
- _hcg addWaypoint [position _cargo, 0];
- [_hcg, 0] setWaypointType "GUARD";
- [_hcg, 0] setWaypointBehaviour "AWARE";
- {
- removeBackpackGlobal _x;
- removeAllWeapons _x;
- _curW = _weapons call BIS_fnc_selectRandom;
- [_x,_curW, 5] call BIS_fnc_addWeapon;
- } forEach units _hcunits;
- };
- if (_rpt) then {
- diag_log "###ETG Heli Crash and Drop Script by Kellojo###";
- diag_log format ["###Helicrash position: %1",_crashpos];
- diag_log "###End###";
- };
- _weapc = 0;
- _maxweapc = round (random _MaxWeap);
- _whold = createVehicle ["Box_IND_Wps_F",_crashpos,[], 25, "none"];
- clearMagazineCargoGlobal _whold;
- clearWeaponCargoGlobal _whold;
- clearItemCargoGlobal _whold;
- clearBackpackCargoGlobal _whold;
- while {_weapc < _maxweapc} do {
- _weapc = _weapc + 1;
- _curri = _Weapons call BIS_fnc_selectRandom;
- _Ammount = 1;
- _whold addWeaponCargoGlobal [_curri,_Ammount];
- _mag = getArray (configFile / "CfgWeapons" / _curri / "magazines");
- _whold addMagazineCargoGlobal [(_mag select 0),round random 6];
- };
- _magc = 0;
- _maxmagc = round (random _MaxMag);
- _whold = createVehicle ["Box_IND_Wps_F",_crashpos,[], 25, "none"];
- clearMagazineCargoGlobal _whold;
- clearWeaponCargoGlobal _whold;
- clearItemCargoGlobal _whold;
- clearBackpackCargoGlobal _whold;
- while {_magc < _maxmagc} do {
- _magc = _magc + 1;
- _curri = _magazines call BIS_fnc_selectRandom;
- _Ammount = round (random _MaxItem);
- _whold addMagazineCargoGlobal [_curri,_Ammount];
- };
- _ic = 0;
- _maxic = round (random _MaxItem);
- _whold = createVehicle ["Box_East_Grenades_F",_crashpos,[], 25, "none"];
- clearMagazineCargoGlobal _whold;
- clearWeaponCargoGlobal _whold;
- clearItemCargoGlobal _whold;
- clearBackpackCargoGlobal _whold;
- while {_ic < _maxic} do {
- _ic = _ic + 1;
- _curri = _Items call BIS_fnc_selectRandom;
- _Ammount = 1;
- _whold addItemCargoGlobal [_curri,_Ammount];
- };
- _bpackc = 0;
- _maxbpackc = round (random _MaxBpack);
- _whold = createVehicle ["Box_East_Grenades_F",_crashpos,[], 25, "none"];
- clearMagazineCargoGlobal _whold;
- clearWeaponCargoGlobal _whold;
- clearItemCargoGlobal _whold;
- clearBackpackCargoGlobal _whold;
- while {_bpackc < _maxbpackc} do {
- _bpackc = _bpackc + 1;
- _curri = _Backpacks call BIS_fnc_selectRandom;
- _Ammount = 1;
- clearBackpackCargoGlobal _whold;
- _whold addBackpackCargoGlobal [_curri,_Ammount];
- };
- [1] call fn_crashdrop;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement