Update damage handler

- Added damage and selection to server RPT hit log
- Increased damage a bit for RunOver due to consistently low damage in
testing
This commit is contained in:
ebaydayz
2017-01-28 16:08:56 -05:00
parent c227bb6019
commit c10a7c3bc9
3 changed files with 26 additions and 29 deletions

View File

@@ -163,27 +163,24 @@ if (_unit == player) then {
};
};
//Log to server :-( OverProcessing really not needed.
if (DZE_ServerLogHits && {!local _source} && {_isMan}) then {
//Log to server. Useful for detecting damage and ammo cheats.
if (DZE_ServerLogHits && {!local _source} && {_isMan} && {!_isZombieHit} && {diag_ticktime-(_source getVariable["lastloghit",0]) > 2}) then {
_wpst = weaponState _source;
if (diag_ticktime-(_source getVariable ["lastloghit",0])>2) then {
_source setVariable ["lastloghit",diag_ticktime];
_sourceDist = round(_unit distance _source);
_sourceWeap = switch (true) do {
case (_isZombieHit) : { _ammo };
case (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship") : { format ["in %1",getText(configFile >> "CfgVehicles" >> _sourceVehicleType >> "displayName")] };
case (_wpst select 0 == "Throw") : { format ["with %1 thrown", _wpst select 3] };
case (["Horn", currentWeapon _source] call fnc_inString) : {"with suspicious vehicle "+str((getposATL _source) nearEntities [["Air", "LandVehicle", "Ship"],5])};
case (["Melee", _wpst select 0] call fnc_inString) : { format ["with %2%1",_wpst select 0, if (_sourceDist>6) then {"suspicious weapon "} else {""}] };
case ((_wpst select 0 == "") AND {(_wpst select 4 == 0)}) : { format ["with %1/%2 suspicious", primaryWeapon _source, _ammo] };
case (_wpst select 0 != "") : { format ["with %1/%2 <ammo left:%3>", _wpst select 0, _ammo, _wpst select 4] };
default { "with suspicious weapon" };
};
if (!_isZombieHit) then { // don't log any zombie wounds, even from remote zombies
PVDZ_sec_atp = [_unit, _source, toArray _sourceWeap, _sourceDist]; //Send arbitrary string as array to allow stricter publicVariableVal.txt filter
publicVariableServer "PVDZ_sec_atp";
};
};
_source setVariable ["lastloghit",diag_ticktime];
_sourceDist = round(_unit distance _source);
_sourceWeap = switch (true) do {
case (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship") : { format ["in %1",getText(configFile >> "CfgVehicles" >> _sourceVehicleType >> "displayName")] };
case (_wpst select 0 == "Throw") : { format ["with %1 thrown", _wpst select 3] };
case (["Horn", currentWeapon _source] call fnc_inString) : {"with suspicious vehicle "+str((getposATL _source) nearEntities [["Air", "LandVehicle", "Ship"],5])};
case (["Melee", _wpst select 0] call fnc_inString) : { format ["with %2%1",_wpst select 0, if (_sourceDist>6) then {"suspicious weapon "} else {""}] };
case ((_wpst select 0 == "") AND {(_wpst select 4 == 0)}) : { format ["with %1/%2 suspicious", primaryWeapon _source, _ammo] };
case (_wpst select 0 != "") : { format ["with %1/%2 <ammo left:%3>", _wpst select 0, _ammo, _wpst select 4] };
default { "with suspicious weapon" };
};
//Damage values over 999,999 will kick for PV value restriction (e+). These should not be possible for legitimate players.
PVDZ_sec_atp = [_unit, _source, toArray _sourceWeap, _sourceDist, toArray _hit, str _damage]; //Send arbitrary string as array to allow stricter publicVariableVal.txt filter
publicVariableServer "PVDZ_sec_atp";
};
dayz_lastDamageSource = switch (true) do {
@@ -203,9 +200,6 @@ if (_unit == player) then {
//Ignore none part dmg. Exit after processing humanity hit
if (_hit == "" && _ammo != "Crash") exitWith { 0 };
//Pure base blood damage
_scale = 200;
//Ammo Type Setup
_type = switch true do {
case ((_ammo isKindof "Grenade") or (_ammo isKindof "ShellBase") or (_ammo isKindof "TimeBombCore") or (_ammo isKindof "BombCore") or (_ammo isKindof "MissileCore") or (_ammo isKindof "RocketCore") or (_ammo isKindof "FuelExplosion") or (_ammo isKindof "GrenadeBase")): { 1 };
@@ -228,6 +222,9 @@ if (_damage > 0.1) then {
};
};
//Pure base blood damage
_scale = 200;
if (_damage > 0.4) then {
//Scale damage based on headhits.
if (_isHeadHit) then {
@@ -239,7 +236,7 @@ if (_damage > 0.4) then {
if (!(player == _source) && (_isPlayer or (_isMan && !_isZombieHit))) then { //Scale shots from AI units the same as shots from players
_scale = _scale + 800;
if (_isHeadHit) then {
_scale = _scale + 1180;
_scale = _scale + 1180; //Based on 12k blood for DMR headshot at 500m
};
};
@@ -252,7 +249,7 @@ if (_damage > 0.4) then {
//Zombies
case 3: {_scale = getNumber (configFile >> "CfgVehicles" >> _sourceType >> "damageScale"); if (dayz_DamageMultiplier > 1) then {_scale = _scale * dayz_DamageMultiplier;};};
//RunOver
case 4: {_scale = _scale - 150};
case 4: {_scale = _scale - 50}; //Based on 12k blood for run over with SUV at 70km/h
//Dragged
case 5: {_scale = 25};
//Crash

View File

@@ -7274,7 +7274,7 @@
<Russian>%1 умер от %2</Russian>
</Key>
<Key ID="str_player_death_killed">
<English>%1 was killed by %2 with a %3 from %4m</English>
<English>%1 was killed by %2 with a(n) %3 from %4m</English>
<German>%1 wurde von %2 mit einer %3 von %4m getötet</German>
<Russian>%1 был убит игроком %2 с %3 с расстояния %4м</Russian>
</Key>

View File

@@ -438,10 +438,10 @@ if (dayz_townGenerator) then {execVM "\z\addons\dayz_server\system\lit_fireplace
_unit = _x select 0;
_source = _x select 1;
if (((!(isNil {_source})) && {!(isNull _source)}) && {((_source isKindOf "CAManBase") && {owner _unit != owner _source})}) then {
diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters",
_unit call fa_plr2Str, _source call fa_plr2Str, toString (_x select 2), _x select 3];
diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters in %5 for %6 damage",
_unit call fa_plr2Str, _source call fa_plr2Str, toString (_x select 2), _x select 3, toString (_x select 4), _x select 5];
if (_unit getVariable ["processedDeath",0] == 0) then {
_unit setVariable ["attacker", name _source];
if (alive _source) then {_unit setVariable ["attacker", name _source];};
_unit setVariable ["noatlf4", diag_ticktime]; // server-side "not in combat" test, if player is not already dead
};
};