1.0.1.6 Developer Build

This commit is contained in:
[VB]AWOL
2013-07-30 21:52:28 -05:00
parent e333adff4f
commit b2b79305f7
42 changed files with 791 additions and 438 deletions

View File

@@ -1090,7 +1090,6 @@ class CfgMagazines {
script = "spawn player_build;"; script = "spawn player_build;";
require[] = {"ItemToolbox"}; require[] = {"ItemToolbox"};
create = "WorkBench_DZ"; create = "WorkBench_DZ";
needNearby[] = {"none"};
}; };
}; };
}; };
@@ -1513,7 +1512,6 @@ class CfgMagazines {
script = "spawn player_build;"; script = "spawn player_build;";
require[] = {"ItemToolbox"}; require[] = {"ItemToolbox"};
create = "Generator_DZ"; create = "Generator_DZ";
needNearby[] = {"dayz_fuelpumparray"};
}; };
}; };
}; };
@@ -1534,7 +1532,6 @@ class CfgMagazines {
script = "spawn player_build;"; script = "spawn player_build;";
require[] = {"ItemToolbox"}; require[] = {"ItemToolbox"};
create = "FuelPump_DZ"; create = "FuelPump_DZ";
needNearby[] = {"dayz_fuelsources"};
}; };
}; };
}; };
@@ -1618,7 +1615,7 @@ class CfgMagazines {
neednearby[] = {}; neednearby[] = {};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"stick_fence_kit",1}}; output[] = {{"stick_fence_kit",1}};
input[] = {{"bulk_empty",1},{"PartWoodPile",6}}; input[] = {{"PartWoodPile",6}};
}; };
@@ -1705,24 +1702,6 @@ class CfgMagazines {
}; };
}; };
class PartWoodShed: CA_Magazine
{
scope = 2;
count = 1;
type = 256;
displayName = "Wooden Shack";
model = "\z\addons\dayz_epoch\models\supply_crate.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa";
descriptionShort = "Wooden Shack: A crafted object that holds some items/weapons/backpacks.";
class ItemActions {
class Build {
text = "Build Wood Shack";
script = "spawn player_build;";
require[] = {"ItemToolbox"};
create = "WoodShack_DZ";
};
};
};
class PartVRotor: CA_Magazine class PartVRotor: CA_Magazine
{ {
scope = 2; scope = 2;
@@ -1771,7 +1750,7 @@ class CfgMagazines {
neednearby[] = {}; neednearby[] = {};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"ItemCanvas",1}}; output[] = {{"ItemCanvas",1}};
input[] = {{"SkinBase",4}}; input[] = {{"SkinBase",2}};
}; };
class Crafting1 class Crafting1
{ {
@@ -1780,7 +1759,7 @@ class CfgMagazines {
neednearby[] = {}; neednearby[] = {};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"ItemBandage",2}}; output[] = {{"ItemBandage",2}};
input[] = {{"SkinBase",1}}; input[] = {{"SkinBase",1},{"ItemTrashToiletpaper",1}};
}; };
}; };
}; };
@@ -2062,7 +2041,7 @@ class CfgMagazines {
neednearby[] = {"workshop"}; neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"desert_net_kit",1}}; output[] = {{"desert_net_kit",1}};
input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; input[] = {{"bulk_empty",1},{"ItemTent",2},{"ItemPole",2}};
}; };
class Crafting1 class Crafting1
{ {
@@ -2071,7 +2050,7 @@ class CfgMagazines {
neednearby[] = {"workshop"}; neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"forest_net_kit",1}}; output[] = {{"forest_net_kit",1}};
input[] = {{"ItemTent",4},{"ItemPole",4}}; input[] = {{"bulk_empty",1},{"ItemTent",2},{"ItemPole",2}};
}; };
}; };
}; };
@@ -2097,7 +2076,7 @@ class CfgMagazines {
neednearby[] = {"workshop"}; neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"desert_net_kit",1}}; output[] = {{"desert_net_kit",1}};
input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; input[] = {{"bulk_empty",1},{"ItemTent",2},{"ItemPole",2}};
}; };
class Crafting1 class Crafting1
{ {
@@ -2106,7 +2085,7 @@ class CfgMagazines {
neednearby[] = {"workshop"}; neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"forest_net_kit",1}}; output[] = {{"forest_net_kit",1}};
input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; input[] = {{"bulk_empty",1},{"ItemTent",2},{"ItemPole",2}};
}; };
}; };
}; };
@@ -2131,7 +2110,7 @@ class CfgMagazines {
neednearby[] = {"workshop"}; neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"desert_net_kit",1}}; output[] = {{"desert_net_kit",1}};
input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; input[] = {{"bulk_empty",1},{"ItemTent",2},{"ItemPole",2}};
}; };
class Crafting1 class Crafting1
{ {
@@ -2140,7 +2119,7 @@ class CfgMagazines {
neednearby[] = {"workshop"}; neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemKnife"}; requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"forest_net_kit",1}}; output[] = {{"forest_net_kit",1}};
input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; input[] = {{"bulk_empty",1},{"ItemTent",2},{"ItemPole",2}};
}; };
}; };
}; };
@@ -2174,7 +2153,7 @@ class CfgMagazines {
{ {
text = "Craft Sandbag Nest"; text = "Craft Sandbag Nest";
script = "spawn player_craftItem1;"; script = "spawn player_craftItem1;";
neednearby[] = {}; neednearby[] = {"workshop"};
requiretools[] = {"ItemEtool","ItemToolbox"}; requiretools[] = {"ItemEtool","ItemToolbox"};
output[] = {{"sandbag_nest_kit",1}}; output[] = {{"sandbag_nest_kit",1}};
input[] = {{"bulk_empty",1},{"ItemSandbag",4},{"PartWoodPlywood",2},{"PartWoodLumber",4}}; input[] = {{"bulk_empty",1},{"ItemSandbag",4},{"PartWoodPlywood",2},{"PartWoodLumber",4}};
@@ -2200,7 +2179,7 @@ class CfgMagazines {
count = 1; count = 1;
type = 256; type = 256;
displayName = "H-barrier cube"; displayName = "H-barrier cube";
model = "\dayz_equip\models\sandbags.p3d"; model = "\dayz_equip\models\sandbags.p3d"; // TODO model
picture = "\dayz_equip\textures\equip_sandbag_ca.paa"; picture = "\dayz_equip\textures\equip_sandbag_ca.paa";
descriptionShort = "Hesco berrier: A buildable object that is used for fortification purposes."; descriptionShort = "Hesco berrier: A buildable object that is used for fortification purposes.";
@@ -2211,6 +2190,35 @@ class CfgMagazines {
require[] = {"ItemEtool"}; require[] = {"ItemEtool"};
create = "Land_HBarrier1_DZ"; create = "Land_HBarrier1_DZ";
}; };
class Crafting
{
text = "Craft Triple H-barrier";
script = "spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemEtool","ItemToolbox"};
output[] = {{"ItemSandbagExLarge",1}};
input[] = {{"ItemSandbagLarge",3}};
};
};
};
class ItemSandbagExLarge : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = "3 x H-barrier cube";
model = "\dayz_equip\models\sandbags.p3d"; // TODO model
picture = "\dayz_equip\textures\equip_sandbag_ca.paa";
descriptionShort = "Hesco berrier: A buildable object that is used for fortification purposes.";
class ItemActions {
class Build {
text = "Build Triple H-barrier";
script = "spawn player_build;";
require[] = {"ItemEtool"};
create = "Land_HBarrier3_DZ";
};
}; };
}; };

View File

