From 6c899dec9bd8c48ad8f0014d99e8ec6269a43ecc Mon Sep 17 00:00:00 2001 From: Defent Date: Sat, 29 Aug 2015 21:58:46 +0200 Subject: [PATCH 1/3] Added --- .../addons/a3_dms/scripts/OnKilled.sqf | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 @ExileServer/addons/a3_dms/scripts/OnKilled.sqf diff --git a/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf b/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf new file mode 100644 index 0000000..c1fce96 --- /dev/null +++ b/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf @@ -0,0 +1,106 @@ +private ["_rockets","_launcher","_type","_mission","_unit","_player"]; + + _unit = _this select 0; + _player = _this select 1; + _type = _this select 2; + _launcher = secondaryWeapon _unit; + + call { + + // then is faster than exitWith + if(_type == "ground") then { + ai_ground_units = (ai_ground_units -1); + }; + + // Not defined yet --> + // if(_type == "air") exitWith { ai_air_units = (ai_air_units -1); }; + // if(_type == "vehicle") exitWith { ai_vehicle_units = (ai_vehicle_units -1); }; + // if(_type == "static") exitWith { ai_emplacement_units = (ai_emplacement_units -1); }; + // <-- Not defined yet + + }; + + + if (isPlayer _player) then { + + + /* < NOT SURE IF THIS WORKS IN EXILE > + + private ["_gainMoney","_gainRep",]; + + if (DMS_MoneyGainOnKill) then { + _gainMoney = _unit getVariable ["ExileMoney", 0]; + call { + if (_unit getVariable ["Bandit", false]) exitWith { + _player setVariable ["ExileMoney",(ExileMoney + DMS_MoneyGainOnKill),true]; + }; + }; + }; + + if (DMS_RepGainOnKill) then { + _gainRep = _player getVariable ["ExileScore", 0]; + call { + if (_unit getVariable ["Bandit", false]) exitWith { + _player setVariable ["ExileScore",(ExileScore + DMS_RepGainOnKill),true]; + }; + }; + }; + + */ + + + if (DMS_clear_AI_body) then { + DMS_CleanUpList pushBack [_unit,diag_tickTime,DMS_CompletedMissionCleanupTime]; + }; + + + if (DMS_ai_share_info) then { + { + if (((position _x) distance (position _unit)) <= DMS_ai_share_info_distance ) then { + _x reveal [_player, 4.0]; + }; + } count allUnits; + }; + + + } else { + + if (DMS_remove_roadkill) then { + + removeBackpack _unit; + removeAllWeapons _unit; + + { + _unit removeMagazine _x + } count magazines _unit; + + } else { + + if ((random 100) <= DMS_remove_roadkill_chance) then { + + removeAllWeapons _unit; + + }; + + }; + + }; + + if(DMS_ai_remove_launchers && _launcher != "") then { + + _rockets = _launcher call DMS_selectMagazine; + _unit removeWeapon _launcher; + + { + if(_x == _rockets) then { + _unit removeMagazine _x; + }; + } count magazines _unit; + + }; + + if(DMS_RemoveNVG) then { + if (_unit hasWeapon "NVGoggles" && floor(random 100) < 20) then { + _unit removeWeapon "NVGoggles"; + }; + }; \ No newline at end of file From df6897de95851f8e1f2962f39db817e8e5b277e1 Mon Sep 17 00:00:00 2001 From: Defent Date: Sat, 29 Aug 2015 22:00:01 +0200 Subject: [PATCH 2/3] Formatting --- @ExileServer/addons/a3_dms/scripts/OnKilled.sqf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf b/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf index c1fce96..39ad48e 100644 --- a/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf +++ b/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf @@ -7,10 +7,8 @@ private ["_rockets","_launcher","_type","_mission","_unit","_player"]; call { - // then is faster than exitWith - if(_type == "ground") then { - ai_ground_units = (ai_ground_units -1); - }; + // then is faster than exitWith + if(_type == "ground") then { ai_ground_units = (ai_ground_units -1);}; // Not defined yet --> // if(_type == "air") exitWith { ai_air_units = (ai_air_units -1); }; @@ -103,4 +101,4 @@ private ["_rockets","_launcher","_type","_mission","_unit","_player"]; if (_unit hasWeapon "NVGoggles" && floor(random 100) < 20) then { _unit removeWeapon "NVGoggles"; }; - }; \ No newline at end of file + }; From 861a8ce20ab14ae42248284ce7bc2c93275871ee Mon Sep 17 00:00:00 2001 From: Defent Date: Sat, 29 Aug 2015 22:01:59 +0200 Subject: [PATCH 3/3] Update OnKilled.sqf --- @ExileServer/addons/a3_dms/scripts/OnKilled.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf b/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf index 39ad48e..f54f561 100644 --- a/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf +++ b/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf @@ -98,7 +98,7 @@ private ["_rockets","_launcher","_type","_mission","_unit","_player"]; }; if(DMS_RemoveNVG) then { - if (_unit hasWeapon "NVGoggles" && floor(random 100) < 20) then { + if (_unit hasWeapon "NVGoggles") then { _unit removeWeapon "NVGoggles"; }; };