Advertisement
Scaris

ETG Helicrash and Drop Script

Mar 29th, 2016
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.04 KB | None | 0 0
  1. /*
  2.     Filename:       fn_crashdrop.sqf
  3.     Author:         Kellojo
  4.     Description:    Heli crash and drop script main function - Part of the ETG script collection
  5.     Link:           http://www.armaholic.com/page.php?id=29519
  6. */
  7.  
  8. _mode = [_this, 0, 0, [0]] call BIS_fnc_param;
  9.  
  10. _time = 3600;                                       //Time between every heli crash/supply drop in seconds (integer)
  11. _markertp = "";                                     //Type of marker? (https://community.bistudio.com/wiki/cfgMarkers) (string - leave empty if no marker is wanted) ie- "n_service";  
  12. _fire = true;                                       //Should fire be around the helicrashsite ? (true/false)
  13. _ai = false;                                        //AI? (true/false)
  14. _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)
  15. _centerrad = 13000;                                 //Radius around the _CenterOfMap (make sure its covering the whole map - Integer)
  16. _rpt = true;                                        //Writes debug information to the rpt file. (true/false)
  17.  
  18. _MaxAmmount = 5;                                    //Ammount of Magazines and Items that can spawn at one lootpile
  19. _MaxItem = 10;                                      //Max ammount of individual items
  20. _MaxMag = 10;                                       //Max ammount of individual magazines
  21. _MaxWeap = 10;                                      //Max ammount of individual weapons
  22. _MaxBpack = 10;
  23.  
  24. //Add or remove item classnames to the array to add them to the loot table
  25. _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'];
  26. _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'];
  27. _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'];
  28. _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'];      
  29. _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
  30.  
  31. //random timer + calls in new drop/crash
  32. if (_mode == 1) exitwith {
  33.     sleep (round (random _time));
  34.     [2] call fn_crashdrop;
  35. };
  36.  
  37. //creates a drop/crash
  38. if (_mode == 2) exitwith {
  39.    
  40.     //Get data
  41.     _cord1 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
  42.     sleep 0.5;
  43.     _cord2 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
  44.     sleep 0.5;
  45.     _cord3 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
  46.     sleep 0.5;
  47.     _cord4 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
  48.     sleep 0.5;
  49.     _cord5 = [_mapcenter, 1, _centerrad, 3, 0, 600, 0] call BIS_fnc_findSafePos;
  50.    
  51.     //Spawn heli & cargo
  52.     _veh = [[0,0,0], 180,"I_Heli_Transport_02_F",WEST] call bis_fnc_spawnvehicle;
  53. //  _cargo = "B_CargoNet_01_ammo_F" createVehicle [0,0,0];
  54.     _grp = group (_veh select 0);
  55.    
  56.     veh = _veh;
  57.     cargo = _cargo;
  58.    
  59.     clearMagazineCargoGlobal _cargo;
  60.     clearWeaponCargoGlobal _cargo;
  61.     clearItemCargoGlobal _cargo;
  62.     clearBackpackCargoGlobal _cargo;
  63.    
  64.     {
  65.         _x disableAI "AUTOTARGET";
  66.         _x disableAI "TARGET";
  67.         _x disableAI "SUPPRESSION";
  68.         removeBackpackGlobal _x;
  69.         removeAllWeapons _x;
  70.     } forEach units (_veh select 4);
  71.    
  72. /*  //Spawn loot
  73.     _weapc = 0;
  74.     _weapcount = round (random _MaxWeap);
  75.     while {_weapc < _weapcount} do {
  76.         sleep 0.1;
  77.         _weapc = _weapc + 1;
  78.         _curi = _Weapons call BIS_fnc_selectRandom;
  79.         _ammount = 1;
  80.         _mag = getArray (configFile / "CfgWeapons" / _curi / "magazines");
  81.         _cargo addWeaponCargoGlobal [_curi,_ammount];
  82.         _cargo addMagazineCargoGlobal [(_mag select 0),round random 8];
  83.     };
  84.  
  85.    
  86.     _magc = 0;
  87.     _magcount = round (random _MaxMag);
  88.     while {_magc < _magcount} do {
  89.         sleep 0.1;
  90.         _magc = _magc + 1;
  91.         _curi = _magazines call BIS_fnc_selectRandom;
  92.         _cargo addMagazineCargoGlobal [_curi,round (random 5)];
  93.     };
  94.  
  95.    
  96.     _ic = 0;
  97.     _ic = round (random _MaxItem);
  98.     while {_ic < _ic} do {
  99.         sleep 0.1;
  100.         _ic = _ic + 1;
  101.         _curi = _Items call BIS_fnc_selectRandom;
  102.         _ammount = 1;
  103.         _cargo addItemCargoGlobal [_curi,_ammount];
  104.     };
  105.  
  106.    
  107.     _bpackc = 0;
  108.     _backcount = round (random _MaxBpack);
  109.     while {_bpackc < _backcount} do {
  110.         sleep 0.1;
  111.         _bpackc = _bpackc + 1;
  112.         _curi = _Backpacks call BIS_fnc_selectRandom;
  113.         _ammount = 1;
  114.         _cargo addBackpackCargoGlobal [_curi,_ammount];
  115.     };
  116.    
  117.     (_veh select 0) setSlingLoad _cargo;
  118. */
  119.     //Set waypoints
  120.     ETG_tvehdrop = false;
  121.     ETG_tvehcrash = false;
  122.  
  123.     _wp = _grp addWaypoint [_cord1, 0];
  124.     _wp setWaypointType "move";
  125.     _wp setWaypointBehaviour "CARELESS";
  126.     (_veh select 0) flyInHeight 220;
  127.     [_grp,1]setWaypointSpeed "FULL";
  128.    
  129.     _wp = _grp addWaypoint [_cord2, 0];
  130.     _wp setWaypointType "move";
  131.     _wp setWaypointBehaviour "CARELESS";
  132.     _wp setWaypointStatements ['true', "ETG_tvehdrop = true;"];
  133.    
  134.     _wp = _grp addWaypoint [_cord3, 0];
  135.     _wp setWaypointType "move";
  136.     _wp setWaypointBehaviour "CARELESS";
  137.    
  138.     _wp = _grp addWaypoint [_cord4, 0];
  139.     _wp setWaypointType "move";
  140.     _wp setWaypointBehaviour "CARELESS";
  141.    
  142.     _wp = _grp addWaypoint [_cord5, 0];
  143.     _wp setWaypointType "move";
  144.     _wp setWaypointBehaviour "CARELESS";
  145.     _wp setWaypointStatements ['true', "ETG_tvehcrash = true;"];
  146.    
  147.     waituntil {ETG_tvehdrop};
  148. /* 
  149.     //Unload
  150.     (_veh select 0) flyInHeight 60; // was 90
  151.     (_veh select 0) setSlingLoad objNull;
  152.     _chute = "B_Parachute_02_F" createVehicle position _cargo;
  153.     _cargo attachTo [_chute,[0, 0, -1.2]];
  154.    
  155.     _smoke = "SmokeShellRed" createVehicle position _cargo;
  156.     _smoke attachto [_cargo,[0,0,0]];
  157.     sleep 10;
  158.     _smoke setDamage 1;
  159.     deleteVehicle _smoke;
  160.    
  161.     _smoke = "SmokeShellRed" createVehicle position _cargo;
  162.     _smoke attachto [_cargo,[0,0,0]];
  163.    
  164.     waituntil {(getPos _cargo select 2) < 4};  
  165.     detach _cargo;
  166.     sleep 4;
  167.     deleteVehicle _chute;
  168.     _smoke = "SmokeShellRed" createVehicle position _cargo;
  169.     _smoke attachto [_cargo,[0,0,0]];
  170.    
  171.     if (_rpt) then {
  172.         diag_log "###ETG Heli Crash and Drop Script by Kellojo###";
  173.         diag_log format ["###Cargodrop position: %1",position _cargo];
  174.         diag_log "###End###";
  175.     };
  176.  
  177.     if !(isNil "_markertp") then {
  178.         _marker = createMarker ["",position _cargo];
  179.         _marker setMarkerType _markertp;
  180.     };
  181.    
  182.     if (_ai) then {
  183.     _hcunits = [position _cargo, EAST, _aiunits,[],[],[],[],[],180] call BIS_fnc_spawnGroup;
  184.         _hcg = group (leader _hcunits);
  185.         _hcg addWaypoint [position  _cargo, 0];
  186.         [_hcg, 0] setWaypointType "GUARD";
  187.         [_hcg, 0] setWaypointBehaviour "AWARE";
  188.         {
  189.             removeBackpackGlobal _x;
  190.             removeAllWeapons _x;
  191.             _curW = _weapons call BIS_fnc_selectRandom;
  192.             [_x,_curW, 5] call BIS_fnc_addWeapon;
  193.         } forEach units _hcunits;
  194.     };
  195. */ 
  196.     //Wait for crash & crash
  197.     waituntil {ETG_tvehcrash  || (getDammage (_veh select 0) > 0.2)};
  198.     (_veh select 0) setDamage 1;
  199.    
  200.     waituntil {(getPos (_veh select 0) select 2) < 1};
  201.     sleep 10;
  202.    
  203.     _crashpos = position (_veh select 0);
  204.     _crashrot = getDir (_veh select 0);
  205.     sleep 2;
  206.     deleteVehicle (_veh select 0);
  207.    
  208.     if !(isNil "_markertp") then {
  209.         _marker = createMarker ["",_crashpos];
  210.         _marker setMarkerType _markertp;
  211.     };
  212.    
  213.     _cheli = createVehicle ["Land_Wreck_Heli_Attack_01_F",_crashpos,[], 0, "can_collide"];
  214.     _cheli setDir _crashrot;
  215.     _cheli setPos [position _cheli select 0,position _cheli select 1, 0.1];
  216.     _cheli setVectorUp surfaceNormal position _cheli;
  217.     _smokeeff = createVehicle ["test_EmptyObjectForSmoke",position _cheli,[], 0, "can_collide"];
  218.     _smokeeff attachTo [_cheli, [0.5, -2, 1] ];
  219.     _fireeff = createVehicle ["Campfire_burning_F",_crashpos,[], 0, "can_collide"];
  220.    
  221.     if (_ai) then {
  222.         _hcunits = [position _cheli, EAST, _aiunits,[],[],[],[],[],180] call BIS_fnc_spawnGroup;
  223.         _hcg = group (leader _hcunits);
  224.         _hcg addWaypoint [position  _cargo, 0];
  225.         [_hcg, 0] setWaypointType "GUARD";
  226.         [_hcg, 0] setWaypointBehaviour "AWARE";
  227.         {
  228.             removeBackpackGlobal _x;
  229.             removeAllWeapons _x;
  230.             _curW = _weapons call BIS_fnc_selectRandom;
  231.             [_x,_curW, 5] call BIS_fnc_addWeapon;
  232.         } forEach units _hcunits;
  233.     };
  234.    
  235.     if (_rpt) then {
  236.         diag_log "###ETG Heli Crash and Drop Script by Kellojo###";
  237.         diag_log format ["###Helicrash position: %1",_crashpos];
  238.         diag_log "###End###";
  239.     };
  240.    
  241.     _weapc = 0;
  242.     _maxweapc = round (random _MaxWeap);
  243.     _whold = createVehicle ["Box_IND_Wps_F",_crashpos,[], 25, "none"];
  244.     clearMagazineCargoGlobal _whold;
  245.     clearWeaponCargoGlobal _whold;
  246.     clearItemCargoGlobal _whold;
  247.     clearBackpackCargoGlobal _whold;
  248.     while {_weapc < _maxweapc} do {
  249.         _weapc = _weapc + 1;
  250.         _curri = _Weapons call BIS_fnc_selectRandom;
  251.         _Ammount = 1;
  252.         _whold addWeaponCargoGlobal [_curri,_Ammount];
  253.         _mag = getArray (configFile / "CfgWeapons" / _curri / "magazines");
  254.         _whold addMagazineCargoGlobal [(_mag select 0),round random 6];
  255.     };
  256.  
  257.     _magc = 0;
  258.     _maxmagc = round (random _MaxMag);
  259.     _whold = createVehicle ["Box_IND_Wps_F",_crashpos,[], 25, "none"];
  260.     clearMagazineCargoGlobal _whold;
  261.     clearWeaponCargoGlobal _whold;
  262.     clearItemCargoGlobal _whold;
  263.     clearBackpackCargoGlobal _whold;
  264.     while {_magc < _maxmagc} do {
  265.         _magc = _magc + 1;
  266.         _curri = _magazines call BIS_fnc_selectRandom;
  267.         _Ammount = round (random _MaxItem);
  268.  
  269.         _whold addMagazineCargoGlobal [_curri,_Ammount];   
  270.     };
  271.  
  272.     _ic = 0;
  273.     _maxic = round (random _MaxItem);
  274.     _whold = createVehicle ["Box_East_Grenades_F",_crashpos,[], 25, "none"];
  275.     clearMagazineCargoGlobal _whold;
  276.     clearWeaponCargoGlobal _whold;
  277.     clearItemCargoGlobal _whold;
  278.     clearBackpackCargoGlobal _whold;
  279.     while {_ic < _maxic} do {
  280.         _ic = _ic + 1;
  281.         _curri = _Items call BIS_fnc_selectRandom;
  282.         _Ammount = 1;
  283.         _whold addItemCargoGlobal [_curri,_Ammount];   
  284.     };
  285.  
  286.     _bpackc = 0;
  287.     _maxbpackc = round (random _MaxBpack);
  288.     _whold = createVehicle ["Box_East_Grenades_F",_crashpos,[], 25, "none"];
  289.     clearMagazineCargoGlobal _whold;
  290.     clearWeaponCargoGlobal _whold;
  291.     clearItemCargoGlobal _whold;
  292.     clearBackpackCargoGlobal _whold;
  293.     while {_bpackc < _maxbpackc} do {
  294.         _bpackc = _bpackc + 1;
  295.         _curri = _Backpacks call BIS_fnc_selectRandom;
  296.         _Ammount = 1;
  297.         clearBackpackCargoGlobal _whold;
  298.         _whold addBackpackCargoGlobal [_curri,_Ammount];   
  299.     };
  300.  
  301.     [1] call fn_crashdrop;
  302. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement