Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Usage: [_crate,"type"] execVM "dir\DZMSBox.sqf";
- _crate is the crate to fill
- "type" is the type of crate
- "type" can be weapons or medical
- */
- _crate = _this select 0;
- _type = _this select 1;
- // Clear the current cargo
- clearWeaponCargoGlobal _crate;
- clearMagazineCargoGlobal _crate;
- // Define lists. Some lists are defined in DZMSWeaponCrateList.sqf in the ExtConfig.
- _bpackList = [
- "DZ_Patrol_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Czech_Vest_Puch","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU",
- "DZ_CivilBackpack_EP1","DZ_Backpack_EP1"
- ];
- _gshellList = [
- "1Rnd_HE_GP25","1Rnd_Smoke_GP25","1Rnd_SmokeGreen_GP25","1Rnd_SmokeRed_GP25","1Rnd_SmokeYellow_GP25",
- "6Rnd_HE_M203","BAF_ied_v1","FlareGreen_GP25","FlareRed_GP25","FlareWhite_GP25","FlareYellow_GP25",
- "SmokeShell","SmokeShellOrange","HandGrenade_west","FlareGreen_M203","FlareWhite_M203","FlareRed_M203","HandGrenade_east",
- "SmokeShellRed","SmokeShellGreen","SmokeShellPurple","SmokeShellBlue","SmokeShellYellow","1Rnd_SmokeRed_M203",
- "1Rnd_SmokeGreen_M203","1Rnd_Smoke_M203","1Rnd_SmokeYellow_M203","FlareYellow_M203","1Rnd_HE_M203","PipeBomb"
- ];
- _medical = [
- "ItemBandage","ItemMorphine","ItemEpinephrine","ItemPainkiller","ItemWaterbottle","FoodMRE","ItemAntibiotic","ItemBloodbag",
- "ItemHeatPack"
- ];
- _money = [
- "ItemSilverBar","ItemSilverBar10oz","ItemGoldBar","ItemGoldBar10oz"
- ];
- //////////////////////////////////////////////////////////////////
- //better switch code, could be optimized better tho
- switch(_type)do{
- case "medical":{
- // load medical
- _scount = count _medical;
- for "_x" from 0 to 40 do {
- _sSelect = floor(random _sCount);
- _item = _medical select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- };
- case "weapons":{
- // load grenades
- _scount = count _gshellList;
- _rnd=round(random 4);
- for "_x" from 0 to _rnd do {
- _sSelect = floor(random _sCount);
- _item = _gshellList select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 8))];
- };
- // load packs
- _scount = count _bpackList;
- _rnd=round(random 4);
- for "_x" from 0 to _rnd do {
- _sSelect = floor(random _sCount);
- _item = _bpackList select _sSelect;
- _crate addBackpackCargoGlobal [_item,1];
- };
- // load pistols
- _scount = count DZMSpistolList;
- _rnd=round(random 3);
- for "_x" from 0 to _rnd do {
- _sSelect = floor(random _sCount);
- _item = DZMSpistolList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- {
- _crate addMagazineCargoGlobal [_x,(round(random 8))];
- }forEach _ammo;
- // _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load sniper
- _scount = count DZMSsniperList;
- for "_x" from 0 to 1 do {
- _sSelect = floor(random _sCount);
- _item = DZMSsniperList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- {
- _crate addMagazineCargoGlobal [_x,(round(random 8))];
- }forEach _ammo;
- // _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load mg
- _scount = count DZMSmgList;
- for "_x" from 0 to 1 do {
- _sSelect = floor(random _sCount);
- _item = DZMSmgList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- {
- _crate addMagazineCargoGlobal [_x,(round(random 8))];
- }forEach _ammo;
- // _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load primary
- _scount = count DZMSprimaryList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSprimaryList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- {
- _crate addMagazineCargoGlobal [_x,(round(random 8))];
- }forEach _ammo;
- // _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- };
- case "supply":{
- // load tools
- _scount = count DZMSConTools;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConTools select _sSelect;
- _crate addWeaponCargoGlobal [_item, 1];
- };
- // load construction
- _scount = count DZMSConSupply;
- for "_x" from 0 to 30 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConSupply select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- };
- case "money":{
- // load money
- _scount = count _money;
- for "_x" from 0 to 3 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- };
- };
- //adding a some extra random loot with chance ["Item",25] = 25% chance for "Item" to be in box
- _rndtools=[
- ["ChainSaw",5],["ItemFlashlight",10],["ItemShovel",10],["ItemSledge",10],["ItemRadio",10],["ItemKeyKit",5],["ItemMap",10],
- ["ItemWatch",10],["ItemHatchet_DZE",10],["ItemMatchbox_DZE",10],["ItemEtool",5],["ItemKnife",10],["Binocular_Vector",2],
- ["NVGoggles",2],["ItemGPS",3],["ItemToolbox",10]
- ];
- _rndmags=[
- //skins
- ["Skin_Rocker2_DZ",15],["Skin_SurvivorW2_DZ",15],["Skin_Functionary1_EP1_DZ",15],["Skin_Haris_Press_EP1_DZ",15],
- ["Skin_Priest_DZ",15],["Skin_SurvivorWpink_DZ",15],["Skin_SurvivorWurban_DZ",15],["Skin_SurvivorWcombat_DZ",15],
- ["Skin_SurvivorWdesert_DZ",15],["Skin_Survivor2_DZ",15],["Skin_Rocker1_DZ",15],["Skin_Rocker3_DZ",15],
- ["Skin_RU_Policeman_DZ",15],["Skin_Pilot_EP1_DZ",15],["Skin_Rocker4_DZ",15],["Skin_Bandit1_DZ",15],["Skin_Bandit2_DZ",15],
- ["Skin_GUE_Commander_DZ",15],["Skin_GUE_Soldier_2_DZ",15],["Skin_GUE_Soldier_CO_DZ",15],["Skin_GUE_Soldier_Crew_DZ",15],
- ["Skin_GUE_Soldier_MG_DZ",15],["Skin_GUE_Soldier_Sniper_DZ",15],["Skin_Ins_Soldier_GL_DZ",15],
- ["Skin_TK_INS_Soldier_EP1_DZ",15],["Skin_TK_INS_Warlord_EP1_DZ",15],["Skin_BanditW1_DZ",15],["Skin_BanditW2_DZ",15],
- ["Skin_CZ_Special_Forces_GL_DES_EP1_DZ",15],["Skin_Drake_Light_DZ",15],["Skin_Soldier_Sniper_PMC_DZ",15],
- ["Skin_FR_OHara_DZ",15],["Skin_FR_Rodriguez_DZ",15],["Skin_CZ_Soldier_Sniper_EP1_DZ",15],["Skin_Graves_Light_DZ",15],
- ["Skin_Soldier_Bodyguard_AA12_PMC_DZ",15],["Skin_Camo1_DZ",15],["Skin_Rocket_DZ",15],["Skin_Sniper1_DZ",15],
- ["Skin_Soldier1_DZ",15],["Skin_Soldier_TL_PMC_DZ",15],
- //random stuff
- ["ItemCanvas",10],["ItemBurlap",10],["PartWoodLumber",10],["PartWoodPlywood",10],["ItemCopperBar10oz",5],["PartPlankPack",10],
- ["ItemSledgeHead",5],["ItemSledgeHandle",5],["20Rnd_B_AA12_74Slug",25],["20Rnd_B_AA12_Pellets",25],["20Rnd_B_AA12_HE",10],
- ["HandRoadFlare",10],["HandChemRed",20],["HandChemBlue",20],["HandChemGreen",20],["ItemTrashToiletpaper",25],["ItemOilBarrel",5],
- ["ItemSodaRabbit",10],["ItemSodaPepsi",10],["FoodCanFrankBeans",25],["FoodNutmix",20],["ItemSilverBar",5],["ItemCopperBar",5],
- ["ItemBronzeBar",5],["ItemAluminumBar",5],["PartOreSilver",5],["HandGrenade_Stone",10],["ItemTinBar",5],
- ["30Rnd_9x19_UZI_SD",25],["20Rnd_762x51_FNFAL",25],["TrapBear",10],["ItemFuelBarrel",5],["PartOreGold",5],["ItemKiloHemp",10],
- ["ItemSodaMdew",10],["ItemSodaSmasht",10],["FoodSteakCooked",25],["ItemSodaLvg",10],["ItemJerrycan",5],["PartEngine",5],
- ["TrashTinCan",20],["TrashJackDaniels",20],["FoodMRE",25],["ItemTentDomed",2],["ItemTentDomed2",2],["ItemTentOld",2],
- ["ItemBandage",35],["ItemMorphine",10],["ItemEpinephrine",10],["ItemPainkiller",25],["ItemAntibiotic",10],["ItemBloodbag",15],
- ["ItemHeatPack",20],["ItemWaterbottle",25],["ItemSodaCoke",10],["FoodCanBakedBeans",20],["PartGeneric",25],
- ["SmokeShellRed",20],["SmokeShellGreen",20],["SmokeShellPurple",20],["SmokeShellBlue",20],["SmokeShellYellow",20],
- ["1Rnd_SmokeRed_M203",20],["1Rnd_SmokeGreen_M203",20],["1Rnd_Smoke_M203",20],["30Rnd_545x39_AK",30],["20Rnd_762x51_B_SCAR",30],
- ["20Rnd_762x51_SB_SCAR",30],["100Rnd_762x51_M240",10],["20Rnd_762x51_DMR",30],["30Rnd_762x39_AK47",30]
- ];
- //adding a few extra special things with low chance
- //["Itemname",chn]
- _specialmaglist=[
- ["ItemWoodFloorHalf",33],["ItemWoodWallDoorLg",33],["ItemWoodWallLg",33],["ItemWoodWallWindowLg",33],
- ["ItemWoodFloorQuarter",33],["ItemWoodWallDoor",33],["ItemWoodWall",33],["ItemWoodWallWindow",33],["ItemWoodWallThird",33],
- ["ItemWoodLadder",33],["ItemWoodFloor",50],["ItemWoodStairs",33],["ItemSandbagLarge",50],["ItemPole",50],["ItemCorrugated",33],
- ["bulk_empty",50],["stick_fence_kit",50],["sandbag_nest_kit",50],["sun_shade_kit",33],["rusty_gate_kit",33],["ItemLightBulb",50],
- ["metal_panel_kit",33],["ItemFireBarrel_kit",33],["ItemGunRackKit",33],["metal_floor_kit",33],
- ["ItemSandbagExLarge",50],["MortarBucket",50],["CinderBlocks",50],["ItemSandbag",50],["ItemTankTrap",50],["ItemWire",50],
- ["ItemSilverBar10oz",50],["cinder_garage_kit",25],["cinder_door_kit",33],["ItemGenerator",50],["cinder_wall_kit",50],
- ["30m_plot_kit",33],["park_bench_kit",33],["wood_ramp_kit",25],["deer_stand_kit",33],["light_pole_kit",50],
- ["storage_shed_kit",50],["outhouse_kit",50],["ItemWoodStairsSupport",55],["ItemWoodWallWithDoorLocked",55],
- ["ItemWoodWallWithDoorLgLocked",55],["ItemWoodWallGarageDoorLocked",55],["ItemWoodWallGarageDoor",55],["wood_shack_kit",33],
- ["wooden_shed_kit",33],["desert_net_kit",25],["forest_net_kit",25],["desert_large_net_kit",25],["forest_large_net_kit",25],
- ["cinder_garage_kit",25],["cinder_door_kit",25],["30m_plot_kit",50],["ItemSandbagExLarge",50],["wood_ramp_kit",25],["Mine",10],
- ["MineE",10],["ItemHotwireKit",12],["HandGrenade_West",15],["HandGrenade_east",15],["Laserbatteries",5],
- ["ItemBriefcase100oz",10],["ItemGoldBar10oz",15],["ItemGoldBar",25]
- ];
- //["Itemname",chn]
- _specialweapslist=[
- ["Igla",5],["Strela",5],["SMAW",5],["RPG7V",5],["Stinger",5],["Laserdesignator",5],
- ["FN_FAL_ANPVS4",25],["BAF_AS50_Scoped",5],["m107",7.5],["M110_NVG_EP1",10],["ItemKeyKit",15],["KSVK_DZE",10],["AA12_PMC",25]
- ];
- //adding some extra fill to boxes that arent "medical","supply","money"
- if ((_type != "medical") and (_type != "supply") and (_type != "money")) then {
- //adding random trash/mags
- _rnd = floor(random 25);
- for "_x" from 0 to _rnd do{
- _rnditem = _rndmags call bis_fnc_selectrandom;
- _item = _rnditem select 0;
- _max = _rnditem select 1;
- _amt = (round(random _max));
- _crate addMagazineCargoGlobal [_item,_amt];
- // diag_log format ["[DZMS]: Added %3 %1 (max %2) to the box",_item,_max,_amt];
- };
- //adding random tools/weapons
- _rnd = floor(random 5);
- for "_x" from 0 to _rnd do{
- _rnditem = _rndtools call bis_fnc_selectrandom;
- _item = _rnditem select 0;
- _max = _rnditem select 1;
- _amt = (round(random _max));
- _crate addWeaponCargoGlobal [_item,_amt];
- // diag_log format ["[DZMS]: Added %3 %1 (max %2) to the box",_item,_max,_amt];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- {
- _crate addMagazineCargoGlobal [_x,(round(random 6))];
- }forEach _ammo;
- };
- };
- //adding some extra specials with low random chance
- for "_x" from 0 to 4 do {
- _rnd=floor(random 99);
- _magnchn = _specialmaglist call bis_fnc_selectrandom;
- _mag = _magnchn select 0;
- _mchn = _magnchn select 1;
- if(_rnd < _mchn)then{
- _amt = (round(random 4));
- _crate addMagazineCargoGlobal [_mag,_amt];
- // diag_log format ["[DZMS]: Added Special %3 %1 (%2%4 chance) to the box",_mag,_mchn,_amt,"%"];
- };
- _rnd=floor(random 99);
- _weapnchn = _specialweapslist call bis_fnc_selectrandom;
- _weap = _weapnchn select 0;
- _wchn = _weapnchn select 1;
- if(_rnd < _wchn)then{
- _amt = (round(random 2));
- _crate addWeaponCargoGlobal [_weap,_amt];
- // diag_log format ["[DZMS]: Added Special %1 (%2%3 chance) to the box",_weap,_wchn,"%"];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _weap >> "magazines");
- if (count _ammo > 0) then {
- {
- _crate addMagazineCargoGlobal [_x,(round(random 6))];
- }forEach _ammo;
- };
- };
- };
- };
- /*
- //////////////////////////////////////////////////////////////////
- // Medical Crates
- if (_type == "medical") then {
- // load medical
- _scount = count _medical;
- for "_x" from 0 to 40 do {
- _sSelect = floor(random _sCount);
- _item = _medical select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Weapon Crates
- if (_type == "weapons") then {
- // load grenades
- _scount = count _gshellList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = _gshellList select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load packs
- _scount = count _bpackList;
- for "_x" from 0 to 3 do {
- _sSelect = floor(random _sCount);
- _item = _bpackList select _sSelect;
- _crate addBackpackCargoGlobal [_item,1];
- };
- // load pistols
- _scount = count DZMSpistolList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSpistolList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load sniper
- _scount = count DZMSsniperList;
- for "_x" from 0 to 1 do {
- _sSelect = floor(random _sCount);
- _item = DZMSsniperList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load mg
- _scount = count DZMSmgList;
- for "_x" from 0 to 1 do {
- _sSelect = floor(random _sCount);
- _item = DZMSmgList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load primary
- _scount = count DZMSprimaryList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSprimaryList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Epoch Supply Crates
- if (_type == "supply") then {
- // load tools
- _scount = count DZMSConTools;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConTools select _sSelect;
- _crate addWeaponCargoGlobal [_item, 1];
- };
- // load construction
- _scount = count DZMSConSupply;
- for "_x" from 0 to 30 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConSupply select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Epoch Money Crates
- if (_type == "money") then {
- // load money
- _scount = count _money;
- for "_x" from 0 to 3 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- };
- */
Advertisement
Add Comment
Please, Sign In to add comment