mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Updates refs #1109
This commit is contained in:
@@ -72,7 +72,6 @@ class CfgBuildingLoot {
|
|||||||
,{"ItemWatch","generic",0.04}
|
,{"ItemWatch","generic",0.04}
|
||||||
,{"ItemCompass","generic",0.03}
|
,{"ItemCompass","generic",0.03}
|
||||||
,{"ItemMap","weapon",0.02}
|
,{"ItemMap","weapon",0.02}
|
||||||
,{"pistols","cfglootweapon",0.1}
|
|
||||||
,{"ItemFlashlight","generic",0.01}
|
,{"ItemFlashlight","generic",0.01}
|
||||||
,{"ItemKnife","generic",0.04}
|
,{"ItemKnife","generic",0.04}
|
||||||
,{"ItemMatchbox_DZE","generic",0.01}
|
,{"ItemMatchbox_DZE","generic",0.01}
|
||||||
@@ -86,7 +85,6 @@ class CfgBuildingLoot {
|
|||||||
,{"clothes","single",0.01}
|
,{"clothes","single",0.01}
|
||||||
,{"specialclothes","single",0.01}
|
,{"specialclothes","single",0.01}
|
||||||
,{"WeaponHolder_MeleeCrowbar","object",0.03}
|
,{"WeaponHolder_MeleeCrowbar","object",0.03}
|
||||||
,{"shotgunsingleshot","cfglootweapon",0.06}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class Office: Default {
|
class Office: Default {
|
||||||
@@ -102,12 +100,10 @@ class CfgBuildingLoot {
|
|||||||
,{"ItemWatch","generic",0.04}
|
,{"ItemWatch","generic",0.04}
|
||||||
,{"ItemCompass","generic",0.03}
|
,{"ItemCompass","generic",0.03}
|
||||||
,{"ItemMap","weapon",0.02}
|
,{"ItemMap","weapon",0.02}
|
||||||
,{"pistols","cfglootweapon",0.11}
|
|
||||||
,{"ItemFlashlight","generic",0.01}
|
,{"ItemFlashlight","generic",0.01}
|
||||||
,{"ItemKnife","generic",0.04}
|
,{"ItemKnife","generic",0.04}
|
||||||
,{"ItemMatchbox_DZE","generic",0.01}
|
,{"ItemMatchbox_DZE","generic",0.01}
|
||||||
,{"","generic",0.31}
|
,{"","generic",0.31}
|
||||||
,{"shotgunsingleshot","cfglootweapon",0.05}
|
|
||||||
,{"backpacks","backpack",0.04}
|
,{"backpacks","backpack",0.04}
|
||||||
,{"tents","single",0.01}
|
,{"tents","single",0.01}
|
||||||
,{"","military",0.02}
|
,{"","military",0.02}
|
||||||
@@ -186,7 +182,6 @@ class CfgBuildingLoot {
|
|||||||
lootType[] = {
|
lootType[] = {
|
||||||
{"ItemJerrycan","magazine",0.05}
|
{"ItemJerrycan","magazine",0.05}
|
||||||
,{"","generic",0.3}
|
,{"","generic",0.3}
|
||||||
,{"farmweapons","cfglootweapon",0.18}
|
|
||||||
,{"","trash",0.26}
|
,{"","trash",0.26}
|
||||||
,{"PartPlankPack","magazine",0.06}
|
,{"PartPlankPack","magazine",0.06}
|
||||||
,{"WeaponHolder_ItemHatchet_DZE","object",0.05}
|
,{"WeaponHolder_ItemHatchet_DZE","object",0.05}
|
||||||
@@ -210,12 +205,10 @@ class CfgBuildingLoot {
|
|||||||
,{"ItemWatch","generic",0.07}
|
,{"ItemWatch","generic",0.07}
|
||||||
,{"ItemCompass","generic",0.02}
|
,{"ItemCompass","generic",0.02}
|
||||||
,{"ItemMap","weapon",0.04}
|
,{"ItemMap","weapon",0.04}
|
||||||
,{"pistols","cfglootweapon",0.04}
|
|
||||||
,{"ItemFlashlight","generic",0.01}
|
,{"ItemFlashlight","generic",0.01}
|
||||||
,{"ItemKnife","generic",0.02}
|
,{"ItemKnife","generic",0.02}
|
||||||
,{"ItemMatchbox_DZE","generic",0.04}
|
,{"ItemMatchbox_DZE","generic",0.04}
|
||||||
,{"","generic",0.04}
|
,{"","generic",0.04}
|
||||||
,{"shotgunsingleshot","cfglootweapon",0.04}
|
|
||||||
,{"backpacks","backpack",0.07}
|
,{"backpacks","backpack",0.07}
|
||||||
,{"tents","single",0.01}
|
,{"tents","single",0.01}
|
||||||
,{"","food",0.3}
|
,{"","food",0.3}
|
||||||
@@ -232,11 +225,7 @@ class CfgBuildingLoot {
|
|||||||
lootChance = 0.5;
|
lootChance = 0.5;
|
||||||
lootPos[] = {};
|
lootPos[] = {};
|
||||||
lootType[] = {
|
lootType[] = {
|
||||||
{"assaultrifles","cfglootweapon",0.1}
|
{"","military",0.3}
|
||||||
,{"submachinegun","cfglootweapon",0.04}
|
|
||||||
,{"sniperrifles","cfglootweapon",0.07}
|
|
||||||
,{"machineguns","cfglootweapon",0.06}
|
|
||||||
,{"","military",0.3}
|
|
||||||
,{"","medical",0.18}
|
,{"","medical",0.18}
|
||||||
,{"MAAWS","weapon",0.02}
|
,{"MAAWS","weapon",0.02}
|
||||||
,{"MedBox0","object",0.05}
|
,{"MedBox0","object",0.05}
|
||||||
@@ -254,11 +243,7 @@ class CfgBuildingLoot {
|
|||||||
lootChance = 0.5;
|
lootChance = 0.5;
|
||||||
lootPos[] = {};
|
lootPos[] = {};
|
||||||
lootType[] = {
|
lootType[] = {
|
||||||
{"assaultrifles","cfglootweapon",0.09}
|
{"","military",0.35}
|
||||||
,{"submachinegun","cfglootweapon",0.03}
|
|
||||||
,{"sniperrifles","cfglootweapon",0.05}
|
|
||||||
,{"machineguns","cfglootweapon",0.05}
|
|
||||||
,{"","military",0.35}
|
|
||||||
,{"","medical",0.18}
|
,{"","medical",0.18}
|
||||||
,{"MAAWS","weapon",0.02}
|
,{"MAAWS","weapon",0.02}
|
||||||
,{"MedBox0","object",0.05}
|
,{"MedBox0","object",0.05}
|
||||||
@@ -289,12 +274,7 @@ class CfgBuildingLoot {
|
|||||||
lootChance = 0.4;
|
lootChance = 0.4;
|
||||||
lootPos[] = {};
|
lootPos[] = {};
|
||||||
lootType[] = {
|
lootType[] = {
|
||||||
{"pistols","cfglootweapon",0.04}
|
{"Binocular","weapon",0.03}
|
||||||
,{"assaultrifles","cfglootweapon",0.13}
|
|
||||||
,{"sniperrifles","cfglootweapon",0.04}
|
|
||||||
,{"shotgunsingleshot","cfglootweapon",0.06}
|
|
||||||
,{"submachinegun","cfglootweapon",0.07}
|
|
||||||
,{"Binocular","weapon",0.03}
|
|
||||||
,{"ItemFlashlightRed","military",0.04}
|
,{"ItemFlashlightRed","military",0.04}
|
||||||
,{"ItemKnife","military",0.01}
|
,{"ItemKnife","military",0.01}
|
||||||
,{"ItemGPS","weapon",0.01}
|
,{"ItemGPS","weapon",0.01}
|
||||||
@@ -305,7 +285,6 @@ class CfgBuildingLoot {
|
|||||||
,{"","military",0.3}
|
,{"","military",0.3}
|
||||||
,{"ItemEtool","weapon",0.02}
|
,{"ItemEtool","weapon",0.02}
|
||||||
,{"ItemSandbag","magazine",0.02}
|
,{"ItemSandbag","magazine",0.02}
|
||||||
,{"machineguns","cfglootweapon",0.03}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class MilitaryIndustrial: Default {
|
class MilitaryIndustrial: Default {
|
||||||
@@ -315,13 +294,8 @@ class CfgBuildingLoot {
|
|||||||
lootChance = 0.4;
|
lootChance = 0.4;
|
||||||
lootPos[] = {};
|
lootPos[] = {};
|
||||||
lootType[] = {
|
lootType[] = {
|
||||||
{"pistols","cfglootweapon",0.02}
|
{"PartGeneric","magazine",0.03}
|
||||||
,{"assaultrifles","cfglootweapon",0.05}
|
|
||||||
,{"PartGeneric","magazine",0.03}
|
|
||||||
,{"sniperrifles","cfglootweapon",0.01}
|
|
||||||
,{"shotgunsingleshot","cfglootweapon",0.05}
|
|
||||||
,{"ItemGenerator","magazine",0.01}
|
,{"ItemGenerator","magazine",0.01}
|
||||||
,{"submachinegun","cfglootweapon",0.05}
|
|
||||||
,{"PartWheel","magazine",0.02}
|
,{"PartWheel","magazine",0.02}
|
||||||
,{"Binocular","weapon",0.01}
|
,{"Binocular","weapon",0.01}
|
||||||
,{"ItemFlashlightRed","military",0.03}
|
,{"ItemFlashlightRed","military",0.03}
|
||||||
@@ -336,7 +310,6 @@ class CfgBuildingLoot {
|
|||||||
,{"ItemSandbag","magazine",0.02}
|
,{"ItemSandbag","magazine",0.02}
|
||||||
,{"ItemFuelBarrelEmpty","magazine",0.03}
|
,{"ItemFuelBarrelEmpty","magazine",0.03}
|
||||||
,{"ItemFuelPump","magazine",0.01}
|
,{"ItemFuelPump","magazine",0.01}
|
||||||
,{"machineguns","cfglootweapon",0.01}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class IndustrialMilitary: Default {
|
class IndustrialMilitary: Default {
|
||||||
@@ -346,13 +319,8 @@ class CfgBuildingLoot {
|
|||||||
lootChance = 0.5;
|
lootChance = 0.5;
|
||||||
lootPos[] = {};
|
lootPos[] = {};
|
||||||
lootType[] = {
|
lootType[] = {
|
||||||
{"pistols","cfglootweapon",0.02}
|
{"PartGeneric","magazine",0.03}
|
||||||
,{"assaultrifles","cfglootweapon",0.05}
|
|
||||||
,{"PartGeneric","magazine",0.03}
|
|
||||||
,{"sniperrifles","cfglootweapon",0.01}
|
|
||||||
,{"shotgunsingleshot","cfglootweapon",0.05}
|
|
||||||
,{"ItemGenerator","magazine",0.01}
|
,{"ItemGenerator","magazine",0.01}
|
||||||
,{"submachinegun","cfglootweapon",0.05}
|
|
||||||
,{"PartWheel","magazine",0.02}
|
,{"PartWheel","magazine",0.02}
|
||||||
,{"Binocular","weapon",0.01}
|
,{"Binocular","weapon",0.01}
|
||||||
,{"ItemFlashlightRed","military",0.03}
|
,{"ItemFlashlightRed","military",0.03}
|
||||||
@@ -370,7 +338,6 @@ class CfgBuildingLoot {
|
|||||||
,{"ItemSandbag","magazine",0.02}
|
,{"ItemSandbag","magazine",0.02}
|
||||||
,{"ItemFuelBarrelEmpty","magazine",0.03}
|
,{"ItemFuelBarrelEmpty","magazine",0.03}
|
||||||
,{"ItemFuelPump","magazine",0.01}
|
,{"ItemFuelPump","magazine",0.01}
|
||||||
,{"machineguns","cfglootweapon",0.01}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class MilitarySpecial: Default {
|
class MilitarySpecial: Default {
|
||||||
@@ -381,13 +348,7 @@ class CfgBuildingLoot {
|
|||||||
lootChance = 0.4;
|
lootChance = 0.4;
|
||||||
lootPos[] = {};
|
lootPos[] = {};
|
||||||
lootType[] = {
|
lootType[] = {
|
||||||
{"assaultrifles","cfglootweapon",0.1}
|
{"AmmoBoxSmall_556","object",0.01}
|
||||||
,{"machineguns","cfglootweapon",0.04}
|
|
||||||
,{"pistols","cfglootweapon",0.08}
|
|
||||||
,{"sniperrifles","cfglootweapon",0.03}
|
|
||||||
,{"militaryshotguns","cfglootweapon",0.05}
|
|
||||||
,{"submachinegun","cfglootweapon",0.06}
|
|
||||||
,{"AmmoBoxSmall_556","object",0.01}
|
|
||||||
,{"AmmoBoxSmall_762","object",0.02}
|
,{"AmmoBoxSmall_762","object",0.02}
|
||||||
,{"Binocular","weapon",0.01}
|
,{"Binocular","weapon",0.01}
|
||||||
,{"ItemFlashlightRed","military",0.02}
|
,{"ItemFlashlightRed","military",0.02}
|
||||||
@@ -417,7 +378,6 @@ class CfgBuildingLoot {
|
|||||||
,{"ItemFlashlight","generic",0.01}
|
,{"ItemFlashlight","generic",0.01}
|
||||||
,{"ItemKnife","generic",0.01}
|
,{"ItemKnife","generic",0.01}
|
||||||
,{"ItemMatchbox_DZE","generic",0.03}
|
,{"ItemMatchbox_DZE","generic",0.03}
|
||||||
,{"farmweapons","cfglootweapon",0.03}
|
|
||||||
,{"","military",0.38}
|
,{"","military",0.38}
|
||||||
,{"WeaponHolder_ItemMachete","object",0.02}
|
,{"WeaponHolder_ItemMachete","object",0.02}
|
||||||
,{"","hunter",0.5}
|
,{"","hunter",0.5}
|
||||||
|
|||||||
@@ -1,58 +1,75 @@
|
|||||||
private ["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_lootChance","_weights","_cntWeights","_index","_itemTypesSmall","_positionsSmall"];
|
/*
|
||||||
//_t1 = diag_tickTime;
|
Created exclusively for ArmA2:OA - DayZMod.
|
||||||
|
Please request permission to use/alter/distribute from project leader (R4Z0R49)
|
||||||
_obj = _this select 0;
|
*/
|
||||||
|
//private ["_lootChance","_index","_weights","_cntWeights","_itemType","_qty","_rnd","_iPos","_obj","_type","_config","_pos","_itemTypes","_positions","_bias"];
|
||||||
// lower case to prevent issues with differing case for buildings from map to map.
|
private ["_lootChance"];
|
||||||
_type = toLower(typeOf _obj);
|
_obj = _this;
|
||||||
|
_type = typeOf _obj;
|
||||||
//diag_log format["Spawning loot for: %1", _type];
|
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||||
|
_pos = [] + getArray (_config >> "lootPos");
|
||||||
|
_itemTypes = [] + getArray (_config >> "lootType");
|
||||||
|
_lootChance = getNumber (_config >> "lootChance");
|
||||||
|
//_countPositions = count _pos;
|
||||||
|
_qty = 0; // effective quantity of spawned weaponholder
|
||||||
|
_lootSpawnBias = 67; //67 between 50 and 100. The lower it is, the lower chance some of the lootpiles will spawn
|
||||||
|
|
||||||
|
|
||||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
// shuffles an array
|
||||||
if (DZE_MissionLootTable) then {
|
// parameters: array
|
||||||
_config = missionConfigFile >> "CfgBuildingLoot" >> _type;
|
// example: _myrandomarray = _myNormalArray call _ShuffleArray;
|
||||||
|
ShuffleArray = {
|
||||||
|
private ["_ar","_rand_array","_rand"];
|
||||||
|
_ar = _this;
|
||||||
|
_rand_array = [];
|
||||||
|
while {count _ar > 0} do {
|
||||||
|
_rand = (count _ar);
|
||||||
|
_rand = floor (random _rand);
|
||||||
|
_rand_array set [count _rand_array, _ar select _rand];
|
||||||
|
_ar set [_rand, "randarray_del"];
|
||||||
|
_ar = _ar - ["randarray_del"];
|
||||||
|
};
|
||||||
|
_rand_array;
|
||||||
};
|
};
|
||||||
|
_positions = _pos call ShuffleArray;
|
||||||
|
|
||||||
_positions = [] + getArray (_config >> "lootPos");
|
|
||||||
_itemTypes = [] + getArray (_config >> "itemType");
|
// bias for this building. The lower it is, the lower chance some of the lootpiles will spawn
|
||||||
_lootChance = getNumber (_config >> "lootChance");
|
_bias = 50 max _lootSpawnBias;
|
||||||
|
_bias = 100 min _bias;
|
||||||
|
_bias = (_bias + random(100 - _bias)) / 100;
|
||||||
|
//diag_log(format["BIAS:%1 LOOTCHANCE:%2", _bias, _lootChance]);
|
||||||
|
|
||||||
{
|
{
|
||||||
if ((random 1) < _lootChance) then {
|
if (count _x == 3) then {
|
||||||
|
_rnd = (random 1) / _bias;
|
||||||
_iPos = _obj modelToWorld _x;
|
_iPos = _obj modelToWorld _x;
|
||||||
_nearBy = nearestObjects [_iPos, ["ReammoBox","WeaponHolder","WeaponHolderBase"], 1];
|
_nearBy = nearestObjects [_iPos, ["ReammoBox"], 2];
|
||||||
if (count _nearBy == 0) then {
|
|
||||||
_index = dayz_CBLBase find _type;
|
if (count _nearBy > 0) then {
|
||||||
//diag_log format["Found %2 at index: %1", _index,_type];
|
_lootChance = _lootChance + 0.05;
|
||||||
_weights = dayz_CBLChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
_index = floor(random _cntWeights);
|
|
||||||
_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];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders) then {
|
||||||
|
if (_rnd <= _lootChance) then {
|
||||||
|
if (count _nearBy == 0) then {
|
||||||
|
_index = dayz_CBLBase find _type;
|
||||||
|
_weights = dayz_CBLChances select _index;
|
||||||
|
_cntWeights = count _weights;
|
||||||
|
_index = floor(random _cntWeights);
|
||||||
|
_index = _weights select _index;
|
||||||
|
_itemType = _itemTypes select _index;
|
||||||
|
[_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot;
|
||||||
|
// diag_log (format["SpawnLoot: Pos: %1, LootType: %2/%3,",_iPos,_itemType select 0,_itemType select 1]);
|
||||||
|
dayz_currentWeaponHolders = dayz_currentWeaponHolders +1;
|
||||||
|
//loclout system
|
||||||
|
_islocal = _obj getVariable ["", false]; // object created locally via TownGenerator. See stream_locationFill.sqf
|
||||||
|
_obj setVariable ["looted",diag_tickTime + dayz_tickTimeOffset,!_islocal];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
//sleep 0.002;
|
||||||
};
|
};
|
||||||
} forEach _positions;
|
} forEach _positions;
|
||||||
|
|
||||||
_itemTypesSmall = [] + getArray (_config >> "itemTypeSmall");
|
//dayz_currentWeaponHolders;
|
||||||
_positionsSmall = [] + getArray (_config >> "lootPosSmall");
|
|
||||||
{
|
|
||||||
if ((random 1) < _lootChance) then {
|
|
||||||
_iPos = _obj modelToWorld _x;
|
|
||||||
_nearBy = nearestObjects [_iPos, ["ReammoBox","WeaponHolder","WeaponHolderBase"], 1];
|
|
||||||
if (count _nearBy == 0) then {
|
|
||||||
_index = dayzE_CBLSBase find _type;
|
|
||||||
//diag_log format["Found %2 at index: %1", _index,_type];
|
|
||||||
_weights = dayzE_CBLSChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
_index = floor(random _cntWeights);
|
|
||||||
_index = _weights select _index;
|
|
||||||
_itemType = _itemTypesSmall select _index;
|
|
||||||
[_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot_small;
|
|
||||||
//_obj setVariable ["created",(DateToNumber date),true];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} forEach _positionsSmall;
|
|
||||||
//["building_spawnLoot.sqf",(diag_tickTime - _t1)] call fnc_dump;
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ _onTheMove = (speed (vehicle player) > 10);
|
|||||||
_dateNow = (DateToNumber date);
|
_dateNow = (DateToNumber date);
|
||||||
_maxWildZombies = 3;
|
_maxWildZombies = 3;
|
||||||
_age = -1;
|
_age = -1;
|
||||||
_radius = 200;
|
_radius = 200;
|
||||||
_position = getPosATL player;
|
_position = getPosATL player;
|
||||||
|
|
||||||
dayz_spawnZombies = 0;
|
dayz_spawnZombies = 0;
|
||||||
@@ -46,7 +46,7 @@ if ("ItemMap_Debug" in items player) then {
|
|||||||
deleteMarkerLocal "Loot30";
|
deleteMarkerLocal "Loot30";
|
||||||
deleteMarkerLocal "Loot120";
|
deleteMarkerLocal "Loot120";
|
||||||
deleteMarkerLocal "Agro80";
|
deleteMarkerLocal "Agro80";
|
||||||
|
|
||||||
_markerstr = createMarkerLocal ["MaxZeds", _position];
|
_markerstr = createMarkerLocal ["MaxZeds", _position];
|
||||||
_markerstr setMarkerColorLocal "ColorYellow";
|
_markerstr setMarkerColorLocal "ColorYellow";
|
||||||
_markerstr setMarkerShapeLocal "ELLIPSE";
|
_markerstr setMarkerShapeLocal "ELLIPSE";
|
||||||
@@ -58,7 +58,7 @@ if ("ItemMap_Debug" in items player) then {
|
|||||||
_markerstr1 setMarkerShapeLocal "ELLIPSE";
|
_markerstr1 setMarkerShapeLocal "ELLIPSE";
|
||||||
_markerstr1 setMarkerBrushLocal "Border";
|
_markerstr1 setMarkerBrushLocal "Border";
|
||||||
_markerstr1 setMarkerSizeLocal [_radius+100, _radius+100];
|
_markerstr1 setMarkerSizeLocal [_radius+100, _radius+100];
|
||||||
|
|
||||||
_markerstr2 = createMarkerLocal ["Agro80", _position];
|
_markerstr2 = createMarkerLocal ["Agro80", _position];
|
||||||
_markerstr2 setMarkerColorLocal "ColorRed";
|
_markerstr2 setMarkerColorLocal "ColorRed";
|
||||||
_markerstr2 setMarkerShapeLocal "ELLIPSE";
|
_markerstr2 setMarkerShapeLocal "ELLIPSE";
|
||||||
@@ -83,11 +83,11 @@ diag_log ("GlobalZombies: " +str(dayz_CurrentZombies) + "/" +str(dayz_maxGlobalZ
|
|||||||
diag_log ("dayz_maxCurrentZeds: " +str(dayz_maxCurrentZeds) + "/" +str(dayz_maxZeds));
|
diag_log ("dayz_maxCurrentZeds: " +str(dayz_maxCurrentZeds) + "/" +str(dayz_maxZeds));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
_nearby = _position nearObjects ["building",_radius];
|
_nearby = _position nearObjects ["building",_radius];
|
||||||
_nearbyCount = count _nearby;
|
_nearbyCount = count _nearby;
|
||||||
if (_nearbyCount < 1) exitwith
|
if (_nearbyCount < 1) exitwith
|
||||||
{
|
{
|
||||||
if ((dayz_spawnZombies < _maxWildZombies) and !_inVehicle) then {
|
if ((dayz_spawnZombies < _maxWildZombies) and !_inVehicle) then {
|
||||||
[_position] call wild_spawnZombies;
|
[_position] call wild_spawnZombies;
|
||||||
@@ -102,7 +102,7 @@ if (_nearbyCount < 1) exitwith
|
|||||||
_config = missionConfigFile >> "CfgBuildingLoot" >> _type;
|
_config = missionConfigFile >> "CfgBuildingLoot" >> _type;
|
||||||
};
|
};
|
||||||
_canLoot = isClass (_config);
|
_canLoot = isClass (_config);
|
||||||
|
|
||||||
if(_canLoot) then {
|
if(_canLoot) then {
|
||||||
|
|
||||||
_dis = _x distance player;
|
_dis = _x distance player;
|
||||||
@@ -124,8 +124,7 @@ if (_nearbyCount < 1) exitwith
|
|||||||
//Register
|
//Register
|
||||||
_x setVariable ["looted",_dateNow,true];
|
_x setVariable ["looted",_dateNow,true];
|
||||||
//cleanup
|
//cleanup
|
||||||
_handle = [_x] spawn building_spawnLoot;
|
_x call building_spawnLoot;
|
||||||
waitUntil{scriptDone _handle};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
private ["_radius","_position","_inVehicle","_dateNow","_age","_locationstypes","_nearestCity","_type","_looted","_cleared","_nearByObj","_handle","_x"];//_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings
|
// private["_radius","_position","_inVehicle","_dateNow","_age","_locationstypes","_nearestCity","_nearbyBuildings","_nearby","_type","_config","_canZombie","_canLoot","_dis","_keepAwayDist","_isNoone","_looted","_cleared"];//_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings
|
||||||
|
//
|
||||||
_radius = _this select 0;
|
// _radius = _this select 0;
|
||||||
_position = _this select 1;
|
// _position = _this select 1;
|
||||||
_inVehicle = _this select 2;
|
// _inVehicle = _this select 2;
|
||||||
_dateNow = _this select 3;
|
// _dateNow = _this select 3;
|
||||||
_age = _this select 4;
|
// _age = _this select 4;
|
||||||
_locationstypes = _this select 5;
|
// _locationstypes = _this select 5;
|
||||||
_nearestCity = _this select 6;
|
// _nearestCity = _this select 6;
|
||||||
|
//
|
||||||
_looted = (_x getVariable ["looted",-0.1]);
|
// _looted = (_x getVariable ["looted",-0.1]);
|
||||||
_cleared = (_x getVariable ["cleared",true]);
|
// _cleared = (_x getVariable ["cleared",true]);
|
||||||
_dateNow = (DateToNumber date);
|
// _dateNow = (DateToNumber date);
|
||||||
_age = (_dateNow - _looted) * 525948;
|
// _age = (_dateNow - _looted) * 525948;
|
||||||
//diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" );
|
// //diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" );
|
||||||
if ((_age > 10) and (!_cleared)) then {
|
// if ((_age > 10) and (!_cleared)) then {
|
||||||
_nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)];
|
// _nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)];
|
||||||
{deleteVehicle _x} forEach _nearByObj;
|
// {deleteVehicle _x} forEach _nearByObj;
|
||||||
_x setVariable ["cleared",true,true];
|
// _x setVariable ["cleared",true];
|
||||||
_x setVariable ["looted",_dateNow,true];
|
// _x setVariable ["looted",_dateNow,true];
|
||||||
};
|
// };
|
||||||
if ((_age > 10) and (_cleared)) then {
|
// if ((_age > 10) and (_cleared)) then {
|
||||||
//Register
|
// //Register
|
||||||
_x setVariable ["looted",_dateNow,true];
|
// _x setVariable ["looted",_dateNow,true];
|
||||||
//cleanup
|
// //cleanup
|
||||||
_handle = [_x] spawn building_spawnLoot;
|
// _handle = [_x] spawn building_spawnLoot;
|
||||||
waitUntil{scriptDone _handle};
|
// waitUntil{scriptDone _handle};
|
||||||
};
|
// };
|
||||||
@@ -1,150 +1,102 @@
|
|||||||
private ["_iItem","_iClass","_iPos","_radius","_item","_itemTypes","_index","_weights","_cntWeights","_qty","_max","_tQty","_canType","_mags","_dateNow"];
|
private ["_item","_itemTypes","_qty","_tQty","_uniq"];
|
||||||
|
|
||||||
_iItem = _this select 0;
|
_iItem = _this select 0;
|
||||||
_iClass = _this select 1;
|
_iClass = _this select 1;
|
||||||
//diag_log format["DEBUG spawn loot class: %1", _iClass];
|
_iPos = _this select 2;
|
||||||
_iPos = _this select 2;
|
_radius = _this select 3;
|
||||||
_radius = _this select 3;
|
|
||||||
|
|
||||||
switch (_iClass) do
|
//_uniq = ["ItemWaterbottle", "ItemWaterbottleUnfilled"];
|
||||||
{
|
_uniq = [];
|
||||||
default
|
//_permaLoot = false;
|
||||||
{
|
|
||||||
|
_iPosZ = _iPos select 2;
|
||||||
|
if((isNil "_iPosZ") OR {( _iPosZ < 0)}) then { _iPos = [_iPos select 0,_iPos select 1,0]; };
|
||||||
|
|
||||||
|
//if(_iClass == "Unknown") exitwith {};
|
||||||
|
|
||||||
|
switch (_iClass) do {
|
||||||
|
default {
|
||||||
//Item is food, add random quantity of cans along with an item (if exists)
|
//Item is food, add random quantity of cans along with an item (if exists)
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||||
|
|
||||||
_itemTypes = [];
|
_itemTypes = [];
|
||||||
if (DZE_MissionLootTable) then {
|
{
|
||||||
_itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iClass)) select 0);
|
_itemTypes set [count _itemTypes, _x select 0]
|
||||||
} else {
|
} foreach getArray (configFile >> "cfgLoot" >> _iClass);
|
||||||
_itemTypes = ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0);
|
|
||||||
};
|
|
||||||
_index = dayz_CLBase find _iClass;
|
|
||||||
_weights = dayz_CLChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
_qty = 0;
|
_qty = 0;
|
||||||
_max = 1 + round(random 2);
|
_max = ceil(random 2) + 1;
|
||||||
while {_qty < _max} do
|
while {_qty < _max} do {
|
||||||
{
|
_index = dayz_CLBase find _iClass;
|
||||||
_tQty = 1 + round(random 1);
|
_weights = dayz_CLChances select _index;
|
||||||
_index = floor(random _cntWeights);
|
_cntWeights = count _weights;
|
||||||
_index = _weights select _index;
|
_index = floor(random _cntWeights);
|
||||||
_canType = _itemTypes select _index;
|
_index = _weights select _index;
|
||||||
_item addMagazineCargoGlobal [_canType,_tQty];
|
_canType = _itemTypes select _index;
|
||||||
_qty = _qty + _tQty;
|
|
||||||
|
//_itemarray = dayz_CLItemNames select _index;
|
||||||
|
//_canType = _itemarray call BIS_fnc_selectRandom;
|
||||||
|
|
||||||
|
//diag_log ("CanType: "+str(_canType));
|
||||||
|
_tQty = round(random 1) + 1;
|
||||||
|
if (_canType in _uniq) then {
|
||||||
|
if (({_x in _uniq} count magazines _item) == 0) then { _tQty = 1; } else { _tQty = 0;};
|
||||||
|
if (_tQty == 0) then {diag_log(format["%1 Prevent any duplicate member %2 from family %3",__FILE__, _canType, _uniq]);};
|
||||||
|
//diag_log(format["%1 %2 DUP? type:%3 mag:%4 _this:%5",__FILE__, __LINE__, _canType, magazines _item, _this]);
|
||||||
|
};
|
||||||
|
if (_tQty > 0) then {
|
||||||
|
if (!(_canType in _uniq)) then {
|
||||||
|
_item addMagazineCargoGlobal [_canType,1];
|
||||||
|
_uniq set [count _uniq, _canType];
|
||||||
|
//diag_log ("uniq: "+str(_uniq));
|
||||||
|
_qty = _qty + 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
if (_iItem != "") then
|
if (_iItem != "") then {
|
||||||
{
|
|
||||||
_item addWeaponCargoGlobal [_iItem,1];
|
_item addWeaponCargoGlobal [_iItem,1];
|
||||||
|
//diag_log ("Unknown");
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "single":
|
case "weapon": {
|
||||||
{
|
|
||||||
//Item is sigle, add 1 item from cfgloot
|
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
_itemTypes = [];
|
|
||||||
if (DZE_MissionLootTable) then {
|
|
||||||
_itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iItem)) select 0);
|
|
||||||
} else {
|
|
||||||
_itemTypes = ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0);
|
|
||||||
};
|
|
||||||
_index = dayz_CLBase find _iItem;
|
|
||||||
_weights = dayz_CLChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
|
|
||||||
_index = floor(random _cntWeights);
|
|
||||||
_index = _weights select _index;
|
|
||||||
_canType = _itemTypes select _index;
|
|
||||||
_item addMagazineCargoGlobal [_canType,1];
|
|
||||||
};
|
|
||||||
case "backpack":
|
|
||||||
{
|
|
||||||
//Item is single backpack
|
|
||||||
if (DZE_MissionLootTable) then {
|
|
||||||
_itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iItem)) select 0);
|
|
||||||
} else {
|
|
||||||
_itemTypes = ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0);
|
|
||||||
};
|
|
||||||
_index = dayz_CLBase find _iItem;
|
|
||||||
_weights = dayz_CLChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
_index = floor(random _cntWeights);
|
|
||||||
_index = _weights select _index;
|
|
||||||
_iItem = _itemTypes select _index;
|
|
||||||
|
|
||||||
_item = createVehicle [_iItem, _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
};
|
|
||||||
case "cfglootweapon":
|
|
||||||
{
|
|
||||||
if (DZE_MissionLootTable) then {
|
|
||||||
_itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iItem)) select 0);
|
|
||||||
} else {
|
|
||||||
_itemTypes = ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0);
|
|
||||||
};
|
|
||||||
_index = dayz_CLBase find _iItem;
|
|
||||||
_weights = dayz_CLChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
|
|
||||||
_index = floor(random _cntWeights);
|
|
||||||
_index = _weights select _index;
|
|
||||||
_iItem = _itemTypes select _index;
|
|
||||||
|
|
||||||
if (_iItem == "Chainsaw") then {
|
|
||||||
_iItem = ["ChainSaw","ChainSawB","ChainSawG","ChainSawP","ChainSawR"] call BIS_fnc_selectRandom;
|
|
||||||
};
|
|
||||||
|
|
||||||
//Item is a weapon, add it and a random quantity of magazines
|
//Item is a weapon, add it and a random quantity of magazines
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||||
_item addWeaponCargoGlobal [_iItem,1];
|
_item addWeaponCargoGlobal [_iItem,1];
|
||||||
_mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
|
_mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
|
||||||
if ((count _mags) > 0) then
|
if ((count _mags) > 0) then {
|
||||||
{
|
// if (_mags select 0 == "Quiver") then { _mags set [0, "WoodenArrow"] }; // Prevent spawning a Quiver
|
||||||
if (_mags select 0 == "Quiver") then { _mags set [0, "WoodenArrow"] }; // Prevent spawning a Quiver
|
|
||||||
if (_mags select 0 == "20Rnd_556x45_Stanag") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
if (_mags select 0 == "20Rnd_556x45_Stanag") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
||||||
if (_mags select 0 == "30Rnd_556x45_G36") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
if (_mags select 0 == "30Rnd_556x45_G36") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
||||||
if (_mags select 0 == "30Rnd_556x45_G36SD") then { _mags set [0, "30Rnd_556x45_StanagSD"] };
|
if (_mags select 0 == "30Rnd_556x45_G36SD") then { _mags set [0, "30Rnd_556x45_StanagSD"] };
|
||||||
_item addMagazineCargoGlobal [(_mags select 0), (round(random 2))];
|
if (!(_iItem in MeleeWeapons)) then {
|
||||||
};
|
_magQty = round(random 10);
|
||||||
|
if (_magQty > 3) then {
|
||||||
};
|
_item addMagazineCargoGlobal [(_mags select 0), (round(random 1) + 1)];
|
||||||
case "weapon":
|
};
|
||||||
{
|
};
|
||||||
//Item is a weapon, add it and a random quantity of magazines
|
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
_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
|
|
||||||
if (_mags select 0 == "20Rnd_556x45_Stanag") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
|
||||||
if (_mags select 0 == "30Rnd_556x45_G36") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
|
||||||
if (_mags select 0 == "30Rnd_556x45_G36SD") then { _mags set [0, "30Rnd_556x45_StanagSD"] };
|
|
||||||
_item addMagazineCargoGlobal [(_mags select 0), (round(random 2))];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "weaponnomags":
|
/*
|
||||||
{
|
case "tools": {
|
||||||
//Item is a weapon, and spawns no mags
|
//Item is one tool
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||||
_item addWeaponCargoGlobal [_iItem,1];
|
_item addMagazineCargoGlobal [_iItem,1];
|
||||||
};
|
};
|
||||||
case "magazine":
|
*/
|
||||||
{
|
case "magazine": {
|
||||||
//Item is one magazine
|
//Item is one magazine
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||||
_item addMagazineCargoGlobal [_iItem,1];
|
_item addMagazineCargoGlobal [_iItem,1];
|
||||||
};
|
};
|
||||||
case "object":
|
case "object": {
|
||||||
{
|
|
||||||
//Item is one magazine
|
//Item is one magazine
|
||||||
_item = createVehicle [_iItem, _iPos, [], _radius, "CAN_COLLIDE"];
|
_item = createVehicle [_iItem, _iPos, [], _radius, "CAN_COLLIDE"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
if ((count _iPos) > 2) then {
|
||||||
// timestamp for later clearing
|
|
||||||
_dateNow = (DateToNumber date);
|
|
||||||
_item setVariable ["looted",_dateNow,true];
|
|
||||||
|
|
||||||
if ((count _iPos) > 2) then
|
|
||||||
{
|
|
||||||
_item setPosATL _iPos;
|
_item setPosATL _iPos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//if (_permaLoot == true) then { _item setVariable ["permaLoot",true]; };
|
||||||
|
|
||||||
|
_item // used in server_spawnCrashSite
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
|
|
||||||
private ["_iItem","_iClass","_iPos","_radius","_item","_itemTypes","_index","_weights","_cntWeights","_canType","_dateNow"];
|
|
||||||
|
|
||||||
_iItem = _this select 0;
|
|
||||||
_iClass = _this select 1;
|
|
||||||
//diag_log format["DEBUG spawn loot class: %1", _iClass];
|
|
||||||
_iPos = _this select 2;
|
|
||||||
_radius = _this select 3;
|
|
||||||
|
|
||||||
switch (_iClass) do
|
|
||||||
{
|
|
||||||
default
|
|
||||||
{
|
|
||||||
//Item is sigle, add 1 item from CfgLootSmall
|
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
_itemTypes = [];
|
|
||||||
if (DZE_MissionLootTable) then {
|
|
||||||
_itemTypes = ((getArray (missionConfigFile >> "CfgLootSmall" >> _iClass)) select 0);
|
|
||||||
} else {
|
|
||||||
_itemTypes = ((getArray (configFile >> "CfgLootSmall" >> _iClass)) select 0);
|
|
||||||
};
|
|
||||||
_index = dayzE_CLSBase find _iClass;
|
|
||||||
|
|
||||||
_weights = dayzE_CLSChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
|
|
||||||
_index = floor(random _cntWeights);
|
|
||||||
_index = _weights select _index;
|
|
||||||
_canType = _itemTypes select _index;
|
|
||||||
_item addMagazineCargoGlobal [_canType,1];
|
|
||||||
};
|
|
||||||
case "single":
|
|
||||||
{
|
|
||||||
//Item is sigle, add 1 item from CfgLootSmall
|
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
|
|
||||||
_itemTypes = [];
|
|
||||||
if (DZE_MissionLootTable) then {
|
|
||||||
_itemTypes = ((getArray (missionConfigFile >> "CfgLootSmall" >> _iItem)) select 0);
|
|
||||||
} else {
|
|
||||||
_itemTypes = ((getArray (configFile >> "CfgLootSmall" >> _iItem)) select 0);
|
|
||||||
};
|
|
||||||
_index = dayzE_CLSBase find _iItem;
|
|
||||||
_weights = dayzE_CLSChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
|
|
||||||
_index = floor(random _cntWeights);
|
|
||||||
_index = _weights select _index;
|
|
||||||
_canType = _itemTypes select _index;
|
|
||||||
_item addMagazineCargoGlobal [_canType,1];
|
|
||||||
};
|
|
||||||
case "cfglootweapon":
|
|
||||||
{
|
|
||||||
//Item is sigle, add 1 item from cfgloot
|
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
|
|
||||||
_itemTypes = [];
|
|
||||||
if (DZE_MissionLootTable) then {
|
|
||||||
_itemTypes = ((getArray (missionConfigFile >> "CfgLootSmall" >> _iItem)) select 0);
|
|
||||||
} else {
|
|
||||||
_itemTypes = ((getArray (configFile >> "CfgLootSmall" >> _iItem)) select 0);
|
|
||||||
};
|
|
||||||
_index = dayz_CLBase find _iItem;
|
|
||||||
_weights = dayz_CLChances select _index;
|
|
||||||
_cntWeights = count _weights;
|
|
||||||
|
|
||||||
_index = floor(random _cntWeights);
|
|
||||||
_index = _weights select _index;
|
|
||||||
_iItem = _itemTypes select _index;
|
|
||||||
|
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
_item addWeaponCargoGlobal [_iItem,1];
|
|
||||||
|
|
||||||
};
|
|
||||||
case "weapon":
|
|
||||||
{
|
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
_item addWeaponCargoGlobal [_iItem,1];
|
|
||||||
};
|
|
||||||
case "magazine":
|
|
||||||
{
|
|
||||||
//Item is one magazine
|
|
||||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
|
||||||
_item addMagazineCargoGlobal [_iItem,1];
|
|
||||||
};
|
|
||||||
|
|
||||||
case "weaponnomags":
|
|
||||||
{
|
|
||||||
//do nothing for now
|
|
||||||
};
|
|
||||||
case "backpack":
|
|
||||||
{
|
|
||||||
//do nothing for now
|
|
||||||
};
|
|
||||||
case "object":
|
|
||||||
{
|
|
||||||
//do nothing for now
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// timestamp for later clearing
|
|
||||||
_dateNow = (DateToNumber date);
|
|
||||||
_item setVariable ["looted",_dateNow,true];
|
|
||||||
|
|
||||||
if ((count _iPos) > 2) then
|
|
||||||
{
|
|
||||||
_item setPosATL _iPos;
|
|
||||||
};
|
|
||||||
@@ -1,120 +1,157 @@
|
|||||||
private ["_position","_doLoiter","_unitTypes","_isNoone","_loot","_array","_agent","_type","_radius","_method","_nearByPlayer","_myDest","_newDest","_lootType","_isAlive","_rnd","_id"];
|
private ["_position","_unitTypes","_radius","_method","_agent"];
|
||||||
_position = _this select 0;
|
|
||||||
_doLoiter = _this select 1;
|
|
||||||
_unitTypes = _this select 2;
|
|
||||||
|
|
||||||
if (dayz_maxCurrentZeds > dayz_maxZeds) exitwith {};
|
_position = _this select 0;
|
||||||
if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {};
|
_doLoiter = _this select 1; // wander around
|
||||||
if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {};
|
_unitTypes = _this select 2; // class of wanted models
|
||||||
|
_maxControlledZombies = round(dayz_maxLocalZombies);
|
||||||
|
|
||||||
_isNoone = {isPlayer _x} count (_position nearEntities [["AllVehicles","CAManBase"],30]) == 0;
|
_cantSee = {
|
||||||
_loot = "";
|
private ["_isok"];
|
||||||
_array = [];
|
|
||||||
_agent = objNull;
|
|
||||||
|
|
||||||
//Exit if a player is nearby
|
_isok = true;
|
||||||
if (!_isNoone) exitWith {};
|
_zPos = +(_this select 0);
|
||||||
|
if (count _zPos < 3) exitWith {
|
||||||
if (count _unitTypes == 0) then {
|
diag_log format["%1::_cantSee illegal pos %2", __FILE__, _zPos];
|
||||||
|
false
|
||||||
if (DZE_MissionLootTable) then {
|
|
||||||
_unitTypes = []+ getArray (missionConfigFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
|
||||||
} else {
|
|
||||||
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
|
||||||
};
|
};
|
||||||
};
|
_zPos = ATLtoASL _zPos;
|
||||||
|
_fov = _this select 1; // players half field of view
|
||||||
_type = _unitTypes call BIS_fnc_selectRandom;
|
_safeDistance = _this select 2; // minimum distance. closer is wrong
|
||||||
|
_farDistance = _this select 3; // distance further we won't check
|
||||||
//Create the Group and populate it
|
_zPos set [2, (_zPos select 2) + 1.7];
|
||||||
//diag_log ("Spawned: " + _type);
|
{
|
||||||
_radius = 0;
|
_xasl = getPosASL _x;
|
||||||
_method = "CAN_COLLIDE";
|
if (_xasl distance _zPos < _farDistance) then {
|
||||||
if (_doLoiter) then {
|
if (_xasl distance _zPos < _safeDistance) then {
|
||||||
_radius = 40;
|
_isok = false;
|
||||||
_method = "NONE";
|
}
|
||||||
};
|
else {
|
||||||
//diag_log ("Spawned: " + str([_type, _position, [], _radius, _method]));
|
_eye = eyePos _x; // ASL
|
||||||
_agent = createAgent [_type, _position, [], _radius, _method];
|
_ed = eyeDirection _x;
|
||||||
PVDZE_zed_Spawn = [_agent];
|
_ed = (_ed select 0) atan2 (_ed select 1);
|
||||||
publicVariableServer "PVDZE_zed_Spawn";
|
_deg = [_xasl, _zPos] call BIS_fnc_dirTo;
|
||||||
|
_deg = (_deg - _ed + 720) % 360;
|
||||||
if (_doLoiter) then {
|
if (_deg > 180) then { _deg = _deg - 360; };
|
||||||
_agent setDir round(random 180);
|
if ((abs(_deg) < _fov) AND {( // in right angle sector?
|
||||||
_agent setPosATL _position;
|
(!(terrainIntersectASL [_zPos, _eye]) // no terrain between?
|
||||||
_agent setvelocity [0, 0, 1];
|
AND {(!(lineIntersects [_zPos, _eye]))}) // and no object between?
|
||||||
//_agent setVariable ["doLoiter",true,true];
|
)}) then {
|
||||||
} else {
|
_isok = false;
|
||||||
_agent setVariable ["doLoiter",false,true];
|
};
|
||||||
};
|
|
||||||
dayz_spawnZombies = dayz_spawnZombies + 1;
|
|
||||||
|
|
||||||
//diag_log ("CREATE INFECTED: " + str(_this));
|
|
||||||
|
|
||||||
_position = getPosATL _agent;
|
|
||||||
_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 {
|
|
||||||
_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);
|
|
||||||
_attempt = _attempt + 1;
|
|
||||||
if (_attempt > 10) exitWith {};
|
|
||||||
};
|
|
||||||
_agent setPos _position;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
if (isNull _agent) exitWith {
|
|
||||||
dayz_spawnZombies = dayz_spawnZombies - 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
_isAlive = alive _agent;
|
|
||||||
|
|
||||||
_myDest = getPosATL _agent;
|
|
||||||
_newDest = getPosATL _agent;
|
|
||||||
_agent setVariable ["myDest",_myDest];
|
|
||||||
_agent setVariable ["newDest",_newDest];
|
|
||||||
|
|
||||||
//Add some loot
|
|
||||||
_rnd = random 1;
|
|
||||||
if (_rnd > 0.3) then {
|
|
||||||
_lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
|
|
||||||
if (isText _lootType) then {
|
|
||||||
|
|
||||||
_array = [];
|
|
||||||
if (DZE_MissionLootTable) then {
|
|
||||||
_array = getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));
|
|
||||||
} else {
|
|
||||||
_array = getArray (configFile >> "cfgLoot" >> getText(_lootType));
|
|
||||||
};
|
|
||||||
if (count _array > 0) then {
|
|
||||||
_loot = _array call BIS_fnc_selectRandomWeighted;
|
|
||||||
if(!isNil "_array") then {
|
|
||||||
_agent addMagazine _loot;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
if (!_isok) exitWith {false};
|
||||||
|
} forEach playableUnits;
|
||||||
|
|
||||||
|
_isok
|
||||||
};
|
};
|
||||||
|
|
||||||
//Start behavior
|
if ((dayz_spawnZombies < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then {
|
||||||
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
if ([_position, dayz_cantseefov, 10, dayz_cantseeDist] call _cantSee) then {
|
||||||
|
//Check if anyone close
|
||||||
|
_tooClose = {isPlayer _x} count (_position nearEntities ["CAManBase",30]) > 0;
|
||||||
|
if (_tooClose) exitwith {
|
||||||
|
diag_log ("Zombie_Generate: was too close to player.");
|
||||||
|
};
|
||||||
|
|
||||||
|
//Add zeds if unitTypes equals 0
|
||||||
|
if (count _unitTypes == 0) then {
|
||||||
|
if (DZE_MissionLootTable) then {
|
||||||
|
_unitTypes = []+ getArray (missionConfigFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
||||||
|
} else {
|
||||||
|
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// lets create an agent
|
||||||
|
_type = _unitTypes call BIS_fnc_selectRandom;
|
||||||
|
_radius = 5;
|
||||||
|
_method = "NONE";
|
||||||
|
if (_doLoiter) then {
|
||||||
|
_radius = 40;
|
||||||
|
_method = "CAN_COLLIDE";
|
||||||
|
};
|
||||||
|
|
||||||
|
//Check if point is in water
|
||||||
|
if (surfaceIsWater _position) exitwith { Diag_log ("Location is in Water Abort"); };
|
||||||
|
|
||||||
|
_agent = createAgent [_type, _position, [], _radius, _method];
|
||||||
|
sleep 0.001;
|
||||||
|
|
||||||
|
//add to global counter
|
||||||
|
dayz_spawnZombies = dayz_spawnZombies + 1;
|
||||||
|
|
||||||
|
//Add some loot
|
||||||
|
_loot = "";
|
||||||
|
_array = [];
|
||||||
|
_rnd = random 1;
|
||||||
|
if (_rnd < 0.2) then {
|
||||||
|
_lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
|
||||||
|
if (isText _lootType) then {
|
||||||
|
_array = [];
|
||||||
|
{
|
||||||
|
_array set [count _array, _x select 0]
|
||||||
|
} foreach getArray (configFile >> "cfgLoot" >> getText(_lootType));
|
||||||
|
if (count _array > 0) then {
|
||||||
|
_index = dayz_CLBase find getText(_lootType);
|
||||||
|
_weights = dayz_CLChances select _index;
|
||||||
|
_loot = _array select (_weights select (floor(random (count _weights))));
|
||||||
|
if(!isNil "_array") then {
|
||||||
|
_loot_count = getNumber(configFile >> "CfgMagazines" >> _loot >> "count");
|
||||||
|
if(_loot_count>1) then {
|
||||||
|
_agent addMagazine [_loot, ceil(random _loot_count)];
|
||||||
|
} else {
|
||||||
|
_agent addMagazine _loot;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
_agent setVariable["agentObject",_agent];
|
||||||
|
|
||||||
|
if (!isNull _agent) then {
|
||||||
|
// sometime Z can be seen flying in very high speed while tp. Its altitude is set underground to hide that.
|
||||||
|
/*
|
||||||
|
_agtPos = getPosASL _agent;
|
||||||
|
_agtPos set [2, -3];
|
||||||
|
_agent setPosASL _agtPos;
|
||||||
|
sleep 0.001;
|
||||||
|
_agtPos = +(_position);
|
||||||
|
_agtPos set [2, -3];
|
||||||
|
_agent setPosASL _agtPos;
|
||||||
|
sleep 0.001;
|
||||||
|
*/
|
||||||
|
_agent setDir random 360;
|
||||||
|
//_agent setPosATL _position;
|
||||||
|
sleep 0.001;
|
||||||
|
|
||||||
|
_position = getPosATL _agent;
|
||||||
|
|
||||||
|
_favStance = (
|
||||||
|
switch ceil(random(3^0.5)^2) do {
|
||||||
|
//case 3: {"DOWN"}; // prone
|
||||||
|
case 2: {"Middle"}; // Kneel
|
||||||
|
default {"UP"} // stand-up
|
||||||
|
}
|
||||||
|
);
|
||||||
|
_agent setUnitPos _favStance;
|
||||||
|
|
||||||
|
_agent setVariable ["stance", _favStance];
|
||||||
|
_agent setVariable ["BaseLocation", _position];
|
||||||
|
_agent setVariable ["doLoiter", true]; // true: Z will be wandering, false: stay still
|
||||||
|
_agent setVariable ["myDest", _position];
|
||||||
|
_agent setVariable ["newDest", _position];
|
||||||
|
[_agent, _position] call zombie_loiter;
|
||||||
|
};
|
||||||
|
//add to monitor
|
||||||
|
//dayz_zedMonitor set [count dayz_zedMonitor, _agent];
|
||||||
|
|
||||||
|
//Disable simulation
|
||||||
|
PVDZ_Server_Simulation = [_agent, false];
|
||||||
|
publicVariableServer "PVDZ_Server_Simulation";
|
||||||
|
|
||||||
|
//Start behavior
|
||||||
|
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
FUNCTION COMPILES
|
FUNCTION COMPILES
|
||||||
*/
|
*/
|
||||||
//Player only
|
//Player only
|
||||||
@@ -6,7 +6,7 @@ if (!isDedicated) then {
|
|||||||
|
|
||||||
"filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
|
"filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
|
||||||
|
|
||||||
BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
|
BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
|
||||||
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie
|
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie
|
||||||
player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
|
player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
|
||||||
fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
|
fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
|
||||||
@@ -31,14 +31,14 @@ if (!isDedicated) then {
|
|||||||
player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
|
player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
|
||||||
player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
|
player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
|
||||||
player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
|
player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
|
||||||
|
|
||||||
player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
|
player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
|
||||||
player_removeNet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNet.sqf";
|
player_removeNet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNet.sqf";
|
||||||
player_removeTankTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeTankTrap.sqf";
|
player_removeTankTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeTankTrap.sqf";
|
||||||
|
|
||||||
player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";
|
player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";
|
||||||
player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf";
|
player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf";
|
||||||
|
|
||||||
player_lockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";
|
player_lockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";
|
||||||
// control_zombieAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf";
|
// control_zombieAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf";
|
||||||
player_updateGui = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
|
player_updateGui = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
|
||||||
@@ -59,22 +59,22 @@ if (!isDedicated) then {
|
|||||||
player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
|
player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
|
||||||
player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
|
player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
|
||||||
fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
|
fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
|
||||||
|
|
||||||
//Objects
|
//Objects
|
||||||
object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
|
object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
|
||||||
object_setpitchbank = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
|
object_setpitchbank = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
|
||||||
object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
|
object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
|
||||||
|
|
||||||
local_roadDebris = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_roadDebris.sqf";
|
local_roadDebris = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_roadDebris.sqf";
|
||||||
|
|
||||||
//Zombies
|
//Zombies
|
||||||
zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
|
zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
|
||||||
zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
|
zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
|
||||||
zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour
|
zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour
|
||||||
wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour
|
wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour
|
||||||
|
|
||||||
pz_attack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf";
|
pz_attack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf";
|
||||||
|
|
||||||
//
|
//
|
||||||
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
|
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
|
||||||
|
|
||||||
@@ -105,24 +105,24 @@ if (!isDedicated) then {
|
|||||||
//player_mineOre = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_mineOre.sqf";
|
//player_mineOre = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_mineOre.sqf";
|
||||||
player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
|
player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
|
||||||
player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf";
|
player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf";
|
||||||
|
|
||||||
player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf";
|
player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf";
|
||||||
player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
|
player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
|
||||||
|
|
||||||
//ui
|
//ui
|
||||||
player_selectSlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_selectSlot.sqf";
|
player_selectSlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_selectSlot.sqf";
|
||||||
player_gearSync = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSync.sqf";
|
player_gearSync = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSync.sqf";
|
||||||
player_gearSet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
|
player_gearSet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
|
||||||
ui_changeDisplay = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
|
ui_changeDisplay = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
|
||||||
ui_gear_sound = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_gear_sound.sqf";
|
ui_gear_sound = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_gear_sound.sqf";
|
||||||
|
|
||||||
//System
|
//System
|
||||||
player_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_monitor.sqf";
|
player_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_monitor.sqf";
|
||||||
player_spawn_1 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
|
player_spawn_1 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
|
||||||
player_spawn_2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
|
player_spawn_2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
|
||||||
onPreloadStarted "dayz_preloadFinished = false;";
|
onPreloadStarted "dayz_preloadFinished = false;";
|
||||||
onPreloadFinished "dayz_preloadFinished = true;";
|
onPreloadFinished "dayz_preloadFinished = true;";
|
||||||
|
|
||||||
// helper functions
|
// helper functions
|
||||||
player_hasTools = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_hasTools.sqf";
|
player_hasTools = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_hasTools.sqf";
|
||||||
player_checkItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkItems.sqf";
|
player_checkItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkItems.sqf";
|
||||||
@@ -137,7 +137,7 @@ if (!isDedicated) then {
|
|||||||
};
|
};
|
||||||
_b
|
_b
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
epoch_totalCurrency = {
|
epoch_totalCurrency = {
|
||||||
// total currency
|
// total currency
|
||||||
@@ -154,7 +154,7 @@ if (!isDedicated) then {
|
|||||||
|
|
||||||
epoch_itemCost = {
|
epoch_itemCost = {
|
||||||
_trade_total = 0;
|
_trade_total = 0;
|
||||||
{
|
{
|
||||||
_part_in_configClass = configFile >> "CfgMagazines" >> (_x select 0);
|
_part_in_configClass = configFile >> "CfgMagazines" >> (_x select 0);
|
||||||
if (isClass (_part_in_configClass)) then {
|
if (isClass (_part_in_configClass)) then {
|
||||||
_part_inWorth = (_part_in_configClass >> "worth");
|
_part_inWorth = (_part_in_configClass >> "worth");
|
||||||
@@ -163,26 +163,26 @@ if (!isDedicated) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
} forEach _this;
|
} forEach _this;
|
||||||
|
|
||||||
diag_log format["DEBUG TRADER ITEMCOST: %1", _this];
|
diag_log format["DEBUG TRADER ITEMCOST: %1", _this];
|
||||||
_trade_total
|
_trade_total
|
||||||
};
|
};
|
||||||
|
|
||||||
epoch_returnChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
|
epoch_returnChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
|
||||||
// usage [["partinclassname",4]] call epoch_returnChange;
|
// usage [["partinclassname",4]] call epoch_returnChange;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
RunTime = 0;
|
RunTime = 0;
|
||||||
TotalRuns = 0;
|
TotalRuns = 0;
|
||||||
|
|
||||||
fnc_dump = {
|
fnc_dump = {
|
||||||
private["_code","_benchmark","_averageRunTime"];
|
private["_code","_benchmark","_averageRunTime"];
|
||||||
_code = _this select 0;
|
_code = _this select 0;
|
||||||
_benchmark = _this select 1;
|
_benchmark = _this select 1;
|
||||||
|
|
||||||
RunTime = RunTime + _benchmark;
|
RunTime = RunTime + _benchmark;
|
||||||
TotalRuns = TotalRuns + 1;
|
TotalRuns = TotalRuns + 1;
|
||||||
_averageRunTime = RunTime/TotalRuns;
|
_averageRunTime = RunTime/TotalRuns;
|
||||||
@@ -201,7 +201,7 @@ if (!isDedicated) then {
|
|||||||
_myExp = _myExp * 0.7;
|
_myExp = _myExp * 0.7;
|
||||||
_myExp
|
_myExp
|
||||||
};
|
};
|
||||||
|
|
||||||
ui_initDisplay = {
|
ui_initDisplay = {
|
||||||
private["_control","_ctrlBleed","_display","_ctrlFracture","_ctrlDogFood","_ctrlDogWater","_ctrlDogWaterBorder", "_ctrlDogFoodBorder"];
|
private["_control","_ctrlBleed","_display","_ctrlFracture","_ctrlDogFood","_ctrlDogWater","_ctrlDogWaterBorder", "_ctrlDogFoodBorder"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
@@ -220,23 +220,23 @@ if (!isDedicated) then {
|
|||||||
_ctrlDogFoodBorder ctrlShow false;
|
_ctrlDogFoodBorder ctrlShow false;
|
||||||
_ctrlDogFood = _display displayCtrl 1701;
|
_ctrlDogFood = _display displayCtrl 1701;
|
||||||
_ctrlDogFood ctrlShow false;
|
_ctrlDogFood ctrlShow false;
|
||||||
|
|
||||||
_ctrlDogWaterBorder = _display displayCtrl 1502;
|
_ctrlDogWaterBorder = _display displayCtrl 1502;
|
||||||
_ctrlDogWaterBorder ctrlShow false;
|
_ctrlDogWaterBorder ctrlShow false;
|
||||||
_ctrlDogWater = _display displayCtrl 1702;
|
_ctrlDogWater = _display displayCtrl 1702;
|
||||||
_ctrlDogWater ctrlShow false
|
_ctrlDogWater ctrlShow false
|
||||||
};
|
};
|
||||||
|
|
||||||
dayz_losCheck = {
|
dayz_losCheck = {
|
||||||
private["_target","_agent","_cantSee"];
|
private["_target","_agent","_cantSee"];
|
||||||
_target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
|
_target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
|
||||||
_agent = _this select 1;
|
_agent = _this select 1;
|
||||||
_cantSee = true;
|
_cantSee = true;
|
||||||
if (!isNull _target) then {
|
if (!isNull _target) then {
|
||||||
|
|
||||||
_tPos = visiblePositionASL _target;
|
_tPos = visiblePositionASL _target;
|
||||||
_zPos = visiblePositionASL _agent;
|
_zPos = visiblePositionASL _agent;
|
||||||
|
|
||||||
_tPos set [2,(_tPos select 2)+1];
|
_tPos set [2,(_tPos select 2)+1];
|
||||||
_zPos set [2,(_zPos select 2)+1];
|
_zPos set [2,(_zPos select 2)+1];
|
||||||
|
|
||||||
@@ -249,21 +249,21 @@ if (!isDedicated) then {
|
|||||||
};
|
};
|
||||||
_cantSee
|
_cantSee
|
||||||
};
|
};
|
||||||
|
|
||||||
eh_zombieInit = {
|
eh_zombieInit = {
|
||||||
private["_unit","_pos"];
|
private["_unit","_pos"];
|
||||||
//_unit = _this select 0;
|
//_unit = _this select 0;
|
||||||
//_pos = getPosATL _unit;
|
//_pos = getPosATL _unit;
|
||||||
//_id = [_pos,_unit] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
//_id = [_pos,_unit] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
||||||
};
|
};
|
||||||
|
|
||||||
dayz_equipCheck = {
|
dayz_equipCheck = {
|
||||||
private ["_empty", "_needed","_diff","_success"];
|
private ["_empty", "_needed","_diff","_success"];
|
||||||
_config = _this;
|
_config = _this;
|
||||||
_empty = [player] call BIS_fnc_invSlotsEmpty;
|
_empty = [player] call BIS_fnc_invSlotsEmpty;
|
||||||
_needed = [_config] call BIS_fnc_invSlotType;
|
_needed = [_config] call BIS_fnc_invSlotType;
|
||||||
_diff = [_empty,_needed] call BIS_fnc_vectorDiff;
|
_diff = [_empty,_needed] call BIS_fnc_vectorDiff;
|
||||||
|
|
||||||
_success = true;
|
_success = true;
|
||||||
{
|
{
|
||||||
if (_x > 0) then {_success = false};
|
if (_x > 0) then {_success = false};
|
||||||
@@ -282,9 +282,9 @@ if (!isDedicated) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
player_tagFriendlyMsg = {
|
player_tagFriendlyMsg = {
|
||||||
if(player == (_this select 0)) then {
|
if(player == (_this select 0)) then {
|
||||||
cutText[(localize "str_epoch_player_2"),"PLAIN DOWN"];
|
cutText[(localize "str_epoch_player_2"),"PLAIN DOWN"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
player_serverModelChange = {
|
player_serverModelChange = {
|
||||||
@@ -295,7 +295,7 @@ if (!isDedicated) then {
|
|||||||
_model call player_switchModel;
|
_model call player_switchModel;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
player_guiControlFlash = {
|
player_guiControlFlash = {
|
||||||
private["_control"];
|
private["_control"];
|
||||||
_control = _this;
|
_control = _this;
|
||||||
@@ -305,7 +305,7 @@ if (!isDedicated) then {
|
|||||||
_control ctrlShow true;
|
_control ctrlShow true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
gear_ui_offMenu = {
|
gear_ui_offMenu = {
|
||||||
private["_control","_parent","_menu"];
|
private["_control","_parent","_menu"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
@@ -323,10 +323,10 @@ if (!isDedicated) then {
|
|||||||
_control ctrlCommit 0;
|
_control ctrlCommit 0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
dze_surrender_off = {
|
dze_surrender_off = {
|
||||||
player setVariable ["DZE_Surrendered", false, true];
|
player setVariable ["DZE_Surrendered", false, true];
|
||||||
DZE_Surrender = false;
|
DZE_Surrender = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
gear_ui_init = {
|
gear_ui_init = {
|
||||||
@@ -344,7 +344,7 @@ if (!isDedicated) then {
|
|||||||
_control ctrlShow false;
|
_control ctrlShow false;
|
||||||
_control ctrlCommit 0;
|
_control ctrlCommit 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
dayz_eyeDir = {
|
dayz_eyeDir = {
|
||||||
private["_vval","_vdir"];
|
private["_vval","_vdir"];
|
||||||
_vval = (eyeDirection _this);
|
_vval = (eyeDirection _this);
|
||||||
@@ -389,7 +389,7 @@ if (!isDedicated) then {
|
|||||||
};
|
};
|
||||||
_notClosest
|
_notClosest
|
||||||
};
|
};
|
||||||
|
|
||||||
// trader menu code
|
// trader menu code
|
||||||
if (DZE_ConfigTrader) then {
|
if (DZE_ConfigTrader) then {
|
||||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuConfig.sqf";
|
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuConfig.sqf";
|
||||||
@@ -419,8 +419,8 @@ if (!isDedicated) then {
|
|||||||
while { _timeOut < 12000 } do {
|
while { _timeOut < 12000 } do {
|
||||||
if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
|
if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
|
||||||
if (!isNil "_display") then {
|
if (!isNil "_display") then {
|
||||||
if ( isNull _display ) then {
|
if ( isNull _display ) then {
|
||||||
waitUntil { !dialog; };
|
waitUntil { !dialog; };
|
||||||
startLoadingScreen ["","RscDisplayLoadCustom"];
|
startLoadingScreen ["","RscDisplayLoadCustom"];
|
||||||
_display = uiNameSpace getVariable "BIS_loadingScreen";
|
_display = uiNameSpace getVariable "BIS_loadingScreen";
|
||||||
_control1 = _display displayctrl 8400;
|
_control1 = _display displayctrl 8400;
|
||||||
@@ -458,13 +458,13 @@ if (!isDedicated) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
dayz_originalPlayer = player;
|
dayz_originalPlayer = player;
|
||||||
|
|
||||||
progressLoadingScreen 0.8;
|
progressLoadingScreen 0.8;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Both
|
//Both
|
||||||
BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_selectRandom.sqf";
|
BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_selectRandom.sqf";
|
||||||
BIS_fnc_vectorAdd = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_vectorAdd.sqf";
|
BIS_fnc_vectorAdd = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_vectorAdd.sqf";
|
||||||
BIS_fnc_halo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_halo.sqf";
|
BIS_fnc_halo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_halo.sqf";
|
||||||
BIS_fnc_findNestedElement = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_findNestedElement.sqf";
|
BIS_fnc_findNestedElement = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_findNestedElement.sqf";
|
||||||
BIS_fnc_param = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_param.sqf";
|
BIS_fnc_param = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_param.sqf";
|
||||||
@@ -486,7 +486,7 @@ if (!isDedicated) then {
|
|||||||
vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
|
vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
|
||||||
vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
|
vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
|
||||||
//fnc_vehicleEventHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf"; //Initialize vehicle
|
//fnc_vehicleEventHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf"; //Initialize vehicle
|
||||||
fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
|
fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
|
||||||
fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
|
fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||||
fnc_isInsideBuilding2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding2.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
|
fnc_isInsideBuilding2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding2.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||||
fnc_isInsideBuilding3 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding3.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
|
fnc_isInsideBuilding3 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding3.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||||
@@ -510,14 +510,13 @@ if (!isDedicated) then {
|
|||||||
world_isDay = {if ((daytime < (24 - dayz_sunRise)) and (daytime > dayz_sunRise)) then {true} else {false}};
|
world_isDay = {if ((daytime < (24 - dayz_sunRise)) and (daytime > dayz_sunRise)) then {true} else {false}};
|
||||||
player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
|
player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
|
||||||
spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
|
spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
|
||||||
spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf";
|
|
||||||
// player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
|
// player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
|
||||||
|
|
||||||
dayz_HungerThirst = {
|
dayz_HungerThirst = {
|
||||||
dayz_hunger = dayz_hunger + (_this select 0);
|
dayz_hunger = dayz_hunger + (_this select 0);
|
||||||
dayz_thirst = dayz_thirst + (_this select 1);
|
dayz_thirst = dayz_thirst + (_this select 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
// better item counting by maca134 - https://github.com/vbawol/DayZ-Epoch/issues/916
|
// better item counting by maca134 - https://github.com/vbawol/DayZ-Epoch/issues/916
|
||||||
MC_item_spaces = {
|
MC_item_spaces = {
|
||||||
private ["_unit", "_item", "_slotsEmpty", "_slotsItem", "_slotsAfterAdd", "_c", "_space"];
|
private ["_unit", "_item", "_slotsEmpty", "_slotsItem", "_slotsAfterAdd", "_c", "_space"];
|
||||||
@@ -582,7 +581,7 @@ if (!isDedicated) then {
|
|||||||
];
|
];
|
||||||
_medical
|
_medical
|
||||||
};
|
};
|
||||||
|
|
||||||
//Server Only
|
//Server Only
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
|
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
|
||||||
|
|||||||
@@ -28,6 +28,13 @@
|
|||||||
/* PVS/PVC - Skaronator */
|
/* PVS/PVC - Skaronator */
|
||||||
"PVCDZE_vehSH" addPublicVariableEventHandler {(_this select 1) call vehicle_handleDamage}; // set damage to vehicle part
|
"PVCDZE_vehSH" addPublicVariableEventHandler {(_this select 1) call vehicle_handleDamage}; // set damage to vehicle part
|
||||||
|
|
||||||
|
"PVDZ_Server_Simulation" addPublicVariableEventHandler {
|
||||||
|
_agent = ((_this select 1) select 0);
|
||||||
|
_control = ((_this select 1) select 1);
|
||||||
|
|
||||||
|
_agent enableSimulation _control;
|
||||||
|
};
|
||||||
|
|
||||||
//Server only
|
//Server only
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
/* PVS/PVC - Skaronator */
|
/* PVS/PVC - Skaronator */
|
||||||
@@ -54,8 +61,8 @@ if (isServer) then {
|
|||||||
"PVDZE_obj_Swap" addPublicVariableEventHandler {(_this select 1) spawn server_swapObject};
|
"PVDZE_obj_Swap" addPublicVariableEventHandler {(_this select 1) spawn server_swapObject};
|
||||||
// disable zombies server side
|
// disable zombies server side
|
||||||
"PVDZE_zed_Spawn" addPublicVariableEventHandler {(_this select 1) spawn server_handleZedSpawn};
|
"PVDZE_zed_Spawn" addPublicVariableEventHandler {(_this select 1) spawn server_handleZedSpawn};
|
||||||
|
|
||||||
// Dayz epoch custom
|
// Dayz epoch custom
|
||||||
"PVDZE_veh_Publish" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh};
|
"PVDZE_veh_Publish" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh};
|
||||||
"PVDZE_veh_Publish2" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh2};
|
"PVDZE_veh_Publish2" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh2};
|
||||||
"PVDZE_veh_Upgrade" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh3};
|
"PVDZE_veh_Upgrade" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh3};
|
||||||
@@ -76,9 +83,9 @@ if (!isDedicated) then {
|
|||||||
"PVDZE_plr_Morph" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer};
|
"PVDZE_plr_Morph" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer};
|
||||||
"PVDZE_obj_Fire" addPublicVariableEventHandler {nulexp=(_this select 1) spawn BIS_Effects_Burn};
|
"PVDZE_obj_Fire" addPublicVariableEventHandler {nulexp=(_this select 1) spawn BIS_Effects_Burn};
|
||||||
"PVDZE_plr_FriendRQ" addPublicVariableEventHandler {(_this select 1) call player_tagFriendlyMsg};
|
"PVDZE_plr_FriendRQ" addPublicVariableEventHandler {(_this select 1) call player_tagFriendlyMsg};
|
||||||
|
|
||||||
// "PVDZE_obj_Debris" addPublicVariableEventHandler {(_this select 1) call local_roadDebris};
|
// "PVDZE_obj_Debris" addPublicVariableEventHandler {(_this select 1) call local_roadDebris};
|
||||||
|
|
||||||
"norrnRaDrag" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"};
|
"norrnRaDrag" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"};
|
||||||
"norrnRnoAnim" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\noAnim.sqf"};
|
"norrnRnoAnim" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\noAnim.sqf"};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -429,6 +429,12 @@ DAYZ_agentnumber = 0;
|
|||||||
dayz_animalDistance = 800;
|
dayz_animalDistance = 800;
|
||||||
dayz_zSpawnDistance = 1000;
|
dayz_zSpawnDistance = 1000;
|
||||||
|
|
||||||
|
dayz_maxMaxModels = 80; // max quantity of Man models (player or Z, dead or alive) around players. Below this limit we can spawn Z // max quantity of loot piles around players. Below this limit we can spawn some loot
|
||||||
|
dayz_spawnArea = 200; // radius around player where we can spawn loot & Z
|
||||||
|
dayz_cantseeDist = 150; // distance from which we can spawn a Z in front of any player without ray-tracing and angle checks
|
||||||
|
dayz_cantseefov = 70; // half player field-of-view. Visible Z won't be spawned in front of any near players
|
||||||
|
dayz_canDelete = 300; // Z, further than this distance from its "owner", will be deleted
|
||||||
|
|
||||||
if(isNil "dayz_maxAnimals") then {
|
if(isNil "dayz_maxAnimals") then {
|
||||||
dayz_maxAnimals = 5;
|
dayz_maxAnimals = 5;
|
||||||
};
|
};
|
||||||
@@ -656,20 +662,34 @@ if(!isDedicated) then {
|
|||||||
dayz_areaAffect = 2.5;
|
dayz_areaAffect = 2.5;
|
||||||
dayz_heartBeat = false;
|
dayz_heartBeat = false;
|
||||||
dayzClickTime = 0;
|
dayzClickTime = 0;
|
||||||
|
//Current local
|
||||||
|
dayz_spawnZombies = 0;
|
||||||
|
dayz_swarmSpawnZombies = 0;
|
||||||
|
//Max local
|
||||||
|
dayz_maxLocalZombies = 30; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
|
||||||
|
//Current NearBy
|
||||||
|
dayz_CurrentNearByZombies = 0;
|
||||||
|
//Max NearBy
|
||||||
|
dayz_maxNearByZombies = 60; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
|
||||||
|
//Current total
|
||||||
|
dayz_currentGlobalZombies = 0;
|
||||||
|
//Max global zeds.
|
||||||
|
dayz_maxGlobalZeds = 3000;
|
||||||
dayz_spawnDelay = 120;
|
dayz_spawnDelay = 120;
|
||||||
dayz_spawnWait = -120;
|
dayz_spawnWait = -120;
|
||||||
dayz_lootDelay = 3;
|
dayz_lootDelay = 3;
|
||||||
dayz_lootWait = -300;
|
dayz_lootWait = -300;
|
||||||
dayz_spawnZombies = 0;
|
|
||||||
//used to count global zeds around players
|
//used to count global zeds around players
|
||||||
dayz_CurrentZombies = 0;
|
dayz_CurrentZombies = 0;
|
||||||
//Used to limit overall zed counts
|
//Used to limit overall zed counts
|
||||||
|
dayz_tickTimeOffset = 0;
|
||||||
|
dayz_currentWeaponHolders = 0;
|
||||||
|
dayz_maxMaxWeaponHolders = 80;
|
||||||
dayz_maxCurrentZeds = 0;
|
dayz_maxCurrentZeds = 0;
|
||||||
dayz_inVehicle = false;
|
dayz_inVehicle = false;
|
||||||
dayz_Magazines = [];
|
dayz_Magazines = [];
|
||||||
dayzGearSave = false;
|
dayzGearSave = false;
|
||||||
dayz_unsaved = false;
|
dayz_unsaved = false;
|
||||||
DZE_ActionInProgress = false;
|
|
||||||
dayz_scaleLight = 0;
|
dayz_scaleLight = 0;
|
||||||
dayzDebug = false;
|
dayzDebug = false;
|
||||||
dayzState = -1;
|
dayzState = -1;
|
||||||
@@ -678,6 +698,8 @@ if(!isDedicated) then {
|
|||||||
// dayzDebug = true;
|
// dayzDebug = true;
|
||||||
//};
|
//};
|
||||||
|
|
||||||
|
DZE_ActionInProgress = false;
|
||||||
|
|
||||||
// DayZ Epoch Client only variables
|
// DayZ Epoch Client only variables
|
||||||
if(isNil "DZE_AllowForceSave") then {
|
if(isNil "DZE_AllowForceSave") then {
|
||||||
DZE_AllowForceSave = false;
|
DZE_AllowForceSave = false;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*%FSM<COMPILE "D:\Programme\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Player Monitor">*/
|
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Player Monitor">*/
|
||||||
/*%FSM<HEAD>*/
|
/*%FSM<HEAD>*/
|
||||||
/*
|
/*
|
||||||
item0[] = {"init",0,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"};
|
item0[] = {"init",0,4346,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"};
|
||||||
item1[] = {"isServer",4,218,50.000000,-350.000000,150.000000,-300.000000,0.000000,"isServer"};
|
item1[] = {"isServer",4,218,50.000000,-350.000000,150.000000,-300.000000,0.000000,"isServer"};
|
||||||
item2[] = {"wait",2,250,50.000000,-275.000000,150.000000,-225.000000,0.000000,"wait"};
|
item2[] = {"wait",2,250,50.000000,-275.000000,150.000000,-225.000000,0.000000,"wait"};
|
||||||
item3[] = {"Allow_Conn",4,218,50.000000,-200.000000,150.000000,-150.000000,0.000000,"Allow" \n "Conn"};
|
item3[] = {"Allow_Conn",4,218,50.000000,-200.000000,150.000000,-150.000000,0.000000,"Allow" \n "Conn"};
|
||||||
@@ -47,7 +47,7 @@ item42[] = {"New_Character",4,218,-325.000000,400.000000,-225.000000,450.000000,
|
|||||||
item43[] = {"Gender_Selection",2,250,-575.000000,400.000000,-475.000000,450.000000,0.000000,"Gender Selection" \n "Dialog"};
|
item43[] = {"Gender_Selection",2,250,-575.000000,400.000000,-475.000000,450.000000,0.000000,"Gender Selection" \n "Dialog"};
|
||||||
item44[] = {"Selected",4,218,-575.000000,475.000000,-475.000000,525.000000,0.000000,"Selected"};
|
item44[] = {"Selected",4,218,-575.000000,475.000000,-475.000000,525.000000,0.000000,"Selected"};
|
||||||
item45[] = {"Process",2,250,-575.000000,550.000000,-475.000000,600.000000,0.000000,"Process"};
|
item45[] = {"Process",2,250,-575.000000,550.000000,-475.000000,600.000000,0.000000,"Process"};
|
||||||
item46[] = {"no_PlayerID",4,4314,50.000000,-100.000000,150.000000,-50.000000,2.000000,"no PlayerID"};
|
item46[] = {"no_PlayerID",4,218,50.000000,-100.000000,150.000000,-50.000000,2.000000,"no PlayerID"};
|
||||||
item47[] = {"ERROR__No_Player_1",2,250,175.000000,-100.000000,275.000000,-50.000000,0.000000,"ERROR:" \n "No PlayerID"};
|
item47[] = {"ERROR__No_Player_1",2,250,175.000000,-100.000000,275.000000,-50.000000,0.000000,"ERROR:" \n "No PlayerID"};
|
||||||
item48[] = {"Too_Long",4,218,300.000000,-100.000000,400.000000,-50.000000,0.000000,"Too" \n "Long"};
|
item48[] = {"Too_Long",4,218,300.000000,-100.000000,400.000000,-50.000000,0.000000,"Too" \n "Long"};
|
||||||
item49[] = {"Stream",2,250,-75.000000,900.000000,25.000000,950.000000,0.000000,"Stream"};
|
item49[] = {"Stream",2,250,-75.000000,900.000000,25.000000,950.000000,0.000000,"Stream"};
|
||||||
@@ -169,8 +169,8 @@ link85[] = {75,57};
|
|||||||
link86[] = {76,78};
|
link86[] = {76,78};
|
||||||
link87[] = {77,76};
|
link87[] = {77,76};
|
||||||
link88[] = {78,57};
|
link88[] = {78,57};
|
||||||
globals[] = {25.000000,1,0,0,0,640,480,1,143,6316128,1,-400.773193,754.994873,294.455383,-631.582458,1137,911,1};
|
globals[] = {25.000000,1,0,0,0,640,480,1,143,6316128,1,-578.392273,577.375793,454.378448,-471.659088,1137,911,1};
|
||||||
window[] = {2,-1,-1,-1,-1,958,200,1478,200,3,1155};
|
window[] = {2,0,0,-1,-1,817,340,1618,59,3,1155};
|
||||||
*//*%FSM</HEAD>*/
|
*//*%FSM</HEAD>*/
|
||||||
class FSM
|
class FSM
|
||||||
{
|
{
|
||||||
@@ -182,12 +182,11 @@ class FSM
|
|||||||
{
|
{
|
||||||
name = "init";
|
name = "init";
|
||||||
init = /*%FSM<STATEINIT""">*/"dayz_versionNo = getText(configFile >> ""CfgMods"" >> ""DayZ"" >> ""version"");" \n
|
init = /*%FSM<STATEINIT""">*/"dayz_versionNo = getText(configFile >> ""CfgMods"" >> ""DayZ"" >> ""version"");" \n
|
||||||
"diag_log (""DAYZ: CLIENT IS RUNNING DAYZ_CODE "" + str(dayz_versionNo));" \n
|
|
||||||
"" \n
|
|
||||||
"_AuthAttempt = 0;" \n
|
"_AuthAttempt = 0;" \n
|
||||||
"" \n
|
"" \n
|
||||||
"0 fadeSound 0;" \n
|
"0 fadeSound 0;" \n
|
||||||
"//player setPosATL [-2148,6655,0];" \n
|
"//player setPosATL [-2148,6655,0];" \n
|
||||||
|
"//DayZ Mod 1.8.1;" \n
|
||||||
"" \n
|
"" \n
|
||||||
"progressLoadingScreen 0.1;" \n
|
"progressLoadingScreen 0.1;" \n
|
||||||
"0 cutText ["""",""BLACK""];" \n
|
"0 cutText ["""",""BLACK""];" \n
|
||||||
@@ -195,10 +194,13 @@ class FSM
|
|||||||
"_timeStart = diag_tickTime;" \n
|
"_timeStart = diag_tickTime;" \n
|
||||||
"_readytoAuth = false;" \n
|
"_readytoAuth = false;" \n
|
||||||
"_startCheck = 0;" \n
|
"_startCheck = 0;" \n
|
||||||
"//player enableSimulation false;" \n
|
"if(isNil ""DZEdebug"") then { DZEdebug = 1; };" \n
|
||||||
"if(isNil ""DZEdebug"") then { DZEdebug = false; };" \n
|
|
||||||
"_debug = DZEdebug;" \n
|
"_debug = DZEdebug;" \n
|
||||||
"" \n
|
"" \n
|
||||||
|
"if (_debug == 1) then {" \n
|
||||||
|
"diag_log (""DAYZ: CLIENT IS RUNNING DAYZ_CODE "" + str(dayz_versionNo));" \n
|
||||||
|
"};" \n
|
||||||
|
"" \n
|
||||||
""/*%FSM</STATEINIT""">*/;
|
""/*%FSM</STATEINIT""">*/;
|
||||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||||
class Links
|
class Links
|
||||||
|
|||||||
Reference in New Issue
Block a user