mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 09:32:02 +03:00
1.0.0.3 Developer Build
+ [FIXED] Battleye kick when calling dog. Thanks to @kikyou2 + [FIXED] Moved vehicle event handler to server side with a call to all connected clients. Before it was just set on only the owner and the server. This should fix issues with damage/repair handling of just purchased vehicles. + [FIXED] Fixed case sensitivity in building loot generation. This was only a problem on new maps that share the same buildings as others yet have differing case in the classnames. + [ADDED] New build-ables: Fence_corrugated_DZ, M240Nest_DZ, CanvasHut_DZ, ParkBench_DZ, MetalGate_DZ, OutHouse_DZ, Wooden_shed_DZ, WoodShack_DZ, StorageShed_DZ. + [ADDED] New crafting items: ItemCanvas, PartWoodLumber, PartWoodPlywood, ItemCorrugated, ItemPole + [ADDED] 55 gallon (210 liter) Fuel Barrel that can only be used on helicopters or fuel trucks. + [ADDED] All DayZ specific magazine items now only take one slot, this also makes it easier to become over burdened so be careful about blacking out. + [ADDED] More building loot spawn positions for Namalsk. + [FIXED] When packing tent get classname of new weapon_holder from config. + [CHANGED] Totally reworked player building system. Preview and placement accuracy has been significantly improved. Building now requires X number of stages to complete. Players cannot build while in combat. + [CHANGED] Added required tools array and is nearby checking for fire, etc. Also, each item can now have 5 separate crafting options. + [CHANGED] Reworked refuel and siphon code to support more can types. + [CHANGED] Removed all infinite fueling sources and added (KamazRefuel_DZ, UralRefuel_TK_EP1_DZ,MtvrRefuel_DES_EP1_DZ) variants of the fuel trucks to remove auto refuel and increase siphon-able fuel capacity to 10000. Old style refuel can still be used if the variable dayz_oldrefuel = true is set in the missions init.sqf. + [CHANGED] Remove object code now uses config variables instead of hard coded into sqf (default: constructioncount = 5) + [CHANGED] Moved most arrays for revealing objects, allowed objects, update objects, disallowed combat roll to arrays within variables.sqf. So that these arrays are unified and easier to change. + [CHANGED] New vehicle spawns now have a new fuel system using a random percent between min and max variables. Defaults: (DynamicVehicleFuelLow = 0; DynamicVehicleFuelHigh = 100;) + [CHANGED] New vehicle spawns now damage all parts and without a limiter on fuel and engine parts, this could cause a vehicle to be very close to blowing up. + [CHANGED] Disabled simulation server side of all road debris and crashes.
This commit is contained in:
@@ -67,143 +67,174 @@ TradeInprogress = true;
|
||||
|
||||
// temp array of removed parts
|
||||
_temp_removed_array = [];
|
||||
_abort = false;
|
||||
_distance = 2;
|
||||
_reason = "";
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
// reqire fire target
|
||||
// TODO: add requirements to config. example: fire nearby, specific toolbelt items like toolbox.
|
||||
_isFireNear = {inflamed _x} count (position player nearObjects 2);
|
||||
_crafting = "Crafting";
|
||||
|
||||
diag_log format["Checking for fire: %1", _isFireNear];
|
||||
// check if fire is reqired
|
||||
_needNear = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> _crafting >> "neednearby");
|
||||
|
||||
if (_isFireNear >= 1 and _canDo) then {
|
||||
if("fire" in _needNear) then {
|
||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
};
|
||||
};
|
||||
|
||||
if(_abort) exitWith {
|
||||
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
// diag_log format["Checking for fire: %1", _isFireNear];
|
||||
|
||||
if (_canDo) then {
|
||||
|
||||
// Moved all recipes input and outputs to configs
|
||||
|
||||
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Crafting" >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Crafting" >> "input");
|
||||
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> _crafting >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> _crafting >> "input");
|
||||
_selectedRecipeTools = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> _crafting >> "require");
|
||||
|
||||
diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
|
||||
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
|
||||
|
||||
// Dry run to see if all parts are available.
|
||||
_proceed = true;
|
||||
_missing = "";
|
||||
_missingTools = false;
|
||||
{
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _missingTools = true; _missing = _x; };
|
||||
} forEach _selectedRecipeTools;
|
||||
|
||||
if(!_missingTools) then {
|
||||
|
||||
diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
|
||||
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
|
||||
|
||||
// Dry run to see if all parts are available.
|
||||
_proceed = true;
|
||||
{
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
|
||||
diag_log format["Recipe Check: %1 %2", _itemIn,_countIn];
|
||||
diag_log format["Recipe Check: %1 %2", _itemIn,_countIn];
|
||||
|
||||
// not neccessary
|
||||
//if (!(_itemIn in magazines player)) exitWith { _missing = _itemIn; _missingQty = _countIn; _proceed = false; };
|
||||
// not neccessary
|
||||
//if (!(_itemIn in magazines player)) exitWith { _missing = _itemIn; _missingQty = _countIn; _proceed = false; };
|
||||
|
||||
// match against class and parentClass
|
||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
// match against class and parentClass
|
||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
|
||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
// If all parts proceed
|
||||
if (_proceed) then {
|
||||
// If all parts proceed
|
||||
if (_proceed) then {
|
||||
|
||||
cutText ["Crafting started", "PLAIN DOWN"];
|
||||
cutText ["Crafting started", "PLAIN DOWN"];
|
||||
|
||||
player playActionNow "Medic";
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
if (_finished) then {
|
||||
|
||||
_removed_total = 0; // count total of removed items
|
||||
_tobe_removed_total = 0; // count total of all to be removed items
|
||||
// Take items
|
||||
{
|
||||
_removed = 0;
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
|
||||
_tobe_removed_total = _tobe_removed_total + _countIn;
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||
_removed = _removed + _num_removed;
|
||||
_removed_total = _removed_total + _num_removed;
|
||||
if(_num_removed >= 1) then {
|
||||
_temp_removed_array set [count _temp_removed_array,_x];
|
||||
};
|
||||
};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||
|
||||
// Only proceed if all parts were removed successfully
|
||||
if(_removed_total == _tobe_removed_total) then {
|
||||
|
||||
// Put items
|
||||
_removed_total = 0; // count total of removed items
|
||||
_tobe_removed_total = 0; // count total of all to be removed items
|
||||
// Take items
|
||||
{
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
// get display name
|
||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||
_removed = 0;
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
|
||||
_tobe_removed_total = _tobe_removed_total + _countIn;
|
||||
|
||||
// Add crafted item
|
||||
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||
_removed = _removed + _num_removed;
|
||||
_removed_total = _removed_total + _num_removed;
|
||||
if(_num_removed >= 1) then {
|
||||
_temp_removed_array set [count _temp_removed_array,_x];
|
||||
};
|
||||
};
|
||||
|
||||
} forEach _selectedRecipeOutput;
|
||||
} forEach magazines player;
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||
|
||||
// Only proceed if all parts were removed successfully
|
||||
if(_removed_total == _tobe_removed_total) then {
|
||||
|
||||
// Put items
|
||||
{
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
// get display name
|
||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||
|
||||
// Add crafted item
|
||||
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
||||
|
||||
} forEach _selectedRecipeOutput;
|
||||
|
||||
} else {
|
||||
// Refund parts since we failed
|
||||
{player addMagazine _x;} forEach _temp_removed_array;
|
||||
|
||||
cutText [format["Missing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
// Refund parts since we failed
|
||||
{player addMagazine _x;} forEach _temp_removed_array;
|
||||
|
||||
cutText [format["Missing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled crafting.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled crafting.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
||||
_textMissing = getText(configFile >> "CfgWeapons" >> _missing >> "displayName");
|
||||
cutText [format["Missing Tool: %1",_textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText ["Crafting needs a fire within 2 meters.", "PLAIN DOWN"];
|
||||
|
||||
Reference in New Issue
Block a user