diff --git a/addons/pharma/functions/fnc_medicationLocal.sqf b/addons/pharma/functions/fnc_medicationLocal.sqf index 1440b1e0f..905b1f02e 100644 --- a/addons/pharma/functions/fnc_medicationLocal.sqf +++ b/addons/pharma/functions/fnc_medicationLocal.sqf @@ -111,23 +111,35 @@ TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); //Change Alpha Factor [_patient, _alphaFactor] call FUNC(alphaAction); +if ([QGVAR(AMS_Enabled)] call CBA_settings_fnc_get) then { -_medicationParts = (_className select [13, count _className - 13]) splitString "_"; + private _medicationParts = (_className splitString "_"); -if (count _medicationParts > 4) then { - _medicationName = _medicationParts select 4; + if (count _medicationParts > 4) then { + _medicationName = _medicationParts select 2; - if (_medicationName in ["lorazepam","EACA","TXA","amiodarone","flumazenil"]) then { + if (_medicationName in ["lorazepam","EACA","TXA","amiodarone","flumazenil"]) then { [format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart], _patient] call CBA_fnc_targetEvent; - }; + }; - if (_medicationName in ["ketamine","atropine"]) then { + if (_medicationName in ["ketamine","atropine"]) then { [format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; - }; + }; - if (_medicationName in ["fentanyl","morphine","nalbuphine"]) then { + if (_medicationName in ["fentanyl","morphine","nalbuphine"]) then { [format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart, _opioidRelief], _patient] call CBA_fnc_targetEvent; + }; + + } else { + diag_log format ["Unexpected _className format: %1", _className]; + }; + } else { + + if (_className in ["Lorazepam","Ketamine","EACA","TXA","Atropine","Amiodarone","Flumazenil"]) then { + [format ["kat_pharma_%1Local", toLower _className], [_patient, _bodyPart], _patient] call CBA_fnc_targetEvent; }; -} else { - diag_log format ["Unexpected _className format: %1", _className]; -}; + + if (_className in ["Fentanyl","Morphine","Nalbuphine"]) then { + [format ["kat_pharma_%1Local", toLower _className], [_patient, _bodyPart, _opioidRelief], _patient] call CBA_fnc_targetEvent; + }; +}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf index f95bf942e..260d7496a 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [player, leftLeg, syringe_kat_ketamine_5ml_2] call kat_pharma_fnc_ketamineLocal; + * [player, leftLeg, syringe_kat_ketamine_5ml_2] call kat_pharma_fnc_treatmentAdvanced_ketamineLocal; * * Public: No */ @@ -20,6 +20,14 @@ params ["_patient", "_bodyPart", "_classname"]; if !(alive _target) exitWith {}; +if (_classname isEqualTo "syringe_kat_ketamine_5ml_2") then { + _patient setVariable [QEGVAR(surgery,sedated), true, true]; + [_patient, true] call ACEFUNC(medical,setUnconscious); + + [{ + _patient setVariable ["kat_surgery_sedated", false, true]; + }, 90] call CBA_fnc_waitAndExecute; +}; if (ACE_Player != _target) exitWith {}; if (GVAR(chromatic_aberration_checkbox_ketamine)) then { [{ @@ -63,10 +71,3 @@ if (GVAR(chromatic_aberration_checkbox_ketamine)) then { }, [_target], 60] call CBA_fnc_waitAndExecute; // chroma start after 60s }; - -if (_classname isEqualTo "syringe_kat_ketamine_5ml_2") then { - _patient setVariable [QEGVAR(surgery,sedated), true, true]; - [_patient, true] call ACEFUNC(medical,setUnconscious); - - [[_patient setVariable [QEGVAR(surgery,sedated), false, true]], 90] call CBA_fnc_waitAndExecute; -};