From 71b975b05ec516f7b85d200862d58dc5897b2379 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Tue, 29 Mar 2016 14:47:28 -0400 Subject: [PATCH] Actions cleanup --- CHANGE LOG 1.0.6.txt | 1 + SQF/dayz_code/actions/ammo.sqf | 6 +- SQF/dayz_code/actions/boil.sqf | 36 ++-- SQF/dayz_code/actions/cook.sqf | 2 - SQF/dayz_code/actions/fire_pack.sqf | 7 +- SQF/dayz_code/actions/gather_meat.sqf | 69 +++--- SQF/dayz_code/actions/gather_zparts.sqf | 98 ++++----- SQF/dayz_code/actions/jerry_fill.sqf | 4 +- SQF/dayz_code/actions/object_pickup.sqf | 45 ++-- SQF/dayz_code/actions/player_addToolbelt.sqf | 35 ++-- SQF/dayz_code/actions/player_addtoBack.sqf | 5 +- SQF/dayz_code/actions/player_build.sqf | 2 + ...ld_vanilla.sqf => player_buildVanilla.sqf} | 0 SQF/dayz_code/actions/player_craftItem.sqf | 3 + ...anilla.sqf => player_craftItemVanilla.sqf} | 0 SQF/dayz_code/actions/player_drinkWater.sqf | 6 +- SQF/dayz_code/actions/player_dropWeapon.sqf | 11 +- SQF/dayz_code/actions/player_goFishing.sqf | 24 +-- SQF/dayz_code/actions/player_makefire.sqf | 9 +- SQF/dayz_code/actions/player_setTrap.sqf | 4 +- SQF/dayz_code/actions/player_sleep.sqf | 22 +- SQF/dayz_code/actions/player_switchWeapon.sqf | 22 +- SQF/dayz_code/actions/player_useMeds.sqf | 2 +- SQF/dayz_code/actions/refuel.sqf | 14 +- SQF/dayz_code/actions/repair.sqf | 6 +- SQF/dayz_code/actions/repair_vehicle.sqf | 10 +- SQF/dayz_code/actions/salvage.sqf | 24 +-- SQF/dayz_code/actions/salvage_vehicle.sqf | 19 +- SQF/dayz_code/actions/siphonFuel.sqf | 6 +- SQF/dayz_code/configVariables.sqf | 2 + SQF/dayz_code/init/compiles.sqf | 3 +- SQF/dayz_code/init/variables.sqf | 3 +- .../medical/publicEH/promptRName.sqf | 5 - SQF/dayz_code/stringtable.xml | 17 +- SQF/dayz_epoch_b/stringtable.xml | 198 ------------------ .../compile/server_spawnCarePackages.sqf | 36 +++- .../compile/server_spawnCrashSites.sqf | 55 ++++- .../compile/server_spawnInfectedCamps.sqf | 22 +- 38 files changed, 330 insertions(+), 503 deletions(-) rename SQF/dayz_code/actions/{player_build_vanilla.sqf => player_buildVanilla.sqf} (100%) rename SQF/dayz_code/actions/{player_craftItem_vanilla.sqf => player_craftItemVanilla.sqf} (100%) delete mode 100644 SQF/dayz_code/medical/publicEH/promptRName.sqf diff --git a/CHANGE LOG 1.0.6.txt b/CHANGE LOG 1.0.6.txt index eccb15356..261963ba1 100644 --- a/CHANGE LOG 1.0.6.txt +++ b/CHANGE LOG 1.0.6.txt @@ -17,6 +17,7 @@ - dayz_allowedObjects --> DayZ_SafeObjects - dayz_fullMoonNights --> dayz_ForcefullmoonNights - dayz_updateObjects --> DayZ_GearedObjects + - DZE_CanPickup --> canPickup - freeTarget --> OpenTarget - PVDZE_serverObjectMonitor --> dayz_serverObjectMonitor - Duplicate public variables have been renamed: diff --git a/SQF/dayz_code/actions/ammo.sqf b/SQF/dayz_code/actions/ammo.sqf index fc1e6458a..d72f9fab8 100644 --- a/SQF/dayz_code/actions/ammo.sqf +++ b/SQF/dayz_code/actions/ammo.sqf @@ -1,4 +1,5 @@ -private ["_ammoType","_vehicle","_ammo","_weapon","_turret","_text","_array","_magazines"]; +private ["_array","_vehicle","_weapon","_turret","_ammo","_text","_magazines","_ammoType"]; + _array = _this select 3; _vehicle = _array select 0; _weapon = _array select 1; @@ -11,9 +12,10 @@ _magazines = getArray (configFile >> "cfgWeapons" >> _weapon >> "magazines"); { _ammoType = getText (configFile >> "cfgMagazines" >> _x >> "displayName"); if (_ammoType == "") then {_ammoType = _x;}; - if (!(_ammoType in _text)) then {_text set [count _text,_ammoType];}; + if !(_ammoType in _text) then {_text set [count _text,_ammoType];}; if (_x in magazines player) exitWith {_ammo = _x;}; } count _magazines; + if (_ammo != "") then { _vehicle removeMagazineTurret [_ammo,_turret]; _vehicle addMagazineTurret [_ammo,_turret]; diff --git a/SQF/dayz_code/actions/boil.sqf b/SQF/dayz_code/actions/boil.sqf index a507fc4d6..55a8d40c0 100644 --- a/SQF/dayz_code/actions/boil.sqf +++ b/SQF/dayz_code/actions/boil.sqf @@ -1,4 +1,4 @@ -private ["_bottletext","_tin1text","_tin2text","_tintext","_hasbottleitem","_hastinitem","_qty","_dis","_sfx"]; +private ["_bottletext","_tin1text","_tin2text","_tintext","_hasbottleitem","_hastinitem","_qty","_dis","_sfx","_bottleInfected","_msg"]; if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_22","PLAIN DOWN"];}; DZE_ActionInProgress = true; @@ -7,29 +7,20 @@ _bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterBottle" >> "dis _tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName"); _tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName"); _tintext = format["%1 / %2",_tin1text,_tin2text]; -_bottleInfected = false; - -_hasbottleitem = (("ItemWaterBottle" in magazines player) || ("ItemWaterBottleInfected" in magazines player) || ("ItemWaterBottleSafe" in magazines player)); +_hasbottleitem = (("ItemWaterBottle" in magazines player) || {"ItemWaterBottleInfected" in magazines player} || {"ItemWaterBottleSafe" in magazines player}); _hastinitem = false; a_player_boil = true; - player removeAction s_player_boil; //s_player_boil = -1; -if ("ItemWaterBottleInfected" in magazines player) then { - _bottleInfected = true; -}; +_bottleInfected = if ("ItemWaterBottleInfected" in magazines player) then {true} else {false}; { - if (_x in magazines player) then { - _hastinitem = true; - }; + if (_x in magazines player) exitWith {_hastinitem = true;}; +} count boil_tin_cans; -} forEach boil_tin_cans; - - -if (!_hasbottleitem) exitWith {cutText [DZE_ActionInProgress = false; format [localize "str_player_31",_bottletext,localize "str_player_31_fill"] , "PLAIN DOWN"]; a_player_boil = false;}; -if (!_hastinitem) exitWith {DZE_ActionInProgress = false; cutText [format [localize "str_player_31",_tintext,localize "str_player_31_fill"] , "PLAIN DOWN"]; a_player_boil = false;}; +if (!_hasbottleitem) exitWith {cutText [format [localize "str_player_31",_bottletext,localize "str_player_31_fill"] , "PLAIN DOWN"]; a_player_boil = false;}; +if (!_hastinitem) exitWith {cutText [format [localize "str_player_31",_tintext,localize "str_player_31_fill"] , "PLAIN DOWN"]; a_player_boil = false;}; if (_hasbottleitem and _hastinitem) then { _qty = 0; @@ -56,15 +47,14 @@ if (_hasbottleitem and _hastinitem) then { }; }; - //if ([0.1] call fn_chance) then { - //player addMagazine "ItemWaterBottleDmg"; + if (dayz_waterBottleBreaking && {[0.1] call fn_chance}) then { + player addMagazine "ItemWaterBottleDmg"; //systemChat (localize ("str_waterbottle_broke")); - //_msg = localize "str_waterbottle_broke"; - //_msg call dayz_rollingMessages; - //} else { + _msg = localize "str_waterbottle_broke"; + _msg call dayz_rollingMessages; + } else { player addMagazine "ItemWaterBottleBoiled"; - //}; - + }; }; //cutText [format [localize "str_player_boiledwater",_qty], "PLAIN DOWN"]; _msg = format [localize "str_player_boiledwater",_qty]; diff --git a/SQF/dayz_code/actions/cook.sqf b/SQF/dayz_code/actions/cook.sqf index d60c2ae56..bc26c4658 100644 --- a/SQF/dayz_code/actions/cook.sqf +++ b/SQF/dayz_code/actions/cook.sqf @@ -1,8 +1,6 @@ private ["_rawmeat","_cookedmeat","_meat","_meatcooked","_text","_qty","_dis","_sfx"]; - if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_23","PLAIN DOWN"];}; DZE_ActionInProgress = true; - //diag_log ("Cook Enabled"); player removeAction s_player_cook; s_player_cook = -1; diff --git a/SQF/dayz_code/actions/fire_pack.sqf b/SQF/dayz_code/actions/fire_pack.sqf index 8f452e94c..ab9aaa630 100644 --- a/SQF/dayz_code/actions/fire_pack.sqf +++ b/SQF/dayz_code/actions/fire_pack.sqf @@ -1,11 +1,14 @@ -private["_obj"]; +private "_obj"; _obj = _this select 3; + player playActionNow "Medic"; uiSleep 6; -if(_obj isKindOf "Land_fire") then { + +if (_obj isKindOf "Land_fire") then { dayz_hasFire = objNull; deleteVehicle _obj; }; + cutText [localize "str_fireplace_removed", "PLAIN DOWN"]; player removeAction s_player_fireout; s_player_fireout = -1; \ No newline at end of file diff --git a/SQF/dayz_code/actions/gather_meat.sqf b/SQF/dayz_code/actions/gather_meat.sqf index c4646c633..ca7b39cb6 100644 --- a/SQF/dayz_code/actions/gather_meat.sqf +++ b/SQF/dayz_code/actions/gather_meat.sqf @@ -1,5 +1,4 @@ -private ["_item", "_type", "_hasHarvested", "_config", "_knifeArray", "_PlayerNear", "_isListed", "_activeKnife", "_text", "_dis", "_sfx", "_sharpnessRemaining"]; - +private ["_item","_type","_hasHarvested","_config","_knifeArray","_PlayerNear","_isListed","_activeKnife","_text","_dis","_sfx","_sharpnessRemaining","_qty","_chance","_msg","_string"]; if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_29","PLAIN DOWN"];}; DZE_ActionInProgress = true; @@ -14,7 +13,7 @@ player removeAction s_player_butcher; s_player_butcher = -1; _PlayerNear = {isPlayer _x} count ((getPosATL _item) nearEntities ["CAManBase", 10]) > 1; -if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_5", "PLAIN DOWN"]}; +if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_5", "PLAIN DOWN"] DZE_ActionInProgress = false;}; //Count how many active tools the player has { @@ -23,21 +22,20 @@ if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_5", "PLAIN DOWN"] }; } count Dayz_Gutting; -if ((count _knifeArray) < 1) exitwith { cutText [localize "str_cannotgut", "PLAIN DOWN"] }; +if ((count _knifeArray) < 1) exitwith { cutText [localize "str_cannotgut", "PLAIN DOWN"]; DZE_ActionInProgress = false; }; if ((count _knifeArray > 0) and !_hasHarvested) then { - private ["_qty"]; + private "_qty"; //Select random can from array _activeKnife = _knifeArray call BIS_fnc_selectRandom; //Get Animal Type - _isListed = isClass (_config); + _isListed = isClass _config; _text = getText (configFile >> "CfgVehicles" >> _type >> "displayName"); player playActionNow "Medic"; - _dis=10; _sfx = "gut"; [player,_sfx,0,false,_dis] call dayz_zombieSpeak; @@ -48,18 +46,14 @@ if ((count _knifeArray > 0) and !_hasHarvested) then { _item setVariable ["meatHarvested",true,true]; - _qty = 2; - if (_isListed) then { - _qty = getNumber (_config >> "yield"); - }; - + _qty = if (_isListed) then {getNumber (_config >> "yield")} else {2}; if (_activeKnife == "ItemKnifeBlunt") then { _qty = round(_qty / 2); }; if (local _item) then { [_item,_qty] spawn local_gutObject; //leave as spawn (sleeping in loops will work but can freeze the script) } else { - PVCDZE_obj_GutBody =[_item,_qty]; - publicVariable "PVCDZE_obj_GutBody"; + PVCDZ_obj_GutBody =[_item,_qty]; + publicVariable "PVCDZ_obj_GutBody"; //achievement system if (!achievement_Gut) then { @@ -67,34 +61,35 @@ if ((count _knifeArray > 0) and !_hasHarvested) then { }; }; - //_sharpnessRemaining = getText (configFile >> "cfgWeapons" >> _activeKnife >> "sharpnessRemaining"); - - /* switch _activeKnife do { - case "ItemKnife" : { - //_chance = getNumber (configFile >> "cfgWeapons" >> _activeKnife >> "chance"); - if ([0.2] call fn_chance) then { + if (dayz_knifeDulling) then { + _sharpnessRemaining = getText (configFile >> "cfgWeapons" >> _activeKnife >> "sharpnessRemaining"); + + switch _activeKnife do { + case "ItemKnife" : { + //_chance = getNumber (configFile >> "cfgWeapons" >> _activeKnife >> "chance"); + if ([0.2] call fn_chance) then { + player removeWeapon _activeKnife; + player addWeapon _sharpnessRemaining; + + //systemChat (localize "str_info_bluntknife"); + _msg = localize "str_info_bluntknife"; + _msg call dayz_rollingMessages; + }; + }; + case "ItemKnifeBlunt" : { + //do nothing + }; + default { player removeWeapon _activeKnife; player addWeapon _sharpnessRemaining; - - //systemChat (localize "str_info_bluntknife"); - _msg = localize "str_info_bluntknife"; - _msg call dayz_rollingMessages; - }; + }; }; - case "ItemKnifeBlunt" : { - //do nothing - }; - default { - player removeWeapon _activeKnife; - player addWeapon _sharpnessRemaining; - }; - }; */ + }; - uisleep 6; + uiSleep 6; _string = format[localize "str_success_gutted_animal",_text,_qty]; - - closedialog 0; - uisleep 0.02; + closeDialog 0; + uiSleep 0.02; //cutText [_string, "PLAIN DOWN"]; _string call dayz_rollingMessages; }; diff --git a/SQF/dayz_code/actions/gather_zparts.sqf b/SQF/dayz_code/actions/gather_zparts.sqf index 133922e39..ce784c896 100644 --- a/SQF/dayz_code/actions/gather_zparts.sqf +++ b/SQF/dayz_code/actions/gather_zparts.sqf @@ -1,58 +1,43 @@ -private ["_item", "_type", "_hasHarvested", "_config", "_knifeArray", "_PlayerNear", "_isListed", "_activeKnife", "_text", "_dis", "_sfx", "_sharpnessRemaining"]; - -if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_29","PLAIN DOWN"];}; +private ["_item","_type","_hasHarvested","_config","_knifeArray","_playerNear","_isListed","_activeKnife","_text","_sharpnessRemaining","_qty","_chance","_msg","_string"]; +if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_31","PLAIN DOWN"];}; DZE_ActionInProgress = true; _item = _this select 3; _type = typeOf _item; -_hasHarvested = _item getVariable["meatHarvested",false]; +_hasHarvested = _item getVariable ["meatHarvested",false]; _config = configFile >> "CfgSurvival" >> "Meat" >> _type; - _knifeArray = []; - player removeAction s_player_butcher; s_player_butcher = -1; -_PlayerNear = {isPlayer _x} count ((getPosATL _item) nearEntities ["CAManBase", 10]) > 1; -if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_5", "PLAIN DOWN"]}; +_playerNear = {isPlayer _x} count ((getPosATL _item) nearEntities ["CAManBase", 10]) > 1; +if (_playerNear) exitWith {cutText [localize "str_pickup_limit_5","PLAIN DOWN"]; DZE_ActionInProgress = false;}; //Count how many active tools the player has { - if (_x IN items player) then { - _knifeArray set [count _knifeArray, _x]; - }; + if (_x in items player) then {_knifeArray set [count _knifeArray, _x];}; } count Dayz_Gutting; -if ((count _knifeArray) < 1) exitwith { cutText [localize "str_cannotgut", "PLAIN DOWN"] }; +if ((count _knifeArray) < 1) exitWith {cutText [localize "str_cannotgut","PLAIN DOWN"]; DZE_ActionInProgress = false; }; - -if ((count _knifeArray > 0) and !_hasHarvested) then { - private ["_qty"]; +if ((count _knifeArray > 0) && !_hasHarvested) then { + private "_qty"; //Select random can from array _activeKnife = _knifeArray call BIS_fnc_selectRandom; - //Get Animal Type - _isListed = isClass (_config); + //Get Zombie Type + _isListed = isClass _config; _text = getText (configFile >> "CfgVehicles" >> _type >> "displayName"); player playActionNow "Medic"; - - _dis=10; - _sfx = "gut"; - [player,_sfx,0,false,_dis] call dayz_zombieSpeak; - [player,_dis,true,(getPosATL player)] call player_alertZombies; - - // Added Nutrition-Factor for work - ["Working",0,[20,40,15,0]] call dayz_NutritionSystem; + [player,"gut",0,false,10] call dayz_zombieSpeak; + [player,10,true,(getPosATL player)] call player_alertZombies; + ["Working",0,[20,40,15,0]] call dayz_NutritionSystem; // Added Nutrition-Factor for work _item setVariable ["meatHarvested",true,true]; - _qty = 2; - if (_isListed) then { - _qty = getNumber (_config >> "yield"); - }; - + _qty = if (_isListed) then {getNumber (_config >> "yield")} else {2}; if (_activeKnife == "ItemKnifeBlunt") then { _qty = round(_qty / 2); }; if (local _item) then { @@ -62,39 +47,38 @@ if ((count _knifeArray > 0) and !_hasHarvested) then { publicVariable "PVDZE_plr_GutBodyZ"; }; - //_sharpnessRemaining = getText (configFile >> "cfgWeapons" >> _activeKnife >> "sharpnessRemaining"); - - /* switch _activeKnife do { - case "ItemKnife" : { - //_chance = getNumber (configFile >> "cfgWeapons" >> _activeKnife >> "chance"); - if ([0.2] call fn_chance) then { + if (dayz_knifeDulling) then { + _sharpnessRemaining = getText (configFile >> "cfgWeapons" >> _activeKnife >> "sharpnessRemaining"); + switch _activeKnife do { + case "ItemKnife" : { + //_chance = getNumber (configFile >> "cfgWeapons" >> _activeKnife >> "chance"); + if ([0.2] call fn_chance) then { + player removeWeapon _activeKnife; + player addWeapon _sharpnessRemaining; + + //systemChat (localize "str_info_bluntknife"); + _msg = localize "str_info_bluntknife"; + _msg call dayz_rollingMessages; + }; + }; + case "ItemKnifeBlunt" : { + //do nothing + }; + default { player removeWeapon _activeKnife; player addWeapon _sharpnessRemaining; - - //systemChat (localize "str_info_bluntknife"); - _msg = localize "str_info_bluntknife"; - _msg call dayz_rollingMessages; - }; + }; }; - case "ItemKnifeBlunt" : { - //do nothing - }; - default { - player removeWeapon _activeKnife; - player addWeapon _sharpnessRemaining; - }; - }; */ + }; // Reduce humanity for gutting zeds - _humanity = player getVariable["humanity",0]; + _humanity = player getVariable ["humanity",0]; _humanity = _humanity - 10; - player setVariable["humanity",_humanity,true]; + player setVariable ["humanity",_humanity,true]; - uisleep 6; - _string = format["Successfully Gutted Zombie",_text,_qty]; - //cutText [_string, "PLAIN DOWN"]; - - closedialog 0; - uisleep 0.02; + uiSleep 6; + _string = format[localize "str_success_gutted_animal",_text,_qty]; //%1 has been gutted, %2 meat steaks now on the carcass + closeDialog 0; + uiSleep 0.02; //cutText [_string, "PLAIN DOWN"]; _string call dayz_rollingMessages; }; diff --git a/SQF/dayz_code/actions/jerry_fill.sqf b/SQF/dayz_code/actions/jerry_fill.sqf index d16e1362b..ca42c8497 100644 --- a/SQF/dayz_code/actions/jerry_fill.sqf +++ b/SQF/dayz_code/actions/jerry_fill.sqf @@ -24,7 +24,7 @@ _qty = count _fuelCans; _fillCounter = _fillCounter + 1; - cutText [format[(localize "str_epoch_player_133"),_displayName], "PLAIN DOWN"]; + cutText [format[(localize "str_siphon_preparing"),_displayName], "PLAIN DOWN"]; [1,1] call dayz_HungerThirst; // force animation @@ -65,7 +65,7 @@ _qty = count _fuelCans; [objNull, player, rSwitchMove,""] call RE; player playActionNow "stop"; }; - cutText [localize "str_epoch_player_35","PLAIN DOWN"]; + cutText [localize "str_siphon_canceled","PLAIN DOWN"]; _abort = true; }; diff --git a/SQF/dayz_code/actions/object_pickup.sqf b/SQF/dayz_code/actions/object_pickup.sqf index 79da7c8bf..bb62c4904 100644 --- a/SQF/dayz_code/actions/object_pickup.sqf +++ b/SQF/dayz_code/actions/object_pickup.sqf @@ -1,14 +1,11 @@ -private ["_array","_type","_classname","_holder","_playerID","_text","_broken","_claimedBy","_config","_isOk","_PlayerNear","_wpn","_ismelee"]; +if (player isKindOf "PZombie_VB") exitWith {}; +private ["_array","_type","_classname","_holder","_playerID","_text","_broken","_claimedBy","_config","_isOk","_PlayerNear","_wpn","_ismelee","_hasBag"]; _array = _this select 3; _type = _array select 0; _classname = _array select 1; _holder = _array select 2; -// Check if closest player -_PlayerNear = _holder call dze_isnearest_player; -if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_4", "PLAIN DOWN"]}; - if (player distance _holder > 3) exitwith { localize "str_pickup_limit_1","PLAIN DOWN" }; @@ -16,7 +13,7 @@ _playerID = getPlayerUID player; player removeAction s_player_holderPickup; _text = getText (configFile >> _type >> _classname >> "displayName"); -if (!canPickup || !DZE_CanPickup) exitwith { +if (!canPickup) exitwith { if (pickupInit) then { cutText [localize "str_pickup_limit_2","PLAIN DOWN"]; } else { @@ -31,22 +28,14 @@ if (isnil "claimed") then { }; canPickup = false; -DZE_CanPickup = false; -if(_classname isKindOf "TrapBear") exitwith {DZE_CanPickup = true; deleteVehicle _holder; }; +if (_classname isKindOf "TrapBear") exitWith { deleteVehicle _holder; }; player playActionNow "PutDown"; //Adding random chance of arrow is re-usable on pickup -_broken = false; - -if(_classname == "WoodenArrow") then { - if ([0.15] call fn_chance) then { - _broken = true; - }; -}; - -if (_broken) exitWith {DZE_CanPickup = true; deleteVehicle _holder; cutText [localize "str_broken_arrow", "PLAIN DOWN"]; }; +_broken = if ((_classname == "WoodenArrow") && {[0.15] call fn_chance}) then {true} else {false}; +if (_broken) exitWith { deleteVehicle _holder; cutText [localize "str_broken_arrow", "PLAIN DOWN"]; }; uiSleep 0.25; //Why are we waiting? Animation @@ -54,9 +43,9 @@ _claimedBy = _holder getVariable["claimed","0"]; if (_claimedBy != _playerID) exitWith { cutText [format [localize "str_player_beinglooted",_text] , "PLAIN DOWN"]; }; -if(_classname isKindOf "Bag_Base_EP1") exitwith { +if (_classname isKindOf "Bag_Base_EP1") exitWith { _PlayerNear = {isPlayer _x} count ((getPosATL _holder) nearEntities ["CAManBase", 10]) > 1; - if (_PlayerNear) exitWith {DZE_CanPickup = true; cutText [localize "str_pickup_limit_4", "PLAIN DOWN"]}; + if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_4", "PLAIN DOWN"]}; diag_log("Picked up a bag: " + _classname); @@ -66,16 +55,13 @@ if(_classname isKindOf "Bag_Base_EP1") exitwith { player action ["TakeBag", _holder]; } else { player action ["putbag", player]; - - uisleep 0.03; - + uiSleep 0.03; player action ["TakeBag", _holder]; }; - DZE_CanPickup = true; + //Lets wait to make sure the player has some kind of backpack. waitUntil { !isNull (unitBackpack player) }; - - uisleep 0.03; + uiSleep 0.03; //Lets call inventory save PVDZ_plr_Save = [player,nil,false]; @@ -85,7 +71,7 @@ if(_classname isKindOf "Bag_Base_EP1") exitwith { _config = (configFile >> _type >> _classname); //Remove melee magazines (BIS_fnc_invAdd fix) -{player removeMagazines _x} forEach MeleeMagazines; +{player removeMagazines _x} count MeleeMagazines; _isOk = [player,_config] call BIS_fnc_invAdd; @@ -97,14 +83,11 @@ if (_isOk) then { cutText [localize "str_player_24", "PLAIN DOWN"]; }; }; - -uisleep 3; +uiSleep 3; //adding melee mags back if needed _wpn = primaryWeapon player; -//diag_log format["Classname: %1, WPN: %2", _classname,_wpn]; _ismelee = (getNumber (configFile >> "CfgWeapons" >> _wpn >> "melee") == 1); if (_ismelee) then { call dayz_meleeMagazineCheck; -}; -DZE_CanPickup = true; \ No newline at end of file +}; \ No newline at end of file diff --git a/SQF/dayz_code/actions/player_addToolbelt.sqf b/SQF/dayz_code/actions/player_addToolbelt.sqf index a0150370a..af7a39680 100644 --- a/SQF/dayz_code/actions/player_addToolbelt.sqf +++ b/SQF/dayz_code/actions/player_addToolbelt.sqf @@ -1,17 +1,18 @@ +if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_39","PLAIN DOWN"];}; +DZE_ActionInProgress = true; private ["_item","_config","_onLadder","_hastoolweapon","_onBack","_text","_create","_config2","_melee2tb","_isOk"]; + disableSerialization; _item = _this; _config = configFile >> "cfgWeapons" >> _item; _onBack = dayz_onBack in MeleeWeapons; -if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_39","PLAIN DOWN"];}; -DZE_ActionInProgress = true; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; -if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"]}; +if (_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"]; DZE_ActionInProgress = false;}; _hastoolweapon = _item in weapons player; _text = getText (_config >> "displayName"); -if (!_hastoolweapon and !_onBack) exitWith {DZE_ActionInProgress = false; cutText [format [localize "str_player_30",_text] , "PLAIN DOWN"]}; +if (!_hastoolweapon and !_onBack) exitWith {cutText [format [localize "str_player_30",_text] , "PLAIN DOWN"]; DZE_ActionInProgress = false;}; call gear_ui_init; @@ -21,24 +22,26 @@ _config2 = configFile >> "cfgWeapons" >> _create; //removing current melee weapon if new melee selected _melee2tb = ""; -if ((_item in ["MeleeHatchet_DZE","MeleeCrowbar","MeleeMachete","MeleeFishingPole","MeleeSledge"]) || _item == DayZ_onBack) then { +if ((_item in ["ItemHatchet","ItemCrowbar","ItemMachete","ItemFishingPole","ItemHatchet_DZE","ItemSledge"]) || _item == DayZ_onBack) then { if (!carryClick) then { //free primary slot for new melee (remember item to add after) switch (primaryWeapon player) do { - case "MeleeHatchet_DZE": { if (!("ItemHatchet_DZE" in weapons player)) then { player removeWeapon "MeleeHatchet_DZE"; _melee2tb = "ItemHatchet_DZE"; }; }; - case "MeleeCrowbar": { if (!("ItemCrowbar" in weapons player)) then { player removeWeapon "MeleeCrowbar"; _melee2tb = "ItemCrowbar"; }; }; - case "MeleeMachete": { if (!("ItemMachete" in weapons player)) then { player removeWeapon "MeleeMachete"; _melee2tb = "ItemMachete"; }; }; + case "MeleeHatchet": {if !("ItemHatchet" in weapons player) then {player removeWeapon "MeleeHatchet"; _melee2tb = "ItemHatchet";};}; + case "MeleeCrowbar": {if !("ItemCrowbar" in weapons player) then {player removeWeapon "MeleeCrowbar"; _melee2tb = "ItemCrowbar";};}; + case "MeleeMachete": {if !("ItemMachete" in weapons player) then {player removeWeapon "MeleeMachete"; _melee2tb = "ItemMachete";};}; case "MeleeFishingPole": {player removeWeapon "MeleeFishingPole"; _melee2tb = "ItemFishingPole";}; - case "MeleeSledge": {player removeWeapon "MeleeSledge"; _melee2tb = "ItemSledge";}; + case "MeleeHatchet_DZE": {if !("ItemHatchet_DZE" in weapons player) then {player removeWeapon "MeleeHatchet_DZE"; _melee2tb = "ItemHatchet_DZE";};}; + case "MeleeSledge": {if !("ItemSledge" in weapons player) then {player removeWeapon "MeleeSledge"; _melee2tb = "ItemSledge";};}; }; } else { if (DayZ_onBack != "" || _item == DayZ_onBack) then { switch DayZ_onBack do { - case "MeleeHatchet_DZE": { if (!("ItemHatchet_DZE" in weapons player)) then { dayz_onBack = ""; _melee2tb = "ItemHatchet_DZE"; }; }; - case "MeleeCrowbar": { if (!("ItemCrowbar" in weapons player)) then { dayz_onBack = ""; _melee2tb = "ItemCrowbar"; }; }; - case "MeleeMachete": { if (!("ItemMachete" in weapons player)) then { dayz_onBack = ""; _melee2tb = "ItemMachete"; }; }; + case "MeleeHatchet": {if !("ItemHatchet" in weapons player) then {dayz_onBack = ""; _melee2tb = "ItemHatchet";};}; + case "MeleeCrowbar": {if !("ItemCrowbar" in weapons player) then {dayz_onBack = ""; _melee2tb = "ItemCrowbar";};}; + case "MeleeMachete": {if !("ItemMachete" in weapons player) then {dayz_onBack = ""; _melee2tb = "ItemMachete";};}; case "MeleeFishingPole": {dayz_onBack = ""; _melee2tb = "ItemFishingPole";}; - case "MeleeSledge": {dayz_onBack = ""; _melee2tb = "ItemSledge";}; + case "MeleeHatchet_DZE": {if !("ItemHatchet_DZE" in weapons player) then {dayz_onBack = ""; _melee2tb = "ItemHatchet_DZE";};}; + case "MeleeSledge": {if !("ItemSledge" in weapons player) then {dayz_onBack = ""; _melee2tb = "ItemSledge";};}; }; carryClick = false; ((findDisplay 106) displayCtrl 1209) ctrlSetText ""; @@ -47,7 +50,7 @@ if ((_item in ["MeleeHatchet_DZE","MeleeCrowbar","MeleeMachete","MeleeFishingPol }; //Remove melee magazines (BIS_fnc_invAdd fix) (add new melee ammo to array if needed) -{player removeMagazines _x} forEach ["Hatchet_Swing","Sledge_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing"]; +{player removeMagazines _x} count ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing","Sledge_Swing"]; _isOk = [player,_config2] call BIS_fnc_invAdd; if (_isOk) then { @@ -57,9 +60,9 @@ if (_isOk) then { //we know there is place to add item but to prevent BE spam using _config2 _config2 = _melee2tb; _isOk = [player,_config2] call BIS_fnc_invAdd; - }; + }; } else { closeDialog 0; cutText [localize "str_player_24", "PLAIN DOWN"]; }; -DZE_ActionInProgress = false; +DZE_ActionInProgress = false; \ No newline at end of file diff --git a/SQF/dayz_code/actions/player_addtoBack.sqf b/SQF/dayz_code/actions/player_addtoBack.sqf index 6b2ac3fb4..9e1a1ef76 100644 --- a/SQF/dayz_code/actions/player_addtoBack.sqf +++ b/SQF/dayz_code/actions/player_addtoBack.sqf @@ -14,13 +14,14 @@ if (dayZ_OnBack != "") exitWith {closeDialog 0; cutText [format [localize "str_p call gear_ui_init; -if (_item in ["ItemHatchet_DZE","ItemCrowbar","ItemMachete","ItemFishingPole","ItemSledge"]) then { +if (_item in ["ItemHatchet","ItemHatchet_DZE","ItemCrowbar","ItemMachete","ItemFishingPole","ItemSledge"]) then { //free primary slot for new melee (remember item to add after) switch (_item) do { - case "ItemHatchet_DZE": {player removeWeapon "ItemHatchet_DZE"; dayz_onBack = "MeleeHatchet_DZE";}; + case "ItemHatchet": {player removeWeapon "ItemHatchet"; dayz_onBack = "MeleeHatchet";}; case "ItemCrowbar": {player removeWeapon "ItemCrowbar"; dayz_onBack = "MeleeCrowbar";}; case "ItemMachete": {player removeWeapon "ItemMachete"; dayz_onBack = "MeleeMachete";}; case "ItemFishingPole": {player removeWeapon "ItemFishingPole"; dayz_onBack = "MeleeFishingPole";}; + case "ItemHatchet_DZE": {player removeWeapon "ItemHatchet_DZE"; dayz_onBack = "MeleeHatchet_DZE";}; case "ItemSledge": {player removeWeapon "ItemSledge"; dayz_onBack = "MeleeSledge";}; }; disableSerialization; diff --git a/SQF/dayz_code/actions/player_build.sqf b/SQF/dayz_code/actions/player_build.sqf index a1c61bf28..1418e8f0e 100644 --- a/SQF/dayz_code/actions/player_build.sqf +++ b/SQF/dayz_code/actions/player_build.sqf @@ -1,3 +1,5 @@ +// If parameters were passed redirect to vanilla player_build (Epoch items don't pass anything) +if ((!isNil "_this") && {typeName _this == "ARRAY"} && {count _this > 0}) exitWith {_this spawn player_buildVanilla;}; /* DayZ Base Building Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com. diff --git a/SQF/dayz_code/actions/player_build_vanilla.sqf b/SQF/dayz_code/actions/player_buildVanilla.sqf similarity index 100% rename from SQF/dayz_code/actions/player_build_vanilla.sqf rename to SQF/dayz_code/actions/player_buildVanilla.sqf diff --git a/SQF/dayz_code/actions/player_craftItem.sqf b/SQF/dayz_code/actions/player_craftItem.sqf index 1b8a2ada8..fb9f13349 100644 --- a/SQF/dayz_code/actions/player_craftItem.sqf +++ b/SQF/dayz_code/actions/player_craftItem.sqf @@ -1,3 +1,6 @@ +// If no parameters were passed redirect to vanilla player_craftItem (Epoch items always pass an array) +if ((isNil "_this") or {(typeName _this == "ARRAY") && (count _this < 1)}) exitWith {[] spawn player_craftItemVanilla;}; + /* DayZ Epoch Crafting 0.3 Made for DayZ Epoch && Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com. diff --git a/SQF/dayz_code/actions/player_craftItem_vanilla.sqf b/SQF/dayz_code/actions/player_craftItemVanilla.sqf similarity index 100% rename from SQF/dayz_code/actions/player_craftItem_vanilla.sqf rename to SQF/dayz_code/actions/player_craftItemVanilla.sqf diff --git a/SQF/dayz_code/actions/player_drinkWater.sqf b/SQF/dayz_code/actions/player_drinkWater.sqf index 5eec54b9e..47c228cb7 100644 --- a/SQF/dayz_code/actions/player_drinkWater.sqf +++ b/SQF/dayz_code/actions/player_drinkWater.sqf @@ -1,4 +1,4 @@ -private["_playerPos","_canFill","_isPond","_isWell","_pondPos","_objectsWell","_onLadder","_hasbottleitem","_config","_item","_text","_objectsPond","_qty","_dis","_sfx","_isInfected","_bodiesNear","_chance"]; +private ["_playerPos","_canFill","_isPond","_isWell","_pondPos","_objectsWell","_onLadder","_hasbottleitem","_config","_item","_text","_objectsPond","_qty","_dis","_sfx","_isInfected","_bodiesNear","_chance","_itemorignal","_well"]; call gear_ui_init; closeDialog 0; @@ -53,10 +53,10 @@ if (!_canFill) then { }; if (_canFill) then { - _chance = 0.05; + _chance = 0.1; if (_itemorignal in boil_tin_cans) then { - _chance = 0.03; + _chance = 0.06; ["FoodDrink",0,[0,0,300,0]] call dayz_NutritionSystem; //[Energy,food,water,temp] } else { _chance = 0.03; diff --git a/SQF/dayz_code/actions/player_dropWeapon.sqf b/SQF/dayz_code/actions/player_dropWeapon.sqf index 1ed11175f..6eb7131fa 100644 --- a/SQF/dayz_code/actions/player_dropWeapon.sqf +++ b/SQF/dayz_code/actions/player_dropWeapon.sqf @@ -1,8 +1,9 @@ -private ["_item","_config","_onLadder","_consume","_bag","_droppedtype"]; +private ["_item","_config","_onLadder","_consume","_bag","_droppedType"]; + disableSerialization; _item = _this; _config = configFile >> "CfgWeapons" >> _item; -_droppedtype = (gettext (_config >> "droppeditem")); +_droppedType = getText (_config >> "droppeditem"); _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; if (_onLadder) exitWith { cutText [localize "str_player_21", "PLAIN DOWN"]; r_action_count = 0; }; @@ -17,19 +18,19 @@ if ((dayz_onBack != "") && (dayz_onBack in MeleeWeapons) && carryClick) then { case "MeleeHatchet": {_item = "ItemHatchet"; dayz_onBack = "";}; case "MeleeCrowbar": {_item = "ItemCrowbar"; dayz_onBack = "";}; case "MeleeMachete": {_item = "ItemMachete"; dayz_onBack = "";}; + case "MeleeHatchet_DZE": {_item = "ItemHatchet_DZE"; dayz_onBack = "";}; case "MeleeSledge": {_item = "ItemSledge"; dayz_onBack = "";}; - case "MeleeFishingPole": {_item = "ItemFishingPole"; dayz_onBack = "";}; }; carryClick = false; ((findDisplay 106) displayCtrl 1209) ctrlSetText ""; } else { player removeMagazines _consume; player removeWeapon _item; - if (_droppedtype == "") then { _item = _this; } else { _item = _droppedtype; }; + _item = if (_droppedType == "") then {_this} else {_droppedType}; }; _bag = createVehicle [format["WeaponHolder_%1",_item],getPosATL player,[], 1, "CAN_COLLIDE"]; _bag modelToWorld getPosATL player; -_bag setdir (getDir player); +_bag setDir (getDir player); player reveal _bag; r_action_count = 0; \ No newline at end of file diff --git a/SQF/dayz_code/actions/player_goFishing.sqf b/SQF/dayz_code/actions/player_goFishing.sqf index edeb430fa..a474f9198 100644 --- a/SQF/dayz_code/actions/player_goFishing.sqf +++ b/SQF/dayz_code/actions/player_goFishing.sqf @@ -4,8 +4,8 @@ Made for DayZ Mod please ask permission to use/edit/distrubute email vbawol@veteranbastards.com. fixed by facoptere@gmail.com for dayzmod */ -private ["_linecastmax","_linecastmin","_num","_position","_ispond","_objectsPond","_isPondNearBy","_isOk","_counter", -"_vehicle","_inVehicle","_rnd","_itemOut","_text","_item","_itemtodrop","_result", "_elevation"]; +private ["_linecastmax","_linecastmin","_num","_position","_ispond","_objectsPond","_isPondNearBy","_isOk","_counter","_vehicle","_inVehicle", +"_rnd","_itemOut","_text","_item","_itemtodrop","_result","_elevation","_inBoat","_i","_ret","_bb","_w2m","_dir"]; //if (!isNil "faco_goFishing") exitWith { _this call faco_goFishing }; @@ -21,7 +21,7 @@ dayz_fishingInprogress = true; _linecastmax = 67; _isOk = false; -_inBoat = (player != vehicle player) and {((vehicle player) isKindOf "Ship")}; +_inBoat = (player != vehicle player) && {(vehicle player) isKindOf "Ship"}; for "_i" from 1 to 10 do { _num = floor(random (2 * _linecastmax / 3) + _linecastmax / 3); _position = if (_inBoat) then { (vehicle player) modeltoworld [-_num, 0 ,0] } else { player modeltoworld [0,_num,0] }; @@ -52,11 +52,11 @@ for "_i" from 1 to 10 do { }; } count (nearestObjects [_x, [], 2]); // find ponds if (_ret) exitWith {}; - } foreach nearestObjects [_position, ["waterHoleProxy"], 45]; // find waterholeproxy close to pond centers + } forEach nearestObjects [_position, ["waterHoleProxy"], 45]; // find waterholeproxy close to pond centers _ret }; // diag_log [ _position, _elevation, surfaceIsWater _position, _linecastmax, _ispond, "=>", ((surfaceIsWater _position or _ispond) and ((player == vehicle player) or {((vehicle player) isKindOf "Ship")})) ]; - if ((surfaceIsWater _position or _ispond) and ((player == vehicle player) or {((vehicle player) isKindOf "Ship")})) exitWith { + if ((surfaceIsWater _position or _ispond) && ((player == vehicle player) or {(vehicle player) isKindOf "Ship"})) exitWith { _isOk = true; }; }; @@ -73,7 +73,6 @@ player playActionNow "GestureSwing"; // Alert zeds [player,3,true,(getPosATL player)] call player_alertZombies; - r_interrupt = false; while {_isOk} do { @@ -87,9 +86,7 @@ while {_isOk} do { cutText [localize "str_fishing_canceled", "PLAIN DOWN"]; } else { //make sure the player isnt swimming - - // wait for animation - uiSleep 2; + uiSleep 2; // wait for animation // check if player is in boat _vehicle = vehicle player; @@ -104,7 +101,7 @@ while {_isOk} do { if (rain > 0) then {_rnd = _rnd / 2;}; // 1% chance to catch anything - if((random _rnd) <= 5) then { + if ((random _rnd) <= 5) then { // Just the one fish for now _itemOut = []; _itemOut = switch (true) do { @@ -115,7 +112,7 @@ while {_isOk} do { }; _itemOut = _itemOut call BIS_fnc_selectRandom; _text = getText (configFile >> "CfgMagazines" >> _itemOut >> "displayName"); - if(_inVehicle) then { + if (_inVehicle) then { _item = _vehicle; _itemtodrop = _itemOut; _item addMagazineCargoGlobal [_itemtodrop,1]; @@ -140,7 +137,6 @@ while {_isOk} do { ["Working",0,[3,2,8,0]] call dayz_NutritionSystem; _isOk = false; } else { - switch (true) do { case (_counter == 0) : { cutText [format [localize "str_fishing_cast",_num], "PLAIN DOWN"]; }; case (_counter == 4) : { cutText [localize "str_fishing_pull", "PLAIN DOWN"]; player playActionNow "GesturePoint"; }; @@ -149,9 +145,9 @@ while {_isOk} do { }; _counter = _counter + 1; - if(_counter == 12) then { + if (_counter == 12) then { _isOk = false; - uisleep 1; + uiSleep 1; cutText [localize "str_fishing_failed", "PLAIN DOWN"]; }; }; diff --git a/SQF/dayz_code/actions/player_makefire.sqf b/SQF/dayz_code/actions/player_makefire.sqf index c3236bcc2..db0a2688a 100644 --- a/SQF/dayz_code/actions/player_makefire.sqf +++ b/SQF/dayz_code/actions/player_makefire.sqf @@ -1,4 +1,4 @@ -private ["_item","_config","_text","_booleans","_worldspace","_dir","_location","_dis","_fire"]; +private ["_item","_config","_text","_booleans","_worldspace","_dir","_location","_dis","_fire","_tool","_itemPile"]; _tool = _this; call gear_ui_init; @@ -6,12 +6,11 @@ closeDialog 0; _item = "ItemLog"; _itemPile = "PartWoodPile"; - _config = configFile >> "CfgMagazines" >> _item; _text = getText (_config >> "displayName"); // item is missing or tools are missing -if ((!(_item IN magazines player)) && (!(_itemPile in magazines player))) exitWith { +if (!(_item in magazines player) && !(_itemPile in magazines player)) exitWith { //cutText [localize "str_player_22", "PLAIN DOWN"]; (localize "str_player_22") call dayz_rollingMessages; }; @@ -45,17 +44,15 @@ if ((count _worldspace) == 2) then { // Added Nutrition-Factor for work ["Working",0,[20,40,15,0]] call dayz_NutritionSystem; - + uiSleep 5; _fire = createVehicle ["Land_Fire_DZ", getMarkerpos "respawn_west", [], 0, "CAN_COLLIDE"]; _fire setDir _dir; _fire setPos _location; // follow terrain slope player reveal _fire; - [_fire,true] call dayz_inflame; _fire spawn player_fireMonitor; - if (dayz_playerAchievements select 14 < 1) then { // Firestarter diff --git a/SQF/dayz_code/actions/player_setTrap.sqf b/SQF/dayz_code/actions/player_setTrap.sqf index e835855ee..379f117cb 100644 --- a/SQF/dayz_code/actions/player_setTrap.sqf +++ b/SQF/dayz_code/actions/player_setTrap.sqf @@ -1,4 +1,4 @@ -private["_item","_config","_onLadder","_classname","_text","_consume","_hastrapitem","_location","_object"]; +private ["_item","_config","_onLadder","_classname","_text","_consume","_hastrapitem","_location","_object"]; _item = _this; _config = configFile >> "CfgWeapons" >> _item; @@ -22,7 +22,7 @@ player removeMagazine _item; _location = getPosATL player; player playActionNow "PutDown"; -uiSleep 1; +sleep 1; _object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; _object setDir (getDir player); diff --git a/SQF/dayz_code/actions/player_sleep.sqf b/SQF/dayz_code/actions/player_sleep.sqf index c2d99c73c..52e7e3d50 100644 --- a/SQF/dayz_code/actions/player_sleep.sqf +++ b/SQF/dayz_code/actions/player_sleep.sqf @@ -1,7 +1,6 @@ -private ["_playArray","_lastRest","_blood"]; +private ["_playArray","_lastRest","_blood","_timesincedrink","_bloodinc","_Moves","_sleepArray","_animState","_started","_finished","_timer","_i","_r","_cureAttempt","_isAsleep","_cureChance","_infectedStatus","_randomamount"]; //_timesincedrink = time - dayz_lastDrink; //_bloodinc =100; Removed for now(untested) due to it not needed yet - //http://community.bistudio.com/wiki/ArmA2:_Moves _sleepArray = ["aidlppnemstpsnonwnondnon_sleepc_laydown","aidlppnemstpsnonwnondnon_sleepc_lookaround","aidlppnemstpsnonwnondnon_sleepc_scratch","aidlppnemstpsnonwnondnon_sleepc_sleep","aidlppnemstpsnonwnondnon_sleepc_sleep0"]; @@ -24,15 +23,10 @@ _lastRest = player getVariable ["lastRest", 0]; while {r_doLoop} do { _isAsleep = (animationState player) in _sleepArray; - - if (_isAsleep and !_started) then { - - _started = true; - }; + if (_isAsleep && !_started) then {_started = true;}; if (_started) then { if (!r_player_unconscious) then { - if (r_player_infected) then { //every 30 seconds run Random Chance to cure infection if (diag_ticktime - _lastRest > 30) then { @@ -58,7 +52,7 @@ while {r_doLoop} do { }; //make sure player isnt infected or inpain. - if (!r_player_injured AND !r_player_infected AND !(r_player_Sepsis select 0)) then { + if (!r_player_injured && !r_player_infected && !(r_player_Sepsis select 0)) then { //Give 53 + random amount of blood every 16 secs if player isn't injured. if ((diag_tickTime - _timer) >= 16) then { if (r_player_blood < 12000) then { @@ -67,7 +61,7 @@ while {r_doLoop} do { _blood = 53 + _randomamount; //Max Possible 153. }; - //Lets make sure we do go over the max amount + //Make sure we don't go over the max amount if ((r_player_blood - 12000) < _blood) then { r_player_bloodregen = r_player_bloodregen + _blood; } else { @@ -77,8 +71,7 @@ while {r_doLoop} do { _timer = diag_tickTime; _infectedStatus = if (r_player_infected) then { "Yes" } else { "Cured" }; cutText [format [localize "str_sleepStats",_blood,r_player_blood], "PLAIN DOWN"]; - }; - + }; }; if (!_isAsleep) then { @@ -97,7 +90,7 @@ while {r_doLoop} do { r_doLoop = false; if (r_interrupt) then { - systemChat(localize ("str_endSleepStandUp")); + systemChat (localize "str_endSleepStandUp"); r_interrupt = false; player playmoveNow ""; player playActionNow "stop"; @@ -106,5 +99,4 @@ if (r_interrupt) then { //Removed due to player sync returning [] //PVDZ_plr_Save = [player,nil,true,dayz_playerAchievements]; //publicVariableServer "PVDZ_plr_Save"; -R3F_TIRED_Accumulator = 0; - +R3F_TIRED_Accumulator = 0; \ No newline at end of file diff --git a/SQF/dayz_code/actions/player_switchWeapon.sqf b/SQF/dayz_code/actions/player_switchWeapon.sqf index 066969df8..3b592da6f 100644 --- a/SQF/dayz_code/actions/player_switchWeapon.sqf +++ b/SQF/dayz_code/actions/player_switchWeapon.sqf @@ -25,7 +25,7 @@ dz_fn_switchWeapon = if (vehicle player != player) exitWith {}; if Player_IsOnLadder() exitWith {}; - private ["_current", "_primary", "_secondary"]; + private ["_current","_primary","_secondary","_swapWeapons"]; _current = currentWeapon player; @@ -101,6 +101,8 @@ dz_fn_switchWeapon = //In primary case 1: { + if (Player_GetStance() == Player_GetStance_PRONE) then + { player playMoveNow "AmovPpneMstpSrasWrflDnon"; }; player selectWeapon primaryWeapon player; }; @@ -108,6 +110,8 @@ dz_fn_switchWeapon = case 2: { if (diag_tickTime - dz_switchWeapon_pistolTime < 1) exitWith {}; + if (Player_GetStance() == Player_GetStance_PRONE) then + { player playMoveNow "AmovPpneMstpSrasWrflDnon"; }; true call dz_fn_switchWeapon_swap; }; }; @@ -179,12 +183,16 @@ dz_fn_switchWeapon = case 1: { player selectWeapon primaryWeapon player; + if (Player_GetStance() == Player_GetStance_PRONE) then + { player playMoveNow "AmovPpneMstpSrasWrflDnon"; }; }; //On back case 2: { if (diag_tickTime - dz_switchWeapon_pistolTime < 1) exitWith {}; + if (Player_GetStance() == Player_GetStance_PRONE) then + { player playMoveNow "AmovPpneMstpSrasWrflDnon"; }; true call dz_fn_switchWeapon_swap; }; }; @@ -241,12 +249,12 @@ dz_fn_switchWeapon_swapSecure = dz_switchWeapon_anim = format [ "AmovP%1MstpSrasWrflDnon_AmovP%1MstpSrasWpstDnon", - //Switch on the 6th letter of the animation class - switch ((toArray animationState player) select 5) do + //Switch on player stance + switch Player_GetStance() do { - case 101: { "erc" }; //e for erc for erected - case 107: { "knl" }; //k for knl for kneeling - case 112: { "pne" }; //p for pne for prone + case Player_GetStance_STAND: { "erc" }; + case Player_GetStance_KNEEL: { "knl" }; + case Player_GetStance_PRONE: { "pne" }; } ]; @@ -259,7 +267,7 @@ dz_fn_switchWeapon_swapSecure = dz_fn_switchWeapon_animDone = { //Wait at most TIMEOUT seconds - if (dz_switchWeapon_time - diag_tickTime > TIMEOUT) exitWith + if (diag_tickTime - dz_switchWeapon_time > TIMEOUT) exitWith { player removeEventHandler ["AnimDone", dz_switchWeapon_handler]; Mutex_Unlock(dz_switchWeapon_mutex); diff --git a/SQF/dayz_code/actions/player_useMeds.sqf b/SQF/dayz_code/actions/player_useMeds.sqf index 9ef0a5625..01dd85a15 100644 --- a/SQF/dayz_code/actions/player_useMeds.sqf +++ b/SQF/dayz_code/actions/player_useMeds.sqf @@ -1,4 +1,4 @@ -private["_item","_onLadder","_hasmeditem","_config","_text","_id"]; +private ["_item","_onLadder","_hasmeditem","_config","_text","_display"]; _item = _this; call gear_ui_init; diff --git a/SQF/dayz_code/actions/refuel.sqf b/SQF/dayz_code/actions/refuel.sqf index 8a4a6e017..9c7c6de6d 100644 --- a/SQF/dayz_code/actions/refuel.sqf +++ b/SQF/dayz_code/actions/refuel.sqf @@ -1,7 +1,7 @@ -private["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling"]; - if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_24","PLAIN DOWN"]}; DZE_ActionInProgress = true; +private ["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling","_array","_cantype", +"_emptycan","_isMan","_isAnimal","_isZombie","_started","_finished","_animState","_isRefuel"]; _vehicle = cursorTarget; _array = _this select 3; @@ -18,11 +18,10 @@ _isMan = _vehicle isKindOf "Man"; _isAnimal = _vehicle isKindOf "Animal"; _isZombie = _vehicle isKindOf "zZombie_base"; -if (_isMan or _isAnimal or _isZombie) exitWith {DZE_ActionInProgress = false; cutText [localize "str_refuel_notvehicle", "PLAIN DOWN"] }; -if (fuel _vehicle == 1) exitwith {DZE_ActionInProgress = false;}; +if (_isMan or _isAnimal or _isZombie) exitWith { cutText [localize "str_refuel_notvehicle", "PLAIN DOWN"]; DZE_ActionInProgress = false;}; +if (fuel _vehicle == 1) exitWith {DZE_ActionInProgress = false;}; player removeAction s_player_fillfuel + _capacity; - a_player_jerryfilling = true; player setVariable ["fueling", true]; @@ -57,7 +56,7 @@ if (!_fueling) then { r_doLoop = false; _finished = true; }; - uisleep 0.1; + uiSleep 0.1; }; r_doLoop = false; @@ -70,8 +69,7 @@ if (!_fueling) then { }; cutText [format [localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"]; - uisleep 1; - + uiSleep 1; call fnc_usec_medic_removeActions; }; [player] allowGetIn true; diff --git a/SQF/dayz_code/actions/repair.sqf b/SQF/dayz_code/actions/repair.sqf index c5eb50bd3..f81e6120a 100644 --- a/SQF/dayz_code/actions/repair.sqf +++ b/SQF/dayz_code/actions/repair.sqf @@ -1,6 +1,6 @@ -private["_id","_array","_vehicle","_part","_hitpoint","_type","_hasToolbox","_section","_nameType","_namePart","_damage","_selection","_dis","_sfx","_hitpoints","_allFixed"]; if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_92","PLAIN DOWN"];}; DZE_ActionInProgress = true; +private ["_array","_vehicle","_part","_hitpoint","_type","_hasToolbox","_section","_nameType","_namePart","_damage","_selection","_dis","_sfx","_hitpoints","_allFixed","__FILE__"]; _id = _this select 2; _array = _this select 3; @@ -25,7 +25,7 @@ _namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName"); if (_section and _hasToolbox) then { player removeMagazine _part; player playActionNow "Medic"; - uisleep 1; + sleep 1; _dis=20; _sfx = "repair"; @@ -35,7 +35,7 @@ if (_section and _hasToolbox) then { // Added Nutrition-Factor for work ["Working",0,[20,40,15,0]] call dayz_NutritionSystem; - uisleep 5; + sleep 5; _damage = [_vehicle,_hitpoint] call object_getHit; _vehicle removeAction _id; diff --git a/SQF/dayz_code/actions/repair_vehicle.sqf b/SQF/dayz_code/actions/repair_vehicle.sqf index 1120187f0..5ce0c38d0 100644 --- a/SQF/dayz_code/actions/repair_vehicle.sqf +++ b/SQF/dayz_code/actions/repair_vehicle.sqf @@ -1,7 +1,7 @@ private ["_part","_cancel","_color","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints","_damagePercent","_configVeh"]; _vehicle = _this select 3; -{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; +{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; dayz_myCursorTarget = _vehicle; _hitpoints = _vehicle call vehicle_getHitpoints; @@ -17,7 +17,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints; _configVeh = configFile >> "cfgVehicles" >> "RepairParts" >> _x; _part = getText(_configVeh >> "part"); - if (isnil ("_part")) then { _part = "PartGeneric"; }; + if (isNil "_part") then { _part = "PartGeneric"; }; // get every damaged part no matter how tiny damage is! _damagePercent = str(round(_damage * 100))+"% Damage"; @@ -29,15 +29,15 @@ _hitpoints = _vehicle call vehicle_getHitpoints; _cmpt = format[localize "str_actions_medical_09",_cmpt,_damagePercent]; _string = format["%2",_color,_cmpt]; //Repair - Part - _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""]; + _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true]; s_player_repairActions set [count s_player_repairActions,_handle]; }; } forEach _hitpoints; -if(count _hitpoints > 0 ) then { +if (count _hitpoints > 0 ) then { //ArmA OA String - _cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false, "",""]; + _cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false]; s_player_repairActions set [count s_player_repairActions,_cancel]; s_player_repair_crtl = 1; }; \ No newline at end of file diff --git a/SQF/dayz_code/actions/salvage.sqf b/SQF/dayz_code/actions/salvage.sqf index 7c0dad8f7..8f671c3f9 100644 --- a/SQF/dayz_code/actions/salvage.sqf +++ b/SQF/dayz_code/actions/salvage.sqf @@ -1,6 +1,6 @@ -private ["_vehicle","_part","_hitpoint","_type","_selection","_array","_started","_finished","_animState","_isMedic","_isOK","_brokenPart","_findPercent","_damage","_hasToolbox","_nameType","_namePart"]; +private ["_array","_vehicle","_part","_hitpoint","_type","_isOK","_brokenPart","_started","_finished","_hasToolbox","_nameType","_namePart","_animState","_isMedic","_damage","_BreakableParts","_selection","_wpn","_classname","_ismelee"]; -if (dayz_salvageInProgress) exitWith {cutText [localize "str_salvage_inprogress", "PLAIN DOWN"]; }; +if (dayz_salvageInProgress) exitWith { cutText [localize "str_salvage_inprogress", "PLAIN DOWN"]; }; dayz_salvageInProgress = true; _array = _this select 3; @@ -8,25 +8,21 @@ _vehicle = _array select 0; _part = _array select 1; _hitpoint = _array select 2; _type = typeOf _vehicle; - _isOK = false; _brokenPart = false; _started = false; _finished = false; - _hasToolbox = "ItemToolbox" in items player; _nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName"); _namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName"); -{_vehicle removeAction _x} forEach s_player_repairActions; - s_player_repairActions = []; +{_vehicle removeAction _x} count s_player_repairActions; +s_player_repairActions = []; s_player_repair_crtl = 1; if (_hasToolbox) then { - player playActionNow "Medic"; - [player,"repair",0,false] call dayz_zombieSpeak; [player,50,true,(getPosATL player)] call player_alertZombies; @@ -49,11 +45,10 @@ if (_hasToolbox) then { if (_finished) then { _damage = [_vehicle,_hitpoint] call object_getHit; - if (_damage < 1) then { + if (_damage < 0.10) then { _BreakableParts = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitLGlass","HitRGlass","HitEngine","HitFuel","HitHRotor"]; if (_hitpoint in _BreakableParts) then { - _findPercent = (1 - _damage) * 10; - if(ceil (random _findPercent) == 1) then { + if ((random 1) < 0.3) then { _isOK = true; _brokenPart = true; } else { @@ -78,9 +73,9 @@ if (_hasToolbox) then { _vehicle call fnc_veh_ResetEH; _vehicle setvelocity [0,0,1]; if(_brokenPart) then { - cutText [format [localize "str_salvage_destroyed",_namePart,_nameType], "PLAIN DOWN"]; + cutText [format [localize "str_salvage_destroyed",_namePart,_nameType], "PLAIN DOWN"]; } else { - cutText [format [localize "str_salvage_removed",_namePart,_nameType], "PLAIN DOWN"]; + cutText [format [localize "str_salvage_removed",_namePart,_nameType], "PLAIN DOWN"]; }; } else { cutText [localize "str_player_24", "PLAIN DOWN"]; @@ -100,7 +95,6 @@ if (_hasToolbox) then { dayz_myCursorTarget = objNull; s_player_repair_crtl = -1; - dayz_salvageInProgress = false; //adding melee mags back if needed @@ -109,4 +103,4 @@ _wpn = primaryWeapon player; _ismelee = (getNumber (configFile >> "CfgWeapons" >> _wpn >> "melee") == 1); if (_ismelee) then { call dayz_meleeMagazineCheck; -}; +}; \ No newline at end of file diff --git a/SQF/dayz_code/actions/salvage_vehicle.sqf b/SQF/dayz_code/actions/salvage_vehicle.sqf index 667c29c13..84bbc03a3 100644 --- a/SQF/dayz_code/actions/salvage_vehicle.sqf +++ b/SQF/dayz_code/actions/salvage_vehicle.sqf @@ -1,7 +1,8 @@ -private ["_part","_color"]; +private ["_part","_color","_vehicle","_PlayerNear","_hitpoints","_cursorTarget","_isATV","_is6WheelType","_HasNoGlassKind", +"_6WheelTypeArray","_NoGlassArray","_NoExtraWheelsArray","_RemovedPartsArray","_damage","_cmpt","_configVeh","_damagePercent","_string","_handle","_cancel"]; _vehicle = _this select 3; -{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; +{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; _PlayerNear = {isPlayer _x} count ((getPosATL _vehicle) nearEntities ["CAManBase", 10]) > 1; if (_PlayerNear) exitWith {dayz_myCursorTarget = objNull; cutText [localize "str_pickup_limit_5", "PLAIN DOWN"];}; @@ -12,7 +13,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints; _cursorTarget = cursorTarget; _isATV = typeof _cursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"]; _is6WheelType = typeOf _cursorTarget in ["V3S_Civ","Ural_TK_CIV_EP1"]; -_HasNoGlassKind = (_cursorTarget iskindof "Motorcycle") or (_cursorTarget iskindof "Bicycle"); +_HasNoGlassKind = (_cursorTarget isKindOf "Motorcycle") or (_cursorTarget isKindOf "Bicycle"); _6WheelTypeArray = ["HitLMWheel","HitRMWheel"]; _NoGlassArray = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitLGlass","HitRGlass"]; @@ -23,11 +24,11 @@ if (_isATV or _HasNoGlassKind) then { _hitpoints = _hitpoints - _NoGlassArray; }; -if (_cursorTarget iskindof "tractor") then { +if (_cursorTarget isKindOf "tractor") then { _hitpoints = _hitpoints - ["motor","HitLFWheel","HitRFWheel","HitLBWheel","HitRBWheel","HitLF2Wheel","HitRF2Wheel","HitLMWheel","HitRMWheel"]; }; -if ((_cursorTarget iskindof "Bicycle") or (_cursorTarget iskindof "Motocycle")) then { +if ((_cursorTarget isKindOf "Bicycle") or (_cursorTarget isKindOf "Motocycle")) then { _hitpoints = _hitpoints - ["HitEngine","HitFuel"]; }; @@ -40,7 +41,7 @@ if (_is6WheelType) then { { _damage = [_vehicle,_x] call object_getHit; - if (!(_x in _RemovedPartsArray)) then { + if !(_x in _RemovedPartsArray) then { _cmpt = toArray (_x); _cmpt set [0,20]; _cmpt set [1,toArray ("-") select 0]; @@ -53,14 +54,14 @@ if (_is6WheelType) then { //get every damaged part no matter how tiny damage is! _damagePercent = str(round(_damage * 100))+"% Damage"; - if (_damage < 1) then { + if (_damage < 0.10) then { if ((_damage >= 0) and (_damage <= 0.25)) then {_color = "color='#00ff00'";}; //green if ((_damage >= 0.26) and (_damage <= 0.50)) then {_color = "color='#ffff00'";}; //yellow if ((_damage >= 0.51) and (_damage <= 0.75)) then {_color = "color='#ff8800'";}; //orange if ((_damage >= 0.76) and (_damage <= 1)) then {_color = "color='#ff0000'";}; //red _string = format[localize "str_actions_repair_01",_cmpt,_damagePercent]; _string = format["%2",_color,_string]; //Remove - Part - _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""]; + _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true]; s_player_repairActions set [count s_player_repairActions,_handle]; }; }; @@ -68,7 +69,7 @@ if (_is6WheelType) then { if (count _hitpoints > 0 ) then { //ArmA OA String - _cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false, "",""]; + _cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false]; s_player_repairActions set [count s_player_repairActions,_cancel]; s_player_repair_crtl = 1; }; \ No newline at end of file diff --git a/SQF/dayz_code/actions/siphonFuel.sqf b/SQF/dayz_code/actions/siphonFuel.sqf index 5a30dafce..9e8ff10ed 100644 --- a/SQF/dayz_code/actions/siphonFuel.sqf +++ b/SQF/dayz_code/actions/siphonFuel.sqf @@ -1,4 +1,6 @@ -private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort","_canNameEmpty","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCanEmpty","_configVeh","_capacity","_nameText","_availableCansEmpty","_hasHose"]; +private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort", +"_canNameEmpty","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCanEmpty","_configVeh","_capacity","_nameText", +"_availableCansEmpty","_hasHose","_PlayerNear","_isMan","_isAnimal","_isZombie"]; player removeAction s_player_siphonfuel; _hasHose = "equip_hose" in magazines player; @@ -13,7 +15,7 @@ _vehicle = _this select 3; _abort = false; // Static vehicle fuel information -_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle); +_configVeh = configFile >> "cfgVehicles" >> typeOf _vehicle; _capacity = getNumber(_configVeh >> "fuelCapacity"); _nameText = getText(_configVeh >> "displayName"); _isMan = _vehicle isKindOf "Man"; diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index 45aad954a..f7faeb46c 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -3,6 +3,8 @@ // To change a variable copy it to your mission init.sqf in the Epoch Config Variables section // Standard DayZ variables are found in dayz_code\init\variables.sqf +dayz_knifeDulling = false; // Enable knife dulling. Knives need to be sharpened after so many uses. +dayz_waterBottleBreaking = false; // Water bottles have a chance to break when boiling and require duct tape to fix dayz_sellDistance_vehicle = 10; // Max distance players can sell land vehicles from at traders dayz_sellDistance_boat = 30; // Max distance players can sell boats from at traders dayz_sellDistance_air = 40; // Max distance players can sell air vehicles from at traders diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 4c812be09..4bc62b7c8 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -91,6 +91,7 @@ if (!isDedicated) then { } else { player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf"; }; + player_buildVanilla = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_buildVanilla.sqf"; fn_buildCamera = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildCamera.sqf"; object_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_build.sqf"; object_upgradeFireplace = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_upgradeFireplace.sqf"; @@ -134,7 +135,7 @@ if (!isDedicated) then { //Crafting fn_updateCraftUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_updateCraftUI.sqf"; - player_craftItem_DZV = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf"; + player_craftItemVanilla = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItemVanilla.sqf"; player_craftItemGUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItemGUI.sqf"; player_checkRecipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_checkRecipe.sqf"; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index bdbb1836d..526ad4146 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -34,7 +34,7 @@ DayZ_Female = ["SurvivorW2_DZ","BanditW1_DZ","BanditW2_DZ","SurvivorWcombat_DZ", //Classnames for specific items MeleeWeapons = ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeBaseball","MeleeBaseBallBat","MeleeBaseBallBatBarbed","MeleeBaseBallBatNails","MeleeFishingPole","MeleeSledge","MeleeHatchet_DZE"]; -MeleeMagazines = ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Bat_Swing","BatBarbed_Swing","BatNails_Swing","Fishing_Swing"]; +MeleeMagazines = ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Bat_Swing","BatBarbed_Swing","BatNails_Swing","Fishing_Swing","Sledge_Swing"]; Dayz_fishingItems = ["MeleeFishingPole"]; Dayz_plants = ["Dayz_Plant1","Dayz_Plant2","Dayz_Plant3"]; Dayz_attachment_array = ["Attachment_ACG","Attachment_AIM"]; @@ -711,7 +711,6 @@ if (!isDedicated) then { DZE_myHaloVehicle = objNull; dayz_myLiftVehicle = objNull; DZE_Friends = []; - DZE_CanPickup = true; DZE_Q = false; DZE_Z = false; DZE_Q_alt = false; diff --git a/SQF/dayz_code/medical/publicEH/promptRName.sqf b/SQF/dayz_code/medical/publicEH/promptRName.sqf deleted file mode 100644 index 75ec85825..000000000 --- a/SQF/dayz_code/medical/publicEH/promptRName.sqf +++ /dev/null @@ -1,5 +0,0 @@ -// promptRName.sqf - -_unit = _this select 0; - -call compile format ["server globalChat reviver_%1", _unit]; \ No newline at end of file diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 331805eac..77e08366e 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -1089,6 +1089,7 @@ Demontáž již probíhá. Récupération déjà en cours. Die Demontage läuft bereits. + Reeds bezig met bergen. @@ -1098,6 +1099,7 @@ %1 se vám při pokusu o demontáž z %2 podařilo úplně zničit. Vous avez détruit %1 lors tentative de retrait de %2 %1 wurde zerstoert, als du versucht hast, %2 auszuschlachten. + Je hebt %1 gesloopt tijdens het demonteren van de %2 @@ -1107,6 +1109,7 @@ Úspěšně jste odmontovali %1 z %2 Vous avez retiré %1 de %2 %1 wurde erfolgreich aus %2 ausgebaut. + Je hebt met succes de %1 van de %2 verwijderd. Salvage canceled. @@ -1224,6 +1227,7 @@ Přečerpávání již probíhá. Siphonnage en cours. Der Treibstoff fliesst bereits ab. + Reeds bezig met brandstofverplaatsing. @@ -1233,6 +1237,7 @@ Začíná přečerpávání. Stůjte klidně, abyste naplnili %1. Prêt pour le siphonnage, ne bougez plus pour remplir le %1 Der Treibstoff kann abgezapft werden. Stillhalten, um %1 zu fuellen. + Bezig met brandstofverplaatsing, sta stil om %1 te vullen. @@ -1242,6 +1247,7 @@ Z %1 bylo přečerpáno %2 litrů paliva. Le %1 a été siphonné de %2 litres de carburant %1 wurden %2 Liter Treibstoff abgezapft. + Je hebt %2 liter brandstof uit de %1 gehaald. @@ -1251,6 +1257,7 @@ %1 nemá dostatek paliva k přečerpání. Le %1 n'a pas assez de carburant à siphonner. Es ist nicht mehr genuegend Treibstoff im %1, um etwas abzuzapfen. + Deze %1 heeft niet voldoende brandstof. Canceled siphon @@ -1259,6 +1266,7 @@ Přečerpávání přerušeno. Annuler le siphonnage Abzapfen abgebrochen + Brandstofverplaatsing stopgezet As you boil the water you notice a leak. Looks like you need to fix that. @@ -7433,6 +7441,7 @@ Cargaste exitosamente munición de %1 Vous avez chargé %1 munitions. Úspěšně jste nabili munici %1. + Je hebt met succes %1 munitie bijgeladen. You need %1 type of ammo to do this. @@ -7441,9 +7450,8 @@ Necesitas munición del tipo %1 para hacer esto. Vous avez besoin de %1 type de munition pour ce faire. Pro toto potřebujete tento typ munice: %1. + Je hebt minstens %1 munitie nodig om dit te doen. - - You can't carry two primary weapons at the same time! Нельзя одновременно носить наготове два основных типа оружия! @@ -9648,8 +9656,7 @@ Kovový plot Metallzaun - - + @@ -10481,4 +10488,4 @@ A Rail Integration System kit designed for the SA-58 assault rifle. - \ No newline at end of file + diff --git a/SQF/dayz_epoch_b/stringtable.xml b/SQF/dayz_epoch_b/stringtable.xml index a4f87e5c9..ef08eddc8 100644 --- a/SQF/dayz_epoch_b/stringtable.xml +++ b/SQF/dayz_epoch_b/stringtable.xml @@ -428,15 +428,6 @@ Le dépeçage de l'animal est déjà en cours. Kuchání zvířete již probíhá. - - Canceled gutting. - Ausweiden abgerochen. - Разделывание отменено. - - Gestopt met opensnijden. - Dépeçage interrompu. - Akce zrušena. - Gutting zombie already in progress. Ausweiden des Zombies bereits im Gange. @@ -473,15 +464,6 @@ Le remplissage du jerrycan est déjà en cours. Plnění kanystru již probíhá. - - Canceled siphon. - Umfüllen abgebrochen. - Слив отменён. - - Brandstofverplaatsing stopgezet - Siphonage annulé. - Přečerpávání přerušeno. - \n\nNo recent Deaths. \n\nKeine aktuellen Todesfälle. @@ -860,15 +842,6 @@ \n\nVous ne pouvez pas porter les vêtements du sexe opposé. \n\nNemůžete nosit oblečení opačného pohlaví. - - Canceled refuel. - Befüllen abgebrochen. - Заправка отменена. - - Bijtanken gestopt. - Remplissage du réservoir annulé. - Tankování zrušeno. - Remove already in progress. Entfernen bereits im Gange. @@ -914,33 +887,6 @@ La réparation est déjà en cours. Opravování již probíhá. - - Canceled Repair. - Reperatur abgebrochen. - Починка отменена. - - Reparatie afgebroken. - Réparation annulée. - Zrušena oprava. - - - Salvage already in progress. - Bergen bereits im Gange. - Уже снимается. - - Reeds bezig met bergen. - La récupération est déjà en cours. - Demontáž i probíhá. - - - Canceled Salvage. - Bergen abgebrochen. - Снятие отменено. - - Berging afgebroken. - Récupération annulée. - Demontáž zrušena. - already in progress. bereits im Gange. @@ -959,15 +905,6 @@ La transaction est déjà en cours. Obchodování již probíhá. - - Siphon already in progress. - Umfüllen bereits im Gange. - Уже сливается. - - Reeds bezig met brandstofverplaatsing. - Le siphonage est déjà en cours. - Přečerpávání již probíhá. - Stop already in progress. Stoppen des Generators bereits im Gange. @@ -1193,42 +1130,6 @@ Combinaison incorrecte, %1 reste verrouillé. Nesprávná kombinace, %1 je stále zamknut. - - You have successfully loaded %1 ammunition. - Sie haben erfolgreich %1 Munition geladen. - Вы успешно загрузили %1 боеприпасы. - - Je hebt met succes %1 munitie bijgeladen. - Vous avez rechargé les munitions de %1 avec succés. - Úspěšně jste naložili %1 munici. - - - You need %1 type of ammo to do this. - Sie benötigen folgene Muntion um dies zu tun: %1 - Вам нужен %1 тип патронов, чтобы сделать это. - - Je hebt minstens %1 munitie nodig om dit te doen. - Vous avez besoin de munitions %1 pour faire ça. - Potřebujete munici typu %1 pro dokončení. - - - Started cooking %1 - Beginne das Kochen von %1 - Начали готовить %1 - - Begonnen met het koken van %1 - Début de la cuisson de %1 - Začalo vaření %1 - - - Canceled cooking %1 - Kochen von %1 abgebrochen - Приготовление %1 отменено - - Gestopt met het koken van %1 - Cuisson de %1 annulée - Zrušeno vaření %1 - Filling up %1, move to cancel. Betanken von %1, bewegen Sie sich um den Vorgang abzubrechen. @@ -1247,15 +1148,6 @@ %1 est rempli(e) à %2 pourcents de sa capacité. %1 je naplněno do %2 procent kapacity. - - Preparing to siphon, stand still to fill %1. - Starte das Umfüllen, bewegen Sie sich nicht um %1 zu befüllen. - Подготовка к сливу, стойте на месте, чтобы заполнить %1. - - Bezig met brandstofverplaatsing, sta stil om %1 te vullen. - Préparation du siphonage, restez immobile pour remplir %1. - Příprava pro přečerpání, stůjte na místě pro naplnění %1. - You have filled %1 with fuel. Sie haben %1 mit Kraftstoff befüllt. @@ -1490,24 +1382,6 @@ Upgranuli jste %1. - - Preparing to refuel, stand still to drain %1. - Betanken von %1 wird vorbereitet, bewegen Sie sich um den Vorgang abzubrechen. - Подготовка к заправке, стойте на месте, чтобы опустошить 1%. - - Bijtanken aan het voorbereiden. Sta stil om de %1 leeg te gieten. - - Příprava přečerpání, stůjte na místě pro čerpání z %1. - - - %1 cannot hold that much fuel. - %1 kann nicht so viel Kraftstoff halten. - %1 не может хранить столько топлива. - - Geen ruimte meer voor brandstof in deze %1. - - %1 nemůže mít tolik paliva. - Starting de-construction of %1. Starte Dekonstruktion von %1. @@ -1544,69 +1418,6 @@ Rozebírání %1. - - You have successfully attached %1 to the %2 - Sie haben erfolgreich %1 zum/zur %2 hinzugefügt. - Вы успешно установили %1 на %2 - - Je hebt succesvol %1 aan de %2 gemonteerd. - - Úspěšně jste připevnili %1 ke %2 - - - You need %1 to repair this - Sie benötigen %1 um dies zu reparieren. - Вам нужно %1, чтобы отремонтировать это - - Om dit te repareren heb je %1 nodig. - - K opravě tohoto potřebujete %1 - - - You have destroyed %1 while attempting to remove from %2 - Beim Abmontieren von dem/der %2 wurde %1 zerstört. - Вы сломали %1, при попытке снятия с %2 - - Je hebt %1 gesloopt tijdens het demonteren van de %2 - - Zničili jste %1 při pokusu o odstranění z %2 - - - You have successfully removed %1 from the %2 - Sie haben erfolgreich ein(e) %1 von dem/der %2 demontiert. - Вы успешно сняли %1 с %2 - - Je hebt met succes de %1 van de %2 verwijderd. - - Úspěšně jste odstranili %1 z %2 - - - You need %1 to remove this part. - Sie benötigen eine %1 um dieses Teil zu demontieren. - Вам нужно %1, чтобы снять эту запчасть. - - Je hebt %1 nodig om dit deel te verwijderen. - - Potřebujete %1 k odstranění této části. - - - %1 has been drained for %2 litres of Fuel - Sie haben %2 Gallonen Kraftstoff von dem/der %1 entfernt. - - - Je hebt %2 liter brandstof uit de %1 gehaald. - - Z %1 bylo odčerpáno %2 litrů paliva - - - %1 does not have enough fuel to siphon. - Diese(r) %1 hat nicht genug Kraftstoff. - %1 не имеет достаточно топлива для слития. - - Deze %1 heeft niet voldoende brandstof. - - %1 nemá dostatek paliva na odčerpání. - Dog consumed %1, and is now tamed. Der Hund hat %1 konsumiert und ist nun gezähmt. @@ -2984,15 +2795,6 @@ Vérifier la cargaison Kontrola nákladu - - Cancel - Abbrechen - Отмена - - Annuleren - Annuler - Zrušit - Upgrade Vehicle Fahrzeug upgraden diff --git a/SQF/dayz_server/compile/server_spawnCarePackages.sqf b/SQF/dayz_server/compile/server_spawnCarePackages.sqf index 609158ef8..2ccecfac8 100644 --- a/SQF/dayz_server/compile/server_spawnCarePackages.sqf +++ b/SQF/dayz_server/compile/server_spawnCarePackages.sqf @@ -21,12 +21,26 @@ Author: #define SEARCH_SLOPE_MAX 1000 #define SEARCH_BLACKLIST [[[12923,3643],[14275,2601]]] -private ["_typeGroup","_position","_type","_class","_vehicle","_loot","_lootGroup","_lootNum","_lootPos","_lootVeh","_size"]; +private +[ + "_typeGroup", + "_position", + "_type", + "_class", + "_vehicle", + "_loot", + "_lootGroup", + "_lootNum", + "_lootPos", + "_lootVeh", + "_size" +]; _lootGroup = Loot_GetGroup("CarePackage"); _typeGroup = Loot_GetGroup("CarePackageType"); -for "_i" from 1 to (SPAWN_NUM) do { +for "_i" from 1 to (SPAWN_NUM) do +{ _type = Loot_SelectSingle(_typeGroup); _class = _type select 1; _lootNum = round Math_RandomRange(_type select 2, _type select 3); @@ -49,15 +63,21 @@ for "_i" from 1 to (SPAWN_NUM) do { _lootVeh = Loot_Spawn(_x, _lootPos); _lootVeh setVariable ["permaLoot", true]; - switch (dayz_spawncarepkgs_clutterCutter) do { - case 1: { //Lift loot up by 5cm + switch (dayz_spawncarepkgs_clutterCutter) do + { + case 1: //Lift loot up by 5cm + { _lootPos set [2, 0.05]; _lootVeh setPosATL _lootpos; - }; - case 2: { //Clutter cutter + }; + + case 2: //Clutter cutter + { createVehicle ["ClutterCutter_small_2_EP1", _lootPos, [], 0, "CAN_COLLIDE"]; - }; - case 3: { //Debug sphere + }; + + case 3: //Debug sphere + { createVehicle ["Sign_sphere100cm_EP1", _lootPos, [], 0, "CAN_COLLIDE"]; }; }; diff --git a/SQF/dayz_server/compile/server_spawnCrashSites.sqf b/SQF/dayz_server/compile/server_spawnCrashSites.sqf index 6d450e3fa..6baf8d32e 100644 --- a/SQF/dayz_server/compile/server_spawnCrashSites.sqf +++ b/SQF/dayz_server/compile/server_spawnCrashSites.sqf @@ -34,11 +34,31 @@ Author: #define LOOT_MIN 5 #define LOOT_MAX 8 -private ["_debugZone","_spawnCrashSite","_type","_class","_lootGroup","_position","_vehicle","_lootParams","_dir","_mag","_lootNum","_lootPos","_lootVeh","_lootpos","_time"]; +private +[ + "_debugZone", + "_spawnCrashSite", + "_type", + "_class", + "_lootGroup", + "_position", + "_vehicle", +// "_size", +// "_loot", + "_lootParams", + "_dir", + "_mag", + "_lootNum", + "_lootPos", + "_lootVeh", + "_lootpos", + "_time" +]; diag_log format ["CRASHSPAWNER: Starting crash site spawner. Frequency: %1±%2 min. Spawn chance: %3", SPAWN_FREQUENCY, SPAWN_VARIANCE, SPAWN_CHANCE]; -_spawnCrashSite = { +_spawnCrashSite = +{ _type = Loot_SelectSingle(Loot_GetGroup("CrashSiteType")); _class = _type select 1; _lootGroup = Loot_GetGroup(_type select 2); @@ -71,36 +91,49 @@ _spawnCrashSite = { _lootVeh = Loot_Spawn(_x, _lootPos); _lootVeh setVariable ["permaLoot", true]; - switch (dayz_spawnCrashSite_clutterCutter) do { - case 1: { //Lift loot up by 5cm + switch (dayz_spawnCrashSite_clutterCutter) do + { + case 1: //Lift loot up by 5cm + { _lootPos set [2, 0.05]; _lootVeh setPosATL _lootpos; }; - case 2: { //Clutter cutter + + case 2: //Clutter cutter + { createVehicle ["ClutterCutter_small_2_EP1", _lootPos, [], 0, "CAN_COLLIDE"]; }; - case 3: { //Debug sphere + + case 3: //Debug sphere + { createVehicle ["Sign_sphere100cm_EP1", _lootPos, [], 0, "CAN_COLLIDE"]; }; }; - } forEach Loot_Select(_lootGroup, _lootNum); + } + forEach Loot_Select(_lootGroup, _lootNum); }; //Spawn initial crash sites -for "_i" from 1 to (INITIAL_NUM) do { +for "_i" from 1 to (INITIAL_NUM) do +{ call _spawnCrashSite; }; -while {true} do { +while {true} do +{ //Pick a time to attempt spawning //currentTime + frequency + ±1 * variance _time = time + 60 * ((SPAWN_FREQUENCY) + ((round random 1) * 2 - 1) * random (SPAWN_VARIANCE)); //Wait until the previously decided time - while {time < _time} do { + while {time < _time} do + { uiSleep (60 * (SPAWN_FREQUENCY) / (TIMER_RESOLUTION)); }; //try to spawn - if ((SPAWN_CHANCE) > random 1) then {call _spawnCrashSite;}; + if ((SPAWN_CHANCE) > random 1) then + { + call _spawnCrashSite; + }; }; \ No newline at end of file diff --git a/SQF/dayz_server/compile/server_spawnInfectedCamps.sqf b/SQF/dayz_server/compile/server_spawnInfectedCamps.sqf index ecb31ee5e..91cd3ce92 100644 --- a/SQF/dayz_server/compile/server_spawnInfectedCamps.sqf +++ b/SQF/dayz_server/compile/server_spawnInfectedCamps.sqf @@ -35,19 +35,32 @@ Author: #define SEARCH_PRECISION 30 #define SEARCH_ATTEMPTS 10 -private ["_typeGroup","_lootGroup","_objectGroup","_type","_position","_composition","_compositionObjects","_objectPos"]; +private +[ + "_typeGroup", + "_lootGroup", + "_objectGroup", + "_type", + "_position", + "_composition", + "_compositionObjects", + "_objectPos" +]; _typeGroup = Loot_GetGroup("InfectedCampType"); _lootGroup = Loot_GetGroup("InfectedCamp"); _objectGroup = Loot_GetGroup("InfectedCampObject"); -for "_i" from 1 to (CAMP_NUM) do { +for "_i" from 1 to (CAMP_NUM) do +{ //Select type of camp _type = Loot_SelectSingle(_typeGroup); _composition = _type select 1; //Find a position - for "_j" from 1 to (SEARCH_ATTEMPTS) do { + + for "_j" from 1 to (SEARCH_ATTEMPTS) do + { _position = ((selectBestPlaces [SEARCH_CENTER, SEARCH_RADIUS, SEARCH_EXPRESSION, SEARCH_PRECISION, 1]) select 0) select 0; _position set [2, 0]; @@ -62,7 +75,8 @@ for "_i" from 1 to (CAMP_NUM) do { //Add loot to containers { - if (_x isKindOf (CAMP_CONTAINER_BASE)) then { + if (_x isKindOf (CAMP_CONTAINER_BASE)) then + { Loot_InsertCargo(_x, _lootGroup, round Math_RandomRange(LOOT_MIN, LOOT_MAX)); }; } forEach _compositionObjects;