Add Hero and Bandit humanity vars

This commit is contained in:
AirwavesMan
2020-09-09 17:33:55 +02:00
parent 567b6d5924
commit 431cbc8855
2 changed files with 19 additions and 9 deletions

View File

@@ -44,7 +44,7 @@ if (dayz_onBack != "") then {
}; };
//Get killer information immediately. Weapon, distance or vehicle can change in seconds. //Get killer information immediately. Weapon, distance or vehicle can change in seconds.
_infected = [0, 1] select (r_player_infected && {DZE_PlayerZed}); _infected = [0, 1] select (r_player_infected && DZE_PlayerZed);
_sourceName = "unknown"; _sourceName = "unknown";
_sourceWeapon = ""; _sourceWeapon = "";
_distance = 0; _distance = 0;
@@ -92,6 +92,7 @@ publicVariableServer "PVDZ_plr_Death";
_body setVariable ["deathType", if (_method == "suicide") then {"shot"} else {_method}, true]; _body setVariable ["deathType", if (_method == "suicide") then {"shot"} else {_method}, true];
if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) then { //If corpse is a player zombie do not give killer a human or bandit kill if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) then { //If corpse is a player zombie do not give killer a human or bandit kill
//Values like humanity which were setVariabled onto player before death remain on corpse. //Values like humanity which were setVariabled onto player before death remain on corpse.
_humankill = false; _humankill = false;
_humanityHit = 0; _humanityHit = 0;
@@ -100,8 +101,8 @@ if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) th
_humanitySource = _realSource getVariable ["humanity",0]; _humanitySource = _realSource getVariable ["humanity",0];
call { call {
if (_humanitySource <= -2000) exitwith {//Killer is Bandit if (_humanitySource <= DZE_Bandit) exitwith {//Killer is Bandit
if (_humanityBody <= -2000) exitwith {//Body is Bandit if (_humanityBody <= DZE_Bandit) exitwith {//Body is Bandit
_killsV = _realSource getVariable ["banditKills",0]; _killsV = _realSource getVariable ["banditKills",0];
_realSource setVariable ["banditKills",(_killsV + 1),true]; _realSource setVariable ["banditKills",(_killsV + 1),true];
_humanityHit = -250; _humanityHit = -250;
@@ -111,13 +112,13 @@ if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) th
_realSource setVariable ["humanKills",(_kills + 1),true]; _realSource setVariable ["humanKills",(_kills + 1),true];
_humankill = true; _humankill = true;
if (_humanityBody >= 5000) exitwith {//Body is Hero if (_humanityBody >= DZE_Hero) exitwith {//Body is Hero
_humanityHit = -1000; _humanityHit = -1000;
}; };
_humanityHit = -500; //Body is Survivor _humanityHit = -500; //Body is Survivor
}; };
if (_humanitySource >= 5000) exitwith {//Killer is Hero if (_humanitySource >= DZE_Hero) exitwith {//Killer is Hero
if (_humanityBody <= -2000) exitwith {//Body is Bandit if (_humanityBody <= DZE_Bandit) exitwith {//Body is Bandit
_killsV = _realSource getVariable ["banditKills",0]; _killsV = _realSource getVariable ["banditKills",0];
_realSource setVariable ["banditKills",(_killsV + 1),true]; _realSource setVariable ["banditKills",(_killsV + 1),true];
_humanityHit = 1000; _humanityHit = 1000;
@@ -127,14 +128,14 @@ if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) th
_realSource setVariable ["humanKills",(_kills + 1),true]; _realSource setVariable ["humanKills",(_kills + 1),true];
_humankill = true; _humankill = true;
if (_humanityBody >= 5000) exitwith {//Body is Hero if (_humanityBody >= DZE_Hero) exitwith {//Body is Hero
_humanityHit = -1000; _humanityHit = -1000;
}; };
_humanityHit = -500; //Body is Survivor _humanityHit = -500; //Body is Survivor
}; };
//Killer is Survivor //Killer is Survivor
if (_humanityBody <= -2000) exitwith {//Body is Bandit if (_humanityBody <= DZE_Bandit) exitwith {//Body is Bandit
_killsV = _realSource getVariable ["banditKills",0]; _killsV = _realSource getVariable ["banditKills",0];
_realSource setVariable ["banditKills",(_killsV + 1),true]; _realSource setVariable ["banditKills",(_killsV + 1),true];
_humanityHit = 500; _humanityHit = 500;
@@ -144,7 +145,7 @@ if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) th
_realSource setVariable ["humanKills",(_kills + 1),true]; _realSource setVariable ["humanKills",(_kills + 1),true];
_humankill = true; _humankill = true;
if (_humanityBody >= 5000) exitwith {//Body is Hero if (_humanityBody >= DZE_Hero) exitwith {//Body is Hero
_humanityHit = -500; _humanityHit = -500;
}; };
_humanityHit = -250; //Body is Survivor _humanityHit = -250; //Body is Survivor
@@ -155,6 +156,11 @@ if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) th
//Setup for study bodys. //Setup for study bodys.
_body setVariable ["KillingBlow",[_realSource,_humankill],true]; _body setVariable ["KillingBlow",[_realSource,_humankill],true];
call {
if (_humanityBody >= DZE_Hero) exitwith {_body addMagazine "ItemDogTagHero";};
if (_humanityBody <= DZE_Bandit) exitwith {_body addMagazine "ItemDogTagBandit";};
};
}; };
disableSerialization; disableSerialization;

View File

@@ -137,6 +137,10 @@ if (!isDedicated) then {
dayz_markSelf = 0; // Players can see their own position on the map 0=never, 1=always, 2=With GPS only dayz_markSelf = 0; // Players can see their own position on the map 0=never, 1=always, 2=With GPS only
dayz_markBody = 0; // Players can see their corpse position on the map 0=never, 1=always, 2=With GPS only dayz_markBody = 0; // Players can see their corpse position on the map 0=never, 1=always, 2=With GPS only
dayz_requireRadio = false; // Require players to have a radio on their toolbelt to create a group, be in a group and receive invites. dayz_requireRadio = false; // Require players to have a radio on their toolbelt to create a group, be in a group and receive invites.
//Humanity System
DZE_Hero = 5000; // Defines the value at how much humanity the player is classed as a hero.
DZE_Bandit = -5000; // Defines the value at how much humanity the player is classed as a bandit.
}; };
// Both // Both