mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-17 17:20:26 +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:
@@ -1,116 +1,146 @@
|
||||
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
|
||||
_vehicle = cursorTarget;
|
||||
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort","_canName","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCan","_configVeh","_capacity","_nameText","_availableCansEmpty","_availableCans"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
// Use target from addaction
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_fillCounter = 0;
|
||||
_abort = false;
|
||||
|
||||
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
|
||||
// Static vehicle fuel information
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||
_nameType = getText(_configVeh >> "displayName");
|
||||
_nameText = getText(_configVeh >> "displayName");
|
||||
|
||||
// _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
|
||||
_availableCans = ["ItemJerrycan","ItemFuelBarrel"];
|
||||
|
||||
// Get number of full jerry cans
|
||||
_refuelQty = {_x == "ItemJerrycan"} count magazines player;
|
||||
// Loop to find containers that can could hold fuel and fill them
|
||||
{
|
||||
_configCan = configFile >> "CfgMagazines" >> _x;
|
||||
|
||||
// attempt to refuel for each empty jerry can
|
||||
for "_x" from 1 to _refuelQty do {
|
||||
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + _canSize);
|
||||
if(_x in _availableCans) then {
|
||||
|
||||
// Get full can size
|
||||
_canName = _x;
|
||||
_canSize = getNumber(_configCan >> "fuelQuantity");
|
||||
_canText = getText(_configCan >> "displayName");
|
||||
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + _canSize);
|
||||
|
||||
if (_newFuel > _capacity) exitWith {
|
||||
cutText [format["%1 is full of fuel.",_nameType], "PLAIN DOWN"];
|
||||
};
|
||||
if (_newFuel <= _capacity) then {
|
||||
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
// calculate new fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
_fillCounter = _fillCounter + 1;
|
||||
diag_log ("refuel check: " + str(_newFuel) + " / " + str(_capacity));
|
||||
|
||||
if(_refuelQty == 1) then {
|
||||
cutText ["Preparing to refuel, stand still to drain full jerry can.", "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format[("Preparing to refuel, stand still to drain full jerry can %1 of %2."),_fillCounter,_refuelQty] , "PLAIN DOWN"];
|
||||
};
|
||||
cutText [format["Preparing to refuel, stand still to drain %1.",_canText], "PLAIN DOWN"];
|
||||
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
// Play sound and alert zombies
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
if(!dayz_isSwimming) then {
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
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;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled refuel." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
} else {
|
||||
// Alternate method in water make sure player stays in one spot for 6 seconds
|
||||
_location1 = getPosATL player;
|
||||
sleep 6;
|
||||
_location2 = getPosATL player;
|
||||
|
||||
if(_location1 distance _location2 > 0.1) then {
|
||||
_finished = false;
|
||||
} else {
|
||||
_finished = true;
|
||||
};
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
if(!dayz_isSwimming) then {
|
||||
|
||||
if ("ItemJerrycan" in magazines player) then {
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
player removeMagazine "ItemJerrycan";
|
||||
player addMagazine "ItemJerrycanEmpty";
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
|
||||
// Get fuel levels again to prevent wasted gas from others filling
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + _canSize);
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
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;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
publicVariable "dayzSetFuel";
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
|
||||
} else {
|
||||
// Alternate method in water make sure player stays in one spot for 6 seconds
|
||||
_location1 = getPosATL player;
|
||||
sleep 6;
|
||||
_location2 = getPosATL player;
|
||||
if(_location1 distance _location2 < 3) then {
|
||||
_finished = true;
|
||||
};
|
||||
};
|
||||
|
||||
cutText [format[localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"];
|
||||
if (_finished) then {
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
// Get vehicle fuel levels again
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + _canSize);
|
||||
|
||||
sleep 1;
|
||||
if (_newFuel <= _capacity) then {
|
||||
|
||||
// calculate minimum needed fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
if(([player,_canName] call BIS_fnc_invRemove) == 1) then {
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
publicVariable "dayzSetFuel";
|
||||
|
||||
// Play sound
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
|
||||
// Add filled can
|
||||
player addMagazine _canName+"Empty";
|
||||
|
||||
cutText [format[localize "str_player_05",_nameText,_canSize], "PLAIN DOWN"];
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
sleep 1;
|
||||
} else {
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["%1 cannot hold that much fuel.",_nameText], "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText ["Canceled refuel." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["%1 cannot hold that much fuel.",_nameText], "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
if(_abort) exitWith {};
|
||||
};
|
||||
|
||||
// exit if abort flag was set
|
||||
if(_abort) exitWith {};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
TradeInprogress = false;
|
||||
Reference in New Issue
Block a user