@@ -58,8 +58,6 @@ _cookedmeat = meatcooked;
if (_finished) then { if (_finished) then {
_removed = _removed + ([player,_meat,_qty] call BIS_fnc_invRemove); _removed = _removed + ([player,_meat,_qty] call BIS_fnc_invRemove);
// Add only number of items removed
for "_x" from 1 to _removed do { for "_x" from 1 to _removed do {
player addMagazine _meatcooked; player addMagazine _meatcooked;
}; };

View File

@@ -27,8 +27,9 @@ switch (_type) do {
}; };
case 1: { case 1: {
player removeMagazine "ItemWaterbottle"; if(([player,"ItemWaterbottle"] call BIS_fnc_invRemove) == 1) then {
player addMagazine "ItemWaterbottleUnfilled"; player addMagazine "ItemWaterbottleUnfilled";
};
_handle setFSMVariable ["_thirst",0]; _handle setFSMVariable ["_thirst",0];
player removeAction s_player_waterdog; player removeAction s_player_waterdog;
s_player_waterdog = -1; s_player_waterdog = -1;

View File

@@ -54,7 +54,6 @@ if (_finished) then {
if(!(_vehicle getVariable ["GeneratorFilled", false]) and ("ItemJerrycan" in magazines player)) then { if(!(_vehicle getVariable ["GeneratorFilled", false]) and ("ItemJerrycan" in magazines player)) then {
if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then { if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then {
player addMagazine "ItemJerrycanEmpty"; player addMagazine "ItemJerrycanEmpty";
// mark as once filled // mark as once filled

View File

@@ -3,6 +3,9 @@ private ["_item","_hasKnife","_hasKnifeBlunt","_hasHarvested","_qty","_text","_s
if(TradeInprogress) exitWith { cutText ["Gutting animal already in progress." , "PLAIN DOWN"]; }; if(TradeInprogress) exitWith { cutText ["Gutting animal already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true; TradeInprogress = true;
player removeAction s_player_butcher;
s_player_butcher = 1;
_item = _this select 3; _item = _this select 3;
_hasKnife = "ItemKnife" in items player; _hasKnife = "ItemKnife" in items player;
_hasKnifeBlunt = "ItemKnifeBlunt" in items player; _hasKnifeBlunt = "ItemKnifeBlunt" in items player;
@@ -10,9 +13,6 @@ _type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false]; _hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type; _config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = 1;
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then { if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type //Get Animal Type
_isListed = isClass (_config); _isListed = isClass (_config);
@@ -73,15 +73,10 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
if (_hasKnifeBlunt) then { _qty = round(_qty / 2); }; if (_hasKnifeBlunt) then { _qty = round(_qty / 2); };
_array = [_item,_qty]; dayzGutBody = [_item,_qty];
dayzGutBody spawn local_gutObject;
if (local _item) then { publicVariable "dayzGutBody";
_array spawn local_gutObject;
} else {
dayzGutBody = _array;
publicVariable "dayzGutBody";
};
_string = format[localize "str_success_gutted_animal",_text,_qty]; _string = format[localize "str_success_gutted_animal",_text,_qty];
cutText [_string, "PLAIN DOWN"]; cutText [_string, "PLAIN DOWN"];
}; };

View File

@@ -3,6 +3,9 @@ private ["_hasKnife","_qty","_item","_text","_string","_type","_started","_finis
if(TradeInprogress) exitWith { cutText ["Gutting zombie already in progress." , "PLAIN DOWN"]; }; if(TradeInprogress) exitWith { cutText ["Gutting zombie already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true; TradeInprogress = true;
player removeAction s_player_butcher;
s_player_butcher = 1;
_item = _this select 3; _item = _this select 3;
_hasKnife = "ItemKnife" in items player; _hasKnife = "ItemKnife" in items player;
_hasKnifeBlunt = "ItemKnifeBlunt" in items player; _hasKnifeBlunt = "ItemKnifeBlunt" in items player;
@@ -10,9 +13,6 @@ _type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false]; _hasHarvested = _item getVariable["meatHarvested",false];
//_config = configFile >> "CfgSurvival" >> "Meat" >> _type; //_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = 1;
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then { if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type //Get Animal Type
//_loop = true; //_loop = true;
@@ -69,14 +69,9 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
_qty = 1; _qty = 1;
_array = [_item,_qty]; dayzGutBody = [_item,_qty];
dayzGutBody spawn local_gutObjectZ;
if (local _item) then { publicVariable "dayzGutBodyZ";
_array spawn local_gutObjectZ;
} else {
dayzGutBody = _array;
publicVariable "dayzGutBodyZ";
};
// Reduce humanity for gutting zeds // Reduce humanity for gutting zeds
_humanity = player getVariable["humanity",0]; _humanity = player getVariable["humanity",0];

View File

@@ -3,12 +3,12 @@ private ["_array","_type","_classname","_holder","_config","_isOk","_muzzles","_
// Exit if player zombie // Exit if player zombie
if(player isKindOf "PZombie_VB") exitWith {}; if(player isKindOf "PZombie_VB") exitWith {};
if(TradeInprogress) exitWith { cutText ["Take item already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
// Test cannot lock while another player is nearby // Test cannot lock while another player is nearby
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1; // _playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1;
if(_playerNear) exitWith { TradeInprogress = false; cutText ["Cannot take item while another player is nearby." , "PLAIN DOWN"]; }; // if(_playerNear) exitWith {cutText ["Cannot take item while another player is nearby." , "PLAIN DOWN"]; };
if (!DZE_CanPickup) exitWith { cutText ["Take item already in progress." , "PLAIN DOWN"]; };
DZE_CanPickup = false;
_array = _this select 3; _array = _this select 3;
_type = _array select 0; _type = _array select 0;
@@ -29,9 +29,10 @@ if (_claimedBy == "0" or !_playerNear) then {
_holder setVariable["claimed",_playerID,true]; _holder setVariable["claimed",_playerID,true];
}; };
if(_classname isKindOf "TrapBear") exitwith {TradeInprogress = false; deleteVehicle _holder;}; if(_classname isKindOf "TrapBear") exitwith {DZE_CanPickup = true; deleteVehicle _holder;};
player playActionNow "PutDown"; player playActionNow "PutDown";
if (_classname == "MeleeCrowbar") then { if (_classname == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing'; player addMagazine 'crowbar_swing';
}; };
@@ -45,26 +46,18 @@ if (_classname == "MeleeFishingPole") then {
player addMagazine 'Fishing_Swing'; player addMagazine 'Fishing_Swing';
}; };
_broken = false;
if(_classname == "WoodenArrow") then {
if (20 > random 100) then {
_broken = true;
};
};
if (_broken) exitWith { deleteVehicle _holder; TradeInprogress = false; cutText [localize "str_broken_arrow", "PLAIN DOWN"] };
sleep 1; sleep 1;
_claimedBy = _holder getVariable["claimed","0"]; _claimedBy = _holder getVariable["claimed","0"];
if (_claimedBy != _playerID) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_beinglooted"),_text] , "PLAIN DOWN"]}; if (_claimedBy != _playerID) exitWith {sleep 1; DZE_CanPickup = true; cutText [format[(localize "str_player_beinglooted"),_text] , "PLAIN DOWN"]};
if(_classname isKindOf "Bag_Base_EP1") then { if(_classname isKindOf "Bag_Base_EP1") then {
diag_log("Picked up a bag: " + _classname); diag_log("Picked up a bag: " + _classname);
}; };
// test to see if item still exists just before adding and removing // test to see if item still exists just before adding and removing
if(isNull _holder) exitWith { TradeInprogress = false; }; if(isNull _holder) exitWith { sleep 1; DZE_CanPickup = true; };
_obj = nearestObjects [(getPosATL player), [(typeOf _holder)], 5]; _obj = nearestObjects [(getPosATL player), [(typeOf _holder)], 5];
_qty = count _obj; _qty = count _obj;
@@ -105,4 +98,6 @@ if(_qty >= 1) then {
}; };
}; };
}; };
TradeInprogress = false;
sleep 1;
DZE_CanPickup = true;

View File

@@ -1,3 +1,7 @@
/*
DayZ Base Building
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_isBuilding","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_buildings","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole"]; private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_isBuilding","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_buildings","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole"];
if(TradeInprogress) exitWith { cutText ["Building already in progress." , "PLAIN DOWN"]; }; if(TradeInprogress) exitWith { cutText ["Building already in progress." , "PLAIN DOWN"]; };
@@ -18,14 +22,11 @@ if(player getVariable["combattimeout", 0] >= time) exitWith {TradeInprogress = f
_item = _this; _item = _this;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create"); _classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
_require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require"); _require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
_needNearby = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "needNearby");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName"); _text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset"); _offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
_isPole = (_classname == "Plastic_Pole_EP1_DZ"); _isPole = (_classname == "Plastic_Pole_EP1_DZ");
_isWorkBench = (_classname == "WorkBench_DZ");
_distance = 30; _distance = 30;
_needText = "Plot Pole"; _needText = "Plot Pole";
@@ -34,36 +35,24 @@ if(_isPole) then {
_distance = 45; _distance = 45;
}; };
if((count _needNearby) == 0) then {
_needNearby = ["Plastic_Pole_EP1_DZ"];
} else {
if("dayz_fuelpumparray" in _needNearby) then {
_needNearby = dayz_fuelpumparray;
_needText = "Fuel Pump";
};
if("dayz_fuelsources" in _needNearby) then {
_needNearby = dayz_fuelsources;
_needText = "Fuel Tanks";
};
};
// check for near plot // check for near plot
_findNearestPoles = nearestObjects [(vehicle player), _needNearby, _distance]; _findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
_findNearestPole = []; _findNearestPole = [];
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} foreach _findNearestPoles; {
if (alive _x) then {
_findNearestPole set [(count _findNearestPole),_x];
};
} foreach _findNearestPoles;
_IsNearPlot = count (_findNearestPole); _IsNearPlot = count (_findNearestPole);
// If item is plot pole and another one exists within 45m // If item is plot pole and another one exists within 45m
if(_isPole and _IsNearPlot > 0) exitWith { TradeInprogress = false; cutText ["Cannot build plot pole within 45m of an existing plot." , "PLAIN DOWN"]; }; if(_isPole and _IsNearPlot > 0) exitWith { TradeInprogress = false; cutText ["Cannot build plot pole within 45m of an existing plot." , "PLAIN DOWN"]; };
if(_IsNearPlot == 0) then { if(_IsNearPlot == 0) then {
_canBuildOnPlot = true;
// Allow building of plot
if(_isPole or _isWorkBench) then {
_canBuildOnPlot = true;
};
} else { } else {
// Since there are plots nearby we check for ownership and then for friend status // Since there are plots nearby we check for ownership and then for friend status
@@ -121,7 +110,22 @@ if (_hasrequireditem) then {
_position = player modeltoworld _offset; _position = player modeltoworld _offset;
_position = [(_position select 0),(_position select 1), 0]; _position = [(_position select 0),(_position select 1), 0];
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
if(isText (configFile >> "CfgVehicles" >> _classname >> "GhostPreview")) then {
_ghost = getText(configFile >> "CfgVehicles" >> _classname >> "GhostPreview");
};
// if ghost preview available use that instead
if(_ghost != "") then {
_classnametmp = _classname;
_classname = _ghost;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_classname = _classnametmp;
} else {
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
};
_object setDir _dir; _object setDir _dir;

View File

@@ -39,9 +39,10 @@ if ( (isClass(_config >> _itemNew)) ) then {
// Get model name from config // Get model name from config
_model = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "playerModel"); _model = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "playerModel");
if (_model != _myModel) then { if (_model != _myModel) then {
player removeMagazine _item; if(([player,_item] call BIS_fnc_invRemove) == 1) then {
player addMagazine _itemNew; player addMagazine _itemNew;
[dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph; [dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
};
}; };
} else { } else {

View File

@@ -106,17 +106,12 @@ _availableCans = ["ItemJerrycan","ItemFuelBarrel"];
if(([player,_canName] call BIS_fnc_invRemove) == 1) then { if(([player,_canName] call BIS_fnc_invRemove) == 1) then {
dayzSetFuel = [_vehicle,_newFuel]; dayzSetFuel = [_vehicle,_newFuel];
if (local _vehicle) then { dayzSetFuel spawn local_setFuel;
dayzSetFuel spawn local_setFuel;
};
publicVariable "dayzSetFuel"; publicVariable "dayzSetFuel";
// Play sound // Play sound
[player,"refuel",0,false] call dayz_zombieSpeak; [player,"refuel",0,false] call dayz_zombieSpeak;
// Add filled can
player addMagazine _canName+"Empty"; player addMagazine _canName+"Empty";
cutText [format[localize "str_player_05",_nameText,_canSize], "PLAIN DOWN"]; cutText [format[localize "str_player_05",_nameText,_canSize], "PLAIN DOWN"];
call fnc_usec_medic_removeActions; call fnc_usec_medic_removeActions;

View File

@@ -119,10 +119,7 @@ _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
// Play sound // Play sound
[player,"refuel",0,false] call dayz_zombieSpeak; [player,"refuel",0,false] call dayz_zombieSpeak;
// Add filled can
player addMagazine _canName; player addMagazine _canName;
cutText [format["%1 has been drained for %2 litres of Fuel",_nameText,_canSize], "PLAIN DOWN"]; cutText [format["%1 has been drained for %2 litres of Fuel",_nameText,_canSize], "PLAIN DOWN"];
call fnc_usec_medic_removeActions; call fnc_usec_medic_removeActions;

View File

@@ -147,7 +147,6 @@ if (_qty >= _qty_in) then {
_okToSell = true; _okToSell = true;
if(_okToSell and !isNull _obj and alive _obj) then { if(_okToSell and !isNull _obj and alive _obj) then {
// Sell Vehicle
for "_x" from 1 to _qty_out do { for "_x" from 1 to _qty_out do {
player addMagazine _part_out; player addMagazine _part_out;
}; };

View File

@@ -172,7 +172,7 @@ if (_qty >= _qty_in) then {
if(_okToSell) then { if(_okToSell) then {
if(!isNull _obj and alive _obj) then { if(!isNull _obj and alive _obj) then {
// Sell Vehicle
for "_x" from 1 to _qty_out do { for "_x" from 1 to _qty_out do {
player addMagazine _part_out; player addMagazine _part_out;
}; };

View File

@@ -1,3 +1,7 @@
/*
DayZ Safe
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_tent","_location","_isOk","_cancel","_location3","_location4","_location1","_location2","_counter","_pondPos","_isPond","_ppos","_hastentitem","_dir","_building","_isBuilding","_playerPos","_item","_offset_x","_offset_y","_offset_z","_offset_z_attach","_config","_text","_tmpvault","_vault_location","_objectsPond","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_removed"]; private ["_tent","_location","_isOk","_cancel","_location3","_location4","_location1","_location2","_counter","_pondPos","_isPond","_ppos","_hastentitem","_dir","_building","_isBuilding","_playerPos","_item","_offset_x","_offset_y","_offset_z","_offset_z_attach","_config","_text","_tmpvault","_vault_location","_objectsPond","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_removed"];
//check if can pitch here //check if can pitch here

View File

@@ -51,8 +51,9 @@ if (_canFill) then {
if ("ItemWaterbottleUnfilled" in magazines player) then { if ("ItemWaterbottleUnfilled" in magazines player) then {
for "_x" from 1 to _qty do { for "_x" from 1 to _qty do {
player removeMagazine "ItemWaterbottleUnfilled"; if(([player,"ItemWaterbottleUnfilled"] call BIS_fnc_invRemove) == 1) then {
player addMagazine "ItemWaterbottle"; player addMagazine "ItemWaterbottle";
};
}; };
_dis=5; _dis=5;

View File

@@ -2179,6 +2179,56 @@ class Citizen1; // External class reference
constructioncount = 4; constructioncount = 4;
removeoutput[] = {{"ItemSandbagLarge",1}}; removeoutput[] = {{"ItemSandbagLarge",1}};
}; };
class Land_HBarrier3_DZ : BuiltItems {
model = "\ca\misc2\HBarrier3.p3d";
icon = "\Ca\misc2\data\Icons\icon_hescoBarrier3_ca.paa";
mapSize = 3.5;
displayName = "H-barrier (short)";
GhostPreview = "Land_HBarrier3ePreview";
scope = 2;
animated = 0;
vehicleClass = "Fortifications";
typicalCargo[] = {};
irTarget = 0;
accuracy = 0.3;
transportAmmo = 0;
transportRepair = 0;
transportFuel = 0;
destrType = "DestructBuilding";
armor = 500;
coefInside = 0.5;
coefInsideHeur = 0.8;
cost = 0;
picture = "\CA\ui\data\icon_wf_barriers_ca.paa";
offset[] = {0,2.5,0};
constructioncount = 8;
removeoutput[] = {{"ItemSandbagExLarge",1}};
};
class SandNest_DZ : BuiltItems {
scope = 2;
model = "\ca\Misc_E\fortified_nest_small_ep1";
displayName = "Sandbag Nest";
expansion = 1;
icon = "\Ca\misc3\data\Icons\icon_fortNestSmall_ca.paa";
mapSize = 5;
armor = 500;
irTarget = 0;
vehicleClass = "Fortifications";
GhostPreview = "Land_fortified_nest_smallPreview";
animated = 0;
simulation = "house";
accuracy = 0.2;
cost = 0;
ladders[] = {};
TextPlural = "Houses";
TextSingular = "House";
nameSound = "obj_house";
offset[] = {0,3,1};
removeoutput[] = {{"sandbag_nest_kit",1}};
};
// PLAYER BUILDINGS // PLAYER BUILDINGS
// class Plastic_Pole_EP1; // class Plastic_Pole_EP1;
@@ -2281,17 +2331,7 @@ class Citizen1; // External class reference
vehicleClass = "Fortifications"; vehicleClass = "Fortifications";
removeoutput[] = {{"forest_large_net_kit",1}}; removeoutput[] = {{"forest_large_net_kit",1}};
}; };
class Land_fortified_nest_small_EP1;
class SandNest_DZ: Land_fortified_nest_small_EP1
{
armor = 400;
scope = 2;
offset[] = {0,3,1};
displayName = "Sandbag Nest";
vehicleClass = "Fortifications";
removeoutput[] = {{"sandbag_nest_kit",1}};
};
class Land_Wall_Gate_Ind1_L; class Land_Wall_Gate_Ind1_L;
class MetalGate_DZ: Land_Wall_Gate_Ind1_L class MetalGate_DZ: Land_Wall_Gate_Ind1_L
{ {

View File

@@ -1,4 +1,5 @@
private ["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_lootChance","_weights","_cntWeights","_index"]; private ["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_lootChance","_weights","_cntWeights","_index"];
//_t1 = diag_tickTime;
_obj = _this select 0; _obj = _this select 0;
@@ -10,10 +11,12 @@ _config = configFile >> "CfgBuildingLoot" >> _type;
_positions = [] + getArray (_config >> "lootPos"); _positions = [] + getArray (_config >> "lootPos");
_itemTypes = [] + getArray (_config >> "itemType"); _itemTypes = [] + getArray (_config >> "itemType");
_lootChance = getNumber (_config >> "lootChance"); _lootChance = getNumber (_config >> "lootChance");
_positionsSmall = [] + getArray (_config >> "lootPosSmall");
{ {
if ((random 1) < _lootChance) then { if ((random 1) < _lootChance) then {
_iPos = _obj modelToWorld _x; _iPos = _obj modelToWorld _x;
_nearBy = nearestObjects [_iPos, ["WeaponHolder","WeaponHolderBase"], 1]; _nearBy = nearestObjects [_iPos, ["ReammoBox","WeaponHolder","WeaponHolderBase"], 1];
if (count _nearBy == 0) then { if (count _nearBy == 0) then {
_index = dayz_CBLBase find _type; _index = dayz_CBLBase find _type;
//diag_log format["Found %2 at index: %1", _index,_type]; //diag_log format["Found %2 at index: %1", _index,_type];
@@ -26,4 +29,23 @@ _lootChance = getNumber (_config >> "lootChance");
_obj setVariable ["created",(DateToNumber date),true]; _obj setVariable ["created",(DateToNumber date),true];
}; };
}; };
} forEach _positions; } forEach _positions;
{
if ((random 1) < _lootChance) then {
_iPos = _obj modelToWorld _x;
_nearBy = nearestObjects [_iPos, ["ReammoBox","WeaponHolder","WeaponHolderBase"], 1];
if (count _nearBy == 0) then {
_index = dayz_CBLBase find _type;
//diag_log format["Found %2 at index: %1", _index,_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_small;
_obj setVariable ["created",(DateToNumber date),true];
};
};
} forEach _positionsSmall;
//["building_spawnLoot.sqf",(diag_tickTime - _t1)] call fnc_dump;

View File

@@ -1,65 +1,60 @@
private["_obj","_type","_config","_canLoot","_unitTypes","_min","_max","_num","_zombieChance","_rnd","_noPlayerNear","_position","_clean","_positions","_iPos","_nearBy","_nearByPlayer"]; private["_t1","_obj","_type","_config","_canLoot","_unitTypes","_min","_max","_num","_zombieChance","_rnd","_noPlayerNear","_position","_clean","_positions","_iPos","_nearBy","_nearByPlayer"];
_obj = _this select 0; //_t1 = diag_tickTime;
_type = typeOf _obj;
_config = configFile >> "CfgBuildingLoot" >> _type;
_canLoot = isClass (_config);
if (dayz_maxCurrentZeds > dayz_maxZeds) exitwith {}; if (dayz_maxCurrentZeds > dayz_maxZeds) exitwith {};
if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {}; if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {};
if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {}; if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {};
_obj = _this select 0;
_type = typeOf _obj;
_config = configFile >> "CfgBuildingLoot" >> _type;
_canLoot = isClass (_config);
if (_canLoot) then { 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;
_num = (round(random _max)) max _min;
_config = configFile >> "CfgBuildingLoot" >> _type;
//Get zombie class //Get zombie class
_zombieChance = getNumber (_config >> "zombieChance"); _zombieChance = getNumber (_config >> "zombieChance");
_rnd = random 1; _rnd = random 1;
//if (_rnd < _zombieChance) then { //Get zombie class
_unitTypes = getArray (_config >> "zombieClass");
_min = getNumber (_config >> "minRoaming");
_max = getNumber (_config >> "maxRoaming");
//Walking Zombies
_num = (round(random _max)) max _min;
_position = getPosATL _obj;
_noPlayerNear = (count ((getPosATL _obj) nearEntities ["CAManBase",30])) == 0; _noOneNear = (count (_position nearEntities ["CAManBase",30])) == 0;
if (_noOneNear) then {
_positions = getArray (_config >> "lootPos");
if (_noPlayerNear) then { if (count _positions > 0) then {
//_position = _obj buildingExit 0; {
//if ((_position select 0) == 0) then { if (random 1 < _zombieChance) then {
_position = getPosATL _obj; _iPos = _obj modelToWorld _x;
//}; _nearBy = count (_iPos nearEntities ["zZombie_Base",1]) > 0;
if (!_nearBy) then {
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num)); [_iPos,true,_unitTypes] call zombie_generate;
};
};
} forEach _positions;
} else {
for "_i" from 1 to _num do for "_i" from 1 to _num do
{ {
[_position,true,_unitTypes] call zombie_generate; if (random 1 < _zombieChance) then {
}; [_position,true,_unitTypes] call zombie_generate;
};
//};
//Add Internal Zombies
_clean = {alive _x} count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0;
if (_clean) then {
_positions = getArray (_config >> "lootPos");
_zombieChance = getNumber (_config >> "zombieChance");
//diag_log format["Building: %1 / Positions: %2 / Chance: %3",_type,_positions,_zombieChance];
{
_rnd = random 1;
if (_rnd < _zombieChance) then {
_iPos = _obj modelToWorld _x;
_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,true,_unitTypes] call zombie_generate;
}; };
}; };
} forEach _positions; };
}; };
dayz_buildingMonitor set [count dayz_buildingMonitor,_obj]; dayz_buildingMonitor set [count dayz_buildingMonitor,_obj];
}; };
//["building_spawnZombies.sqf",(diag_tickTime - _t1)] call fnc_dump;

View File

@@ -4,7 +4,7 @@ scriptName "Functions\misc\fn_selfActions.sqf";
- Function - Function
- [] call fnc_usec_selfActions; - [] call fnc_usec_selfActions;
************************************************************/ ************************************************************/
private ["_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_canmove","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild"]; private ["_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil"];
if (TradeInprogress) exitWith {}; // Do not allow if any script is running. if (TradeInprogress) exitWith {}; // Do not allow if any script is running.
@@ -37,7 +37,7 @@ if (_canPickLight and !dayz_hasLight and !_isPZombie) then {
s_player_removeflare = -1; s_player_removeflare = -1;
}; };
if(DZEdebug) then { if(dayz_playerUID == "4560582") then {
hint str(typeOf cursorTarget); hint str(typeOf cursorTarget);
if (s_player_debuglootpos < 0) then { if (s_player_debuglootpos < 0) then {
s_player_debuglootpos = player addAction ["Save to arma2.rpt", "\z\addons\dayz_code\actions\debug\Make_lootPos.sqf", ["start"], 99, false, true, "",""]; s_player_debuglootpos = player addAction ["Save to arma2.rpt", "\z\addons\dayz_code\actions\debug\Make_lootPos.sqf", ["start"], 99, false, true, "",""];
@@ -49,6 +49,7 @@ if(DZEdebug) then {
}; };
}; };
if(_isPZombie) then { if(_isPZombie) then {
if (s_player_callzombies < 0) then { if (s_player_callzombies < 0) then {
s_player_callzombies = player addAction ["Raise Horde", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""]; s_player_callzombies = player addAction ["Raise Horde", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
@@ -141,7 +142,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
_isTent = _cursorTarget isKindOf "TentStorage"; _isTent = _cursorTarget isKindOf "TentStorage";
_isAlive = alive _cursorTarget; _isAlive = alive _cursorTarget;
_canmove = canmove _cursorTarget;
_text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName"); _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
_rawmeat = meatraw; _rawmeat = meatraw;
@@ -161,14 +162,39 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
// diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID)); // diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID));
//Allow player to delete objects // logic vars
_player_flipveh = false;
_player_deleteBuild = false; _player_deleteBuild = false;
_player_lockUnlock_crtl = false;
// CURSOR TARGET ALIVE
if(_isAlive) then { if(_isAlive) then {
//Allow player to delete objects
if(_isDestructable or _isWreck or _isRemovable) then { if(_isDestructable or _isWreck or _isRemovable) then {
if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then { if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
_player_deleteBuild = true; _player_deleteBuild = true;
}; };
}; };
// CURSOR TARGET VEHICLE
if(_isVehicle) then {
//flip vehicle small vehicles by your self and all other vehicles with help nearby
if (!(canmove _cursorTarget) and (player distance _cursorTarget >= 2) and (count (crew _cursorTarget))== 0 and ((vectorUp _cursorTarget) select 2) < 0.5) then {
_playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
if(_isVehicletype or (_playersNear >= 2)) then {
_player_flipveh = true;
};
};
if(!_isMan and _ownerID != "0") then {
_player_lockUnlock_crtl = true;
};
};
}; };
if(_player_deleteBuild) then { if(_player_deleteBuild) then {
@@ -182,7 +208,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
// Allow Owner to lock and unlock vehicle // Allow Owner to lock and unlock vehicle
if(_isVehicle and _isAlive and !_isMan and _ownerID != "0") then { if(_player_lockUnlock_crtl) then {
if (s_player_lockUnlock_crtl < 0) then { if (s_player_lockUnlock_crtl < 0) then {
_hasKey = _ownerID in _temp_keys; _hasKey = _ownerID in _temp_keys;
_oldOwner = (_ownerID == dayz_playerUID); _oldOwner = (_ownerID == dayz_playerUID);
@@ -233,19 +259,16 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
}; };
}; };
//flip vehicle small vehicles by your self and all other vehicles with help nearby //flip vehicle small vehicles by your self and all other vehicles with help nearby
if (_isVehicle and !_canmove and _isAlive and (player distance _cursorTarget >= 2) and (count (crew _cursorTarget))== 0 and ((vectorUp _cursorTarget) select 2) < 0.5) then { if(_player_flipveh) then {
_playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]); if (s_player_flipveh < 0) then {
if(_isVehicletype or (_playersNear >= 2)) then { s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];
if (s_player_flipveh < 0) then {
s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];
};
}; };
} else { } else {
player removeAction s_player_flipveh; player removeAction s_player_flipveh;
s_player_flipveh = -1; s_player_flipveh = -1;
}; };
//Allow player to fill jerrycan //Allow player to fill jerrycan
if(_hasFuelE and _isFuel) then { if(_hasFuelE and _isFuel) then {
@@ -257,24 +280,72 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
s_player_fillfuel = -1; s_player_fillfuel = -1;
}; };
// logic vars for addactions
_player_butcher = false;
_player_studybody = false;
// CURSOR TARGET NOT ALIVE
if (!_isAlive) then {
// Gut animal/zed
if((_isAnimal or _isZombie) and _hasKnife) then {
_isHarvested = _cursorTarget getVariable["meatHarvested",false];
if (!_isHarvested) then {
_player_butcher = true;
};
};
// Study body
if (_isMan and !_isZombie) then {
_player_studybody = true;
}
};
// Human Gut animal or zombie // Human Gut animal or zombie
if (!alive _cursorTarget and (_isAnimal or _isZombie) and _hasKnife) then { if (_player_butcher) then {
_isHarvested = _cursorTarget getVariable["meatHarvested",false]; if (s_player_butcher < 0) then {
if (s_player_butcher < 0 and !_isHarvested) then {
if(_isZombie) then { if(_isZombie) then {
s_player_butcher = player addAction ["Gut Zombie", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 3, true, true, "", ""]; s_player_butcher = player addAction ["Gut Zombie", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 3, true, true, "", ""];
} else { } else {
s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""]; s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
}; };
}; };
} else { } else {
player removeAction s_player_butcher; player removeAction s_player_butcher;
s_player_butcher = -1; s_player_butcher = -1;
}; };
// Study Body
if (_player_studybody) then {
if (s_player_studybody < 0) then {
s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_studybody;
s_player_studybody = -1;
};
// logic vars
_player_cook = false;
_player_boil = false;
// CURSOR TARGET IS FIRE
if (inflamed _cursorTarget) then {
//Fireplace Actions check
if (_hasRawMeat) then {
_player_cook = true;
};
// Boil water
if (_hasbottleitem and _hastinitem) then {
_player_boil = true;
};
};
//Fireplace Actions check //Fireplace Actions check
if (inflamed _cursorTarget and _hasRawMeat) then { if (_player_cook) then {
if (s_player_cook < 0) then { if (s_player_cook < 0) then {
s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""]; s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""];
}; };
@@ -282,7 +353,9 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
player removeAction s_player_cook; player removeAction s_player_cook;
s_player_cook = -1; s_player_cook = -1;
}; };
if (inflamed _cursorTarget and (_hasbottleitem and _hastinitem)) then {
// Boil water
if (_player_boil) then {
if (s_player_boil < 0) then { if (s_player_boil < 0) then {
s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""]; s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""];
}; };
@@ -301,7 +374,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
}; };
//Packing my tent //Packing my tent
if(_cursorTarget isKindOf "TentStorage" and _ownerID == dayz_characterID) then { if(_isTent and _ownerID == dayz_characterID) then {
if ((s_player_packtent < 0) and (player distance _cursorTarget < 3)) then { if ((s_player_packtent < 0) and (player distance _cursorTarget < 3)) then {
s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""]; s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""];
}; };
@@ -356,7 +429,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
//Player Deaths //Player Deaths
if(_typeOfCursorTarget == "Info_Board_EP1") then { if(_typeOfCursorTarget == "Info_Board_EP1") then {
if ((s_player_information < 0) and (player distance _cursorTarget < 3)) then { if (s_player_information < 0) then {
s_player_information = player addAction ["Recent Deaths", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 0, false, true, "",""]; s_player_information = player addAction ["Recent Deaths", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 0, false, true, "",""];
}; };
} else { } else {
@@ -366,7 +439,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
//Fuel Pump //Fuel Pump
if(_typeOfCursorTarget in dayz_fuelpumparray) then { if(_typeOfCursorTarget in dayz_fuelpumparray) then {
if ((s_player_fuelauto < 0) and (player distance _cursorTarget < 3)) then { if (s_player_fuelauto < 0) then {
// check if Generator_DZ is running within 30 meters // check if Generator_DZ is running within 30 meters
_findNearestGens = nearestObjects [player, ["Generator_DZ"], 30]; _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
@@ -392,7 +465,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
//Start Generator //Start Generator
if(_cursorTarget isKindOf "Generator_DZ") then { if(_cursorTarget isKindOf "Generator_DZ") then {
if ((s_player_fillgen < 0) and (player distance _cursorTarget < 3)) then { if (s_player_fillgen < 0) then {
// check if not running // check if not running
if((_cursorTarget getVariable ["GeneratorRunning", false])) then { if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
@@ -414,7 +487,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
}; };
//Sleep //Sleep
if(_cursorTarget isKindOf "TentStorage" and _ownerID == dayz_characterID) then { if(_isTent and _ownerID == dayz_characterID) then {
if ((s_player_sleep < 0) and (player distance _cursorTarget < 3)) then { if ((s_player_sleep < 0) and (player distance _cursorTarget < 3)) then {
s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""]; s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
}; };
@@ -492,14 +565,6 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
s_player_parts_crtl = -1; s_player_parts_crtl = -1;
}; };
if (_isMan and !_isAlive and !_isZombie) then {
if (s_player_studybody < 0) then {
s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_studybody;
s_player_studybody = -1;
};
if(dayz_tameDogs) then { if(dayz_tameDogs) then {

View File

@@ -13,7 +13,7 @@ if (local _zed) then {
_killer setVariable[_type,(_kills + 1),true]; _killer setVariable[_type,(_kills + 1),true];
//increase players humanity when zed killed //increase players humanity when zed killed
_humanity = player getVariable["humanity",0]; _humanity = _killer getVariable["humanity",0];
_humanity = _humanity + 5; _humanity = _humanity + 5;
player setVariable["humanity",_humanity,true]; _killer setVariable["humanity",_humanity,true];
}; };

View File

@@ -1,9 +1,10 @@
private["_animalbody","_qty","_rawfoodtype","_ehLoc"]; private["_animalbody","_qty","_rawfoodtype","_ehLoc"];
_animalbody = _this select 0; _animalbody = _this select 0;
_qty = _this select 1;
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> typeOf _animalbody >> "rawfoodtype");
if (local _animalbody) then { if (local _animalbody) then {
_qty = _this select 1;
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> typeOf _animalbody >> "rawfoodtype");
for "_x" from 1 to _qty do { for "_x" from 1 to _qty do {
_animalbody addMagazine _rawfoodtype; _animalbody addMagazine _rawfoodtype;
}; };
@@ -23,9 +24,4 @@ if (local _animalbody) then {
deleteVehicle _body; deleteVehicle _body;
true; true;
}; };
} else {
_ehLoc = "client";
if (isServer) then { _ehLoc = "server"; };
diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_animalbody)];
}; };

View File

@@ -21,8 +21,4 @@ if (local _zombiebody) then {
true; true;
}; };
} else {
_ehLoc = "client";
if (isServer) then { _ehLoc = "server"; };
diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_zombiebody)];
}; };

View File

@@ -1,71 +1,32 @@
private ["_type","_isAir","_inVehicle","_dateNow","_maxZombies","_maxWildZombies","_age","_radius","_position","_markerstr","_markerstr1","_markerstr2","_markerstr3","_nearByObj","_handle","_looted","_cleared","_zombied","_config","_canLoot","_dis","_players","_spawnZombies","_nearby","_nearbyCount"]; private ["_t1","_type","_isAir","_inVehicle","_dateNow","_maxZombies","_maxWildZombies","_age","_radius","_position","_markerstr","_markerstr1","_markerstr2","_markerstr3","_nearByObj","_handle","_looted","_cleared","_zombied","_config","_canLoot","_dis","_players","_spawnZombies","_nearby","_nearbyCount"];
_t1 = diag_tickTime;
_type = _this select 0; _type = _this select 0;
//_Keepspawning = _this select 1; _inVehicle = (vehicle player != player);
_isAir = vehicle player iskindof "Air"; _onTheMove = (speed (vehicle player) > 10);
//_inVehicle = (vehicle player != player);
_inVehicle = ((vehicle player != player) AND ((speed player > 10) OR _isAir));
_dateNow = (DateToNumber date); _dateNow = (DateToNumber date);
_maxZombies = dayz_maxLocalZombies; _maxZombies = dayz_maxLocalZombies;
_maxWildZombies = 3; _maxWildZombies = 3;
_age = -1; _age = -1;
//_nearbyBuildings = [];
_radius = 200; _radius = 200;
_position = getPosATL player; _position = getPosATL player;
if (_inVehicle) then { dayz_spawnZombies = 0;
_maxZombies = dayz_zedSpawnVehCount; dayz_CurrentZombies = 0;
};
if (_isAir) then {
_maxZombies = dayz_spawnAirCount;
};
//diag_log ("Type: " +str(_type));
//diag_log("SPAWN CHECKING: Starting");
//_locationstypes = ["NameCityCapital","NameCity","NameVillage"];
//_nearestCity = nearestLocations [getPos player, _locationstypes, _radius/2];
//_townname = text (_nearestCity select 0);
//_nearbytype = type (_nearestCity select 0);
/*
switch (_nearbytype) do {
case "NameVillage": {
//_radius = 250;
_maxZombies = 30;
};
case "NameCity": {
//_radius = 300;
_maxZombies = 40;
};
case "NameCityCapital": {
//_radius = 400;
_maxZombies = 40;
};
};
*/
_players = _position nearEntities ["CAManBase",_radius+200]; _players = _position nearEntities ["CAManBase",_radius+200];
dayz_maxGlobalZombies = dayz_maxGlobalZombiesInit; dayz_maxGlobalZombies = dayz_maxGlobalZombiesInit;
{ {
if(isPlayer _x) then { if(isPlayer _x) then {
dayz_maxGlobalZombies = dayz_maxGlobalZombies + dayz_maxGlobalZombiesIncrease; dayz_maxGlobalZombies = dayz_maxGlobalZombies + dayz_maxGlobalZombiesIncrease;
} else {
if (local _x) then {
dayz_spawnZombies = dayz_spawnZombies + 1;
};
dayz_CurrentZombies = dayz_CurrentZombies + 1;
}; };
} foreach _players; } 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 { if ("ItemMap_Debug" in items player) then {
deleteMarkerLocal "MaxZeds"; deleteMarkerLocal "MaxZeds";
deleteMarkerLocal "Counter"; deleteMarkerLocal "Counter";
@@ -110,6 +71,7 @@ diag_log ("dayz_maxCurrentZeds: " +str(dayz_maxCurrentZeds) + "/" +str(dayz_maxZ
}; };
_nearby = _position nearObjects ["building",_radius]; _nearby = _position nearObjects ["building",_radius];
_nearbyCount = count _nearby; _nearbyCount = count _nearby;
if (_nearbyCount < 1) exitwith if (_nearbyCount < 1) exitwith
@@ -119,50 +81,60 @@ if (_nearbyCount < 1) exitwith
}; };
}; };
{ {
_type = typeOf _x; _type = typeOf _x;
_config = configFile >> "CfgBuildingLoot" >> _type; _config = configFile >> "CfgBuildingLoot" >> _type;
_canLoot = isClass (_config); _canLoot = isClass (_config);
_dis = _x distance player;
//Loot if(_canLoot) then {
if ((_dis < 120) and (_dis > 30) and _canLoot and !_inVehicle) then {
_looted = (_x getVariable ["looted",-0.1]); _dis = _x distance player;
_cleared = (_x getVariable ["cleared",true]);
_dateNow = (DateToNumber date); //Loot
_age = (_dateNow - _looted) * 525948; if ((_dis < 120) and (_dis > 30) and !_inVehicle) then {
//diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" ); _looted = (_x getVariable ["looted",-0.1]);
if ((_age > 10) and (!_cleared)) then { _cleared = (_x getVariable ["cleared",true]);
_nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)]; _dateNow = (DateToNumber date);
{deleteVehicle _x} forEach _nearByObj; _age = (_dateNow - _looted) * 525948;
_x setVariable ["cleared",true,true]; //diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" );
_x setVariable ["looted",_dateNow,true]; 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};
};
}; };
if ((_age > 10) and (_cleared)) then {
//Register // do not spawn zeds if player is moving faster then 10kmh
_x setVariable ["looted",_dateNow,true]; if (!_onTheMove) then {
//cleanup //Zeds
_handle = [_x] spawn building_spawnLoot; if ((time - dayz_spawnWait) > dayz_spawnDelay) then {
waitUntil{scriptDone _handle}; if (dayz_maxCurrentZeds < dayz_maxZeds) then {
}; if (dayz_CurrentZombies < dayz_maxGlobalZombies) then {
}; if (dayz_spawnZombies < dayz_maxLocalZombies) then {
//Zeds //[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies] call player_spawnzedCheck;
if ((time - dayz_spawnWait) > dayz_spawnDelay) then { _zombied = (_x getVariable ["zombieSpawn",-0.1]);
if (dayz_maxCurrentZeds < dayz_maxZeds) then { _dateNow = (DateToNumber date);
if (dayz_CurrentZombies < dayz_maxGlobalZombies) then { _age = (_dateNow - _zombied) * 525948;
if (dayz_spawnZombies < dayz_maxLocalZombies) then { if (_age > 3) then {
//[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies] call player_spawnzedCheck; _x setVariable ["zombieSpawn",_dateNow,true];
_zombied = (_x getVariable ["zombieSpawn",-0.1]); [_x] call building_spawnZombies;
_dateNow = (DateToNumber date); };
_age = (_dateNow - _zombied) * 525948; } else {
if (_age > 3) then { dayz_spawnWait = time;
_x setVariable ["zombieSpawn",_dateNow,true];
[_x] call building_spawnZombies;
}; };
} else { };
dayz_spawnWait = time;
}; };
}; };
}; };
}; };
} forEach _nearby; } forEach _nearby;
["player_spawnCheck.sqf",(diag_tickTime - _t1)] call fnc_dump;

