Guest User

Fixed building_spawnLoot.sqf

a guest
May 19th, 2013
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 56.85 KB | None | 0 0
  1. private["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_itemChances","_lootChance","_weights","_cntWeights","_index","_LootClass"];
  2.  
  3. _obj         =  _this select 0;
  4. _type        =  typeOf _obj;
  5. _config      =  configFile >> "CfgBuildingLoot" >> _type;
  6. _positions   =  [] + getArray (_config >> "lootPos");
  7. //_itemTypes =  [] + getArray (_config >> "itemType"); // Default System
  8. _lootChance  =  getNumber (_config >> "lootChance");
  9.  
  10. //------------------//
  11. //CUSTOM LOOT SPAWNS//
  12. //------------------//
  13. _itemTypes  = []; //Initialise array
  14. _itemChance = []; //Initialise array
  15.  
  16. //diag_log "SPAWNING WITH CUSTOM LOOT";//Remove This line after testing
  17.  
  18. switch (_type) do { //Assign building classes
  19. private["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_itemChances","_lootChance","_weights","_cntWeights","_index","_LootClass"];
  20.  
  21. _obj         =  _this select 0;
  22. _type        =  typeOf _obj;
  23. _config      =  configFile >> "CfgBuildingLoot" >> _type;
  24. _positions   =  [] + getArray (_config >> "lootPos");
  25. //_itemTypes =  [] + getArray (_config >> "itemType"); // Default System
  26. _lootChance  =  getNumber (_config >> "lootChance");
  27.  
  28. //------------------//
  29. //CUSTOM LOOT SPAWNS//
  30. //------------------//
  31. _itemTypes  = []; //Initialise array
  32. _itemChance = []; //Initialise array
  33.  
  34. //diag_log "SPAWNING WITH CUSTOM LOOT";//Remove This line after testing
  35.  
  36. switch (_type) do { //Assign building classes
  37.  
  38.         // == Residential ===================================== */
  39.         case "Land_HouseV_1I4": { _LootClass = "Residential"; };
  40.         case "Land_kulna": { _LootClass = "Residential"; };
  41.         case "Land_hut06": { _LootClass = "Residential"; };
  42.         case "Land_Hlidac_budka": { _LootClass = "Residential"; };
  43.         case "Land_HouseV2_02_Interier": { _LootClass = "Residential"; };
  44.         case "Land_A_Pub_01": { _LootClass = "Residential"; };
  45.         case "Land_Shed_wooden": { _LootClass = "Residential"; };
  46.         case "Land_HouseBlock_A1_1": { _LootClass = "Residential"; };
  47.         case "Land_A_MunicipalOffice": { _LootClass = "Residential"; };
  48.         case "Land_ruin_01": { _LootClass = "Residential"; };
  49.         case "Land_HouseV2_04_interier": { _LootClass = "Residential"; };
  50.         case "Land_HouseV2_01A": { _LootClass = "Residential"; };
  51.         case "Land_psi_bouda": { _LootClass = "Residential"; };
  52.         case "Land_KBud": { _LootClass = "Residential"; };
  53.         case "Land_A_Castle_Bergfrit": { _LootClass = "Residential"; };
  54.         case "Land_A_Castle_Stairs_A": { _LootClass = "Residential"; };
  55.         case "Land_A_Castle_Gate": { _LootClass = "Residential"; };
  56.         case "Land_sara_domek_zluty": { _LootClass = "Residential"; };
  57.         case "Land_Church_01": { _LootClass = "Residential"; };
  58.         case "Land_Church_03": { _LootClass = "Residential"; };
  59.         case "Land_HouseB_Tenement": { _LootClass = "Residential"; };
  60.         case "Land_Panelak": { _LootClass = "Residential"; };
  61.         case "Land_Panelak2": { _LootClass = "Residential"; };
  62.         case "Land_rail_station_big": { _LootClass = "Residential"; };
  63.         case "Land_A_Office01": { _LootClass = "Residential"; };
  64.         case "Land_A_Office02": { _LootClass = "Residential"; };
  65.  
  66.         // == Industrial ====================================== */
  67.         case "Land_Ind_Workshop01_04": { _LootClass = "Industrial"; };
  68.         case "Land_Ind_Workshop01_01": { _LootClass = "Industrial"; };
  69.         case "Land_Ind_Garage01": { _LootClass = "Industrial"; };
  70.         case "Land_Ind_Workshop01_02": { _LootClass = "Industrial"; };
  71.         case "Land_Ind_Workshop01_L": { _LootClass = "Industrial"; };
  72.         case "Land_Hangar_2": { _LootClass = "Industrial"; };
  73.         case "Land_A_FuelStation_Build": { _LootClass = "Industrial"; };
  74.         case "Land_Shed_Ind02": { _LootClass = "Industrial"; };
  75.         case "Land_Misc_PowerStation": { _LootClass = "Industrial"; };
  76.         case "Land_Shed_W01": { _LootClass = "Industrial"; };
  77.         case "Land_Tovarna2": { _LootClass = "Industrial"; };
  78.         case "Land_Ind_Vysypka": { _LootClass = "Industrial"; };
  79.         case "Land_A_BuildingWIP": { _LootClass = "Industrial"; };
  80.         case "Land_A_TVTower_Base": { _LootClass = "Industrial"; };
  81.         case "Land_Misc_Cargo1Ao": { _LootClass = "Industrial"; };
  82.         case "Land_Misc_Cargo1Bo": { _LootClass = "Industrial"; };
  83.         case "Land_Nav_Boathouse": { _LootClass = "Industrial"; };
  84.         case "Land_wagon_box": { _LootClass = "Industrial"; };
  85.         case "Land_Rail_House_01": { _LootClass = "Industrial"; };
  86.  
  87.         // == Farm ============================================ */
  88.         case "Land_stodola_old_open": { _LootClass = "Farm"; };
  89.         case "Land_Farm_Cowshed_a": { _LootClass = "Farm"; };
  90.         case "Land_stodola_open": { _LootClass = "Farm"; };
  91.         case "Land_Barn_W_01": { _LootClass = "Farm"; };
  92.         case "Land_Barn_W_02": { _LootClass = "Farm"; };
  93.  
  94.         // == Supermarket ===================================== */
  95.         case "Land_A_GeneralStore_01a": { _LootClass = "Supermarket"; };
  96.         case "Land_A_GeneralStore_01": { _LootClass = "Supermarket"; };
  97.  
  98.         // == Hospital ======================================== */
  99.         case "Land_A_Hospital": { _LootClass = "Hospital"; };
  100.         case "MASH": { _LootClass = "Hospital"; };
  101.         case "MASH_EP1": { _LootClass = "Hospital"; };
  102.         case "USMC_WarfareBFieldhHospital": { _LootClass = "Hospital"; };
  103.  
  104.         // == Hunting ========================================= */
  105.         case "Land_Misc_deerstand": { _LootClass = "Hunting"; _lootChance = 0.8; };
  106.  
  107.         // == Military ======================================== */
  108.         case "Land_a_stationhouse": { _LootClass = "Military"; _lootChance = 0.8; };
  109.         case "Land_Mil_ControlTower": { _LootClass = "Military"; _lootChance = 0.8; };
  110.        
  111.         case "Land_Mil_House": { _LootClass = "Military"; _lootChance = 0.8; };
  112.         case "Camp": { _LootClass = "Military"; _lootChance = 0.8; };
  113.         case "CampEast_EP1": { _LootClass = "Military"; _lootChance = 0.8; };
  114.  
  115.         // == Military Special ================================ */
  116.         case "Land_Mil_Barracks_i": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
  117.         case "CampEast": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
  118.         case "Land_SS_hangar": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
  119.        
  120.         default { _LootClass = "Residential"; };
  121. };
  122.  
  123. switch (_LootClass) do { //Find correct loot
  124.         case "Residential": {
  125.                 _itemTypes = [
  126.                     //General
  127.                     ["ItemSodaMdew","magazine"],
  128.                     ["","generic"],
  129.                     ["","military"],
  130.                     ["","trash"],
  131.                     ["WeaponHolder_ItemTent","object"],
  132.  
  133.                     //Equipment
  134.                     ["ItemWatch","generic"],
  135.                     ["ItemCompass","generic"],
  136.                     ["ItemMap","weapon"],
  137.                     ["ItemFlashlight","generic"],
  138.                     ["ItemKnife","generic"],
  139.                     ["ItemMatchbox","generic"],
  140.                     ["Binocular","weapon"],
  141.                     ["PartWoodPile","magazine"],
  142.                     ["WeaponHolder_ItemCrowbar","object"],
  143.                     ["WeaponHolder_ItemHatchet","object"],
  144.                     ["WeaponHolder_ItemMachete","object"],
  145.  
  146.                     // Secondary Weapons
  147.                     ["Colt1911","weapon"],
  148.                     ["Makarov","weapon"],
  149.                     ["MakarovSD","weapon"],
  150.                    
  151.                     // Primary Weapons
  152.                     ["MR43","weapon"],
  153.                     ["Winchester1866","weapon"],
  154.  
  155.                     ["Crossbow_DZ","weapon"],
  156.  
  157.                     // Back Packs
  158.                     ["DZ_Assault_Pack_EP1","object"],
  159.                     ["DZ_Czech_Vest_Puch","object"],
  160.                     ["DZ_ALICE_Pack_EP1","object"],
  161.  
  162.                     // Special
  163.                     ["Skin_Camo1_DZ","magazine"],
  164.                     ["Skin_Sniper1_DZ","magazine"],
  165.  
  166.                     // Building Mats
  167.                     ["ItemWire","magazine"],
  168.                     ["ItemTankTrap","magazine"],
  169.                     ["ItemSandbag","magazine"]
  170.                    
  171.                  ];
  172.                 _itemChance = [ //Residential
  173.                     // General
  174.                     0.01, // Mountian Dew
  175.                     2.00, // Generic
  176.                     0.05, // Military
  177.                     0.50, // Trash
  178.                     0.02, // Tent
  179.  
  180.                     // Equipment
  181.                     0.05, // Watch
  182.                     0.05, // Compass
  183.                     0.05, // Map
  184.                     0.05, // Flashlight
  185.                     0.06, // Knife
  186.                     0.06, // Matchbox
  187.                     0.04, // Binocular
  188.                     0.04, // Woodpile
  189.                     0.04, // Crowbar
  190.                     0.04, // Hatchet
  191.                     0.02, // Machete
  192.  
  193.                     // Secondary Weapons
  194.                     0.02, // Colt 1911
  195.                     0.03, // Makarov
  196.                     0.01, // Makarov SD
  197.  
  198.                     // Primary Weapons
  199.                     0.05, // Double Bareled
  200.                     0.01, // Winchester 1866
  201.                     0.10, // Crossbow
  202.  
  203.                     // Back Packs
  204.                     0.05, // Assault Pack
  205.                     0.03, // Czech Pack
  206.                     0.01, // Alice Pack
  207.  
  208.                     // Special
  209.                     0.01, // Camo Clothing
  210.                     0.01, // Guilie Suit
  211.  
  212.                     // Building Mats
  213.                     0.03, // Wire Kit
  214.                     0.03, // Tank Trap
  215.                     0.02  // Sandbags
  216.                 ];
  217.         };
  218.         case "Industrial": {
  219.                 _itemTypes = [
  220.  
  221.                     // General
  222.                     ["","generic"],
  223.                     ["","trash"],
  224.                     ["","military"],
  225.  
  226.                     // Equipment
  227.                     ["WeaponHolder_ItemHatchet","object"],
  228.                     ["WeaponHolder_ItemMachete","object"],
  229.                     ["ItemKnife","military"],
  230.                     ["ItemToolbox","weapon"],
  231.  
  232.                     // Primary Weapon
  233.                     ["Crossbow_DZ","weapon"],
  234.  
  235.                     // Parts
  236.                     ["WeaponHolder_PartGeneric","object"],
  237.                     ["WeaponHolder_PartWheel","object"],
  238.                     ["WeaponHolder_PartFueltank","object"],
  239.                     ["WeaponHolder_PartEngine","object"],
  240.                     ["WeaponHolder_PartGlass","object"],
  241.                     ["WeaponHolder_PartVRotor","object"],
  242.                     ["WeaponHolder_ItemJerrycan","object"],
  243.  
  244.                     // Building Mats
  245.                     ["ItemWire","magazine"],
  246.                     ["ItemTankTrap","magazine"],
  247.                     ["ItemSandbag","magazine"]
  248.                                              
  249.                 ];
  250.                 _itemChance = [ //Industrial
  251.                     // General
  252.                     0.18, // Generic
  253.                     0.08, // Trash
  254.                     0.30, // Military
  255.  
  256.                     // Equipment
  257.                     0.15, // Hatchet
  258.                     0.10, // Machete
  259.                     0.07, // Knife
  260.                     0.03, // Toolbox
  261.  
  262.                     // Parts
  263.                     0.04, // Generic Part
  264.                     0.03, // Wheel
  265.                     0.03, // Full tank
  266.                     0.03, // Engine
  267.                     0.03, // Glass
  268.                     0.02, // Rotor
  269.                     0.03, // Jerry Can
  270.  
  271.                     // Building Mats
  272.                     0.05, // Wirekit
  273.                     0.05, // Tank trap
  274.                     0.04  // Sandbag
  275.                 ];
  276.         };
  277.         case "Farm": {
  278.                 _itemTypes = [ //Farm
  279.  
  280.                     // General
  281.                     ["","generic"],
  282.                     ["","trash"],
  283.  
  284.                     // Equipment
  285.                     ["WeaponHolder_ItemHatchet","object"],  
  286.                     ["WeaponHolder_ItemMachete","object"],  
  287.                     ["ItemEtool","weapon"],
  288.  
  289.                     // Secondary Weapons
  290.                     ["Colt1911","weapon"],
  291.                     ["revolver_EP1","weapon"],
  292.  
  293.                     // Primary Weapons
  294.                     ["MR43","weapon"],
  295.                     ["M1014","weapon"],
  296.                     ["Remington870_lamp","weapon"],
  297.  
  298.                     ["Huntingrifle","weapon"],
  299.  
  300.                     ["Crossbow_DZ","weapon"],
  301.  
  302.                     ["LeeEnfield","weapon"],
  303.  
  304.                     // Backpacks
  305.                     ["DZ_Czech_Vest_Puch","object"],
  306.  
  307.                     // Parts
  308.                     ["WeaponHolder_ItemJerrycan","object"],
  309.  
  310.                     // Building Mats
  311.                     ["ItemWire","magazine"],
  312.                     ["PartWoodPile","magazine"]
  313.                 ];
  314.                 _itemChance = [
  315.                     // General
  316.                     0.20, // Generic
  317.                     0.10, // Trash
  318.  
  319.                     // Equipment
  320.                     0.15, // Hatchet
  321.                     0.10, // Machete
  322.                     0.03, // Entrenching
  323.  
  324.                     // Secondary Weapons
  325.                     0.02, // Colt 1911
  326.                     0.03, // Revolver
  327.  
  328.                     // Primary Weapons
  329.                     0.10, // Double Barreled
  330.                     0.05, // M1014
  331.                     0.05, // R870
  332.                     0.03, // Hunting Rifle
  333.                     0.10, // Crossbow
  334.                     0.03, // Lee Enfield
  335.  
  336.                     // Backpacks
  337.                     0.04, // Czech
  338.  
  339.                     // Parts
  340.                     0.02, // Jerry can
  341.  
  342.                     // Building Mats
  343.                     0.03, // Wire Kit
  344.                     0.03  // Woodpile
  345.                 ];
  346.         };
  347.         case "Supermarket": {
  348.                 _itemTypes = [
  349.                     // General
  350.                     ["","generic"],
  351.                     ["","food"],
  352.                     ["","trash"],
  353.                     ["WeaponHolder_ItemTent","object"],
  354.  
  355.                     // Equipment
  356.                     ["ItemWatch","generic"],
  357.                     ["ItemCompass","generic"],
  358.                     ["ItemMap","weapon"],
  359.                     ["ItemFlashlight","generic"],
  360.                     ["ItemKnife","generic"],
  361.                     ["ItemMatchbox","generic"],
  362.                     ["Binocular","weapon"],
  363.                     ["WeaponHolder_ItemHatchet","object"],
  364.  
  365.                     // Secondary Weapons
  366.                     ["Colt1911","weapon"],
  367.                     ["Makarov","weapon"],
  368.                     ["revolver_EP1","weapon"],
  369.                    
  370.                     // Primary Weapons
  371.                     ["Crossbow_DZ","weapon"],
  372.                     ["MR43","weapon"],
  373.  
  374.                     // Backpacks
  375.                     ["DZ_Assault_Pack_EP1","object"],
  376.                     ["DZ_Czech_Vest_Puch","object"],
  377.                     ["DZ_TK_Assault_Pack_EP1","object"],
  378.  
  379.                     // Building Mats
  380.                     ["PartWoodPile","magazine"]
  381.                 ];
  382.                 _itemChance = [ //Super Market
  383.                     // General
  384.                     0.05, // Generic
  385.                     2.00, // Food
  386.                     0.10, // Trash
  387.                     0.03, // Tent
  388.  
  389.                     // Equipmnet
  390.                     0.05, // Watch
  391.                     0.04, // Compass
  392.                     0.04, // Map
  393.                     0.05, // Flashlight
  394.                     0.05, // Knife
  395.                     0.05, // Matches
  396.                     0.04, // Binoculars
  397.                     0.08, // Hatchet
  398.  
  399.                     // Secondary Weapons
  400.                     0.03, // Colt 1911
  401.                     0.05, // Makarov
  402.                     0.03, // Revolver
  403.  
  404.                     // Primary Weapons
  405.                     0.09, // Crossbow
  406.                     0.08, // Double Barreled
  407.  
  408.                     // Backpacks
  409.                     0.04, // Assault
  410.                     0.03, // Czech
  411.                     0.01, // TK Assault
  412.  
  413.                     // Building Mats
  414.                     0.03  // Woodpile
  415.                 ];
  416.         };
  417.         case "Hospital": {
  418.                 _itemTypes =    [
  419.                         ["","trash"],
  420.                         ["","hospital"],
  421.                         ["MedBox0","object"]
  422.                 ];
  423.                 _itemChance = [
  424.                         0.20,    // Trash
  425.                         0.75,    // Hospital
  426.                         0.15     // Medical Box
  427.                 ];
  428.         };
  429.         case "Military": {
  430.                 _itemTypes = [
  431.                     // General
  432.                     ["","medical"],
  433.                     ["","generic"],
  434.                     ["","military"],
  435.  
  436.                     // Equipment
  437.                     ["Binocular","weapon"],
  438.                     ["ItemFlashlightRed","military"],
  439.                     ["ItemKnife","military"],
  440.                     ["ItemGPS","weapon"],
  441.                     ["ItemMap","military"],
  442.                     ["ItemEtool","weapon"],
  443.  
  444.                     // Secondary Weapons
  445.                     ["glock17_EP1","weapon"],
  446.                     ["M9","weapon"],
  447.                     ["M9SD","weapon"],
  448.                     ["UZI_EP1","weapon"],
  449.  
  450.                     // Primary Weapons
  451.                     ["AK_74","weapon"],
  452.                     ["AK_47_S","weapon"],
  453.                     ["AKS_74","weapon"],
  454.                     ["AKS_74_kobra","weapon"],
  455.                     ["AKS_74_U","weapon"],
  456.  
  457.                     ["G36a","weapon"],
  458.                     ["G36A_camo","weapon"],
  459.                     ["G36C","weapon"],
  460.                     ["G36C_camo","weapon"],
  461.                     ["G36K","weapon"],
  462.                     ["G36K_camo","weapon"],
  463.  
  464.                     ["M16A2","weapon"],
  465.                     ["M16A2GL","weapon"],
  466.  
  467.                     ["M4A1","weapon"],
  468.                     ["M4A1_Aim","weapon"],
  469.                     ["M4A1_Aim_camo","weapon"],
  470.  
  471.                     ["SCAR_L_CQC","weapon"],
  472.  
  473.                     ["MP5A5","weapon"],
  474.  
  475.                     ["M1014","weapon"],
  476.                     ["Remington870_lamp","weapon"],
  477.                     ["Winchester1866","weapon"],
  478.  
  479.                     // Snipers
  480.  
  481.                     ["DMR","weapon"],
  482.                     ["M4SPR","weapon"],
  483.  
  484.                     // Backpacks
  485.                     ["DZ_British_ACU","object"],
  486.                     ["DZ_CivilBackpack_EP1","object"],
  487.                    
  488.                     // Special
  489.                     ["Skin_Camo1_DZ","magazine"],
  490.                     ["Skin_Sniper1_DZ","magazine"],
  491.  
  492.                     // Building Mats  
  493.                     ["ItemSandbag","magazine"],
  494.                     ["ItemTankTrap","magazine"]
  495.                 ];
  496.                 _itemChance = [ //Military
  497.                     // General
  498.                     0.05, // Medical
  499.                     0.03, // General
  500.                     2.00, // Military
  501.  
  502.                     // Equipment
  503.                     0.05, // Binocular
  504.                     0.04, // Military Flashlight
  505.                     0.05, // Knife
  506.                     0.01, // GPS
  507.                     0.05, // Map
  508.                     0.05, // Entrenching
  509.  
  510.                     // Secondary Weapons
  511.                     0.04, // G17
  512.                     0.04, // M9
  513.                     0.01, // M9 SD
  514.                     0.03, // PDW
  515.  
  516.                     // Primary Weapons
  517.                     0.04, // AK 47
  518.                     0.03, // AKS
  519.                     0.04, // AKS 74
  520.                     0.02, // AKS 74 Kobra
  521.                     0.04, // AKS 74 U
  522.  
  523.                     0.04, // G36
  524.                     0.02, // G36 Camo
  525.                     0.03, // G36C
  526.                     0.02, // G36C Camo
  527.                     0.02, // G36K
  528.                     0.01, // G36K Camo
  529.  
  530.                     0.04, // M16A2
  531.                     0.01, // M16A2 GL
  532.  
  533.                     0.04, // M4A1
  534.                     0.02, // M4A1 CCO
  535.                     0.01, // M4A1 CCO Camo
  536.  
  537.                     0.02, // SCAR L
  538.  
  539.                     0.04, // MP5A
  540.  
  541.                     0.05, // M1014
  542.                     0.05, // R870
  543.                     0.05, // 1866
  544.  
  545.                     // Snipers
  546.                     0.01, // DMR
  547.                     0.01, // M4SPR
  548.  
  549.                     // Backpacks
  550.                     0.02, // British ACU
  551.                     0.01, // Civil
  552.  
  553.                     // Special
  554.                     0.02, // Camo
  555.                     0.01, //Guilie
  556.  
  557.                     // Building Mats
  558.                     0.02, // Sandbags
  559.                     0.02 // Tank Trap
  560.                 ];
  561.         };
  562.         case "MilitarySpecial": {
  563.                 _itemTypes = [
  564.                     // General
  565.                     ["","medical"],
  566.                     ["","generic"],
  567.                     ["","military"],
  568.  
  569.                     // Equipment
  570.                     ["NVGoggles","weapon"],
  571.                     ["Binocular","weapon"],
  572.                     ["ItemFlashlightRed","military"],
  573.                     ["ItemKnife","military"],
  574.                     ["ItemGPS","weapon"],
  575.                     ["ItemMap","military"],
  576.                     ["Binocular_Vector","military"],
  577.  
  578.                     // Secondary Weapons
  579.                     ["UZI_EP1","weapon"],
  580.                     ["M9","weapon"],
  581.                     ["glock17_EP1","weapon"],
  582.                     ["M9SD","weapon"],
  583.                     ["revolver_gold_EP1","weapon"],
  584.                     ["MakarovSD","weapon"],
  585.  
  586.                     // Primary Weapons
  587.                     ["M1014","weapon"],
  588.                     ["Remington870_lamp"],
  589.  
  590.                     ["AK_107_kobra","weapon"],
  591.                     ["AK_107_GL_kobra","weapon"],
  592.                     ["AK_47_M","weapon"],
  593.                     ["AKS_74_kobra","weapon"],
  594.                     ["AKS_74_NSPU","weapon"],
  595.                     ["AKS_74_pso","weapon"],
  596.  
  597.                     ["FN_FAL","weapon"],
  598.                     ["FN_FAL_ANPVS4","weapon"],
  599.                     ["M14_EP1","weapon"],
  600.  
  601.                     ["G36A_camo","weapon"],
  602.                     ["G36C_camo","weapon"],
  603.                     ["G36_C_SD_camo","weapon"],
  604.                     ["G36K_camo","weapon"],
  605.                     ["G36K","weapon"],
  606.  
  607.                     ["M16A2GL","weapon"],
  608.                     ["M16A4_GL","weapon"],
  609.                     ["M16A4_ACG_GL","weapon"],
  610.                     ["M16A4_ACG","weapon"],
  611.  
  612.                     ["M4A1_HWS_GL_camo","weapon"],
  613.                     ["M4A1_RCO_GL","weapon"],
  614.                     ["M4A1_Aim","weapon"],
  615.                     ["M4A1_Aim_camo","weapon"],
  616.                     ["M4A1_Aim_SD_camo","weapon"],
  617.  
  618.                     ["M4A3_RCO_GL_EP1","weapon"],
  619.                     ["M4A3_CCO_EP1","weapon"],
  620.  
  621.                     ["SCAR_L_CQC","weapon"],
  622.                     ["SCAR_L_CQC_CCO_SD","weapon"],
  623.                     ["SCAR_H_CQC_CCO","weapon"],
  624.  
  625.                     ["MP5SD","weapon"],
  626.  
  627.                     // Snipers
  628.                     ["M107","weapon"],
  629.                     ["DMR","weapon"],
  630.                     ["M24","weapon"],
  631.                     ["M40A3","weapon"],
  632.                     ["M4SPR","weapon"],
  633.                     ["SVD","weapon"],
  634.                     ["SVD_CAMO","weapon"],
  635.  
  636.                     // Backpacks
  637.                     ["DZ_British_ACU","object"],
  638.                     ["DZ_CivilBackpack_EP1","object"],
  639.                     ["DZ_Backpack_EP1","object"],
  640.  
  641.                     // Special
  642.                     ["AmmoBoxSmall_556","object"],
  643.                     ["AmmoBoxSmall_762","object"],
  644.                     ["100Rnd_762x54_PK","magazine"],
  645.                     ["Skin_Camo1_DZ","magazine"],
  646.                     ["Skin_Sniper1_DZ","magazine"]
  647.                        
  648.                 ];
  649.                 _itemChance = [ //Heavy Military
  650.                     // General
  651.                     0.05, // Medical
  652.                     0.05, // General
  653.                     3.00, // Militray
  654.  
  655.                     // Equipment
  656.                     0.01, // NVG
  657.                     0.05, // Binocular
  658.                     0.04, // Flashlight
  659.                     0.05, // Knife
  660.                     0.01, // GPS
  661.                     0.05, // Map
  662.                     0.01, // Range Finder
  663.  
  664.                     // Secondary Weapons
  665.                     0.05, // PDW
  666.                     0.05, // M9
  667.                     0.05, // G17
  668.                     0.01, // M9SD
  669.                     0.01, // LOL
  670.                     0.01, // Makarov SD
  671.  
  672.                     // Primary Weapons
  673.                     0.04, // M1017
  674.                     0.04, // R870
  675.  
  676.                     0.04, // AK 107 Kobr
  677.                     0.02, // AK 107 GL Kobra
  678.                     0.03, // AKM
  679.                     0.04, // AK74 Kobra
  680.                     0.02, // AKS NSPU
  681.                     0.02, // AKS pso
  682.  
  683.                     0.02, // FN FAL
  684.                     0.01, // FN FAL NVG
  685.                     0.02, // M14
  686.  
  687.                     0.03, // G36A Camo
  688.                     0.03, // G36C Camo
  689.                     0.01, // G36C SD Camo
  690.                     0.02, // G36K Camo
  691.                     0.02, // G36K
  692.  
  693.                     0.02, // M16A2 GL
  694.                     0.01, // M16A4 GL
  695.                     0.01, // M16A4 ACG GL
  696.                     0.01, // M16A4 ACG
  697.  
  698.                     0.01, // M4A1 HWS GL Camo
  699.                     0.01, // M4A1 RCO GL
  700.                     0.04, // M4A1 CCO
  701.                     0.02, // M4A1 CCO Camo
  702.                     0.01, // M4A1 CCO SD Camo
  703.  
  704.                     0.01, // M4A3 RCG GL EP1
  705.                     0.02, // M4A3 CCO EP1
  706.  
  707.                     0.03, // SCAR L
  708.                     0.01, // SCAR L CCO SD
  709.                     0.02, // SCAR H CCO
  710.  
  711.                     0.01, // MP5SD
  712.  
  713.                     // Snipers
  714.                     0.01, // M107
  715.                     0.01, // DMR
  716.                     0.005, // M24
  717.                     0.005, // M40A3
  718.                     0.005, // M4SPR
  719.                     0.005, // SVD
  720.                     0.005, // SVD Camo
  721.  
  722.                     // Backpacks
  723.                     0.02, // British ACU
  724.                     0.01, // Civil
  725.                     0.01, // DZ Backpack
  726.  
  727.                     // Special
  728.                     0.04, // Ammo Box 556
  729.                     0.04, // Ammo Box 762
  730.                     0.02, // 100 RD 762
  731.                     0.01, // Camo
  732.                     0.01  // Guilie
  733.                 ];
  734.         };
  735.         case "Hunting": {
  736.                 _itemTypes = [
  737.                     // General
  738.                     ["","military"],
  739.                     ["","hunter"],
  740.  
  741.                     // Equipment
  742.                     ["ItemMap","weapon"],
  743.                     ["ItemFlashlight","generic"],
  744.                     ["ItemKnife","generic"],
  745.                     ["ItemMatchbox","generic"],
  746.                    
  747.                     // Secondary Weapons
  748.                     ["revolver_EP1","weapon"],
  749.                    
  750.                     // Primary Weapons
  751.                     ["Crossbow_DZ","weapon"],
  752.                     ["M1014","weapon"],
  753.                     ["Remington870_lamp","weapon"],
  754.                     ["Winchester1866","weapon"],
  755.                     ["huntingrifle","weapon"],
  756.                     ["FN_FAL","weapon"],
  757.                     ["M14_EP1","weapon"]
  758.    
  759.                 ];
  760.                 _itemChance = [ // Deerstands
  761.                     // General
  762.                     2.00, // Military
  763.                     4.00, // Hunting
  764.  
  765.                     // Equipment
  766.                     0.05, // Map
  767.                     0.05, // Flashlight
  768.                     0.04, // Knife
  769.                     0.04, // Matches
  770.  
  771.                     // Secondary Weapons
  772.                     0.03, // Revolver
  773.  
  774.                     // Primary Weapons
  775.                     0.15, // Crossbow
  776.                     0.04, // M1014
  777.                     0.04, // R870
  778.                     0.05, // Winchester 1866
  779.                     0.05, // Hunting Rifle
  780.                     0.01, // FN FAL
  781.                     0.01  // M14
  782.                 ];
  783.         };
  784. };
  785. //------------------//
  786. //CUSTOM LOOT SPAWNS//
  787. //------------------//
  788. {
  789.         if ((random 1) < _lootChance) then {
  790.                 _iPos = _obj modelToWorld _x;
  791.                 _nearBy = nearestObjects [_iPos, ["WeaponHolder","WeaponHolderBase"], 1];
  792.                 if (count _nearBy == 0) then {
  793.                         private["_index"];
  794.                         _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
  795.                         _index = _weights call BIS_fnc_selectRandom;
  796.                         _itemType = _itemTypes select _index;
  797.                         [_itemType select 0, _itemType select 1 , _iPos, 0.0]  call spawn_loot;
  798.                 };
  799.         };
  800. } forEach _positions;
  801.         // == Residential ===================================== */
  802.         case "Land_HouseV_1I4": { _LootClass = "Residential"; };
  803.         case "Land_kulna": { _LootClass = "Residential"; };
  804.         case "Land_hut06": { _LootClass = "Residential"; };
  805.         case "Land_Hlidac_budka": { _LootClass = "Residential"; };
  806.         case "Land_HouseV2_02_Interier": { _LootClass = "Residential"; };
  807.         case "Land_A_Pub_01": { _LootClass = "Residential"; };
  808.         case "Land_Shed_wooden": { _LootClass = "Residential"; };
  809.         case "Land_HouseBlock_A1_1": { _LootClass = "Residential"; };
  810.         case "Land_A_MunicipalOffice": { _LootClass = "Residential"; };
  811.         case "Land_ruin_01": { _LootClass = "Residential"; };
  812.         case "Land_HouseV2_04_interier": { _LootClass = "Residential"; };
  813.         case "Land_HouseV2_01A": { _LootClass = "Residential"; };
  814.         case "Land_psi_bouda": { _LootClass = "Residential"; };
  815.         case "Land_KBud": { _LootClass = "Residential"; };
  816.         case "Land_A_Castle_Bergfrit": { _LootClass = "Residential"; };
  817.         case "Land_A_Castle_Stairs_A": { _LootClass = "Residential"; };
  818.         case "Land_A_Castle_Gate": { _LootClass = "Residential"; };
  819.         case "Land_sara_domek_zluty": { _LootClass = "Residential"; };
  820.         case "Land_Church_01": { _LootClass = "Residential"; };
  821.         case "Land_Church_03": { _LootClass = "Residential"; };
  822.         case "Land_HouseB_Tenement": { _LootClass = "Residential"; };
  823.         case "Land_Panelak": { _LootClass = "Residential"; };
  824.         case "Land_Panelak2": { _LootClass = "Residential"; };
  825.         case "Land_rail_station_big": { _LootClass = "Residential"; };
  826.         case "Land_A_Office01": { _LootClass = "Residential"; };
  827.         case "Land_A_Office02": { _LootClass = "Residential"; };
  828.  
  829.         // == Industrial ====================================== */
  830.         case "Land_Ind_Workshop01_04": { _LootClass = "Industrial"; };
  831.         case "Land_Ind_Workshop01_01": { _LootClass = "Industrial"; };
  832.         case "Land_Ind_Garage01": { _LootClass = "Industrial"; };
  833.         case "Land_Ind_Workshop01_02": { _LootClass = "Industrial"; };
  834.         case "Land_Ind_Workshop01_L": { _LootClass = "Industrial"; };
  835.         case "Land_Hangar_2": { _LootClass = "Industrial"; };
  836.         case "Land_A_FuelStation_Build": { _LootClass = "Industrial"; };
  837.         case "Land_Shed_Ind02": { _LootClass = "Industrial"; };
  838.         case "Land_Misc_PowerStation": { _LootClass = "Industrial"; };
  839.         case "Land_Shed_W01": { _LootClass = "Industrial"; };
  840.         case "Land_Tovarna2": { _LootClass = "Industrial"; };
  841.         case "Land_Ind_Vysypka": { _LootClass = "Industrial"; };
  842.         case "Land_A_BuildingWIP": { _LootClass = "Industrial"; };
  843.         case "Land_A_TVTower_Base": { _LootClass = "Industrial"; };
  844.         case "Land_Misc_Cargo1Ao": { _LootClass = "Industrial"; };
  845.         case "Land_Misc_Cargo1Bo": { _LootClass = "Industrial"; };
  846.         case "Land_Nav_Boathouse": { _LootClass = "Industrial"; };
  847.         case "Land_wagon_box": { _LootClass = "Industrial"; };
  848.         case "Land_Rail_House_01": { _LootClass = "Industrial"; };
  849.  
  850.         // == Farm ============================================ */
  851.         case "Land_stodola_old_open": { _LootClass = "Farm"; };
  852.         case "Land_Farm_Cowshed_a": { _LootClass = "Farm"; };
  853.         case "Land_stodola_open": { _LootClass = "Farm"; };
  854.         case "Land_Barn_W_01": { _LootClass = "Farm"; };
  855.         case "Land_Barn_W_02": { _LootClass = "Farm"; };
  856.  
  857.         // == Supermarket ===================================== */
  858.         case "Land_A_GeneralStore_01a": { _LootClass = "Supermarket"; };
  859.         case "Land_A_GeneralStore_01": { _LootClass = "Supermarket"; };
  860.  
  861.         // == Hospital ======================================== */
  862.         case "Land_A_Hospital": { _LootClass = "Hospital"; };
  863.         case "MASH": { _LootClass = "Hospital"; };
  864.         case "MASH_EP1": { _LootClass = "Hospital"; };
  865.         case "USMC_WarfareBFieldhHospital": { _LootClass = "Hospital"; };
  866.  
  867.         // == Hunting ========================================= */
  868.         case "Land_Misc_deerstand": { _LootClass = "Hunting"; _lootChance = 0.8; };
  869.  
  870.         // == Military ======================================== */
  871.         case "Land_a_stationhouse": { _LootClass = "Military"; _lootChance = 0.8; };
  872.         case "Land_Mil_ControlTower": { _LootClass = "Military"; _lootChance = 0.8; };
  873.         case "Land_SS_hangar": { _LootClass = "Military"; _lootChance = 0.8; };
  874.         case "Land_Mil_House": { _LootClass = "Military"; _lootChance = 0.8; };
  875.         case "Camp": { _LootClass = "Military"; _lootChance = 0.8; };
  876.         case "CampEast_EP1": { _LootClass = "Military"; _lootChance = 0.8; };
  877.  
  878.         // == Military Special ================================ */
  879.         case "Land_Mil_Barracks_i": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
  880.         case "CampEast": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
  881.        
  882.         default { _LootClass = "Residential"; };
  883. };
  884.  
  885. switch (_LootClass) do { //Find correct loot
  886.         case "Residential": {
  887.                 _itemTypes = [
  888.                     //General
  889.                     ["ItemSodaMdew","magazine"],
  890.                     ["","generic"],
  891.                     ["","military"],
  892.                     ["","trash"],
  893.                     ["WeaponHolder_ItemTent","object"],
  894.  
  895.                     //Equipment
  896.                     ["ItemWatch","generic"],
  897.                     ["ItemCompass","generic"],
  898.                     ["ItemMap","weapon"],
  899.                     ["ItemFlashlight","generic"],
  900.                     ["ItemKnife","generic"],
  901.                     ["ItemMatchbox","generic"],
  902.                     ["Binocular","weapon"],
  903.                     ["PartWoodPile","magazine"],
  904.                     ["WeaponHolder_ItemCrowbar","object"],
  905.                     ["WeaponHolder_ItemHatchet","object"],
  906.                     ["WeaponHolder_ItemMachete","object"],
  907.  
  908.                     // Secondary Weapons
  909.                     ["Colt1911","weapon"],
  910.                     ["Makarov","weapon"],
  911.                     ["MakarovSD","weapon"],
  912.                    
  913.                     // Primary Weapons
  914.                     ["MR43","weapon"],
  915.                     ["Winchester1866","weapon"],
  916.  
  917.                     ["Crossbow_DZ","weapon"],
  918.  
  919.                     // Back Packs
  920.                     ["DZ_Assault_Pack_EP1","object"],
  921.                     ["DZ_Czech_Vest_Puch","object"],
  922.                     ["DZ_ALICE_Pack_EP1","object"],
  923.  
  924.                     // Special
  925.                     ["Skin_Camo1_DZ","magazine"],
  926.                     ["Skin_Survivor2_DZ","magazine"]
  927.  
  928.                     // Building Mats
  929.                     ["ItemWire","magazine"],
  930.                     ["ItemTankTrap","magazine"],
  931.                     ["ItemSandbag","magazine"]
  932.                    
  933.                  ];
  934.                 _itemChance = [ //Residential
  935.                     // General
  936.                     0.01, // Mountian Dew
  937.                     2.00, // Generic
  938.                     0.05, // Military
  939.                     0.50, // Trash
  940.                     0.02, // Tent
  941.  
  942.                     // Equipment
  943.                     0.05, // Watch
  944.                     0.05, // Compass
  945.                     0.05, // Map
  946.                     0.05, // Flashlight
  947.                     0.06, // Knife
  948.                     0.06, // Matchbox
  949.                     0.04, // Binocular
  950.                     0.04, // Woodpile
  951.                     0.04, // Crowbar
  952.                     0.04, // Hatchet
  953.                     0.02, // Machete
  954.  
  955.                     // Secondary Weapons
  956.                     0.02, // Colt 1911
  957.                     0.03, // Makarov
  958.                     0.01, // Makarov SD
  959.  
  960.                     // Primary Weapons
  961.                     0.05, // Double Bareled
  962.                     0.01, // Winchester 1866
  963.                     0.10, // Crossbow
  964.  
  965.                     // Back Packs
  966.                     0.05, // Assault Pack
  967.                     0.03, // Czech Pack
  968.                     0.01, // Alice Pack
  969.  
  970.                     // Special
  971.                     0.01, // Camo Clothing
  972.                     0.01, // Civilian
  973.  
  974.                     // Building Mats
  975.                     0.03, // Wire Kit
  976.                     0.03, // Tank Trap
  977.                     0.02  // Sandbags
  978.                 ];
  979.         };
  980.         case "Industrial": {
  981.                 _itemTypes = [
  982.  
  983.                     // General
  984.                     ["","generic"],
  985.                     ["","trash"],
  986.                     ["","military"],
  987.  
  988.                     // Equipment
  989.                     ["WeaponHolder_ItemHatchet","object"],
  990.                     ["WeaponHolder_ItemMachete","object"],
  991.                     ["ItemKnife","military"],
  992.                     ["ItemToolbox","weapon"],
  993.  
  994.                     // Primary Weapon
  995.                     ["Crossbow_DZ","weapon"],
  996.  
  997.                     // Parts
  998.                     ["WeaponHolder_PartGeneric","object"],
  999.                     ["WeaponHolder_PartWheel","object"],
  1000.                     ["WeaponHolder_PartFueltank","object"],
  1001.                     ["WeaponHolder_PartEngine","object"],
  1002.                     ["WeaponHolder_PartGlass","object"],
  1003.                     ["WeaponHolder_PartVRotor","object"],
  1004.                     ["WeaponHolder_ItemJerrycan","object"],
  1005.  
  1006.                     // Building Mats
  1007.                     ["ItemWire","magazine"],
  1008.                     ["ItemTankTrap","magazine"],
  1009.                     ["ItemSandbag","magazine"]
  1010.                                              
  1011.                 ];
  1012.                 _itemChance = [ //Industrial
  1013.                     // General
  1014.                     0.18, // Generic
  1015.                     0.08, // Trash
  1016.                     0.30, // Military
  1017.  
  1018.                     // Equipment
  1019.                     0.15, // Hatchet
  1020.                     0.10, // Machete
  1021.                     0.07, // Knife
  1022.                     0.03, // Toolbox
  1023.  
  1024.                     // Primary Weapon
  1025.                     0.10, // Crossbow
  1026.  
  1027.                     // Parts
  1028.                     0.04, // Generic Part
  1029.                     0.03, // Wheel
  1030.                     0.03, // Full tank
  1031.                     0.03, // Engine
  1032.                     0.03, // Glass
  1033.                     0.02, // Rotor
  1034.                     0.03, // Jerry Can
  1035.  
  1036.                     //Building Mats
  1037.                     0.15, // Wirekit
  1038.                     0.15, // Tank trap
  1039.                     0.14  // Sandbag
  1040.                 ];
  1041.         };
  1042.         case "Farm": {
  1043.                 _itemTypes = [ //Farm
  1044.  
  1045.                     // General
  1046.                     ["","generic"],
  1047.                     ["","trash"],
  1048.  
  1049.                     // Equipment
  1050.                     ["WeaponHolder_ItemHatchet","object"],  
  1051.                     ["WeaponHolder_ItemMachete","object"],  
  1052.                     ["ItemEtool","weapon"],
  1053.  
  1054.                     // Secondary Weapons
  1055.                     ["Colt1911","weapon"],
  1056.                     ["revolver_EP1","weapon"],
  1057.  
  1058.                     // Primary Weapons
  1059.                     ["MR43","weapon"],
  1060.                     ["M1014","weapon"],
  1061.                     ["Remington870_lamp","weapon"],
  1062.  
  1063.                     ["Huntingrifle","weapon"],
  1064.  
  1065.                     ["Crossbow_DZ","weapon"],
  1066.  
  1067.                     ["LeeEnfield","weapon"],
  1068.  
  1069.                     // Backpacks
  1070.                     ["DZ_Czech_Vest_Puch","object"],
  1071.  
  1072.                     // Parts
  1073.                     ["WeaponHolder_ItemJerrycan","object"],
  1074.  
  1075.                     // Building Mats
  1076.                     ["ItemWire","magazine"],
  1077.                     ["PartWoodPile","magazine"]
  1078.                 ];
  1079.                 _itemChance = [
  1080.                     // General
  1081.                     0.20, // Generic
  1082.                     0.10, // Trash
  1083.  
  1084.                     // Equipment
  1085.                     0.15, // Hatchet
  1086.                     0.10, // Machete
  1087.                     0.13, // Entrenching
  1088.  
  1089.                     // Secondary Weapons
  1090.                     0.12, // Colt 1911
  1091.                     0.13, // Revolver
  1092.  
  1093.                     // Primary Weapons
  1094.                     0.10, // Double Barreled
  1095.                     0.15, // M1014
  1096.                     0.15, // R870
  1097.                     0.13, // Hunting Rifle
  1098.                     0.10, // Crossbow
  1099.                     0.13, // Lee Enfield
  1100.  
  1101.                     // Backpacks
  1102.                     0.14, // Czech
  1103.  
  1104.                     // Parts
  1105.                     0.12, // Jerry can
  1106.  
  1107.                     // Building Mats
  1108.                     0.13, // Wire Kit
  1109.                     0.13  // Woodpile
  1110.                 ];
  1111.         };
  1112.         case "Supermarket": {
  1113.                 _itemTypes = [
  1114.                     // General
  1115.                     ["","generic"],
  1116.                     ["","food"],
  1117.                     ["","trash"],
  1118.                     ["WeaponHolder_ItemTent","object"],
  1119.  
  1120.                     // Equipment
  1121.                     ["ItemWatch","generic"],
  1122.                     ["ItemCompass","generic"],
  1123.                     ["ItemMap","weapon"],
  1124.                     ["ItemFlashlight","generic"],
  1125.                     ["ItemKnife","generic"],
  1126.                     ["ItemMatchbox","generic"],
  1127.                     ["Binocular","weapon"],
  1128.                     ["WeaponHolder_ItemHatchet","object"],
  1129.  
  1130.                     // Secondary Weapons
  1131.                     ["Colt1911","weapon"],
  1132.                     ["Makarov","weapon"],
  1133.                     ["revolver_EP1","weapon"],
  1134.                    
  1135.                     // Primary Weapons
  1136.                     ["Crossbow_DZ","weapon"],
  1137.                     ["MR43","weapon"],
  1138.  
  1139.                     // Backpacks
  1140.                     ["DZ_Assault_Pack_EP1","object"],
  1141.                     ["DZ_Czech_Vest_Puch","object"],
  1142.                     ["DZ_TK_Assault_Pack_EP1","object"],
  1143.  
  1144.                     // Building Mats
  1145.                     ["PartWoodPile","magazine"]
  1146.                 ];
  1147.                 _itemChance = [ //Super Market
  1148.                     // General
  1149.                     0.05, // Generic
  1150.                     2.00, // Food
  1151.                     0.10, // Trash
  1152.                     0.03, // Tent
  1153.  
  1154.                     // Equipmnet
  1155.                     0.15, // Watch
  1156.                     0.14, // Compass
  1157.                     0.14, // Map
  1158.                     0.15, // Flashlight
  1159.                     0.15, // Knife
  1160.                     0.15, // Matches
  1161.                     0.14, // Binoculars
  1162.                     0.18, // Hatchet
  1163.  
  1164.                     // Secondary Weapons
  1165.                     0.13, // Colt 1911
  1166.                     0.15, // Makarov
  1167.                     0.13, // Revolver
  1168.  
  1169.                     // Primary Weapons
  1170.                     0.19, // Crossbow
  1171.                     0.18, // Double Barreled
  1172.  
  1173.                     // Backpacks
  1174.                     //0.14, // Assault
  1175.                     0.13, // Czech
  1176.                     0.11, // TK Assault
  1177.  
  1178.                     // Building Mats
  1179.                     0.03  // Woodpile
  1180.                 ];
  1181.         };
  1182.         case "Hospital": {
  1183.                 _itemTypes =    [
  1184.                         ["","trash"],
  1185.                         ["","hospital"],
  1186.                         ["MedBox0","object"],
  1187.                         ["AKS_74","weapon"],
  1188.                 ];
  1189.                 _itemChance = [
  1190.                         0.20,    // Trash
  1191.                         0.75,    // Hospital
  1192.                         0.15,     // Medical Box
  1193.                         0.09    // AKS 74
  1194.                 ];
  1195.         };
  1196.         case "Military": {
  1197.                 _itemTypes = [
  1198.                     // General
  1199.                     ["","medical"],
  1200.                     ["","generic"],
  1201.                     ["","military"],
  1202.  
  1203.                     // Equipment
  1204.                     ["Binocular","weapon"],
  1205.                     ["ItemFlashlightRed","military"],
  1206.                     ["ItemKnife","military"],
  1207.                     ["ItemGPS","weapon"],
  1208.                     ["ItemMap","military"],
  1209.                     ["ItemEtool","weapon"],
  1210.  
  1211.                     // Secondary Weapons
  1212.                     ["glock17_EP1","weapon"],
  1213.                     ["M9","weapon"],
  1214.                     ["M9SD","weapon"],
  1215.                     ["UZI_EP1","weapon"],
  1216.  
  1217.                     // Primary Weapons
  1218.                     ["AK_47_S","weapon"],
  1219.                     ["AKS_74","weapon"],
  1220.                     ["AKS_74_kobra","weapon"],
  1221.                     ["AKS_74_U","weapon"],
  1222.  
  1223.                     ["G36a","weapon"],
  1224.                     ["G36A_camo","weapon"],
  1225.                     ["G36C","weapon"],
  1226.                     ["G36C_camo","weapon"],
  1227.                     ["G36K","weapon"],
  1228.                     ["G36K_camo","weapon"],
  1229.  
  1230.                     ["M16A2","weapon"],
  1231.                     ["M16A2GL","weapon"],
  1232.  
  1233.                     ["M4A1","weapon"],
  1234.                     ["M4A1_Aim","weapon"],
  1235.                     ["M4A1_Aim_camo","weapon"],
  1236.  
  1237.                     ["SCAR_L_CQC","weapon"],
  1238.  
  1239.                     ["MP5A5","weapon"],
  1240.  
  1241.                     ["M1014","weapon"],
  1242.                     ["Remington870_lamp","weapon"],
  1243.                     ["Winchester1866","weapon"],
  1244.  
  1245.                     // Snipers
  1246.  
  1247.                     ["DMR","weapon"],
  1248.                     ["M4SPR","weapon"],
  1249.  
  1250.                     // Backpacks
  1251.                     ["DZ_British_ACU","object"],
  1252.                     ["DZ_CivilBackpack_EP1","object"],
  1253.                     ["DZ_Backpack_EP1","object"],
  1254.                    
  1255.                     // Special
  1256.                     ["Skin_Camo1_DZ","magazine"],
  1257.                     ["Skin_Sniper1_DZ","magazine"],
  1258.                     ["Skin_Soldier1_DZ","magazine"],
  1259.  
  1260.                     // Building Mats  
  1261.                     ["ItemSandbag","magazine"],
  1262.                     ["ItemTankTrap","magazine"]
  1263.                 ];
  1264.                 _itemChance = [ //Military
  1265.                     // General
  1266.                     0.15, // Medical
  1267.                     0.13, // General
  1268.                     2.10, // Military
  1269.  
  1270.                     // Equipment
  1271.                     0.15, // Binocular
  1272.                     0.14, // Military Flashlight
  1273.                     0.15, // Knife
  1274.                     0.11, // GPS
  1275.                     0.15, // Map
  1276.                     0.15, // Entrenching
  1277.  
  1278.                     // Secondary Weapons
  1279.                     0.14, // G17
  1280.                     0.14, // M9
  1281.                     0.11, // M9 SD
  1282.                     0.13, // PDW
  1283.  
  1284.                     // Primary Weapons
  1285.                     0.13, // AKS
  1286.                     0.14, // AKS 74
  1287.                     0.12, // AKS 74 Kobra
  1288.                     0.14, // AKS 74 U
  1289.  
  1290.                     0.14, // G36
  1291.                     0.12, // G36 Camo
  1292.                     0.13, // G36C
  1293.                     0.12, // G36C Camo
  1294.                     0.12, // G36K
  1295.                     0.11, // G36K Camo
  1296.  
  1297.                     0.14, // M16A2
  1298.                     0.11, // M16A2 GL
  1299.  
  1300.                     0.14, // M4A1
  1301.                     0.12, // M4A1 CCO
  1302.                     0.11, // M4A1 CCO Camo
  1303.  
  1304.                     0.12, // SCAR L
  1305.  
  1306.                     0.14, // MP5A
  1307.  
  1308.                     0.15, // M1014
  1309.                     0.15, // R870
  1310.                     0.15, // 1866
  1311.  
  1312.                     // Snipers
  1313.                     0.11, // DMR
  1314.                     0.11, // M4SPR
  1315.  
  1316.                     // Backpacks
  1317.                     0.12, // British ACU
  1318.                     0.11, // Civil
  1319.                     0.11, // DZ Backpack
  1320.  
  1321.                     // Special
  1322.                     0.12, // Camo
  1323.                     0.11, // Guilie
  1324.                     0.12, // Soldier
  1325.  
  1326.                     // Building Mats
  1327.                     0.12, // Sandbags
  1328.                     0.12 // Tank Trap
  1329.                 ];
  1330.         };
  1331.         case "MilitarySpecial": {
  1332.                 _itemTypes = [
  1333.                     // General
  1334.                     ["","medical"],
  1335.                     ["","generic"],
  1336.                     ["","military"],
  1337.  
  1338.                     // Equipment
  1339.                     ["NVGoggles","weapon"],
  1340.                     ["Binocular","weapon"],
  1341.                     ["ItemFlashlightRed","military"],
  1342.                     ["ItemKnife","military"],
  1343.                     ["ItemGPS","weapon"],
  1344.                     ["ItemMap","military"],
  1345.                     ["Binocular_Vector","military"],
  1346.  
  1347.                     // Secondary Weapons
  1348.                     ["UZI_EP1","weapon"],
  1349.                     ["M9","weapon"],
  1350.                     ["glock17_EP1","weapon"],
  1351.                     ["M9SD","weapon"],
  1352.                     ["revolver_gold_EP1","weapon"],
  1353.                     ["MakarovSD","weapon"],
  1354.  
  1355.                     // Primary Weapons
  1356.                     ["M1014","weapon"],
  1357.                     ["Remington870_lamp"],
  1358.  
  1359.                     ["AK_107_kobra","weapon"],
  1360.                     ["AK_107_GL_kobra","weapon"],
  1361.                     ["AK_47_M","weapon"],
  1362.                     ["AKS_74_kobra","weapon"],
  1363.                     ["AKS_74_NSPU","weapon"],
  1364.  
  1365.                     ["FN_FAL","weapon"],
  1366.                     ["FN_FAL_ANPVS4","weapon"],
  1367.                     ["M14_EP1","weapon"],
  1368.  
  1369.                     ["G36A_camo","weapon"],
  1370.                     ["G36C_camo","weapon"],
  1371.                     ["G36K_camo","weapon"],
  1372.                     ["G36K","weapon"],
  1373.  
  1374.                     ["M16A2GL","weapon"],
  1375.                     ["M16A4_GL","weapon"],
  1376.                     ["M16A4_ACG_GL","weapon"],
  1377.                     ["M16A4_ACG","weapon"],
  1378.  
  1379.                     ["M4A1_HWS_GL_camo","weapon"],
  1380.                     ["M4A1_RCO_GL","weapon"],
  1381.                     ["M4A1_Aim","weapon"],
  1382.                     ["M4A1_Aim_camo","weapon"],
  1383.                     ["M4A1_Aim_SD_camo","weapon"],
  1384.  
  1385.                     ["M4A3_RCO_GL_EP1","weapon"],
  1386.                     ["M4A3_CCO_EP1","weapon"],
  1387.  
  1388.                     ["SCAR_L_CQC","weapon"],
  1389.                     ["SCAR_L_CQC_CCO_SD","weapon"],
  1390.                     ["SCAR_H_CQC_CCO","weapon"],
  1391.  
  1392.                     ["MP5SD","weapon"],
  1393.  
  1394.                     // Snipers
  1395.                     ["M107","weapon"],
  1396.                     ["DMR","weapon"],
  1397.                     ["M24","weapon"],
  1398.                     ["M40A3","weapon"],
  1399.                     ["M4SPR","weapon"],
  1400.                     ["SVD_CAMO","weapon"],
  1401.  
  1402.                     // Backpacks
  1403.                     ["DZ_British_ACU","object"],
  1404.                     ["DZ_CivilBackpack_EP1","object"],
  1405.                     ["DZ_Backpack_EP1","object"],
  1406.  
  1407.                     // Special
  1408.                     ["AmmoBoxSmall_556","object"],
  1409.                     ["AmmoBoxSmall_762","object"],
  1410.                     ["100Rnd_762x54_PK","magazine"],
  1411.                     ["Skin_Camo1_DZ","magazine"],
  1412.                     ["Skin_Sniper1_DZ","magazine"],
  1413.                     ["Skin_Soldier1_DZ","magazine"]
  1414.                        
  1415.                 ];
  1416.                 _itemChance = [ //Heavy Military
  1417.                     // General
  1418.                     0.05, // Medical
  1419.                     0.05, // General
  1420.                     3.00, // Militray
  1421.  
  1422.                     // Equipment
  1423.                     0.01, // NVG
  1424.                     0.05, // Binocular
  1425.                     0.04, // Flashlight
  1426.                     0.05, // Knife
  1427.                     0.01, // GPS
  1428.                     0.05, // Map
  1429.                     0.01, // Range Finder
  1430.  
  1431.                     // Secondary Weapons
  1432.                     0.15, // PDW
  1433.                     0.15, // M9
  1434.                     0.15, // G17
  1435.                     0.11, // M9SD
  1436.                     0.11, // LOL
  1437.                     //5.00, // Makarov SD
  1438.  
  1439.                     // Primary Weapons
  1440.                     0.14, // M1017
  1441.                     0.14, // R870
  1442.  
  1443.                     0.14, // AK 107 Kobra
  1444.                     5.12, // AK 107 GL Kobra
  1445.                     0.13, // AKM
  1446.                     0.14, // AK74 Kobra
  1447.                     5.12, // AKS NSPU
  1448.  
  1449.                     0.12, // FN FAL
  1450.                     //0.11, // FN FAL NVG
  1451.                     0.12, // M14
  1452.  
  1453.                     5.03, // G36A Camo
  1454.                     5.03, // G36C Camo
  1455.                     5.02, // G36K Camo
  1456.                     0.12, // G36K
  1457.  
  1458.                     0.02, // M16A2 GL
  1459.                     0.01, // M16A4 GL
  1460.                     5.01, // M16A4 ACG GL
  1461.                     5.01, // M16A4 ACG
  1462.  
  1463.                     5.01, // M4A1 HWS GL Camo
  1464.                     5.01, // M4A1 RCO GL
  1465.                     0.04, // M4A1 CCO
  1466.                     0.02, // M4A1 CCO Camo
  1467.                     0.01, // M4A1 CCO SD Camo
  1468.  
  1469.                     5.01, // M4A3 RCG GL EP1
  1470.                     5.02, // M4A3 CCO EP1
  1471.  
  1472.                     0.03, // SCAR L
  1473.                     5.01, // SCAR L CCO SD
  1474.                     5.03, // SCAR H CCO
  1475.  
  1476.                     0.01, // MP5SD
  1477.  
  1478.                     // Snipers
  1479.                     0.01, // M107
  1480.                     0.01, // DMR
  1481.                     0.005, // M24
  1482.                     5.005, // M40A3
  1483.                     5.005, // M4SPR
  1484.                     0.005, // SVD Camo
  1485.  
  1486.                     // Backpacks
  1487.                     0.02, // British ACU
  1488.                     0.01, // Civil
  1489.                     0.01, // DZ Backpack
  1490.  
  1491.                     // Special
  1492.                     0.04, // Ammo Box 556
  1493.                     0.04, // Ammo Box 762
  1494.                     0.02, // 100 RD 762
  1495.                     0.01, // Camo
  1496.                     0.01, // Guilie
  1497.                     0.02  // Soldier
  1498.                 ];
  1499.         };
  1500.         case "Hunting": {
  1501.                 _itemTypes = [
  1502.                     // General
  1503.                     ["","military"],
  1504.                     ["","hunter"],
  1505.  
  1506.                     // Equipment
  1507.                     ["ItemMap","weapon"],
  1508.                     ["ItemFlashlight","generic"],
  1509.                     ["ItemKnife","generic"],
  1510.                     ["ItemMatchbox","generic"],
  1511.                    
  1512.                     // Secondary Weapons
  1513.                     ["revolver_EP1","weapon"],
  1514.                    
  1515.                     // Primary Weapons
  1516.                     ["Crossbow_DZ","weapon"],
  1517.                     ["M1014","weapon"],
  1518.                     ["Remington870_lamp","weapon"],
  1519.                     ["Winchester1866","weapon"],
  1520.                     ["huntingrifle","weapon"],
  1521.                     ["FN_FAL","weapon"],
  1522.                     ["M14_EP1","weapon"]
  1523.    
  1524.                 ];
  1525.                 _itemChance = [ // Deerstands
  1526.                     // General
  1527.                     2.00, // Military
  1528.                     4.00, // Hunting
  1529.  
  1530.                     // Equipment
  1531.                     0.05, // Map
  1532.                     0.05, // Flashlight
  1533.                     0.04, // Knife
  1534.                     0.04, // Matches
  1535.  
  1536.                     // Secondary Weapons
  1537.                     0.03, // Revolver
  1538.  
  1539.                     // Primary Weapons
  1540.                     0.15, // Crossbow
  1541.                     0.04, // M1014
  1542.                     0.04, // R870
  1543.                     0.05, // Winchester 1866
  1544.                     0.05, // Hunting Rifle
  1545.                     0.01, // FN FAL
  1546.                     0.01  // M14
  1547.                 ];
  1548.         };
  1549. };
  1550. //------------------//
  1551. //CUSTOM LOOT SPAWNS//
  1552. //------------------//
  1553. {
  1554.         if ((random 1) < _lootChance) then {
  1555.                 _iPos = _obj modelToWorld _x;
  1556.                 _nearBy = nearestObjects [_iPos, ["WeaponHolder","WeaponHolderBase"], 1];
  1557.                 if (count _nearBy == 0) then {
  1558.                         private["_index"];
  1559.                         _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
  1560.                         _index = _weights call BIS_fnc_selectRandom;
  1561.                         _itemType = _itemTypes select _index;
  1562.                         [_itemType select 0, _itemType select 1 , _iPos, 0.0]  call spawn_loot;
  1563.                 };
  1564.         };
  1565. } forEach _positions;
Advertisement
Add Comment
Please, Sign In to add comment