mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
added document to zombies and random open chance
This commit is contained in:
@@ -155,6 +155,20 @@ class CfgMagazines {
|
||||
picture = "\z\addons\dayz_epoch\pictures\equip_doc_generic_ca.paa";
|
||||
descriptionShort = "Unknown document";
|
||||
weight = 0.1;
|
||||
class ItemActions
|
||||
{
|
||||
class Crafting
|
||||
{
|
||||
text = "Open Document";
|
||||
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
|
||||
neednearby[] = {};
|
||||
requiretools[] = {};
|
||||
randomOutput = 1;
|
||||
output[] = {{"ItemLetter",1},{"ItemDocumentRamp",1}};
|
||||
input[] = {{"ItemDocument",1}};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
class ItemLetter: CA_Magazine
|
||||
{
|
||||
|
||||
@@ -35,13 +35,14 @@ class CfgLoot {
|
||||
"ItemBandage",
|
||||
"ItemPainkiller",
|
||||
"FoodBioMeat",
|
||||
"8Rnd_9x18_MakarovSD"
|
||||
"8Rnd_9x18_MakarovSD",
|
||||
"ItemDocument"
|
||||
},
|
||||
{
|
||||
0.07,
|
||||
0.09,
|
||||
0.09,
|
||||
0.1,
|
||||
0.09,
|
||||
0.09,
|
||||
0.05,
|
||||
0.05,
|
||||
@@ -54,6 +55,7 @@ class CfgLoot {
|
||||
0.06,
|
||||
0.06,
|
||||
0.01,
|
||||
0.01,
|
||||
0.01
|
||||
}
|
||||
};
|
||||
@@ -76,11 +78,12 @@ class CfgLoot {
|
||||
"ItemPainkiller",
|
||||
"FoodBioMeat",
|
||||
"8Rnd_9x18_MakarovSD",
|
||||
"ItemBriefcaseEmpty"
|
||||
"ItemBriefcaseEmpty",
|
||||
"ItemDocument"
|
||||
},
|
||||
{
|
||||
0.07,
|
||||
0.09,
|
||||
0.08,
|
||||
0.09,
|
||||
0.09,
|
||||
0.09,
|
||||
@@ -96,6 +99,7 @@ class CfgLoot {
|
||||
0.06,
|
||||
0.01,
|
||||
0.01,
|
||||
0.01,
|
||||
0.01
|
||||
}
|
||||
};
|
||||
@@ -162,7 +166,8 @@ class CfgLoot {
|
||||
"HandChemBlue",
|
||||
"HandChemRed",
|
||||
"ItemHeatPack",
|
||||
"ItemLockbox"
|
||||
"ItemLockbox",
|
||||
"ItemDocument"
|
||||
},
|
||||
{
|
||||
0.06,
|
||||
@@ -183,7 +188,7 @@ class CfgLoot {
|
||||
0.04,
|
||||
0.05,
|
||||
0.05,
|
||||
0.09,
|
||||
0.08,
|
||||
0.02,
|
||||
0.04,
|
||||
0.07,
|
||||
@@ -192,7 +197,8 @@ class CfgLoot {
|
||||
0.03,
|
||||
0.03,
|
||||
0.03,
|
||||
0.04
|
||||
0.04,
|
||||
0.01
|
||||
}
|
||||
};
|
||||
generic[] = {
|
||||
@@ -391,19 +397,21 @@ class CfgLoot {
|
||||
"ItemComboLock",
|
||||
"SmokeShell",
|
||||
"FoodMRE",
|
||||
"ItemHotwireKit"
|
||||
"ItemHotwireKit",
|
||||
"ItemDocument"
|
||||
},
|
||||
{
|
||||
0.3,
|
||||
0.08,
|
||||
0.08,
|
||||
0.14,
|
||||
0.17,
|
||||
0.16,
|
||||
0.08,
|
||||
0.01,
|
||||
0.05,
|
||||
0.04,
|
||||
0.04,
|
||||
0.01,
|
||||
0.01
|
||||
}
|
||||
};
|
||||
@@ -417,18 +425,20 @@ class CfgLoot {
|
||||
"WoodenArrow",
|
||||
"ItemHeatPack",
|
||||
"FoodMRE",
|
||||
"FoodNutmix"
|
||||
"FoodNutmix",
|
||||
"ItemDocument"
|
||||
},
|
||||
{
|
||||
0.4,
|
||||
0.17,
|
||||
0.16,
|
||||
0.03,
|
||||
0.1,
|
||||
0.05,
|
||||
0.2,
|
||||
0.02,
|
||||
0.01,
|
||||
0.02
|
||||
0.02,
|
||||
0.01
|
||||
}
|
||||
};
|
||||
|
||||
@@ -448,13 +458,14 @@ class CfgLoot {
|
||||
"ItemWire",
|
||||
"ItemTankTrap",
|
||||
"ItemComboLock",
|
||||
"ItemSledgeHead"
|
||||
"ItemSledgeHead",
|
||||
"ItemDocument"
|
||||
},
|
||||
{
|
||||
0.09,
|
||||
0.10,
|
||||
0.10,
|
||||
0.11,
|
||||
0.10,
|
||||
0.10,
|
||||
0.06,
|
||||
0.06,
|
||||
@@ -465,7 +476,8 @@ class CfgLoot {
|
||||
0.01,
|
||||
0.03,
|
||||
0.04,
|
||||
0.02
|
||||
0.02,
|
||||
0.01
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class ItemActions
|
||||
};
|
||||
};
|
||||
*/
|
||||
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons"];
|
||||
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["\n\nCrafting already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
@@ -70,6 +70,11 @@ if (_canDo) then {
|
||||
_outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons");
|
||||
_inputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputweapons");
|
||||
|
||||
_randomOutput = 0;
|
||||
if(isNumber (configFile >> _baseClass >> _item >> "randomOutput")) then {
|
||||
_randomOutput = getNumber(configFile >> _baseClass >> _item >> "randomOutput");
|
||||
};
|
||||
|
||||
_craft_doLoop = true;
|
||||
_tradeComplete = 0;
|
||||
|
||||
@@ -167,6 +172,12 @@ if (_canDo) then {
|
||||
_num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove);
|
||||
} forEach _inputWeapons;
|
||||
if (_num_removed_weapons == (count _inputWeapons)) then {
|
||||
if(_randomOutput == 1) then {
|
||||
_selectedWeapon = _outputWeapons call BIS_fnc_selectRandom;
|
||||
_outputWeapons = [_selectedWeapon];
|
||||
_selectedMag = _selectedRecipeOutput call BIS_fnc_selectRandom;
|
||||
_selectedRecipeOutput = [_selectedMag];
|
||||
};
|
||||
{
|
||||
player addWeapon _x;
|
||||
} forEach _outputWeapons;
|
||||
|
||||
Reference in New Issue
Block a user