New config variable dayz_toolBreaking

Tool breaking is disabled by default.

Also made all scripts use Epoch sledge, which is a different model from
vanilla sledge.

PK_DZ was a duplicate of the new PKM_DZ.
This commit is contained in:
ebaydayz
2016-04-03 16:34:14 -04:00
parent d07d31983b
commit e69364991c
37 changed files with 323 additions and 231 deletions

View File

@@ -127,14 +127,16 @@ while {_isOk} do {
};
};
//Chances to damage tools
{
if ([(_x select 1)] call fn_chance) then {
player removeWeapon (_x select 0);
player addWeapon (_x select 2);
titleText ["Your tool has been damaged." , "PLAIN DOWN"];
};
}foreach _tools;
if (dayz_toolBreaking) then {
//Chances to damage tools
{
if ([(_x select 1)] call fn_chance) then {
player removeWeapon (_x select 0);
player addWeapon (_x select 2);
titleText ["Your tool has been damaged." , "PLAIN DOWN"];
};
}foreach _tools;
};
if(_counter == _limit) exitWith {
//stop loop

View File

@@ -5,7 +5,7 @@ _pos = getPos _target;
_isGate = (typeOf cursorTarget) in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"];
_limit = 2 + round(random 3);
_hasSledgeHammer = "ItemSledgeHammer" in items player;
_hasSledgeHammer = "ItemSledge" in items player;
_hasCrowbar = "ItemCrowbar" in items player;
if (!_hasSledgeHammer) exitWith {
@@ -25,7 +25,7 @@ _brokein = false;
while {_isOk} do {
//Check if we have the tools to start
_hasSledgeHammer = "ItemSledgeHammer" in items player;
_hasSledgeHammer = "ItemSledge" in items player;
_hasCrowbar = "ItemCrowbar" in items player;
if (!_hasSledgeHammer) exitWith {
@@ -100,17 +100,20 @@ while {_isOk} do {
};
};
//Chances to damage tools
if ([0.02] call fn_chance) then {
player removeWeapon "ItemSledgeHammer";
player addWeapon "ItemSledgeHammerBroken";
titleText ["Your SledgeHammer handle has snapped." , "PLAIN DOWN"];
};
if (dayz_toolBreaking) then {
//Chances to damage tools
if ([0.02] call fn_chance) then {
player removeWeapon "ItemSledge";
player addMagazine "ItemSledgeHandle";
player addMagazine "ItemSledgeHead";
titleText ["Your SledgeHammer handle has snapped." , "PLAIN DOWN"];
};
if ([0.04] call fn_chance) then {
player removeWeapon "ItemCrowbar";
player addWeapon "ItemCrowbarBent";
titleText ["Your crowbar has bent." , "PLAIN DOWN"];
if ([0.04] call fn_chance) then {
player removeWeapon "ItemCrowbar";
player addWeapon "ItemCrowbarBent";
titleText ["Your crowbar has bent." , "PLAIN DOWN"];
};
};
if(_counter == _limit) exitWith {

View File

@@ -102,7 +102,7 @@ if (_woodCutting) then {
if(_finished) then {
_breaking = false;
if ([0.04] call fn_chance) then {
if (dayz_toolBreaking && {[0.04] call fn_chance}) then {
_breaking = true;
if ("MeleeHatchet" in weapons player) then {
player removeWeapon "MeleeHatchet";

View File

@@ -88,7 +88,7 @@ if (!isNull _findNearestRock) then {
if(_finished) then {
_breaking = false;
if ([0.04] call fn_chance) then {
if (dayz_toolBreaking && {[0.04] call fn_chance}) then {
_breaking = true;
if ("MeleePickaxe" in weapons player) then {
player removeWeapon "MeleePickaxe";

View File

@@ -129,9 +129,7 @@ while {_isOk} do {
_counter = _counter + 1;
// 10% chance to break a required tool each pass
if((_isDestructable || _isRemovable) && !_isOwnerOfObj) then {
if((random 10) <= 1) then {
_brokenTool = true;
};
if (dayz_toolBreaking && {[0.04] call fn_chance}) then {_brokenTool = true;};
};
};
if(_brokenTool) exitWith {