Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_itemChances","_lootChance","_weights","_cntWeights","_index","_LootClass"];
- _obj = _this select 0;
- _type = typeOf _obj;
- _config = configFile >> "CfgBuildingLoot" >> _type;
- _positions = [] + getArray (_config >> "lootPos");
- //_itemTypes = [] + getArray (_config >> "itemType"); // Default System
- _lootChance = getNumber (_config >> "lootChance");
- //------------------//
- //CUSTOM LOOT SPAWNS//
- //------------------//
- _itemTypes = []; //Initialise array
- _itemChance = []; //Initialise array
- //diag_log "SPAWNING WITH CUSTOM LOOT";//Remove This line after testing
- switch (_type) do { //Assign building classes
- private["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_itemChances","_lootChance","_weights","_cntWeights","_index","_LootClass"];
- _obj = _this select 0;
- _type = typeOf _obj;
- _config = configFile >> "CfgBuildingLoot" >> _type;
- _positions = [] + getArray (_config >> "lootPos");
- //_itemTypes = [] + getArray (_config >> "itemType"); // Default System
- _lootChance = getNumber (_config >> "lootChance");
- //------------------//
- //CUSTOM LOOT SPAWNS//
- //------------------//
- _itemTypes = []; //Initialise array
- _itemChance = []; //Initialise array
- //diag_log "SPAWNING WITH CUSTOM LOOT";//Remove This line after testing
- switch (_type) do { //Assign building classes
- // == Residential ===================================== */
- case "Land_HouseV_1I4": { _LootClass = "Residential"; };
- case "Land_kulna": { _LootClass = "Residential"; };
- case "Land_hut06": { _LootClass = "Residential"; };
- case "Land_Hlidac_budka": { _LootClass = "Residential"; };
- case "Land_HouseV2_02_Interier": { _LootClass = "Residential"; };
- case "Land_A_Pub_01": { _LootClass = "Residential"; };
- case "Land_Shed_wooden": { _LootClass = "Residential"; };
- case "Land_HouseBlock_A1_1": { _LootClass = "Residential"; };
- case "Land_A_MunicipalOffice": { _LootClass = "Residential"; };
- case "Land_ruin_01": { _LootClass = "Residential"; };
- case "Land_HouseV2_04_interier": { _LootClass = "Residential"; };
- case "Land_HouseV2_01A": { _LootClass = "Residential"; };
- case "Land_psi_bouda": { _LootClass = "Residential"; };
- case "Land_KBud": { _LootClass = "Residential"; };
- case "Land_A_Castle_Bergfrit": { _LootClass = "Residential"; };
- case "Land_A_Castle_Stairs_A": { _LootClass = "Residential"; };
- case "Land_A_Castle_Gate": { _LootClass = "Residential"; };
- case "Land_sara_domek_zluty": { _LootClass = "Residential"; };
- case "Land_Church_01": { _LootClass = "Residential"; };
- case "Land_Church_03": { _LootClass = "Residential"; };
- case "Land_HouseB_Tenement": { _LootClass = "Residential"; };
- case "Land_Panelak": { _LootClass = "Residential"; };
- case "Land_Panelak2": { _LootClass = "Residential"; };
- case "Land_rail_station_big": { _LootClass = "Residential"; };
- case "Land_A_Office01": { _LootClass = "Residential"; };
- case "Land_A_Office02": { _LootClass = "Residential"; };
- // == Industrial ====================================== */
- case "Land_Ind_Workshop01_04": { _LootClass = "Industrial"; };
- case "Land_Ind_Workshop01_01": { _LootClass = "Industrial"; };
- case "Land_Ind_Garage01": { _LootClass = "Industrial"; };
- case "Land_Ind_Workshop01_02": { _LootClass = "Industrial"; };
- case "Land_Ind_Workshop01_L": { _LootClass = "Industrial"; };
- case "Land_Hangar_2": { _LootClass = "Industrial"; };
- case "Land_A_FuelStation_Build": { _LootClass = "Industrial"; };
- case "Land_Shed_Ind02": { _LootClass = "Industrial"; };
- case "Land_Misc_PowerStation": { _LootClass = "Industrial"; };
- case "Land_Shed_W01": { _LootClass = "Industrial"; };
- case "Land_Tovarna2": { _LootClass = "Industrial"; };
- case "Land_Ind_Vysypka": { _LootClass = "Industrial"; };
- case "Land_A_BuildingWIP": { _LootClass = "Industrial"; };
- case "Land_A_TVTower_Base": { _LootClass = "Industrial"; };
- case "Land_Misc_Cargo1Ao": { _LootClass = "Industrial"; };
- case "Land_Misc_Cargo1Bo": { _LootClass = "Industrial"; };
- case "Land_Nav_Boathouse": { _LootClass = "Industrial"; };
- case "Land_wagon_box": { _LootClass = "Industrial"; };
- case "Land_Rail_House_01": { _LootClass = "Industrial"; };
- // == Farm ============================================ */
- case "Land_stodola_old_open": { _LootClass = "Farm"; };
- case "Land_Farm_Cowshed_a": { _LootClass = "Farm"; };
- case "Land_stodola_open": { _LootClass = "Farm"; };
- case "Land_Barn_W_01": { _LootClass = "Farm"; };
- case "Land_Barn_W_02": { _LootClass = "Farm"; };
- // == Supermarket ===================================== */
- case "Land_A_GeneralStore_01a": { _LootClass = "Supermarket"; };
- case "Land_A_GeneralStore_01": { _LootClass = "Supermarket"; };
- // == Hospital ======================================== */
- case "Land_A_Hospital": { _LootClass = "Hospital"; };
- case "MASH": { _LootClass = "Hospital"; };
- case "MASH_EP1": { _LootClass = "Hospital"; };
- case "USMC_WarfareBFieldhHospital": { _LootClass = "Hospital"; };
- // == Hunting ========================================= */
- case "Land_Misc_deerstand": { _LootClass = "Hunting"; _lootChance = 0.8; };
- // == Military ======================================== */
- case "Land_a_stationhouse": { _LootClass = "Military"; _lootChance = 0.8; };
- case "Land_Mil_ControlTower": { _LootClass = "Military"; _lootChance = 0.8; };
- case "Land_Mil_House": { _LootClass = "Military"; _lootChance = 0.8; };
- case "Camp": { _LootClass = "Military"; _lootChance = 0.8; };
- case "CampEast_EP1": { _LootClass = "Military"; _lootChance = 0.8; };
- // == Military Special ================================ */
- case "Land_Mil_Barracks_i": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
- case "CampEast": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
- case "Land_SS_hangar": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
- default { _LootClass = "Residential"; };
- };
- switch (_LootClass) do { //Find correct loot
- case "Residential": {
- _itemTypes = [
- //General
- ["ItemSodaMdew","magazine"],
- ["","generic"],
- ["","military"],
- ["","trash"],
- ["WeaponHolder_ItemTent","object"],
- //Equipment
- ["ItemWatch","generic"],
- ["ItemCompass","generic"],
- ["ItemMap","weapon"],
- ["ItemFlashlight","generic"],
- ["ItemKnife","generic"],
- ["ItemMatchbox","generic"],
- ["Binocular","weapon"],
- ["PartWoodPile","magazine"],
- ["WeaponHolder_ItemCrowbar","object"],
- ["WeaponHolder_ItemHatchet","object"],
- ["WeaponHolder_ItemMachete","object"],
- // Secondary Weapons
- ["Colt1911","weapon"],
- ["Makarov","weapon"],
- ["MakarovSD","weapon"],
- // Primary Weapons
- ["MR43","weapon"],
- ["Winchester1866","weapon"],
- ["Crossbow_DZ","weapon"],
- // Back Packs
- ["DZ_Assault_Pack_EP1","object"],
- ["DZ_Czech_Vest_Puch","object"],
- ["DZ_ALICE_Pack_EP1","object"],
- // Special
- ["Skin_Camo1_DZ","magazine"],
- ["Skin_Sniper1_DZ","magazine"],
- // Building Mats
- ["ItemWire","magazine"],
- ["ItemTankTrap","magazine"],
- ["ItemSandbag","magazine"]
- ];
- _itemChance = [ //Residential
- // General
- 0.01, // Mountian Dew
- 2.00, // Generic
- 0.05, // Military
- 0.50, // Trash
- 0.02, // Tent
- // Equipment
- 0.05, // Watch
- 0.05, // Compass
- 0.05, // Map
- 0.05, // Flashlight
- 0.06, // Knife
- 0.06, // Matchbox
- 0.04, // Binocular
- 0.04, // Woodpile
- 0.04, // Crowbar
- 0.04, // Hatchet
- 0.02, // Machete
- // Secondary Weapons
- 0.02, // Colt 1911
- 0.03, // Makarov
- 0.01, // Makarov SD
- // Primary Weapons
- 0.05, // Double Bareled
- 0.01, // Winchester 1866
- 0.10, // Crossbow
- // Back Packs
- 0.05, // Assault Pack
- 0.03, // Czech Pack
- 0.01, // Alice Pack
- // Special
- 0.01, // Camo Clothing
- 0.01, // Guilie Suit
- // Building Mats
- 0.03, // Wire Kit
- 0.03, // Tank Trap
- 0.02 // Sandbags
- ];
- };
- case "Industrial": {
- _itemTypes = [
- // General
- ["","generic"],
- ["","trash"],
- ["","military"],
- // Equipment
- ["WeaponHolder_ItemHatchet","object"],
- ["WeaponHolder_ItemMachete","object"],
- ["ItemKnife","military"],
- ["ItemToolbox","weapon"],
- // Primary Weapon
- ["Crossbow_DZ","weapon"],
- // Parts
- ["WeaponHolder_PartGeneric","object"],
- ["WeaponHolder_PartWheel","object"],
- ["WeaponHolder_PartFueltank","object"],
- ["WeaponHolder_PartEngine","object"],
- ["WeaponHolder_PartGlass","object"],
- ["WeaponHolder_PartVRotor","object"],
- ["WeaponHolder_ItemJerrycan","object"],
- // Building Mats
- ["ItemWire","magazine"],
- ["ItemTankTrap","magazine"],
- ["ItemSandbag","magazine"]
- ];
- _itemChance = [ //Industrial
- // General
- 0.18, // Generic
- 0.08, // Trash
- 0.30, // Military
- // Equipment
- 0.15, // Hatchet
- 0.10, // Machete
- 0.07, // Knife
- 0.03, // Toolbox
- // Parts
- 0.04, // Generic Part
- 0.03, // Wheel
- 0.03, // Full tank
- 0.03, // Engine
- 0.03, // Glass
- 0.02, // Rotor
- 0.03, // Jerry Can
- // Building Mats
- 0.05, // Wirekit
- 0.05, // Tank trap
- 0.04 // Sandbag
- ];
- };
- case "Farm": {
- _itemTypes = [ //Farm
- // General
- ["","generic"],
- ["","trash"],
- // Equipment
- ["WeaponHolder_ItemHatchet","object"],
- ["WeaponHolder_ItemMachete","object"],
- ["ItemEtool","weapon"],
- // Secondary Weapons
- ["Colt1911","weapon"],
- ["revolver_EP1","weapon"],
- // Primary Weapons
- ["MR43","weapon"],
- ["M1014","weapon"],
- ["Remington870_lamp","weapon"],
- ["Huntingrifle","weapon"],
- ["Crossbow_DZ","weapon"],
- ["LeeEnfield","weapon"],
- // Backpacks
- ["DZ_Czech_Vest_Puch","object"],
- // Parts
- ["WeaponHolder_ItemJerrycan","object"],
- // Building Mats
- ["ItemWire","magazine"],
- ["PartWoodPile","magazine"]
- ];
- _itemChance = [
- // General
- 0.20, // Generic
- 0.10, // Trash
- // Equipment
- 0.15, // Hatchet
- 0.10, // Machete
- 0.03, // Entrenching
- // Secondary Weapons
- 0.02, // Colt 1911
- 0.03, // Revolver
- // Primary Weapons
- 0.10, // Double Barreled
- 0.05, // M1014
- 0.05, // R870
- 0.03, // Hunting Rifle
- 0.10, // Crossbow
- 0.03, // Lee Enfield
- // Backpacks
- 0.04, // Czech
- // Parts
- 0.02, // Jerry can
- // Building Mats
- 0.03, // Wire Kit
- 0.03 // Woodpile
- ];
- };
- case "Supermarket": {
- _itemTypes = [
- // General
- ["","generic"],
- ["","food"],
- ["","trash"],
- ["WeaponHolder_ItemTent","object"],
- // Equipment
- ["ItemWatch","generic"],
- ["ItemCompass","generic"],
- ["ItemMap","weapon"],
- ["ItemFlashlight","generic"],
- ["ItemKnife","generic"],
- ["ItemMatchbox","generic"],
- ["Binocular","weapon"],
- ["WeaponHolder_ItemHatchet","object"],
- // Secondary Weapons
- ["Colt1911","weapon"],
- ["Makarov","weapon"],
- ["revolver_EP1","weapon"],
- // Primary Weapons
- ["Crossbow_DZ","weapon"],
- ["MR43","weapon"],
- // Backpacks
- ["DZ_Assault_Pack_EP1","object"],
- ["DZ_Czech_Vest_Puch","object"],
- ["DZ_TK_Assault_Pack_EP1","object"],
- // Building Mats
- ["PartWoodPile","magazine"]
- ];
- _itemChance = [ //Super Market
- // General
- 0.05, // Generic
- 2.00, // Food
- 0.10, // Trash
- 0.03, // Tent
- // Equipmnet
- 0.05, // Watch
- 0.04, // Compass
- 0.04, // Map
- 0.05, // Flashlight
- 0.05, // Knife
- 0.05, // Matches
- 0.04, // Binoculars
- 0.08, // Hatchet
- // Secondary Weapons
- 0.03, // Colt 1911
- 0.05, // Makarov
- 0.03, // Revolver
- // Primary Weapons
- 0.09, // Crossbow
- 0.08, // Double Barreled
- // Backpacks
- 0.04, // Assault
- 0.03, // Czech
- 0.01, // TK Assault
- // Building Mats
- 0.03 // Woodpile
- ];
- };
- case "Hospital": {
- _itemTypes = [
- ["","trash"],
- ["","hospital"],
- ["MedBox0","object"]
- ];
- _itemChance = [
- 0.20, // Trash
- 0.75, // Hospital
- 0.15 // Medical Box
- ];
- };
- case "Military": {
- _itemTypes = [
- // General
- ["","medical"],
- ["","generic"],
- ["","military"],
- // Equipment
- ["Binocular","weapon"],
- ["ItemFlashlightRed","military"],
- ["ItemKnife","military"],
- ["ItemGPS","weapon"],
- ["ItemMap","military"],
- ["ItemEtool","weapon"],
- // Secondary Weapons
- ["glock17_EP1","weapon"],
- ["M9","weapon"],
- ["M9SD","weapon"],
- ["UZI_EP1","weapon"],
- // Primary Weapons
- ["AK_74","weapon"],
- ["AK_47_S","weapon"],
- ["AKS_74","weapon"],
- ["AKS_74_kobra","weapon"],
- ["AKS_74_U","weapon"],
- ["G36a","weapon"],
- ["G36A_camo","weapon"],
- ["G36C","weapon"],
- ["G36C_camo","weapon"],
- ["G36K","weapon"],
- ["G36K_camo","weapon"],
- ["M16A2","weapon"],
- ["M16A2GL","weapon"],
- ["M4A1","weapon"],
- ["M4A1_Aim","weapon"],
- ["M4A1_Aim_camo","weapon"],
- ["SCAR_L_CQC","weapon"],
- ["MP5A5","weapon"],
- ["M1014","weapon"],
- ["Remington870_lamp","weapon"],
- ["Winchester1866","weapon"],
- // Snipers
- ["DMR","weapon"],
- ["M4SPR","weapon"],
- // Backpacks
- ["DZ_British_ACU","object"],
- ["DZ_CivilBackpack_EP1","object"],
- // Special
- ["Skin_Camo1_DZ","magazine"],
- ["Skin_Sniper1_DZ","magazine"],
- // Building Mats
- ["ItemSandbag","magazine"],
- ["ItemTankTrap","magazine"]
- ];
- _itemChance = [ //Military
- // General
- 0.05, // Medical
- 0.03, // General
- 2.00, // Military
- // Equipment
- 0.05, // Binocular
- 0.04, // Military Flashlight
- 0.05, // Knife
- 0.01, // GPS
- 0.05, // Map
- 0.05, // Entrenching
- // Secondary Weapons
- 0.04, // G17
- 0.04, // M9
- 0.01, // M9 SD
- 0.03, // PDW
- // Primary Weapons
- 0.04, // AK 47
- 0.03, // AKS
- 0.04, // AKS 74
- 0.02, // AKS 74 Kobra
- 0.04, // AKS 74 U
- 0.04, // G36
- 0.02, // G36 Camo
- 0.03, // G36C
- 0.02, // G36C Camo
- 0.02, // G36K
- 0.01, // G36K Camo
- 0.04, // M16A2
- 0.01, // M16A2 GL
- 0.04, // M4A1
- 0.02, // M4A1 CCO
- 0.01, // M4A1 CCO Camo
- 0.02, // SCAR L
- 0.04, // MP5A
- 0.05, // M1014
- 0.05, // R870
- 0.05, // 1866
- // Snipers
- 0.01, // DMR
- 0.01, // M4SPR
- // Backpacks
- 0.02, // British ACU
- 0.01, // Civil
- // Special
- 0.02, // Camo
- 0.01, //Guilie
- // Building Mats
- 0.02, // Sandbags
- 0.02 // Tank Trap
- ];
- };
- case "MilitarySpecial": {
- _itemTypes = [
- // General
- ["","medical"],
- ["","generic"],
- ["","military"],
- // Equipment
- ["NVGoggles","weapon"],
- ["Binocular","weapon"],
- ["ItemFlashlightRed","military"],
- ["ItemKnife","military"],
- ["ItemGPS","weapon"],
- ["ItemMap","military"],
- ["Binocular_Vector","military"],
- // Secondary Weapons
- ["UZI_EP1","weapon"],
- ["M9","weapon"],
- ["glock17_EP1","weapon"],
- ["M9SD","weapon"],
- ["revolver_gold_EP1","weapon"],
- ["MakarovSD","weapon"],
- // Primary Weapons
- ["M1014","weapon"],
- ["Remington870_lamp"],
- ["AK_107_kobra","weapon"],
- ["AK_107_GL_kobra","weapon"],
- ["AK_47_M","weapon"],
- ["AKS_74_kobra","weapon"],
- ["AKS_74_NSPU","weapon"],
- ["AKS_74_pso","weapon"],
- ["FN_FAL","weapon"],
- ["FN_FAL_ANPVS4","weapon"],
- ["M14_EP1","weapon"],
- ["G36A_camo","weapon"],
- ["G36C_camo","weapon"],
- ["G36_C_SD_camo","weapon"],
- ["G36K_camo","weapon"],
- ["G36K","weapon"],
- ["M16A2GL","weapon"],
- ["M16A4_GL","weapon"],
- ["M16A4_ACG_GL","weapon"],
- ["M16A4_ACG","weapon"],
- ["M4A1_HWS_GL_camo","weapon"],
- ["M4A1_RCO_GL","weapon"],
- ["M4A1_Aim","weapon"],
- ["M4A1_Aim_camo","weapon"],
- ["M4A1_Aim_SD_camo","weapon"],
- ["M4A3_RCO_GL_EP1","weapon"],
- ["M4A3_CCO_EP1","weapon"],
- ["SCAR_L_CQC","weapon"],
- ["SCAR_L_CQC_CCO_SD","weapon"],
- ["SCAR_H_CQC_CCO","weapon"],
- ["MP5SD","weapon"],
- // Snipers
- ["M107","weapon"],
- ["DMR","weapon"],
- ["M24","weapon"],
- ["M40A3","weapon"],
- ["M4SPR","weapon"],
- ["SVD","weapon"],
- ["SVD_CAMO","weapon"],
- // Backpacks
- ["DZ_British_ACU","object"],
- ["DZ_CivilBackpack_EP1","object"],
- ["DZ_Backpack_EP1","object"],
- // Special
- ["AmmoBoxSmall_556","object"],
- ["AmmoBoxSmall_762","object"],
- ["100Rnd_762x54_PK","magazine"],
- ["Skin_Camo1_DZ","magazine"],
- ["Skin_Sniper1_DZ","magazine"]
- ];
- _itemChance = [ //Heavy Military
- // General
- 0.05, // Medical
- 0.05, // General
- 3.00, // Militray
- // Equipment
- 0.01, // NVG
- 0.05, // Binocular
- 0.04, // Flashlight
- 0.05, // Knife
- 0.01, // GPS
- 0.05, // Map
- 0.01, // Range Finder
- // Secondary Weapons
- 0.05, // PDW
- 0.05, // M9
- 0.05, // G17
- 0.01, // M9SD
- 0.01, // LOL
- 0.01, // Makarov SD
- // Primary Weapons
- 0.04, // M1017
- 0.04, // R870
- 0.04, // AK 107 Kobr
- 0.02, // AK 107 GL Kobra
- 0.03, // AKM
- 0.04, // AK74 Kobra
- 0.02, // AKS NSPU
- 0.02, // AKS pso
- 0.02, // FN FAL
- 0.01, // FN FAL NVG
- 0.02, // M14
- 0.03, // G36A Camo
- 0.03, // G36C Camo
- 0.01, // G36C SD Camo
- 0.02, // G36K Camo
- 0.02, // G36K
- 0.02, // M16A2 GL
- 0.01, // M16A4 GL
- 0.01, // M16A4 ACG GL
- 0.01, // M16A4 ACG
- 0.01, // M4A1 HWS GL Camo
- 0.01, // M4A1 RCO GL
- 0.04, // M4A1 CCO
- 0.02, // M4A1 CCO Camo
- 0.01, // M4A1 CCO SD Camo
- 0.01, // M4A3 RCG GL EP1
- 0.02, // M4A3 CCO EP1
- 0.03, // SCAR L
- 0.01, // SCAR L CCO SD
- 0.02, // SCAR H CCO
- 0.01, // MP5SD
- // Snipers
- 0.01, // M107
- 0.01, // DMR
- 0.005, // M24
- 0.005, // M40A3
- 0.005, // M4SPR
- 0.005, // SVD
- 0.005, // SVD Camo
- // Backpacks
- 0.02, // British ACU
- 0.01, // Civil
- 0.01, // DZ Backpack
- // Special
- 0.04, // Ammo Box 556
- 0.04, // Ammo Box 762
- 0.02, // 100 RD 762
- 0.01, // Camo
- 0.01 // Guilie
- ];
- };
- case "Hunting": {
- _itemTypes = [
- // General
- ["","military"],
- ["","hunter"],
- // Equipment
- ["ItemMap","weapon"],
- ["ItemFlashlight","generic"],
- ["ItemKnife","generic"],
- ["ItemMatchbox","generic"],
- // Secondary Weapons
- ["revolver_EP1","weapon"],
- // Primary Weapons
- ["Crossbow_DZ","weapon"],
- ["M1014","weapon"],
- ["Remington870_lamp","weapon"],
- ["Winchester1866","weapon"],
- ["huntingrifle","weapon"],
- ["FN_FAL","weapon"],
- ["M14_EP1","weapon"]
- ];
- _itemChance = [ // Deerstands
- // General
- 2.00, // Military
- 4.00, // Hunting
- // Equipment
- 0.05, // Map
- 0.05, // Flashlight
- 0.04, // Knife
- 0.04, // Matches
- // Secondary Weapons
- 0.03, // Revolver
- // Primary Weapons
- 0.15, // Crossbow
- 0.04, // M1014
- 0.04, // R870
- 0.05, // Winchester 1866
- 0.05, // Hunting Rifle
- 0.01, // FN FAL
- 0.01 // M14
- ];
- };
- };
- //------------------//
- //CUSTOM LOOT SPAWNS//
- //------------------//
- {
- if ((random 1) < _lootChance) then {
- _iPos = _obj modelToWorld _x;
- _nearBy = nearestObjects [_iPos, ["WeaponHolder","WeaponHolderBase"], 1];
- if (count _nearBy == 0) then {
- private["_index"];
- _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
- _index = _weights call BIS_fnc_selectRandom;
- _itemType = _itemTypes select _index;
- [_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot;
- };
- };
- } forEach _positions;
- // == Residential ===================================== */
- case "Land_HouseV_1I4": { _LootClass = "Residential"; };
- case "Land_kulna": { _LootClass = "Residential"; };
- case "Land_hut06": { _LootClass = "Residential"; };
- case "Land_Hlidac_budka": { _LootClass = "Residential"; };
- case "Land_HouseV2_02_Interier": { _LootClass = "Residential"; };
- case "Land_A_Pub_01": { _LootClass = "Residential"; };
- case "Land_Shed_wooden": { _LootClass = "Residential"; };
- case "Land_HouseBlock_A1_1": { _LootClass = "Residential"; };
- case "Land_A_MunicipalOffice": { _LootClass = "Residential"; };
- case "Land_ruin_01": { _LootClass = "Residential"; };
- case "Land_HouseV2_04_interier": { _LootClass = "Residential"; };
- case "Land_HouseV2_01A": { _LootClass = "Residential"; };
- case "Land_psi_bouda": { _LootClass = "Residential"; };
- case "Land_KBud": { _LootClass = "Residential"; };
- case "Land_A_Castle_Bergfrit": { _LootClass = "Residential"; };
- case "Land_A_Castle_Stairs_A": { _LootClass = "Residential"; };
- case "Land_A_Castle_Gate": { _LootClass = "Residential"; };
- case "Land_sara_domek_zluty": { _LootClass = "Residential"; };
- case "Land_Church_01": { _LootClass = "Residential"; };
- case "Land_Church_03": { _LootClass = "Residential"; };
- case "Land_HouseB_Tenement": { _LootClass = "Residential"; };
- case "Land_Panelak": { _LootClass = "Residential"; };
- case "Land_Panelak2": { _LootClass = "Residential"; };
- case "Land_rail_station_big": { _LootClass = "Residential"; };
- case "Land_A_Office01": { _LootClass = "Residential"; };
- case "Land_A_Office02": { _LootClass = "Residential"; };
- // == Industrial ====================================== */
- case "Land_Ind_Workshop01_04": { _LootClass = "Industrial"; };
- case "Land_Ind_Workshop01_01": { _LootClass = "Industrial"; };
- case "Land_Ind_Garage01": { _LootClass = "Industrial"; };
- case "Land_Ind_Workshop01_02": { _LootClass = "Industrial"; };
- case "Land_Ind_Workshop01_L": { _LootClass = "Industrial"; };
- case "Land_Hangar_2": { _LootClass = "Industrial"; };
- case "Land_A_FuelStation_Build": { _LootClass = "Industrial"; };
- case "Land_Shed_Ind02": { _LootClass = "Industrial"; };
- case "Land_Misc_PowerStation": { _LootClass = "Industrial"; };
- case "Land_Shed_W01": { _LootClass = "Industrial"; };
- case "Land_Tovarna2": { _LootClass = "Industrial"; };
- case "Land_Ind_Vysypka": { _LootClass = "Industrial"; };
- case "Land_A_BuildingWIP": { _LootClass = "Industrial"; };
- case "Land_A_TVTower_Base": { _LootClass = "Industrial"; };
- case "Land_Misc_Cargo1Ao": { _LootClass = "Industrial"; };
- case "Land_Misc_Cargo1Bo": { _LootClass = "Industrial"; };
- case "Land_Nav_Boathouse": { _LootClass = "Industrial"; };
- case "Land_wagon_box": { _LootClass = "Industrial"; };
- case "Land_Rail_House_01": { _LootClass = "Industrial"; };
- // == Farm ============================================ */
- case "Land_stodola_old_open": { _LootClass = "Farm"; };
- case "Land_Farm_Cowshed_a": { _LootClass = "Farm"; };
- case "Land_stodola_open": { _LootClass = "Farm"; };
- case "Land_Barn_W_01": { _LootClass = "Farm"; };
- case "Land_Barn_W_02": { _LootClass = "Farm"; };
- // == Supermarket ===================================== */
- case "Land_A_GeneralStore_01a": { _LootClass = "Supermarket"; };
- case "Land_A_GeneralStore_01": { _LootClass = "Supermarket"; };
- // == Hospital ======================================== */
- case "Land_A_Hospital": { _LootClass = "Hospital"; };
- case "MASH": { _LootClass = "Hospital"; };
- case "MASH_EP1": { _LootClass = "Hospital"; };
- case "USMC_WarfareBFieldhHospital": { _LootClass = "Hospital"; };
- // == Hunting ========================================= */
- case "Land_Misc_deerstand": { _LootClass = "Hunting"; _lootChance = 0.8; };
- // == Military ======================================== */
- case "Land_a_stationhouse": { _LootClass = "Military"; _lootChance = 0.8; };
- case "Land_Mil_ControlTower": { _LootClass = "Military"; _lootChance = 0.8; };
- case "Land_SS_hangar": { _LootClass = "Military"; _lootChance = 0.8; };
- case "Land_Mil_House": { _LootClass = "Military"; _lootChance = 0.8; };
- case "Camp": { _LootClass = "Military"; _lootChance = 0.8; };
- case "CampEast_EP1": { _LootClass = "Military"; _lootChance = 0.8; };
- // == Military Special ================================ */
- case "Land_Mil_Barracks_i": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
- case "CampEast": { _LootClass = "MilitarySpecial"; _lootChance = 1; };
- default { _LootClass = "Residential"; };
- };
- switch (_LootClass) do { //Find correct loot
- case "Residential": {
- _itemTypes = [
- //General
- ["ItemSodaMdew","magazine"],
- ["","generic"],
- ["","military"],
- ["","trash"],
- ["WeaponHolder_ItemTent","object"],
- //Equipment
- ["ItemWatch","generic"],
- ["ItemCompass","generic"],
- ["ItemMap","weapon"],
- ["ItemFlashlight","generic"],
- ["ItemKnife","generic"],
- ["ItemMatchbox","generic"],
- ["Binocular","weapon"],
- ["PartWoodPile","magazine"],
- ["WeaponHolder_ItemCrowbar","object"],
- ["WeaponHolder_ItemHatchet","object"],
- ["WeaponHolder_ItemMachete","object"],
- // Secondary Weapons
- ["Colt1911","weapon"],
- ["Makarov","weapon"],
- ["MakarovSD","weapon"],
- // Primary Weapons
- ["MR43","weapon"],
- ["Winchester1866","weapon"],
- ["Crossbow_DZ","weapon"],
- // Back Packs
- ["DZ_Assault_Pack_EP1","object"],
- ["DZ_Czech_Vest_Puch","object"],
- ["DZ_ALICE_Pack_EP1","object"],
- // Special
- ["Skin_Camo1_DZ","magazine"],
- ["Skin_Survivor2_DZ","magazine"]
- // Building Mats
- ["ItemWire","magazine"],
- ["ItemTankTrap","magazine"],
- ["ItemSandbag","magazine"]
- ];
- _itemChance = [ //Residential
- // General
- 0.01, // Mountian Dew
- 2.00, // Generic
- 0.05, // Military
- 0.50, // Trash
- 0.02, // Tent
- // Equipment
- 0.05, // Watch
- 0.05, // Compass
- 0.05, // Map
- 0.05, // Flashlight
- 0.06, // Knife
- 0.06, // Matchbox
- 0.04, // Binocular
- 0.04, // Woodpile
- 0.04, // Crowbar
- 0.04, // Hatchet
- 0.02, // Machete
- // Secondary Weapons
- 0.02, // Colt 1911
- 0.03, // Makarov
- 0.01, // Makarov SD
- // Primary Weapons
- 0.05, // Double Bareled
- 0.01, // Winchester 1866
- 0.10, // Crossbow
- // Back Packs
- 0.05, // Assault Pack
- 0.03, // Czech Pack
- 0.01, // Alice Pack
- // Special
- 0.01, // Camo Clothing
- 0.01, // Civilian
- // Building Mats
- 0.03, // Wire Kit
- 0.03, // Tank Trap
- 0.02 // Sandbags
- ];
- };
- case "Industrial": {
- _itemTypes = [
- // General
- ["","generic"],
- ["","trash"],
- ["","military"],
- // Equipment
- ["WeaponHolder_ItemHatchet","object"],
- ["WeaponHolder_ItemMachete","object"],
- ["ItemKnife","military"],
- ["ItemToolbox","weapon"],
- // Primary Weapon
- ["Crossbow_DZ","weapon"],
- // Parts
- ["WeaponHolder_PartGeneric","object"],
- ["WeaponHolder_PartWheel","object"],
- ["WeaponHolder_PartFueltank","object"],
- ["WeaponHolder_PartEngine","object"],
- ["WeaponHolder_PartGlass","object"],
- ["WeaponHolder_PartVRotor","object"],
- ["WeaponHolder_ItemJerrycan","object"],
- // Building Mats
- ["ItemWire","magazine"],
- ["ItemTankTrap","magazine"],
- ["ItemSandbag","magazine"]
- ];
- _itemChance = [ //Industrial
- // General
- 0.18, // Generic
- 0.08, // Trash
- 0.30, // Military
- // Equipment
- 0.15, // Hatchet
- 0.10, // Machete
- 0.07, // Knife
- 0.03, // Toolbox
- // Primary Weapon
- 0.10, // Crossbow
- // Parts
- 0.04, // Generic Part
- 0.03, // Wheel
- 0.03, // Full tank
- 0.03, // Engine
- 0.03, // Glass
- 0.02, // Rotor
- 0.03, // Jerry Can
- //Building Mats
- 0.15, // Wirekit
- 0.15, // Tank trap
- 0.14 // Sandbag
- ];
- };
- case "Farm": {
- _itemTypes = [ //Farm
- // General
- ["","generic"],
- ["","trash"],
- // Equipment
- ["WeaponHolder_ItemHatchet","object"],
- ["WeaponHolder_ItemMachete","object"],
- ["ItemEtool","weapon"],
- // Secondary Weapons
- ["Colt1911","weapon"],
- ["revolver_EP1","weapon"],
- // Primary Weapons
- ["MR43","weapon"],
- ["M1014","weapon"],
- ["Remington870_lamp","weapon"],
- ["Huntingrifle","weapon"],
- ["Crossbow_DZ","weapon"],
- ["LeeEnfield","weapon"],
- // Backpacks
- ["DZ_Czech_Vest_Puch","object"],
- // Parts
- ["WeaponHolder_ItemJerrycan","object"],
- // Building Mats
- ["ItemWire","magazine"],
- ["PartWoodPile","magazine"]
- ];
- _itemChance = [
- // General
- 0.20, // Generic
- 0.10, // Trash
- // Equipment
- 0.15, // Hatchet
- 0.10, // Machete
- 0.13, // Entrenching
- // Secondary Weapons
- 0.12, // Colt 1911
- 0.13, // Revolver
- // Primary Weapons
- 0.10, // Double Barreled
- 0.15, // M1014
- 0.15, // R870
- 0.13, // Hunting Rifle
- 0.10, // Crossbow
- 0.13, // Lee Enfield
- // Backpacks
- 0.14, // Czech
- // Parts
- 0.12, // Jerry can
- // Building Mats
- 0.13, // Wire Kit
- 0.13 // Woodpile
- ];
- };
- case "Supermarket": {
- _itemTypes = [
- // General
- ["","generic"],
- ["","food"],
- ["","trash"],
- ["WeaponHolder_ItemTent","object"],
- // Equipment
- ["ItemWatch","generic"],
- ["ItemCompass","generic"],
- ["ItemMap","weapon"],
- ["ItemFlashlight","generic"],
- ["ItemKnife","generic"],
- ["ItemMatchbox","generic"],
- ["Binocular","weapon"],
- ["WeaponHolder_ItemHatchet","object"],
- // Secondary Weapons
- ["Colt1911","weapon"],
- ["Makarov","weapon"],
- ["revolver_EP1","weapon"],
- // Primary Weapons
- ["Crossbow_DZ","weapon"],
- ["MR43","weapon"],
- // Backpacks
- ["DZ_Assault_Pack_EP1","object"],
- ["DZ_Czech_Vest_Puch","object"],
- ["DZ_TK_Assault_Pack_EP1","object"],
- // Building Mats
- ["PartWoodPile","magazine"]
- ];
- _itemChance = [ //Super Market
- // General
- 0.05, // Generic
- 2.00, // Food
- 0.10, // Trash
- 0.03, // Tent
- // Equipmnet
- 0.15, // Watch
- 0.14, // Compass
- 0.14, // Map
- 0.15, // Flashlight
- 0.15, // Knife
- 0.15, // Matches
- 0.14, // Binoculars
- 0.18, // Hatchet
- // Secondary Weapons
- 0.13, // Colt 1911
- 0.15, // Makarov
- 0.13, // Revolver
- // Primary Weapons
- 0.19, // Crossbow
- 0.18, // Double Barreled
- // Backpacks
- //0.14, // Assault
- 0.13, // Czech
- 0.11, // TK Assault
- // Building Mats
- 0.03 // Woodpile
- ];
- };
- case "Hospital": {
- _itemTypes = [
- ["","trash"],
- ["","hospital"],
- ["MedBox0","object"],
- ["AKS_74","weapon"],
- ];
- _itemChance = [
- 0.20, // Trash
- 0.75, // Hospital
- 0.15, // Medical Box
- 0.09 // AKS 74
- ];
- };
- case "Military": {
- _itemTypes = [
- // General
- ["","medical"],
- ["","generic"],
- ["","military"],
- // Equipment
- ["Binocular","weapon"],
- ["ItemFlashlightRed","military"],
- ["ItemKnife","military"],
- ["ItemGPS","weapon"],
- ["ItemMap","military"],
- ["ItemEtool","weapon"],
- // Secondary Weapons
- ["glock17_EP1","weapon"],
- ["M9","weapon"],
- ["M9SD","weapon"],
- ["UZI_EP1","weapon"],
- // Primary Weapons
- ["AK_47_S","weapon"],
- ["AKS_74","weapon"],
- ["AKS_74_kobra","weapon"],
- ["AKS_74_U","weapon"],
- ["G36a","weapon"],
- ["G36A_camo","weapon"],
- ["G36C","weapon"],
- ["G36C_camo","weapon"],
- ["G36K","weapon"],
- ["G36K_camo","weapon"],
- ["M16A2","weapon"],
- ["M16A2GL","weapon"],
- ["M4A1","weapon"],
- ["M4A1_Aim","weapon"],
- ["M4A1_Aim_camo","weapon"],
- ["SCAR_L_CQC","weapon"],
- ["MP5A5","weapon"],
- ["M1014","weapon"],
- ["Remington870_lamp","weapon"],
- ["Winchester1866","weapon"],
- // Snipers
- ["DMR","weapon"],
- ["M4SPR","weapon"],
- // Backpacks
- ["DZ_British_ACU","object"],
- ["DZ_CivilBackpack_EP1","object"],
- ["DZ_Backpack_EP1","object"],
- // Special
- ["Skin_Camo1_DZ","magazine"],
- ["Skin_Sniper1_DZ","magazine"],
- ["Skin_Soldier1_DZ","magazine"],
- // Building Mats
- ["ItemSandbag","magazine"],
- ["ItemTankTrap","magazine"]
- ];
- _itemChance = [ //Military
- // General
- 0.15, // Medical
- 0.13, // General
- 2.10, // Military
- // Equipment
- 0.15, // Binocular
- 0.14, // Military Flashlight
- 0.15, // Knife
- 0.11, // GPS
- 0.15, // Map
- 0.15, // Entrenching
- // Secondary Weapons
- 0.14, // G17
- 0.14, // M9
- 0.11, // M9 SD
- 0.13, // PDW
- // Primary Weapons
- 0.13, // AKS
- 0.14, // AKS 74
- 0.12, // AKS 74 Kobra
- 0.14, // AKS 74 U
- 0.14, // G36
- 0.12, // G36 Camo
- 0.13, // G36C
- 0.12, // G36C Camo
- 0.12, // G36K
- 0.11, // G36K Camo
- 0.14, // M16A2
- 0.11, // M16A2 GL
- 0.14, // M4A1
- 0.12, // M4A1 CCO
- 0.11, // M4A1 CCO Camo
- 0.12, // SCAR L
- 0.14, // MP5A
- 0.15, // M1014
- 0.15, // R870
- 0.15, // 1866
- // Snipers
- 0.11, // DMR
- 0.11, // M4SPR
- // Backpacks
- 0.12, // British ACU
- 0.11, // Civil
- 0.11, // DZ Backpack
- // Special
- 0.12, // Camo
- 0.11, // Guilie
- 0.12, // Soldier
- // Building Mats
- 0.12, // Sandbags
- 0.12 // Tank Trap
- ];
- };
- case "MilitarySpecial": {
- _itemTypes = [
- // General
- ["","medical"],
- ["","generic"],
- ["","military"],
- // Equipment
- ["NVGoggles","weapon"],
- ["Binocular","weapon"],
- ["ItemFlashlightRed","military"],
- ["ItemKnife","military"],
- ["ItemGPS","weapon"],
- ["ItemMap","military"],
- ["Binocular_Vector","military"],
- // Secondary Weapons
- ["UZI_EP1","weapon"],
- ["M9","weapon"],
- ["glock17_EP1","weapon"],
- ["M9SD","weapon"],
- ["revolver_gold_EP1","weapon"],
- ["MakarovSD","weapon"],
- // Primary Weapons
- ["M1014","weapon"],
- ["Remington870_lamp"],
- ["AK_107_kobra","weapon"],
- ["AK_107_GL_kobra","weapon"],
- ["AK_47_M","weapon"],
- ["AKS_74_kobra","weapon"],
- ["AKS_74_NSPU","weapon"],
- ["FN_FAL","weapon"],
- ["FN_FAL_ANPVS4","weapon"],
- ["M14_EP1","weapon"],
- ["G36A_camo","weapon"],
- ["G36C_camo","weapon"],
- ["G36K_camo","weapon"],
- ["G36K","weapon"],
- ["M16A2GL","weapon"],
- ["M16A4_GL","weapon"],
- ["M16A4_ACG_GL","weapon"],
- ["M16A4_ACG","weapon"],
- ["M4A1_HWS_GL_camo","weapon"],
- ["M4A1_RCO_GL","weapon"],
- ["M4A1_Aim","weapon"],
- ["M4A1_Aim_camo","weapon"],
- ["M4A1_Aim_SD_camo","weapon"],
- ["M4A3_RCO_GL_EP1","weapon"],
- ["M4A3_CCO_EP1","weapon"],
- ["SCAR_L_CQC","weapon"],
- ["SCAR_L_CQC_CCO_SD","weapon"],
- ["SCAR_H_CQC_CCO","weapon"],
- ["MP5SD","weapon"],
- // Snipers
- ["M107","weapon"],
- ["DMR","weapon"],
- ["M24","weapon"],
- ["M40A3","weapon"],
- ["M4SPR","weapon"],
- ["SVD_CAMO","weapon"],
- // Backpacks
- ["DZ_British_ACU","object"],
- ["DZ_CivilBackpack_EP1","object"],
- ["DZ_Backpack_EP1","object"],
- // Special
- ["AmmoBoxSmall_556","object"],
- ["AmmoBoxSmall_762","object"],
- ["100Rnd_762x54_PK","magazine"],
- ["Skin_Camo1_DZ","magazine"],
- ["Skin_Sniper1_DZ","magazine"],
- ["Skin_Soldier1_DZ","magazine"]
- ];
- _itemChance = [ //Heavy Military
- // General
- 0.05, // Medical
- 0.05, // General
- 3.00, // Militray
- // Equipment
- 0.01, // NVG
- 0.05, // Binocular
- 0.04, // Flashlight
- 0.05, // Knife
- 0.01, // GPS
- 0.05, // Map
- 0.01, // Range Finder
- // Secondary Weapons
- 0.15, // PDW
- 0.15, // M9
- 0.15, // G17
- 0.11, // M9SD
- 0.11, // LOL
- //5.00, // Makarov SD
- // Primary Weapons
- 0.14, // M1017
- 0.14, // R870
- 0.14, // AK 107 Kobra
- 5.12, // AK 107 GL Kobra
- 0.13, // AKM
- 0.14, // AK74 Kobra
- 5.12, // AKS NSPU
- 0.12, // FN FAL
- //0.11, // FN FAL NVG
- 0.12, // M14
- 5.03, // G36A Camo
- 5.03, // G36C Camo
- 5.02, // G36K Camo
- 0.12, // G36K
- 0.02, // M16A2 GL
- 0.01, // M16A4 GL
- 5.01, // M16A4 ACG GL
- 5.01, // M16A4 ACG
- 5.01, // M4A1 HWS GL Camo
- 5.01, // M4A1 RCO GL
- 0.04, // M4A1 CCO
- 0.02, // M4A1 CCO Camo
- 0.01, // M4A1 CCO SD Camo
- 5.01, // M4A3 RCG GL EP1
- 5.02, // M4A3 CCO EP1
- 0.03, // SCAR L
- 5.01, // SCAR L CCO SD
- 5.03, // SCAR H CCO
- 0.01, // MP5SD
- // Snipers
- 0.01, // M107
- 0.01, // DMR
- 0.005, // M24
- 5.005, // M40A3
- 5.005, // M4SPR
- 0.005, // SVD Camo
- // Backpacks
- 0.02, // British ACU
- 0.01, // Civil
- 0.01, // DZ Backpack
- // Special
- 0.04, // Ammo Box 556
- 0.04, // Ammo Box 762
- 0.02, // 100 RD 762
- 0.01, // Camo
- 0.01, // Guilie
- 0.02 // Soldier
- ];
- };
- case "Hunting": {
- _itemTypes = [
- // General
- ["","military"],
- ["","hunter"],
- // Equipment
- ["ItemMap","weapon"],
- ["ItemFlashlight","generic"],
- ["ItemKnife","generic"],
- ["ItemMatchbox","generic"],
- // Secondary Weapons
- ["revolver_EP1","weapon"],
- // Primary Weapons
- ["Crossbow_DZ","weapon"],
- ["M1014","weapon"],
- ["Remington870_lamp","weapon"],
- ["Winchester1866","weapon"],
- ["huntingrifle","weapon"],
- ["FN_FAL","weapon"],
- ["M14_EP1","weapon"]
- ];
- _itemChance = [ // Deerstands
- // General
- 2.00, // Military
- 4.00, // Hunting
- // Equipment
- 0.05, // Map
- 0.05, // Flashlight
- 0.04, // Knife
- 0.04, // Matches
- // Secondary Weapons
- 0.03, // Revolver
- // Primary Weapons
- 0.15, // Crossbow
- 0.04, // M1014
- 0.04, // R870
- 0.05, // Winchester 1866
- 0.05, // Hunting Rifle
- 0.01, // FN FAL
- 0.01 // M14
- ];
- };
- };
- //------------------//
- //CUSTOM LOOT SPAWNS//
- //------------------//
- {
- if ((random 1) < _lootChance) then {
- _iPos = _obj modelToWorld _x;
- _nearBy = nearestObjects [_iPos, ["WeaponHolder","WeaponHolderBase"], 1];
- if (count _nearBy == 0) then {
- private["_index"];
- _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
- _index = _weights call BIS_fnc_selectRandom;
- _itemType = _itemTypes select _index;
- [_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot;
- };
- };
- } forEach _positions;
Advertisement
Add Comment
Please, Sign In to add comment