mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-08 09:12:52 +03:00
1.7.5.M1D7
This commit is contained in:
@@ -15,9 +15,11 @@ if (_canLoot) then {
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
//Get zombie class
|
||||
_zombieChance = getNumber (_config >> "zombieChance");
|
||||
_rnd = random 1;
|
||||
_rnd = random 0.5;
|
||||
_chance = round(random 20);
|
||||
|
||||
if (_rnd < _zombieChance) then {
|
||||
//if (_rnd < _zombieChance) then {
|
||||
if ((_chance % 2) == 0) then {
|
||||
|
||||
_noPlayerNear = (count ((getPosATL _obj) nearEntities ["CAManBase",30])) == 0;
|
||||
|
||||
@@ -31,14 +33,14 @@ if (_rnd < _zombieChance) then {
|
||||
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
|
||||
for "_i" from 1 to _num do
|
||||
{
|
||||
[_originalPos,_unitTypes] call zombie_generate;
|
||||
[_position,_unitTypes] call zombie_generate;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
/*
|
||||
|
||||
//Add Internal Zombies
|
||||
_clean = count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0;
|
||||
_clean = {alive _x} count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0;
|
||||
if (_clean) then {
|
||||
_positions = getArray (_config >> "lootPos");
|
||||
_zombieChance = getNumber (_config >> "zombieChance");
|
||||
@@ -47,11 +49,10 @@ if (_rnd < _zombieChance) then {
|
||||
_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;
|
||||
|
||||
_nearBy = {alive _x} count nearestObjects [_iPos , ["zZombie_Base"],3] > 0;
|
||||
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
|
||||
//diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer));
|
||||
diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer));
|
||||
|
||||
if (!_nearByPlayer and !_nearBy) then {
|
||||
[_iPos,_unitTypes] call zombie_generate;
|
||||
@@ -60,5 +61,4 @@ if (_rnd < _zombieChance) then {
|
||||
} forEach _positions;
|
||||
};
|
||||
dayz_buildingMonitor set [count dayz_buildingMonitor,_obj];
|
||||
*/
|
||||
};
|
||||
@@ -1,22 +1,28 @@
|
||||
private["_findarray","_stringarray","_findcount","_stringcount","_found","_y","_i","_x"];
|
||||
|
||||
_findarray = toArray (_this select 0);
|
||||
_stringarray = toArray (_this select 1);
|
||||
_findcount = count _findarray;
|
||||
_stringcount = count _stringarray;
|
||||
_found = false;
|
||||
//Kilzone_Kid's megafast inString function
|
||||
//caseinsensitive
|
||||
//params [needle,haystack]
|
||||
private["_needle","_haystack","_found","_haystackArr","_haystackLen","_needleLen","_hayArr"];
|
||||
scopeName "main";
|
||||
|
||||
if (_findcount <= _stringcount) then {
|
||||
for "_y" from 0 to (_stringcount - _findcount) do {
|
||||
_i = 0;
|
||||
{
|
||||
scopeName "loop1";
|
||||
if (_x == (_stringarray select (_y + _i))) then {
|
||||
_i = _i + 1;
|
||||
} else {breakOut "loop1";};
|
||||
} forEach _findarray;
|
||||
if (_i == _findcount) then {_found = true; breakTo "main";};
|
||||
_needle = _this select 0;
|
||||
_haystack = _this select 1;
|
||||
_haystackArr = toArray _haystack;
|
||||
_haystackLen = count _haystackArr;
|
||||
_needleLen = count (toArray _needle);
|
||||
_found = false;
|
||||
if (_needleLen <= _haystackLen) then {
|
||||
_hayArr = [];
|
||||
for "_i" from 0 to (_needleLen - 1) do {
|
||||
_hayArr set [count _hayArr, _haystackArr select _i];
|
||||
};
|
||||
for "_i" from _needleLen to _haystackLen do {
|
||||
if (toString _hayArr != _needle) then {
|
||||
_hayArr set [_needleLen, _haystackArr select _i];
|
||||
_hayArr set [0, "x"];
|
||||
_hayArr = _hayArr - ["x"];
|
||||
} else {
|
||||
_found = true;
|
||||
breakTo "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
_found
|
||||
_found;
|
||||
|
||||
@@ -215,6 +215,16 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
||||
player removeAction s_player_lockvault;
|
||||
s_player_lockvault = -1;
|
||||
};
|
||||
|
||||
//Sleep
|
||||
if(cursorTarget isKindOf "TentStorage" and _canDo and _ownerID == dayz_characterID) then {
|
||||
if ((s_player_sleep < 0) and (player distance cursorTarget < 3)) then {
|
||||
s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",cursorTarget, 0, false, true, "",""];
|
||||
};
|
||||
} else {
|
||||
player removeAction s_player_sleep;
|
||||
s_player_sleep = -1;
|
||||
};
|
||||
|
||||
//Repairing Vehicles
|
||||
if ((dayz_myCursorTarget != cursorTarget) and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then {
|
||||
@@ -576,6 +586,8 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
||||
s_player_forceSave = -1;
|
||||
player removeAction s_player_flipveh;
|
||||
s_player_flipveh = -1;
|
||||
player removeAction s_player_sleep;
|
||||
s_player_sleep = -1;
|
||||
player removeAction s_player_deleteBuild;
|
||||
s_player_deleteBuild = -1;
|
||||
player removeAction s_player_butcher;
|
||||
|
||||
@@ -6,6 +6,9 @@ _worldspace = _this select 2;
|
||||
_class = _this select 3;
|
||||
_id = 0;
|
||||
|
||||
_allowed = [_object, (name player)] call check_publishobject;
|
||||
if (!_allowed) exitWith { };
|
||||
|
||||
diag_log ("PUBLISH: Attempt " + str(_object));
|
||||
_dir = _worldspace select 0;
|
||||
_location = _worldspace select 1;
|
||||
|
||||
@@ -4,7 +4,7 @@ _unit = _this select 0;
|
||||
_distance = _this select 1;
|
||||
_doRun = _this select 2;
|
||||
_pos = _this select 3;
|
||||
_listTalk = _pos nearEntities ["zZombie_Base",_distance];
|
||||
_listTalk = _pos nearEntities ["zZombie_Base",_distance * 3];
|
||||
|
||||
//hint str(_listTalk);
|
||||
|
||||
@@ -19,17 +19,4 @@ _listTalk = _pos nearEntities ["zZombie_Base",_distance];
|
||||
} else {
|
||||
_zombie setVariable ["myDest",_pos,true];
|
||||
};
|
||||
} forEach _listTalk;
|
||||
_listTalk = _pos nearEntities [["DZ_Fin, DZ_Pastor"], _distance * 3];
|
||||
|
||||
{
|
||||
_dog = _x;
|
||||
//Ensure dog is tamed AND is not players own dog
|
||||
if (_doRun && (_dog getVariable ["characterID", 0]) != 0) then {
|
||||
_targets = _dog getVariable ["targets",[]];
|
||||
if (!(_unit in _targets)) then {
|
||||
_targets set [count _targets,_unit];
|
||||
_dog setVariable ["targets",_targets,true];
|
||||
};
|
||||
}
|
||||
} forEach _listTalk;
|
||||
@@ -1,5 +1,6 @@
|
||||
private["_type","_isAir","_inVehicle","_dateNow","_maxZombies","_maxWildZombies","_age","_nearbyBuildings","_radius","_locationstypes","_nearestCity","_position","_nearbytype"];
|
||||
_type = _this select 0;
|
||||
_Keepspawning = _this select 1;
|
||||
_isAir = vehicle player iskindof "Air";
|
||||
_inVehicle = (vehicle player != player);
|
||||
_dateNow = (DateToNumber date);
|
||||
@@ -7,77 +8,57 @@ _maxZombies = dayz_maxLocalZombies;
|
||||
_maxWildZombies = 3;
|
||||
_age = -1;
|
||||
_nearbyBuildings = [];
|
||||
_radius = 200;
|
||||
_maxZombies = 20;
|
||||
|
||||
diag_log ("Type: " +str(_type));
|
||||
|
||||
|
||||
//diag_log("SPAWN CHECKING: Starting");
|
||||
_radius = 300;
|
||||
_locationstypes = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
|
||||
_radius = 200;
|
||||
_locationstypes = ["NameCityCapital","NameCity","NameVillage"];
|
||||
_nearestCity = nearestLocations [getPos player, _locationstypes, _radius];
|
||||
_townname = text (_nearestCity select 0);
|
||||
|
||||
_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;
|
||||
_maxZombies = 30;
|
||||
};
|
||||
case "NameCity": {
|
||||
_radius = 300;
|
||||
_maxZombies = 45;
|
||||
_maxZombies = 40;
|
||||
};
|
||||
case "NameCityCapital": {
|
||||
_radius = 400;
|
||||
_maxZombies = 50;
|
||||
};
|
||||
default {
|
||||
_radius = 200;
|
||||
_maxZombies = 20;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
if ((count _nearestCity) > 0) then {
|
||||
_markerstr = createMarker["markername_" +str (_townname), _position];
|
||||
_markerstr setMarkerText _townname;
|
||||
_markerstr setMarkerColor "ColorGreen";
|
||||
_markerstr setMarkerShape "ELLIPSE";
|
||||
_markerstr setMarkerBrush "Grid";
|
||||
_markerstr setMarkerSize [_radius, _radius];
|
||||
};
|
||||
|
||||
deleteMarker "Player_Marker_Radius";
|
||||
_markerstr = createMarker["Player_Marker_Radius", getPosATL player];
|
||||
_markerstr setMarkerColor "ColorRed";
|
||||
_markerstr setMarkerShape "ELLIPSE";
|
||||
_markerstr setMarkerBrush "Border";
|
||||
_markerstr setMarkerSize [_radius, _radius];
|
||||
*/
|
||||
|
||||
_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius]) < _maxZombies;
|
||||
|
||||
switch (_type) do {
|
||||
case "Zeds": {
|
||||
_spawnZombies = count (getPosATL player nearEntities ["zZombie_Base",_radius]) < _maxZombies;
|
||||
if (_spawnZombies) then {
|
||||
_nearbyBuildings = _position nearObjects ["building",_radius];
|
||||
//_nearbyBuildings = nearestObjects [getPosATL player, dayz_ZombieBuildings, _radius]; //Cant be used Not all zones are covered yet (wrecks, Buildings outside towns)
|
||||
//_nearbyBuildings = nearestObjects [_position, ["building"], _radius];
|
||||
_nearbyBuildings = nearestObjects [_position, dayz_LootBuildings, _radius];
|
||||
_nearbyCount = count _nearbyBuildings;
|
||||
if (_nearbyCount > 0) then {
|
||||
[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies, _nearbyBuildings] call player_spawnzedCheck;
|
||||
};
|
||||
};
|
||||
};
|
||||
case "Wild": {
|
||||
//[_position, _maxZombies] call wild_spawnZombies;
|
||||
};
|
||||
case "Loot": {
|
||||
_nearbyBuildings = _position nearObjects ["building",_radius];
|
||||
//_nearbyBuildings = nearestObjects [_position, dayz_LootBuildings, _radius]; //Cant be used Not all zones are covered yet (wrecks, Buildings outside towns)
|
||||
//_nearbyBuildings = nearestObjects [_position, ["building"], _radius];
|
||||
_nearbyBuildings = nearestObjects [_position, dayz_ZombieBuildings, _radius];
|
||||
_nearbyCount = count _nearbyBuildings;
|
||||
if (_nearbyCount > 0) then {
|
||||
[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings] call player_spawnlootCheck;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -10,7 +10,6 @@ _maxZombies = _this select 7;
|
||||
_nearby = _this select 8;
|
||||
|
||||
diag_log ("Zed Started");
|
||||
_maxWildZombies = 3;
|
||||
|
||||
// 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 {
|
||||
@@ -22,13 +21,12 @@ dayz_inVehicle = _inVehicle;
|
||||
|
||||
if (_inVehicle) then {
|
||||
_maxZombies = _maxZombies / 2;
|
||||
_maxWildZombies = 0;
|
||||
};
|
||||
_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius]) < _maxZombies;
|
||||
// _spawnZombies = count (_position nearEntities ["zZombie_Base",_radius]) < _maxZombies;
|
||||
// _tooManyZs = count (_position nearEntities ["zZombie_Base",_radius]) > _maxZombies;
|
||||
// _tooManyWildZs = count (_position nearEntities ["zZombie_Base",_radius]) > _maxWildZombies;
|
||||
|
||||
{
|
||||
if (dayz_spawnZombies > _maxZombies) exitwith {};
|
||||
// if (dayz_spawnZombies > _maxZombies) exitwith {};
|
||||
_zombied = (_x getVariable ["zombieSpawn",-0.1]);
|
||||
_dateNow = (DateToNumber date);
|
||||
_age = (_dateNow - _zombied) * 525948;
|
||||
@@ -40,22 +38,4 @@ if (_inVehicle) then {
|
||||
[_x] call building_spawnZombies;
|
||||
//};
|
||||
};
|
||||
} forEach _nearby;
|
||||
/*
|
||||
if ((count _nearby) < 1) then {
|
||||
diag_log ("1");
|
||||
_spawnWildZs = count (_position nearEntities ["zZombie_Base",_radius]);
|
||||
if (_spawnWildZs < _maxWildZombies) then {
|
||||
diag_log ("2");
|
||||
if (!_tooManyWildZs) then {
|
||||
diag_log ("3");
|
||||
_zombiesNum = count (_position nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]);
|
||||
//diag_log ("ZombiesNum: " +str(_zombiesNum));
|
||||
if (_zombiesNum == 0) then {
|
||||
diag_log ("4");
|
||||
[_position] call wild_spawnZombies;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
*/
|
||||
} forEach _nearby;
|
||||
@@ -20,7 +20,7 @@ if (r_player_unconscious && _vehicle == player && _type == "zombie") then {
|
||||
};
|
||||
_dir = [_unit,player] call BIS_Fnc_dirTo;
|
||||
_unit setDir _dir;
|
||||
[objNull, _unit, rPlayMove,_move] call RE;
|
||||
_unit playMove _move;
|
||||
|
||||
//Wait
|
||||
sleep 0.3;
|
||||
@@ -29,11 +29,11 @@ if (_vehicle != player) then {
|
||||
_hpList = _vehicle call vehicle_getHitpoints;
|
||||
_hp = _hpList call BIS_fnc_selectRandom;
|
||||
_wound = getText(configFile >> "cfgVehicles" >> (typeOf _vehicle) >> "HitPoints" >> _hp >> "name");
|
||||
_damage = random 0.03;
|
||||
_damage = random 0.08;
|
||||
_chance = round(random 12);
|
||||
|
||||
if ((_wound == "Glass1") or (_wound == "Glass2") or (_wound == "Glass3") or (_wound == "Glass4") or (_wound == "Glass5") or (_wound == "Glass6")) then {
|
||||
[_unit,"hit",0,false] call dayz_zombieSpeak;
|
||||
[_unit,"hit",2,true] call dayz_zombieSpeak;
|
||||
_strH = "hit_" + (_wound);
|
||||
_dam = _vehicle getVariable [_strH,0];
|
||||
_total = (_dam + _damage);
|
||||
@@ -63,7 +63,7 @@ if (_vehicle != player) then {
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "dayzHit";
|
||||
[_unit,"hit",0,false] call dayz_zombieSpeak;
|
||||
[_unit,"hit",2,true] call dayz_zombieSpeak;
|
||||
} else {
|
||||
_result = [_vehicle, _wound,_total, _unit,"zombie"] call fnc_usec_damageVehicle;
|
||||
dayzHitV = [_vehicle,_wound,_total, _unit,"zombie"];
|
||||
@@ -107,7 +107,7 @@ if (_vehicle != player) then {
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "dayzHit";
|
||||
[_unit,"hit",0,false] call dayz_zombieSpeak;
|
||||
[_unit,"hit",2,true] call dayz_zombieSpeak;
|
||||
} else {
|
||||
/*
|
||||
_isZombieInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||
@@ -117,7 +117,7 @@ if (_vehicle != player) then {
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "dayzHit";
|
||||
[_unit,"hit",0,false] call dayz_zombieSpeak;
|
||||
[_unit,"hit",2,true] call dayz_zombieSpeak;
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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","DZ_Pastor"],80];
|
||||
_listTalk = (position _refObj) nearEntities [["zZombie_Base"],80];
|
||||
_pHeight = (getPosATL _refObj) select 2;
|
||||
_attacked = false;
|
||||
_multiplier = 1;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
private["_unit","_selection","_killer"];
|
||||
|
||||
Diag_log ("handlekilled");
|
||||
|
||||
_unit = _this select 0;
|
||||
_killer = _this select 1;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ _target = objNull;
|
||||
_lead = leader _group;
|
||||
_targetMen = [];
|
||||
_targetDis = [];
|
||||
_range = 300;
|
||||
_range = 500;
|
||||
|
||||
_assigned = _group getVariable ["targets",[]];
|
||||
{
|
||||
@@ -17,19 +17,19 @@ _targets = _lead nearTargets _range;
|
||||
private["_obj","_dis"];
|
||||
_obj = _x select 4;
|
||||
_dis = _obj distance _lead;
|
||||
if (_obj isKindOf "Man") then {
|
||||
if (!(_obj isKindOf "zZombie_Base") and !(_obj in _targetMen)) then {
|
||||
// if (_obj isKindOf "Man") then {
|
||||
if (((_obj isKindOf "Man") or (_obj isKindOf "AllVehicles")) and !(_obj isKindOf "zZombie_Base") and !(_obj in _targetMen)) then {
|
||||
//process man targets
|
||||
_targetMen set [count _targetMen,_obj];
|
||||
_targetDis set [count _targetDis,_dis];
|
||||
};
|
||||
} else {
|
||||
if ((_obj isKindOf "AllVehicles") and (count crew _obj > 0) and !(_obj in _targetMen)) then {
|
||||
//process vehicle targets
|
||||
_targetMen set [count _targetMen,_obj];
|
||||
_targetDis set [count _targetDis,_dis];
|
||||
};
|
||||
};
|
||||
// } else {
|
||||
// if ((_obj isKindOf "AllVehicles") and (count crew _obj > 0) and !(_obj in _targetMen)) then {
|
||||
// //process vehicle targets
|
||||
// _targetMen set [count _targetMen,_obj];
|
||||
// _targetDis set [count _targetDis,_dis];
|
||||
// };
|
||||
// };
|
||||
} forEach _targets;
|
||||
|
||||
//Search for fires
|
||||
|
||||
@@ -26,7 +26,7 @@ if (count _targets == 0) then {
|
||||
if (isNil "_targets") exitWith {};
|
||||
//Search for objects
|
||||
if (count _targets == 0) then {
|
||||
_objects = nearestObjects [_agent,["ThrownObjects","GrenadeHandTimedWest","SmokeShell"],_range/2];
|
||||
_objects = nearestObjects [_agent,["ThrownObjects","GrenadeHandTimedWest","SmokeShell"],_range];
|
||||
{
|
||||
private["_dis"];
|
||||
if (!(_x in _targets)) then {
|
||||
|
||||
Reference in New Issue
Block a user