added document to zombies and random open chance

This commit is contained in:
[VB]AWOL
2013-10-07 13:34:07 -05:00
parent dad0bc69bb
commit f38b436cbe
3 changed files with 53 additions and 16 deletions

View File

@@ -155,6 +155,20 @@ class CfgMagazines {
picture = "\z\addons\dayz_epoch\pictures\equip_doc_generic_ca.paa"; picture = "\z\addons\dayz_epoch\pictures\equip_doc_generic_ca.paa";
descriptionShort = "Unknown document"; descriptionShort = "Unknown document";
weight = 0.1; 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 class ItemLetter: CA_Magazine
{ {

View File

@@ -35,13 +35,14 @@ class CfgLoot {
"ItemBandage", "ItemBandage",
"ItemPainkiller", "ItemPainkiller",
"FoodBioMeat", "FoodBioMeat",
"8Rnd_9x18_MakarovSD" "8Rnd_9x18_MakarovSD",
"ItemDocument"
}, },
{ {
0.07, 0.07,
0.09, 0.09,
0.09, 0.09,
0.1, 0.09,
0.09, 0.09,
0.05, 0.05,
0.05, 0.05,
@@ -54,6 +55,7 @@ class CfgLoot {
0.06, 0.06,
0.06, 0.06,
0.01, 0.01,
0.01,
0.01 0.01
} }
}; };
@@ -76,11 +78,12 @@ class CfgLoot {
"ItemPainkiller", "ItemPainkiller",
"FoodBioMeat", "FoodBioMeat",
"8Rnd_9x18_MakarovSD", "8Rnd_9x18_MakarovSD",
"ItemBriefcaseEmpty" "ItemBriefcaseEmpty",
"ItemDocument"
}, },
{ {
0.07, 0.07,
0.09, 0.08,
0.09, 0.09,
0.09, 0.09,
0.09, 0.09,
@@ -96,6 +99,7 @@ class CfgLoot {
0.06, 0.06,
0.01, 0.01,
0.01, 0.01,
0.01,
0.01 0.01
} }
}; };
@@ -162,7 +166,8 @@ class CfgLoot {
"HandChemBlue", "HandChemBlue",
"HandChemRed", "HandChemRed",
"ItemHeatPack", "ItemHeatPack",
"ItemLockbox" "ItemLockbox",
"ItemDocument"
}, },
{ {
0.06, 0.06,
@@ -183,7 +188,7 @@ class CfgLoot {
0.04, 0.04,
0.05, 0.05,
0.05, 0.05,
0.09, 0.08,
0.02, 0.02,
0.04, 0.04,
0.07, 0.07,
@@ -192,7 +197,8 @@ class CfgLoot {
0.03, 0.03,
0.03, 0.03,
0.03, 0.03,
0.04 0.04,
0.01
} }
}; };
generic[] = { generic[] = {
@@ -391,19 +397,21 @@ class CfgLoot {
"ItemComboLock", "ItemComboLock",
"SmokeShell", "SmokeShell",
"FoodMRE", "FoodMRE",
"ItemHotwireKit" "ItemHotwireKit",
"ItemDocument"
}, },
{ {
0.3, 0.3,
0.08, 0.08,
0.08, 0.08,
0.14, 0.14,
0.17, 0.16,
0.08, 0.08,
0.01, 0.01,
0.05, 0.05,
0.04, 0.04,
0.04, 0.04,
0.01,
0.01 0.01
} }
}; };
@@ -417,18 +425,20 @@ class CfgLoot {
"WoodenArrow", "WoodenArrow",
"ItemHeatPack", "ItemHeatPack",
"FoodMRE", "FoodMRE",
"FoodNutmix" "FoodNutmix",
"ItemDocument"
}, },
{ {
0.4, 0.4,
0.17, 0.16,
0.03, 0.03,
0.1, 0.1,
0.05, 0.05,
0.2, 0.2,
0.02, 0.02,
0.01, 0.01,
0.02 0.02,
0.01
} }
}; };
@@ -448,13 +458,14 @@ class CfgLoot {
"ItemWire", "ItemWire",
"ItemTankTrap", "ItemTankTrap",
"ItemComboLock", "ItemComboLock",
"ItemSledgeHead" "ItemSledgeHead",
"ItemDocument"
}, },
{ {
0.09, 0.09,
0.10, 0.10,
0.10, 0.10,
0.11, 0.10,
0.10, 0.10,
0.06, 0.06,
0.06, 0.06,
@@ -465,7 +476,8 @@ class CfgLoot {
0.01, 0.01,
0.03, 0.03,
0.04, 0.04,
0.02 0.02,
0.01
} }
}; };

View File

@@ -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"]; }; if(TradeInprogress) exitWith { cutText ["\n\nCrafting already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true; TradeInprogress = true;
@@ -69,6 +69,11 @@ if (_canDo) then {
_selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input"); _selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input");
_outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons"); _outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons");
_inputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputweapons"); _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; _craft_doLoop = true;
_tradeComplete = 0; _tradeComplete = 0;
@@ -167,6 +172,12 @@ if (_canDo) then {
_num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove); _num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove);
} forEach _inputWeapons; } forEach _inputWeapons;
if (_num_removed_weapons == (count _inputWeapons)) then { 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; player addWeapon _x;
} forEach _outputWeapons; } forEach _outputWeapons;