Jump to content
  • 0

Disable/Remove humanity gain/loss on kills!


mark88

Question

I want to re-write the humanity system (with some success already)!

First i overwrite the cliend-side fn_damageHandler.sqf, and removed following part:

            /*
            _canHitFree =     player getVariable ["freeTarget",false];
            _isBandit = (player getVariable["humanity",0]) <= -5000;
            _isPZombie = player isKindOf "PZombie_VB";

            if (!_canHitFree && !_isBandit && !_isPZombie) then {
                //Process Morality Hit
                _myKills = 0 max (1 - (player getVariable ["humanKills",0]) / 5);
                _humanityHit = -100 * _myKills * _damage;

                if (_humanityHit != 0) then {
                    [_source,_humanityHit] spawn {
                        private ["_source","_humanityHit"];
                        _source = _this select 0;
                        _humanityHit = _this select 1;
                        PVDZE_send = [_source,"Humanity",[_source,_humanityHit,30]];
                        publicVariableServer "PVDZE_send";
                    };
                };
            };
            */

I believe this is some epoch "wannabe" random humanity crap (never understood why).

 

Now in server_playerDied.sqf i added following:

    (...)
    if ((owner _victim) == (owner _killer)) then
    {
       (...)
        _message = format["%1 killed himself",_victimName];
        _loc_message = format["PKILL: %1 killed himself", _victimName];
    }
    else
    {
        //custom humanity
        private ["_vichumanity","_killerhumanity"];
        _vichumanity = _victim getVariable ["humanity",0];
        _killerhumanity = _killer getVariable ["humanity",0];
        
        //bandit/hero
        // level1    +/- 5000
        // level2    +/- 10000
        // level3    +/- 20000
        
        // a hero who kills a hero, same loss of humanity at any time
        if((_vichumanity > 4999)) then {
            if(_killerhumanity > 4999) then { // lvl1 hero kille by lvl3 hero
                _killerhumanity = _killerhumanity - 800;
                _killer setVariable ["humanity",_killerhumanity,true];
                
                _vichumanity = _vichumanity - 300;
                _victim setVariable ["humanity",_vichumanity,true];
            };
        };
        //custom humanity
        
        _message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
        _loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
    };
   (...)

Tested with 2 Players, both had exactly 5000 humanity.

Victim was killed by Killer.

 

Victim humanity: 4700 (should be 4700)

Killer humanity: 2987 (should be 4200)

 

 

I dont get it, where else does epoch screw up the humanity?

Anyone got any idea?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

i don't have the answer you seek,

I'm actually looking at changing the humanity gain/loss system also

 

I just used windows grep on a de-pbo'd dayz_code and searched for humanity

 

KMbg9CR.png

 

I suspect local_eventKill may be the one we're looking for. But I can't be certain just yet.  (ninja edit: nope.. thats to do with zombie kills)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...