[1.7.7] Infection reduction / antibiotic increase

Excelsior

Valued Member!
The custom loot spawn can be adjusted to increase the occurrence of antibiotics..

http://www.opendayz.net/threads/100-custom-loot-tables-tutorial.8474/page-14#post-53096

BUT how about we decipher and play with the fn_damageHandler.sqf file to reduce the infection chance to your liking? Partularly the _hitInfection = ((exp _rndInfection) > 1.25) line

Code:
if (_damage > 0.4) then {    //0.25
    //Pain and Infection
    if (_unit == player) then {
        _hitPain = (((_damage * _damage) min 0.75) > _bloodPercentage);
       
        //Infection from zombies
        if (_ammo == "zombie") then {
            _rndInfection = random (_damage - _bloodPercentage);
            _hitInfection = ((exp _rndInfection) > 1.25);
            if (_newtypezed) then {
                _rndInfection = random (_damage - _bloodPercentage);
                _hitInfection = ((exp _rndInfection * 1.25*1.1) > 1.25);
            };
            if (_hitInfection) then {
                r_player_infected = true;
                player setVariable["USEC_infected",true,true];
            };
            //diag_log format["%1  (_damage - _bloodPercentage):%2  _rndInfection:%3  (exp _rndInfection):%4  _hitInfection:%5 ", __FILE__, (_damage - _bloodPercentage), _rndInfection, exp _rndInfection, _hitInfection];
        };
        if (_hitPain) then {
            r_player_inpain = true;
            player setVariable["USEC_inPain",true,true];
        };
        if ((_damage > 1.5) and _isHeadHit) then {
            _id = [_source,"shothead"] spawn player_death;
        };
    };
 

ALKINDA

Valued Member!
Make a compiles.sqf inside your root mission.
put
Code:
    fnc_usec_damageHandler =    compile preprocessFileLineNumbers "fn_damageHandler.sqf";        //Event handler run on damage
then inside Init.sqf
UNDER
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
put another line same as above but this ones inside your root with the one line we just added. this will exec AFTER the normal compiles and overwrite the fn_usec_damagehander.

Code:
call compile preprocessFileLineNumbers "compiles.sqf";                //Custom Compiles addition
 

Excelsior

Valued Member!
This is now a setting in the variables.sqf

dayz_infectionTreshold = 1.25; // used to trigger infection, see fn_damageHandler.sqf

which calls this line in the fn_damageHandler.sqf

_hitInfection = ((exp _rndInfection) > (dayz_infectionTreshold / (_zClose * 0.25)));


Now I just need to figure out the code to check if they are carrying a holy book or not.... :)
if (_ammo == "zombie" AND playerinventory !=ItemBookBible) then {
 
Top