mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
NL Weapons - Scripts
This commit is contained in:
parent
9b1dc356e9
commit
4a6506513c
@ -18,60 +18,67 @@ if !(_source isEqualTo _unit) then {
|
||||
switch _projectile do {
|
||||
case "B_EnergyPack": {
|
||||
EPOCH_HandleDamageTimeOut = diag_ticktime + 0.1;
|
||||
if (currentweapon _source isEqualTo "pvcrifle_01_epoch") then {
|
||||
if !(lifeState _unit == "INCAPACITATED") then {
|
||||
EPOCH_HandleDamageTimeOut = diag_ticktime + 1;
|
||||
_unit setUnconscious true;
|
||||
EPOCH_UnconsciousTime = diag_ticktime + 60 + (random 120);
|
||||
["You are Knocked out for a while...",5] call Epoch_Message;
|
||||
};
|
||||
}
|
||||
else {
|
||||
if (_source distance _unit > 10) exitwith {};
|
||||
if !(missionnamespace getvariable ["EPOCH_OldRevive",false]) then {
|
||||
_attachments = handgunItems _source;
|
||||
if ("Heal_EPOCH" in _attachments) then {
|
||||
if (lifeState _unit == "INCAPACITATED") exitwith {
|
||||
EPOCH_HandleDamageTimeOut = diag_ticktime + 1;
|
||||
_unit setUnconscious false;
|
||||
_unit playMoveNow 'AmovPercMstpSnonWnonDnon';
|
||||
if (_source distance _unit > 10) exitwith {};
|
||||
if !(missionnamespace getvariable ["EPOCH_OldRevive",false]) then {
|
||||
_attachments = handgunItems _source;
|
||||
if ("Heal_EPOCH" in _attachments) then {
|
||||
if (lifeState _unit == "INCAPACITATED") exitwith {
|
||||
EPOCH_HandleDamageTimeOut = diag_ticktime + 1;
|
||||
_unit setUnconscious false;
|
||||
_unit playMoveNow 'AmovPercMstpSnonWnonDnon';
|
||||
};
|
||||
_highestDMG = 0;
|
||||
_currentHIT = -1;
|
||||
_currentDMG = 0;
|
||||
{
|
||||
_currentDMG = _x;
|
||||
if (_currentDMG > _highestDMG) then{
|
||||
_highestDMG = _currentDMG;
|
||||
_currentHIT = _forEachIndex;
|
||||
};
|
||||
_highestDMG = 0;
|
||||
_currentHIT = -1;
|
||||
_currentDMG = 0;
|
||||
{
|
||||
_currentDMG = _x;
|
||||
if (_currentDMG > _highestDMG) then{
|
||||
_highestDMG = _currentDMG;
|
||||
_currentHIT = _forEachIndex;
|
||||
};
|
||||
}forEach((getAllHitPointsDamage _unit) param[2,[]]);
|
||||
if (_highestDMG > 0) then {
|
||||
_newDMG = 0;
|
||||
[_unit,[[_currentHIT,_newDMG]]] call EPOCH_client_repairVehicle;
|
||||
} else {
|
||||
if ((damage _unit) > 0) then {
|
||||
[_unit,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2];
|
||||
};
|
||||
}forEach((getAllHitPointsDamage _unit) param[2,[]]);
|
||||
if (_highestDMG > 0) then {
|
||||
_newDMG = 0;
|
||||
[_unit,[[_currentHIT,_newDMG]]] call EPOCH_client_repairVehicle;
|
||||
} else {
|
||||
if ((damage _unit) > 0) then {
|
||||
[_unit,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2];
|
||||
};
|
||||
};
|
||||
if ("Defib_EPOCH" in _attachments) then {
|
||||
if !(alive _unit) then {
|
||||
EPOCH_HandleDamageTimeOut = diag_ticktime + 1;
|
||||
[_unit,_source,Epoch_personalToken] remoteExec ["EPOCH_server_revivePlayer",2];
|
||||
};
|
||||
};
|
||||
if ("Defib_EPOCH" in _attachments) then {
|
||||
if !(alive _unit) then {
|
||||
EPOCH_HandleDamageTimeOut = diag_ticktime + 1;
|
||||
[_unit,_source,Epoch_personalToken] remoteExec ["EPOCH_server_revivePlayer",2];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
case "B_KnockOut": {
|
||||
case "shell_12g_bb";
|
||||
case "bbag_pvc";
|
||||
case "xbow_tranq";
|
||||
case "tranq_dart": {
|
||||
if !(lifeState _unit == "INCAPACITATED") then {
|
||||
EPOCH_HandleDamageTimeOut = diag_ticktime + 1;
|
||||
_unit setUnconscious true;
|
||||
EPOCH_UnconsciousTime = diag_ticktime + 60 + (random 120);
|
||||
(["CfgEpochClient", "UnconsciousTime", [60,180]] call EPOCH_fnc_returnConfigEntryV2) params [["_mintime",60],["_maxtime",180]];
|
||||
EPOCH_UnconsciousTime = diag_ticktime + _mintime + (random (_maxtime - _mintime));
|
||||
["You are Knocked out for a while...",5] call Epoch_Message;
|
||||
};
|
||||
};
|
||||
case "B_Swing";
|
||||
case "B_Stick";
|
||||
case "B_Hatchet": {
|
||||
if !(lifeState _unit == "INCAPACITATED") then {
|
||||
if ((random 100) < (["CfgEpochClient", "UnconsciousChance", 30] call EPOCH_fnc_returnConfigEntryV2)) then {
|
||||
EPOCH_HandleDamageTimeOut = diag_ticktime + 1;
|
||||
_unit setUnconscious true;
|
||||
(["CfgEpochClient", "UnconsciousTime", [60,180]] call EPOCH_fnc_returnConfigEntryV2) params [["_mintime",60],["_maxtime",180]];
|
||||
EPOCH_UnconsciousTime = diag_ticktime + _mintime + (random (_maxtime - _mintime));
|
||||
["You are Knocked out for a while...",5] call Epoch_Message;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
_damage
|
||||
|
@ -19,6 +19,8 @@ class CfgEpochClient
|
||||
debug = "true"; // true = enable extra rpt debug lines, false to disable
|
||||
|
||||
UseOldRevive = "false"; // Revive / Heal Player has been changed to use "HandleDamage" Eventhandler. If scripts are breaking it for you, set it to true (not recommended!)
|
||||
UnconsciousChance = 30; // Change in percent to get unconscious by a hit with an Axe / Sledge / Sword
|
||||
UnconsciousTime[] = {60,180}; // Min / Max time for unconscious after you got a hit from a non lethal weapon / Axe / Sledge / Sword
|
||||
|
||||
antagonistRngChance = 100; // increase number to reduce chances and reduce to increase. Default 100
|
||||
NuisanceMulti = 0.5; // Multi for Nuisance increase on shooting - higher Nuisance effect at least antagonist spawn change. (0-1, default 0.5)
|
||||
|
Loading…
Reference in New Issue
Block a user