mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-20 18:36:29 +03:00
1.0.0.6 Developer Build
+ [CHANGED] lowered metal pole crafting requirements to 1 scrap 1 tank
trap.
+ [CHANGED] Corrugated crafting now
{"ItemPole",1},{"PartGeneric",2},{"ItemTankTrap",1},{"PartWoodLumber",2}.
+ [CHANGED] Generator can now be started and stopped.
+ [FIXED] Generators cannot be removed while running.
+ [ADDED] New larger backpack: DZ_LargeGunBag_EP1 (Weapons = 10;
Magazines = 45) added to MilitarySpecial loot table.
+ [ADDED] New backpack: DZ_GunBag_EP1 (Weapons = 6; Magazines = 8) added
to Militaryloot table..
+ [ADDED] New backpack: DZ_CompactPack_EP1 (Weapons = 1; Magazines = 18)
added to Supermarket loot table.
+ [ADDED] New backpack: DZ_TerminalPack_EP1 (Weapons = 1; Magazines =
12) added to Supermarket loot table.
+ [ADDED] Green domed tent ItemTentDomed2 - TentStorageDomed2 added to
Residential loot table at 0.01.
+ [ADDED] When removing road debris you will now get one random car part
in return.
+ [ADDED] Revamped chopping wood so that it now actually chops down a
tree within 5m. Supports specific tree types for most maps.
+ [ADDED] Craftable stick fence requires tools
{"ItemToolbox","ItemKnife"} and input {"PartWoodPile",6}.
+ [ADDED] Buildable stick fence StickFence_DZ requires tools
{"ItemEtool","ItemToolbox"}.
+ [CHANGED] Middle floor of A2 in Namalsk changed to MilitarySpecial.
+ [ADDED] 55 Gallon Fuel Barrel as a rare spawn to Farm and Industrial
loot tables at 0.005.
+ [CHANGED] Lowered chance for spawn of generator to 0.005 from 0.01.
+ [FIXED] incorrectly setting characterID server side with wrong
variable.
This commit is contained in:
@@ -3,6 +3,9 @@ private ["_vehicle","_started","_finished","_animState","_isMedic"];
|
||||
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
player removeAction s_player_fillgen;
|
||||
|
||||
|
||||
// Use target from addaction
|
||||
_vehicle = _this select 3;
|
||||
|
||||
@@ -40,29 +43,49 @@ if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled refuel." , "PLAIN DOWN"]
|
||||
cutText ["Canceled." , "PLAIN DOWN"]
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
// take jerry can and replace with empty
|
||||
if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then {
|
||||
player addMagazine "ItemJerrycanEmpty";
|
||||
// take jerry can and replace with empty
|
||||
|
||||
if(!(_vehicle getVariable ["GeneratorFilled", false]) and ("ItemJerrycan" in magazines player)) then {
|
||||
|
||||
if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then {
|
||||
|
||||
player addMagazine "ItemJerrycanEmpty";
|
||||
|
||||
// mark as once filled
|
||||
_vehicle setVariable ["GeneratorFilled", true,true];
|
||||
|
||||
// Start generator
|
||||
_vehicle setVariable ["GeneratorRunning", true,true];
|
||||
|
||||
// Sound_Generator1
|
||||
// Looks like this was the entended way of making the sound, lets test
|
||||
_soundSource = createSoundSource ["Sound_Generator1", position player, [], 0];
|
||||
|
||||
_vehicle setVariable ["GeneratorSound", _soundSource,true];
|
||||
|
||||
// TODO: Add running sounds to generator
|
||||
cutText ["Generator has been started.", "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
|
||||
// Start generator
|
||||
_vehicle setVariable ["GeneratorRunning", true,true];
|
||||
|
||||
// Sound_Generator1
|
||||
// Looks like this was the entended way of making the sound, lets test
|
||||
//_classname = "Sound_Generator1";
|
||||
_soundSource = createSoundSource ["Sound_Generator1", position player, [], 0];
|
||||
|
||||
//_location = (getPosATL _vehicle);
|
||||
|
||||
//_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_soundSource = createSoundSource ["Generator1", position player, [], 0];
|
||||
_vehicle setVariable ["GeneratorSound", _soundSource,true];
|
||||
|
||||
// TODO: Add running sounds to generator
|
||||
cutText ["Generator has been started.", "PLAIN DOWN"];
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
TradeInprogress = false;
|
||||
s_player_fillgen = -1;
|
||||
@@ -23,55 +23,53 @@ _text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
|
||||
|
||||
// check for near plot
|
||||
_findNearestPole = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 30];
|
||||
_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], 30];
|
||||
_findNearestPole = [];
|
||||
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} foreach _findNearestPoles;
|
||||
|
||||
_IsNearPlot = count (_findNearestPole);
|
||||
_IsNearPlot = count (_findNearestPole);
|
||||
|
||||
if(_IsNearPlot == 0) then {
|
||||
|
||||
// Allow building of plot
|
||||
if(_classname == "Plastic_Pole_EP1_DZ") then {
|
||||
if(count (nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 60]) == 0) then {
|
||||
if({alive _x} count (nearestObjects[(vehicle player), ["Plastic_Pole_EP1_DZ"], 45]) == 0) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
// Since there are plots nearby we check for ownership and then for friend status
|
||||
|
||||
// select closest pole
|
||||
|
||||
_nearestPole = _findNearestPole select 0;
|
||||
|
||||
// Find owner
|
||||
_ownerID = _nearestPole getVariable["CharacterID","0"];
|
||||
|
||||
diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
|
||||
|
||||
// check if friendly to owner
|
||||
if(dayz_characterID == _ownerID) then {
|
||||
// owner can build anything within his plot
|
||||
|
||||
if(_classname == "Plastic_Pole_EP1_DZ") then {
|
||||
if(count ([player, ["Plastic_Pole_EP1_DZ"], 30]) == 0) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
} else {
|
||||
_canBuildOnPlot = true;
|
||||
// owner can build anything within his plot except other plots witin
|
||||
if(_classname != "Plastic_Pole_EP1_DZ") then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
// not the owner so check if user is friendly to owner.
|
||||
|
||||
_friendlies = player getVariable ["friendlies",[]];
|
||||
// check if friendly to owner
|
||||
if(_ownerID in _friendlies) then {
|
||||
if(_classname != "Plastic_Pole_EP1_DZ") then {
|
||||
// disallow building plot
|
||||
if(_classname != "Plastic_Pole_EP1_DZ") then {
|
||||
_friendlies = player getVariable ["friendlyTo",[]];
|
||||
// check if friendly to owner
|
||||
if(_ownerID in _friendlies) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
if(!_canBuildOnPlot) exitWith { TradeInprogress = false; cutText ["Building requires plot within 30m" , "PLAIN DOWN"]; };
|
||||
// _message
|
||||
if(!_canBuildOnPlot) exitWith { TradeInprogress = false; cutText ["Building requires plot pole within 30m" , "PLAIN DOWN"]; };
|
||||
|
||||
_missing = "";
|
||||
_hasrequireditem = true;
|
||||
@@ -249,6 +247,8 @@ if (_hasrequireditem) then {
|
||||
if(_num_removed == 1) then {
|
||||
|
||||
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
|
||||
|
||||
_tmpbuilt setVariable ["characterID",dayz_characterID,true];
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_tmpbuilt,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_tmpbuilt,[_dir,_location],_classname];
|
||||
|
||||
@@ -3,22 +3,101 @@ private["_item","_location","_isOk","_dir","_classname"];
|
||||
if(TradeInprogress) exitWith { cutText ["Harvest wood already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// allowed trees list
|
||||
_trees = ["t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fagus2s.p3d","t_fagus2f.p3d","t_betula1f.p3d","t_betula2f.p3d","t_betula2s.p3d","t_betula2w.p3d","t_alnus2s.p3d","t_acer2s.p3d","t_populus3s.p3d","t_quercus2f.p3d","t_sorbus2s.p3d","t_malus1s.p3d","t_salix2s.p3d","t_picea1s_w.p3d","t_picea2s_w.p3d","t_ficusb2s_ep1.p3d","t_populusb2s_ep1.p3d","t_populusf2s_ep1.p3d","t_amygdalusc2s_ep1.p3d","t_ficusb2s_ep1.p3d","t_pistacial2s_ep1.p3d","t_pinuse2s_ep1.p3d","t_pinuss3s_ep1.p3d","t_prunuss2s_ep1.p3d","t_pinusn2s.p3d","t_pinusn1s.p3d","t_pinuss2f.p3d","t_poplar2f_dead_pmc.p3d","misc_torzotree_pmc.p3d","misc_burnspruce_pmc.p3d","brg_cocunutpalm8.p3d","brg_umbrella_acacia01b.p3d","brg_jungle_tree_canopy_1.p3d","brg_jungle_tree_canopy_2.p3d","brg_cocunutpalm4.p3d","brg_cocunutpalm3.p3d","palm_04.p3d","brg_cocunutpalm2.p3d","brg_jungle_tree_antiaris.p3d","brg_cocunutpalm1.p3d"];
|
||||
|
||||
_item = _this;
|
||||
call gear_ui_init;
|
||||
|
||||
if (["forest",dayz_surfaceType] call fnc_inString) then {
|
||||
player playActionNow "Medic";
|
||||
[player,20,false,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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) then {
|
||||
|
||||
_nearByTrees = 0;
|
||||
|
||||
_findNearestTree = [];
|
||||
{
|
||||
if("" == typeOf _x) then {
|
||||
|
||||
if (alive _x) then {
|
||||
|
||||
_objInfo = toArray(str(_x));
|
||||
_lenInfo = count _objInfo - 1;
|
||||
_objName = [];
|
||||
_i = 0;
|
||||
// determine where the object name starts
|
||||
{
|
||||
if (ASCII_COLON == _objInfo select _i) exitWith {};
|
||||
_i = _i + 1;
|
||||
} forEach _objInfo;
|
||||
_i = _i + 2; // skip the ": " part
|
||||
for "_k" from _i to _lenInfo do {
|
||||
_objName = _objName + [_objInfo select _k];
|
||||
};
|
||||
_objName = toLower(toString(_objName));
|
||||
|
||||
// Exit since we found a tree
|
||||
if (_objName in _trees) exitWith {
|
||||
_findNearestTree set [(count _findNearestTree),_x];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
} foreach nearestObjects [getPos player, [], 5];
|
||||
|
||||
diag_log format["DEBUG TREES: %1", _findNearestTree];
|
||||
|
||||
if (count(_findNearestTree) >= 1) then {
|
||||
|
||||
_result = [player,"PartWoodPile"] call BIS_fnc_invAdd;
|
||||
[player,"chopwood",0,false] call dayz_zombieSpeak;
|
||||
if (_result) then {
|
||||
cutText [localize "str_player_25", "PLAIN DOWN"];
|
||||
_tree = _findNearestTree select 0;
|
||||
|
||||
if("" == typeOf _tree) then {
|
||||
_tree setDamage 1;
|
||||
};
|
||||
|
||||
diag_log format["DEBUG TREE DAMAGE: %1", _tree];
|
||||
} else {
|
||||
cutText [localize "str_player_24", "PLAIN DOWN"];
|
||||
};
|
||||
[player,20,false,(getPosATL player)] spawn player_alertZombies;
|
||||
player playActionNow "Medic";
|
||||
sleep 3;
|
||||
} else {
|
||||
cutText [localize "str_player_23", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
} else {
|
||||
cutText [localize "str_player_23", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled Harvest Wood.", "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -3,7 +3,14 @@ delete object from db with extra waiting by [VB]AWOL
|
||||
parameters: _obj
|
||||
*/
|
||||
private ["_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_id","_objType","_sfx","_dis","_itemOut","_countOut","_textCreate","_selectedRemoveOutput"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Remove already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_obj = _this select 3;
|
||||
|
||||
if(_obj getVariable ["GeneratorRunning", false]) exitWith {TradeInprogress = false; cutText ["Cannot remove running generator.", "PLAIN DOWN"];};
|
||||
|
||||
_objectID = _obj getVariable ["ObjectID","0"];
|
||||
_objectUID = _obj getVariable ["ObjectUID","0"];
|
||||
|
||||
@@ -16,8 +23,11 @@ if(isNumber (configFile >> "CfgVehicles" >> _objType >> "constructioncount")) th
|
||||
_limit = getNumber(configFile >> "CfgVehicles" >> _objType >> "constructioncount");
|
||||
};
|
||||
|
||||
_findNearestPole = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 30];
|
||||
_IsNearPlot = count (_findNearestPole);
|
||||
_findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 30];
|
||||
_findNearestPole = [];
|
||||
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} foreach _findNearestPoles;
|
||||
|
||||
_IsNearPlot = count (_findNearestPole);
|
||||
|
||||
if(_IsNearPlot >= 1) then {
|
||||
|
||||
@@ -29,7 +39,7 @@ if(_IsNearPlot >= 1) then {
|
||||
// check if friendly to owner
|
||||
if(dayz_characterID != _ownerID) then {
|
||||
|
||||
_friendlies = player getVariable ["friendlies",[]];
|
||||
_friendlies = player getVariable ["friendlyTo",[]];
|
||||
// check if friendly to owner
|
||||
if(!(_ownerID in _friendlies)) then {
|
||||
_limit = round(_limit*2);
|
||||
@@ -37,8 +47,6 @@ if(_IsNearPlot >= 1) then {
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
cutText [format["Starting de-construction of %1.",_objType], "PLAIN DOWN"];
|
||||
|
||||
// Alert zombies once.
|
||||
@@ -113,17 +121,24 @@ if (_proceed) then {
|
||||
dayzDeleteObj = [_objectID,_objectUID];
|
||||
publicVariableServer "dayzDeleteObj";
|
||||
|
||||
_isWreck = typeOf _obj in ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];
|
||||
|
||||
deleteVehicle _obj;
|
||||
|
||||
if(_isWreck) then {
|
||||
// Find one random part to give back
|
||||
_refundpart = ["PartEngine","PartGeneric","PartFueltank","PartWheel","PartGlass","ItemJerrycan"] call BIS_fnc_selectRandom;
|
||||
_selectedRemoveOutput = [_refundpart];
|
||||
} else {
|
||||
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
|
||||
};
|
||||
|
||||
// give refund items
|
||||
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
|
||||
if((count _selectedRemoveOutput) > 0) then {
|
||||
// Put items
|
||||
{
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
diag_log format["Removal Output: %1 %2", _itemOut,_countOut];
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
@@ -139,4 +154,5 @@ if (_proceed) then {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
TradeInprogress = false;
|
||||
65
dayz_code/actions/stopGenerator.sqf
Normal file
65
dayz_code/actions/stopGenerator.sqf
Normal file
@@ -0,0 +1,65 @@
|
||||
private ["_vehicle","_started","_finished","_animState","_isMedic"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Stop already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
player removeAction s_player_fillgen;
|
||||
|
||||
|
||||
// Use target from addaction
|
||||
_vehicle = _this select 3;
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
cutText ["Preparing stop generator, move to cancel.", "PLAIN DOWN"];
|
||||
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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) then {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled." , "PLAIN DOWN"]
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// find sound and delete
|
||||
_soundObject = _vehicle getVariable "GeneratorSound";
|
||||
|
||||
deleteVehicle _soundObject;
|
||||
|
||||
// Stop generator
|
||||
_vehicle setVariable ["GeneratorRunning", false,true];
|
||||
|
||||
// TODO: Add running sounds to generator
|
||||
cutText ["Generator has been stopped.", "PLAIN DOWN"];
|
||||
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
s_player_fillgen = -1;
|
||||
@@ -116,14 +116,43 @@ if (_qty >= _qty_in) then {
|
||||
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
} else {
|
||||
|
||||
_obj = _obj select 0;
|
||||
|
||||
|
||||
//check make sure there are no fully damaged tires fully
|
||||
_hitpoints = _obj call vehicle_getHitpoints;
|
||||
_okToSell = true;
|
||||
|
||||
// count parts
|
||||
_tires = 0;
|
||||
|
||||
// total damage
|
||||
_tireDmg = 0;
|
||||
|
||||
_damage = 0;
|
||||
{
|
||||
if(["Wheel",_x,false] call fnc_inString) then {
|
||||
_damage = [_obj,_x] call object_getHit;
|
||||
_tireDmg = _tireDmg + _damage;
|
||||
_tires = _tires + 1;
|
||||
};
|
||||
} forEach _hitpoints;
|
||||
|
||||
// find average tire damage
|
||||
if(_tireDmg > 0 and _tires > 0) then {
|
||||
if((_tireDmg / _tires) > 0.75) then {
|
||||
_okToSell = false;
|
||||
};
|
||||
};
|
||||
|
||||
if(_okToSell) then {
|
||||
|
||||
if((damage _obj) >= 0.75) then {
|
||||
// Sell Vehicle
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
_obj = _obj select 0;
|
||||
_objectID = _obj getVariable ["ObjectID","0"];
|
||||
_objectUID = _obj getVariable ["ObjectUID","0"];
|
||||
|
||||
@@ -134,11 +163,7 @@ if (_qty >= _qty_in) then {
|
||||
deleteVehicle _obj;
|
||||
|
||||
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
} else {
|
||||
_dampercent = (damage _obj) * 100;
|
||||
cutText [format[("Cannot sell %1 it is %2% damaged and cannot be sold under 75%."),_textPartIn,_dampercent], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
|
||||
Reference in New Issue
Block a user