Merge branch 'Feature/1109'

Conflicts:
	SQF/dayz_code/Configs/CfgBuildingLoot/CfgBuildingLoot.hpp
	SQF/dayz_code/Configs/CfgBuildingLoot/CfgLootSmall.hpp
	SQF/dayz_code/Configs/CfgBuildingLoot/cfgLoot.hpp
This commit is contained in:
Florian Kinder
2014-02-15 14:14:50 +01:00
6 changed files with 1294 additions and 2634 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,585 +1,272 @@
class CfgLootSmall {
trash[] = {
{
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemTrashToiletpaper",
"ItemTrashRazor"
},
{
0.5,
0.05,
0.25,
0.10,
0.1
}
{"TrashTinCan",0.5}
,{"TrashJackDaniels",0.05}
,{"ItemSodaEmpty",0.25}
,{"ItemTrashToiletpaper",0.1}
,{"ItemTrashRazor",0.1}
};
civilian[] = {
{
"FoodCanUnlabeled",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"8Rnd_9x18_Makarov",
"7Rnd_45ACP_1911",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"ItemBandage",
"ItemPainkiller",
"FoodBioMeat",
"8Rnd_9x18_MakarovSD"
},
{
0.07,
0.09,
0.09,
0.1,
0.09,
0.05,
0.05,
0.05,
0.05,
0.07,
0.05,
0.05,
0.05,
0.06,
0.06,
0.01,
0.01
}
{"FoodCanUnlabeled",0.07}
,{"TrashJackDaniels",0.09}
,{"ItemSodaEmpty",0.09}
,{"ItemSodaCoke",0.1}
,{"ItemSodaPepsi",0.09}
,{"FoodCanBakedBeans",0.05}
,{"FoodCanSardines",0.05}
,{"FoodCanFrankBeans",0.05}
,{"FoodCanPasta",0.05}
,{"8Rnd_9x18_Makarov",0.07}
,{"7Rnd_45ACP_1911",0.05}
,{"2Rnd_shotgun_74Slug",0.05}
,{"2Rnd_shotgun_74Pellets",0.05}
,{"ItemBandage",0.06}
,{"ItemPainkiller",0.06}
,{"FoodBioMeat",0.01}
,{"8Rnd_9x18_MakarovSD",0.01}
};
office2[] = {
{
"FoodCanUnlabeled",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"8Rnd_9x18_Makarov",
"7Rnd_45ACP_1911",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"ItemBandage",
"ItemPainkiller",
"FoodBioMeat",
"8Rnd_9x18_MakarovSD"
},
{
0.07,
0.09,
0.09,
0.09,
0.09,
0.05,
0.05,
0.05,
0.05,
0.07,
0.05,
0.05,
0.05,
0.06,
0.06,
0.01,
0.01
}
{"FoodCanUnlabeled",0.07}
,{"TrashJackDaniels",0.09}
,{"ItemSodaEmpty",0.09}
,{"ItemSodaCoke",0.09}
,{"ItemSodaPepsi",0.09}
,{"FoodCanBakedBeans",0.05}
,{"FoodCanSardines",0.05}
,{"FoodCanFrankBeans",0.05}
,{"FoodCanPasta",0.05}
,{"8Rnd_9x18_Makarov",0.07}
,{"7Rnd_45ACP_1911",0.05}
,{"2Rnd_shotgun_74Slug",0.05}
,{"2Rnd_shotgun_74Pellets",0.05}
,{"ItemBandage",0.06}
,{"ItemPainkiller",0.06}
,{"FoodBioMeat",0.01}
,{"8Rnd_9x18_MakarovSD",0.01}
};
food[] = {
{
//trash
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"FoodCanUnlabeled",
// food Bags
"FoodPistachio",
"FoodNutmix"
},
{
//trash
0.09,
0.12,
0.12,
0.09,
0.11,
0.07,
0.07,
0.07,
0.07,
0.1,
// food Bags
0.05,
0.04
}
{"TrashTinCan",0.09}
,{"TrashJackDaniels",0.12}
,{"ItemSodaEmpty",0.12}
,{"ItemSodaCoke",0.09}
,{"ItemSodaPepsi",0.11}
,{"FoodCanBakedBeans",0.07}
,{"FoodCanSardines",0.07}
,{"FoodCanFrankBeans",0.07}
,{"FoodCanPasta",0.07}
,{"FoodCanUnlabeled",0.1}
,{"FoodPistachio",0.05}
,{"FoodNutmix",0.04}
};
office[] = {
{
"FoodCanUnlabeled",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"TrashJackDaniels",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"ItemWaterbottleUnfilled",
"ItemWaterbottle",
"ItemBandage",
"7Rnd_45ACP_1911",
"5x_22_LR_17_HMR",
"10x_303",
"6Rnd_45ACP",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"8Rnd_9x18_Makarov",
"15Rnd_W1866_Slug",
"WoodenArrow",
"HandRoadFlare",
"ItemPainkiller",
"HandChemGreen",
"HandChemBlue",
"HandChemRed",
"ItemHeatPack"
},
{
0.06,
0.06,
0.06,
0.04,
0.04,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.08,
0.03,
0.01,
0.04,
0.04,
0.05,
0.05,
0.09,
0.02,
0.04,
0.07,
0.02,
0.01,
0.03,
0.03,
0.03
}
{"FoodCanUnlabeled",0.06}
,{"ItemSodaEmpty",0.06}
,{"ItemSodaCoke",0.06}
,{"ItemSodaPepsi",0.04}
,{"TrashJackDaniels",0.04}
,{"FoodCanBakedBeans",0.01}
,{"FoodCanSardines",0.01}
,{"FoodCanFrankBeans",0.01}
,{"FoodCanPasta",0.01}
,{"ItemWaterbottleUnfilled",0.01}
,{"ItemWaterbottle",0.01}
,{"ItemBandage",0.08}
,{"7Rnd_45ACP_1911",0.03}
,{"5x_22_LR_17_HMR",0.01}
,{"10x_303",0.04}
,{"6Rnd_45ACP",0.04}
,{"2Rnd_shotgun_74Slug",0.05}
,{"2Rnd_shotgun_74Pellets",0.05}
,{"8Rnd_9x18_Makarov",0.09}
,{"15Rnd_W1866_Slug",0.02}
,{"WoodenArrow",0.04}
,{"HandRoadFlare",0.07}
,{"ItemPainkiller",0.02}
,{"HandChemGreen",0.01}
,{"HandChemBlue",0.03}
,{"HandChemRed",0.03}
,{"ItemHeatPack",0.03}
};
generic[] = {
{
"FoodCanUnlabeled",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"TrashJackDaniels",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"ItemWaterbottleUnfilled",
"ItemWaterbottle",
"ItemBandage",
"7Rnd_45ACP_1911",
"5x_22_LR_17_HMR",
"10x_303",
"6Rnd_45ACP",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"8Rnd_9x18_Makarov",
"15Rnd_W1866_Slug",
"WoodenArrow",
"HandRoadFlare",
"ItemPainkiller",
"HandChemGreen",
"HandChemBlue",
"HandChemRed",
"ItemHeatPack"
},
{
0.06,
0.06,
0.06,
0.04,
0.04,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.11,
0.03,
0.01,
0.04,
0.04,
0.05,
0.05,
0.09,
0.02,
0.04,
0.07,
0.02,
0.01,
0.03,
0.03,
0.04
}
{"FoodCanUnlabeled",0.06}
,{"ItemSodaEmpty",0.06}
,{"ItemSodaCoke",0.06}
,{"ItemSodaPepsi",0.04}
,{"TrashJackDaniels",0.04}
,{"FoodCanBakedBeans",0.01}
,{"FoodCanSardines",0.01}
,{"FoodCanFrankBeans",0.01}
,{"FoodCanPasta",0.01}
,{"ItemWaterbottleUnfilled",0.01}
,{"ItemWaterbottle",0.01}
,{"ItemBandage",0.11}
,{"7Rnd_45ACP_1911",0.03}
,{"5x_22_LR_17_HMR",0.01}
,{"10x_303",0.04}
,{"6Rnd_45ACP",0.04}
,{"2Rnd_shotgun_74Slug",0.05}
,{"2Rnd_shotgun_74Pellets",0.05}
,{"8Rnd_9x18_Makarov",0.09}
,{"15Rnd_W1866_Slug",0.02}
,{"WoodenArrow",0.04}
,{"HandRoadFlare",0.07}
,{"ItemPainkiller",0.02}
,{"HandChemGreen",0.01}
,{"HandChemBlue",0.03}
,{"HandChemRed",0.03}
,{"ItemHeatPack",0.04}
};
medical[] = {
{
"ItemBandage",
"ItemPainkiller",
"ItemMorphine",
"ItemEpinephrine",
"ItemAntibiotic",
"ItemHeatPack"
},
{
0.4,
0.15,
0.2,
0.1,
0.1,
0.05
}
{"ItemBandage",0.4}
,{"ItemPainkiller",0.15}
,{"ItemMorphine",0.2}
,{"ItemEpinephrine",0.1}
,{"ItemAntibiotic",0.1}
,{"ItemHeatPack",0.05}
};
hospital[] = {
{
"ItemBandage",
"ItemPainkiller",
"ItemMorphine",
"ItemEpinephrine",
"ItemBloodbag",
"ItemAntibiotic"
},
{
0.33,
0.16,
0.13,
0.09,
0.17,
0.12
}
{"ItemBandage",0.33}
,{"ItemPainkiller",0.16}
,{"ItemMorphine",0.13}
,{"ItemEpinephrine",0.09}
,{"ItemBloodbag",0.17}
,{"ItemAntibiotic",0.12}
};
military[] = {
{
"FoodCanUnlabeled",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"ItemBandage",
"ItemAntibiotic",
"ItemPainkiller",
"ItemMorphine",
"30Rnd_556x45_Stanag",
"20Rnd_762x51_DMR",
"17Rnd_9x19_glock17",
"15Rnd_9x19_M9SD",
"15Rnd_9x19_M9",
"30Rnd_762x39_AK47",
"30Rnd_545x39_AK",
"5Rnd_762x51_M24",
"5Rnd_86x70_L115A1",
"8Rnd_B_Beneli_74Slug",
"1Rnd_HE_M203",
"FlareWhite_M203",
"FlareGreen_M203",
"1Rnd_Smoke_M203",
"200Rnd_556x45_M249",
"HandGrenade_west",
"HandGrenade_east",
"SmokeShell",
"SmokeShellRed",
"SmokeShellGreen",
"8Rnd_B_Beneli_Pellets",
"30Rnd_556x45_StanagSD",
"30Rnd_9x19_MP5",
"30Rnd_9x19_MP5SD",
"100Rnd_762x51_M240",
"HandChemGreen",
"HandChemBlue",
"HandChemRed",
"ItemHeatPack",
"8Rnd_9x18_MakarovSD",
"20Rnd_B_765x17_Ball",
"30Rnd_9x19_UZI_SD"
},
{
0.09,
0.04,
0.01,
0.01,
0.04,
0.04,
0.04,
0.01,
0.04,
0.04,
0.05,
0.01,
0.02,
0.04,
0.04,
0.01,
0.01,
0.04,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.04,
0.02,
0.02,
0.04,
0.01,
0.02,
0.01,
0.01,
0.02,
0.02,
0.02,
0.04,
0.01,
0.04,
0.01
}
{"FoodCanUnlabeled",0.09}
,{"ItemSodaEmpty",0.04}
,{"ItemSodaCoke",0.01}
,{"ItemSodaPepsi",0.01}
,{"ItemBandage",0.04}
,{"ItemAntibiotic",0.04}
,{"ItemPainkiller",0.04}
,{"ItemMorphine",0.01}
,{"30Rnd_556x45_Stanag",0.04}
,{"20Rnd_762x51_DMR",0.04}
,{"17Rnd_9x19_glock17",0.05}
,{"15Rnd_9x19_M9SD",0.01}
,{"15Rnd_9x19_M9",0.02}
,{"30Rnd_762x39_AK47",0.04}
,{"30Rnd_545x39_AK",0.04}
,{"5Rnd_762x51_M24",0.01}
,{"5Rnd_86x70_L115A1",0.01}
,{"8Rnd_B_Beneli_74Slug",0.04}
,{"1Rnd_HE_M203",0.01}
,{"FlareWhite_M203",0.01}
,{"FlareGreen_M203",0.01}
,{"1Rnd_Smoke_M203",0.01}
,{"200Rnd_556x45_M249",0.01}
,{"HandGrenade_west",0.01}
,{"HandGrenade_east",0.01}
,{"SmokeShell",0.04}
,{"SmokeShellRed",0.02}
,{"SmokeShellGreen",0.02}
,{"8Rnd_B_Beneli_Pellets",0.04}
,{"30Rnd_556x45_StanagSD",0.01}
,{"30Rnd_9x19_MP5",0.02}
,{"30Rnd_9x19_MP5SD",0.01}
,{"100Rnd_762x51_M240",0.01}
,{"HandChemGreen",0.02}
,{"HandChemBlue",0.02}
,{"HandChemRed",0.02}
,{"ItemHeatPack",0.04}
,{"8Rnd_9x18_MakarovSD",0.01}
,{"20Rnd_B_765x17_Ball",0.04}
,{"30Rnd_9x19_UZI_SD",0.01}
};
policeman[] = {
{
"ItemBandage",
"7Rnd_45ACP_1911",
"6Rnd_45ACP",
"15Rnd_W1866_Slug",
"8Rnd_B_Beneli_Pellets",
"HandRoadFlare",
"8Rnd_9x18_MakarovSD",
"ItemComboLock",
"SmokeShell",
"ItemHotwireKit"
},
{
0.3,
0.08,
0.08,
0.14,
0.17,
0.08,
0.01,
0.05,
0.04,
0.01
}
{"ItemBandage",0.3}
,{"7Rnd_45ACP_1911",0.08}
,{"6Rnd_45ACP",0.08}
,{"15Rnd_W1866_Slug",0.14}
,{"8Rnd_B_Beneli_Pellets",0.17}
,{"HandRoadFlare",0.08}
,{"8Rnd_9x18_MakarovSD",0.01}
,{"ItemComboLock",0.05}
,{"SmokeShell",0.04}
,{"ItemHotwireKit",0.01}
};
hunter[] = {
{
"FoodMRE"
},
{
0.01
}
{"FoodMRE",0.01}
};
worker[] = {
{
"FoodCanUnlabeled",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"ItemBandage",
"ItemPainkiller",
"ItemComboLock",
"ItemSledgeHead"
},
{
0.09,
0.10,
0.10,
0.11,
0.10,
0.06,
0.06,
0.06,
0.06,
0.1,
0.06,
0.04,
0.02
}
{"FoodCanUnlabeled",0.09}
,{"TrashJackDaniels",0.1}
,{"ItemSodaEmpty",0.1}
,{"ItemSodaCoke",0.11}
,{"ItemSodaPepsi",0.1}
,{"FoodCanBakedBeans",0.06}
,{"FoodCanSardines",0.06}
,{"FoodCanFrankBeans",0.06}
,{"FoodCanPasta",0.06}
,{"ItemBandage",0.1}
,{"ItemPainkiller",0.06}
,{"ItemComboLock",0.04}
,{"ItemSledgeHead",0.02}
};
clothes[] = {
{
"Skin_RU_Policeman_DZ",
"Skin_Pilot_EP1_DZ",
"Skin_Functionary1_EP1_DZ",
"Skin_Priest_DZ",
"Skin_Rocker1_DZ",
"Skin_Rocker2_DZ",
"Skin_Rocker3_DZ",
"Skin_Rocker4_DZ",
"Skin_SurvivorW3_DZ",
"Skin_SurvivorWpink_DZ",
"Skin_SurvivorWurban_DZ"
//"Skin_SurvivorWsequisha_DZ",
//"Skin_SurvivorWsequishaD_DZ",
},
{
0.13,
0.12,
0.1,
0.1,
0.07,
0.07,
0.08,
0.08,
0.09,
0.09,
0.07
//0.04,
//0.02
}
{"Skin_RU_Policeman_DZ",0.13}
,{"Skin_Pilot_EP1_DZ",0.12}
,{"Skin_Functionary1_EP1_DZ",0.1}
,{"Skin_Priest_DZ",0.1}
,{"Skin_Rocker1_DZ",0.07}
,{"Skin_Rocker2_DZ",0.07}
,{"Skin_Rocker3_DZ",0.08}
,{"Skin_Rocker4_DZ",0.08}
,{"Skin_SurvivorW3_DZ",0.09}
,{"Skin_SurvivorWpink_DZ",0.09}
,{"Skin_SurvivorWurban_DZ",0.07}
};
militaryclothes[] = {
{
"Skin_Camo1_DZ",
"Skin_Sniper1_DZ",
"Skin_Rocket_DZ",
"Skin_Soldier1_DZ",
"Skin_Drake_Light_DZ",
"Skin_Soldier_TL_PMC_DZ",
"Skin_Soldier_Sniper_PMC_DZ",
"Skin_Soldier_Bodyguard_AA12_PMC_DZ",
"Skin_CZ_Special_Forces_GL_DES_EP1_DZ",
"Skin_FR_OHara_DZ",
"Skin_FR_Rodriguez_DZ",
"Skin_CZ_Soldier_Sniper_EP1_DZ",
"Skin_Graves_Light_DZ"
},
{
0.1,
0.08,
0.05,
0.13,
0.07,
0.07,
0.05,
0.07,
0.08,
0.08,
0.09,
0.04,
0.09
}
{"Skin_Camo1_DZ",0.1}
,{"Skin_Sniper1_DZ",0.08}
,{"Skin_Rocket_DZ",0.05}
,{"Skin_Soldier1_DZ",0.13}
,{"Skin_Drake_Light_DZ",0.07}
,{"Skin_Soldier_TL_PMC_DZ",0.07}
,{"Skin_Soldier_Sniper_PMC_DZ",0.05}
,{"Skin_Soldier_Bodyguard_AA12_PMC_DZ",0.07}
,{"Skin_CZ_Special_Forces_GL_DES_EP1_DZ",0.08}
,{"Skin_FR_OHara_DZ",0.08}
,{"Skin_FR_Rodriguez_DZ",0.09}
,{"Skin_CZ_Soldier_Sniper_EP1_DZ",0.04}
,{"Skin_Graves_Light_DZ",0.09}
};
specialclothes[] = {
{
"Skin_Ins_Soldier_GL_DZ",
"Skin_GUE_Commander_DZ",
"Skin_Bandit1_DZ",
"Skin_Bandit2_DZ",
"Skin_BanditW1_DZ",
"Skin_BanditW2_DZ",
"Skin_TK_INS_Soldier_EP1_DZ",
"Skin_TK_INS_Warlord_EP1_DZ",
"Skin_SurvivorWcombat_DZ",
"Skin_SurvivorWdesert_DZ",
"Skin_GUE_Soldier_MG_DZ",
"Skin_GUE_Soldier_Sniper_DZ",
"Skin_GUE_Soldier_Crew_DZ",
"Skin_GUE_Soldier_CO_DZ",
"Skin_GUE_Soldier_2_DZ"
},
{
0.1,
0.08,
0.13,
0.06,
0.07,
0.07,
0.05,
0.07,
0.08,
0.08,
0.05,
0.04,
0.04,
0.04,
0.04
}
{"Skin_Ins_Soldier_GL_DZ",0.1}
,{"Skin_GUE_Commander_DZ",0.08}
,{"Skin_Bandit1_DZ",0.13}
,{"Skin_Bandit2_DZ",0.06}
,{"Skin_BanditW1_DZ",0.07}
,{"Skin_BanditW2_DZ",0.07}
,{"Skin_TK_INS_Soldier_EP1_DZ",0.05}
,{"Skin_TK_INS_Warlord_EP1_DZ",0.07}
,{"Skin_SurvivorWcombat_DZ",0.08}
,{"Skin_SurvivorWdesert_DZ",0.08}
,{"Skin_GUE_Soldier_MG_DZ",0.05}
,{"Skin_GUE_Soldier_Sniper_DZ",0.04}
,{"Skin_GUE_Soldier_Crew_DZ",0.04}
,{"Skin_GUE_Soldier_CO_DZ",0.04}
,{"Skin_GUE_Soldier_2_DZ",0.04}
};
machinegunammoexpl[] = {
{
"100Rnd_556x45_BetaCMag",
"75Rnd_545x39_RPK",
"100Rnd_556x45_M249",
"100Rnd_762x51_M240",
"100Rnd_762x54_PK",
"200Rnd_556x45_M249",
"MAAWS_HEAT",
"PipeBomb"
},
{
0.20,
0.20,
0.15,
0.15,
0.14,
0.14,
0.01,
0.01
}
{"100Rnd_556x45_BetaCMag",0.2}
,{"75Rnd_545x39_RPK",0.2}
,{"100Rnd_556x45_M249",0.15}
,{"100Rnd_762x51_M240",0.15}
,{"100Rnd_762x54_PK",0.14}
,{"200Rnd_556x45_M249",0.14}
,{"MAAWS_HEAT",0.01}
,{"PipeBomb",0.01}
};
pistols[] = {
{
"Makarov",
"Colt1911",
"revolver_EP1",
"glock17_EP1",
"MakarovSD",
"M9",
"M9SD",
"revolver_gold_EP1"
},
{
0.25,
0.23,
0.20,
0.10,
0.10,
0.07,
0.04,
0.01
}
{"Makarov",0.25}
,{"Colt1911",0.23}
,{"revolver_EP1",0.2}
,{"glock17_EP1",0.1}
,{"MakarovSD",0.1}
,{"M9",0.07}
,{"M9SD",0.04}
,{"revolver_gold_EP1",0.01}
};
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,127 +1,74 @@
private ["_config","_itemChances","_itemCount","_weighted","_j","_weight","_type","_canZombie","_canLoot","_classname","_itemChancesSmall","_itemCountSmall"];
private ["_weighted","_j"];
dayz_CBLChances = [];
dayz_CBLBase = [];
dayzE_CBLSChances = [];
dayzE_CBLSBase = [];
_config = [];
_config = configFile >> "CfgBuildingLoot";
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot";
} else {
_config = configFile >> "CfgBuildingLoot";
};
for "_i" from 0 to ((count _config) - 1) do {
_classname = toLower(configName (_config select _i));
_itemChances = [] + getArray (_config >> _classname >> "ItemChance");
_classname = configName (_config select _i);
_itemChances = getArray (_config >> _classname >> "lootType");
_itemCount = count _itemChances;
//diag_log format["Classname: %1, Array: %2, Amount: %3", _classname, _itemChances, _itemCount];
if (_itemCount > 0) then {
if (dayz_CBLBase find _classname < 0) then {
_weighted = [];
_j = 0;
for "_l" from 0 to ((count _itemChances) - 1) do {
_weight = round ((_itemChances select _l) * 100);
for "_k" from 0 to _weight - 1 do {
_weight = round (((_itemChances select _l) select 2) * 100);
for "_k" from 0 to (_weight - 1) do
{
_weighted set [_j + _k, _l];
};
_j = _j + _weight;
_j = _j + _weight;
};
dayz_CBLChances set [count dayz_CBLChances, _weighted];
dayz_CBLBase set [count dayz_CBLBase, _classname];
dayz_CBLChances set [count dayz_CBLChances, _weighted];
dayz_CBLBase set [count dayz_CBLBase, _classname];
};
} else {
dayz_CBLChances set [count dayz_CBLChances, [0]];
dayz_CBLBase set [count dayz_CBLBase, _classname];
};
_itemChancesSmall = [] + getArray (_config >> _classname >> "ItemChanceSmall");
_itemCountSmall = count _itemChancesSmall;
if (_itemCountSmall > 0) then {
if (dayzE_CBLSBase find _classname < 0) then {
_weighted = [];
_j = 0;
for "_l" from 0 to ((count _itemChancesSmall) - 1) do {
_weight = round ((_itemChancesSmall select _l) * 100);
for "_k" from 0 to _weight - 1 do {
_weighted set [_j + _k, _l];
};
_j = _j + _weight;
};
dayzE_CBLSChances set [count dayzE_CBLSChances, _weighted];
dayzE_CBLSBase set [count dayzE_CBLSBase, _classname];
};
} else {
dayzE_CBLSChances set [count dayzE_CBLSChances, [0]];
dayzE_CBLSBase set [count dayzE_CBLSBase, _classname];
};
};
dayz_CLChances = [];
dayz_CLBase = [];
//dayz_CLItemNames = [];
_config = [];
_config = configFile >> "cfgLoot";
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "cfgLoot";
} else {
_config = configFile >> "cfgLoot";
};
for "_i" from 0 to ((count (_config)) - 1) do {
_itemChances = (getArray (_config select _i)) select 1;
_classname = configName (_config select _i);
_itemChances = getArray (_config select _i);
_weighted = [];
_j = 0;
for "_l" from 0 to ((count _itemChances) - 1) do {
_weight = round ((_itemChances select _l) * 100);
for "_k" from 0 to _weight - 1 do {
_weight = round (((_itemChances select _l) select 1) * 100);
for "_k" from 0 to (_weight - 1) do {
_weighted set [_j + _k, _l];
//_items set [count _items, ((_itemChances select _l) select 0)];
};
_j = _j + _weight;
};
dayz_CLBase set [count dayz_CLBase, configName (_config select _i)];
dayz_CLChances set [count dayz_CLChances, _weighted];
dayz_CLBase set [count dayz_CLBase, _classname];
//dayz_CLItemNames set [count dayz_CLBase, _items];
dayz_CLChances set [count dayz_CLChances, _weighted];
//diag_log format["CFGLoot: %1, Array: %2", _classname, _items];
};
dayzE_CLSChances = [];
dayzE_CLSBase = [];
_config = [];
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "cfgLootSmall";
} else {
_config = configFile >> "cfgLootSmall";
};
for "_i" from 0 to ((count (_config)) - 1) do {
_itemChances = (getArray (_config select _i)) select 1;
_weighted = [];
_j = 0;
for "_l" from 0 to ((count _itemChances) - 1) do {
_weight = round ((_itemChances select _l) * 100);
for "_k" from 0 to _weight - 1 do {
_weighted set [_j + _k, _l];
};
_j = _j + _weight;
};
dayzE_CLSBase set [count dayzE_CLSBase, configName (_config select _i)];
dayzE_CLSChances set [count dayzE_CLSChances, _weighted];
};
private["_i","_type","_config","_canZombie","_canLoot"];
//diag_log ("BaseLoot: " +str(dayz_CLBase));
dayz_ZombieBuildings = [];
dayz_LootBuildings = [];
_config = [];
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot";
} else {
_config = configFile >> "CfgBuildingLoot";
};
for "_i" from 0 to (count (_config) - 1) do {
_type = _config select _i;
_canZombie = getNumber (_type >> "zombieChance") > 0;
_canLoot = getNumber (_type >> "lootChance") > 0;
for "_i" from 0 to (count (configFile >> "CfgBuildingLoot") - 1) do {
_type = (configFile >> "CfgBuildingLoot") select _i;
_canZombie = getNumber (_type >> "zombieChance") > 0;
_canLoot = getNumber (_type >> "lootChance") > 0;
if(_canZombie) then {
if(!((configName _type) in dayz_ZombieBuildings)) then {
dayz_ZombieBuildings set [count dayz_ZombieBuildings, configName _type];
@@ -133,3 +80,5 @@ for "_i" from 0 to (count (_config) - 1) do {
};
};
};
//diag_log format["ZombieBuildings: %1", dayz_ZombieBuildings];
//diag_log format["LootBuildings: %1", dayz_LootBuildings];

View File

@@ -0,0 +1,67 @@
use strict;
use warnings;
use Data::Dumper;
# Customize
my $configFile = '../../SQF/dayz_code/Configs/CfgBuildingLoot/CfgBuildingLoot.hpp';
# do not touch
my $cfg = '';
my $collect = 0;
my $small = 0;
my @itemType;
my @itemChance;
open(CFG, '<', $configFile) or die $!;
while (my $line = <CFG>) {
if ($line =~ /itemType(Small)?\[\]\s*=\s*\{\s*$/) {
$collect = 1;
@itemType = ();
if (defined($1) && $1) {
$small = 1;
}
else {
$small = 0;
}
}
elsif ($collect == 1 && $line =~ /^\s*\{\s*"(\w*)",\s*"(\w*)"\s*\}/i) {
push(@itemType, {
Class => $1
,Type => $2
});
}
elsif ($collect == 1 && $line =~ /\};/) {
$collect = 2;
}
elsif ($collect == 2 && $line =~ /itemChance(?:Small)?\[\]\s*=\s*\{/) {
$collect = 3;
@itemChance = ();
}
elsif ($collect == 3 && $line =~ /^\s*(\d+\.\d+),?/) {
push(@itemChance, $1);
}
elsif ($collect == 3 && $line =~ /\};/) {
$collect = 0;
$cfg .= "\t\titemChance[] = {\n" if $small == 0;
$cfg .= "\t\titemChanceSmall[] = {\n" if $small == 1;
for (my $i=0; $i<scalar(@itemType); $i++) {
$cfg .= sprintf("\t\t\t%s{\"%s\",\"%s\",%.2f}\n", ($i > 0 ? ',' : ''), $itemType[$i]->{Class}, $itemType[$i]->{Type}, $itemChance[$i]);
}
$cfg .= "\t\t};\n";
}
elsif ($line !~ /^\s*\/\// && $line !~ /^\s*$/) {
$cfg .= $line;
}
}
close(CFG);
$cfg =~ s/(\d+\.\d+)[0]+\}\s*$/$1}/gm;
open(NEWCFG,'>', $configFile) or die $!;
print NEWCFG $cfg;
close(NEWCFG);
exit(0);