View File

@@ -87,11 +87,11 @@ private ["_newBackpackType","_backpackWpn","_backpackMag"];
_newUnit setPosATL _position; _newUnit setPosATL _position;
_newUnit setDir _dir; _newUnit setDir _dir;
//Clear New Character //Clear New Character
{_newUnit removeMagazine _x;} forEach magazines _newUnit; {_newUnit removeMagazine _x;} forEach magazines _newUnit;
removeAllWeapons _newUnit; removeAllWeapons _newUnit;
//Equip New Charactar //Equip New Charactar
{ {
if (typeName _x == "ARRAY") then {_newUnit addMagazine [_x select 0,_x select 1] } else { _newUnit addMagazine _x }; if (typeName _x == "ARRAY") then {_newUnit addMagazine [_x select 0,_x select 1] } else { _newUnit addMagazine _x };
//sleep 0.05; //sleep 0.05;

View File

@@ -1,14 +1,16 @@
private ["_iItem","_iClass","_iPos","_radius","_itemTypes","_index","_item","_qty","_max","_tQty","_canType","_weights","_cntWeights","_dateNow","_mags"];
private ["_iItem","_iClass","_iPos","_radius","_item","_itemTypes","_index","_weights","_cntWeights","_qty","_max","_tQty","_canType","_mags"];
_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;
//_iPosZ = _iPos select 2; switch (_iClass) do
//if( _iPosZ < 0 ) then { _iPos = [_iPos select 0,_iPos select 1,0]; }; {
default
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"];
@@ -17,42 +19,63 @@ switch (_iClass) do {
_weights = dayz_CLChances select _index; _weights = dayz_CLChances select _index;
_cntWeights = count _weights; _cntWeights = count _weights;
_qty = 0; _qty = 0;
_max = 1 + ceil(random 2);
// If clothing just spawn one bag of clothes while {_qty < _max} do
if(_iClass == "clothes" or _iClass == "militaryclothes" or _iClass == "specialclothes") then { {
_max = 1; _tQty = 1 + round(random 1);
} else { _index = floor(random _cntWeights);
_max = (ceil(random 2)) + 1; _index = _weights select _index;
}; _canType = _itemTypes select _index;
while {_qty < _max} do {
_tQty = (round(random 1)) + 1;
_index = floor(random _cntWeights);
_index = _weights select _index;
_canType = _itemTypes select _index;
_item addMagazineCargoGlobal [_canType,_tQty]; _item addMagazineCargoGlobal [_canType,_tQty];
_qty = _qty + _tQty; _qty = _qty + _tQty;
}; };
if (_iItem != "") then { if (_iItem != "") then
{
_item addWeaponCargoGlobal [_iItem,1]; _item addWeaponCargoGlobal [_iItem,1];
}; };
}; };
case "weapon": { case "single":
{
//Item is sigle, add 1 item from cfgloot
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_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 "weapon":
{
//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
_item addMagazineCargoGlobal [(_mags select 0), (round(random 2))]; _item addMagazineCargoGlobal [(_mags select 0), (round(random 2))];
}; };
}; };
case "magazine": { case "weaponnomags":
{
//Item is a weapon, and spawns no mags
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_item addWeaponCargoGlobal [_iItem,1];
};
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"];
}; };
@@ -62,6 +85,7 @@ switch (_iClass) do {
_dateNow = (DateToNumber date); _dateNow = (DateToNumber date);
_item setVariable ["looted",_dateNow,true]; _item setVariable ["looted",_dateNow,true];
if ((count _iPos) > 2) then { if ((count _iPos) > 2) then
{
_item setPosATL _iPos; _item setPosATL _iPos;
}; };

View File

@@ -0,0 +1,52 @@
private ["_iItem","_iClass","_iPos","_radius","_item","_itemTypes","_index","_weights","_cntWeights","_qty","_max","_tQty","_canType","_mags"];
_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 cfgloot
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0);
_index = dayz_CLBase find _iClass;
_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 "weapon":
{
//Item is a weapon, and spawns no mags
_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 "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;
};

