mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 04:23:13 +03:00
1.7.5.D1216
This commit is contained in:
@@ -1,37 +1,41 @@
|
||||
private["_serial","_positions","_min","_lootGroup","_iArray","_iItem","_iClass","_iPos","_item","_mags","_qty","_max","_tQty","_canType","_obj","_type","_nearBy","_clean","_unitTypes","_max","_isNoone","_config","_num","_originalPos","_zombieChance","_rnd","_fastRun"];
|
||||
_obj = _this select 0;
|
||||
private["_obj","_type","_config","_canLoot","_originalPos","_unitTypes","_min","_max","_num","_clean","_positions","_zombieChance","_rnd","_iPos","_nearBy","_nearByPlayer"];_obj = _this select 0;
|
||||
_type = typeOf _obj;
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
_canLoot = isClass (_config);
|
||||
_originalPos = getPosATL _obj;
|
||||
|
||||
if (_canLoot) then {
|
||||
//Get zombie class
|
||||
_unitTypes = getArray (_config >> "zombieClass");
|
||||
_min = getNumber (_config >> "minRoaming");
|
||||
_max = getNumber (_config >> "maxRoaming");
|
||||
_min = getNumber (_config >> "maxRoaming");
|
||||
_max = getNumber (_config >> "minRoaming");
|
||||
//Walking Zombies
|
||||
_num = round(random _max) max _min; // + round(_max / 3);
|
||||
diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
|
||||
|
||||
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
|
||||
for "_i" from 1 to _num do
|
||||
{
|
||||
[_originalPos,true,_unitTypes] call zombie_generate;
|
||||
[_originalPos,_unitTypes] call zombie_generate;
|
||||
};
|
||||
|
||||
//Add Internal Zombies
|
||||
_clean = count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0;
|
||||
if (_clean) then {
|
||||
_positions = getArray (_config >> "lootPos");
|
||||
_zombieChance = getNumber (_config >> "zombieChance");
|
||||
diag_log format["Building: %1 / Positions: %2 / Chance: %3",_type,_positions,_zombieChance];
|
||||
//diag_log format["Building: %1 / Positions: %2 / Chance: %3",_type,_positions,_zombieChance];
|
||||
{
|
||||
_rnd = random 1;
|
||||
if (_rnd < _zombieChance) then {
|
||||
_iPos = _obj modelToWorld _x;
|
||||
//_iPos = [_iPos,0,20,20,0,0,0] call BIS_fnc_findSafePos;
|
||||
//_iPos = position (_obj);
|
||||
_nearBy = count nearestObjects [_iPos, ["zZombie_Base"],1] > 0;
|
||||
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
|
||||
//diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer));
|
||||
|
||||
if (!_nearByPlayer and !_nearBy) then {
|
||||
[_iPos,false,_unitTypes] call zombie_generate;
|
||||
[_iPos,_unitTypes] call zombie_generate;
|
||||
};
|
||||
};
|
||||
} forEach _positions;
|
||||
|
||||
@@ -46,16 +46,6 @@ if (_isPlayer) then {
|
||||
if (_unit == player) then {
|
||||
if (_hit == "") then {
|
||||
if ((_source != player) and _isPlayer) then {
|
||||
//Dog defends player if within 50meters
|
||||
_listTalk = _pos nearEntities [["DZ_Fin, DZ_Pastor"], 100];
|
||||
{
|
||||
if (_x getVariable ["characterID", "0"] == dayz_characterID) then {
|
||||
_targets = _x getVariable ["targets",[]];
|
||||
_targets set [count _targets, _source];
|
||||
_x setVariable ["targets", _targets, true];
|
||||
};
|
||||
}foreach _listTalk;
|
||||
|
||||
//Enable aggressor Actions
|
||||
if (_source isKindOf "CAManBase") then {
|
||||
_source setVariable["startcombattimer",1];
|
||||
|
||||
@@ -19,7 +19,7 @@ Missing:
|
||||
*/
|
||||
|
||||
|
||||
private["_looptime","_vehicle_factor","_moving_factor","_fire_factor","_rain_factor","_night_factor","_wind_factor","_building_factor","_sun_factor","_water_factor","_difference","_hasfireffect","_isinbuilding","_isinvehicle","_raining","_sunrise","_vel","_speed","_fireplaces","_building","_daytime","_height_mod","_temp"];
|
||||
private ["_looptime","_sun_factor","_building_factor","_vehicle_factor","_fire_factor","_water_factor","_rain_factor","_night_factor","_wind_factor","_height_mod","_difference","_hasfireffect","_isinbuilding","_isinvehicle","_raining","_sunrise","_building"];
|
||||
|
||||
_looptime = _this;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ _num = switch (_type) do {
|
||||
case "dog_qq": {2};
|
||||
};
|
||||
|
||||
if (_type in ["shout","hit","attack","scream","breath"]) then {
|
||||
if (_type in ["shout","hit","attack","scream","breath","spotted"]) then {
|
||||
_dis = 100;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private["_unit","_distance","_doRun","_pos","_listTalk","_zombie","_targets","_dog"];
|
||||
private["_unit","_distance","_i","_listTalk","_zombie","_targets","_pos"];
|
||||
//Alert Zed's to noise of shot
|
||||
_unit = _this select 0;
|
||||
_distance = _this select 1;
|
||||
|
||||
@@ -30,7 +30,6 @@ if (count _list < dayz_maxAnimals) then {
|
||||
|
||||
_root = configFile >> "CfgVehicles" >> _type;
|
||||
_favouritezones = getText ( _root >> "favouritezones");
|
||||
|
||||
//_randrefpoint = [position player, 10, dayz_animalDistance, 1, 0, 50, 0] call BIS_fnc_findSafePos;
|
||||
_randrefpoint = getposATL player;
|
||||
_PosList = selectbestplaces [_randrefpoint,dayz_animalDistance,_favouritezones,10,5];
|
||||
@@ -45,21 +44,4 @@ if (count _list < dayz_maxAnimals) then {
|
||||
_id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
|
||||
};
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
//Comment out above code and use code below for testing
|
||||
/*
|
||||
private["_type","_pos","_agent","_id"];
|
||||
_near = (position player) nearEntities ["DZ_Pastor",500];
|
||||
|
||||
if (count _near == 0) then {
|
||||
_type = "DZ_Pastor";
|
||||
_pos = player modelToWorld [0,(count _near) + 1,0];
|
||||
_agent = createAgent [_type, _pos, [], 0, "NONE"];
|
||||
player reveal _agent;
|
||||
_agent setpos _pos;
|
||||
//_id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
|
||||
_id = 1;
|
||||
_agent setVariable ["fsm_handle", _id];
|
||||
};
|
||||
*/
|
||||
};
|
||||
18
dayz_code/compile/player_combatCheck.sqf
Normal file
18
dayz_code/compile/player_combatCheck.sqf
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
Initial Idea by Daimyo
|
||||
|
||||
System test to see how this would handle in the game. Other systems will be brought in to play along side this if full permission is givin.
|
||||
For now this is just a test system based on the idea.
|
||||
*/
|
||||
|
||||
private["_dialog","_dangerNear","_inCombat","_inVehicle"];
|
||||
|
||||
_inCombat = player getVariable["startcombattimer",0];
|
||||
_inVehicle = (vehicle player != player);
|
||||
_dangerNear = (getPosATL player) nearEntities [["zZombie_Base","CAManBase"],30];
|
||||
|
||||
if (_inVehicle && (speed player != 0)) exitwith {};
|
||||
|
||||
if (count _dangerNear > 1) then {
|
||||
player setVariable["startcombattimer", 1, true];
|
||||
};
|
||||
@@ -126,6 +126,9 @@ terminate dayz_animalCheck;
|
||||
terminate dayz_monitor1;
|
||||
terminate dayz_medicalH;
|
||||
terminate dayz_gui;
|
||||
terminate dayz_zedCheck;
|
||||
terminate dayz_locationCheck;
|
||||
terminate dayz_combatCheck;
|
||||
|
||||
//Reset (just in case)
|
||||
//deleteVehicle dayz_playerTrigger;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private["_unit","_weapon","_ammo","_projectile","_audible","_caliber","_distance","_i","_listTalk","_group","_targets","_id"];
|
||||
private["_unit","_ammo","_audible","_distance","_listTalk","_weapon"];
|
||||
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
private["_objects","_dialog","_magazineArray","_control","_i","_item","_val","_max"];
|
||||
_objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage","VaultStorage"], 10];
|
||||
private ["_objects"];
|
||||
_objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage"], 10];
|
||||
{
|
||||
dayzUpdateVehicle = [_x,"all"];
|
||||
dayzUpdateVehicle = [_x,"gear"];
|
||||
publicVariableServer "dayzUpdateVehicle";
|
||||
} foreach _objects;
|
||||
|
||||
private["_dialog","_magazineArray","_control","_item","_val","_max"];
|
||||
|
||||
disableSerialization;
|
||||
_dialog = _this select 0;
|
||||
_magazineArray = [];
|
||||
|
||||
@@ -15,7 +15,7 @@ dayz_inVehicle = _inVehicle;
|
||||
//if (((time - dayz_spawnWait) < dayz_spawnDelay) or ((time - dayz_lootWait) < dayz_lootDelay)) exitWith {diag_log("Skipping Check since neither loot or zombies are ready");};
|
||||
//if (((time - dayz_spawnWait) < dayz_spawnDelay) and ((time - dayz_lootWait) < dayz_lootDelay)) exitWith {};
|
||||
|
||||
diag_log("SPAWN CHECKING: Starting");
|
||||
//diag_log("SPAWN CHECKING: Starting");
|
||||
_radius = 300;
|
||||
_locationstypes = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
|
||||
_nearestCity = nearestLocations [getPos player, _locationstypes, _radius];
|
||||
@@ -29,40 +29,41 @@ if ((count _nearestCity) > 0) then {
|
||||
};
|
||||
|
||||
_nearbytype = type (_nearestCity select 0);
|
||||
_nearby = _position nearObjects ["Building",_radius];
|
||||
|
||||
switch (_nearbytype) do {
|
||||
default {
|
||||
_maxZombies = 20;
|
||||
case "Hill": {
|
||||
_radius = 50;
|
||||
_maxZombies = 30;
|
||||
};
|
||||
case "NameLocal": {
|
||||
_radius = 100;
|
||||
_maxZombies = 40;
|
||||
};
|
||||
case "NameVillage": {
|
||||
_radius = 150;
|
||||
_maxZombies = 60;
|
||||
};
|
||||
case "NameCity": {
|
||||
_radius = 200;
|
||||
_maxZombies = 80;
|
||||
};
|
||||
case "NameCityCapital": {
|
||||
_radius = 300;
|
||||
_maxZombies = 100;
|
||||
};
|
||||
default {
|
||||
_radius = 100;
|
||||
_maxZombies = 40;
|
||||
};
|
||||
};
|
||||
|
||||
//diag_log ("nearbytype: " +str(_nearbytype));
|
||||
_nearby = _position nearObjects ["Building",_radius];
|
||||
|
||||
if (_inVehicle) then {
|
||||
_maxZombies = _maxZombies / 2;
|
||||
};
|
||||
|
||||
_age = 0;
|
||||
_tooManyZs = count (_position nearEntities ["zZombie_Base",200]) > _maxZombies;
|
||||
//diag_log("Too Many Zeds: " +str(_tooManyZs));
|
||||
//diag_log(format["SPAWN CHECK: Building count is %1", count _nearby]);
|
||||
_count = ({alive _x} count allMissionObjects "zZombie_Base");
|
||||
//hint "Total Zeds: " +str(_count));
|
||||
//hint format["Total Zeds %1",_count];
|
||||
diag_log ("Total Zeds: " +str(_count));
|
||||
_tooManyZs = count (_position nearEntities ["zZombie_Base",_radius * 2]) > _maxZombies;
|
||||
{
|
||||
//diag_log("SPAWN CHECK: Start of Loop");
|
||||
_type = typeOf _x;
|
||||
@@ -88,6 +89,7 @@ if (_inVehicle) then {
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
if (_canZombie) then {
|
||||
if (dayz_spawnZombies < _maxZombies) then {
|
||||
if (!_tooManyZs) then {
|
||||
@@ -107,9 +109,6 @@ if (_inVehicle) then {
|
||||
};
|
||||
};
|
||||
};
|
||||
//} else {
|
||||
//dayz_spawnWait = time;
|
||||
//dayz_spawnZombies = 0;
|
||||
};
|
||||
};
|
||||
} forEach _nearby;
|
||||
@@ -1,3 +1,4 @@
|
||||
private["_isAir","_inVehicle","_dateNow","_age","_radius","_locationstypes","_nearestCity","_position","_nearby","_type","_config","_canZombie","_canLoot","_dis","_keepAwayDist","_isNoone","_looted","_cleared"];
|
||||
_isAir = vehicle player iskindof "Air";
|
||||
_inVehicle = (vehicle player != player);
|
||||
_dateNow = (DateToNumber date);
|
||||
|
||||
93
dayz_code/compile/player_spawnzedCheck.sqf
Normal file
93
dayz_code/compile/player_spawnzedCheck.sqf
Normal file
@@ -0,0 +1,93 @@
|
||||
private["_isAir","_inVehicle","_dateNow","_maxZombies","_spawnDelay","_age","_radius","_locationstypes","_nearestCity","_position","_nearbytype","_tooManyZs","_nearbyplayer","_type","_config","_canZombie","_dis","_zombied","_bPos","_zombiesNum","_withinRange"];
|
||||
|
||||
_isAir = vehicle player iskindof "Air";
|
||||
_inVehicle = (vehicle player != player);
|
||||
_dateNow = (DateToNumber date);
|
||||
_maxZombies = dayz_maxLocalZombies;
|
||||
_age = -1;
|
||||
|
||||
// If they just got out of a vehicle, boost their per-player zombie limit by 5 in hopes of allowing insta-spawn zombies
|
||||
if (dayz_inVehicle and !_inVehicle) then {
|
||||
dayz_spawnWait = -300;
|
||||
//_maxZombies = _maxZombies + 2;
|
||||
};
|
||||
dayz_inVehicle = _inVehicle;
|
||||
|
||||
|
||||
//diag_log("SPAWN CHECKING: Starting");
|
||||
_radius = 300;
|
||||
_locationstypes = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
|
||||
_nearestCity = nearestLocations [getPos player, _locationstypes, _radius];
|
||||
|
||||
_position = getPosATL player;
|
||||
if ((count _nearestCity) > 0) then {
|
||||
_position = position (_nearestCity select 0);
|
||||
};
|
||||
|
||||
|
||||
_nearbytype = type (_nearestCity select 0);
|
||||
|
||||
switch (_nearbytype) do {
|
||||
case "NameLocal": {
|
||||
_radius = 200;
|
||||
_maxZombies = 30;
|
||||
};
|
||||
case "NameVillage": {
|
||||
_radius = 250;
|
||||
_maxZombies = 40;
|
||||
};
|
||||
case "NameCity": {
|
||||
_radius = 300;
|
||||
_maxZombies = 45;
|
||||
};
|
||||
case "NameCityCapital": {
|
||||
_radius = 400;
|
||||
_maxZombies = 50;
|
||||
};
|
||||
default {
|
||||
_radius = 180;
|
||||
_maxZombies = 20;
|
||||
};
|
||||
};
|
||||
if (_inVehicle) then {
|
||||
_maxZombies = _maxZombies / 2;
|
||||
};
|
||||
|
||||
_tooManyZs = count (_position nearEntities ["zZombie_Base",_radius]) > _maxZombies;
|
||||
_nearby = nearestObjects [player, ["Building"], _radius];
|
||||
//_nearby = _position nearObjects ["building",_radius];
|
||||
{
|
||||
_type = typeOf _x;
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
_canZombie = isClass (_config);
|
||||
_dis = _x distance player;
|
||||
|
||||
if (_canZombie) then {
|
||||
//if ((time - dayz_spawnWait) > dayz_spawnDelay) then {
|
||||
if (dayz_spawnZombies < _maxZombies) then {
|
||||
if (!_tooManyZs) then {
|
||||
private["_zombied"];
|
||||
_zombied = (_x getVariable ["zombieSpawn",-0.1]);
|
||||
_dateNow = (DateToNumber date);
|
||||
_age = (_dateNow - _zombied) * 525948;
|
||||
//diag_log(format["Date: %1 | ZombieSpawn: %2 | age: %3 | building: %4 (%5)", _dateNow, _zombied, _age, str(_x), _dis]);
|
||||
if (_age > 1) then {
|
||||
_bPos = getPosATL _x;
|
||||
_zombiesNum = count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]);
|
||||
_withinRange = _x distance player < _radius;
|
||||
//diag_log ("ZombiesNum: " +str(_zombiesNum));
|
||||
if ((_zombiesNum == 0) and _withinRange) then {
|
||||
//if (_zombiesNum == 0) then {
|
||||
//Randomize Zombies
|
||||
_x setVariable ["zombieSpawn",_dateNow,true];
|
||||
[_x] call building_spawnZombies;
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
dayz_spawnWait = time;
|
||||
dayz_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius]);
|
||||
};
|
||||
};
|
||||
} forEach _nearby;
|
||||
_running = 0
|
||||
@@ -1,4 +1,4 @@
|
||||
private["_foodVal","_thirstVal","_tempVal","_combatVal","_array","_display","_ctrlBlood","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_ctrlTemp","_ctrlEar","_ctrlEye","_ctrlHumanity","_ctrlCombat","_ctrlFracture","_bloodLvl","_thirstLvl","_foodLvl","_blood","_thirst","_food","_temp","_tempImg","_tempLvl","_ca","_visualtext","_visual","_audibletext","_audible","_humanity","_guiHumanity","_humanityText"];
|
||||
private["_display","_ctrlBlood","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye"/*,"_ctrlHumanity"*/,"_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible"];
|
||||
disableSerialization;
|
||||
|
||||
_foodVal = 1 - (dayz_hunger / SleepFood);
|
||||
@@ -62,7 +62,10 @@ if (_bloodLvl <= 0) then {
|
||||
_blood = "\z\addons\dayz_code\gui\status_blood_inside_" + str(_bloodLvl) + "_ca.paa";
|
||||
};
|
||||
|
||||
if (_thirstLvl < 0) then { _thirstLvl = 0 };
|
||||
_thirst = "\z\addons\dayz_code\gui\status_thirst_inside_" + str(_thirstLvl) + "_ca.paa";
|
||||
|
||||
if (_foodLvl < 0) then { _foodLvl = 0 };
|
||||
_food = "\z\addons\dayz_code\gui\status_food_inside_" + str(_foodLvl) + "_ca.paa";
|
||||
|
||||
if ( _tempLvl >= 36 ) then { _tempImg = 4 };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
||||
private["_unit","_firer","_distance","_weapon","_ammo","_killerID","_handled","_arc","_isBallistic","_dmgDistance","_isRocket","_isPlayer","_inVehicle","_evType","_recordable","_turretDir","_weaponDir","_pos1","_pos2","_facing","_firingArc","_isInFront","_isInRear","_id"];
|
||||
private["_unit","_magazine","_used","_quantity","_magsNet","_magsWhole","_key","_result","_evType","_recordable","_inVehicle","_isPlayer","_isRocket","_dmgDistance","_isBallistic","_handled"];
|
||||
//Init
|
||||
//[unit, firer, distance, weapon, muzzle, mode, ammo]
|
||||
_unit = _this select 0;
|
||||
|
||||
@@ -1,32 +1,21 @@
|
||||
private["_isZombie","_unit","_vehicle","_targets","_move","_rnd","_wound","_type","_dir","_hpList","_hp","_damage","_chance","_strH","_dam","_total","_result","_tPos","_zPos","_inAngle","_cantSee","_isZombieInside","_building","_isPlayerInside"];
|
||||
_unit = _this;
|
||||
private["_unit","_targets","_move","_damage","_wound","_index","_cnt","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_result","_vehicle","_tPos","_zPos","_cantSee","_inAngle"];
|
||||
_unit = _this select 0;
|
||||
_type = _this select 1;
|
||||
_vehicle = (vehicle player);
|
||||
|
||||
_isZombie = _unit isKindOf "zZombie_base";
|
||||
if(_isZombie) then {
|
||||
_type = "zombie";
|
||||
} else {
|
||||
_type = "dog";
|
||||
};
|
||||
|
||||
_targets = _unit getVariable ["targets",[]];
|
||||
//if (!(_vehicle in _targets)) exitWith {};
|
||||
|
||||
//Do the attack
|
||||
_move = "ZombieStandingAttack1";
|
||||
_rnd = 0;
|
||||
_wound = "";
|
||||
if (r_player_unconscious && _vehicle == player) then {
|
||||
_unit doMove (getPos player);
|
||||
if (r_player_unconscious && _vehicle == player && _type == "zombie") then {
|
||||
_rnd = round(random 4) + 1;
|
||||
_move = "ZombieFeed" + str(_rnd);
|
||||
} else {
|
||||
_unit doMove (getPos player);
|
||||
if (_type == "dog") then {
|
||||
_move = "Dog_Attack";
|
||||
} else {
|
||||
if (_type == "zombie") then {
|
||||
_rnd = round(random 9) + 1;
|
||||
_move = "ZombieStandingAttack" + str(_rnd);
|
||||
} else {
|
||||
_move = "Dog_Attack";
|
||||
};
|
||||
};
|
||||
_dir = [_unit,player] call BIS_Fnc_dirTo;
|
||||
@@ -59,9 +48,15 @@ if (_vehicle != player) then {
|
||||
if ((_vehicle isKindOf "ATV_Base_EP1") or (_vehicle isKindOf "Motorcycle")) then { player action ["eject", _vehicle] };
|
||||
};
|
||||
if (r_player_blood < (r_player_bloodTotal * 0.8)) then {
|
||||
_wound = DAYZ_woundHit call BIS_fnc_selectRandomWeighted;
|
||||
} else {
|
||||
_wound = DAYZ_woundHit_ok call BIS_fnc_selectRandomWeighted;
|
||||
_cnt = count (DAYZ_woundHit select 1);
|
||||
_index = floor (random _cnt);
|
||||
_index = (DAYZ_woundHit select 1) select _index;
|
||||
_wound = (DAYZ_woundHit select 0) select _index;
|
||||
} else {
|
||||
_cnt = count (DAYZ_woundHit_ok select 1);
|
||||
_index = floor (random _cnt);
|
||||
_index = (DAYZ_woundHit_ok select 1) select _index;
|
||||
_wound = (DAYZ_woundHit_ok select 0) select _index;
|
||||
};
|
||||
_damage = 0.1 + random (1.2);
|
||||
//diag_log ("START DAM: Player Hit on " + _wound + " for " + str(_damage));
|
||||
@@ -88,13 +83,22 @@ if (_vehicle != player) then {
|
||||
_cantSee = [_unit,_vehicle] call dayz_losCheck;
|
||||
if (!_cantSee) then {
|
||||
if (_type == "dog") then {
|
||||
_wound = DAYZ_woundHit_dog call BIS_fnc_selectRandomWeighted;
|
||||
_cnt = count (DAYZ_woundHit_dog select 1);
|
||||
_index = floor (random _cnt);
|
||||
_index = (DAYZ_woundHit_dog select 1) select _index;
|
||||
_wound = (DAYZ_woundHit_dog select 0) select _index;
|
||||
_damage = 0.3 + random (1.0);
|
||||
} else {
|
||||
if (r_player_blood < (r_player_bloodTotal * 0.8)) then {
|
||||
_wound = DAYZ_woundHit call BIS_fnc_selectRandomWeighted;
|
||||
_cnt = count (DAYZ_woundHit select 1);
|
||||
_index = floor (random _cnt);
|
||||
_index = (DAYZ_woundHit select 1) select _index;
|
||||
_wound = (DAYZ_woundHit select 0) select _index;
|
||||
} else {
|
||||
_wound = DAYZ_woundHit_ok call BIS_fnc_selectRandomWeighted;
|
||||
_cnt = count (DAYZ_woundHit_ok select 1);
|
||||
_index = floor (random _cnt);
|
||||
_index = (DAYZ_woundHit_ok select 1) select _index;
|
||||
_wound = (DAYZ_woundHit_ok select 0) select _index;
|
||||
};
|
||||
_damage = 0.1 + random (1.2);
|
||||
};
|
||||
@@ -103,7 +107,7 @@ if (_vehicle != player) then {
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "dayzHit";
|
||||
if (_type == "dog") then { [_unit,"dog_growl",0,false] call dayz_zombieSpeak; } else { [_unit,"hit",0,false] call dayz_zombieSpeak; };
|
||||
[_unit,"hit",0,false] call dayz_zombieSpeak;
|
||||
} else {
|
||||
/*
|
||||
_isZombieInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
private["_listTalk","_isZombie","_group","_eyeDir","_attacked","_chance","_last","_audial","_distance","_refObj","_list","_scaleMvmt","_scalePose","_scaleLight","_anim","_activators","_nearFire","_nearFlare","_scaleAlert","_inAngle","_scaler","_initial","_tPos","_zPos","_cantSee"];
|
||||
private["_listTalk","_isZombie","_group","_eyeDir","_attacked","_continue","_type","_chance","_last","_audial","_distance","_refObj","_list","_scaleMvmt","_scalePose","_scaleLight","_anim","_activators","_nearFire","_nearFlare","_scaleAlert","_inAngle","_scaler","_initial","_tPos","_zPos","_cantSee"];
|
||||
_refObj = vehicle player;
|
||||
//_listTalk = (position _refObj) nearEntities ["zZombie_Base",200];
|
||||
_listTalk = (position _refObj) nearEntities ["zZombie_Base",100];
|
||||
_listTalk = (position _refObj) nearEntities [["zZombie_Base","DZ_Pastor"],80];
|
||||
_pHeight = (getPosATL _refObj) select 2;
|
||||
_attacked = false;
|
||||
_multiplier = 1;
|
||||
|
||||
//_list = list dayz_playerTrigger;
|
||||
{
|
||||
_continue = true;
|
||||
|
||||
@@ -23,16 +21,8 @@ _multiplier = 1;
|
||||
private["_dist"];
|
||||
_dist = (_x distance _refObj);
|
||||
_group = _x;
|
||||
/*
|
||||
_group = group _x;
|
||||
_chance = (count units _group);
|
||||
if (isNull group _x) then {
|
||||
_group = _x;
|
||||
|
||||
_chance = 1;
|
||||
};
|
||||
*/
|
||||
_chance = 1;
|
||||
//if ((_x in _list) and !(animationState _x == "ZombieFeed")) then {
|
||||
if ((_x distance player < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then {
|
||||
if (_type == "zombie") then { [_x,"attack",(_chance),true] call dayz_zombieSpeak; };
|
||||
//perform an attack
|
||||
@@ -40,11 +30,8 @@ _multiplier = 1;
|
||||
_entHeight = (getPosATL _x) select 2;
|
||||
_delta = _pHeight - _entHeight;
|
||||
if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then {
|
||||
//_isZInside = [_x,_building] call fnc_isInsideBuilding;
|
||||
//if ((_isPlayerInside and _isZInside) or (!_isPlayerInside and !_isZInside)) then {
|
||||
_x spawn player_zombieAttack;
|
||||
[_x, _type] spawn player_zombieAttack;
|
||||
_x setVariable["lastAttack",time];
|
||||
//};
|
||||
};
|
||||
_attacked = true;
|
||||
} else {
|
||||
@@ -59,12 +46,12 @@ _multiplier = 1;
|
||||
//Noise Activation
|
||||
_targets = _group getVariable ["targets",[]];
|
||||
if (!(_refObj in _targets)) then {
|
||||
if (_dist < DAYZ_disAudial) then {
|
||||
if (DAYZ_disAudial > 80) then {
|
||||
if (_dist < (DAYZ_disAudial * _multiplier)) then {
|
||||
if ((DAYZ_disAudial * _multiplier) > 80) then {
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
} else {
|
||||
_chance = [_x,_dist,DAYZ_disAudial] call dayz_losChance;
|
||||
_chance = [_x,_dist,(DAYZ_disAudial * _multiplier)] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
|
||||
if ((random 1) < _chance) then {
|
||||
_cantSee = [_x,_refObj] call dayz_losCheck;
|
||||
@@ -72,7 +59,7 @@ _multiplier = 1;
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
} else {
|
||||
if (_dist < (DAYZ_disAudial / 2)) then {
|
||||
if (_dist < ((DAYZ_disAudial * _multiplier) / 2)) then {
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
};
|
||||
@@ -84,8 +71,8 @@ _multiplier = 1;
|
||||
//Sight Activation
|
||||
_targets = _group getVariable ["targets",[]];
|
||||
if (!(_refObj in _targets)) then {
|
||||
if (_dist < DAYZ_disVisual) then {
|
||||
_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
|
||||
if (_dist < (DAYZ_disVisual * _multiplier)) then {
|
||||
_chance = [_x,_dist,(DAYZ_disVisual * _multiplier)] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
|
||||
if ((random 1) < _chance) then {
|
||||
//diag_log ("Chance Detection");
|
||||
@@ -93,7 +80,7 @@ _multiplier = 1;
|
||||
_zPos = (getPosASL _x);
|
||||
//_eyeDir = _x call dayz_eyeDir;
|
||||
_eyeDir = direction _x;
|
||||
_inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
|
||||
_inAngle = [_zPos,_eyeDir,(30 * _multiplier),_tPos] call fnc_inAngleSector;
|
||||
if (_inAngle) then {
|
||||
//diag_log ("In Angle");
|
||||
//LOS check
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private["_group","_target","_lead","_targetMen","_targetDis","_range","_assigned","_targets","_obj","_dis","_fires","_rnd","_man","_manDis","_c"];
|
||||
private["_group","_target","_targetMen","_targetDis","_c","_man","_manDis","_targets","_lead","_leadheight","_nearEnts","_rnd","_assigned"];
|
||||
_group = _this;
|
||||
_target = objNull;
|
||||
_lead = leader _group;
|
||||
|
||||
@@ -7,7 +7,6 @@ _range = 300;
|
||||
_manDis = 0;
|
||||
|
||||
_targets = _agent getVariable ["targets",[]];
|
||||
/*
|
||||
//Search for fires
|
||||
if (count _targets == 0) then {
|
||||
_fires = nearestObjects [_agent,["Land_Fire"],_range];
|
||||
@@ -21,11 +20,11 @@ if (count _targets == 0) then {
|
||||
};
|
||||
} forEach _fires;
|
||||
};
|
||||
*/
|
||||
|
||||
if (isNil "_targets") exitWith {};
|
||||
//Search for objects
|
||||
if (count _targets == 0) then {
|
||||
_objects = nearestObjects [_agent,["ThrownObjects","GrenadeHandTimedWest","SmokeShell"],50];
|
||||
_objects = nearestObjects [_agent,["ThrownObjects","GrenadeHandTimedWest","SmokeShell"],_range/2];
|
||||
{
|
||||
private["_dis"];
|
||||
if (!(_x in _targets)) then {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
private["_position","_doLoiter","_unitTypes","_isNoone","_loot","_array","_agent","_type","_radius","_method","_nearByPlayer","_attempt","_isAlive","_myDest","_newDest","_rnd","_lootType","_id"];
|
||||
private["_position","_doLoiter","_unitTypes","_isNoone","_loot","_array","_agent","_type","_radius","_method","_nearByPlayer","_attempt","_myDest","_newDest","_lootType"];
|
||||
_position = _this select 0;
|
||||
_doLoiter = _this select 1;
|
||||
_unitTypes = _this select 2;
|
||||
_unitTypes = _this select 1;
|
||||
_doLoiter = true;
|
||||
|
||||
_isNoone = {isPlayer _x} count (_position nearEntities ["AllVehicles",30]) == 0;
|
||||
_loot = "";
|
||||
@@ -9,7 +9,7 @@ _array = [];
|
||||
_agent = objNull;
|
||||
|
||||
//Exit if a player is nearby
|
||||
if (!_isNoone) exitWith {};
|
||||
if (!isNoone) exitWith {};
|
||||
|
||||
if (count _unitTypes == 0) then {
|
||||
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
||||
@@ -24,21 +24,26 @@ if (_doLoiter) then {
|
||||
_radius = 40;
|
||||
_method = "NONE";
|
||||
};
|
||||
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
|
||||
//diag_log ("Spawned: " + str([_type, _position, [], _radius, _method]));
|
||||
|
||||
if (_nearByPlayer) then {
|
||||
_position = [_position,25,80,10,0,0,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
_agent = createAgent [_type, _position, [], _radius, _method];
|
||||
|
||||
if (_doLoiter) then {
|
||||
_agent setPosATL _position;
|
||||
//_agent setPosATL _position;
|
||||
//_agent setVariable ["doLoiter",true,true];
|
||||
} else {
|
||||
_agent setVariable ["doLoiter",false,true];
|
||||
_agent setDir round(random 180);
|
||||
};
|
||||
dayz_spawnZombies = dayz_spawnZombies + 1;
|
||||
|
||||
//diag_log ("CREATE INFECTED: " + str(_this));
|
||||
|
||||
_position = getPosATL _agent;
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
|
||||
//_position = getPosATL _agent;
|
||||
//_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
|
||||
|
||||
if (random 1 > 0.7) then {
|
||||
_agent setUnitPos "Middle";
|
||||
@@ -46,28 +51,24 @@ if (random 1 > 0.7) then {
|
||||
|
||||
//diag_log ("CREATED: " + str(_agent));
|
||||
|
||||
/*
|
||||
//_agent setVariable["host",player,true];
|
||||
if (!_doLoiter) then {
|
||||
_agent setPosATL _position;
|
||||
_agent setDir round(random 180);
|
||||
_agent setVariable ["doLoiter",false,true];
|
||||
if (_nearByPlayer) then {
|
||||
deleteVehicle _agent;
|
||||
};
|
||||
} else {
|
||||
if (_nearByPlayer) then {
|
||||
_attempt = 0;
|
||||
while {_nearByPlayer} do {
|
||||
//_position = [_position,0,20,10,0,20,0] call BIS_fnc_findSafePos; Orignal
|
||||
// _position = [_position,0,50,20,0,20,0] call BIS_fnc_findSafePos; OEM v2
|
||||
_position = [_position,30,60,20,0,20,0] call BIS_fnc_findSafePos;
|
||||
_agent setPos _position;
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
|
||||
_position = [_position,40,80,10,0,20,0] call BIS_fnc_findSafePos;
|
||||
_agent switchmove AidlPpneMstpSnonWnonDnon_SleepA_layDown;
|
||||
_attempt = _attempt + 1;
|
||||
if (_attempt > 10) exitWith {};
|
||||
} else {
|
||||
_position = [_position,0,20,10,0,20,0] call BIS_fnc_findSafePos;
|
||||
_agent setPosATL _position;
|
||||
};
|
||||
_agent setPos _position;
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
if (isNull _agent) exitWith {
|
||||
dayz_spawnZombies = dayz_spawnZombies - 1;
|
||||
|
||||
Reference in New Issue
Block a user