Merge pull request #2049 from worldwidesorrow/master

Code auditing, optimization, archiving unused files
This commit is contained in:
worldwidesorrow
2019-12-11 22:03:18 -06:00
committed by GitHub
56 changed files with 807 additions and 898 deletions

View File

@@ -13,91 +13,38 @@ _text = getText (_config >> "displayName");
if (!_hasmeditem) exitWith {format[localize "str_player_31",_text,localize "str_player_31_use"] call dayz_rollingMessages;};
switch (_item) do {
case "ItemBandage": {
_id = [0,0,0,[player,"ItemBandage"]] execVM "\z\addons\dayz_code\medical\bandage.sqf";
};
case "ItemMorphine": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\morphine.sqf";
};
case "equip_woodensplint": {
_id = [0,0,0,[player,"equip_woodensplint"]] execVM "\z\addons\dayz_code\medical\brokeBones.sqf";
};
case "ItemPainkiller": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\painkiller.sqf";
};
//Antibiotic's system
case "ItemAntibiotic": {
_id = [player,"ItemAntibiotic"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
};
case "ItemAntibiotic1": {
_id = [player,"ItemAntibiotic1"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
};
case "ItemAntibiotic2": {
_id = [player,"ItemAntibiotic2"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
};
case "ItemAntibiotic3": {
_id = [player,"ItemAntibiotic3"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
};
case "ItemAntibiotic4": {
_id = [player,"ItemAntibiotic4"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
};
case "ItemAntibiotic5": {
_id = [player,"ItemAntibiotic5"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
};
case "ItemAntibiotic6": {
_id = [player,"ItemAntibiotic6"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
};
case "ItemAntibacterialWipe": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\wipes.sqf";
};
case "ItemHeatPack": {
player removeMagazine "ItemHeatPack";
//dayz_temperatur = (dayz_temperatur + 5) min dayz_temperaturmax;
r_player_warming_heatpack = [true, diag_tickTime];
localize "str_player_27" call dayz_rollingMessages;
};
case "bloodTester": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\blood_test.sqf";
};
case "transfusionKit": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\fillBloodBag.sqf";
};
case "emptyBloodBag": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\fillBloodBag.sqf";
};
case "ItemSepsisBandage": {
_id = [0,0,0,[player,"ItemSepsisBandage"]] execVM "\z\addons\dayz_code\medical\bandage.sqf";
};
case "wholeBloodBagANEG": {
_id = [player,"wholeBloodBagANEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "wholeBloodBagAPOS": {
_id = [player,"wholeBloodBagAPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "wholeBloodBagBNEG": {
_id = [player,"wholeBloodBagBNEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "wholeBloodBagBPOS": {
_id = [player,"wholeBloodBagBPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "wholeBloodBagABNEG": {
_id = [player,"wholeBloodBagABNEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "wholeBloodBagABPOS": {
_id = [player,"wholeBloodBagABPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "wholeBloodBagONEG": {
_id = [player,"wholeBloodBagONEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "wholeBloodBagOPOS": {
_id = [player,"wholeBloodBagOPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
case "ItemBloodbag": {
_id = [player,"ItemBloodbag"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";
};
call {
if (_item == "ItemBandage") exitWith {[0,0,0,[player,"ItemBandage"]] execVM "\z\addons\dayz_code\medical\bandage.sqf";};
if (_item == "ItemMorphine") exitWith {[0,0,0,[player,"ItemMorphine"]] execVM "\z\addons\dayz_code\medical\brokeBones.sqf";};
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 == "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";};
if (_item == "ItemAntibiotic1") exitWith {[player,"ItemAntibiotic1"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";};
if (_item == "ItemAntibiotic2") exitWith {[player,"ItemAntibiotic2"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";};
if (_item == "ItemAntibiotic3") exitWith {[player,"ItemAntibiotic3"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";};
if (_item == "ItemAntibiotic3") exitWith {[player,"ItemAntibiotic3"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";};
if (_item == "ItemAntibiotic4") exitWith {[player,"ItemAntibiotic4"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";};
if (_item == "ItemAntibiotic5") exitWith {[player,"ItemAntibiotic5"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";};
if (_item == "ItemAntibiotic6") exitWith {[player,"ItemAntibiotic6"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";};
if (_item == "wholeBloodBagANEG") exitWith {[player,"wholeBloodBagANEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "wholeBloodBagAPOS") exitWith {[player,"wholeBloodBagAPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "wholeBloodBagBNEG") exitWith {[player,"wholeBloodBagBNEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "wholeBloodBagBPOS") exitWith {[player,"wholeBloodBagBPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "wholeBloodBagABNEG") exitWith {[player,"wholeBloodBagABNEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "wholeBloodBagABNEG") exitWith {[player,"wholeBloodBagABNEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "wholeBloodBagABPOS") exitWith {[player,"wholeBloodBagABPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "wholeBloodBagONEG") exitWith {[player,"wholeBloodBagONEG"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "wholeBloodBagOPOS") exitWith {[player,"wholeBloodBagOPOS"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "bloodTester") exitWith {[0,0,0,[player]] execVM "\z\addons\dayz_code\medical\blood_test.sqf";};
if (_item == "transfusionKit") exitWith {[0,0,0,[player]] execVM "\z\addons\dayz_code\medical\fillBloodBag.sqf";};
if (_item == "emptyBloodBag") exitWith {[0,0,0,[player]] execVM "\z\addons\dayz_code\medical\fillBloodBag.sqf";};
};
if (vehicle player != player) then {
_display = findDisplay 106;
_display closeDisplay 0;
};
};

View File

@@ -13,7 +13,7 @@ if (!isNull _ent && {player distance _ent < 5}) then {
_ent setDamage 1;
} else {
/* PVS/PVC - Skaronator */
PVDZ_send = [_ent,"Legs",[_ent,player]];
PVDZ_send = [_ent,"Legs",[_ent,player],[_ent,dayz_authKey,player]];
publicVariableServer "PVDZ_send";
};
[player,"hit",0,false] call dayz_zombieSpeak;
@@ -21,4 +21,4 @@ if (!isNull _ent && {player distance _ent < 5}) then {
uiSleep 1;
player switchMove "";
s_player_attack = -1;
s_player_attack = -1;

View File

@@ -8,7 +8,7 @@ scriptName "Functions\misc\fn_damageActions.sqf";
- [] call fnc_usec_damageActions;
************************************************************/
private ["_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 ["_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;
@@ -88,7 +88,7 @@ if (_inVehicle) then {
if (!r_action_unload) then {
r_action_unload = true;
_vehType = typeOf _vehicle;
_action = _vehicle addAction [format[localize "str_actions_medical_14",_vehType], "\z\addons\dayz_code\medical\load\unLoad_act.sqf",[player,_vehicle], 0, false, true];
_action = _vehicle addAction [format[localize "str_actions_medical_14",_vehType], "\z\addons\dayz_code\medical\load\unLoad_act.sqf",[player,_unconscious_crew,_vehicle], 0, false, true];
r_player_actions2 set [count r_player_actions2,_action];
};
} else {
@@ -119,10 +119,11 @@ if (isPlayer cursorTarget) then {
//Arrays
_antibiotics =["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"];
_bloodBags = ["ItemBloodbag","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS"];
_bloodBags = ["bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
//Var checks
_unconscious = _unit getVariable ["NORRN_unconscious", false];
_dragged = _unit getVariable ["NORRN_unit_dragged", false];
_lowBlood = _unit getVariable ["USEC_lowBlood", false];
_injured = _unit getVariable ["USEC_injured", false];
_hasSepsis = _unit getVariable ["USEC_Sepsis", false];
@@ -140,40 +141,46 @@ if (isPlayer cursorTarget) then {
_hasSplint = "equip_woodensplint" in _playerMagazines;
_hasPainkillers = "ItemPainkiller" in _playerMagazines;
_hasAntibiotics = Array_Any(_playerMagazines, {_this in _antibiotics});
_hasBloodBag = Array_Any(_playerMagazines, {_this in _bloodBags});
if (dayz_classicBloodBagSystem) then {
_hasBloodBag = "ItemBloodbag" in _playerMagazines;
} else {
_hasBloodBag = Array_Any(_playerMagazines, {_this in _bloodBags});
};
_vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5];
if (_hasPatient) then {
//Allow player to drag
if(_unconscious) then {
if(_unconscious && {!_dragged}) then {
r_action = true;
_action1 = _unit addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\openGear.sqf",_unit, 0, true, true];
_action2 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true];
_action3 = _unit addAction [localize "str_actions_medical_02", "\z\addons\dayz_code\medical\pulse.sqf",_unit, 0, true, true];
_action4 = _unit addAction [localize "str_actions_medical_drag", "\z\addons\dayz_code\medical\carry.sqf",_unit, 0, true, true];
r_player_actions set [count r_player_actions, _action1];
r_player_actions set [count r_player_actions, _action2];
r_player_actions set [count r_player_actions, _action3];
r_player_actions set [count r_player_actions, _action4];
};
//Load Vehicle
if (count _vehClose > 0 && {!locked (_vehClose select 0)} && {_unconscious}) then {
r_action = true;
_vehicle = _vehClose select 0;
_vehType = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
NORRN_loadWoundedAction = _unit addAction [format[localize "str_actions_medical_03",_vehType], "\z\addons\dayz_code\medical\load\load_act.sqf",[player,_vehicle,_unit], 0, true, true];
r_player_actions set [count r_player_actions,NORRN_loadWoundedAction];
_action = _unit addAction [format[localize "str_actions_medical_03",_vehType], "\z\addons\dayz_code\medical\load\load_act.sqf",[player,_vehicle,_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to bandage
if(_injured && {_hasBandage}) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemBandage"], 0, true, true, "", "'ItemBandage' in magazines player"];
_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
if(_hasSepsis && {_hasSepsisBandage}) then {
if((_injured || {_hasSepsis}) && {_hasSepsisBandage}) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemSepsisBandage"], 0, true, true, "", "'ItemBandage' in magazines player"];
_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 Epinephrine
@@ -185,26 +192,39 @@ if (isPlayer cursorTarget) then {
//Allow player to give Morphine
if((_legsBroke || {_armsBroke}) && {_hasMorphine}) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"ItemMorphine"], 0, true, true, "", "'ItemMorphine' in magazines player"];
_action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"ItemMorphine"], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give equip_woodensplint
if((_legsBroke || {_armsBroke}) && {_hasSplint}) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_06_splint", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"equip_woodensplint"], 0, true, true, "", "'equip_woodensplint' in magazines player"];
_action = _unit addAction [localize "str_actions_medical_06_splint", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"equip_woodensplint"], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Painkillers
if(_inPain && {_hasPainkillers}) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true, "", "'ItemPainkiller' in magazines player"];
_action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to transfuse blood
if(_lowBlood && {_hasBloodBag}) then {
private ["_tempArray","_displayName"];
r_action = true;
_action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion.sqf",[_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
if (dayz_classicBloodBagSystem) then {
_action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion.sqf",[_unit,"ItemBloodbag"], 0, true, true];
r_player_actions set [count r_player_actions,_action];
} else {
_tempArray = [];
{ // This was a TODO by the Vanilla Mod devs.
if (_x in magazines player && {!(_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];
_tempArray set [count _tempArray, _x];
};
} count _bloodBags;
};
};
//Allow player to give antibiotics
if (_infected && {_hasAntibiotics}) then {
@@ -234,6 +254,3 @@ if ((!_isClose || {!_hasPatient}) && {r_action}) then {
call fnc_usec_medic_removeActions;
r_action = false;
};
//Monitor
player setVariable ["damageActions", diag_ticktime, false];

View File

@@ -71,6 +71,14 @@ if (!isDedicated) then {
zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviours
//zombie_generateSwarm = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\swarm_generate.sqf";
// Medical
player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
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";
//actions
userActionConditions = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\userActionConditions.sqf";
@@ -715,13 +723,6 @@ local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\l
local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
//player_weaponCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf"; //Run by the player or server to monitor whether they have picked up a new weapon
//curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
//player_medInject = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
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_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf"; //New
player_humanityCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityCheck.sqf"; //Old
player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";

View File

@@ -1,6 +1,4 @@
// Both client and server
"PVDZ_drg_RaLW" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\load_wounded.sqf"};
"PVDZ_drg_RLact" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf"};
"PVDZ_hlt_Bleed" addPublicVariableEventHandler {(_this select 1) spawn fnc_usec_damageBleed};
"PVCDZ_veh_SH" addPublicVariableEventHandler {(_this select 1) call fnc_veh_handleDam}; // set damage to vehicle part
//"PVCDZ_obj_Damage" addPublicVariableEventHandler {(_this select 1) call fnc_Obj_FenceHandleDam}; // set damage to object. //Vanilla fences not used in Epoch
@@ -116,16 +114,6 @@ if (isServer) then {
_object setVariable["ownerArray", _ownerArray, true];
};
};*/
"PVDZ_sendUnconscious" addPublicVariableEventHandler {
_owner = (_this select 1) select 0;
_duration = (_this select 1) select 1;
diag_log format["%1,%2",_owner,_duration];
PVDZ_receiveUnconscious = [_owner,_duration];
(owner _owner) publicVariableClient "PVDZ_receiveUnconscious";
};
"PVDZ_Server_Simulation" addPublicVariableEventHandler {
_agent = (_this select 1) select 0;
@@ -252,6 +240,10 @@ if (!isDedicated) then {
};
"PVDZ_obj_RoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare};
"PVDZ_drg_RaDrag" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"};
"PVDZ_drg_RaDrop" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\animDrop.sqf"};
"PVDZ_drg_RaCarry" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\animCarry.sqf"};
"PVDZ_drg_RaLW" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf"};
"PVDZ_drg_RaUW" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\load\unload_wounded.sqf"};
"PVDZ_obj_Fire" addPublicVariableEventHandler {(_this select 1) spawn BIS_Effects_Burn};
"PVCDZ_plr_Humanity" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
"PVDZE_plr_FriendRQ" addPublicVariableEventHandler {if (player == ((_this select 1) select 0)) then {localize "str_epoch_player_2" call dayz_rollingMessages;};};
@@ -261,7 +253,6 @@ if (!isDedicated) then {
"PVCDZ_hlt_Bandage" addPublicVariableEventHandler {(_this select 1) call player_medBandage};
"PVCDZ_hlt_Epi" addPublicVariableEventHandler {(_this select 1) call player_medEpi};
"PVCDZ_hlt_Transfuse" addPublicVariableEventHandler {(_this select 1) spawn player_medTransfuse; };
"PVCDZ_hlt_Transfuse_completed" addPublicVariableEventHandler {player setVariable["TransfusionCompleted",true]; };
"PVCDZ_hlt_PainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
"PVCDZ_hlt_AntiB" addPublicVariableEventHandler {(_this select 1) call player_medAntiBiotics};
"PVCDZ_OpenTarget_Reset" addPublicVariableEventHandler { OpenTarget_Time = diag_tickTime; }; //reset OpenTarget timer

View File

@@ -1,6 +1,4 @@
#include "\z\addons\dayz_code\util\array.hpp";
private ["_msg","_antibiotics","_hasAntibiotics","_id","_hasMeds","_unit","_medsUsed"];
private ["_msg","_unit","_medsUsed"];
if (count _this > 2) then {
_unit = (_this select 3) select 0;
@@ -10,31 +8,21 @@ if (count _this > 2) then {
_medsUsed = _this select 1;
};
_antibiotics =["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"];
_hasAntibiotics = false;
{
if (_x in magazines player) exitWith {
// Set antibiotics if not defined (used when giving to somebody)
if(isNil "_medsUsed") then {
if (isNil "_medsUsed") then {
{
if (_x in magazines player) exitWith {
// Set antibiotics if not defined (used when giving to somebody)
_medsUsed = _x;
};
_hasAntibiotics = true;
};
} count _antibiotics;
} count ["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"];
};
_msg = "str_actions_medical_misplaced_antibiotics";
_msg = localize "str_actions_medical_misplaced_antibiotics";
if (_hasAntibiotics) then {
if !(isNil "_medsUsed") then {
//Remove one table from the box.
[_medsUsed,"medical"] call dayz_reduceItems;
//remove infection
//Called in medAntis
//r_player_infected = false;
//_unit setVariable["USEC_infected",false,true];
//remove option
call fnc_usec_medic_removeActions;
r_action = false;
@@ -42,22 +30,23 @@ if (_hasAntibiotics) then {
//player removeAction s_player_antiobiotic;
//s_player_antiobiotic = -1;
if ((_unit == player) or (vehicle player != player)) then {
if (_unit == player) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf";
r_player_infected = false;
_unit setVariable["USEC_infected",false,true];
_msg = "str_actions_medical_taken_antibiotics";
_msg = localize "str_actions_medical_taken_antibiotics";
} else {
//Send request to other player
// Heal another player
PVDZ_send = [_unit,"Antibiotics",[_unit,player]];
publicVariableServer "PVDZ_send";
//Give humnaity for good deeds
[20,0] call player_humanityChange;
_msg = "str_actions_medical_gave_antibiotics";
_msg = format[localize "str_actions_medical_gave_antibiotics", (name _unit)];
};
};
localize _msg call dayz_rollingMessages;
_msg call dayz_rollingMessages;

View File

@@ -1,4 +1,4 @@
private ["_finished","_id","_unit","_item"];
private ["_msg","_finished","_unit","_item"];
_unit = (_this select 3) select 0;
_item = (_this select 3) select 1;
@@ -22,21 +22,25 @@ if (vehicle player != player) then {
};
if (_finished) then {
if ((_unit == player) or (vehicle player != player)) then {
if (_unit == player) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
if (_item=="ItemSepsisBandage") then {
r_player_Sepsis = [false, 0];
player setVariable ["USEC_Sepsis", false, true];
player setVariable ["sepsisStarted", nil];
};
//Self Healing
[player, player, if (_item == "ItemSepsisBandage") then {true} else {false}] call player_medBandage;
_msg = if (_item == "ItemSepsisBandage") then {"str_actions_medical_sepsisbandage_self"} else {"str_actions_medical_bandage_self"};
localize _msg call dayz_rollingMessages;
} else {
PVDZ_send = [_unit,"Bandage",[_unit,player]];
// Heal another player
PVDZ_send = [_unit,"Bandage",[_unit, player, if (_item == "ItemSepsisBandage") then {true} else {false}]];
publicVariableServer "PVDZ_send";
//Give humanity
[20,0] call player_humanityChange;
_msg = if (_item == "ItemSepsisBandage") then {"str_actions_medical_gave_sepsisbandage"} else {"str_actions_medical_gave_bandage"};
format[localize _msg,(name _unit)] call dayz_rollingMessages;
};
} else {
player addMagazine _item;
};
dayz_actionInProgress = false;
dayz_actionInProgress = false;

View File

@@ -1,4 +1,4 @@
private ["_finished","_id","_unit","_item","_humanityGain"];
private ["_msg","_finished","_id","_unit","_item","_humanityGain"];
_unit = (_this select 3) select 0;
_item = (_this select 3) select 1;
@@ -8,6 +8,9 @@ dayz_actionInProgress = true;
player removeMagazine _item;
call fnc_usec_medic_removeActions;
r_action = false;
if (vehicle player == player) then {
_finished = ["Medic",1] call fn_loopAction;
} else {
@@ -15,34 +18,26 @@ if (vehicle player == player) then {
_finished = true;
};
if (_finished) then {
_unit setVariable ["hit_legs",0];
_unit setVariable ["hit_hands",0];
if (_unit == player) then {
//give to player, Ie the player fixed himself
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
} else {
//give to remote player, ie the player fixed another player
//Give humanity reward to player giving the morphine to another player.
_humanityGain = switch true do {
case (_item == "ItemMorphine"): { 50 };
case (_item == "equip_woodensplint"): { 25 };
default { 0 };
};
if (_humanityGain > 0) then {
[_humanityGain,0] call player_humanityChange;
};
};
_msg = if (_item == "equip_woodensplint") then {"STR_ITEM_NAME_WOODENSPLINT"} else {"STR_EQUIP_NAME_15"};
PVDZ_send = [_unit,"Morphine",[_unit,player]];
publicVariableServer "PVDZ_send";
if (_finished) then {
if (_unit == player) then {
//Self Healing
[player,player,_item] call player_medMorphine;
format [localize "str_actions_medical_general_self", (localize _msg)] call dayz_rollingMessages;
} else {
//Give humanity reward to player giving the morphine to another player.
_humanityGain = if (_item == "ItemMorphine") then {50} else {25};
[_humanityGain,0] call player_humanityChange;
PVDZ_send = [_unit,"Morphine",[_unit,player,_item]];
publicVariableServer "PVDZ_send";
format [localize "str_actions_medical_general_give", (localize _msg),(name _unit)] call dayz_rollingMessages;
};
} else {
player addMagazine _item;
};
dayz_actionInProgress = false;
dayz_actionInProgress = false;

View File

@@ -6,54 +6,69 @@
JULY 2010 - norrin
*****************************************************************************************************************************
Start carry.sqf
Updated December 2019 - JasonTM
*/
private ["_unit","_dragee","_pos","_dir"];
private ["_medic","_dragee","_unconscious","_dropObjects"];
_dragee = _this select 3;
_can_be_revived = NORRN_revive_array select 20;
_can_be_revived_2 = NORRN_revive_array select 21;
_unit = player;
r_carry_sqf = true;
r_drag_sqf = false;
_medic = player;
_unconscious = _dragee getVariable ["NORRN_unconscious", false];
_unit removeAction Norrn_carryAction;
if (isNull _dragee) exitWith {};
_dragee setVariable ["NORRN_unit_dragged", true, true];
if (!_unconscious) exitWith {};
_dropObjects = nearestObjects [player, DayZ_DropDrageeObjects, 3];
if (count _dropObjects > 0) exitWith {};
// Attach before the other client sets direction and position
_dragee attachto [_medic,[0.1, 1.01, 0]];
// Send information to start the carry process
PVDZ_send = [_dragee,"CarryPlayer",_dragee,[_dragee,dayz_authKey,_medic]];
publicVariableServer "PVDZ_send";
// Wait until the other client has performed its actions.
waitUntil {((_dragee getVariable ["NORRN_unit_dragged",false]) || (!alive _dragee));};
uiSleep 1;
detach _dragee;
uiSleep 1.5;
// public EH
//PVDZ_drg_RACarUp = _dragee; // not used
//publicVariable "PVDZ_drg_RACarUp"; // not used
//_dragee switchMove "ainjpfalmstpsnonwrfldnon_carried_up";
//PVDZ_drg_RAPicUp = _unit; // not used
//publicVariable "PVDZ_drg_RAPicUp"; // not used
_unit switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";
// Animation needs to be synced on all clients.
[nil, _medic, rSWITCHMOVE, "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon"] call RE;
_medic switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";
// Fix from fn_unconscious
disableUserInput false; disableUserInput false;
disableUserInput true; disableUserInput true;
disableUserInput false; disableUserInput false;
uiSleep 10;
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_still";
_dragee attachto [_unit,[-0.2, 0.2, 0]];
// Wait until first animation done to attach player
_dragee attachto [_medic,[-0.2, 0.2, 0]];
while {r_carry_sqf} do
{
_anim_name = animationstate _unit;
if (!(_dragee getVariable "NORRN_unconscious")) exitWith
{
detach _dragee;
_unit switchMove "";
player removeAction Norrn_dropAction;
r_carry_sqf = false;
//Unnecessary actions removed & drop body added
call fnc_usec_medic_removeActions;
r_action = false;
force_dropBody = false;
NORRN_dropAction = player addAction [localize "str_actions_medical_dropbody", "\z\addons\dayz_code\medical\drop_body.sqf",[_medic,_dragee], 0, false, true];
r_drag_sqf = true;
while {r_drag_sqf} do {
_dropObjects = nearestObjects [player, DayZ_DropDrageeObjects, 3]; //Prevent exploit of glitching through doors
if (force_dropBody || {count _dropObjects > 0} || {!(_dragee getVariable ["NORRN_unconscious", false])} || {!alive _dragee}) then {
[0,0,0,[_medic,_dragee]] execVM "\z\addons\dayz_code\medical\drop_body.sqf";
};
//check that dragged unit still exists
if (!alive _unit || _anim_name != "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon" && _anim_name != "acinpercmstpsraswrfldnon" && _anim_name != "acinpercmrunsraswrfldf") exitWith
{
player removeAction NORRN_dropAction;
detach _dragee;
_unit switchMove "";
r_carry_sqf = false;
if (vehicle player != player) then {
player action ["eject", vehicle player];
localize "str_actions_medical_dragbody_veh" call dayz_rollingMessages;
[0,0,0,[_medic,_dragee]] execVM "\z\addons\dayz_code\medical\drop_body.sqf";
};
uiSleep 0.1;
};
if (true) exitWith {};

View File

@@ -6,14 +6,14 @@
JULY 2010 - norrin
*****************************************************************************************************************************
Start drag.sqf
Updated December 2019 - JasonTM
*/
private ["_unit","_dragee","_pos","_dir","_addAction"];
private ["_medic","_dragee","_dropObjects","_unconscious"];
_dragee = _this select 3;
_unit = player;
_medic = player;
_unconscious = _dragee getVariable ["NORRN_unconscious", false];
_addAction = false;
if (isNull _dragee) exitWith {};
if (!_unconscious) exitWith {};
@@ -21,48 +21,45 @@ if (!_unconscious) exitWith {};
_dropObjects = nearestObjects [player, DayZ_DropDrageeObjects, 3];
if (count _dropObjects > 0) exitWith {};
//player assumes dragging posture
// Animation needs to be synced on all clients.
[nil, _medic, rSWITCHMOVE, "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2"] call RE;
_medic switchmove "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
// Fix from fn_unconscious
disableUserInput false; disableUserInput false;
disableUserInput true; disableUserInput true;
disableUserInput false; disableUserInput false;
uiSleep .5;
// Attach before the other client sets direction and position
_dragee attachto [_medic,[0.1, 1.01, 0]];
// Send information to start the drag process
PVDZ_send = [_dragee,"DragPlayer",_dragee,[_dragee,dayz_authKey,_medic]];
publicVariableServer "PVDZ_send";
// Wait until the other client has performed its actions.
waitUntil {uiSleep 0.02; ((_dragee getVariable ["NORRN_unit_dragged",false]) || (!alive _dragee));};
//Unnecessary actions removed & drop body added
call fnc_usec_medic_removeActions;
r_action = false;
force_dropBody = false;
NORRN_dropAction = player addAction [localize "str_actions_medical_dropbody", "\z\addons\dayz_code\medical\drop_body.sqf",[_medic,_dragee], 0, false, true];
r_drag_sqf = true;
while {r_drag_sqf} do {
if (!_addAction) then {
_dragee setVariable ["NORRN_unit_dragged", true, true];
_unit playActionNow "grabDrag";
uiSleep 2;
//unconscious unit assumes dragging posture
//public EH
//PVDZ_drg_RaDrag = _dragee;
PVDZ_drg_RaDrag = [_dragee];
publicVariable "PVDZ_drg_RaDrag";
//_dragee switchmove "ainjppnemstpsnonwrfldb_still";
_dragee attachto [_unit,[0.1, 1.01, 0]];
uiSleep 0.02;
//rotate wounded units so that it is facing the correct direction
//PVDZ_drg_R180 = _dragee; // not used
//publicVariable "PVDZ_drg_R180"; // not used
_dragee setDir 180;
//Uneccesary actions removed & drop body added
call fnc_usec_medic_removeActions;
NORRN_dropAction = player addAction [localize "str_actions_medical_dropbody", "\z\addons\dayz_code\medical\drop_body.sqf",_dragee, 0, false, true];
//NORRN_carryAction = player addAction ["Carry body", "\z\addons\dayz_code\medical\carry.sqf",_dragee, 0, false, true];
uiSleep 1;
_addAction = true;
};
_dropObjects = nearestObjects [player, DayZ_DropDrageeObjects, 3]; //Prevent exploit of glitching through doors
if (force_dropBody || (count _dropObjects > 0)) then {
[cursorTarget, _unit, _unconscious, _dragee] execVM "\z\addons\dayz_code\medical\drop_body.sqf";
if (force_dropBody || {count _dropObjects > 0} || {!(_dragee getVariable ["NORRN_unconscious", false])} || {!alive _dragee}) then {
[0,0,0,[_medic,_dragee]] execVM "\z\addons\dayz_code\medical\drop_body.sqf";
};
if (vehicle player != player) then {
player action ["eject", vehicle player];
localize "str_actions_medical_dragbody_veh" call dayz_rollingMessages;
[cursorTarget, _unit, _unconscious, _dragee] execVM "\z\addons\dayz_code\medical\drop_body.sqf";
[0,0,0,[_medic,_dragee]] execVM "\z\addons\dayz_code\medical\drop_body.sqf";
};
if (!r_drag_sqf) exitWith {};
uiSleep 0.001;
uiSleep 0.1;
};

View File

@@ -7,28 +7,20 @@
*****************************************************************************************************************************
Start drop_body.sqf
*/
private ["_medic","_dragee"];
_dragee = _this select 3;
_medic = (_this select 3) select 0;
_dragee = (_this select 3) select 1;
player removeAction NORRN_dropAction;
//player removeAction NORRN_carryAction;
NORRN_remove_drag = true;
r_drag_sqf = false;
r_carry_sqf = false;
r_action = false;
_unit = player;
detach _unit;
detach _dragee;
_unit switchMove "";
_dragee switchMove "";
NORRN_Dragged_body = objNull;
_dragee setVariable ["NORRN_unit_dragged", false, true];
//lie on back
_dragee playMoveNow "ainjppnemstpsnonwrfldnon";
//PVDZ_drg_Ralie = _dragee; // not used
//publicVariable "PVDZ_drg_Ralie"; // not used
force_dropBody = false;
r_drag_sqf = false;
if (true) exitWith {};
//detach _medic;
_medic switchMove "";
if (alive _dragee) then {
PVDZ_send = [_dragee, "DropPlayer",_dragee,[_dragee,dayz_authKey,_medic]];
publicVariableServer "PVDZ_send";
};

View File

@@ -1,25 +1,27 @@
private ["_finished","_isDead","_unit"];
_unit = (_this select 3) select 0;
_isDead = _unit getVariable["USEC_isDead",false];
call fnc_usec_medic_removeActions;
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
player removeMagazine "ItemEpinephrine";
_finished = ["Medic",1] call fn_loopAction;
if (!_isDead && _finished && ("ItemEpinephrine" in magazines player)) then {
player removeMagazine "ItemEpinephrine";
_unit setVariable ["NORRN_unconscious", false, true];
_unit setVariable ["USEC_isCardiac",false,true];
_isDead = _unit getVariable["USEC_isDead",false];
if (!_isDead && {_finished}) then {
//give humanity
[25,0] call player_humanityChange;
PVDZ_send = [_unit,"Epinephrine",[_unit,player,"ItemEpinephrine"]];
PVDZ_send = [_unit,"Epinephrine",[_unit,player]];
publicVariableServer "PVDZ_send";
format [localize "str_actions_medical_general_give", (localize "STR_EQUIP_NAME_14"), (name _unit)] call dayz_rollingMessages;
} else {
player addMagazine "ItemEpinephrine";
};
r_action = false;
dayz_actionInProgress = false;
dayz_actionInProgress = false;

View File

@@ -1,31 +1,23 @@
// Load_act.sqf
// JULY 2010 - norrin
// Updated December 2019 - JasonTM
private ["_args","_dragger","_vcl","_wounded"];
private ["_args","_medic","_vcl","_wounded"];
_args = _this select 3;
_dragger = _args select 0;
_medic = _args select 0;
_vcl = _args select 1;
_wounded = _args select 2;
r_drag_sqf = false;
r_action = false;
r_action_load = false;
call fnc_usec_medic_removeActions;
_wounded removeAction NORRN_loadWoundedAction;
if ((_vcl emptyPositions "cargo") > 0) then
{
detach _wounded;
_dragger switchMove "";
_wounded setVariable ["NORRN_LoadVcl", _vcl, true];
uiSleep 1;
//["PVDZ_drg_RLact",_wounded] call broadcastRpcCallAll;
[_wounded] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf";
PVDZ_drg_RLact = _wounded;
publicVariable "PVDZ_drg_RLact";
player removeAction NORRN_dropAction;
if ((_vcl emptyPositions "cargo") > 0) then {
// Send information to start the load process
PVDZ_send = [_wounded,"LoadWounded",[_wounded,_medic,_vcl],[_wounded,dayz_authKey,_medic]];
publicVariableServer "PVDZ_send";
} else {
localize "str_dragnospace" call dayz_rollingMessages;//hint "No space left in vehicle";
localize "str_dragnospace" call dayz_rollingMessages; // "No space left in vehicle"
};
NORRN_load_wounded_action = true;

View File

@@ -1,52 +1,40 @@
// Load_wounded.sqf
// OCTOBER 2010 - norrin
// Updated December 2019 - JasonTM
private ["_wounded","_vcl","_group"];
private ["_wounded","_vehicle","_group","_medic"];
_wounded = _this select 0;
_medic = _this select 1;
_vehicle = _this select 2;
if (!local _wounded) exitWith {};
// Check to see that the first passed object matches local player object
if (player != _wounded) exitWith {};
if !(r_player_unconscious) exitWith {};
uiSleep 1;
_vcl = _wounded getVariable "NORRN_loadVcl";
_wounded setVariable ["NORRN_unit_dragged", true, true];
_wounded assignAsCargo _vehicle;
_wounded moveInCargo _vehicle;
_wounded assignAsCargo _vcl;
_wounded moveInCargo _vcl;
uiSleep 1;
//["PVDZ_drg_RaLW",_wounded] call broadcastRpcCallAll;
PVDZ_drg_RaLW = _wounded;
publicVariable "PVDZ_drg_RaLW";
_wounded switchMove "kia_hmmwv_driver";
// Animation needs to be synced on all clients.
[nil, _wounded, rSWITCHMOVE, "KIA_HMMWV_Cargo01"] call RE;
_wounded switchMove "KIA_HMMWV_Cargo01";
if (local _wounded) then
{
waitUntil {!(_wounded getVariable "NORRN_unconscious")|| !alive _wounded || vehicle _wounded == _wounded || (assignedVehicleRole _wounded) select 0 != "Cargo"};
r_drag_sqf = true;
if ((vehicle _wounded == _wounded) || (assignedVehicleRole _wounded) select 0 != "Cargo") exitWith
{
if (_wounded getVariable "NORRN_AIunconscious") then
{
if (vehicle _wounded != _wounded) then
{
unassignVehicle _wounded;
uiSleep 0.05;
_wounded action ["EJECT", _vcl];
uiSleep 1;
};
// PVDZ_drg_RAlie = _wounded; // not used
// publicVariable "PVDZ_drg_RAlie"; // not used
_wounded switchMove "ainjppnemstpsnonwrfldnon";
_wounded setVariable ["NORRN_unit_dragged", false, true];
uiSleep 1;
while {r_drag_sqf} do {
// If the player wakes up, end the loop.
if (!(_wounded getVariable ["NORRN_unconscious", false])) then {
uiSleep 2; // Give fn_unconsious time to finish
if (vehicle _wounded != _wounded) then {
// fn_unconscious does not perform an animation if the player is in a vehicle.
[nil, _wounded, rSWITCHMOVE, "HMMWV_Cargo01"] call RE;
_wounded switchMove "HMMWV_Cargo01";
};
r_drag_sqf = false;
};
if (vehicle _wounded != _wounded && alive _wounded) then
{
_wounded playMove "BasicDriver";
};
};
uiSleep 0.01;
if (true) exitWith {};
uiSleep 1;
};

View File

@@ -1,40 +1,30 @@
// unLoad_act.sqf
// AUGUST 2010 - norrin
// Updated December 2019 - JasonTM
private ["_args","_dragger","_vcl","_wounded"];
private ["_args","_unconscious_crew","_vehicle","_pos","_wounded","_medic"];
_args = _this select 3;
_name = _args select 0;
_vcl = _args select 1;
_crewVcl = crew _vcl;
LHA_Deck = [];
LHA_height = 0;
_medic = _args select 0;
_unconscious_crew = _args select 1;
_vehicle = _args select 2;
_pos = [_vehicle] call FNC_GetPos;
//_name removeAction NORRN_pullOutAction; // NORRN_pullOutAction is defined anywhere
r_action = false;
call fnc_usec_medic_removeActions;
for [{ _loop = 0 },{ _loop < count _crewVcl },{ _loop = _loop + 1}] do
{
_unit = _crewVcl select _loop;
if (_unit getVariable "NORRN_unconscious") then
// Prevent trolling unconscious players by checking that the position is not over water.
if !(surfaceIsWater _pos) then {
{
unassignVehicle _unit;
uiSleep 0.05;
_unit action ["EJECT", _vcl];
uiSleep 1;
_position = getPosATL _unit;
_isOnDeck = getPosASL _unit in LHA_Deck;
if (_isOnDeck) then {
_unit setPosAsl [(_position select 0), (_position select 1), (LHA_height+1)];
};
_unit switchMove "";
_unit switchMove "ainjppnemstpsnonwrfldnon";
uiSleep 0.2;
//Needed or else patient user input is not fully disabled after eject
PVDZ_drg_RaDrag = [_unit];
publicVariable "PVDZ_drg_RaDrag";
};
uiSleep 0.1;
};
_wounded = _x;
unassignVehicle _wounded;
_wounded action ["EJECT", _vehicle];
// Send information to reestablish the "lie on back" animation
PVDZ_send = [_wounded,"UnloadWounded",_wounded,[_pos,dayz_authKey,_medic]];
publicVariableServer "PVDZ_send";
if (true) exitWith {};
} count _unconscious_crew;
} else {
localize "str_actions_unload_fail" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,18 @@
// unload_wounded.sqf
// December 2019 - JasonTM
private "_wounded";
_wounded = _this;
// Check to see that the passed object matches local player object
if (player != _wounded) exitWith {};
// Check if the player is still unconscious
if (r_player_unconscious) then {
// Reestablish the "lie on back" animation
[nil, _wounded, rSWITCHMOVE, "ainjppnemstpsnonwrfldnon"] call RE;
_wounded switchmove "ainjppnemstpsnonwrfldnon";
};
r_drag_sqf = false;

View File

@@ -1,23 +1,27 @@
private ["_id","_unit"];
private "_unit";
_unit = (_this select 3) select 0;
call fnc_usec_medic_removeActions;
r_action = false;
player removeMagazine "ItemPainkiller";
if (vehicle player == player) then {
//not in a vehicle
player playActionNow "Gear";
};
if ((_unit == player) or (vehicle player != player)) then {
if (_unit == player) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
[player,player] call player_medPainkiller;
localize "str_actions_medical_painkillers_self" call dayz_rollingMessages;
} else {
//Send to server its given to someone else.
// Heal another player
PVDZ_send = [_unit,"Painkiller",[_unit,player]];
publicVariableServer "PVDZ_send";
// Give humanity
[20,0] call player_humanityChange;
format [localize "str_actions_medical_painkillers_give",(name _unit)] call dayz_rollingMessages;
};
player removeMagazine "ItemPainkiller";

View File

@@ -0,0 +1,26 @@
// animDrag.sqf
private "_dragee";
_dragee = _this;
// Check to see that the passed object matches local player object
if (player != _dragee) exitWith {};
if !(r_player_unconscious) exitWith {};
// Have to wait until attached to set direction and position
_dragee setDir -180;
_dragee setPos (getPos _dragee);
_dragee setVariable ["NORRN_unit_dragged", true, true];
uiSleep 1.5;
// First animation
[nil, _dragee, rSWITCHMOVE, "ainjpfalmstpsnonwrfldnon_carried_up"] call RE;
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_up";
uiSleep 10;
// Second animation
[nil, _dragee, rSWITCHMOVE, "ainjpfalmstpsnonwrfldnon_carried_still"] call RE;
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_still";

View File

@@ -1,5 +1,16 @@
// animDrag.sqf
private "_dragee";
_dragee = _this select 0;
_dragee = _this;
_dragee switchmove "ainjppnemstpsnonwrfldb_still";
// Check to see that the passed object matches local player object
if (player != _dragee) exitWith {};
if !(r_player_unconscious) exitWith {};
_dragee setVariable ["NORRN_unit_dragged", true, true];
// Animation needs to be synced on all clients.
[nil, _dragee, rSWITCHMOVE, "ainjppnemstpsnonwrfldb_still"] call RE;
_dragee playMoveNow "ainjppnemstpsnonwrfldb_still";
_dragee setDir -180;
_dragee setPos (getPos _dragee);

View File

@@ -0,0 +1,18 @@
// animDrop.sqf
private "_dragee";
_dragee = _this;
// Check to see that the passed object matches local player object
if (player != _dragee) exitWith {};
_dragee setVariable ["NORRN_unit_dragged", false, true];
detach _dragee;
// We don't want to override the animations from fn_unconscious or load_act.sqf
if (r_player_unconscious) then {
// Animation needs to be synced on all clients.
[nil, _dragee, rSWITCHMOVE, "ainjppnemstpsnonwrfldnon"] call RE;
_dragee switchmove "ainjppnemstpsnonwrfldnon";
};

View File

@@ -1,4 +0,0 @@
//carriedUp.sqf
_dragee = _this select 0;
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_up";

View File

@@ -1,9 +1,11 @@
private ["_array","_unit","_medic"];
_array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
private ["_unit","_medic"];
if ((_unit == player) or (vehicle player != player)) then {
r_player_infected = false;
_unit setVariable["USEC_infected",false,true];
};
_unit = _this select 0;
_medic = _this select 1;
r_player_infected = false;
_unit setVariable["USEC_infected",false,true];
if (_medic != player) then {
format [localize "str_actions_medical_antibiotics_received",(name _medic)] call dayz_rollingMessages;
};

View File

@@ -1,23 +1,34 @@
// animHealed.sqf
private["_array","_unit","_medic","_display","_control"];
private["_msg","_isSepsis","_unit","_medic","_display","_control"];
disableserialization;
_array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
if ((_unit == player) or (vehicle player != player)) then {
r_player_injured = false;
r_player_handler = false;
_unit = _this select 0;
_medic = _this select 1;
_isSepsis = _this select 2;
if (r_player_blood == r_player_bloodTotal) then {
player setVariable["USEC_lowBlood",false,true];
};
r_player_injured = false;
r_player_handler = false;
// Reset sepsis variables if sepsis bandage was used.
if (_isSepsis) then {
r_player_Sepsis = [false, 0];
_unit setVariable ["USEC_Sepsis", false, true];
_unit setVariable ["sepsisStarted", nil];
};
dayz_sourceBleeding = objNull;
call fnc_usec_resetWoundPoints;
if (r_player_blood == r_player_bloodTotal) then {
player setVariable["USEC_lowBlood",false,true];
};
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1303;
_control ctrlShow false;
};
dayz_sourceBleeding = objNull;
call fnc_usec_resetWoundPoints;
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1303;
_control ctrlShow false;
if (_medic != player) then {
_msg = if (_isSepsis) then {"str_actions_medical_sepsisbandage_received"} else {"str_actions_medical_bandage_received"};
format [localize _msg,(name _medic)] call dayz_rollingMessages;
};

View File

@@ -1,16 +1,16 @@
// called by PublicVariableEventHandler "PVCDZ_hlt_Epi", received from the server,
// because another player sent a PVDZ_send = [_unit,"Epinephrine",[_unit,player,"ItemEpinephrine"]];
// because another player sent a PVDZ_send = [_unit,"Epinephrine",[_unit,player]];
_array = _this; //_this select 0;
_unit = _array select 0; // healed
_medic = _array select 1; // healer
private ["_unit","_medic"];
_isDead = _unit getVariable["USEC_isDead",false];
_unit = _this select 0;
_medic = _this select 1;
//if (local _unit) then {_unit setCaptive false}; // captive ????
_unit setVariable ["NORRN_unconscious", false, true];
_unit setVariable ["USEC_isCardiac",false, true];
r_player_unconscious = false;
r_player_cardiac = false;
if (_unit == player and !(_unit getVariable["USEC_isDead",false]) and _medic != _unit and _medic distance _unit < 5) then {
_unit setVariable ["NORRN_unconscious", false, false]; r_player_unconscious = false;
_unit setVariable ["USEC_isCardiac",false, false]; r_player_cardiac = false;
//AmovPpneMstpSnonWnonDnon_healed
if (_medic != player) then {
format [localize "str_actions_medical_general_received",(name _medic), localize "STR_EQUIP_NAME_14"] call dayz_rollingMessages;
};

View File

@@ -1,22 +1,23 @@
private ["_array","_unit","_medic","_display","_control"];
private ["_msg","_unit","_medic","_item"];
disableserialization;
_array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
if ((_unit == player) or (vehicle player != player)) then {
r_fracture_legs = false;
r_fracture_arms = false;
_unit setHit["legs",0];
_unit setHit["hands",0];
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1203;
_control ctrlShow false;
//_id = false spawn dayz_disableRespawn;
};
_unit = _this select 0;
_medic = _this select 1;
_item = _this select 2;
r_fracture_legs = false;
r_fracture_arms = false;
_unit setHit["legs",0];
_unit setHit["hands",0];
_unit setVariable ["hit_legs",0,true];
_unit setVariable ["hit_hands",0,true];
_unit setVariable ["hit_hands",0,true];
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1203;
_control ctrlShow false;
if (_medic != player) then {
_msg = if (_item == "equip_woodensplint") then {"STR_ITEM_NAME_WOODENSPLINT"} else {"STR_EQUIP_NAME_15"};
format [localize "str_actions_medical_general_received",(name _medic), localize _msg] call dayz_rollingMessages;
};

View File

@@ -1,10 +1,12 @@
private ["_array","_unit","_medic"];
_array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
private ["_unit","_medic"];
if ((_unit == player) or (vehicle player != player)) then {
r_player_inpain = false;
_unit setVariable ["USEC_inPain", false, true];
R3F_TIRED_Accumulator = 0;
_unit = _this select 0;
_medic = _this select 1;
r_player_inpain = false;
_unit setVariable ["USEC_inPain", false, true];
R3F_TIRED_Accumulator = 0;
if (_medic != player) then {
format [localize "str_actions_medical_painkillers_receive",(name _medic)] call dayz_rollingMessages;
};

View File

@@ -1,18 +1,23 @@
// animHealed.sqf
private["_array","_unit","_medic","_amount","_display","_control","_lowBlood","_started"];
disableserialization;
private["_msg","_unit","_medic","_amount","_transfusionInfection","_timer"];
//[_unit,player,_bloodAmount]
_array = _this; //_this select 0;
_unit = _array select 0; //Player receving the blood
_medic = _array select 1; //Player sending the blood
_amount = _array select 2; //total amount of blood given
_unit = _this select 0; //Player receving the blood
_medic = _this select 1; //Player sending the blood
_amount = _this select 2; //total amount of blood given
if (_unit != player) exitWith {/* not the correct client */};
if (_amount < 0) exitWith {/* someone is trying to kill the player */};
_timer = diag_tickTime;
_started = false;
_msg = "";
r_doLoop = true;
r_interrupt = false;
if (_amount < 0) exitWith { /* someone is trying to kill the player */ };
//Infection chance
_TransfusionInfection = ((random 20) < 0.3);
localize "str_actions_medical_transfusion_start" call dayz_rollingMessages;
//Start the loop to mimic the transfusion to cut back on issues flooding the server
while {r_doLoop} do {
@@ -20,62 +25,45 @@ while {r_doLoop} do {
if ((diag_tickTime - _timer) >= 1) then {
_timer = diag_tickTime;
//Infection chance
_rndInfection = (random 20);
_TransfusionInfection = (_rndInfection < 0.3);
//Mimic the transfer of the blood (cut out the server)
if (_amount > 0) then {
_amount = _amount - 500;
};
if (!_started) then {
localize "str_actions_medical_transfusion_start" call dayz_rollingMessages;
_started = true;
// update stats based on whats being sent (should mimic 500 units of blood being sent)
if ((r_player_blood + 500) >= r_player_bloodTotal) then {
r_player_blood = r_player_bloodTotal;
player setVariable["USEC_BloodQty",r_player_bloodTotal,true];
} else {
r_player_blood = r_player_blood + 500;
player setVariable["USEC_BloodQty",r_player_blood,true];
};
//Make sure the unit is a player and update stats based on whats being sent (should mimic 500 units of blood being sent)
if (_unit == player) then {
if ((r_player_blood + 500) >= r_player_bloodTotal) then {
r_player_blood = r_player_bloodTotal;
player setVariable["USEC_BloodQty",r_player_bloodTotal,true];
} else {
r_player_blood = r_player_blood + 500;
player setVariable["USEC_BloodQty",r_player_blood,true];
};
if (((r_player_blood / r_player_bloodTotal) >= 0.35) and (r_player_lowblood)) then {
r_player_lowblood = false;
player setVariable["USEC_lowBlood",false,true];
};
if (_TransfusionInfection) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1300;
_control ctrlShow true;
if (((r_player_blood / r_player_bloodTotal) >= 0.35) and (r_player_lowblood)) then {
r_player_lowblood = false;
player setVariable["USEC_lowBlood",false,true];
};
};
//If the players blood is equals too or above r_player_bloodTotal stop or if the blood mimic amount reaches 0 end the loop.
_blood = _unit getVariable ["USEC_BloodQty", 0];
//diag_log format["Player Blood %1 - %2, - %3, - %4",_blood,_unit,_medic,(_unit getVariable "USEC_BloodQty")];
if (_blood >= r_player_bloodTotal or _amount == 0) then {
localize "str_actions_medical_transfusion_successful" call dayz_rollingMessages;
//If the players blood is equals too or above r_player_bloodTotal stop or if the blood mimic amount reaches 0 end the loop.
if ((_unit getVariable ["USEC_BloodQty", 0]) >= r_player_bloodTotal or _amount == 0) then {
_msg = "str_actions_medical_transfusion_successful";
r_doLoop = false;
};
if (r_interrupt) then {
localize "str_actions_medical_transfusion_interrupted" call dayz_rollingMessages;
_msg = "str_actions_medical_transfusion_interrupted";
r_doLoop = false;
};
//Rerun the loop
sleep 1;
};
uiSleep 1;
};
if (_TransfusionInfection) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
localize _msg call dayz_rollingMessages;

View File

@@ -1,153 +1,61 @@
private ["_unit","_blood","_lowBlood","_injured","_inPain","_animState","_started","_finished","_timer","_i","_isMedic","_duration","_rhVal","_bloodBagArrayNeeded","_BBneeded","_bbselect","_bloodBagNeeded","_badBag","_wholeBag","_bagFound","_bagToRemove","_forceClose","_bloodType","_rh","_bloodBagArray","_bbarray_length","_bloodBagWholeNeeded","_haswholebag","_r","_transfusionInfection"];
private ["_msg","_unit","_bagUsed","_duration","_rhVal","_badBag","_bloodType","_bloodBagWholeNeeded","_wholeBag","_transfusionInfection","_finished","_bloodAmount"];
// Check to see if enough time has passed since the last self-transfusion.
if (time - dayz_lastSelfTransfusion <= DZE_selfTransfuse_Values select 2) exitWith {localize "str_actions_medical_18" call dayz_rollingMessages;};
// bleed.sqf
_unit = _this select 0;
_bagUsed = _this select 1;
_blood = _unit getVariable ["USEC_BloodQty", 0];
_lowBlood = _unit getVariable ["USEC_lowBlood", false];
_injured = _unit getVariable ["USEC_injured", false];
_inPain = _unit getVariable ["USEC_inPain", false];
if (time - dayz_lastSelfTransfusion <= DZE_selfTransfuse_Values select 2) exitWith {localize "str_actions_medical_18" call dayz_rollingMessages;};
call gear_ui_init;
closeDialog 0;
_bloodType = _unit getVariable ["blood_type", false];
_rh = _unit getVariable ["rh_factor", false];
_badBag = false;
_wholeBag = false;
_bagFound = false;
_BBneeded = false;
_forceClose = false;
_transfusionInfection = if (DZE_selfTransfuse_Values select 1 <= 0) then {false} else {((random 100) < (DZE_selfTransfuse_Values select 1))};
if (_blood <= 4000) then {
_duration = 3;
} else {
_duration = 2;
};
_bloodBagArray = ["wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
if (_rh) then {_rhVal = "POS";} else {_rhVal = "NEG";};
//No subs for whole blood :(
_bloodBagWholeNeeded = "wholeBloodBag" + _bloodType + _rhVal;
_haswholebag = _bloodBagWholeNeeded in magazines player;
if (_haswholebag) then {
_wholeBag = true;
} else {
_badBag = true;
};
if (dayz_classicBloodBagSystem) then {_wholeBag = true; _badBag = false;};
call fnc_usec_medic_removeActions;
r_action = false;
if (vehicle player == player) then {
//not in a vehicle
player playActionNow "Medic";
};
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_msg = "";
_finished = false;
_timer = diag_tickTime;
_i = 0;
_r = 0;
_transfusionInfection = if (DZE_selfTransfuse_Values select 1 <= 0) then {false} else {((random 100) < (DZE_selfTransfuse_Values select 1))};
_duration = if ((_unit getVariable ["USEC_BloodQty", 0]) <= 4000) then {3} else {2};
while {r_doLoop and (_i < 12)} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (((vehicle player != player) || _isMedic) and !_started) then {
closeDialog 0;
diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
if (_badBag) then {
for "_r" from 0 to 15 do {
_bagToRemove = _bagUsed;
if (_bagToRemove in magazines player) exitWith { //TODO: add separate action menu options so the removed bag isn't random
_bagFound = true;
if (_r >= 8) then {
_wholeBag = true;
};
};
};
} else {
if (_wholeBag) then {_bagToRemove = _bloodBagWholeNeeded; };
if (dayz_classicBloodBagSystem) then { _bagToRemove = _bagUsed; };
if (_bagToRemove in magazines player) then { _bagFound = true; };
};
if (!_bagFound) then {_forceClose = true;} else { player removeMagazine _bagToRemove;};
localize "str_actions_medical_transfusion_start" call dayz_rollingMessages;
_started = true;
};
if (_started) then {
if ((diag_tickTime - _timer) >= 1) then {
_timer = diag_tickTime;
_i = _i + 3;
if (!_badBag) then {
if (!_forceClose) then {
if (!_wholeBag) then {
_randomamount = round(random 60);
r_player_blood = r_player_blood + 100 + _randomamount;
} else {
_randomamount = round(random 200);
r_player_blood = (r_player_blood + ((DZE_selfTransfuse_Values select 0)/4)) min r_player_bloodTotal;
};
//PVDZ_send = [_unit,"Transfuse",[_unit,player,1000]];
//publicVariableServer "PVDZ_send";
};
} else {
if (!_forceClose and (_i >= 12)) then {
[_unit, _duration] call fnc_usec_damageUnconscious;
};
};
};
if (vehicle player == player) then {
if (!_isMedic) then {
player playActionNow "Medic";
};
} else {
uisleep 4;
};
};
_blood = _unit getVariable ["USEC_BloodQty", 0];
if (((_blood >= r_player_bloodTotal) and !_badBag and _bagFound) or (_i == 12)) then {
diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
dayz_lastSelfTransfusion = time;
if (_transfusionInfection) then {r_player_infected = true; player setVariable["USEC_infected",true,true];};
localize "str_actions_medical_transfusion_successful" call dayz_rollingMessages;
r_doLoop = false;
};
if (r_interrupt or _forceClose) then {
diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 | _i = %3)", r_interrupt, player distance _unit, _i];
localize "str_actions_medical_transfusion_interrupted" call dayz_rollingMessages;
r_doLoop = false;
};
uiSleep 0.1;
if (!dayz_classicBloodBagSystem) then {
// A player can only self blood bag with a whole typed bag or the classic ItemBloodbag.
// If not using dayz_classicBloodBagSystem then the player needs to know his/her blood type or use wholeBloodBagONEG.
_bloodType = _unit getVariable ["blood_type", ""];
_rhVal = if (_unit getVariable ["rh_factor", false]) then {"POS"} else {"NEG"};
_bloodBagWholeNeeded = "wholeBloodBag" + _bloodType + _rhVal;
_wholeBag = _bagUsed in ["wholeBloodBagONEG",_bloodBagWholeNeeded];
if (!_wholeBag) then {_badBag = true;};
};
r_doLoop = false;
_bloodAmount = if (!_wholeBag) then {(DZE_selfTransfuse_Values select 0)} else {4000};
if (r_interrupt) then {
r_interrupt = false;
if (vehicle player == player) then {
player switchMove "";
player playActionNow "stop";
localize "str_actions_medical_transfusion_start" call dayz_rollingMessages;
_unit removeMagazine _bagUsed;
// Players can self blood bag in a vehicle so we use this simple method.
if (vehicle player == player) then {
_finished = ["Medic",1] call fn_loopAction;
} else {
uiSleep 3;
_finished = true;
};
if (!_finished) then {
_unit addMagazine _bagUsed;
_msg = "str_actions_medical_transfusion_interrupted";
} else {
if (!_badBag) then {
r_player_blood = (r_player_blood + _bloodAmount) min r_player_bloodTotal;
_msg = "str_actions_medical_transfusion_successful";
} else {
// Player gets knocked unconscious and receives no blood if wrong type is used.
[_unit, _duration] call fnc_usec_damageUnconscious;
_msg = "str_actions_medical_transfusion_fail";
};
dayz_lastSelfTransfusion = time;
if (_transfusionInfection) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
};
localize _msg call dayz_rollingMessages;

View File

@@ -46,7 +46,6 @@ fnc_usec_damageUnconscious = {
};
r_player_unconscious = true;
player setVariable["medForceUpdate",true];
player setVariable ["unconsciousTime", r_player_timeout, true];
};
@@ -228,14 +227,13 @@ fnc_usec_playerHandleBlood = {
if (_elapsedTime > _bleedTime) then {
r_player_injured = false;
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
[player,player,false] call player_medBandage;
};
_bloodDiff = r_player_blood - (player getVariable["USEC_BloodQty", r_player_bloodTotal]);
if ((_bloodDiff >= 500) or (_bloodDiff <= -500)) then {
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
};
@@ -253,7 +251,6 @@ fnc_usec_playerHandleBlood = {
if ((_bloodDiff >= 500) or (_bloodDiff <= -500)) then {
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
};
};
};
@@ -357,4 +354,4 @@ fnc_usec_damageBleed = {
deleteVehicle _source;
deleteVehicle _point;
};
};

View File

@@ -1,213 +1,134 @@
private ["_bloodAmount","_unit","_blood","_lowBlood","_injured","_inPain","_hasTransfusionKit","_animState","_started","_finished","_timer","_i","_isMedic","_isClose","_duration","_rhVal","_bloodBagArrayNeeded","_BBneeded","_bbselect","_bloodBagNeeded","_badBag","_wholeBag","_bagFound","_bagToRemove","_forceClose","_bloodType","_rh","_bloodBagArray","_bbarray_length","_bloodBagWholeNeeded","_haswholebag","_r","_bloodTestdone","_sentRequest"];// bleed.sqf
//Get receving unit
private ["_msg","_bagUsed","_bloodResult","_bloodAmount","_unit","_hasTransfusionKit","_timer","_i","_isClose","_duration","_rhVal","_bloodBagArrayNeeded","_bloodBagNeeded","_badBag","_wholeBag","_bagFound","_bloodType","_rh","_bloodBagWholeNeeded","_wholeBagFound","_bloodTestdone"];// bleed.sqf
_unit = (_this select 3) select 0;
_bagUsed = (_this select 3) select 1;
call fnc_usec_medic_removeActions;
r_action = false;
if !(vehicle player == player) exitWith {/* This check is probably not necessary */};
//Does the player have a transfusionKit
//_hasTransfusionKit = "transfusionKit" in magazines player;
if (time - dayz_lastTransfusion > 120) then {dayz_bloodBagHumanity = 300;}; //Reset humanity reward to full value after two minutes
//Get receving units blood value
_blood = _unit getVariable ["USEC_BloodQty", 0];
//Get receving units bloodtype
_bloodType = _unit getVariable ["blood_type", ""];
//Get the receving units RH type
_rh = _unit getVariable ["rh_factor", false];
//Get status of bloodtest of receving unit
_bloodTestdone = _unit getVariable ["blood_testdone", false];
r_interrupt = false;
_badBag = false;
_wholeBag = false;
_bagFound = false;
_forceClose = false;
if (!dayz_classicBloodBagSystem) then {
_bloodType = _unit getVariable ["blood_type", ""]; //Get receiving units blood type
_rh = _unit getVariable ["rh_factor", false]; //Get the receiving units RH type
_rhVal = if (_rh) then {"POS"} else {"NEG"}; // Get the RH value.
_bloodTestdone = _unit getVariable ["blood_testdone", false]; //Get status of blood test of receiving unit
_bloodResult = _bloodType + _rhVal; // Combine strings for convenience
//End if the player does not have a transfusion kit
//if (!_hasTransfusionKit) exitWith { localize "str_actions_medical_transfusion_failed_transfusionkit" call dayz_rollingMessages; };
//End if the player does not have a transfusion kit
//if (!_hasTransfusionKit) exitWith { localize "str_actions_medical_transfusion_failed_transfusionkit" call dayz_rollingMessages; };
//Unconscious timeout for receving unit
_duration = if (_blood <= 4000) then { 3 } else { 2 };
_bloodBagArray = ["bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagONEG"];
if (_bloodTestdone) then { // if the recipient does not know his blood type, only O- can apply
switch (_bloodType) do {
case "A" : {
if (_rh) then {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagAPOS","bloodBagANEG","bloodBagONEG","bloodBagOPOS"];
} else {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagANEG","bloodBagONEG"];
};
};
case "B" : {
if (_rh) then {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagBPOS","bloodBagBNEG","bloodBagONEG","bloodBagOPOS"];
} else {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagBNEG","bloodBagONEG"];
};
};
case "AB" : {
if (_rh) then {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagABPOS","bloodBagABNEG","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagONEG","bloodBagOPOS"];
} else {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagABNEG","bloodBagANEG","bloodBagBNEG","bloodBagONEG"];
};
};
case "O" : {
if (_rh) then {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagOPOS","bloodBagONEG"];
} else {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagONEG"];
};
//Unconscious timeout for receiving unit
_duration = if ((_unit getVariable ["USEC_BloodQty", 0]) <= 4000) then { 3 } else { 2 };
_bloodBagArrayNeeded = ["bloodBagONEG"];
if (_bloodTestdone) then { // if the recipient does not know his blood type, only O- can apply
_bloodBagArrayNeeded = call {
if (_bloodResult == "APOS") exitWith {["bloodBagAPOS","bloodBagANEG","bloodBagONEG","bloodBagOPOS"];};
if (_bloodResult == "ANEG") exitWith {["bloodBagANEG","bloodBagONEG"];};
if (_bloodResult == "BPOS") exitWith {["bloodBagBPOS","bloodBagBNEG","bloodBagONEG","bloodBagOPOS"];};
if (_bloodResult == "BNEG") exitWith {["bloodBagBNEG","bloodBagONEG"];};
if (_bloodResult == "ABPOS") exitWith {["bloodBagABPOS","bloodBagABNEG","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagONEG","bloodBagOPOS"];};
if (_bloodResult == "ABNEG") exitWith {["bloodBagABNEG","bloodBagANEG","bloodBagBNEG","bloodBagONEG"];};
if (_bloodResult == "OPOS") exitWith {["bloodBagOPOS","bloodBagONEG"];};
if (_bloodResult == "ONEG") exitWith {["bloodBagONEG"];};
};
};
};
_BBneeded = false;
{ if (_x in magazines player) exitWith { _BBneeded = true; _bbselect = _x; }; } count _bloodBagArrayNeeded;
_bagFound = (_bagUsed in _bloodBagArrayNeeded);
//No subs for whole blood :(
_rhVal = if (_rh) then { "POS" } else { "NEG" };
_bloodBagWholeNeeded = "wholeBloodBag" + _bloodType + _rhVal;
_haswholebag = _bloodBagWholeNeeded in magazines player;
//No subs for whole blood :(
_bloodBagWholeNeeded = "wholeBloodBag" + _bloodResult;
_wholeBagFound = (_bagUsed == _bloodBagWholeNeeded);
if (!_BBneeded and !_haswholebag) then {
_badBag = true;
};
//use packed/separated bags first
if (_BBneeded) then {
_wholeBag = false;
} else {
if (_haswholebag) then {
_wholeBag = true;
call { // Options are listed top to bottom in order of precedence
if (_bagFound) exitWith {_wholeBag = false; _badBag = false;}; //use packed/separated bags first
if (_wholeBagFound) exitWith {_wholeBag = true; _badBag = false;};
_wholeBag = false; _badBag = true; // Default
};
};
if (dayz_classicBloodBagSystem) then {_wholeBag = false; _badBag = false;};
call fnc_usec_medic_removeActions;
r_action = false;
if (vehicle player == player) then {
//not in a vehicle
player playActionNow "Medic";
};
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
_sentRequest = false;
_timer = diag_tickTime;
_i = 0;
_r = 0;
_humanityAwarded = 0;
_msg = "";
_bloodAmount = if (!_wholeBag) then { r_player_bloodTotal/*Full bloodbag*/ } else { 4000 /*Whole blood only gives 4k*/ };
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
//diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
if (_isMedic and !_started) then {
closeDialog 0;
diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
if (_badBag) then {
for "_r" from 0 to 15 do {
//select random bloodbag if the player has more then one of the required types
_bagToRemove = _bloodBagArray select _r;
//TODO: add separate action menu options so the removed bag isn't random
if (_bagToRemove in magazines player) exitWith {
_bagFound = true;
if (_r >= 8) then {
_wholeBag = true;
};
};
player removeMagazine _bagUsed;
player playActionNow "Medic";
if (!_badBag) then {
PVDZ_send = [_unit,"Transfuse",[_unit,player,_bloodAmount]];
publicVariableServer "PVDZ_send";
};
localize "str_actions_medical_transfusion_start" call dayz_rollingMessages;
while {r_doLoop} do {
if (!(["medic",animationState player] call fnc_inString)) then {
player playActionNow "Medic";
};
if ((diag_tickTime - _timer) >= 1) then {
_timer = diag_tickTime;
if (!_wholeBag) then {
_i = _i + 1; //Full bloodbag
} else {
_i = _i + 3; //Whole blood only gives 4k
};
if (!_badBag) then {
_bloodAmount = _bloodAmount - 500;
// 25 points to be given up to a maximum of 300 points if the player stays for the full duration
//This should be better this way to keep calculus simple and prevent people getting points for giving blood transfusions to healthy players (and less humanity for only very small amounts of blood)
//Pulled from pull request from ILoveBeans
if (_humanityAwarded < dayz_bloodBagHumanity) then {
_humanityAwarded = _humanityAwarded + 25;
};
} else {
_bagToRemove = if (_wholeBag) then { _bloodBagWholeNeeded } else { _bbselect };
if (dayz_classicBloodBagSystem) then {_bagToRemove = "ItemBloodbag";};
if (_bagToRemove in magazines player) then {
_bagFound = true;
// This is designed to knock the player out after 12 seconds if they get a bad blood bag.
if (_i >= 12) then {
_bloodAmount = 0;
// Send to server with key for security
PVDZ_send = [_unit,"Unconscious",[_unit,_duration],[_unit,dayz_authKey,player]];
publicVariableServer "PVDZ_send";
//diag_log ("Transfusion: "+str(PVDZ_send select 2));
_msg = "str_actions_medical_transfusion_fail";
};
};
if (!_bagFound) then {_forceClose = true;} else { player removeMagazine _bagToRemove;};
localize "str_actions_medical_transfusion_start" call dayz_rollingMessages;
//see Note 1
//[player,_unit,"loc",rTITLETEXT,format["Transfusion of %1 in progress, remain still...",_bagToRemove],"PLAIN DOWN"] call RE;
_started = true;
};
if (_started) then {
//_sentRequest var stops the pvs running more then once as it's no longer needs too 1.8.4
if ((!_sentRequest) And (!_badBag)) then {
PVDZ_send = [_unit,"Transfuse",[_unit,player,_bloodAmount]];
publicVariableServer "PVDZ_send";
_sentRequest = true;
};
if ((diag_tickTime - _timer) >= 1) then {
_timer = diag_tickTime;
//see Note 1
//PVCDZ_hlt_Transfuse = [_unit,player,1000];
//publicVariable "PVCDZ_hlt_Transfuse";
if (!_wholeBag) then {
_i = _i + 1; //Full bloodbag
} else {
_i = _i + 3; //Whole blood only gives 4k
};
if (!_badBag) then {
if (!_forceClose) then {
_bloodAmount = _bloodAmount - 500;
//see Note 1
//PVDZ_send = [_unit,"Transfuse",[_unit,player,500]];
//publicVariableServer "PVDZ_send";
// 25 points to be givin upto a maximum of 300 points if the player stays for the full duration
//This should be better this way to keep calculus simple and prevent people getting points for giving blood transfusions to healthy players (and less humanity for only very small amounts of blood)
//Pulled from pullrequest from ILoveBeans
if (_humanityAwarded < dayz_bloodBagHumanity) then {
_humanityAwarded = _humanityAwarded + 25;
};
};
} else {
if (!_forceClose and (_i >= 12)) then {
_bloodAmount = 0;
PVDZ_sendUnconscious = [_unit,_duration];
publicVariableServer "PVDZ_sendUnconscious";
diag_log ("Transfusion: "+str(PVDZ_sendUnconscious));
};
};
//see Note 1
//[player,_unit,"loc",rTITLETEXT,format["Transfusion of %1 in progress, remain still...",_bagToRemove],"PLAIN DOWN"] call RE;
};
if (!_isMedic) then {
player playActionNow "Medic";
};
};
_blood = _unit getVariable ["USEC_BloodQty", 0];
if (_blood >= r_player_bloodTotal or _bloodAmount == 0) then {
diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
localize "str_actions_medical_transfusion_successful" call dayz_rollingMessages;
dayz_bloodBagHumanity = dayz_bloodBagHumanity / 2; //Diminish humanity reward for subsequent bloodbags. Resets to full reward after two minutes.
if ((_unit getVariable ["USEC_BloodQty", 0]) >= r_player_bloodTotal || _bloodAmount == 0) then {
//diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
dayz_bloodBagHumanity = dayz_bloodBagHumanity / 2; //Diminish humanity reward for subsequent transfusions. Resets to full reward after two minutes.
dayz_lastTransfusion = time;
//see Note 1
//[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_successful","PLAIN DOWN"] call RE;
if (!_badBag and _bagFound) then { [_humanityAwarded,0] call player_humanityChange; };
if (!_badBag) then {
[_humanityAwarded,0] call player_humanityChange;
_msg = "str_actions_medical_transfusion_successful";
};
r_doLoop = false;
};
_isClose = ((player distance _unit) < ((sizeOf typeOf _unit) / 2));
if (r_interrupt or !_isClose or _forceClose) then {
diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i];
localize "str_actions_medical_transfusion_interrupted" call dayz_rollingMessages;
//see Note 1
//[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_interrupted","PLAIN DOWN"] call RE;
if (r_interrupt or !_isClose) then {
//diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i];
_msg = "str_actions_medical_transfusion_interrupted";
r_doLoop = false;
};
@@ -222,6 +143,11 @@ if (r_interrupt) then {
player playActionNow "stop";
};
// Wait until the animation stops to display the message.
waitUntil {uiSleep .5; (!(["medic",animationState player] call fnc_inString))};
localize _msg call dayz_rollingMessages;
/*
Note 1 - 1.8 system sending way too much info upto 12 times to the server on top of each call RE also being sent upto 12 times. System removed

View File

@@ -1,5 +1,4 @@
private ["_finished","_unit"];
_unit = (_this select 3) select 0;
private "_finished";
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -19,20 +18,12 @@ if (vehicle player == player) then {
};
if (_finished) then {
//["PVCDZ_hlt_Bandage",[_unit,player]] call broadcastRpcCallAll;
//PVCDZ_hlt_Bandage = [_unit,player];
//publicVariable "PVCDZ_hlt_Bandage";
//PVDZ_send = [_unit,"Bandage",[_unit,player]];
//publicVariableServer "PVDZ_send";
if ((_unit == player) or (vehicle player != player)) then {
r_player_Sepsis = [false, 0];
player setVariable ["USEC_Sepsis", false, true];
player setVariable ["sepsisStarted", nil];
};
r_player_Sepsis = [false, 0];
player setVariable ["USEC_Sepsis", false, true];
player setVariable ["sepsisStarted", nil];
localize "str_actions_medical_wipe_self" call dayz_rollingMessages;
} else {
player addMagazine "ItemAntibacterialWipe";
};
dayz_actionInProgress = false;
dayz_actionInProgress = false;

View File

@@ -289,11 +289,6 @@
<Russian>Вы приняли антибиотики.</Russian>
<German>Du hast Antibiotikum eingenommen.</German>
</Key>
<Key ID="str_actions_medical_gave_antibiotics">
<English>You gave antibiotics.</English>
<Russian>Вы поделились антибиотиками.</Russian>
<German>Du hast Antibiotikum verabreicht.</German>
</Key>
<Key ID="str_actions_medical_knocked_out">
<English>You have been knocked out.</English>
<Russian>Вы оглушены.</Russian>
@@ -18293,5 +18288,64 @@
<French>Une tenue de camouflage spécialement étudiée pour se fondre dans la végétation. Peut être porté.</French>
<German>Schwere Tarnkleidung, die dichtes Unterholz simuliert. Kann ausgepackt und getragen werden.</German>
</Key>
<!--New Strings 1.0.7-->
<Key ID="str_actions_medical_gave_antibiotics">
<English>You gave antibiotics to %1</English>
</Key>
<Key ID="str_actions_medical_antibiotics_received">
<English>%1 has given you Antibiotics</English>
</Key>
<Key ID="str_actions_medical_bandage_self">
<English>You have bandaged your wounds</English>
</Key>
<Key ID="str_actions_medical_sepsisbandage_self">
<English>You have bandaged and sanitized your wounds</English>
</Key>
<Key ID="str_actions_medical_gave_bandage">
<English>You have bandaged %1</English>
</Key>
<Key ID="str_actions_medical_gave_sepsisbandage">
<English>You have bandaged and sanitized the wounds of %1</English>
</Key>
<Key ID="str_actions_medical_bandage_received">
<English>%1 has bandaged your wounds</English>
</Key>
<Key ID="str_actions_medical_sepsisbandage_received">
<English>%1 has bandaged and sanitized your wounds</English>
</Key>
<Key ID="str_actions_medical_general_self">
<English>You have given yourself a %1</English>
</Key>
<Key ID="str_actions_medical_general_give">
<English>You have given a %1 to %2</English>
</Key>
<Key ID="str_actions_medical_08a">
<English>Give %1</English>
</Key>
<Key ID="str_actions_medical_general_received">
<English>%1 has given you a %2</English>
</Key>
<Key ID="str_actions_medical_painkillers_self">
<English>You have taken painkillers</English>
</Key>
<Key ID="str_actions_medical_painkillers_give">
<English>You have given painkillers to %1</English>
</Key>
<Key ID="str_actions_medical_painkillers_receive">
<English>%1 has given you Painkillers</English>
</Key>
<Key ID="str_actions_medical_wipe_self">
<English>You have sanitized your wounds</English>
</Key>
<Key ID="str_actions_medical_04_sepsis">
<English>Give Sepsis Bandage</English>
</Key>
<Key ID="str_actions_unload_fail">
<English>You are not allowed to unload unconscious crew into the water</English>
</Key>
<Key ID="str_actions_medical_transfusion_fail">
<English>Wrong blood type used</English>
</Key>
</Package>
</Project>

View File

@@ -59,7 +59,8 @@ _trigger = {
if (_entity isKindOf "Animal") then {
_entity setDamage 1;
} else {
[_entity, "Legs", [_entity]] call server_sendToClient;
PVCDZ_plr_Legs = [_entity];
(owner _entity) publicVariableClient "PVCDZ_plr_Legs";
};
};

View File

@@ -60,7 +60,8 @@ _trigger = {
if (_entity isKindOf "Animal") then {
_entity setDamage 1;
} else {
[_entity, "Legs", [_entity]] call server_sendToClient;
PVCDZ_plr_Legs = [_entity];
(owner _entity) publicVariableClient "PVCDZ_plr_Legs";
};
};

View File

@@ -60,7 +60,8 @@ _trigger = {
if (_entity isKindOf "Animal") then {
_entity setDamage 1;
} else {
[_entity, "Legs", [_entity]] call server_sendToClient;
PVCDZ_plr_Legs = [_entity];
(owner _entity) publicVariableClient "PVCDZ_plr_Legs";
};
};

View File

@@ -99,7 +99,6 @@ if !((_charPos select 0 == 0) && (_charPos select 1 == 0)) then {
};
if (_charPosLen < 3) then {_playerPos = [];};
};
_character setVariable ["posForceUpdate",false,true];
//Check player backpack each time sync runs
_backpack = unitBackpack _character;
@@ -108,7 +107,6 @@ _playerBackp = [typeOf _backpack,getWeaponCargo _backpack,getMagazineCargo _back
if (!_usec_Dead) then {
_medical = _character call player_sumMedical;
};
_character setVariable ["medForceUpdate",false,true];
_character addScore _kills;
/*

View File

@@ -1,14 +1,29 @@
private ["_unit","_variable","_arraytosend","_owner","_vehicle","_qty"];
private ["_unit","_variable","_arraytosend","_owner","_vehicle","_qty","_exitReason"];
//Inbound [_unit,"PVCDZ_hlt_Transfuse",[_unit,player,1000]]
_unit = _this select 0;
_variable = _this select 1;
_arraytosend = _this select 2;
_owner = owner _unit;
_exitReason = "";
// Add security for higher risk PVDZ_Send usage
if (_variable in ["Unconscious","DragPlayer","DropPlayer","Legs","RemoveObject","CarryPlayer","LoadWounded","UnloadWounded"]) then {
private ["_verifyArray","_objPos","_clientKey","_activatingPlayer","_playerUID"];
_verifyArray = _this select 3;
_objPos = _verifyArray select 0; // can be object or position
_clientKey = _verifyArray select 1;
_activatingPlayer = _verifyArray select 2;
_playerUID = getPlayerUID _activatingPlayer;
_exitReason = [_verifyArray,_variable,_objPos,_clientKey,_playerUID,_activatingPlayer] call server_verifySender;
//diag_log text format ["server_sendToClient: Player [%1:%2] used function %3 on/at %4.",(name _activatingPlayer),_playerUID,_variable,_objPos];
};
if (_exitReason != "") exitWith {diag_log _exitReason};
//diag_log format ["%1, %2, %3, %4", _unit, _variable, _arraytosend, _owner];
switch (_variable) do {
case "VehHandleDam": {
call {
if (_variable == "VehHandleDam") exitWith {
_vehicle = _arraytosend select 0;
if (local _vehicle) then {
_arraytosend call fnc_veh_handleDam;
@@ -18,7 +33,7 @@ switch (_variable) do {
};
};
case "SetFuel": {
if (_variable == "SetFuel") exitWith {
_vehicle = _arraytosend select 0;
_qty = _arraytosend select 1;
if (local _vehicle) then {
@@ -29,7 +44,7 @@ switch (_variable) do {
};
};
case "SetEngineState": {
if (_variable == "SetEngineState") exitWith {
_vehicle = _arraytosend select 0;
_state = _arraytosend select 1;
if (local _vehicle) then {
@@ -41,91 +56,105 @@ switch (_variable) do {
};
};
case "GutBody": {
if (_variable == "GutBody") exitWith {
PVCDZ_obj_GutBody = _arraytosend;
_owner publicVariableClient "PVCDZ_obj_GutBody";
};
case "HideBody": {
if (_variable == "HideBody") exitWith {
PVCDZ_obj_HideBody = _arraytosend select 0;
_owner publicVariableClient "PVCDZ_obj_HideBody";
};
case "Humanity": {
if (_variable == "Humanity") exitWith {
PVCDZ_plr_Humanity = _arraytosend;
_owner publicVariableClient "PVCDZ_plr_Humanity";
//diag_log ("Humanity" +str(PVCDZ_plr_Humanity));
};
case "dayzSetDate": {
if (_variable == "dayzSetDate") exitWith {
dayzSetDate = dayz_storeTimeDate;
_owner publicVariableClient "dayzSetDate";
//diag_log ("Time and date: " +str (dayz_storeTimeDate));
};
case "Transfuse": {
if (_variable == "Transfuse") exitWith {
PVCDZ_hlt_Transfuse = _arraytosend;
_owner publicVariableClient "PVCDZ_hlt_Transfuse";
_unit setVariable ["medForceUpdate",true];
};
case "Transfuse_completed": {
PVCDZ_hlt_Transfuse_completed = true;
_owner publicVariableClient "PVCDZ_hlt_Transfuse_completed";
_unit setVariable ["medForceUpdate",true];
};
case "Painkiller": {
if (_variable == "Painkiller") exitWith {
PVCDZ_hlt_PainK = _arraytosend;
_owner publicVariableClient "PVCDZ_hlt_PainK";
_unit setVariable ["medForceUpdate",true];
};
case "Morphine": {
if (_variable == "Morphine") exitWith {
PVCDZ_hlt_Morphine = _arraytosend;
_owner publicVariableClient "PVCDZ_hlt_Morphine";
_unit setVariable ["hit_legs",0,false];
_unit setVariable ["hit_hands",0,false];
_unit setVariable ["medForceUpdate",true];
};
case "Epinephrine": {
if (_variable == "Epinephrine") exitWith {
PVCDZ_hlt_Epi = _arraytosend;
_owner publicVariableClient "PVCDZ_hlt_Epi";
_unit setVariable ["medForceUpdate",true];
};
case "Bandage": {
if (_variable == "Bandage") exitWith {
PVCDZ_hlt_Bandage = _arraytosend;
_owner publicVariableClient "PVCDZ_hlt_Bandage";
_unit setVariable ["medForceUpdate",true];
//diag_log ("Bandage: " +str(PVCDZ_hlt_Bandage));
};
case "Antibiotics": {
if (_variable == "Antibiotics") exitWith {
PVCDZ_hlt_AntiB = _arraytosend;
_owner publicVariableClient "PVCDZ_hlt_AntiB";
_unit setVariable ["medForceUpdate",true];
};
case "Legs": {
if (_variable == "Legs") exitWith {
PVCDZ_plr_Legs = _arraytosend;
_owner publicVariableClient "PVCDZ_plr_Legs";
};
//reset OpenTarget timer
case "OpenTarget": {
_unit setVariable ["OpenTarget",true,true];
if (_variable == "OpenTarget") exitWith {
_unit setVariable ["OpenTarget",true,true];
PVCDZ_OpenTarget_Reset = true;
_owner publicVariableClient "PVCDZ_OpenTarget_Reset";
};
case "tagFriendly": {
if (_variable == "tagFriendly") exitWith {
PVDZE_plr_FriendRQ = _arraytosend;
_owner publicVariableClient "PVDZE_plr_FriendRQ";
};
case "RemoveObject": {
if (_variable == "Unconscious") exitWith {
PVDZ_receiveUnconscious = _arraytosend;
_owner publicVariableClient "PVDZ_receiveUnconscious";
};
if (_variable == "DragPlayer") exitWith {
PVDZ_drg_RaDrag = _arraytosend;
_owner publicVariableClient "PVDZ_drg_RaDrag";
};
if (_variable == "DropPlayer") exitWith {
PVDZ_drg_RaDrop = _arraytosend;
_owner publicVariableClient "PVDZ_drg_RaDrop";
};
if (_variable == "CarryPlayer") exitWith {
PVDZ_drg_RaCarry = _arraytosend;
_owner publicVariableClient "PVDZ_drg_RaCarry";
};
if (_variable == "LoadWounded") exitWith {
PVDZ_drg_RaLW = _arraytosend;
_owner publicVariableClient "PVDZ_drg_RaLW";
};
if (_variable == "UnloadWounded") exitWith {
PVDZ_drg_RaUW = _arraytosend;
_owner publicVariableClient "PVDZ_drg_RaUW";
};
if (_variable == "RemoveObject") exitWith {
PVDZE_obj_Remove = _arraytosend;
{
_pOwner = owner _x;
@@ -134,5 +163,7 @@ switch (_variable) do {
};
} forEach playableUnits;
};
default { diag_log format ["%1, %2, %3, %4", _unit, _variable, _arraytosend, _owner]; };
//default
diag_log format ["%1, %2, %3, %4", _unit, _variable, _arraytosend, _owner];
};

View File

@@ -49,4 +49,4 @@ if (local _wounded) then
};
};
uiSleep 0.01;
if (true) exitWith {};
if (true) exitWith {};

View File

@@ -36,4 +36,4 @@ if (_finished) then {
player addMagazine "ItemMorphine";
};
dayz_actionInProgress = false;
dayz_actionInProgress = false;

View File

@@ -4,4 +4,4 @@ _unit = _this select 0;
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
_unit allowDamage true;
_unit setCaptive false;
_unit setCaptive false;

View File

@@ -6,4 +6,4 @@ _unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
if (_unit == player) then {
r_player_unconscious = false;
r_player_injured = false;
};
};

View File

@@ -0,0 +1,4 @@
//carriedUp.sqf
_dragee = _this select 0;
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_up";

View File

@@ -2,4 +2,4 @@
_unit = _this select 0;
_unit switchMove "kia_hmmwv_driver";
_unit switchMove "kia_hmmwv_driver";

View File

@@ -4,4 +4,4 @@ _unit = _array select 0;
_medic = _array select 1;
_item = _array select 2;
_medic playMove "AinvPknlMstpSnonWrflDnon_medic1";
_medic playMove "AinvPknlMstpSnonWrflDnon_medic1";

View File

@@ -2,4 +2,4 @@
_unit = _this select 0;
_unit switchMove "";
_unit switchMove "";

View File

@@ -2,4 +2,4 @@
_unit = _this select 0;
_unit switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";
_unit switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";

View File

@@ -2,4 +2,4 @@
_dragee = _this select 0;
_dragee setDir 180;
_dragee setDir 180;

View File

@@ -1,6 +1,6 @@
//new
5 !=(remExField|remExFP) !=(PVCDZ_obj_GutBody|drn_AskServerDynamicWeatherEventArgs|BIS_effects_gepv|achievement) !=PVDZ_(drg_(RaDrag|RaLW|RLact)|getTickTime|hlt_Bleed|obj_(Delete|Publish|RoadFlare|Destroy|Fire)|veh_Save|veh_SF) !=PVDZ_(plr_(Death|Login[12]|LoginRecord|Save|SwitchMove)|Server(_Simulation|StoreVar)|sec_atp) !=PVDZ_(playerMedicalSync|object_replace|groupInvite) !=PVDZ_(send(|Unconscious)) !=PVDZ_Server_(buildLock|UpdateGroup) !=PVDZ_Server_process(Code|SetAccessCode) !=PVDZ_objgather_(Delete|Knockdown) !=PVDZE_(obj_(Swap|Trade)|maintainArea|PingSend|veh_(Lock|Publish2|Upgrade)|handleSafeGear|plr_(DeathB|FriendRQ|TradeMenu))
1=BIS_effects_gepv|PVDZ_(drg_RaDrag|hlt_Bleed|obj_Delete|obj_Destroy|obj_Publish|plr_Death|plr_LoginRecord|sec_atp|send)
5 !=(remExField|remExFP) !=(PVCDZ_obj_GutBody|drn_AskServerDynamicWeatherEventArgs|BIS_effects_gepv|achievement) !=PVDZ_(getTickTime|hlt_Bleed|obj_(Delete|Publish|RoadFlare|Destroy|Fire)|veh_Save|veh_SF) !=PVDZ_(plr_(Death|Login[12]|LoginRecord|Save|SwitchMove)|Server(_Simulation|StoreVar)|sec_atp) !=PVDZ_(playerMedicalSync|object_replace|groupInvite) !=PVDZ_send !=PVDZ_Server_(buildLock|UpdateGroup) !=PVDZ_Server_process(Code|SetAccessCode) !=PVDZ_objgather_(Delete|Knockdown) !=PVDZE_(obj_(Swap|Trade)|maintainArea|PingSend|veh_(Lock|Publish2|Upgrade)|handleSafeGear|plr_(DeathB|FriendRQ|TradeMenu))
1=BIS_effects_gepv|PVDZ_(|hlt_Bleed|obj_Delete|obj_Destroy|obj_Publish|plr_Death|plr_LoginRecord|sec_atp|send)
1=PVDZ_veh_(Save|SF)
1=PVDZE_obj_Swap
1=PVDZE_veh_(Publish2|Upgrade)
1=PVDZE_veh_(Publish2|Upgrade)

View File

@@ -1,7 +1,7 @@
//new
5 '..*' !^(USEC_|NORRN_|BIS_|hit_) !=(totaldmg|actionSet|agentObjectCamps|armed|banditKills|characterID|claimed|combattimeout|deathType|doLoiter|firedDamage) !=(firedHit|freeTarget|headShots|hitRegistered|humanity|humanKills|lastPos|looted|meatHarvested|medForceUpdate|messing|myDest) !=(owner|posForceUpdate|remotetargets|temperature|unconsciousTime|updatePlayer|zombieKills|zombieSpawn) !=(blood(taken|_type)|rh_factor) !^$
5 '..*' !^(USEC_|NORRN_|BIS_|hit_) !=(totaldmg|actionSet|agentObjectCamps|armed|banditKills|characterID|claimed|combattimeout|deathType|doLoiter|firedDamage) !=(firedHit|freeTarget|headShots|hitRegistered|humanity|humanKills|lastPos|looted|meatHarvested|messing|myDest) !=(owner|remotetargets|temperature|unconsciousTime|updatePlayer|zombieKills|zombieSpawn) !=(blood(taken|_type)|rh_factor) !^$
5 ^USEC_!=USEC_(BloodQty|infected|injured|inPain|isCardiac|isDead|lowBlood|Sepsis)
5 ^NORRN_ !=NORRN_(LoadVcl|unconscious|unit_dragged)
5 ^NORRN_ !=NORRN_(unconscious|unit_dragged)
5 ^bis_ !=bis_greeted(by(evil|languages|people|times)|languages|people|times) !=BIS_noCoreConversations
5 ^hit_ !=hit_(Pelvis|aimpoint|lelbow|relbow|RightFoot|LeftFoot|neck|pilot|hands|svetlo|vez|zbran) !=hit_(hands|legs) !=hit_arms !="hit_(elektronika|engine|fueltank|glass[0-9]+|karoserie|(mala|velka) vrtule|motor|munice|netrup|palivo)" !="hit_(pravy (predni|zadni) tlumic|[lp] svetlo|sklo predni [lp]|svetlo l|wheel_[12]_[1-4]_steering|wheel_[12]_damper)" !=hit_telo !="hit_\?" !="hit_(light_nav_(right|top|left|back)|light_1_(1_dir|1_pos|2_dir|2_pos)|LandLeft|LandRight)" !="hit_(NEmotor|NEtelo|pas_L|pas_P)" !="hit_door_(fl|rl|fr|rr)"
1=hit_(Pelvis|aimpoint|lelbow|relbow|RightFoot|LeftFoot|neck|pilot) // Bleeding Limbs (optional)