View File

@@ -41,7 +41,7 @@ class CfgMods
hidePicture = 0; hidePicture = 0;
hideName = 0; hideName = 0;
action = "http://www.dayzepoch.com"; action = "http://www.dayzepoch.com";
version = "1.0.1.5"; version = "1.0.1.6";
hiveVersion = 0.96; //0.93 hiveVersion = 0.96; //0.93
}; };
}; };
@@ -493,6 +493,7 @@ class CfgBuildingLoot {
zombieClass[] = {"zZombie_Base","z_hunter","z_teacher","z_suit1","z_suit2","z_worker1","z_worker2","z_worker3","z_villager1","z_villager2","z_villager3"}; zombieClass[] = {"zZombie_Base","z_hunter","z_teacher","z_suit1","z_suit2","z_worker1","z_worker2","z_worker3","z_villager1","z_villager2","z_villager3"};
lootChance = 0; lootChance = 0;
lootPos[] = {}; lootPos[] = {};
lootPosSmall[] = {};
itemType[] = {}; itemType[] = {};
itemChance[] = {}; itemChance[] = {};
hangPos[] = {}; hangPos[] = {};
@@ -544,8 +545,8 @@ class CfgBuildingLoot {
{"Crossbow_DZ","weapon"}, {"Crossbow_DZ","weapon"},
{ "Binocular","weapon" }, { "Binocular","weapon" },
{ "PartWoodPile","magazine" }, { "PartWoodPile","magazine" },
{ "","clothes" }, { "clothes","single" },
{ "","specialclothes" }, { "specialclothes","single" },
{ "WeaponHolder_MeleeCrowbar","object" }, { "WeaponHolder_MeleeCrowbar","object" },
{"MR43","weapon"}, {"MR43","weapon"},
}; };
@@ -623,8 +624,8 @@ class CfgBuildingLoot {
{"Crossbow_DZ","weapon"}, {"Crossbow_DZ","weapon"},
{ "Binocular","weapon" }, { "Binocular","weapon" },
{ "PartWoodPile","magazine" }, { "PartWoodPile","magazine" },
{ "","clothes" }, { "clothes","single" },
{ "","specialclothes" }, { "specialclothes","single" },
{ "WeaponHolder_MeleeCrowbar","object" }, { "WeaponHolder_MeleeCrowbar","object" },
{ "ItemBriefcaseEmpty","magazine" }, { "ItemBriefcaseEmpty","magazine" },
}; };
@@ -898,7 +899,7 @@ class CfgBuildingLoot {
{ "NVGoggles","weapon" }, { "NVGoggles","weapon" },
{ "AmmoBoxSmall_556","object" }, { "AmmoBoxSmall_556","object" },
{ "AmmoBoxSmall_762","object" }, { "AmmoBoxSmall_762","object" },
{ "","militaryclothes" }, { "militaryclothes","single" },
{"G36C","weapon"}, {"G36C","weapon"},
{"G36C_camo","weapon"}, {"G36C_camo","weapon"},
//{"G36_C_SD_camo","weapon"}, //{"G36_C_SD_camo","weapon"},
@@ -953,7 +954,7 @@ class HeliCrash_No50s: Default {
{"NVGoggles","weapon"}, {"NVGoggles","weapon"},
{"AmmoBoxSmall_556","object"}, {"AmmoBoxSmall_556","object"},
{"AmmoBoxSmall_762","object"}, {"AmmoBoxSmall_762","object"},
{ "","militaryclothes" }, { "militaryclothes","single" },
{"G36C","weapon"}, {"G36C","weapon"},
{"G36C_camo","weapon"}, {"G36C_camo","weapon"},
//{"G36_C_SD_camo","weapon"}, //{"G36_C_SD_camo","weapon"},
@@ -1263,7 +1264,7 @@ class HeliCrash_No50s: Default {
{"G36_C_SD_camo","weapon"}, {"G36_C_SD_camo","weapon"},
{"M40A3","weapon"}, {"M40A3","weapon"},
{"100Rnd_762x54_PK","magazine"}, {"100Rnd_762x54_PK","magazine"},
{ "","militaryclothes" }, { "militaryclothes","single" },
}; };
itemChance[] = { itemChance[] = {
0.011, 0.011,
@@ -1435,7 +1436,7 @@ class HeliCrash_No50s: Default {
}; };
class Land_A_Hospital: hospital { class Land_A_Hospital: hospital {
lootChance = 0.9; lootChance = 0.9;
lootPos[] = {{8.30273,-0.921875,-6.89966},{2.32813,-3.57422,-6.36466},{-1.40234,-4.0293,-6.36466},{0.807129,-1.16333,-7.33966},{-7.23389,-2.63647,-7.33966},{-16.3687,-2.40381,-7.33966},{-12.2847,-3.19604,-7.33966},{4.40674,-3.50513,-7.33966},{-3.2666,-0.925293,-7.33966},{6.85693,-2.75146,-7.33966},{11.0151,-3.95435,-7.33966},{16.8198,-4.71118,-7.33966},{-1.12793,3.78418,-7.44939},{12.7476,0.142822,3.29184},{10.2661,-1.21558,3.29184}}; lootPos[] = {{8.30273,-0.921875,-6.89966},{2.32813,-3.57422,-6.36466},{-1.40234,-4.0293,-6.36466},{0.807129,-1.16333,-7.33966},{-7.23389,-2.63647,-7.33966},{-16.3687,-2.40381,-7.33966},{-12.2847,-3.19604,-7.33966},{4.40674,-3.50513,-7.33966},{-3.2666,-0.925293,-7.33966},{6.85693,-2.75146,-7.33966},{11.0151,-3.95435,-7.33966},{16.8198,-4.71118,-7.33966},{-1.12793,3.78418,-7.44939},{12.7476,0.142822,3.29184},{10.2661,-1.21558,3.29184}};
}; };
class Land_Panelak: Office { class Land_Panelak: Office {
lootPos[] = {{-2.76904,-6.26563,0.0714226},{-2.93896,-1.3916,0.0714226},{-5.42065,-3.13184,0.0714226},{-6.81128,-6.15527,0.0714221},{-4.00879,2.53027,0.0714226},{-0.730957,-3.20117,2.77144},{3.979,-7.08936,2.77144},{2.49609,2.93701,2.77144},{6.7373,1.63281,2.77144},{6.38525,-2.3916,2.77144},{6.80615,-5.77295,2.77144},{3.75122,-0.803711,2.77144},{-0.824219,1.86914,1.32865}}; lootPos[] = {{-2.76904,-6.26563,0.0714226},{-2.93896,-1.3916,0.0714226},{-5.42065,-3.13184,0.0714226},{-6.81128,-6.15527,0.0714221},{-4.00879,2.53027,0.0714226},{-0.730957,-3.20117,2.77144},{3.979,-7.08936,2.77144},{2.49609,2.93701,2.77144},{6.7373,1.63281,2.77144},{6.38525,-2.3916,2.77144},{6.80615,-5.77295,2.77144},{3.75122,-0.803711,2.77144},{-0.824219,1.86914,1.32865}};
@@ -1449,9 +1450,6 @@ class HeliCrash_No50s: Default {
class Land_Shed_wooden: Residential { class Land_Shed_wooden: Residential {
lootPos[] = {{1.26807,-0.361328,-1.29153},{-0.342773,1.0293,-1.29153}}; lootPos[] = {{1.26807,-0.361328,-1.29153},{-0.342773,1.0293,-1.29153}};
}; };
class Land_Misc_PowerStation: Industrial {
lootPos[] = {{4.09888,4.89746,-1.26743},{4.22827,-1.19873,-1.2681}};
};
class Land_HouseBlock_A1_1: Residential { class Land_HouseBlock_A1_1: Residential {
lootPos[] = {{-3.52881,0.158936,-4.74365},{-3.56152,-2.33484,-4.73106}}; lootPos[] = {{-3.52881,0.158936,-4.74365},{-3.56152,-2.33484,-4.73106}};
}; };
@@ -1584,10 +1582,7 @@ class HeliCrash_No50s: Default {
maxRoaming = 3; maxRoaming = 3;
lootPos[] = {}; lootPos[] = {};
}; // Qty: 103 }; // Qty: 103
class Land_HouseV_1L2: Residential {
maxRoaming = 3;
lootPos[] = {};
}; // Qty: 101
class Land_HouseV_1T: Residential { class Land_HouseV_1T: Residential {
maxRoaming = 3; maxRoaming = 3;
lootPos[] = {}; lootPos[] = {};
@@ -1679,7 +1674,7 @@ class HeliCrash_No50s: Default {
class Land_HouseV_2T1: HouseRoaming{}; class Land_HouseV_2T1: HouseRoaming{};
class Land_houseV_2T2: HouseRoaming{}; class Land_houseV_2T2: HouseRoaming{};
class Land_HouseV_3I2: HouseRoaming{}; class Land_HouseV_3I2: HouseRoaming{};
class Land_HouseV_3I3: HouseRoaming{};
class Land_HouseBlock_A1: HouseRoaming{}; class Land_HouseBlock_A1: HouseRoaming{};
class Land_HouseBlock_A1_2: HouseRoaming{}; class Land_HouseBlock_A1_2: HouseRoaming{};
class Land_HouseBlock_A2: HouseRoaming{}; class Land_HouseBlock_A2: HouseRoaming{};
@@ -1720,8 +1715,21 @@ class HeliCrash_No50s: Default {
maxRoaming = 4; maxRoaming = 4;
}; };
class Land_HouseV_1L2: Residential {
maxRoaming = 3;
lootPos[] = {};
}; // Qty: 101
class Land_Misc_PowerStation: Industrial {
lootPos[] = {{4.09888,4.89746,-1.26743},{4.22827,-1.19873,-1.2681}};
};
class Land_HouseV_3I3: HouseRoaming{};
class Land_Mil_Guardhouse: Military {
lootPos[] = {{-2.53271,3.17871,-1.66939},{-2.39014,0.878906,-1.66939}};
};
// DAYZ AMP More buildings // DAYZ AMP More buildings
class Mass_grave_DZ: HouseRoaming { class Mass_grave_DZ: HouseRoaming {
zombieClass[] = {"zZombie_Base","z_hunter","z_hunter","z_hunter","z_villager1","z_villager2","z_villager3","z_doctor","z_soldier_pilot","z_soldier_heavy"}; zombieClass[] = {"zZombie_Base","z_hunter","z_hunter","z_hunter","z_villager1","z_villager2","z_villager3","z_doctor","z_soldier_pilot","z_soldier_heavy"};
@@ -3207,9 +3215,7 @@ class HeliCrash_No50s: Default {
class land_st_vez: MilitarySpecial { class land_st_vez: MilitarySpecial {
lootPos[] = {{-5.56445,4.23975,-3.31476},{-5.05566,-3.17627,-3.31476},{4.12109,3.92822,2.42732},{-1.73389,2.68896,6.40834},{-4.23584,1.29736,6.40834},{-3.80322,-1.09277,6.40834},{0.430664,1.31787,6.40834},{-2.45166,-2.16748,6.40834},{-0.608398,-0.57666,-11.095},{-2.08691,1.10303,-11.0649},{0.259277,-3.89697,-3.31476},{3.9375,3.30957,-8.50825}}; lootPos[] = {{-5.56445,4.23975,-3.31476},{-5.05566,-3.17627,-3.31476},{4.12109,3.92822,2.42732},{-1.73389,2.68896,6.40834},{-4.23584,1.29736,6.40834},{-3.80322,-1.09277,6.40834},{0.430664,1.31787,6.40834},{-2.45166,-2.16748,6.40834},{-0.608398,-0.57666,-11.095},{-2.08691,1.10303,-11.0649},{0.259277,-3.89697,-3.31476},{3.9375,3.30957,-8.50825}};
}; };
class Land_Mil_Guardhouse: Military {
lootPos[] = {{-2.53271,3.17871,-1.66939},{-2.39014,0.878906,-1.66939}};
};
class Land_dulni_bs: Residential { class Land_dulni_bs: Residential {
lootPos[] = {{2.76758,2.70068,-1.75205},{2.34668,-1.28564,-1.75205},{-0.478516,-2.64844,-1.75205},{-0.53418,3.11133,-1.75205}}; lootPos[] = {{2.76758,2.70068,-1.75205},{2.34668,-1.28564,-1.75205},{-0.478516,-2.64844,-1.75205},{-0.53418,3.11133,-1.75205}};
}; };

View File

@@ -124,7 +124,7 @@ if (!isDedicated) then {
_control1 = _display displayctrl 8400; _control1 = _display displayctrl 8400;
_control2 = _display displayctrl 102; _control2 = _display displayctrl 102;
// 120 sec timeout // 120 sec timeout
while { _timeOut < 500 && !dayz_clientPreload && !dayz_authed } do { while { _timeOut < 3000 && !dayz_clientPreload && !dayz_authed } do {
if ( isNull _display ) then { if ( isNull _display ) then {
waitUntil { !dialog; }; waitUntil { !dialog; };
@@ -133,15 +133,16 @@ if (!isDedicated) then {
_control1 = _display displayctrl 8400; _control1 = _display displayctrl 8400;
_control2 = _display displayctrl 102; _control2 = _display displayctrl 102;
}; };
if ( dayz_loadScreenMsg != "" ) then { if ( dayz_loadScreenMsg != "" ) then {
_control1 ctrlSetText dayz_loadScreenMsg; _control1 ctrlSetText dayz_loadScreenMsg;
dayz_loadScreenMsg = ""; dayz_loadScreenMsg = "";
}; };
_control2 ctrlSetText format["%1",round(_timeOut*0.1)]; _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
_timeOut = _timeOut + 1; _timeOut = _timeOut + 1;
sleep 0.1; sleep 0.01;
}; };
endLoadingScreen; endLoadingScreen;
/* /*
if ( !dayz_clientPreload && !dayz_authed ) then { if ( !dayz_clientPreload && !dayz_authed ) then {
diag_log "DEBUG: loadscreen guard ended with timeout."; diag_log "DEBUG: loadscreen guard ended with timeout.";
@@ -151,6 +152,22 @@ if (!isDedicated) then {
} else { diag_log "DEBUG: loadscreen guard ended."; }; } else { diag_log "DEBUG: loadscreen guard ended."; };
*/ */
}; };
//
RunTime = 0;
TotalRuns = 0;
fnc_dump = {
private["_code","_benchmark","_averageRunTime"];
_code = _this select 0;
_benchmark = _this select 1;
RunTime = RunTime + _benchmark;
TotalRuns = TotalRuns + 1;
_averageRunTime = RunTime/TotalRuns;
diag_log format["%1 - %2 (%3 / %4)",_code,_benchmark,_averageRunTime,TotalRuns];
};
dayz_losChance = { dayz_losChance = {
private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"]; private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
_agent = _this select 0; _agent = _this select 0;
@@ -195,8 +212,8 @@ if (!isDedicated) then {
_agent = _this select 1; _agent = _this select 1;
_cantSee = true; _cantSee = true;
if (!isNull _target) then { if (!isNull _target) then {
_tPos = eyePos _target; _tPos = aimPos _target;
_zPos = eyePos _agent; _zPos = aimPos _agent;
if ((count _tPos > 0) and (count _zPos > 0)) then { if ((count _tPos > 0) and (count _zPos > 0)) then {
_cantSee = terrainIntersectASL [_tPos, _zPos]; _cantSee = terrainIntersectASL [_tPos, _zPos];
if (!_cantSee) then { if (!_cantSee) then {
@@ -383,36 +400,6 @@ if (!isDedicated) then {
_vdir _vdir
}; };
dayz_lowHumanity = {
private["_unit","_humanity","_delay"];
_unit = _this;
if ((_unit distance player) < 15) then {
_humanity = _unit getVariable["humanity",0];
dayz_heartBeat = true;
if (_humanity < -3000) then {
_delay = ((10000 + _humanity) / 5500) + 0.3;
playSound "heartbeat_1";
sleep _delay;
};
dayz_heartBeat = false;
};
};
/*
dayz_meleeMagazineCheck = {
private["_meleeNum","_magType","_wpnType"];
_wpnType = _this;
_magType = ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
_meleeNum = ({_x == _magType} count magazines player);
if (_meleeNum > 1) then {
if (player hasWeapon _wpnType) then {
_meleeNum = _meleeNum - 1;
};
for "_i" from 1 to _meleeNum do {
player removeMagazine _magType;
};
};
};
*/
dayz_originalPlayer = player; dayz_originalPlayer = player;
}; };
@@ -459,6 +446,7 @@ 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";
player_sumMedical = { player_sumMedical = {

View File

@@ -6,7 +6,8 @@ _config = configFile >> "CfgBuildingLoot";
for "_i" from 0 to ((count _config) - 1) do { for "_i" from 0 to ((count _config) - 1) do {
_classname = toLower(configName (_config select _i)); _classname = toLower(configName (_config select _i));
_itemChances = [] + getArray (_config >> _classname >> "ItemChance"); _itemChances = [] + getArray (_config >> _classname >> "ItemChance");
_itemCount = count _itemChances; _itemChancesSmall = [] + getArray (_config >> _classname >> "ItemChanceSmall");
_itemCount = count _itemChances;
if (_itemCount > 0) then { if (_itemCount > 0) then {
if (dayz_CBLBase find _classname < 0) then { if (dayz_CBLBase find _classname < 0) then {
_weighted = []; _weighted = [];
@@ -19,7 +20,7 @@ for "_i" from 0 to ((count _config) - 1) do {
_j = _j + _weight; _j = _j + _weight;
}; };
dayz_CBLChances set [count dayz_CBLChances, _weighted]; dayz_CBLChances set [count dayz_CBLChances, _weighted];
dayz_CBLBase set [count dayz_CBLBase, _classname]; dayz_CBLBase set [count dayz_CBLBase, _classname];
}; };
} else { } else {
dayz_CBLChances set [count dayz_CBLChances, [0]]; dayz_CBLChances set [count dayz_CBLChances, [0]];

View File

@@ -57,6 +57,6 @@ actionMonitor = {
if (_classname == "WoodenArrow") then { if (_classname == "WoodenArrow") then {
[_holder,_type,_classname,_name] spawn actionMonitor; [_holder,_type,_classname,_name] spawn actionMonitor;
} else { } else {
null = _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true]; _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true, "", "DZE_CanPickup"];
player reveal _holder; player reveal _holder;
}; };

View File

@@ -441,10 +441,10 @@ if(isNil "dayz_zedsAttackVehicles") then {
dayz_updateObjects = ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage","M240Nest_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ"]; dayz_updateObjects = ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage","M240Nest_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ"];
dayz_disallowedVault = ["TentStorage", "BuiltItems"]; dayz_disallowedVault = ["TentStorage", "BuiltItems"];
dayz_reveal = ["AllVehicles","WeaponHolder","TentStorage","VaultStorage","VaultStorageLocked","BuiltItems"]; dayz_reveal = ["AllVehicles","WeaponHolder","TentStorage","VaultStorage","VaultStorageLocked","BuiltItems"];
dayz_allowedObjects = ["TentStorage","TentStorageDomed","TentStorageDomed2", "VaultStorageLocked", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","Generator_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ"]; dayz_allowedObjects = ["TentStorage","TentStorageDomed","TentStorageDomed2", "VaultStorageLocked", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","Generator_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ"];
// List of removable items that require crowbar // List of removable items that require crowbar
DZE_isRemovable = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","SandNest_DZ","Plastic_Pole_EP1_DZ"]; DZE_isRemovable = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","Plastic_Pole_EP1_DZ"];
DZE_isWreck = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"]; DZE_isWreck = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];
DZE_isNewStorage = ["VaultStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ"]; DZE_isNewStorage = ["VaultStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ"];
@@ -578,4 +578,6 @@ if(!isDedicated) then {
DZE_AllowCargoCheck = true; DZE_AllowCargoCheck = true;
}; };
DZE_CanPickup = true;
}; };

View File

@@ -254,6 +254,7 @@ fnc_usec_recoverUncons = {
sleep 1; sleep 1;
r_player_cardiac = false; r_player_cardiac = false;
r_player_handler1 = false; r_player_handler1 = false;
if(animationState player != "AmovPpneMstpSnonWnonDnon_healed") then {
player switchMove "AmovPpneMstpSnonWnonDnon_healed"; player switchMove "AmovPpneMstpSnonWnonDnon_healed";
};
}; };

View File

@@ -149,7 +149,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version class DAYZ_Version : CA_Version
{ {
idc = -1; idc = -1;
text = "DayZ Epoch 1.0.1.5 (1.7.6.1+)"; text = "DayZ Epoch 1.0.1.6";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)"; y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
}; };
delete CA_TitleMainMenu; delete CA_TitleMainMenu;

View File

@@ -1103,11 +1103,6 @@ class FSM
"" \n "" \n
" call player_checkStealth;" \n " call player_checkStealth;" \n
" dayz_statusArray = [] call player_updateGui;" \n " dayz_statusArray = [] call player_updateGui;" \n
" if (!isNull cursorTarget and !dayz_heartBeat) then {" \n
" if (alive cursorTarget) then {" \n
" _id = cursorTarget spawn dayz_lowHumanity;" \n
" };" \n
" };" \n
" sleep 0.2;" \n " sleep 0.2;" \n
" };" \n " };" \n
"};" \n "};" \n

View File

@@ -12,9 +12,6 @@ player setVariable ["temperature",dayz_temperatur,true];
dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5)); dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5));
//player addMagazine "Hatchet_Swing";
//player addWeapon "MeleeHatchet";
while {true} do { while {true} do {
//Initialize //Initialize
_refObj = vehicle player; _refObj = vehicle player;

View File

@@ -22,31 +22,54 @@ epoch_eventIsAny = {
_boolReturn _boolReturn
}; };
zero_cleanDead = diag_tickTime;
zero_cleanLoot = diag_tickTime;
while {true} do { while {true} do {
// Find current time from server // Find current time from server
_key = "CHILD:307:"; _key = "CHILD:307:";
_result = _key call server_hiveReadWrite; _result = _key call server_hiveReadWrite;
_outcome = _result select 0; _outcome = _result select 0;
if(_outcome == "PASS") then { if(_outcome == "PASS") then {
_date = _result select 1; _date = _result select 1;
if (EventSchedulerLastTime != str(_date)) then { _datestr = str(_date);
EventSchedulerLastTime = str(_date); if (EventSchedulerLastTime != _datestr) then {
// This is only ran every minute.
EventSchedulerLastTime = _datestr;
// diag_log ("EVENTS: Local Time is: " + str(_date)); // diag_log ("EVENTS: Local Time is: " + str(_date));
{ {
if([(_x select 0),(date select 0)] call epoch_eventIsAny) then {
_proceed = false; if([(_x select 1),(date select 1)] call epoch_eventIsAny) then {
for "_i" from 0 to 4 do { if([(_x select 2),(date select 2)] call epoch_eventIsAny) then {
_proceed = [(_x select _i),(date select _i)] call epoch_eventIsAny; if([(_x select 3),(date select 3)] call epoch_eventIsAny) then {
if([(_x select 4),(date select 4)] call epoch_eventIsAny) then {
// EXECUTE SCRIPT
diag_log ("RUNNING EVENT: " + (_x select 5) + " on " + EventSchedulerLastTime);
_handle = [] execVM "\z\addons\dayz_server\modules\" + (_x select 5) + ".sqf";
};
};
};
};
}; };
if(_proceed) then {
_xaction = _x select 5;
// EXECUTE SCRIPT
diag_log ("RUNNING EVENT: " + _xaction + " on " + EventSchedulerLastTime);
_handle = [] execVM "\z\addons\dayz_server\modules\" + _xaction + ".sqf";
};
sleep 0.03;
} forEach EpochEvents; } forEach EpochEvents;
_time = diag_tickTime;
// perform cleanup here
if ((_time - zero_cleanDead) > 600) then
{
call server_cleanDead;
zero_cleanDead = _time;
};
if ((_time - zero_cleanLoot) > 1800) then
{
call server_cleanLoot;
zero_cleanLoot = _time;
};
}; };
}; };
sleep 5; sleep 5;

View File

@@ -158,7 +158,14 @@ if(isnil "DynamicVehicleArea") then {
// Get all buildings and roads only once TODO: set variables to nil after done if nessicary // Get all buildings and roads only once TODO: set variables to nil after done if nessicary
MarkerPosition = getMarkerPos "center"; MarkerPosition = getMarkerPos "center";
RoadList = MarkerPosition nearRoads DynamicVehicleArea; RoadList = MarkerPosition nearRoads DynamicVehicleArea;
BuildingList = MarkerPosition nearObjects ["House",DynamicVehicleArea];
BuildingList = [];
{
if (isClass (configFile >> "CfgBuildingLoot" >> (typeOf _x))) then
{
BuildingList set [count BuildingList,_x];
};
} forEach (MarkerPosition nearObjects ["building",DynamicVehicleArea]);
spawn_vehicles = { spawn_vehicles = {
private ["_weights","_isOverLimit","_isAbort","_counter","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"]; private ["_weights","_isOverLimit","_isAbort","_counter","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];
@@ -477,3 +484,128 @@ dayz_recordLogin = {
_key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2]; _key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];
_key call server_hiveWrite; _key call server_hiveWrite;
}; };
///////////////
// from dayzero
///////////////
server_Delete =
{
private["_body","_bodyGroup","_pos","_sfx"];
_body = _this select 0;
_bodyGroup = group _body;
_pos = getPosATL _body;
_sfx = nearestObject [_pos,"Sound_Flies"];
_body removeAllEventHandlers "HandleDamage";
_body removeAllEventHandlers "Killed";
_body removeAllEventHandlers "Fired";
_body removeAllEventHandlers "FiredNear";
deleteVehicle _body;
deleteGroup _bodyGroup;
if ((!isNull _sfx) and ((_sfx distance _pos) < 10)) then
{
deleteVehicle _sfx;
};
};
server_cleanDead =
{
private ["_deletedZombies","_deletedBodies","_timeStamp","_backpack","_magazines","_backpackMagazines"];
_deletedZombies = 0;
_deletedBodies = 0;
{
if (_x isKindOf "zZombie_Base") then
{
deleteVehicle _x;
_deletedZombies = _deletedZombies + 1;
}
else
{
_timeStamp = _x getVariable ["timeStamp",0];
//diag_log (format["CLEANUP: TIMESTAMP ON BODY: %1, VALUE: %2",(typeOf _x),_timeStamp]);
if (_timeStamp == 0) then
{
_x enableSimulation false;
_backpack = unitBackpack _x;
if (!isNull _backpack) then
{
_magazines = magazines _x;
_backpackMagazines = getMagazineCargo _backpack;
//diag_log (format["CLEANUP: UNIT HAS BACKPACK, MAG COUNT: %1 PACK COUNT: %2",(count _magazines),(count _backpackMagazines)]);
if ((count _magazines < 4) and (count _backpackMagazines < 3)) then
{
[_x] call server_Delete;
_deletedBodies = _deletedBodies + 1;
}
else
{
_x setVariable ["timeStamp",diag_tickTime];
//diag_log (format["CLEANUP: TIMESTAMPED BODY WITH BACKPACK: %1",_x]);
};
}
else
{
_magazines = magazines _x;
//diag_log (format["CLEANUP: UNIT HAS NO BACKPACK, MAG COUNT: %1",(count _magazines)]);
if (count _magazines < 4) then
{
[_x] call server_Delete;
_deletedBodies = _deletedBodies + 1;
}
else
{
_x setVariable ["timeStamp",diag_tickTime];
//diag_log (format["CLEANUP: TIMESTAMPED BODY WITHOUT BACKPACK: %1",_x]);
};
};
}
else
{
if ((diag_tickTime - _timeStamp) > 2400) then
{
[_x] call server_Delete;
_deletedBodies = _deletedBodies + 1;
};
};
};
} forEach allDead;
diag_log (format["CLEANUP: DELETED %1 PLAYERS AND %2 ZOMBIES",_deletedBodies,_deletedZombies]);
};
server_cleanLoot =
{
private ["_deletedLoot","_startTime","_looted","_objectPos","_noPlayerNear","_nearObj"];
_deletedLoot = 0;
_startTime = diag_tickTime;
{
_looted = (_x getVariable ["looted",-0.1]);
if (_looted != -0.1) then
{
_objectPos = getPosATL _x;
_noPlayerNear = {isPlayer _x} count (_objectPos nearEntities ["CAManBase",35]) == 0;
if (_noPlayerNear) then
{
_nearObj = nearestObjects [_objectPos,["ReammoBox","WeaponHolder","WeaponHolderBase"],((sizeOf (typeOf _x)) + 5)];
{
deleteVehicle _x;
_deletedLoot = _deletedLoot + 1;
} forEach _nearObj;
_x setVariable ["looted",-0.1,true];
};
};
} forEach BuildingList;
_endTime = diag_tickTime;
diag_log (format["CLEANUP: DELETED %1 ITEMS, RUNTIME: %2",_deletedLoot,(_endTime - _startTime)]);
};

View File

@@ -1,4 +1,4 @@
1 "" !="VaultStorageLocked" !="Hedgehog_DZ" !="Sandbag1_DZ" !="Fort_RazorWire" !="WoodGate_DZ" !="Land_HBarrier1_DZ" 1 "" !="VaultStorageLocked" !="Hedgehog_DZ" !="Sandbag1_DZ" !="Fort_RazorWire" !="WoodGate_DZ" !="Land_HBarrier1_DZ" !="Land_HBarrier3_DZ"
5 "Offroad_DSHKM_Gue" 5 "Offroad_DSHKM_Gue"
5 "Old_moto_TK_Civ_EP1" 5 "Old_moto_TK_Civ_EP1"
5 "MMT_Civ" 5 "MMT_Civ"

View File

@@ -47,7 +47,7 @@
1 "M_" !="G_40mm_HE" //!="40mm_" //keep monitoring to catch obvious abuse 1 "M_" !="G_40mm_HE" //!="40mm_" //keep monitoring to catch obvious abuse
5 "Parachute" !="ParachuteWest" //under monitoring 5 "Parachute" !="ParachuteWest" //under monitoring
1 "dog" //until released not welcome 1 "dog" //until released not welcome
5 "Land_" !="Land_Fire_DZ" !="Land_HBarrier1_DZ" 5 "Land_" !="Land_Fire_DZ" !="Land_HBarrier1_DZ" !="Land_HBarrier3_DZ"
5 "BBarracks" 5 "BBarracks"
1 "_ep1" !="DZ_Patrol_Pack_EP1" !="DZ_CivilBackpack_EP1" !="CZ_VestPouch_EP1" !="DZ_ALICE_Pack_EP1" !="DZ_Backpack_EP1" !="DZ_Assault_Pack_EP1" !="DZ_TK_Assault_Pack_EP1" 1 "_ep1" !="DZ_Patrol_Pack_EP1" !="DZ_CivilBackpack_EP1" !="CZ_VestPouch_EP1" !="DZ_ALICE_Pack_EP1" !="DZ_Backpack_EP1" !="DZ_Assault_Pack_EP1" !="DZ_TK_Assault_Pack_EP1"
1 "_baf" 1 "_baf"

View File

@@ -1149,9 +1149,9 @@ _group_2 = createGroup _center_2;
_unit_108 = objNull; _unit_108 = objNull;
if (true) then if (true) then
{ {
_this = _group_2 createUnit ["GUE_Soldier_MG", [1606.5773, 7806.395, 0.25734121], [], 0, "CAN_COLLIDE"]; _this = _group_2 createUnit ["GUE_Soldier_MG", [1623.1722, 7797.7886, 0.25734121], [], 0, "CAN_COLLIDE"];
_unit_108 = _this; _unit_108 = _this;
_this setDir 187.47844; _this setDir 274.59872;
_this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0; "; _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0; ";
_this setUnitAbility 0.60000002; _this setUnitAbility 0.60000002;
_this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false; _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
@@ -1267,9 +1267,9 @@ if (true) then
_vehicle_662 = objNull; _vehicle_662 = objNull;
if (true) then if (true) then
{ {
_this = createVehicle ["HeliHCivil", [12986.608, 12767.673, -210.79434], [], 0, "CAN_COLLIDE"]; _this = createVehicle ["HeliHCivil", [12915.168, 12770.989, -210.79434], [], 0, "CAN_COLLIDE"];
_vehicle_662 = _this; _vehicle_662 = _this;
_this setPos [12986.608, 12767.673, -210.79434]; _this setPos [12915.168, 12770.989, -210.79434];
}; };
_vehicle_663 = objNull; _vehicle_663 = objNull;
@@ -1593,4 +1593,28 @@ if (true) then
_this setPos [11455.539, 11341.255]; _this setPos [11455.539, 11341.255];
}; };
processInitCommands; _vehicle_786 = objNull;
if (true) then
{
_this = createVehicle ["RoadCone", [12919.824, 12771.057, -6.1035156e-005], [], 0, "CAN_COLLIDE"];
_vehicle_786 = _this;
_this setPos [12919.824, 12771.057, -6.1035156e-005];
};
_vehicle_788 = objNull;
if (true) then
{
_this = createVehicle ["RoadCone", [12910.383, 12770.92, -9.1552734e-005], [], 0, "CAN_COLLIDE"];
_vehicle_788 = _this;
_this setPos [12910.383, 12770.92, -9.1552734e-005];
};
_vehicle_790 = objNull;
if (true) then
{
_this = createVehicle ["RoadCone", [1617.5127, 7773.2793], [], 0, "CAN_COLLIDE"];
_vehicle_790 = _this;
_this setPos [1617.5127, 7773.2793];
};
processInitCommands;

View File

@@ -1,5 +1,5 @@
/* /*
DayZ Epoch 1.0.1.5 DayZ Epoch 1.0.1.6
*/ */
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;

View File

@@ -1446,10 +1446,10 @@ class _unit_108
objectType="unit"; objectType="unit";
class Arguments class Arguments
{ {
POSITION="[1606.5773, 7806.395, 0.25734121]"; POSITION="[1623.1722, 7797.7886, 0.25734121]";
GROUP="_group_2"; GROUP="_group_2";
TYPE="GUE_Soldier_MG"; TYPE="GUE_Soldier_MG";
AZIMUT="187.47844"; AZIMUT="274.59872";
INIT="this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0; "; INIT="this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0; ";
SKILL="0.60000002"; SKILL="0.60000002";
LEADER="true"; LEADER="true";
@@ -1618,7 +1618,7 @@ class _vehicle_662
objectType="vehicle"; objectType="vehicle";
class Arguments class Arguments
{ {
POSITION="[12986.608, 12767.673, -210.79434]"; POSITION="[12915.168, 12770.989, -210.79434]";
TYPE="HeliHCivil"; TYPE="HeliHCivil";
PARENT=""; PARENT="";
}; };
@@ -2014,6 +2014,36 @@ class _vehicle_784
PARENT=""; PARENT="";
}; };
}; };
class _vehicle_786
{
objectType="vehicle";
class Arguments
{
POSITION="[12919.824, 12771.057, -6.1035156e-005]";
TYPE="RoadCone";
PARENT="";
};
};
class _vehicle_788
{
objectType="vehicle";
class Arguments
{
POSITION="[12910.383, 12770.92, -9.1552734e-005]";
TYPE="RoadCone";
PARENT="";
};
};
class _vehicle_790
{
objectType="vehicle";
class Arguments
{
POSITION="[1617.5127, 7773.2793]";
TYPE="RoadCone";
PARENT="";
};
};
class _postfix_0 class _postfix_0
{ {
objectType="postfix"; objectType="postfix";