From 3adea80c34e953bdfbf94354129e2ff216fbff7c Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 04:54:46 -0600 Subject: [PATCH 1/8] Add Antibacterial wipe option --- SQF/dayz_server/eventHandlers/server_sendToClient.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SQF/dayz_server/eventHandlers/server_sendToClient.sqf b/SQF/dayz_server/eventHandlers/server_sendToClient.sqf index 9da17fdeb..888099615 100644 --- a/SQF/dayz_server/eventHandlers/server_sendToClient.sqf +++ b/SQF/dayz_server/eventHandlers/server_sendToClient.sqf @@ -108,6 +108,11 @@ call { _owner publicVariableClient "PVCDZ_hlt_AntiB"; }; + if (_variable == "AntiBacterialWipe") exitWith { + PVCDZ_hlt_Wipe = _arraytosend; + _owner publicVariableClient "PVCDZ_hlt_Wipe"; + }; + if (_variable == "Legs") exitWith { PVCDZ_plr_Legs = _arraytosend; _owner publicVariableClient "PVCDZ_plr_Legs"; From dc159297423d38f3a80bc4b1620743bfba6d97b7 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 04:56:33 -0600 Subject: [PATCH 2/8] Update player_useMeds.sqf --- SQF/dayz_code/actions/player_useMeds.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SQF/dayz_code/actions/player_useMeds.sqf b/SQF/dayz_code/actions/player_useMeds.sqf index f7f204127..4aa724333 100644 --- a/SQF/dayz_code/actions/player_useMeds.sqf +++ b/SQF/dayz_code/actions/player_useMeds.sqf @@ -19,7 +19,7 @@ call { if (_item == "ItemPainkiller") exitWith {[0,0,0,[player]] execVM "\z\addons\dayz_code\medical\painkiller.sqf";}; if (_item == "ItemAntibiotic") exitWith {[player,"ItemAntibiotic"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";}; if (_item == "ItemBloodbag") exitWith {[player,"ItemBloodbag"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";}; - if (_item == "ItemAntibacterialWipe") exitWith {execVM "\z\addons\dayz_code\medical\wipes.sqf";}; + if (_item == "ItemAntibacterialWipe") exitWith {[0,0,0,[player]] execVM "\z\addons\dayz_code\medical\wipes.sqf";}; if (_item == "ItemHeatPack") exitWith {player removeMagazine "ItemHeatPack"; r_player_warming_heatpack = [true, diag_tickTime]; localize "str_player_27" call dayz_rollingMessages;}; //dayz_temperatur = (dayz_temperatur + 5) min dayz_temperaturmax; if (_item == "equip_woodensplint") exitWith {[0,0,0,[player,"equip_woodensplint"]] execVM "\z\addons\dayz_code\medical\brokeBones.sqf";}; if (_item == "ItemSepsisBandage") exitWith {[0,0,0,[player,"ItemSepsisBandage"]] execVM "\z\addons\dayz_code\medical\bandage.sqf";}; From 843269ad2028a6a1faa158ccbc61bb0fd68299f9 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 04:57:40 -0600 Subject: [PATCH 3/8] Compile antibacterial wipe file. --- SQF/dayz_code/init/compiles.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index c46937397..0da28dad8 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -79,6 +79,7 @@ if (!isDedicated) then { player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf"; player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf"; player_medAntiBiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf"; + player_medABWipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medABwipe.sqf"; //actions userActionConditions = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\userActionConditions.sqf"; From e57c54a2c755454ebc9a0baa1decae08a80f3403 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 04:59:19 -0600 Subject: [PATCH 4/8] Add PV for antibacterial wipe option. --- SQF/dayz_code/init/publicEH.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/SQF/dayz_code/init/publicEH.sqf b/SQF/dayz_code/init/publicEH.sqf index 97cee05f7..eb44b0acd 100644 --- a/SQF/dayz_code/init/publicEH.sqf +++ b/SQF/dayz_code/init/publicEH.sqf @@ -255,6 +255,7 @@ if (!isDedicated) then { "PVCDZ_hlt_Transfuse" addPublicVariableEventHandler {(_this select 1) spawn player_medTransfuse; }; "PVCDZ_hlt_PainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller}; "PVCDZ_hlt_AntiB" addPublicVariableEventHandler {(_this select 1) call player_medAntiBiotics}; + "PVCDZ_hlt_Wipe" addPublicVariableEventHandler {(_this select 1) call player_medABWipe}; "PVCDZ_OpenTarget_Reset" addPublicVariableEventHandler { OpenTarget_Time = diag_tickTime; }; //reset OpenTarget timer "PVCDZ_plr_Legs" addPublicVariableEventHandler { From 16117b035c6b456ccf71fcc995aeffbb51d8b2b3 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 05:01:47 -0600 Subject: [PATCH 5/8] Add option to give another player an antibacterial wipe. --- SQF/dayz_code/medical/wipes.sqf | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_code/medical/wipes.sqf b/SQF/dayz_code/medical/wipes.sqf index cad2bd5cd..fcb5dc9e8 100644 --- a/SQF/dayz_code/medical/wipes.sqf +++ b/SQF/dayz_code/medical/wipes.sqf @@ -1,4 +1,6 @@ -private "_finished"; +private ["_finished","_unit"]; + +_unit = (_this select 3) select 0; if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; dayz_actionInProgress = true; @@ -18,10 +20,23 @@ if (vehicle player == player) then { }; if (_finished) then { - r_player_Sepsis = [false, 0]; - player setVariable ["USEC_Sepsis", false, true]; - player setVariable ["sepsisStarted", nil]; - localize "str_actions_medical_wipe_self" call dayz_rollingMessages; + if (_unit == player) then { + // Self healing + r_player_Sepsis = [false, 0]; + _unit setVariable ["USEC_Sepsis", false, true]; + _unit setVariable ["sepsisStarted", nil]; + + localize "str_actions_medical_wipe_self" call dayz_rollingMessages; + } else { + // Heal another player + PVDZ_send = [_unit,"AntiBacterialWipe",[_unit,player]]; + publicVariableServer "PVDZ_send"; + + // Give humanity + [20,0] call player_humanityChange; + + format[localize "str_actions_medical_general_give",localize "STR_ITEM_DESC_WIPES",(name _unit)] call dayz_rollingMessages; + }; } else { player addMagazine "ItemAntibacterialWipe"; }; From a89cd084387c132d624fad3ebf6c4b97c00959b2 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 05:03:07 -0600 Subject: [PATCH 6/8] Add files via upload --- SQF/dayz_code/medical/publicEH/medABwipe.sqf | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 SQF/dayz_code/medical/publicEH/medABwipe.sqf diff --git a/SQF/dayz_code/medical/publicEH/medABwipe.sqf b/SQF/dayz_code/medical/publicEH/medABwipe.sqf new file mode 100644 index 000000000..b0a3da016 --- /dev/null +++ b/SQF/dayz_code/medical/publicEH/medABwipe.sqf @@ -0,0 +1,12 @@ +private ["_unit","_medic"]; + +_unit = _this select 0; +_medic = _this select 1; + +r_player_Sepsis = [false, 0]; +_unit setVariable ["USEC_Sepsis", false, true]; +_unit setVariable ["sepsisStarted", nil]; + +if (_medic != player) then { + format [localize "str_actions_medical_general_received",(name _medic),localize "STR_ITEM_DESC_WIPES"] call dayz_rollingMessages; +}; From 5d983694c8f46d62145fa68a551709be4140bef4 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 05:07:31 -0600 Subject: [PATCH 7/8] Remove period from string. It doesn't belong there. --- SQF/dayz_code/stringtable.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 37a1fb4f2..8a04d3d92 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -6124,12 +6124,12 @@ Desinfektionstücher - Antibacterial Wipe. - Антибактериальные салфетки. - Gasa estéril con plata antibacteriana. + Antibacterial Wipe + Антибактериальные салфетки + Gasa estéril con plata antibacteriana Lingette antibactérienne Antibakteriální ubrousky - Antibakterielle Desinfektionstücher, mit welchen Wunden gereinigt und desinfiziert werden können. + Antibakterielle Desinfektionstücher, mit welchen Wunden gereinigt und desinfiziert werden können Fishing Pole From 8c074be9a7d471ca3cdcc88032f63bbc5d0b8017 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 05:12:03 -0600 Subject: [PATCH 8/8] Add action for giving another player an antibacterial wipe. --- SQF/dayz_code/compile/fn_damageActions.sqf | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/SQF/dayz_code/compile/fn_damageActions.sqf b/SQF/dayz_code/compile/fn_damageActions.sqf index 804fc787f..95bbd0439 100644 --- a/SQF/dayz_code/compile/fn_damageActions.sqf +++ b/SQF/dayz_code/compile/fn_damageActions.sqf @@ -8,7 +8,7 @@ scriptName "Functions\misc\fn_damageActions.sqf"; - [] call fnc_usec_damageActions; ************************************************************/ -private ["_dragged","_menClose","_hasPatient","_vehicle","_inVehicle","_isClose","_assignedRole","_driver","_action","_turret","_weapons","_weaponName","_crew","_unconscious_crew","_patients","_vehType","_unit","_antibiotics","_bloodBags","_unconscious","_lowBlood","_injured","_hasSepsis","_inPain","_legsBroke","_armsBroke","_infected","_hasBandage","_hasSepsisBandage","_hasEpi","_hasMorphine","_hasSplint","_hasPainkillers","_hasAntibiotics","_hasBloodBag","_vehClose","_action1","_action2","_action3","_playerMagazines","_isFriendly"]; +private ["_hasABWipes","_dragged","_menClose","_hasPatient","_vehicle","_inVehicle","_isClose","_assignedRole","_driver","_action","_turret","_weapons","_weaponName","_crew","_unconscious_crew","_patients","_vehType","_unit","_antibiotics","_bloodBags","_unconscious","_lowBlood","_injured","_hasSepsis","_inPain","_legsBroke","_armsBroke","_infected","_hasBandage","_hasSepsisBandage","_hasEpi","_hasMorphine","_hasSplint","_hasPainkillers","_hasAntibiotics","_hasBloodBag","_vehClose","_action1","_action2","_action3","_playerMagazines","_isFriendly"]; _menClose = cursorTarget; _hasPatient = alive _menClose; @@ -141,6 +141,7 @@ if (isPlayer cursorTarget) then { _hasSplint = "equip_woodensplint" in _playerMagazines; _hasPainkillers = "ItemPainkiller" in _playerMagazines; _hasAntibiotics = Array_Any(_playerMagazines, {_this in _antibiotics}); + _hasABWipes = "ItemAntibacterialWipe" in _playerMagazines; if (dayz_classicBloodBagSystem) then { _hasBloodBag = "ItemBloodbag" in _playerMagazines; } else { @@ -177,12 +178,18 @@ if (isPlayer cursorTarget) then { _action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemBandage"], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; - //Sepsis + //Allow player to give sepsis bandage if((_injured || {_hasSepsis}) && {_hasSepsisBandage}) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_04_sepsis", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemSepsisBandage"], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; + //Allow player to give antibacterial wipe + if(_hasSepsis && {_hasABWipes}) then { + r_action = true; + _action = _unit addAction [format[localize "str_actions_medical_08a",localize "STR_ITEM_DESC_WIPES"], "\z\addons\dayz_code\medical\wipes.sqf",[_unit], 0, true, true]; + r_player_actions set [count r_player_actions,_action]; + }; //Allow player to give Epinephrine if(_unconscious && {_hasEpi}) then { r_action = true; @@ -217,7 +224,7 @@ if (isPlayer cursorTarget) then { } else { _tempArray = []; { // This was a TODO by the Vanilla Mod devs. - if (_x in magazines player && {!(_x in _tempArray)}) then { + if (_x in _playerMagazines && {!(_x in _tempArray)}) then { _displayName = getText(configFile >> "cfgMagazines" >> _x >> "displayName"); _action = _unit addAction [format[localize "str_actions_medical_08a",_displayName], "\z\addons\dayz_code\medical\transfusion.sqf",[_unit,_x], 0, true, true]; r_player_actions set [count r_player_actions,_action];