diff --git a/SQF/dayz_code/CfgMagazines.hpp b/SQF/dayz_code/CfgMagazines.hpp index ce4832ec3..50aed2307 100644 --- a/SQF/dayz_code/CfgMagazines.hpp +++ b/SQF/dayz_code/CfgMagazines.hpp @@ -46,7 +46,7 @@ class CfgMagazines { neednearby[] = {"workshop"}; requiretools[] = {"ItemToolbox","ItemKnife"}; output[] = {{"sun_shade_kit",1}}; - input[] = {{"ItemCanvas",1},{"PartWoodLumber",4}}; + input[] = {{"bulk_empty",1},{"ItemCanvas",1},{"PartWoodLumber",4}}; }; class Crafting4 { @@ -98,7 +98,7 @@ class CfgMagazines { neednearby[] = {"workshop"}; requiretools[] = {"ItemEtool","ItemToolbox"}; output[] = {{"light_pole_kit",1}}; - input[] = {{"ItemLightBulb",1},{"PartGeneric",1},{"PartWoodLumber",6}}; + input[] = {{"bulk_empty",1},{"ItemLightBulb",1},{"PartGeneric",1},{"PartWoodLumber",6}}; }; }; }; @@ -831,7 +831,7 @@ class CfgMagazines { neednearby[] = {}; requiretools[] = {"ItemToolbox","ItemCrowbar"}; output[] = {{"wooden_shed_kit",1}}; - input[] = {{"ItemCorrugated",2},{"PartWoodPlywood",5},{"PartWoodLumber",5}}; + input[] = {{"bulk_empty",1},{"ItemCorrugated",2},{"PartWoodPlywood",5},{"PartWoodLumber",5}}; }; class Crafting1 { @@ -840,7 +840,7 @@ class CfgMagazines { neednearby[] = {}; requiretools[] = {"ItemToolbox","ItemCrowbar"}; output[] = {{"outhouse_kit",1}}; - input[] = {{"ItemCorrugated",1},{"PartWoodPlywood",5},{"PartWoodLumber",3},{"ItemTrashToiletpaper",1}}; + input[] = {{"bulk_empty",1},{"ItemCorrugated",1},{"PartWoodPlywood",5},{"PartWoodLumber",3},{"ItemTrashToiletpaper",1}}; }; class Crafting2 { @@ -849,7 +849,7 @@ class CfgMagazines { neednearby[] = {}; requiretools[] = {"ItemToolbox","ItemCrowbar"}; output[] = {{"storage_shed_kit",1}}; - input[] = {{"ItemCorrugated",5},{"PartWoodPlywood",2},{"PartWoodLumber",5}}; + input[] = {{"bulk_empty",1},{"ItemCorrugated",5},{"PartWoodPlywood",2},{"PartWoodLumber",5}}; }; }; }; @@ -879,7 +879,7 @@ class CfgMagazines { neednearby[] = {}; requiretools[] = {"ItemToolbox","ItemCrowbar"}; output[] = {{"rusty_gate_kit",1}}; - input[] = {{"ItemPole",6},{"PartGeneric",3},{"ItemTankTrap",1}}; + input[] = {{"bulk_empty",1},{"ItemPole",6},{"PartGeneric",3},{"ItemTankTrap",1}}; }; }; }; @@ -953,13 +953,22 @@ class CfgMagazines { { class Crafting { - text = "Make 6 pack of Coke"; + text = "Pack 6 Coke"; script = "spawn player_craftItem;"; neednearby[] = {}; requiretools[] = {"ItemToolbox"}; output[] = {{"bulk_ItemSodaCoke",1}}; input[] = {{"bulk_empty",1},{"ItemSodaCoke",6}}; }; + class Crafting1 + { + text = "Pack 6 Pepsi"; + script = "spawn player_craftItem1;"; + neednearby[] = {}; + requiretools[] = {"ItemToolbox"}; + output[] = {{"bulk_ItemSodaPepsi",1}}; + input[] = {{"bulk_empty",1},{"ItemSodaPepsi",6}}; + }; }; }; class bulk_ItemSodaCoke: bulk @@ -1556,7 +1565,7 @@ class CfgMagazines { neednearby[] = {}; requiretools[] = {"ItemToolbox","ItemKnife"}; output[] = {{"stick_fence_kit",1}}; - input[] = {{"PartWoodPile",6}}; + input[] = {{"bulk_empty",1},{"PartWoodPile",6}}; }; @@ -1590,12 +1599,22 @@ class CfgMagazines { }; class Crafting1 { - text = "Craft Deer Stand"; + text = "Craft Supply Crate"; script = "spawn player_craftItem1;"; + neednearby[] = {"sawmil"}; + requiretools[] = {"ItemToolbox"}; + output[] = {{"PartWoodPlywood",1}}; + input[] = {{"PartWoodLumber",4},{"PartGeneric",1}}; + + }; + class Crafting2 + { + text = "Craft Deer Stand"; + script = "spawn player_craftItem2;"; neednearby[] = {"workshop"}; requiretools[] = {"ItemToolbox","ItemCrowbar"}; output[] = {{"deer_stand_kit",1}}; - input[] = {{"PartWoodLumber",8},{"PartWoodPile",2}}; + input[] = {{"bulk_empty",1},{"PartWoodLumber",8},{"PartWoodPile",2}}; }; }; @@ -1617,7 +1636,7 @@ class CfgMagazines { neednearby[] = {}; requiretools[] = {"ItemToolbox"}; output[] = {{"wood_shack_kit",1}}; - input[] = {{"PartWoodPlywood",4},{"PartWoodLumber",4}}; + input[] = {{"bulk_empty",1},{"PartWoodPlywood",4},{"PartWoodLumber",4}}; }; }; @@ -1979,7 +1998,7 @@ class CfgMagazines { neednearby[] = {"workshop"}; requiretools[] = {"ItemToolbox","ItemKnife"}; output[] = {{"desert_net_kit",1}}; - input[] = {{"ItemTent",4},{"ItemPole",4}}; + input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; }; class Crafting1 { @@ -2014,7 +2033,7 @@ class CfgMagazines { neednearby[] = {"workshop"}; requiretools[] = {"ItemToolbox","ItemKnife"}; output[] = {{"desert_net_kit",1}}; - input[] = {{"ItemTent",4},{"ItemPole",4}}; + input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; }; class Crafting1 { @@ -2023,7 +2042,7 @@ class CfgMagazines { neednearby[] = {"workshop"}; requiretools[] = {"ItemToolbox","ItemKnife"}; output[] = {{"forest_net_kit",1}}; - input[] = {{"ItemTent",4},{"ItemPole",4}}; + input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; }; }; }; @@ -2048,7 +2067,7 @@ class CfgMagazines { neednearby[] = {"workshop"}; requiretools[] = {"ItemToolbox","ItemKnife"}; output[] = {{"desert_net_kit",1}}; - input[] = {{"ItemTent",4},{"ItemPole",4}}; + input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; }; class Crafting1 { @@ -2057,7 +2076,7 @@ class CfgMagazines { neednearby[] = {"workshop"}; requiretools[] = {"ItemToolbox","ItemKnife"}; output[] = {{"forest_net_kit",1}}; - input[] = {{"ItemTent",4},{"ItemPole",4}}; + input[] = {{"bulk_empty",1},{"ItemTent",4},{"ItemPole",4}}; }; }; }; @@ -2094,7 +2113,7 @@ class CfgMagazines { neednearby[] = {}; requiretools[] = {"ItemEtool","ItemToolbox"}; output[] = {{"sandbag_nest_kit",1}}; - input[] = {{"ItemSandbag",4},{"PartWoodPlywood",2},{"PartWoodLumber",4}}; + input[] = {{"bulk_empty",1},{"ItemSandbag",4},{"PartWoodPlywood",2},{"PartWoodLumber",4}}; }; /* class Crafting2 @@ -2104,7 +2123,7 @@ class CfgMagazines { neednearby[] = {"workshop"}; requiretools[] = {"ItemEtool","ItemToolbox","M240_DZ"}; output[] = {{"m240_nest_kit",1}}; - input[] = {{"ItemSandbag",4},{"ItemCanvas",1},{"PartWoodPlywood",4},{"PartWoodLumber",3}}; + input[] = {{"bulk_empty",1},{"ItemSandbag",4},{"ItemCanvas",1},{"PartWoodPlywood",4},{"PartWoodLumber",3}}; consumeweapons[] = {"M240_DZ"}; }; */ diff --git a/SQF/dayz_code/actions/trade_metals.sqf b/SQF/dayz_code/actions/trade_metals.sqf index 77d8805e3..fee2b56c6 100644 --- a/SQF/dayz_code/actions/trade_metals.sqf +++ b/SQF/dayz_code/actions/trade_metals.sqf @@ -18,7 +18,9 @@ _metals_conversion = [ ["ItemCopperBar10oz","ItemSilverBar",3,1,"buy","Silver","10oz Copper",103], ["ItemGoldBar","ItemSilverBar10oz",1,3,"buy","10oz Silver","Gold",102], - ["ItemSilverBar10oz","ItemGoldBar",3,1,"buy","Gold","10oz Silver",101] + ["ItemSilverBar10oz","ItemGoldBar",3,1,"buy","Gold","10oz Silver",101], + + ["ItemBriefcase100oz","ItemGoldBar10oz",1,12,"buy","10oz Gold","Full Briefcase",99] ]; diff --git a/SQF/dayz_code/cfgVehicles.hpp b/SQF/dayz_code/cfgVehicles.hpp index 8f28afd33..e77e3e2dd 100644 --- a/SQF/dayz_code/cfgVehicles.hpp +++ b/SQF/dayz_code/cfgVehicles.hpp @@ -367,7 +367,7 @@ class Citizen1; // External class reference class SurvivorWurban_DZ: SurvivorW2_DZ { hiddenSelections[] = {"Camo"}; - hiddenSelectionsTextures[] = {"\z\addons\dayz_epoch\textures\textures\UrbanGirl.paa"}; + hiddenSelectionsTextures[] = {"\z\addons\dayz_epoch\textures\UrbanGirl.paa"}; }; class PZombie_VB: Citizen1 diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index fb1aba737..502ae1266 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -200,27 +200,29 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu s_player_lockUnlock_crtl = -1; }; - /* - //Allow player to force save - if((_isVehicle or _isTent) and !_isMan) then { - if (s_player_forceSave < 0) then { - s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""]; + if(DZE_AllowForceSave) then { + //Allow player to force save + if((_isVehicle or _isTent) and !_isMan) then { + if (s_player_forceSave < 0) then { + s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""]; + }; + } else { + player removeAction s_player_forceSave; + s_player_forceSave = -1; }; - } else { - player removeAction s_player_forceSave; - s_player_forceSave = -1; }; - - if((_isVehicle or _isTent or _isnewstorage) and _isAlive and !_isMan) then { - if (s_player_checkGear < 0) then { - s_player_checkGear = player addAction ["Cargo Check", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""]; + If(DZE_AllowCargoCheck) then { + if((_isVehicle or _isTent or _isnewstorage) and _isAlive and !_isMan) then { + if (s_player_checkGear < 0) then { + s_player_checkGear = player addAction ["Cargo Check", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""]; + }; + } else { + player removeAction s_player_checkGear; + s_player_checkGear = -1; }; - } else { - player removeAction s_player_checkGear; - s_player_checkGear = -1; }; - */ + //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 { @@ -400,13 +402,6 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu player removeAction s_player_fillgen; s_player_fillgen = -1; }; - - - // not the right place for this... - // Find if fuel pump is within 5 meters. - // If so then look for a generator within 30m of pump - // and if generator is running - // Allow auto fill //Sleep if(_cursorTarget isKindOf "TentStorage" and _ownerID == dayz_characterID) then { diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index b57780888..a01589482 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -564,4 +564,13 @@ if(!isDedicated) then { //if (uiNamespace getVariable ['DZ_displayUI', 0] == 2) then { // dayzDebug = true; //}; + + // DayZ Epoch Client only variables + if(isNil "DZE_AllowForceSave") then { + DZE_AllowForceSave = false; + }; + if(isNil "DZE_AllowCargoCheck") then { + DZE_AllowCargoCheck = true; + }; + }; \ No newline at end of file diff --git a/SQF/dayz_server/modules/crash_spawner.sqf b/SQF/dayz_server/modules/crash_spawner.sqf new file mode 100644 index 000000000..88d180fa4 --- /dev/null +++ b/SQF/dayz_server/modules/crash_spawner.sqf @@ -0,0 +1,91 @@ +private ["_guaranteedLoot","_randomizedLoot","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_fadeFire","_crashModel","_lootTable","_crashName","_spawnRoll","_position","_crash","_config","_hasAdjustment","_newHeight","_adjustedPos","_num","_itemTypes","_index","_weights","_cntWeights","_nearby","_itemType"]; + +_guaranteedLoot = 3; +_randomizedLoot = 4; +_spawnChance = 0.90; +_spawnMarker = 'center'; +// _spawnRadius = 5000; +_spawnRadius = HeliCrashArea; +_spawnFire = true; +_fadeFire = false; + +_spawnRoll = random 1; +if (_spawnRoll <= _spawnChance) then { + + _crashModel = ["UH60Wreck_DZ","UH1Wreck_DZ","Mass_grave_DZ"] call BIS_fnc_selectRandom; + + if(_crashModel == "Mass_grave_DZ") then { + _lootTable = "MassGrave"; + } else { + _lootTable = ["Military","HeliCrash","MilitarySpecial"] call BIS_fnc_selectRandom; + }; + + _crashName = getText (configFile >> "CfgVehicles" >> _crashModel >> "displayName"); + + _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos; + + diag_log(format["CRASHSPAWNER: Spawning '%1' with loot table '%2' NOW! (%3) at: %4", _crashName, _lootTable, time, str(_position)]); + + _crash = createVehicle [_crashModel,_position, [], 0, "CAN_COLLIDE"]; + // Randomize the direction the wreck is facing + _crash setDir round(random 360); + + // Using "custom" wrecks (using the destruction model of a vehicle vs. a prepared wreck model) will result + // in the model spawning halfway in the ground. To combat this, an OPTIONAL configuration can be tied to + // the CfgVehicles class you've created for the custom wreck to define how high above the ground it should + // spawn. This is optional. + _config = configFile >> "CfgVehicles" >> _crashModel >> "heightAdjustment"; + _hasAdjustment = isNumber(_config); + _newHeight = 0; + if (_hasAdjustment) then { + _newHeight = getNumber(_config); + }; + + // Must setPos after a setDir otherwise the wreck won't level itself with the terrain + _adjustedPos = [(_position select 0), (_position select 1), _newHeight]; + //diag_log(format["DIAG: Designated Position: %1", str(_adjustedPos)]); + _crash setPos _adjustedPos; + + // I don't think this is needed (you can't get "in" a crash), but it was in the original DayZ Crash logic + dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_crash]; + + _crash setVariable ["ObjectID","1",true]; + + // Disable simulation server side + _crash enableSimulation false; + + _num = round(random _randomizedLoot) + _guaranteedLoot; + + if(_crashModel == "Mass_grave_DZ") then { + _spawnFire = false; + _num = _num * 2; + }; + + if (_spawnFire) then { + //["dayzFire",[_crash,2,time,false,_fadeFire]] call broadcastRpcCallAll; + dayzFire = [_crash,2,time,false,_fadeFire]; + publicVariable "dayzFire"; + _crash setvariable ["fadeFire",_fadeFire,true]; + }; + + _config = configFile >> "CfgBuildingLoot" >> _lootTable; + _itemTypes = [] + getArray (_config >> "itemType"); + _index = dayz_CBLBase find toLower(_lootTable); + _weights = dayz_CBLChances select _index; + _cntWeights = count _weights; + + for "_x" from 1 to _num do { + //create loot + _index = floor(random _cntWeights); + _index = _weights select _index; + _itemType = _itemTypes select _index; + [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot; + diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _crashName, _lootTable]); + }; + + // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items. + _nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)]; + { + _x setVariable ["permaLoot",true]; + } forEach _nearBy; +}; \ No newline at end of file diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf index 518c4383b..b640b26ec 100644 --- a/SQF/dayz_server/system/server_monitor.sqf +++ b/SQF/dayz_server/system/server_monitor.sqf @@ -284,7 +284,7 @@ if (isServer and isNil "sm_done") then { }; // [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire] - nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', HeliCrashArea, true, false] spawn server_spawnCrashSite; + // nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', HeliCrashArea, true, false] spawn server_spawnCrashSite; // Epoch Events nul = [] spawn server_spawnEvents;