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 { class CfgLootSmall {
trash[] = { trash[] = {
{ {"TrashTinCan",0.5}
"TrashTinCan", ,{"TrashJackDaniels",0.05}
"TrashJackDaniels", ,{"ItemSodaEmpty",0.25}
"ItemSodaEmpty", ,{"ItemTrashToiletpaper",0.1}
"ItemTrashToiletpaper", ,{"ItemTrashRazor",0.1}
"ItemTrashRazor"
},
{
0.5,
0.05,
0.25,
0.10,
0.1
}
}; };
civilian[] = { civilian[] = {
{ {"FoodCanUnlabeled",0.07}
"FoodCanUnlabeled", ,{"TrashJackDaniels",0.09}
"TrashJackDaniels", ,{"ItemSodaEmpty",0.09}
"ItemSodaEmpty", ,{"ItemSodaCoke",0.1}
"ItemSodaCoke", ,{"ItemSodaPepsi",0.09}
"ItemSodaPepsi", ,{"FoodCanBakedBeans",0.05}
"FoodCanBakedBeans", ,{"FoodCanSardines",0.05}
"FoodCanSardines", ,{"FoodCanFrankBeans",0.05}
"FoodCanFrankBeans", ,{"FoodCanPasta",0.05}
"FoodCanPasta", ,{"8Rnd_9x18_Makarov",0.07}
"8Rnd_9x18_Makarov", ,{"7Rnd_45ACP_1911",0.05}
"7Rnd_45ACP_1911", ,{"2Rnd_shotgun_74Slug",0.05}
"2Rnd_shotgun_74Slug", ,{"2Rnd_shotgun_74Pellets",0.05}
"2Rnd_shotgun_74Pellets", ,{"ItemBandage",0.06}
"ItemBandage", ,{"ItemPainkiller",0.06}
"ItemPainkiller", ,{"FoodBioMeat",0.01}
"FoodBioMeat", ,{"8Rnd_9x18_MakarovSD",0.01}
"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
}
}; };
office2[] = { office2[] = {
{ {"FoodCanUnlabeled",0.07}
"FoodCanUnlabeled", ,{"TrashJackDaniels",0.09}
"TrashJackDaniels", ,{"ItemSodaEmpty",0.09}
"ItemSodaEmpty", ,{"ItemSodaCoke",0.09}
"ItemSodaCoke", ,{"ItemSodaPepsi",0.09}
"ItemSodaPepsi", ,{"FoodCanBakedBeans",0.05}
"FoodCanBakedBeans", ,{"FoodCanSardines",0.05}
"FoodCanSardines", ,{"FoodCanFrankBeans",0.05}
"FoodCanFrankBeans", ,{"FoodCanPasta",0.05}
"FoodCanPasta", ,{"8Rnd_9x18_Makarov",0.07}
"8Rnd_9x18_Makarov", ,{"7Rnd_45ACP_1911",0.05}
"7Rnd_45ACP_1911", ,{"2Rnd_shotgun_74Slug",0.05}
"2Rnd_shotgun_74Slug", ,{"2Rnd_shotgun_74Pellets",0.05}
"2Rnd_shotgun_74Pellets", ,{"ItemBandage",0.06}
"ItemBandage", ,{"ItemPainkiller",0.06}
"ItemPainkiller", ,{"FoodBioMeat",0.01}
"FoodBioMeat", ,{"8Rnd_9x18_MakarovSD",0.01}
"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
}
}; };
food[] = { food[] = {
{ {"TrashTinCan",0.09}
//trash ,{"TrashJackDaniels",0.12}
"TrashTinCan", ,{"ItemSodaEmpty",0.12}
"TrashJackDaniels", ,{"ItemSodaCoke",0.09}
"ItemSodaEmpty", ,{"ItemSodaPepsi",0.11}
"ItemSodaCoke", ,{"FoodCanBakedBeans",0.07}
"ItemSodaPepsi", ,{"FoodCanSardines",0.07}
"FoodCanBakedBeans", ,{"FoodCanFrankBeans",0.07}
"FoodCanSardines", ,{"FoodCanPasta",0.07}
"FoodCanFrankBeans", ,{"FoodCanUnlabeled",0.1}
"FoodCanPasta", ,{"FoodPistachio",0.05}
"FoodCanUnlabeled", ,{"FoodNutmix",0.04}
// 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
}
}; };
office[] = { office[] = {
{ {"FoodCanUnlabeled",0.06}
"FoodCanUnlabeled", ,{"ItemSodaEmpty",0.06}
"ItemSodaEmpty", ,{"ItemSodaCoke",0.06}
"ItemSodaCoke", ,{"ItemSodaPepsi",0.04}
"ItemSodaPepsi", ,{"TrashJackDaniels",0.04}
"TrashJackDaniels", ,{"FoodCanBakedBeans",0.01}
"FoodCanBakedBeans", ,{"FoodCanSardines",0.01}
"FoodCanSardines", ,{"FoodCanFrankBeans",0.01}
"FoodCanFrankBeans", ,{"FoodCanPasta",0.01}
"FoodCanPasta", ,{"ItemWaterbottleUnfilled",0.01}
"ItemWaterbottleUnfilled", ,{"ItemWaterbottle",0.01}
"ItemWaterbottle", ,{"ItemBandage",0.08}
"ItemBandage", ,{"7Rnd_45ACP_1911",0.03}
"7Rnd_45ACP_1911", ,{"5x_22_LR_17_HMR",0.01}
"5x_22_LR_17_HMR", ,{"10x_303",0.04}
"10x_303", ,{"6Rnd_45ACP",0.04}
"6Rnd_45ACP", ,{"2Rnd_shotgun_74Slug",0.05}
"2Rnd_shotgun_74Slug", ,{"2Rnd_shotgun_74Pellets",0.05}
"2Rnd_shotgun_74Pellets", ,{"8Rnd_9x18_Makarov",0.09}
"8Rnd_9x18_Makarov", ,{"15Rnd_W1866_Slug",0.02}
"15Rnd_W1866_Slug", ,{"WoodenArrow",0.04}
"WoodenArrow", ,{"HandRoadFlare",0.07}
"HandRoadFlare", ,{"ItemPainkiller",0.02}
"ItemPainkiller", ,{"HandChemGreen",0.01}
"HandChemGreen", ,{"HandChemBlue",0.03}
"HandChemBlue", ,{"HandChemRed",0.03}
"HandChemRed", ,{"ItemHeatPack",0.03}
"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
}
}; };
generic[] = { generic[] = {
{ {"FoodCanUnlabeled",0.06}
"FoodCanUnlabeled", ,{"ItemSodaEmpty",0.06}
"ItemSodaEmpty", ,{"ItemSodaCoke",0.06}
"ItemSodaCoke", ,{"ItemSodaPepsi",0.04}
"ItemSodaPepsi", ,{"TrashJackDaniels",0.04}
"TrashJackDaniels", ,{"FoodCanBakedBeans",0.01}
"FoodCanBakedBeans", ,{"FoodCanSardines",0.01}
"FoodCanSardines", ,{"FoodCanFrankBeans",0.01}
"FoodCanFrankBeans", ,{"FoodCanPasta",0.01}
"FoodCanPasta", ,{"ItemWaterbottleUnfilled",0.01}
"ItemWaterbottleUnfilled", ,{"ItemWaterbottle",0.01}
"ItemWaterbottle", ,{"ItemBandage",0.11}
"ItemBandage", ,{"7Rnd_45ACP_1911",0.03}
"7Rnd_45ACP_1911", ,{"5x_22_LR_17_HMR",0.01}
"5x_22_LR_17_HMR", ,{"10x_303",0.04}
"10x_303", ,{"6Rnd_45ACP",0.04}
"6Rnd_45ACP", ,{"2Rnd_shotgun_74Slug",0.05}
"2Rnd_shotgun_74Slug", ,{"2Rnd_shotgun_74Pellets",0.05}
"2Rnd_shotgun_74Pellets", ,{"8Rnd_9x18_Makarov",0.09}
"8Rnd_9x18_Makarov", ,{"15Rnd_W1866_Slug",0.02}
"15Rnd_W1866_Slug", ,{"WoodenArrow",0.04}
"WoodenArrow", ,{"HandRoadFlare",0.07}
"HandRoadFlare", ,{"ItemPainkiller",0.02}
"ItemPainkiller", ,{"HandChemGreen",0.01}
"HandChemGreen", ,{"HandChemBlue",0.03}
"HandChemBlue", ,{"HandChemRed",0.03}
"HandChemRed", ,{"ItemHeatPack",0.04}
"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
}
}; };
medical[] = { medical[] = {
{ {"ItemBandage",0.4}
"ItemBandage", ,{"ItemPainkiller",0.15}
"ItemPainkiller", ,{"ItemMorphine",0.2}
"ItemMorphine", ,{"ItemEpinephrine",0.1}
"ItemEpinephrine", ,{"ItemAntibiotic",0.1}
"ItemAntibiotic", ,{"ItemHeatPack",0.05}
"ItemHeatPack"
},
{
0.4,
0.15,
0.2,
0.1,
0.1,
0.05
}
}; };
hospital[] = { hospital[] = {
{ {"ItemBandage",0.33}
"ItemBandage", ,{"ItemPainkiller",0.16}
"ItemPainkiller", ,{"ItemMorphine",0.13}
"ItemMorphine", ,{"ItemEpinephrine",0.09}
"ItemEpinephrine", ,{"ItemBloodbag",0.17}
"ItemBloodbag", ,{"ItemAntibiotic",0.12}
"ItemAntibiotic"
},
{
0.33,
0.16,
0.13,
0.09,
0.17,
0.12
}
}; };
military[] = { military[] = {
{ {"FoodCanUnlabeled",0.09}
"FoodCanUnlabeled", ,{"ItemSodaEmpty",0.04}
"ItemSodaEmpty", ,{"ItemSodaCoke",0.01}
"ItemSodaCoke", ,{"ItemSodaPepsi",0.01}
"ItemSodaPepsi", ,{"ItemBandage",0.04}
"ItemBandage", ,{"ItemAntibiotic",0.04}
"ItemAntibiotic", ,{"ItemPainkiller",0.04}
"ItemPainkiller", ,{"ItemMorphine",0.01}
"ItemMorphine", ,{"30Rnd_556x45_Stanag",0.04}
"30Rnd_556x45_Stanag", ,{"20Rnd_762x51_DMR",0.04}
"20Rnd_762x51_DMR", ,{"17Rnd_9x19_glock17",0.05}
"17Rnd_9x19_glock17", ,{"15Rnd_9x19_M9SD",0.01}
"15Rnd_9x19_M9SD", ,{"15Rnd_9x19_M9",0.02}
"15Rnd_9x19_M9", ,{"30Rnd_762x39_AK47",0.04}
"30Rnd_762x39_AK47", ,{"30Rnd_545x39_AK",0.04}
"30Rnd_545x39_AK", ,{"5Rnd_762x51_M24",0.01}
"5Rnd_762x51_M24", ,{"5Rnd_86x70_L115A1",0.01}
"5Rnd_86x70_L115A1", ,{"8Rnd_B_Beneli_74Slug",0.04}
"8Rnd_B_Beneli_74Slug", ,{"1Rnd_HE_M203",0.01}
"1Rnd_HE_M203", ,{"FlareWhite_M203",0.01}
"FlareWhite_M203", ,{"FlareGreen_M203",0.01}
"FlareGreen_M203", ,{"1Rnd_Smoke_M203",0.01}
"1Rnd_Smoke_M203", ,{"200Rnd_556x45_M249",0.01}
"200Rnd_556x45_M249", ,{"HandGrenade_west",0.01}
"HandGrenade_west", ,{"HandGrenade_east",0.01}
"HandGrenade_east", ,{"SmokeShell",0.04}
"SmokeShell", ,{"SmokeShellRed",0.02}
"SmokeShellRed", ,{"SmokeShellGreen",0.02}
"SmokeShellGreen", ,{"8Rnd_B_Beneli_Pellets",0.04}
"8Rnd_B_Beneli_Pellets", ,{"30Rnd_556x45_StanagSD",0.01}
"30Rnd_556x45_StanagSD", ,{"30Rnd_9x19_MP5",0.02}
"30Rnd_9x19_MP5", ,{"30Rnd_9x19_MP5SD",0.01}
"30Rnd_9x19_MP5SD", ,{"100Rnd_762x51_M240",0.01}
"100Rnd_762x51_M240", ,{"HandChemGreen",0.02}
"HandChemGreen", ,{"HandChemBlue",0.02}
"HandChemBlue", ,{"HandChemRed",0.02}
"HandChemRed", ,{"ItemHeatPack",0.04}
"ItemHeatPack", ,{"8Rnd_9x18_MakarovSD",0.01}
"8Rnd_9x18_MakarovSD", ,{"20Rnd_B_765x17_Ball",0.04}
"20Rnd_B_765x17_Ball", ,{"30Rnd_9x19_UZI_SD",0.01}
"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
}
}; };
policeman[] = { policeman[] = {
{ {"ItemBandage",0.3}
"ItemBandage", ,{"7Rnd_45ACP_1911",0.08}
"7Rnd_45ACP_1911", ,{"6Rnd_45ACP",0.08}
"6Rnd_45ACP", ,{"15Rnd_W1866_Slug",0.14}
"15Rnd_W1866_Slug", ,{"8Rnd_B_Beneli_Pellets",0.17}
"8Rnd_B_Beneli_Pellets", ,{"HandRoadFlare",0.08}
"HandRoadFlare", ,{"8Rnd_9x18_MakarovSD",0.01}
"8Rnd_9x18_MakarovSD", ,{"ItemComboLock",0.05}
"ItemComboLock", ,{"SmokeShell",0.04}
"SmokeShell", ,{"ItemHotwireKit",0.01}
"ItemHotwireKit"
},
{
0.3,
0.08,
0.08,
0.14,
0.17,
0.08,
0.01,
0.05,
0.04,
0.01
}
}; };
hunter[] = { hunter[] = {
{ {"FoodMRE",0.01}
"FoodMRE"
},
{
0.01
}
}; };
worker[] = { worker[] = {
{ {"FoodCanUnlabeled",0.09}
"FoodCanUnlabeled", ,{"TrashJackDaniels",0.1}
"TrashJackDaniels", ,{"ItemSodaEmpty",0.1}
"ItemSodaEmpty", ,{"ItemSodaCoke",0.11}
"ItemSodaCoke", ,{"ItemSodaPepsi",0.1}
"ItemSodaPepsi", ,{"FoodCanBakedBeans",0.06}
"FoodCanBakedBeans", ,{"FoodCanSardines",0.06}
"FoodCanSardines", ,{"FoodCanFrankBeans",0.06}
"FoodCanFrankBeans", ,{"FoodCanPasta",0.06}
"FoodCanPasta", ,{"ItemBandage",0.1}
"ItemBandage", ,{"ItemPainkiller",0.06}
"ItemPainkiller", ,{"ItemComboLock",0.04}
"ItemComboLock", ,{"ItemSledgeHead",0.02}
"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
}
}; };
clothes[] = { clothes[] = {
{ {"Skin_RU_Policeman_DZ",0.13}
"Skin_RU_Policeman_DZ", ,{"Skin_Pilot_EP1_DZ",0.12}
"Skin_Pilot_EP1_DZ", ,{"Skin_Functionary1_EP1_DZ",0.1}
"Skin_Functionary1_EP1_DZ", ,{"Skin_Priest_DZ",0.1}
"Skin_Priest_DZ", ,{"Skin_Rocker1_DZ",0.07}
"Skin_Rocker1_DZ", ,{"Skin_Rocker2_DZ",0.07}
"Skin_Rocker2_DZ", ,{"Skin_Rocker3_DZ",0.08}
"Skin_Rocker3_DZ", ,{"Skin_Rocker4_DZ",0.08}
"Skin_Rocker4_DZ", ,{"Skin_SurvivorW3_DZ",0.09}
"Skin_SurvivorW3_DZ", ,{"Skin_SurvivorWpink_DZ",0.09}
"Skin_SurvivorWpink_DZ", ,{"Skin_SurvivorWurban_DZ",0.07}
"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
}
}; };
militaryclothes[] = { militaryclothes[] = {
{ {"Skin_Camo1_DZ",0.1}
"Skin_Camo1_DZ", ,{"Skin_Sniper1_DZ",0.08}
"Skin_Sniper1_DZ", ,{"Skin_Rocket_DZ",0.05}
"Skin_Rocket_DZ", ,{"Skin_Soldier1_DZ",0.13}
"Skin_Soldier1_DZ", ,{"Skin_Drake_Light_DZ",0.07}
"Skin_Drake_Light_DZ", ,{"Skin_Soldier_TL_PMC_DZ",0.07}
"Skin_Soldier_TL_PMC_DZ", ,{"Skin_Soldier_Sniper_PMC_DZ",0.05}
"Skin_Soldier_Sniper_PMC_DZ", ,{"Skin_Soldier_Bodyguard_AA12_PMC_DZ",0.07}
"Skin_Soldier_Bodyguard_AA12_PMC_DZ", ,{"Skin_CZ_Special_Forces_GL_DES_EP1_DZ",0.08}
"Skin_CZ_Special_Forces_GL_DES_EP1_DZ", ,{"Skin_FR_OHara_DZ",0.08}
"Skin_FR_OHara_DZ", ,{"Skin_FR_Rodriguez_DZ",0.09}
"Skin_FR_Rodriguez_DZ", ,{"Skin_CZ_Soldier_Sniper_EP1_DZ",0.04}
"Skin_CZ_Soldier_Sniper_EP1_DZ", ,{"Skin_Graves_Light_DZ",0.09}
"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
}
}; };
specialclothes[] = { specialclothes[] = {
{ {"Skin_Ins_Soldier_GL_DZ",0.1}
"Skin_Ins_Soldier_GL_DZ", ,{"Skin_GUE_Commander_DZ",0.08}
"Skin_GUE_Commander_DZ", ,{"Skin_Bandit1_DZ",0.13}
"Skin_Bandit1_DZ", ,{"Skin_Bandit2_DZ",0.06}
"Skin_Bandit2_DZ", ,{"Skin_BanditW1_DZ",0.07}
"Skin_BanditW1_DZ", ,{"Skin_BanditW2_DZ",0.07}
"Skin_BanditW2_DZ", ,{"Skin_TK_INS_Soldier_EP1_DZ",0.05}
"Skin_TK_INS_Soldier_EP1_DZ", ,{"Skin_TK_INS_Warlord_EP1_DZ",0.07}
"Skin_TK_INS_Warlord_EP1_DZ", ,{"Skin_SurvivorWcombat_DZ",0.08}
"Skin_SurvivorWcombat_DZ", ,{"Skin_SurvivorWdesert_DZ",0.08}
"Skin_SurvivorWdesert_DZ", ,{"Skin_GUE_Soldier_MG_DZ",0.05}
"Skin_GUE_Soldier_MG_DZ", ,{"Skin_GUE_Soldier_Sniper_DZ",0.04}
"Skin_GUE_Soldier_Sniper_DZ", ,{"Skin_GUE_Soldier_Crew_DZ",0.04}
"Skin_GUE_Soldier_Crew_DZ", ,{"Skin_GUE_Soldier_CO_DZ",0.04}
"Skin_GUE_Soldier_CO_DZ", ,{"Skin_GUE_Soldier_2_DZ",0.04}
"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
}
}; };
machinegunammoexpl[] = { machinegunammoexpl[] = {
{ {"100Rnd_556x45_BetaCMag",0.2}
"100Rnd_556x45_BetaCMag", ,{"75Rnd_545x39_RPK",0.2}
"75Rnd_545x39_RPK", ,{"100Rnd_556x45_M249",0.15}
"100Rnd_556x45_M249", ,{"100Rnd_762x51_M240",0.15}
"100Rnd_762x51_M240", ,{"100Rnd_762x54_PK",0.14}
"100Rnd_762x54_PK", ,{"200Rnd_556x45_M249",0.14}
"200Rnd_556x45_M249", ,{"MAAWS_HEAT",0.01}
"MAAWS_HEAT", ,{"PipeBomb",0.01}
"PipeBomb"
},
{
0.20,
0.20,
0.15,
0.15,
0.14,
0.14,
0.01,
0.01
}
}; };
pistols[] = { pistols[] = {
{ {"Makarov",0.25}
"Makarov", ,{"Colt1911",0.23}
"Colt1911", ,{"revolver_EP1",0.2}
"revolver_EP1", ,{"glock17_EP1",0.1}
"glock17_EP1", ,{"MakarovSD",0.1}
"MakarovSD", ,{"M9",0.07}
"M9", ,{"M9SD",0.04}
"M9SD", ,{"revolver_gold_EP1",0.01}
"revolver_gold_EP1"
},
{
0.25,
0.23,
0.20,
0.10,
0.10,
0.07,
0.04,
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_CBLChances = [];
dayz_CBLBase = []; dayz_CBLBase = [];
_config = configFile >> "CfgBuildingLoot";
dayzE_CBLSChances = [];
dayzE_CBLSBase = [];
_config = [];
if (DZE_MissionLootTable) then { if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot"; _config = missionConfigFile >> "CfgBuildingLoot";
} else {
_config = configFile >> "CfgBuildingLoot";
}; };
for "_i" from 0 to ((count _config) - 1) do { for "_i" from 0 to ((count _config) - 1) do {
_classname = toLower(configName (_config select _i)); _classname = configName (_config select _i);
_itemChances = [] + getArray (_config >> _classname >> "ItemChance"); _itemChances = getArray (_config >> _classname >> "lootType");
_itemCount = count _itemChances; _itemCount = count _itemChances;
//diag_log format["Classname: %1, Array: %2, Amount: %3", _classname, _itemChances, _itemCount];
if (_itemCount > 0) then { if (_itemCount > 0) then {
if (dayz_CBLBase find _classname < 0) then { if (dayz_CBLBase find _classname < 0) then {
_weighted = []; _weighted = [];
_j = 0; _j = 0;
for "_l" from 0 to ((count _itemChances) - 1) do { for "_l" from 0 to ((count _itemChances) - 1) do {
_weight = round ((_itemChances select _l) * 100); _weight = round (((_itemChances select _l) select 2) * 100);
for "_k" from 0 to _weight - 1 do { for "_k" from 0 to (_weight - 1) do
{
_weighted set [_j + _k, _l]; _weighted set [_j + _k, _l];
}; };
_j = _j + _weight; _j = _j + _weight;
}; };
dayz_CBLChances set [count dayz_CBLChances, _weighted]; dayz_CBLChances set [count dayz_CBLChances, _weighted];
dayz_CBLBase set [count dayz_CBLBase, _classname]; dayz_CBLBase set [count dayz_CBLBase, _classname];
}; };
} else { } else {
dayz_CBLChances set [count dayz_CBLChances, [0]]; dayz_CBLChances set [count dayz_CBLChances, [0]];
dayz_CBLBase set [count dayz_CBLBase, _classname]; 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_CLChances = [];
dayz_CLBase = []; dayz_CLBase = [];
//dayz_CLItemNames = [];
_config = []; _config = configFile >> "cfgLoot";
if (DZE_MissionLootTable) then { if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "cfgLoot"; _config = missionConfigFile >> "cfgLoot";
} else {
_config = configFile >> "cfgLoot";
}; };
for "_i" from 0 to ((count (_config)) - 1) do { 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 = []; _weighted = [];
_j = 0; _j = 0;
for "_l" from 0 to ((count _itemChances) - 1) do { for "_l" from 0 to ((count _itemChances) - 1) do {
_weight = round ((_itemChances select _l) * 100); _weight = round (((_itemChances select _l) select 1) * 100);
for "_k" from 0 to _weight - 1 do { for "_k" from 0 to (_weight - 1) do {
_weighted set [_j + _k, _l]; _weighted set [_j + _k, _l];
//_items set [count _items, ((_itemChances select _l) select 0)];
}; };
_j = _j + _weight; _j = _j + _weight;
}; };
dayz_CLBase set [count dayz_CLBase, configName (_config select _i)]; dayz_CLBase set [count dayz_CLBase, _classname];
dayz_CLChances set [count dayz_CLChances, _weighted]; //dayz_CLItemNames set [count dayz_CLBase, _items];
dayz_CLChances set [count dayz_CLChances, _weighted];
//diag_log format["CFGLoot: %1, Array: %2", _classname, _items];
}; };
//diag_log ("BaseLoot: " +str(dayz_CLBase));
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"];
dayz_ZombieBuildings = []; dayz_ZombieBuildings = [];
dayz_LootBuildings = []; dayz_LootBuildings = [];
for "_i" from 0 to (count (configFile >> "CfgBuildingLoot") - 1) do {
_config = []; _type = (configFile >> "CfgBuildingLoot") select _i;
if (DZE_MissionLootTable) then { _canZombie = getNumber (_type >> "zombieChance") > 0;
_config = missionConfigFile >> "CfgBuildingLoot"; _canLoot = getNumber (_type >> "lootChance") > 0;
} 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;
if(_canZombie) then { if(_canZombie) then {
if(!((configName _type) in dayz_ZombieBuildings)) then { if(!((configName _type) in dayz_ZombieBuildings)) then {
dayz_ZombieBuildings set [count dayz_ZombieBuildings, configName _type]; 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);