mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-06 08:12:53 +03:00
0.981 + 1.7.6.1 CE
+ Increased raise horde distance to 65m. + decreased raise horde action timer to 7 seconds. + sync with 1.7.6.1 CE
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
private["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_itemChances","_lootChance","_weights","_cntWeights","_index"];
|
||||
|
||||
_obj = _this select 0;
|
||||
_type = typeOf _obj;
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
@@ -17,6 +18,7 @@ _lootChance = getNumber (_config >> "lootChance");
|
||||
_index = _weights select _index;
|
||||
_itemType = _itemTypes select _index;
|
||||
[_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot;
|
||||
_obj setVariable ["created",(DateToNumber date),true];
|
||||
};
|
||||
};
|
||||
} forEach _positions;
|
||||
@@ -1,43 +1,47 @@
|
||||
private["_obj","_type","_config","_canLoot","_originalPos","_unitTypes","_min","_max","_num","_clean","_positions","_zombieChance","_rnd","_iPos","_nearBy","_nearByPlayer"];_obj = _this select 0;
|
||||
private["_obj","_type","_config","_canLoot","_unitTypes","_min","_max","_num","_zombieChance","_rnd","_noPlayerNear","_position","_clean","_positions","_iPos","_nearBy","_nearByPlayer"];
|
||||
_obj = _this select 0;
|
||||
_type = typeOf _obj;
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
_canLoot = isClass (_config);
|
||||
_originalPos = getPosATL _obj;
|
||||
|
||||
if (_canLoot and placevault) then {
|
||||
if (dayz_maxCurrentZeds > dayz_maxZeds) exitwith {};
|
||||
if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {};
|
||||
if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {};
|
||||
|
||||
if (_canLoot) then {
|
||||
//Get zombie class
|
||||
_unitTypes = getArray (_config >> "zombieClass");
|
||||
_min = getNumber (_config >> "minRoaming");
|
||||
_max = getNumber (_config >> "maxRoaming");
|
||||
//Walking Zombies
|
||||
_num = round(random _max) min _min;
|
||||
//Walking Zombies
|
||||
//_num = round(random _max) min _min;
|
||||
_num = round(random _max) max _min;
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
//Get zombie class
|
||||
//Get zombie class
|
||||
_zombieChance = getNumber (_config >> "zombieChance");
|
||||
_rnd = random 0.5;
|
||||
_chance = round(random 20);
|
||||
_rnd = random 1;
|
||||
|
||||
//if (_rnd < _zombieChance) then {
|
||||
if ((_chance % 2) == 0) then {
|
||||
|
||||
|
||||
_noPlayerNear = (count ((getPosATL _obj) nearEntities ["CAManBase",30])) == 0;
|
||||
|
||||
|
||||
if (_noPlayerNear) then {
|
||||
|
||||
_position = _obj buildingExit 0;
|
||||
if ((_position select 0) == 0) then {
|
||||
|
||||
//_position = _obj buildingExit 0;
|
||||
//if ((_position select 0) == 0) then {
|
||||
_position = getPosATL _obj;
|
||||
};
|
||||
|
||||
//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
|
||||
{
|
||||
[_position,_unitTypes] call zombie_generate;
|
||||
[_position,true,_unitTypes] call zombie_generate;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
//};
|
||||
|
||||
|
||||
//Add Internal Zombies
|
||||
_clean = {alive _x} count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0;
|
||||
if (_clean) then {
|
||||
@@ -48,13 +52,11 @@ if (_canLoot and placevault) then {
|
||||
_rnd = random 1;
|
||||
if (_rnd < _zombieChance) then {
|
||||
_iPos = _obj modelToWorld _x;
|
||||
|
||||
_nearBy = {alive _x} count nearestObjects [_iPos , ["zZombie_Base"],3] > 0;
|
||||
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
|
||||
_nearBy = {alive _x} 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,_unitTypes] call zombie_generate;
|
||||
[_iPos,true,_unitTypes] call zombie_generate;
|
||||
};
|
||||
};
|
||||
} forEach _positions;
|
||||
|
||||
@@ -42,7 +42,7 @@ while {_isAlive and _isSomeone} do {
|
||||
_targetPos = getPosATL _target;
|
||||
//Move to target
|
||||
_agent moveTo _targetPos;
|
||||
_agent forceSpeed 6;
|
||||
_agent forceSpeed 8;
|
||||
sleep 1;
|
||||
};
|
||||
//LOOP
|
||||
|
||||
@@ -249,7 +249,7 @@ if ((!_isClose or !_hasPatient) and r_action) then {
|
||||
};
|
||||
|
||||
//Pain Effects
|
||||
if (r_player_inpain and !r_player_unconscious) then {
|
||||
playSound "breath_1";
|
||||
addCamShake [2, 1, 25];
|
||||
};
|
||||
//if (r_player_inpain and !r_player_unconscious) then {
|
||||
// playSound "breath_1";
|
||||
// addCamShake [2, 1, 25];
|
||||
//};
|
||||
@@ -30,7 +30,9 @@ _unitIsPlayer = _unit == player;
|
||||
if (_isPlayer) then {
|
||||
if (_damage > 0.1) then {
|
||||
dayz_canDisconnect = false;
|
||||
["dayzDiscoAdd",getPlayerUID player] call callRpcProcedure;
|
||||
//["dayzDiscoAdd",getPlayerUID player] call callRpcProcedure;
|
||||
dayzDiscoAdd = getPlayerUID player;
|
||||
publicVariable "dayzDiscoAdd";
|
||||
|
||||
dayz_damageCounter = time;
|
||||
|
||||
@@ -55,7 +57,9 @@ if (_unitIsPlayer) then {
|
||||
_myKills = 200 - (((player getVariable ["humanKills",0]) / 30) * 100);
|
||||
//Process Morality Hit
|
||||
_humanityHit = -(_myKills * _damage);
|
||||
["dayzHumanity",[_source,_humanityHit,30]] call broadcastRpcCallAll;
|
||||
//["dayzHumanity",[_source,_humanityHit,30]] call broadcastRpcCallAll;
|
||||
dayzHumanity = [_this select 0,_this select 1,30];
|
||||
publicVariable "dayzHumanity";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -96,7 +100,7 @@ if (_hit in USEC_MinorWounds) then {
|
||||
} else {
|
||||
[_unit,_hit,(_damage / 4)] call object_processHit;
|
||||
};
|
||||
} else {;
|
||||
} else {
|
||||
[_unit,_hit,(_damage / 2)] call object_processHit;
|
||||
};
|
||||
if (_ammo == "") then {
|
||||
@@ -165,7 +169,9 @@ if (_damage > 0.4) then { //0.25
|
||||
if(!_isPZombie) then {
|
||||
//Create Wound
|
||||
_unit setVariable[_wound,true,true];
|
||||
["usecBleed",[_unit,_wound,_hit]] call broadcastRpcCallAll;
|
||||
[_unit,_wound,_hit] spawn fnc_usec_damageBleed;
|
||||
usecBleed = [_unit,_wound,_hit];
|
||||
publicVariable "usecBleed";
|
||||
|
||||
//Set Injured if not already
|
||||
_isInjured = _unit getVariable["USEC_injured",false];
|
||||
@@ -180,7 +186,7 @@ if (_damage > 0.4) then { //0.25
|
||||
if (!_lowBlood) then {
|
||||
_unit setVariable["USEC_lowBlood",true,true];
|
||||
};
|
||||
if (_unitIsPlayer) then {
|
||||
if (_unitIsPlayer) then {
|
||||
r_player_injured = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ scriptName "Functions\misc\fn_selfActions.sqf";
|
||||
private["_isPZombie","_vehicle","_inVehicle","_bag","_classbag","_isWater","_hasAntiB","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_hasTent","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_canmove","_Unlock","_lock","_allFixed","_hitpoints","_damage","_part","_cmpt","_color","_string","_handle","_trader_id","_category","_buy","_buy2","_buy3","_buy1","_buy4","_buy5","_cantrader","_cantrader1","_buy6","_zparts1","_zparts2","_zparts3","_zparts4","_metals1","_metals2","_metals4","_metals3","_metals5","_dogHandle","_lieDown","_warn"];
|
||||
|
||||
_vehicle = vehicle player;
|
||||
_isPZombie = player isKindOf "PZombie_VB";
|
||||
_inVehicle = (_vehicle != player);
|
||||
_bag = unitBackpack player;
|
||||
_classbag = typeOf _bag;
|
||||
@@ -15,7 +16,13 @@ _hasAntiB = "ItemAntibiotic" in magazines player;
|
||||
_hasFuelE = "ItemJerrycanEmpty" in magazines player;
|
||||
//boiled Water
|
||||
_hasbottleitem = "ItemWaterbottle" in magazines player;
|
||||
_hastinitem = ("TrashTinCan" in magazines player) or ("ItemSodaEmpty" in magazines player);
|
||||
_hastinitem = false;
|
||||
{
|
||||
if (_x in magazines player) then {
|
||||
_hastinitem = true;
|
||||
};
|
||||
|
||||
} forEach boil_tin_cans;
|
||||
|
||||
|
||||
_hasKnife = "ItemKnife" in items player;
|
||||
@@ -33,7 +40,7 @@ if (!isNull _nearLight) then {
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
//Grab Flare
|
||||
if (_canPickLight and !dayz_hasLight) then {
|
||||
if (_canPickLight and !dayz_hasLight and !_isPZombie) then {
|
||||
if (s_player_grabflare < 0) then {
|
||||
_text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
|
||||
s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
|
||||
@@ -46,7 +53,7 @@ if (_canPickLight and !dayz_hasLight) then {
|
||||
s_player_removeflare = -1;
|
||||
};
|
||||
|
||||
_isPZombie = player isKindOf "PZombie_VB";
|
||||
|
||||
if(_isPZombie) then {
|
||||
//_state = animationState player;
|
||||
//hint str(_state);
|
||||
@@ -59,7 +66,7 @@ if(_isPZombie) then {
|
||||
};
|
||||
|
||||
|
||||
if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6)) then { //Has some kind of target
|
||||
if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cursorTarget < 6)) then { //Has some kind of target
|
||||
_isHarvested = cursorTarget getVariable["meatHarvested",false];
|
||||
_isVehicle = cursorTarget isKindOf "AllVehicles";
|
||||
_isVehicletype = typeOf cursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
|
||||
@@ -76,6 +83,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
|
||||
_canmove = canmove cursorTarget;
|
||||
_text = getText (configFile >> "CfgVehicles" >> typeOf cursorTarget >> "displayName");
|
||||
|
||||
|
||||
_rawmeat = meatraw;
|
||||
_hasRawMeat = false;
|
||||
{
|
||||
@@ -84,6 +92,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
|
||||
};
|
||||
} forEach _rawmeat;
|
||||
|
||||
|
||||
if (_hasFuelE) then {
|
||||
_isFuel = (cursorTarget isKindOf "Land_Ind_TankSmall") or (cursorTarget isKindOf "Land_fuel_tank_big") or (cursorTarget isKindOf "Land_fuel_tank_stairs") or (cursorTarget isKindOf "Land_fuel_tank_stairs_ep1") or (cursorTarget isKindOf "Land_wagon_tanker") or (cursorTarget isKindOf "Land_fuelstation") or (cursorTarget isKindOf "Land_fuelstation_army");
|
||||
};
|
||||
@@ -288,7 +297,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
|
||||
|
||||
|
||||
//Repairing Vehicles
|
||||
if (_isVehicle and (dayz_myCursorTarget != cursorTarget) and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then {
|
||||
if ((dayz_myCursorTarget != cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then {
|
||||
|
||||
if (s_player_repair_crtl < 0) then {
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ if (local _animalbody) then {
|
||||
_animalbody addMagazine _rawfoodtype;
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
[time, _animalbody] spawn {
|
||||
private ["_timer", "_body"];
|
||||
_timer = _this select 0;
|
||||
@@ -17,7 +15,10 @@ if (local _animalbody) then {
|
||||
while {(count magazines _body >0) and (time - _timer < 300) } do {
|
||||
sleep 5;
|
||||
};
|
||||
["dayzHideBody",_body] call broadcastRpcCallAll;
|
||||
//["dayzHideBody",_body] call broadcastRpcCallAll;
|
||||
dayzHideBody = _body;
|
||||
hideBody _body; // local player
|
||||
publicVariable "dayzHideBody"; // remote player
|
||||
sleep 5;
|
||||
deleteVehicle _body;
|
||||
true;
|
||||
|
||||
@@ -1,20 +1,30 @@
|
||||
private["_item","_qty","_type","_meat","_loop"];
|
||||
_item = _this select 0;
|
||||
_qty = _this select 1;
|
||||
_item = _zombiebody select 0;
|
||||
_qty = _zombiebody select 1;
|
||||
_type = typeOf _item;
|
||||
_meat = 0;
|
||||
_loop = true;
|
||||
if (local _item) then {
|
||||
_item addMagazine "ItemZombieParts";
|
||||
sleep 2;
|
||||
_timer = time;
|
||||
while {_loop} do {
|
||||
_meat = count magazines _item;
|
||||
if (_meat == 0) then {_loop = false};
|
||||
if ((time - _timer) > 300) then {_loop = false};
|
||||
sleep 1;
|
||||
|
||||
|
||||
[time, _zombiebody] spawn {
|
||||
private ["_timer", "_body"];
|
||||
_timer = _zombiebody select 0;
|
||||
_body = _zombiebody select 1;
|
||||
while {(count magazines _body >0) and (time - _timer < 300) } do {
|
||||
sleep 5;
|
||||
};
|
||||
//["dayzHideBody",_body] call broadcastRpcCallAll;
|
||||
dayzHideBody = _body;
|
||||
hideBody _body; // local player
|
||||
publicVariable "dayzHideBody"; // remote player
|
||||
sleep 5;
|
||||
deleteVehicle _body;
|
||||
true;
|
||||
};
|
||||
["dayzHideBodyZ",_item] call broadcastRpcCallAll;
|
||||
|
||||
|
||||
sleep 10;
|
||||
deleteVehicle _item;
|
||||
} else {
|
||||
|
||||
@@ -9,8 +9,18 @@ if (_selection != "" and local _unit) then {
|
||||
//player sidechat str _damage;
|
||||
_unit setVariable [_strH,_damage,true];
|
||||
if (_damage == 0) then {
|
||||
["dayzUpdateVehicle",[_unit,"repair"]] call callRpcProcedure;
|
||||
if (isServer) then {
|
||||
[_unit,"repair"] call server_updateObject
|
||||
} else {
|
||||
dayzUpdateVehicle = [_unit,"repair"];
|
||||
publicVariable "dayzUpdateVehicle";
|
||||
};
|
||||
} else {
|
||||
["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
|
||||
if (isServer) then {
|
||||
[_unit,"damage"] call server_updateObject
|
||||
} else {
|
||||
dayzUpdateVehicle = [_unit,"damage"];
|
||||
publicVariable "dayzUpdateVehicle";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -12,7 +12,9 @@ if ((_selection != "") and local _unit) then {
|
||||
_unit setVariable [_strH,_total,true];
|
||||
|
||||
if (_damage >= 1) then {
|
||||
["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
|
||||
//["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
|
||||
dayzUpdateVehicle = [_unit,"damage"];
|
||||
publicVariable "dayzUpdateVehicle";
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
@@ -2,8 +2,6 @@ private["_unit","_type","_chance","_rnd","_sound","_local","_dis"];
|
||||
_unit = _this select 0;
|
||||
_type = _this select 1;
|
||||
_chance = _this select 2;
|
||||
_local = _this select 3;
|
||||
_dis = 40;
|
||||
|
||||
_num = switch (_type) do {
|
||||
default {0};
|
||||
@@ -23,8 +21,17 @@ _num = switch (_type) do {
|
||||
case "dog_qq": {2};
|
||||
};
|
||||
|
||||
if (_type in ["shout","hit","attack","scream","breath","spotted"]) then {
|
||||
_dis = 100;
|
||||
if (count _this > 4) then {
|
||||
_dis = _this select 4;
|
||||
_local = ({isPlayer _x} count (_unit nearEntities ["AllVehicles",_dis]) < 2);
|
||||
} else {
|
||||
_local = _this select 3;
|
||||
|
||||
if (_type in ["shout","hit","attack","scream","breath","spotted"]) then {
|
||||
_dis = 100;
|
||||
} else {
|
||||
_dis = 40;
|
||||
};
|
||||
};
|
||||
|
||||
_isWoman = getText(configFile >> "cfgVehicles" >> (typeOf _unit) >> "TextPlural") == "Women";
|
||||
|
||||
@@ -4,7 +4,15 @@ _unit = _this select 0;
|
||||
_distance = _this select 1;
|
||||
_doRun = _this select 2;
|
||||
_pos = _this select 3;
|
||||
_listTalk = _pos nearEntities ["zZombie_Base",_distance * 2];
|
||||
_listTalk = _pos nearEntities ["zZombie_Base",_distance/2];
|
||||
|
||||
if ("ItemMap_Debug" in items player) then {
|
||||
diag_log ("alertzeds Unit: " +str(_unit));
|
||||
diag_log ("alertzeds Distance: " +str(_distance/2));
|
||||
diag_log ("alertzeds DoRun: " +str(_doRun));
|
||||
diag_log ("alertzeds Pos: " +str(_pos));
|
||||
diag_log ("alertzeds ListTalk: " +str(_listTalk));
|
||||
};
|
||||
|
||||
//hint str(_listTalk);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ private["_unit","_ammo","_audible","_distance","_listTalk","_weapon","_projectil
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_ammo = _this select 4;
|
||||
_magazine = _this select 5;
|
||||
_projectile = _this select 6;
|
||||
|
||||
_projectile = nearestObject [_unit, _ammo];
|
||||
@@ -9,6 +10,14 @@ _vUp = vectorUp _projectile;
|
||||
_endPos = getPosATL _projectile;
|
||||
_dir = 0;
|
||||
|
||||
if (_magazine == "Quiver") then {
|
||||
_ammo = player ammo "Crossbow_DZ";
|
||||
if (_ammo > 0) then {
|
||||
player removeMagazines "Quiver";
|
||||
player addMagazine ["Quiver", _ammo];
|
||||
};
|
||||
};
|
||||
|
||||
while {alive _projectile} do {
|
||||
_endPos = getPosATL _projectile;
|
||||
_vUp = vectorUp _projectile;
|
||||
@@ -21,7 +30,7 @@ _doLoop = true;
|
||||
_countr = 0;
|
||||
|
||||
if (_height < 100) then {
|
||||
_bolt = createVehicle ["BoltSteelF", _endPos, [], 0, "CAN_COLLIDE"];
|
||||
_bolt = createVehicle ["WoodenArrowF", _endPos, [], 0, "CAN_COLLIDE"];
|
||||
_bolt setPosATL _endPos;
|
||||
_bolt setDir (getDir _unit);
|
||||
_bolt setVectorUp _vUp;
|
||||
@@ -35,7 +44,6 @@ if (_height < 100) then {
|
||||
sleep 0.1;
|
||||
};
|
||||
|
||||
|
||||
if (count _hitArray > 0) then {
|
||||
_hitObject = _hitArray select 0;
|
||||
_hitSelection = _hitArray select 1;
|
||||
|
||||
@@ -13,9 +13,11 @@ if (r_player_infected) then {
|
||||
};
|
||||
|
||||
//Send Death Notice
|
||||
["dayzDeath",[dayz_characterID,0,_body,_playerID,dayz_playerName,_infected]] call callRpcProcedure;
|
||||
//["dayzDeath",[dayz_characterID,0,_body,_playerID,dayz_playerName,_infected]] call callRpcProcedure;
|
||||
dayzDeath = [dayz_characterID,0,_body,_playerID,dayz_playerName,_infected];
|
||||
publicVariableServer "dayzDeath";
|
||||
|
||||
_id = [player,50,true,getPosATL player] spawn player_alertZombies;
|
||||
_id = [player,20,true,getPosATL player] spawn player_alertZombies;
|
||||
|
||||
sleep 0.5;
|
||||
|
||||
@@ -62,7 +64,9 @@ if (count _array > 0) then {
|
||||
_wait = 0;
|
||||
};
|
||||
if (!_canHitFree and !_isBandit) then {
|
||||
["dayzHumanity",[_source,_humanity,_wait]] call broadcastRpcCallAll;
|
||||
//["dayzHumanity",[_source,_humanity,_wait]] call broadcastRpcCallAll;
|
||||
dayzHumanity = [_source,_humanity,_wait];
|
||||
publicVariable "dayzHumanity";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -43,14 +43,6 @@ if (_ammo isKindOf "SmokeShell") then {
|
||||
//Check if need to place arrow
|
||||
if (_ammo isKindOf "Bolt") then {
|
||||
_id = _this spawn player_crossbowBolt;
|
||||
|
||||
// Reload animation if more that 1 in mag/pack
|
||||
_count = player ammo _weapon;
|
||||
if(_count >= 1) then {
|
||||
_unit playActionNow "reloadMagazine";
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
if (_ammo isKindOf "GrenadeHand") then {
|
||||
|
||||
@@ -60,14 +52,16 @@ if (_ammo isKindOf "SmokeShell") then {
|
||||
if (_ammo isKindOf "RoadFlare") then {
|
||||
//hint str(_ammo);
|
||||
_projectile = nearestObject [_unit, "RoadFlare"];
|
||||
["dayzRoadFlare",[_projectile,0]] call broadcastRpcCallAll;
|
||||
|
||||
_id = [_projectile,0] spawn object_roadFlare;
|
||||
dayzRoadFlare = [_projectile,0];
|
||||
publicVariable "dayzRoadFlare";
|
||||
_id = _this spawn player_throwObject;
|
||||
};
|
||||
if (_ammo isKindOf "ChemLight") then {
|
||||
_projectile = nearestObject [_unit, "ChemLight"];
|
||||
["dayzRoadFlare",[_projectile,1]] call broadcastRpcCallAll;
|
||||
|
||||
_id = [_projectile,1] spawn object_roadFlare;
|
||||
dayzRoadFlare = [_projectile,1];
|
||||
publicVariable "dayzRoadFlare";
|
||||
_id = _this spawn player_throwObject;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,6 +16,9 @@ if (count _inventory > 0) then {
|
||||
_item = _x;
|
||||
_val = -1;
|
||||
};
|
||||
|
||||
if (_item == "BoltSteel") then { _item = "WoodenArrow" }; // Convert BoltSteel to WoodenArrow
|
||||
|
||||
//Is item legal?
|
||||
_isOK = isClass(configFile >> "CfgMagazines" >> _item);
|
||||
if (_isOK) then {
|
||||
@@ -30,6 +33,8 @@ if (count _inventory > 0) then {
|
||||
|
||||
//Add weapons
|
||||
{
|
||||
if (_x == "Crossbow") then { _x = "Crossbow_DZ" }; // Convert Crossbow to Crossbow_DZ
|
||||
|
||||
//Is item legal?
|
||||
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
|
||||
if (_isOK) then {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
private ["_objects"];
|
||||
_objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage","VaultStorage"], 10];
|
||||
{
|
||||
["dayzUpdateVehicle",[_x,"gear"]] call callRpcProcedure;
|
||||
//["dayzUpdateVehicle",[_x,"gear"]] call callRpcProcedure;
|
||||
dayzUpdateVehicle = [_x,"gear"];
|
||||
publicVariable "dayzUpdateVehicle";
|
||||
|
||||
} foreach _objects;
|
||||
|
||||
private["_dialog","_magazineArray","_control","_item","_val","_max"];
|
||||
@@ -18,6 +21,7 @@ for "_i" from 109 to 120 do
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_item == "BoltSteel") then { _item = "WoodenArrow" };
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
} else {
|
||||
|
||||
@@ -46,7 +46,9 @@ if (count _medical > 0) then {
|
||||
//Add Wounds
|
||||
{
|
||||
player setVariable[_x,true,true];
|
||||
["usecBleed",[player,_x,_hit]] call broadcastRpcCallAll;
|
||||
//["usecBleed",[player,_x,_hit]] call broadcastRpcCallAll;
|
||||
usecBleed = [player,_x,0];
|
||||
publicVariable "usecBleed";
|
||||
} forEach (_medical select 8);
|
||||
|
||||
//Add fractures
|
||||
|
||||
@@ -10,31 +10,38 @@ private["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax","_isDead"];
|
||||
_btnAbort ctrlEnable false;
|
||||
_timeOut = 0;
|
||||
_timeMax = 30;
|
||||
dayz_lastCheckBit = time;
|
||||
|
||||
if(r_player_dead) exitWith {_btnAbort ctrlEnable true;};
|
||||
if(r_fracture_legs) exitWith {_btnRespawn ctrlEnable true;};
|
||||
if(r_fracture_legs) exitWith {_btnRespawn ctrlEnable true; _btnAbort ctrlEnable true;};
|
||||
|
||||
//force gear save
|
||||
if (time - dayz_lastCheckBit > 10) then {
|
||||
call dayz_forceSave;
|
||||
};
|
||||
|
||||
while {!isNull _display} do {
|
||||
switch true do {
|
||||
case ({isPlayer _x} count (player nearEntities ["AllVehicles", 6]) > 1) : {
|
||||
_btnAbort ctrlEnable false;
|
||||
cutText ["Cannot Abort near another player!", "PLAIN DOWN"];
|
||||
cutText [format[localize "str_abort_playerclose",_text], "PLAIN DOWN"];
|
||||
};
|
||||
case (_timeOut < _timeMax && count (player nearEntities ["zZombie_Base", 25]) > 0) : {
|
||||
case (_timeOut < _timeMax && count (player nearEntities ["zZombie_Base", 35]) > 0) : {
|
||||
_btnAbort ctrlEnable false;
|
||||
cutText [format ["Can Abort in %1", (_timeMax - _timeOut)], "PLAIN DOWN"];
|
||||
_timeOut = _timeOut + 1;
|
||||
|
||||
//cutText [format[localize "str_abort_zedsclose",_text, "PLAIN DOWN"];
|
||||
};
|
||||
case (player getVariable["combattimeout", 0] >= time) : {
|
||||
_btnAbort ctrlEnable false;
|
||||
cutText ["Cannot Abort while in combat!", "PLAIN DOWN"];
|
||||
//cutText ["Cannot Abort while in combat!", "PLAIN DOWN"];
|
||||
cutText [format[localize "str_abort_playerincombat",_text], "PLAIN DOWN"];
|
||||
};
|
||||
default {
|
||||
_btnAbort ctrlEnable true;
|
||||
cutText ["", "PLAIN DOWN"];
|
||||
cutText ["", "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
sleep 1;
|
||||
_timeOut = _timeOut + 1;
|
||||
};
|
||||
cutText ["", "PLAIN DOWN"];
|
||||
@@ -20,7 +20,12 @@ if(_ownerID == dayz_characterID) then {
|
||||
|
||||
_dir = direction _obj;
|
||||
_pos = getposATL _obj;
|
||||
[player,"tentpack",0,false] call dayz_zombieSpeak;
|
||||
|
||||
_dis=20;
|
||||
_sfx = "tentpack";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
sleep 3;
|
||||
|
||||
//place tent (local)
|
||||
@@ -34,7 +39,12 @@ if(_ownerID == dayz_characterID) then {
|
||||
_magazines = getMagazineCargo _obj;
|
||||
_backpacks = getBackpackCargo _obj;
|
||||
|
||||
["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
|
||||
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
|
||||
dayzDeleteObj = [_objectID,_objectUID];
|
||||
publicVariable "dayzDeleteObj";
|
||||
if (isServer) then {
|
||||
dayzDeleteObj call server_deleteObj;
|
||||
};
|
||||
deleteVehicle _obj;
|
||||
|
||||
//Add weapons
|
||||
|
||||
@@ -50,7 +50,10 @@ if(_ownerID == dayz_playerUID) then {
|
||||
_backpacks = getBackpackCargo _obj;
|
||||
*/
|
||||
|
||||
["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
|
||||
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
|
||||
dayzDeleteObj = [_objectID,_objectUID];
|
||||
publicVariableServer "dayzDeleteObj";
|
||||
|
||||
|
||||
deleteVehicle _obj;
|
||||
|
||||
|
||||
@@ -8,13 +8,18 @@ _maxZombies = dayz_maxLocalZombies;
|
||||
_maxWildZombies = 3;
|
||||
_age = -1;
|
||||
|
||||
|
||||
|
||||
_nearbyBuildings = [];
|
||||
_radius = 300;
|
||||
_radius = 200;
|
||||
_position = getPosATL player;
|
||||
//_maxZombies = 10;
|
||||
|
||||
|
||||
if (_inVehicle) then {
|
||||
_maxZombies = _maxZombies / 2;
|
||||
};
|
||||
if (_isAir) then {
|
||||
_maxZombies = 5
|
||||
};
|
||||
|
||||
|
||||
//diag_log ("Type: " +str(_type));
|
||||
|
||||
|
||||
@@ -23,7 +28,7 @@ _position = getPosATL player;
|
||||
//_nearestCity = nearestLocations [getPos player, _locationstypes, _radius/2];
|
||||
//_townname = text (_nearestCity select 0);
|
||||
//_nearbytype = type (_nearestCity select 0);
|
||||
/*
|
||||
/*
|
||||
switch (_nearbytype) do {
|
||||
case "NameVillage": {
|
||||
//_radius = 250;
|
||||
@@ -35,19 +40,36 @@ switch (_nearbytype) do {
|
||||
};
|
||||
case "NameCityCapital": {
|
||||
//_radius = 400;
|
||||
_maxZombies = 50;
|
||||
_maxZombies = 40;
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius+100]) < _maxZombies;
|
||||
_players = _position nearEntities ["AllPlayers",_radius+200];
|
||||
dayz_maxGlobalZombies = 40;
|
||||
{
|
||||
dayz_maxGlobalZombies = dayz_maxGlobalZombies + 10;
|
||||
} foreach _players;
|
||||
|
||||
_spawnZombies = _position nearEntities ["zZombie_Base",_radius+100];
|
||||
dayz_spawnZombies = 0;
|
||||
{
|
||||
if (local _x) then
|
||||
{
|
||||
//diag_log ("Local");
|
||||
dayz_spawnZombies = dayz_spawnZombies + 1;
|
||||
};
|
||||
} foreach _spawnZombies;
|
||||
|
||||
dayz_CurrentZombies = count (_position nearEntities ["zZombie_Base",_radius+200]);
|
||||
|
||||
if ("ItemMap_Debug" in items player) then {
|
||||
deleteMarkerLocal "MaxZeds";
|
||||
deleteMarkerLocal "Counter";
|
||||
deleteMarkerLocal "Loot30";
|
||||
deleteMarkerLocal "Loot120";
|
||||
deleteMarkerLocal "Agro80";
|
||||
|
||||
_markerstr = createMarkerLocal ["MaxZeds", _position];
|
||||
_markerstr setMarkerColorLocal "ColorYellow";
|
||||
_markerstr setMarkerShapeLocal "ELLIPSE";
|
||||
@@ -58,8 +80,14 @@ if ("ItemMap_Debug" in items player) then {
|
||||
_markerstr1 setMarkerColorLocal "ColorRed";
|
||||
_markerstr1 setMarkerShapeLocal "ELLIPSE";
|
||||
_markerstr1 setMarkerBrushLocal "Border";
|
||||
_markerstr1 setMarkerSizeLocal [_radius+100, _radius+100];
|
||||
_markerstr1 setMarkerSizeLocal [_radius+100, _radius+100];
|
||||
|
||||
_markerstr2 = createMarkerLocal ["Agro80", _position];
|
||||
_markerstr2 setMarkerColorLocal "ColorRed";
|
||||
_markerstr2 setMarkerShapeLocal "ELLIPSE";
|
||||
_markerstr2 setMarkerBrushLocal "Border";
|
||||
_markerstr2 setMarkerSizeLocal [80, 80];
|
||||
|
||||
_markerstr2 = createMarkerLocal ["Loot30", _position];
|
||||
_markerstr2 setMarkerColorLocal "ColorRed";
|
||||
_markerstr2 setMarkerShapeLocal "ELLIPSE";
|
||||
@@ -70,45 +98,68 @@ if ("ItemMap_Debug" in items player) then {
|
||||
_markerstr3 setMarkerColorLocal "ColorBlue";
|
||||
_markerstr3 setMarkerShapeLocal "ELLIPSE";
|
||||
_markerstr3 setMarkerBrushLocal "Border";
|
||||
_markerstr3 setMarkerSizeLocal [120, 120];
|
||||
_markerstr3 setMarkerSizeLocal [120, 120];
|
||||
|
||||
diag_log ("SpawnWait: " +str(time - dayz_spawnWait));
|
||||
diag_log ("LocalZombies: " +str(dayz_spawnZombies) + "/" +str(dayz_maxLocalZombies));
|
||||
diag_log ("GlobalZombies: " +str(dayz_CurrentZombies) + "/" +str(dayz_maxGlobalZombies));
|
||||
diag_log ("dayz_maxCurrentZeds: " +str(dayz_maxCurrentZeds) + "/" +str(dayz_maxZeds));
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
switch (_type) do {
|
||||
case "Zeds": {
|
||||
_nearby = nearestObjects [_position, dayz_ZombieBuildings, _radius];
|
||||
};
|
||||
case "both": {
|
||||
_nearby = nearestObjects [_position, ["building"], _radius];
|
||||
};
|
||||
case "Loot": {
|
||||
_nearby = nearestObjects [_position, dayz_LootBuildings, _radius];
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
_nearby = nearestObjects [_position, ["building"], _radius];
|
||||
_nearby = _position nearObjects ["building",_radius];
|
||||
_nearbyCount = count _nearby;
|
||||
if (_nearbyCount < 1) exitwith {};
|
||||
if (_nearbyCount < 1) exitwith
|
||||
{
|
||||
if ((dayz_spawnZombies < _maxWildZombies) and !_inVehicle) then {
|
||||
[_position] call wild_spawnZombies;
|
||||
};
|
||||
};
|
||||
|
||||
{
|
||||
_type = typeOf _x;
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
_canLoot = isClass (_config);
|
||||
_dis = _x distance player;
|
||||
|
||||
//Loot
|
||||
if ((_dis < 120) and (_dis > 30) and _canLoot and !_inVehicle) then {
|
||||
[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity] call player_spawnlootCheck;
|
||||
_looted = (_x getVariable ["looted",-0.1]);
|
||||
_cleared = (_x getVariable ["cleared",true]);
|
||||
_dateNow = (DateToNumber date);
|
||||
_age = (_dateNow - _looted) * 525948;
|
||||
//diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" );
|
||||
if ((_age > 10) and (!_cleared)) then {
|
||||
_nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)];
|
||||
{deleteVehicle _x} forEach _nearByObj;
|
||||
_x setVariable ["cleared",true,true];
|
||||
_x setVariable ["looted",_dateNow,true];
|
||||
};
|
||||
if ((_age > 10) and (_cleared)) then {
|
||||
//Register
|
||||
_x setVariable ["looted",_dateNow,true];
|
||||
//cleanup
|
||||
_handle = [_x] spawn building_spawnLoot;
|
||||
waitUntil{scriptDone _handle};
|
||||
};
|
||||
};
|
||||
//Zeds
|
||||
if ((time - dayz_spawnWait) > dayz_spawnDelay) then {
|
||||
if (dayz_spawnZombies < _maxZombies) then {
|
||||
if (_spawnZombies) then {
|
||||
//hintSilent format["Spawning %1 / %2 <br /> total: %3 ",dayz_spawnZombies,_maxZombies,count (_position nearEntities ["zZombie_Base",_radius+100])];
|
||||
[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies] call player_spawnzedCheck;
|
||||
if (dayz_maxCurrentZeds < dayz_maxZeds) then {
|
||||
if (dayz_CurrentZombies < dayz_maxGlobalZombies) then {
|
||||
if (dayz_spawnZombies < dayz_maxLocalZombies) then {
|
||||
//[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies] call player_spawnzedCheck;
|
||||
_zombied = (_x getVariable ["zombieSpawn",-0.1]);
|
||||
_dateNow = (DateToNumber date);
|
||||
_age = (_dateNow - _zombied) * 525948;
|
||||
if (_age > 3) then {
|
||||
_x setVariable ["zombieSpawn",_dateNow,true];
|
||||
[_x] call building_spawnZombies;
|
||||
};
|
||||
} else {
|
||||
dayz_spawnWait = time;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
//hintSilent format["Waiting %1 / %2 <br /> total: %3",dayz_spawnZombies,_maxZombies,count (_position nearEntities ["zZombie_Base",_radius+100])];
|
||||
dayz_spawnWait = time;
|
||||
dayz_spawnZombies = 0;
|
||||
};
|
||||
};
|
||||
} forEach _nearby;
|
||||
@@ -9,11 +9,6 @@ _locationstypes = _this select 5;
|
||||
_nearestCity = _this select 6;
|
||||
_maxZombies = _this select 7;
|
||||
|
||||
/*
|
||||
if (_inVehicle) then {
|
||||
_maxZombies = _maxZombies / 2;
|
||||
};
|
||||
*/
|
||||
|
||||
_zombied = (_x getVariable ["zombieSpawn",-0.1]);
|
||||
_dateNow = (DateToNumber date);
|
||||
|
||||
@@ -128,6 +128,8 @@ if (_foodVal < 0.2) then {
|
||||
|
||||
if (_tempVal > 0.8) then { //TeeChange
|
||||
_ctrlTemp call player_guiControlFlash;
|
||||
} else {
|
||||
_ctrlTemp ctrlShow true;
|
||||
};
|
||||
|
||||
if (r_player_injured) then {
|
||||
|
||||
@@ -32,8 +32,17 @@ if (_vehicle != player) then {
|
||||
_damage = random 0.08;
|
||||
_chance = round(random 12);
|
||||
|
||||
if ((_chance % 4) == 0) then {
|
||||
_openVehicles = ["ATV_Base_EP1", "Motorcycle", "Bicycle"];
|
||||
{
|
||||
if (_vehicle isKindOf _x) exitWith {
|
||||
player action ["eject", _vehicle];
|
||||
};
|
||||
} forEach _openVehicles;
|
||||
};
|
||||
|
||||
if ((_wound == "Glass1") or (_wound == "Glass2") or (_wound == "Glass3") or (_wound == "Glass4") or (_wound == "Glass5") or (_wound == "Glass6")) then {
|
||||
[_unit,"hit",2,true] call dayz_zombieSpeak;
|
||||
[_unit,"hit",4,false] call dayz_zombieSpeak;
|
||||
_strH = "hit_" + (_wound);
|
||||
_dam = _vehicle getVariable [_strH,0];
|
||||
_total = (_dam + _damage);
|
||||
@@ -42,9 +51,6 @@ if (_vehicle != player) then {
|
||||
|
||||
//["dayzHitV",[_vehicle, _wound,_total, _unit,"zombie"]] call broadcastRpcCallAll;
|
||||
if (_total >= 1) then {
|
||||
if ((_chance % 4) == 0) 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 {
|
||||
_cnt = count (DAYZ_woundHit select 1);
|
||||
_index = floor (random _cnt);
|
||||
@@ -61,14 +67,20 @@ if (_vehicle != player) then {
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "dayzHit";
|
||||
[_unit,"hit",2,true] call dayz_zombieSpeak;
|
||||
[_unit,"hit",2,false] call dayz_zombieSpeak;
|
||||
} else {
|
||||
["dayzHitV",[_vehicle, _wound,_total, _unit,"zombie"]] call broadcastRpcCallAll;
|
||||
//["dayzHitV",[_vehicle, _wound, _total, _unit,"zombie"]] call broadcastRpcCallAll;
|
||||
dayzHitV = [_vehicle, _wound, _total, _unit,"zombie"];
|
||||
publicVariable "dayzHitV";
|
||||
};
|
||||
};
|
||||
} else {
|
||||
//Did he hit?
|
||||
if ((_unit distance player) <= 3) then {
|
||||
//_currentAnim = animationState _unit;
|
||||
//diag_log ("Animation state: " +(_currentAnim));
|
||||
//"amovpercmstpsnonwnondnon",
|
||||
_attackanimations = ["zombiestandingattack1","zombiestandingattack2","zombiestandingattack3","zombiestandingattack4","zombiestandingattack5","zombiestandingattack6","zombiestandingattack7","zombiestandingattack8","zombiestandingattack9","zombiestandingattack10","zombiefeed1","zombiefeed2","zombiefeed3","zombiefeed4","zombiefeed5"];
|
||||
if (((_unit distance player) <= 3) and ((animationState _unit) in _attackanimations)) then {
|
||||
//check LOS
|
||||
private[];
|
||||
_tPos = (getPosASL _vehicle);
|
||||
@@ -78,32 +90,24 @@ if (_vehicle != player) then {
|
||||
//LOS check
|
||||
_cantSee = [_unit,_vehicle] call dayz_losCheck;
|
||||
if (!_cantSee) then {
|
||||
if (_type == "dog") then {
|
||||
_cnt = count (DAYZ_woundHit_dog select 1);
|
||||
if (r_player_blood < (r_player_bloodTotal * 0.8)) then {
|
||||
_cnt = count (DAYZ_woundHit 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);
|
||||
_index = (DAYZ_woundHit select 1) select _index;
|
||||
_wound = (DAYZ_woundHit select 0) select _index;
|
||||
} else {
|
||||
if (r_player_blood < (r_player_bloodTotal * 0.8)) then {
|
||||
_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);
|
||||
_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));
|
||||
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
|
||||
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
|
||||
//publicVariable "dayzHit";
|
||||
[_unit,"hit",2,true] call dayz_zombieSpeak;
|
||||
[_unit,"hit",2,false] call dayz_zombieSpeak;
|
||||
} else {
|
||||
/*
|
||||
_isZombieInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||
@@ -113,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",2,true] call dayz_zombieSpeak;
|
||||
[_unit,"hit",2,false] call dayz_zombieSpeak;
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
@@ -1,28 +1,23 @@
|
||||
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 = (getPos _refObj) nearEntities ["zZombie_Base",80];
|
||||
_pHeight = (getPosATL _refObj) select 2;
|
||||
_attacked = false;
|
||||
_multiplier = 1;
|
||||
//_multiplier = 1;
|
||||
|
||||
//Old System
|
||||
|
||||
{
|
||||
_continue = true;
|
||||
|
||||
if (typeOf _x == "DZ_Fin" || typeOf _x == "DZ_Pastor") then { _type = "dog"; } else { _type = "zombie"; };
|
||||
//check if untamed dog;
|
||||
if (_type == "dog") then {
|
||||
_multiplier = 2;
|
||||
if ((_x getVariable ["characterID", "0"] == "0") || (_x getVariable ["state", "passive"] == "passive") || (_x getVariable ["characterID", "0"] == dayz_characterID)) then {
|
||||
_continue = false;
|
||||
};
|
||||
};
|
||||
|
||||
_type = "zombie";
|
||||
_targets = _group getVariable ["targets",[]];
|
||||
|
||||
if (alive _x && _continue) then {
|
||||
private["_dist"];
|
||||
_dist = (_x distance _refObj);
|
||||
_group = _x;
|
||||
|
||||
_chance = 1;
|
||||
_chance = 1;
|
||||
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
|
||||
@@ -31,50 +26,43 @@ _multiplier = 1;
|
||||
_delta = _pHeight - _entHeight;
|
||||
if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then {
|
||||
zedattack = [_x, _type] spawn player_zombieAttack;
|
||||
_x setVariable["lastAttack",time];
|
||||
_x setVariable["lastAttack",time];
|
||||
};
|
||||
_attacked = true;
|
||||
} else {
|
||||
if (_type == "zombie") then {
|
||||
if (speed _x < 4) then {
|
||||
[_x,"idle",(_chance + 4),true] call dayz_zombieSpeak;
|
||||
} else {
|
||||
[_x,"chase",(_chance + 3),true] call dayz_zombieSpeak;
|
||||
if (speed _x < 4) then {
|
||||
[_x,"idle",(_chance + 4),true] call dayz_zombieSpeak;
|
||||
} else {
|
||||
[_x,"chase",(_chance + 3),true] call dayz_zombieSpeak;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Noise Activation
|
||||
_targets = _group getVariable ["targets",[]];
|
||||
if (!(_refObj in _targets)) then {
|
||||
if (_dist < DAYZ_disAudial) then {
|
||||
if (DAYZ_disAudial > 80) then {
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
if (!(_refObj in _targets)) then {
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
};
|
||||
} else {
|
||||
_chance = [_x,_dist,DAYZ_disAudial] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
|
||||
if ((random 1) < _chance) then {
|
||||
_cantSee = [_x,_refObj] call dayz_losCheck;
|
||||
if (!_cantSee) then {
|
||||
if (_dist < (DAYZ_disAudial / 2)) then {
|
||||
if (!(_refObj in _targets)) then {
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
} else {
|
||||
if (_dist < (DAYZ_disAudial / 2)) then {
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
//Sight Activation
|
||||
_targets = _group getVariable ["targets",[]];
|
||||
if (!(_refObj in _targets)) then {
|
||||
if (_dist < DAYZ_disVisual) then {
|
||||
_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
|
||||
if ((random 1) < _chance) then {
|
||||
//_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: m" + str([_x,_dist]) + " " + str(_chance));
|
||||
//if ((random 1) < _chance) then {
|
||||
//diag_log ("Chance Detection");
|
||||
_tPos = (getPosASL _refObj);
|
||||
_zPos = (getPosASL _x);
|
||||
@@ -82,21 +70,236 @@ _multiplier = 1;
|
||||
_eyeDir = direction _x;
|
||||
_inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
|
||||
if (_inAngle) then {
|
||||
//diag_log ("In Angle");
|
||||
//LOS check
|
||||
_cantSee = [_x,_refObj] call dayz_losCheck;
|
||||
//diag_log ("LOS Check: " + str(_cantSee));
|
||||
if (!_cantSee) then {
|
||||
//diag_log ("Within LOS! Target");
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
if (!(_refObj in _targets)) then {
|
||||
_targets set [count _targets, driver _refObj];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
};
|
||||
};
|
||||
};
|
||||
//};
|
||||
};
|
||||
};
|
||||
};
|
||||
//diag_log ("Targets Array: " +str(_targets));
|
||||
} forEach _listTalk;
|
||||
|
||||
|
||||
// New Systems
|
||||
/*
|
||||
{
|
||||
_continue = true;
|
||||
_type = "zombie";
|
||||
_targets = _group getVariable ["targets",[]];
|
||||
|
||||
if (alive _x and _continue) then
|
||||
{
|
||||
if (local _x) then
|
||||
{
|
||||
private["_dist"];
|
||||
_dist = (_x distance _refObj);
|
||||
|
||||
_chance = 1;
|
||||
if ((_dist < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then
|
||||
{
|
||||
if (_type == "zombie") then { [_x,"attack",(_chance),true] call dayz_zombieSpeak; };
|
||||
//perform an attack
|
||||
_last = _x getVariable["lastAttack",0];
|
||||
_entHeight = (getPosATL _x) select 2;
|
||||
_delta = _pHeight - _entHeight;
|
||||
if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then
|
||||
{
|
||||
[_x, _type] spawn player_zombieAttack;
|
||||
_x setVariable["lastAttack",time];
|
||||
};
|
||||
_attacked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_type == "zombie") then
|
||||
{
|
||||
if (speed _x < 4) then
|
||||
{
|
||||
[_x,"idle",(_chance + 4),true] call dayz_zombieSpeak;
|
||||
}
|
||||
else
|
||||
{
|
||||
[_x,"chase",(_chance + 3),true] call dayz_zombieSpeak;
|
||||
};
|
||||
};
|
||||
};
|
||||
//Noise Activation
|
||||
_target = _x getVariable ["target",[]];
|
||||
if (!(_refObj in _target)) then
|
||||
{
|
||||
if (_dist < DAYZ_disAudial) then
|
||||
{
|
||||
if (DAYZ_disAudial > 80) then
|
||||
{
|
||||
_target set [count _target,(driver _refObj)];
|
||||
_x setVariable ["target",_target];
|
||||
}
|
||||
else
|
||||
{
|
||||
// _chance = [_x,_dist,DAYZ_disAudial] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
|
||||
// if ((random 1) < _chance) then {
|
||||
_cantSee = [_x,_refObj] call dayz_losCheck;
|
||||
if (!_cantSee) then
|
||||
{
|
||||
_target set [count _target,(driver _refObj)];
|
||||
_x setVariable ["target",_target];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_dist < (DAYZ_disAudial / 2)) then
|
||||
{
|
||||
_target set [count _target,(driver _refObj)];
|
||||
_x setVariable ["target",_target];
|
||||
};
|
||||
};
|
||||
//};
|
||||
};
|
||||
};
|
||||
};
|
||||
//Sight Activation
|
||||
_target = _x getVariable ["target",[]];
|
||||
if (!(_refObj in _target)) then
|
||||
{
|
||||
if (_dist < DAYZ_disVisual) then
|
||||
{
|
||||
_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
|
||||
//if ((random 1) < _chance) then {
|
||||
//diag_log ("Chance Detection");
|
||||
_tPos = (getPosASL _refObj);
|
||||
_zPos = (getPosASL _x);
|
||||
//_eyeDir = _x call dayz_eyeDir;
|
||||
_eyeDir = direction _x;
|
||||
_inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
|
||||
if (_inAngle) then
|
||||
{
|
||||
//diag_log ("In Angle");
|
||||
//LOS check
|
||||
_cantSee = [_x,_refObj] call dayz_losCheck;
|
||||
//diag_log ("LOS Check: " + str(_cantSee));
|
||||
if (!_cantSee) then
|
||||
{
|
||||
_target set [count _target,(driver _refObj)];
|
||||
_x setVariable ["target",_target];
|
||||
};
|
||||
};
|
||||
//};
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
private["_dist"];
|
||||
_dist = (_x distance _refObj);
|
||||
|
||||
_chance = 1;
|
||||
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
|
||||
_last = _x getVariable["lastAttack",0];
|
||||
_entHeight = (getPosATL _x) select 2;
|
||||
_delta = _pHeight - _entHeight;
|
||||
if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then
|
||||
{
|
||||
[_x, _type] spawn player_zombieAttack;
|
||||
_x setVariable["lastAttack",time];
|
||||
};
|
||||
_attacked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_type == "zombie") then
|
||||
{
|
||||
if (speed _x < 4) then
|
||||
{
|
||||
[_x,"idle",(_chance + 4),true] call dayz_zombieSpeak;
|
||||
}
|
||||
else
|
||||
{
|
||||
[_x,"chase",(_chance + 3),true] call dayz_zombieSpeak;
|
||||
};
|
||||
};
|
||||
};
|
||||
//Noise Activation
|
||||
_targets = _x getVariable ["targets",[]];
|
||||
if (!(_refObj in _targets)) then
|
||||
{
|
||||
if (_dist < DAYZ_disAudial) then
|
||||
{
|
||||
if (DAYZ_disAudial > 80) then
|
||||
{
|
||||
_targets set [count _targets,(driver _refObj)];
|
||||
_x setVariable ["targets",_targets,true];
|
||||
}
|
||||
else
|
||||
{
|
||||
//_chance = [_x,_dist,DAYZ_disAudial] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
|
||||
//if ((random 1) < _chance) then {
|
||||
_cantSee = [_x,_refObj] call dayz_losCheck;
|
||||
if (!_cantSee) then
|
||||
{
|
||||
_targets set [count _targets,(driver _refObj)];
|
||||
_x setVariable ["targets",_targets,true];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_dist < (DAYZ_disAudial / 2)) then
|
||||
{
|
||||
_targets set [count _targets,(driver _refObj)];
|
||||
_x setVariable ["targets",_targets,true];
|
||||
};
|
||||
};
|
||||
//};
|
||||
};
|
||||
};
|
||||
};
|
||||
//Sight Activation
|
||||
_targets = _x getVariable ["targets",[]];
|
||||
if (!(_refObj in _targets)) then
|
||||
{
|
||||
if (_dist < DAYZ_disVisual) then
|
||||
{
|
||||
//_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
|
||||
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
|
||||
//if ((random 1) < _chance) then {
|
||||
//diag_log ("Chance Detection");
|
||||
_tPos = (getPosASL _refObj);
|
||||
_zPos = (getPosASL _x);
|
||||
//_eyeDir = _x call dayz_eyeDir;
|
||||
_eyeDir = direction _x;
|
||||
_inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
|
||||
if (_inAngle) then
|
||||
{
|
||||
//diag_log ("In Angle");
|
||||
//LOS check
|
||||
_cantSee = [_x,_refObj] call dayz_losCheck;
|
||||
//diag_log ("LOS Check: " + str(_cantSee));
|
||||
if (!_cantSee) then
|
||||
{
|
||||
//diag_log ("Within LOS! Target");
|
||||
_targets set [count _targets,(driver _refObj)];
|
||||
_x setVariable ["targets",_targets,true];
|
||||
};
|
||||
};
|
||||
//};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach _listTalk;
|
||||
*/
|
||||
|
||||
if (_attacked) then {
|
||||
if (r_player_unconscious) then {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
+private["_iItem","_iClass","_iPos","_radius","_itemTypes","_index","_item","_qty","_max","_tQty","_canType","_weights","_cntWeights","_dateNow"];
|
||||
private["_iItem","_iClass","_iPos","_radius","_itemTypes","_index","_item","_qty","_max","_tQty","_canType","_weights","_cntWeights","_dateNow"];
|
||||
_iItem = _this select 0;
|
||||
_iClass = _this select 1;
|
||||
_iPos = _this select 2;
|
||||
_radius = _this select 3;
|
||||
|
||||
switch (_iClass) do {
|
||||
default {
|
||||
//Item is food, add random quantity of cans along with an item (if exists)
|
||||
@@ -32,6 +33,7 @@ switch (_iClass) do {
|
||||
_item addWeaponCargoGlobal [_iItem,1];
|
||||
_mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
|
||||
if ((count _mags) > 0) then {
|
||||
if (_mags select 0 == "Quiver") then { _mags set [0, "WoodenArrow"] }; // Prevent spawning a Quiver
|
||||
_item addMagazineCargoGlobal [(_mags select 0), (round(random 2))];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,7 +23,13 @@ if (_dam < 1 ) then {
|
||||
_unit setVariable [_strH,_total,true];
|
||||
if ( !_needUpdate ) then {
|
||||
_unit setVariable ["needUpdate",true,true];
|
||||
["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
|
||||
//["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
|
||||
if (isServer) then {
|
||||
[_unit, "damage"] call server_updateObject;
|
||||
} else {
|
||||
dayzUpdateVehicle = [_unit,"damage"];
|
||||
publicVariable "dayzUpdateVehicle";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,7 +9,13 @@ _hitPoints = _unit call vehicle_getHitpoints;
|
||||
_unit setVariable [_selection, 1, true];
|
||||
} forEach _hitPoints;
|
||||
|
||||
["dayzUpdateVehicle",[_unit, "damage", true]] call callRpcProcedure;
|
||||
//["dayzUpdateVehicle",[_unit, "damage"]] call callRpcProcedure;
|
||||
if (isServer) then {
|
||||
[_unit, "killed"] call server_updateObject;
|
||||
} else {
|
||||
dayzUpdateVehicle = [_unit, "killed"];
|
||||
publicVariable "dayzUpdateVehicle";
|
||||
};
|
||||
|
||||
_unit removeAllEventHandlers "HandleDamage";
|
||||
_unit removeAllEventHandlers "Killed";
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
private["_position","_doLoiter","_unitTypes","_isNoone","_loot","_array","_agent","_type","_radius","_method","_nearByPlayer","_attempt","_myDest","_newDest","_lootType"];
|
||||
_position = _this select 0;
|
||||
_maxZombies = _this select 1;
|
||||
|
||||
_totalzeds = dayz_spawnZombies;
|
||||
|
||||
diag_log ("totalzeds" +str"_totalzeds");
|
||||
_player = _this select 0;
|
||||
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
||||
_doLoiter = true;
|
||||
|
||||
@@ -14,18 +9,13 @@ _agent = objNull;
|
||||
|
||||
_type = _unitTypes call BIS_fnc_selectRandom;
|
||||
|
||||
diag_log ("Wild Loaded");
|
||||
|
||||
//Create the Group and populate it
|
||||
//diag_log ("Spawned: " + _type);
|
||||
_radius = 40;
|
||||
_method = "NONE";
|
||||
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
|
||||
_position = [_player,120,200,10,0,0,0] call BIS_fnc_findSafePos;
|
||||
|
||||
if (_nearByPlayer) then {
|
||||
_position = [_position,55,100,10,0,0,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
_agent = createAgent [_type, _position, [], _radius, _method];
|
||||
|
||||
if (_doLoiter) then {
|
||||
@@ -41,9 +31,6 @@ if (random 1 > 0.7) then {
|
||||
_agent setUnitPos "Middle";
|
||||
};
|
||||
|
||||
//diag_log ("CREATED: " + str(_agent));
|
||||
|
||||
|
||||
if (isNull _agent) exitWith {
|
||||
dayz_spawnZombies = dayz_spawnZombies - 1;
|
||||
};
|
||||
@@ -71,6 +58,4 @@ if (_rnd > 0.3) then {
|
||||
};
|
||||
|
||||
//Start behavior
|
||||
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
||||
|
||||
diag_log ("Wild Ended");
|
||||
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
||||
@@ -1,35 +1,45 @@
|
||||
private["_agent","_target","_targets","_targetDis","_c","_man","_manDis","_targets","_agent","_agentheight","_nearEnts","_rnd","_assigned","_range","_objects"];
|
||||
_agent = _this;
|
||||
_target = objNull;
|
||||
/*
|
||||
_local = [];
|
||||
_remote = [];
|
||||
*/
|
||||
_targets = [];
|
||||
_targetDis = [];
|
||||
_range = 300;
|
||||
_range = 120;
|
||||
_manDis = 0;
|
||||
_refobj = vehicle player;
|
||||
|
||||
_targets = _agent getVariable ["targets",[]];
|
||||
/*
|
||||
//Search for fires
|
||||
if (count _targets == 0) then {
|
||||
_fires = nearestObjects [_agent,["Land_Fire"],_range];
|
||||
{
|
||||
private["_dis"];
|
||||
_dis = _x distance _agent;
|
||||
_rnd = random 1;
|
||||
if ((_dis < _range) and (inflamed _x) and !(_x in _targets) and (_rnd < 0.5)) then {
|
||||
_targets set [count _targets,_x];
|
||||
_targetDis set [count _targetDis,_dis];
|
||||
};
|
||||
} forEach _fires;
|
||||
_local = _agent getVariable ["target",[]];
|
||||
//diag_log ("Local is: " + str(_local));
|
||||
_remote = _agent getVariable ["targets",[]];
|
||||
//diag_log ("Remote is: " + str(_remote));
|
||||
|
||||
if (count _remote == 0) then
|
||||
{
|
||||
_targets = _local;
|
||||
//diag_log ("Targets is: " + str(_targets));
|
||||
}
|
||||
else
|
||||
{
|
||||
_targets = _local + _remote;
|
||||
//diag_log ("Local + Remote targets is: " + str(_targets));
|
||||
};
|
||||
*/
|
||||
|
||||
_targets = _agent getVariable ["targets",[]];
|
||||
|
||||
if (isNil "_targets") exitWith {};
|
||||
//Search for objects
|
||||
if (count _targets == 0) then {
|
||||
_objects = nearestObjects [_agent,["ThrownObjects","GrenadeHandTimedWest","SmokeShell"],_range];
|
||||
if (count _targets == 0) then
|
||||
{
|
||||
_objects = nearestObjects [_agent,["ThrownObjects","GrenadeHandTimedWest","SmokeShell"],50];
|
||||
{
|
||||
private["_dis"];
|
||||
if (!(_x in _targets)) then {
|
||||
if (!(_x in _targets)) then
|
||||
{
|
||||
_targets set [count _targets,_x];
|
||||
_targetDis set [count _targetDis,_dis];
|
||||
};
|
||||
@@ -37,28 +47,37 @@ if (count _targets == 0) then {
|
||||
};
|
||||
|
||||
//Find best target
|
||||
if (count _targets > 0) then {
|
||||
if (count _targets > 0) then
|
||||
{
|
||||
_man = _targets select 0;
|
||||
_manDis = _man distance _agent;
|
||||
//diag_log (str(_man) + str(_manDis));
|
||||
{
|
||||
private["_dis"];
|
||||
_dis = _x distance _agent;
|
||||
if (_dis < _manDis) then {
|
||||
if (_dis < _manDis) then
|
||||
{
|
||||
_man = _x;
|
||||
_manDis = _dis;
|
||||
};
|
||||
if (_x isKindOf "SmokeShell") then {
|
||||
if (_dis > _range) then
|
||||
{
|
||||
_targets = _targets - [_x];
|
||||
};
|
||||
if (_x isKindOf "SmokeShell") then
|
||||
{
|
||||
_man = _x;
|
||||
_manDis = _dis;
|
||||
};
|
||||
} forEach _targets;
|
||||
|
||||
_target = _man;
|
||||
};
|
||||
|
||||
//Check if too far
|
||||
if (_manDis > _range) then {
|
||||
if (_manDis > _range) then
|
||||
{
|
||||
_targets = _targets - [_target];
|
||||
_target = objNull;
|
||||
};
|
||||
_target;
|
||||
|
||||
_target
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
private["_position","_doLoiter","_unitTypes","_isNoone","_loot","_array","_agent","_type","_radius","_method","_nearByPlayer","_attempt","_myDest","_newDest","_lootType"];
|
||||
_position = _this select 0;
|
||||
_unitTypes = _this select 1;
|
||||
_doLoiter = true;
|
||||
_doLoiter = _this select 1;
|
||||
_unitTypes = _this select 2;
|
||||
|
||||
_isNoone = {isPlayer _x} count (_position nearEntities ["CAManBase",30]) == 0;
|
||||
if (dayz_maxCurrentZeds > dayz_maxZeds) exitwith {};
|
||||
if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {};
|
||||
if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {};
|
||||
|
||||
_isNoone = {isPlayer _x} count (_position nearEntities [["AllVehicles","CAManBase"],30]) == 0;
|
||||
_loot = "";
|
||||
_array = [];
|
||||
_agent = objNull;
|
||||
@@ -27,13 +31,6 @@ if (_doLoiter) then {
|
||||
//diag_log ("Spawned: " + str([_type, _position, [], _radius, _method]));
|
||||
_agent = createAgent [_type, _position, [], _radius, _method];
|
||||
|
||||
/*
|
||||
if(!(_agent == objNull)) then {
|
||||
dayzSpawnZed = [_agent];
|
||||
publicVariableServer "dayzSpawnZed";
|
||||
};
|
||||
*/
|
||||
|
||||
if (_doLoiter) then {
|
||||
_agent setPosATL _position;
|
||||
//_agent setVariable ["doLoiter",true,true];
|
||||
@@ -45,31 +42,38 @@ dayz_spawnZombies = dayz_spawnZombies + 1;
|
||||
//diag_log ("CREATE INFECTED: " + str(_this));
|
||||
|
||||
_position = getPosATL _agent;
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities [["AllVehicles","CAManBase"],30]) > 0);
|
||||
|
||||
if (random 1 > 0.7) then {
|
||||
_agent setUnitPos "Middle";
|
||||
};
|
||||
|
||||
//diag_log ("CREATED: " + str(_agent));
|
||||
|
||||
|
||||
|
||||
if (_nearByPlayer) then {
|
||||
deleteVehicle _agent;
|
||||
};
|
||||
/*
|
||||
//_agent setVariable["host",player,true];
|
||||
if (_doLoiter) then {
|
||||
if (!_doLoiter) then {
|
||||
_agent setPosATL _position;
|
||||
_agent setDir round(random 180);
|
||||
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;
|
||||
_agent setPos _position;
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30]) > 0);
|
||||
_attempt = _attempt + 1;
|
||||
if (_attempt > 10) exitWith {};
|
||||
};
|
||||
_agent setPos _position;
|
||||
};
|
||||
};
|
||||
|
||||
*/
|
||||
if (isNull _agent) exitWith {
|
||||
dayz_spawnZombies = dayz_spawnZombies - 1;
|
||||
};
|
||||
@@ -89,7 +93,6 @@ if (_rnd > 0.3) then {
|
||||
_array = []+ getArray (configFile >> "cfgLoot" >> getText(_lootType));
|
||||
if (count _array > 0) then {
|
||||
_loot = _array call BIS_fnc_selectRandomWeighted;
|
||||
//diag_log ("Zed Loot: " +(_loot));
|
||||
if(!isNil "_array") then {
|
||||
_agent addMagazine _loot;
|
||||
};
|
||||
|
||||
@@ -2,13 +2,26 @@ private["_unit","_originalPos","_pos"];
|
||||
_unit = _this select 0;
|
||||
_originalPos = _this select 1;
|
||||
_pos = getPosATL _unit;
|
||||
_playerpos = getPos player;
|
||||
|
||||
if (count _this > 2) then {
|
||||
_pos = _this select 2;
|
||||
} else {
|
||||
//_unit enableAI "MOVE";
|
||||
//_unit enableAI "ANIM";
|
||||
|
||||
_chance = round(random 12);
|
||||
if ((_chance % 4) == 0) then {
|
||||
//_Offset = [0,0,0];
|
||||
//_playerworldPos = _playerpos modelToWorld _Offset;
|
||||
_pos = [_playerpos,30,120,4,0,5,0] call BIS_fnc_findSafePos;
|
||||
} else {
|
||||
_pos = [_originalPos,10,90,4,0,5,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
|
||||
if (_unit distance player > 250) then {
|
||||
_pos = [_playerpos,120,200,4,0,5,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
};
|
||||
|
||||
if(isNull group _unit) then {
|
||||
|
||||
Reference in New Issue
Block a user