View File

@@ -0,0 +1,52 @@
use strict;
use warnings;
use Data::Dumper;
# Customize
my $configFile = '../../SQF/dayz_code/Configs/CfgBuildingLoot/CfgLootSmall.hpp';
# do not touch
my $cfg = '';
my $collect = 0;
my $small = 0;
my @itemType;
my @itemChance;
open(CFG, '<', $configFile) or die $!;
while (my $line = <CFG>) {
if ($line =~ /^\s*(\w+)\[\]\s*=\s*\{/i) {
$collect = 1;
$cfg .= "\t".$1."[] = {\n";
}
elsif ($collect == 1 && $line =~ /^\s*"([^"]+)"/) {
push(@itemType, $1);
}
elsif ($collect == 1 && $line =~ /^\s*\},/) {
$collect = 2;
}
elsif ($collect == 2 && $line =~ /^\s*(\d+\.\d+),?/) {
push(@itemChance, $1);
}
elsif ($collect == 2 && $line =~ /^\t\}/) {
$collect = 0;
for (my $i=0; $i<scalar(@itemType); $i++) {
$cfg .= sprintf("\t\t%s{\"%s\",%.2f}\n", ($i > 0 ? ',' : ''), $itemType[$i], $itemChance[$i]);
}
@itemType = ();
@itemChance = ();
$cfg .= "\t};\n";
}
elsif ($collect == 0 && $line !~ /^\s*\/\// && $line !~ /^\s*$/) {
$cfg .= $line;
}
}
close(CFG);
$cfg =~ s/(\d+\.\d+)[0]+\}\s*$/$1}/gm;
open(NEWCFG,'>', $configFile) or die $!;
print NEWCFG $cfg;
close(NEWCFG);
exit(0);