Commit 8b63324c authored by Razer's avatar Razer
Browse files

Added ability to revive dead players

parent 87f30d16
......@@ -10,7 +10,7 @@
*/
params["_classname",["_target",objNull]];
if(isNull _target) exitWith {};
_animation = "Medic";
_animation = "MedicOther";
_success = {
params["_target"];
[1] call DS_fnc_addPoints;
......@@ -18,7 +18,17 @@ _success = {
if(_state == "INCAPACITATED") then {
_target setVariable ["DS_var_Defibbed",true,true];
} else {
[-500] remoteExecCall ["DS_fnc_onBloodRecive", _target];
if (!alive _target && isPlayer _target) then {
_currentLevel = player getVariable ["PVAR_DS_Progression_Medical_Level",0];
if (_currentLevel == 0) exitWith {systemChat "You need at least medical level 1"};
if (random 100 < (10 * _currentLevel)) then {
_target setVariable ["DS_var_Defibbed",true,true];
[-1] remoteExecCall ["setPlayerRespawnTime",_target];
};
} else {
[-500] remoteExecCall ["DS_fnc_onBloodReceive",_target];
};
};
};
_failure = {
......
/*
* Desolation Redux
* http://desolationredux.com/
* © 2016 - 2020 Desolation Dev Team
*
* This work is licensed under the Arma Public License Share Alike (APL-SA) + Bohemia monetization rights.
* To view a copy of this license, visit:
* https://www.bistudio.com/community/licenses/arma-public-license-share-alike/
* https://www.bistudio.com/monetization/
*/
params [["_newUnit",objNull],["_corpse",objNull]];
if (isNull _newUnit || isNull _corpse) exitWith {};
_corpse setVariable ["DS_var_Defibbed",nil,true];
[_corpse,true] remoteExec ["hideObjectGlobal",2];
// Restore SVAR variables
waitUntil {isNil {_newUnit getVariable "SVAR_DS_var_Blood"}}; // Make sure ApmsDB plugin removes the variables first
[_newUnit,_corpse] remoteExecCall ["DS_fnc_restoreVariables",2];
_loadout = (getUnitLoadout _corpse);
_newUnit switchMove "amovppnemstpsnonwnondnon"; // Prone, no wep
_newUnit setPosATL (getPosATL _corpse);
_newUnit setDir (getDir _corpse);
// Make sure server gets the varibles reseted first, before removing body object
waitUntil {!isNil {_newUnit getVariable "SVAR_DS_var_Blood"}};
deleteVehicle _corpse;
// Restore loadout once body is removed to prevent duplicating
_newUnit setUnitLoadout _loadout;
// Create new character
[player] remoteExec ["DB_fnc_registerCharacter",2];
// ----MODIFIED FINISH SPAWN----
player setVariable ["DS_var_isPlaying",true,true];
// starting health systems
call DS_fnc_initHealthSys;
[] spawn DS_fnc_initStatusSys;
call DS_fnc_initBleedingSystem;
if (DS_var_blood < 5000) then {
DS_var_blood = 5000;
};
//--- fire scripted plugin events
["DS_OnPlayerReady",[player]] spawn BASE_fnc_addEventHandler;
if(!isNil "MSYS_fnc_registerMeleeAction") then { //--- if the Melee plugin is included, register our fishing action
["DSR_Melee_Fishingrod","dsr_KatanaSlashGst",[false,false,0,0,{((random 0.1) + 0.15)}],0.6,1.5] call MSYS_fnc_registerMeleeAction;
};
[true] call DS_fnc_toggleStatus;
setPlayerRespawnTime (getNumber(missionConfigFile >> "respawnDelay")); // Reset respawn time
//--- fade into the game
1 fadeSound 2;
1 fadeMusic 2;
0 cutText ["","BLACK IN",5];
\ No newline at end of file
......@@ -12,8 +12,8 @@
params["_bloodChange"];
_currentLevel = player getVariable ["PVAR_DS_Progression_Medical_Level",0];
if(_currentLevel >= 1) then {
_bloodChange = _bloodChange + 2500;
if(_currentLevel >= 1 && _bloodChange > 0) then { // Dont make negative values to positive
_bloodChange = _bloodChange + (500 * _currentLevel);
};
DS_var_Blood = (DS_var_Blood + _bloodChange) min 27500;
\ No newline at end of file
params ["_newUnit","_corpse","_respawn","_time"];
if (_corpse getVariable ["DS_var_Defibbed",false]) exitWith {
[_newUnit,_corpse] spawn DS_fnc_revivePlayer;
};
[_newUnit,false] remoteExec ["enableSimulationGlobal",2];
[_newUnit,true] remoteExec ["hideObjectGlobal",2];
_newUnit allowDamage false;
......
/*
* Desolation Redux
* http://desolationredux.com/
* © 2016 - 2020 Desolation Dev Team
*
* This work is licensed under the Arma Public License Share Alike (APL-SA) + Bohemia monetization rights.
* To view a copy of this license, visit:
* https://www.bistudio.com/community/licenses/arma-public-license-share-alike/
* https://www.bistudio.com/monetization/
*/
// This function is used when reviving player and moving the SVARs from body object to new player object
params ["_newUnit","_oldUnit"];
(allVariables _oldUnit) apply {
if("svar_" in _x) then { // Both (_svar_ and svar_)
_data = _oldUnit getVariable _x;
if((_x select [0,1]) == "_") then {
_newUnit setVariable [_x,_data];
} else {
_newUnit setVariable [_x,_data,true];
};
};
};
\ No newline at end of file
......@@ -473,6 +473,7 @@ class CfgFunctions
isclient = 1;
class knockOut {};
class stopBleeding {};
class revivePlayer {};
};
class Client_Medical_Bleeding {
file = "Desolation\Client\Medical\Bleeding";
......@@ -514,6 +515,7 @@ class CfgFunctions
isserver = 1;
class initSpawnSettings {};
class requestSave {};
class restoreVariables {};
};
class Server_Audio {
file = "Desolation\Server\Audio";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment