27 Commits

Author SHA1 Message Date
worldwidesorrow
6ca6aea4fc Add Namalsk fuel station to service point array 2023-09-17 10:11:01 -05:00
worldwidesorrow
24a8ad39fa Update CHANGE LOG 1.0.8.txt 2023-09-15 14:12:01 -05:00
worldwidesorrow
d9c4075143 Add Object A2 sensor with light and sound SFX
Added sensor to mission.sqm to trigger Sumrak's custom lighting and sound effects when entering Object A2. The config position in mission.sqm doesn't want to work correctly with the distance command so I used the original position from Sumrak's file. The trigger activates when you get down the ladder about 2 meters.
2023-09-15 14:09:18 -05:00
worldwidesorrow
55ffa33628 Update CHANGE LOG 1.0.8.txt 2023-09-15 12:08:51 -05:00
worldwidesorrow
b8f201d986 Add namalsk POIs
Fixed Object A2 scenery and converted to compact arrays. Fixed floating objects, objects sticking through walls, and disabled simulation to stop bouncing of some objects. Objects that originally used setPosASL converted to setPosATL. Added some map fixes for Object A2 ladder shaft fall hazards and barracks entrances that required vaulting to enter. Added rail gun spawning with configurable chance. The POI call in init.sqf has the individual POI files listed in an array so server owners can comment them out or remove them if they don't want them.
2023-09-15 12:05:55 -05:00
A Man
366bda6af4 Fix a missing word for the german language 2023-09-15 08:24:02 +02:00
worldwidesorrow
8def5b3810 Update CHANGE LOG 1.0.8.txt 2023-09-15 00:00:19 -05:00
worldwidesorrow
057ecc094c Add option to exempt players in safezones from EVR effects 2023-09-14 23:48:26 -05:00
worldwidesorrow
60ff7ab07b Update CHANGE LOG 1.0.8.txt 2023-09-14 21:39:53 -05:00
worldwidesorrow
b27f189259 Add option to limit static weapon access within plot radius.
If the config variable is set to true then then static weapon access within the plot radius is limited to plot owner and plot friends.
2023-09-14 21:10:40 -05:00
A Man
4ce8e24282 Update Changelog 2023-08-16 10:48:06 +02:00
A Man
0ad3698b35 Fix wrong name for 2 static weapons 2023-08-16 10:37:29 +02:00
A Man
cb3f553286 Merge pull request #2191 from ZzBombardierzZ/master
Fix prefix missing property and pboprefix showing as .txt
2023-07-26 17:36:43 +02:00
Jeremiah
59089220d0 Fix prefix missing property and pboprefix showing as .txt 2023-07-25 15:43:28 -07:00
A Man
d318eed7dd Merge pull request #2190 from ZzBombardierzZ/master
Add @DayZ_Epoch_Server and VS C++ Redistributables folder such as 1.0.6.2 had.
2023-07-25 17:27:03 +02:00
Jeremiah
382bff8317 Add dll instructions to install readme. 2023-07-24 12:44:45 -07:00
Jeremiah
0a9e93794a Add missing VS C++ Redistributables folder 2023-07-24 12:44:16 -07:00
Jeremiah
3c27ee9756 Add @DayZ_Epoch_Server folder with the correct layout. 2023-07-24 12:43:40 -07:00
A Man
3f350a04a6 Update Server Files with all current fixes
Those fixes can be removed in a future epoch update.
2023-05-25 16:15:25 +02:00
A Man
ab50bf3158 Fix upgrading AAV_DZE to AAV_DZE1 did not work 2023-05-25 15:27:03 +02:00
A Man
3f1ada6dd9 Fix upgrading or creating a key for a vehicle
Due to the max length of the format command, vehicles with too many items in the gear could not be upgraded,
2023-05-25 15:14:30 +02:00
A Man
69d46beda0 Add new binaries and keep old ones 2023-05-25 15:11:58 +02:00
A Man
433b3c8e24 Update Readme.md 2023-05-25 15:11:24 +02:00
A Man
692321c69d Merge pull request #2189 from F507DMT/patch-33
Update player_MaintainVG.sqf
2023-05-25 15:04:03 +02:00
F507DMT
369789d706 Update player_MaintainVG.sqf
added all real private variables. 
Fix Maintain the Virtual Garage with Coins can be not work properly
2022-09-29 17:34:28 +06:00
A Man
1b08487791 Fix wooden bases with wood walls and floors does not get properly recognized as shelter 2022-07-17 12:12:09 +02:00
A Man
2d00a515cd Fix Maintain the Virtual Garage with Coins does not work properly 2022-07-17 10:35:04 +02:00
132 changed files with 6344 additions and 81 deletions

13
CHANGE LOG 1.0.8.txt Normal file
View File

@@ -0,0 +1,13 @@
[NEW] Added sensor to trigger lighting and sound effects when entering Namalsk Object A2. (d9c4075) @worldwidesorrow
[NEW] Sumrak's original Namalsk Object A2 POI added. Map fixes and rail gun spawn also added as POI. (b8f201d) @worldwidesorrow
[NEW] Added option to exempt players in safe zones from effects of EVR storm. (057ecc0) @worldwidesorrow
[NEW] Added an option to limit access to static weapons within plot radius to plot owner and plot friends (b27f189) @worldwidesorrow
[FIXED] Upgrading or creating a key for a vehicle could fail if the vehicle had too many items in the gear. (3f1ada6dd) @Wilhelm Klink, @AirwavesMan
[FIXED] Maintain the Virtual Garage with Coins did not work properly. (2d00a515c) @AirwavesMan
[FIXED] Wooden bases with wooden walls and floors got not properly recognized as shelter. (1b0848779) @Victor-the-Cleaner, @AirwavesMan
[FIXED] Upgrading the AAV_DZE to AAV_DZE1 did not work. (ab50bf315) @Big Dee, @AirwavesMan
[FIXED] Wrong classname for 2 static weapons. (0ad3698b3) @Kitty, @AirwavesMan
[REPLACED] GPMG_TriPod_GrenadeLauncher_Static_kit --> GPMG_TriPod_MG_Static_kit (0ad3698b3) @Kitty, @AirwavesMan
[REPLACED] GMG_Tripod_MG_Static_kit --> GMG_Tripod_GrenadeLauncher_Static_kit (0ad3698b3) @Kitty, @AirwavesMan
[REPLACED] GPMG_TriPod_GrenadeLauncher_Static_DZ --> GPMG_TriPod_MG_Static_DZ (0ad3698b3) @Kitty, @AirwavesMan
[REPLACED] GMG_Tripod_MG_Static_DZ --> GMG_Tripod_GrenadeLauncher_Static_DZ (0ad3698b3) @Kitty, @AirwavesMan

View File

@@ -174,7 +174,7 @@ class L2A1_Tripod_MG_Static_kit: CA_Magazine
}; };
}; };
class GMG_Tripod_MG_Static_kit: CA_Magazine class GMG_Tripod_GrenadeLauncher_Static_kit: CA_Magazine
{ {
scope = 2; scope = 2;
count = 1; count = 1;
@@ -191,7 +191,7 @@ class GMG_Tripod_MG_Static_kit: CA_Magazine
text = $STR_ACTIONS_BUILD; text = $STR_ACTIONS_BUILD;
script = "spawn player_build;"; script = "spawn player_build;";
require[] = {"ItemToolbox"}; require[] = {"ItemToolbox"};
create = "GMG_Tripod_MG_Static_DZ"; create = "GMG_Tripod_GrenadeLauncher_Static_kit";
}; };
}; };
}; };
@@ -240,7 +240,7 @@ class MK19_TriPod_GrenadeLauncher_Static_kit: CA_Magazine
}; };
}; };
class GPMG_TriPod_GrenadeLauncher_Static_kit: CA_Magazine class GPMG_TriPod_MG_Static_kit: CA_Magazine
{ {
scope = 2; scope = 2;
count = 1; count = 1;
@@ -257,7 +257,7 @@ class GPMG_TriPod_GrenadeLauncher_Static_kit: CA_Magazine
text = $STR_ACTIONS_BUILD; text = $STR_ACTIONS_BUILD;
script = "spawn player_build;"; script = "spawn player_build;";
require[] = {"ItemToolbox"}; require[] = {"ItemToolbox"};
create = "GPMG_TriPod_GrenadeLauncher_Static_DZ"; create = "GPMG_TriPod_MG_Static_kit";
}; };
}; };
}; };

View File

@@ -122,7 +122,7 @@ class BAF_GMG_Tripod_D: GMG_TriPod {
class assembleInfo; class assembleInfo;
}; };
class GMG_Tripod_MG_Static_DZ: BAF_GMG_Tripod_D { // GMG Minitripod class GMG_Tripod_GrenadeLauncher_Static_DZ: BAF_GMG_Tripod_D { // GMG Minitripod
side = 1; side = 1;
faction = "USMC"; faction = "USMC";
class assembleInfo: assembleInfo { class assembleInfo: assembleInfo {
@@ -130,9 +130,9 @@ class GMG_Tripod_MG_Static_DZ: BAF_GMG_Tripod_D { // GMG Minitripod
}; };
offset[] = {0,3,0}; offset[] = {0,3,0};
nounderground = 0; nounderground = 0;
GhostPreview = "GMG_Tripod_MG_Static_DZ"; GhostPreview = "GMG_Tripod_GrenadeLauncher_Static_DZ";
vehicleClass = "DayZ Epoch Static Weapons"; vehicleClass = "DayZ Epoch Static Weapons";
removeoutput[] = {{"GMG_Tripod_MG_Static_kit",1}}; removeoutput[] = {{"GMG_Tripod_GrenadeLauncher_Static_kit",1}};
}; };
class AGS_Ins; class AGS_Ins;
@@ -161,7 +161,7 @@ class BAF_GPMG_Minitripod_D: BAF_L2A1_ACOG_base {
class assembleInfo; class assembleInfo;
}; };
class GPMG_TriPod_GrenadeLauncher_Static_DZ: BAF_GPMG_Minitripod_D { // GPMG Minitripod class GPMG_TriPod_MG_Static_DZ: BAF_GPMG_Minitripod_D { // GPMG Minitripod
side = 1; side = 1;
faction = "USMC"; faction = "USMC";
class assembleInfo: assembleInfo { class assembleInfo: assembleInfo {
@@ -169,9 +169,9 @@ class GPMG_TriPod_GrenadeLauncher_Static_DZ: BAF_GPMG_Minitripod_D { // GPMG Min
}; };
offset[] = {0,3,0}; offset[] = {0,3,0};
nounderground = 0; nounderground = 0;
GhostPreview = "GPMG_TriPod_GrenadeLauncher_Static_DZ"; GhostPreview = "GPMG_TriPod_MG_Static_DZ";
vehicleClass = "DayZ Epoch Static Weapons"; vehicleClass = "DayZ Epoch Static Weapons";
removeoutput[] = {{"GPMG_TriPod_GrenadeLauncher_Static_kit",1}}; removeoutput[] = {{"GPMG_TriPod_MG_Static_kit",1}};
}; };
class M119; class M119;

View File

@@ -80,7 +80,9 @@ class AAV_DZE : AAV_DZ {
stabilizedInAxes = 0; stabilizedInAxes = 0;
}; };
}; };
class Upgrades {
ItemTankORP[] = {"AAV_DZE1",{"ItemToolbox","ItemCrowbar"},{},{{"ItemTankORP",1},{"PartEngine",6},{"PartGeneric",2},{"ItemScrews",2}}};
};
}; };
class AAV_DZE1: AAV_DZE { class AAV_DZE1: AAV_DZE {

View File

@@ -1,6 +1,6 @@
// Written by icomrade (https://github.com/icomrade) // Written by icomrade (https://github.com/icomrade)
private ["_hasAccess","_heliPad","_objectID","_objectUID","_plotCheck"]; private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0; closeDialog 0;

View File

@@ -389,9 +389,14 @@ fnc_evr = {
local _vehicle = vehicle player; local _vehicle = vehicle player;
local _inside = (dayz_inside || (DZE_roofOverhead && {DZE_sheltered > 0.96})); local _inside = (dayz_inside || (DZE_roofOverhead && {DZE_sheltered > 0.96}));
local _inSafeZone = false;
{
if (player distance (_x select 0) < (_x select 1)) exitWith {_inSafeZone = true;};
} count DZE_SafeZonePosArray;
if (player == _vehicle) then { if (player == _vehicle) then {
if (_hasAPSI || {DZE_EVRProtectInside && _inside}) then { if (_hasAPSI || {DZE_EVRProtectInside && _inside} || {(DZE_EVRSafezoneExempt && _inSafeZone)}) then {
player switchMove ""; player switchMove "";
[objNull, player, rswitchMove, ""] call RE; [objNull, player, rswitchMove, ""] call RE;
} else { } else {
@@ -405,7 +410,7 @@ fnc_evr = {
player action ["engineOff",_vehicle]; player action ["engineOff",_vehicle];
_vehicle setFuel _fuel; _vehicle setFuel _fuel;
} else { } else {
if (!_hasAPSI && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)}) then { if (!_hasAPSI && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)} && {(DZE_EVRSafezoneExempt && !_inSafeZone)}) then {
player action ["eject",_vehicle]; player action ["eject",_vehicle];
[] spawn { [] spawn {
uiSleep 3; uiSleep 3;
@@ -421,7 +426,7 @@ fnc_evr = {
uiSleep 0.1; uiSleep 0.1;
titleText["","BLACK OUT",1]; titleText["","BLACK OUT",1];
if (!_hasAPSI && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)}) then { if (!_hasAPSI && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)} && {(DZE_EVRSafezoneExempt && !_inSafeZone)}) then {
r_player_inpain = true; r_player_inpain = true;
player setVariable["USEC_inPain",true,true]; player setVariable["USEC_inPain",true,true];
local _blood = r_player_blood - ((DZE_EVRBloodLoss select 0) max random(DZE_EVRBloodLoss select 1)); // Player is not inside a building so reduce blood. local _blood = r_player_blood - ((DZE_EVRBloodLoss select 0) max random(DZE_EVRBloodLoss select 1)); // Player is not inside a building so reduce blood.
@@ -440,7 +445,7 @@ fnc_evr = {
titleText["","BLACK IN",10]; titleText["","BLACK IN",10];
ppEffectDestroy _effect; ppEffectDestroy _effect;
if (DZE_EVRDamageItemsChance > 0) then { if (DZE_EVRDamageItemsChance > 0 && {(DZE_EVRSafezoneExempt && !_inSafeZone)}) then {
local _items = []; local _items = [];
{ {
local _tool = _x select 0; local _tool = _x select 0;
@@ -462,7 +467,7 @@ fnc_evr = {
"dynamicBlur" ppEffectCommit 16; "dynamicBlur" ppEffectCommit 16;
if (!_hasAPSI) then { if (!_hasAPSI) then {
if (player == vehicle player && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)}) then { if (player == vehicle player && {!DZE_EVRProtectInside || (DZE_EVRProtectInside && !_inside)} && {(DZE_EVRSafezoneExempt && !_inSafeZone)}) then {
uiSleep 10; // 10 second knockout. uiSleep 10; // 10 second knockout.
[nil, player, rSWITCHMOVE, "AmovPpneMstpSnonWnonDnon_healed"] call RE; [nil, player, rSWITCHMOVE, "AmovPpneMstpSnonWnonDnon_healed"] call RE;
player SWITCHMOVE "AmovPpneMstpSnonWnonDnon_healed"; player SWITCHMOVE "AmovPpneMstpSnonWnonDnon_healed";

View File

@@ -36,29 +36,17 @@ local _deepScan = {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object; local _box = boundingBox _object;
local _b0 = _box select 0; // min boundary local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _b1 = _box select 1; // max boundary local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeX = abs (_b0 select 0) + (_b1 select 0); local _edgeZ = _edge select 2;
local _edgeY = abs (_b0 select 1) + (_b1 select 1);
local _edgeZ = abs (_b0 select 2) + (_b1 select 2);
local _proceed = false; local _proceed = false;
call { call {
if (_idx < 2) exitWith { // objects close to the horizon if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e1) then { // have a minimum height requirement if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeX > _e2 || {_edgeY > _e2}) then { // plus at least one long edge if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
_proceed = true;
};
};
};
if (_edgeX > _e1 && {_edgeY > _e2}) exitWith { // objects above the player
_proceed = true; // must have
}; // at least one long edge
if (_edgeX > _e2 && {_edgeY > _e1}) exitWith { // with a minimum adjacent edge
_proceed = true; // but no minimum height requirement
};
}; };
if (_proceed) then { if (_proceed) then {
@@ -81,7 +69,7 @@ local _rad = 50; // scan radius
local _seg = 8; // initial segments local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length local _e1 = 2.5; // minimum edge length
local _e2 = 5.0; // long edge length local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting local _total = 0; // total hits, adjusted for weighting

View File

@@ -0,0 +1,59 @@
/*
* AII module light system
* intensity variable DZE_ObjectA2lightIntensity (RECOMMENDED VALUE = 0.10, 0 = off (dark), 1 = fully on (not recommended))
*
* AII module SFX system
* parallel procedure to the light system
* enabling / disabling environment sounds
* ominous sound effect
*/
local _showText = _this select 0;
local _status = _this select 1;
DZE_AII_Lights = [];
// Do not show message when player changes clothes in object A2.
if ((dayz_lastClothesChange + 3 > diag_tickTime) || {(player distance respawn_west_original < 100)}) then {
_showText = false;
};
if (_status == "enter") then {
if (_showText) then {
localize "STR_OBJECTA2_ENTER" call dayz_rollingMessages;
};
enableEnvironment false;
// create light sources
{
local _light = "#LightPoint" createVehicleLocal _x;
_light setLightBrightness DZE_ObjectA2lightIntensity;
_light setLightAmbient [0.5, 0.5, 0.5];
_light setLightColor [1.0, 1.0, 1.0];
_light setPos _x;
DZE_AII_Lights = DZE_AII_Lights + [_light];
} count [[4978.8086,6630.834,0],[4983.9385,6614.6343,0],[4975.1152,6606.9126,0]];
// Four second sound effect gets repeated until leaving.
[] spawn {
while {count DZE_AII_Lights > 0} do {
playSound "ns_fx_aii_underground";
uiSleep 4;
};
//diag_log "Object A2 Sound loop has ended";
};
} else {
if (_showText) then {
localize "STR_OBJECTA2_LEAVE" call dayz_rollingMessages;
};
// remove light sources
{
_x setLightBrightness 0;
deleteVehicle _x;
} count DZE_AII_Lights;
DZE_AII_Lights = [];
enableEnvironment true;
};

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -34,7 +34,7 @@ class L2A1_Tripod_MG_Static_kit
{ {
weight = 32.5; weight = 32.5;
}; };
class GMG_Tripod_MG_Static_kit class GMG_Tripod_GrenadeLauncher_Static_kit
{ {
weight = 29; weight = 29;
}; };
@@ -46,7 +46,7 @@ class MK19_TriPod_GrenadeLauncher_Static_kit
{ {
weight = 35.3; weight = 35.3;
}; };
class GPMG_TriPod_GrenadeLauncher_Static_kit class GPMG_TriPod_MG_Static_kit
{ {
weight = 25.7; weight = 25.7;
}; };

View File

@@ -752,6 +752,7 @@ if (!isDedicated) then {
dayz_EjectPlayer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_ejectPlayer.sqf"; dayz_EjectPlayer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_ejectPlayer.sqf";
fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding; fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
fnc_setCombat = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setCombat.sqf"; fnc_setCombat = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setCombat.sqf";
if (worldName == "namalsk") then {player_objectAII = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_objectA2.sqf";};
}; };
//Both //Both

View File

@@ -8,7 +8,7 @@ DZE_modularDoors = ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_Garag
DZE_modularDoors = DZE_modularDoors + DZE_LockedGates; DZE_modularDoors = DZE_modularDoors + DZE_LockedGates;
DZE_LockedStorage = ["VaultStorageLocked","VaultStorage2Locked","LockboxStorageLocked","LockboxStorage2Locked","LockboxStorageWinterLocked","LockboxStorageWinter2Locked","TallSafeLocked"]; DZE_LockedStorage = ["VaultStorageLocked","VaultStorage2Locked","LockboxStorageLocked","LockboxStorage2Locked","LockboxStorageWinterLocked","LockboxStorageWinter2Locked","TallSafeLocked"];
DZE_UnLockedStorage = ["VaultStorage","VaultStorage2","LockboxStorage","LockboxStorage2","LockboxStorageWinter","LockboxStorageWinter2","TallSafe"]; DZE_UnLockedStorage = ["VaultStorage","VaultStorage2","LockboxStorage","LockboxStorage2","LockboxStorageWinter","LockboxStorageWinter2","TallSafe"];
DZE_StaticWeapons = ["ZU23_AntiAir_Static_DZ","Igla_AntiAir_Launcher_Static_DZ","Rbs70_Launcher_Static_DZ","TOW_Tripod_Launcher_Static_DZ","Stinger_Tripod_Launcher_Static_DZ","SPG9_Launcher_Static_DZ","Metis_Launcher_Static_DZ","2b14_82mm_Mortar_Static_DZ","M252_Mortar_Static_DZ","SearchLight_Static_DZ","D30_Artillery_Static_DZ","M119_Artillery_Static_DZ","GPMG_TriPod_GrenadeLauncher_Static_DZ","MK19_TriPod_GrenadeLauncher_Static_DZ","AGS30_GrenadeLauncher_Static_DZ","GMG_Tripod_MG_Static_DZ","L2A1_Tripod_MG_Static_DZ","L2A1_MG_Static_DZ","KORD_MG_Static_DZ","KORD_Tripod_MG_Static_DZ","DSHKM_TriPod_MG_Static_DZ","DSHKM_MG_Static_DZ","M2_TriPod_MG_Static_DZ","M2_MG_Static_DZ","M240Nest_DZ"]; DZE_StaticWeapons = ["ZU23_AntiAir_Static_DZ","Igla_AntiAir_Launcher_Static_DZ","Rbs70_Launcher_Static_DZ","TOW_Tripod_Launcher_Static_DZ","Stinger_Tripod_Launcher_Static_DZ","SPG9_Launcher_Static_DZ","Metis_Launcher_Static_DZ","2b14_82mm_Mortar_Static_DZ","M252_Mortar_Static_DZ","SearchLight_Static_DZ","D30_Artillery_Static_DZ","M119_Artillery_Static_DZ","GPMG_TriPod_MG_Static_DZ","MK19_TriPod_GrenadeLauncher_Static_DZ","AGS30_GrenadeLauncher_Static_DZ","GMG_Tripod_GrenadeLauncher_Static_DZ","L2A1_Tripod_MG_Static_DZ","L2A1_MG_Static_DZ","KORD_MG_Static_DZ","KORD_Tripod_MG_Static_DZ","DSHKM_TriPod_MG_Static_DZ","DSHKM_MG_Static_DZ","M2_TriPod_MG_Static_DZ","M2_MG_Static_DZ","M240Nest_DZ"];
DZE_isNewStorage = ["Generator_DZ","GunRack_DZ","GunRack2_DZ","WoodCrate_DZ","WoodCrate2_DZ","OutHouse_DZ","StorageShed_DZ","StorageShed2_DZ","WoodShack_DZ","WoodShack2_DZ","Wooden_shed_DZ","Wooden_shed2_DZ","WorkBench_DZE","Advanced_WorkBench_DZ","CookTripod_DZ","Stoneoven_DZ","Commode_DZ","Wardrobe_DZ","Fridge_DZ","Washing_Machine_DZ","Server_Rack_DZ","ATM_DZ","Armchair_DZ","Sofa_DZ","Arcade_DZ","Vendmachine1_DZ","Vendmachine2_DZ","StorageCrate_DZ","CamoStorageCrate_DZ","StorageBarrelRed1_DZ","StorageBarrelRed2_DZ","StorageBarrelEpoch1_DZ","StorageBarrelEpoch2_DZ","StorageBarrelYellow1_DZ","StorageBarrelYellow2_DZ","StorageBarrelBlack1_DZ","StorageBarrelBlack2_DZ","StorageBarrelGreenDark1_DZ","StorageBarrelGreenDark2_DZ","StorageBarrelMilk1_DZ","StorageBarrelMilk2_DZ","StorageBarrelGreen1_DZ","StorageBarrelGreen2_DZ","StorageBarrelGreenRusty1_DZ","StorageBarrelGreenRusty2_DZ","Rabbit_Hutch_DZE","Chicken_Coop_DZE","Doghouse_DZE","Postbox_DZE","Wild_Bee_Hive_DZE","Cow_Stable_DZE","Goat_Stable_DZE","Sheep_Stable_DZE","Boar_Stable_DZE","VaultStorageBroken","VaultStorageBroken2","TallSafeBroken","LockboxStorageBroken","LockboxStorage2Broken","LockboxStorageWinterBroken","LockboxStorageWinter2Broken"]; DZE_isNewStorage = ["Generator_DZ","GunRack_DZ","GunRack2_DZ","WoodCrate_DZ","WoodCrate2_DZ","OutHouse_DZ","StorageShed_DZ","StorageShed2_DZ","WoodShack_DZ","WoodShack2_DZ","Wooden_shed_DZ","Wooden_shed2_DZ","WorkBench_DZE","Advanced_WorkBench_DZ","CookTripod_DZ","Stoneoven_DZ","Commode_DZ","Wardrobe_DZ","Fridge_DZ","Washing_Machine_DZ","Server_Rack_DZ","ATM_DZ","Armchair_DZ","Sofa_DZ","Arcade_DZ","Vendmachine1_DZ","Vendmachine2_DZ","StorageCrate_DZ","CamoStorageCrate_DZ","StorageBarrelRed1_DZ","StorageBarrelRed2_DZ","StorageBarrelEpoch1_DZ","StorageBarrelEpoch2_DZ","StorageBarrelYellow1_DZ","StorageBarrelYellow2_DZ","StorageBarrelBlack1_DZ","StorageBarrelBlack2_DZ","StorageBarrelGreenDark1_DZ","StorageBarrelGreenDark2_DZ","StorageBarrelMilk1_DZ","StorageBarrelMilk2_DZ","StorageBarrelGreen1_DZ","StorageBarrelGreen2_DZ","StorageBarrelGreenRusty1_DZ","StorageBarrelGreenRusty2_DZ","Rabbit_Hutch_DZE","Chicken_Coop_DZE","Doghouse_DZE","Postbox_DZE","Wild_Bee_Hive_DZE","Cow_Stable_DZE","Goat_Stable_DZE","Sheep_Stable_DZE","Boar_Stable_DZE","VaultStorageBroken","VaultStorageBroken2","TallSafeBroken","LockboxStorageBroken","LockboxStorage2Broken","LockboxStorageWinterBroken","LockboxStorageWinter2Broken"];
DZE_Tents = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","TentStorageWinter","TentStorageWinter0","TentStorageWinter1","TentStorageWinter2","TentStorageWinter3","TentStorageWinter4","WinterDomeTentStorage","WinterDomeTentStorage0","WinterDomeTentStorage1","WinterDomeTentStorage2","WinterDomeTentStorage3","WinterDomeTentStorage4"]; DZE_Tents = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","TentStorageWinter","TentStorageWinter0","TentStorageWinter1","TentStorageWinter2","TentStorageWinter3","TentStorageWinter4","WinterDomeTentStorage","WinterDomeTentStorage0","WinterDomeTentStorage1","WinterDomeTentStorage2","WinterDomeTentStorage3","WinterDomeTentStorage4"];
DZE_Stashes = ["StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4"]; DZE_Stashes = ["StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4"];

View File

@@ -37225,6 +37225,12 @@
<German>Haufen Erde</German> <German>Haufen Erde</German>
<Russian>Кучка земли</Russian> <Russian>Кучка земли</Russian>
</Key> </Key>
<Key ID="STR_OBJECTA2_ENTER">
<English>Entering Object AII</English>
</Key>
<Key ID="STR_OBJECTA2_LEAVE">
<English>Leaving Object AII</English>
</Key>
<!--Placeholder strings for new items server admins want to add within the mission by overwrite this strings--> <!--Placeholder strings for new items server admins want to add within the mission by overwrite this strings-->
<Key ID="STR_PLACEHOLDER_ITEM_NAME_01"> <Key ID="STR_PLACEHOLDER_ITEM_NAME_01">
@@ -40411,7 +40417,7 @@
</Key> </Key>
<Key ID="STR_CL_AUTOCLAIM_RETURN"> <Key ID="STR_CL_AUTOCLAIM_RETURN">
<English>You have left the mission area! You have %1 seconds to return!</English> <English>You have left the mission area! You have %1 seconds to return!</English>
<German>Du hast den Missionsbereich verlassen! Du hast %1 um zurückzukehren!</German> <German>Du hast den Missionsbereich verlassen! Du hast %1 Sekunden um zurückzukehren!</German>
<French>Vous quitter la zone de mission! Vous avez %1 secondes pour revenir!</French> <French>Vous quitter la zone de mission! Vous avez %1 secondes pour revenir!</French>
<Russian>Вы покинули зону миссии! У вас есть %1 сек. чтобы вернуться!</Russian> <Russian>Вы покинули зону миссии! У вас есть %1 сек. чтобы вернуться!</Russian>
<Spanish>Has dejado el área de la misión! Tienes %1 segundos para volver!</Spanish> <Spanish>Has dejado el área de la misión! Tienes %1 segundos para volver!</Spanish>

View File

@@ -0,0 +1,108 @@
// Object A2 scenery
local _obj = objNull;
{
_obj = (_x select 0) createVehicle [0,0,0];
if (count _x == 4) then {
_obj setDir (_x select 3);
};
_obj setVectorUp (_x select 2);
_obj setPosATL (_x select 1);
_obj enableSimulation false;
} count [
// First floor
["ns_zarivka",[4983.9385,6614.6343,27.40],[0,0,1]],
["ns_zarivka",[4986.8208,6619.5962,27.4],[0,0,1]],
["ns_zarivka",[4990.2695,6616.0361,27.4],[0,0,1]],
["ns_zarivka",[4978.6118,6626.6675,27.4],[0,0,1]],
["ns_zarivka",[4978.8086,6630.834,27.4],[0,0,1]],
["ns_zarivka",[4979.1362,6635.5249,27.4],[0,0,1]],
["FoldChair",[4974.1978,6607.0635,23.48],[0,0,1],93],
["ns_zarivka",[4975.1152,6606.9126,27.40],[0,0,1]],
["Desk",[4973.9487,6610.4839,23.4],[0,0,1],180],
["Desk",[4973.9219,6603.0215,23.6],[0,0,1]],
["WoodChair",[4973.8438,6603.9565,23.6],[0,0,1]],
["SatPhone",[4973.9072,6603.0386,24.42],[0,0,1],180],
["Notebook",[4973.9404,6610.4087,24.33],[0,0,1],192],
["EvMoscow",[4974.6909,6610.3784,24.33],[0,0,1]],
["FoldChair",[4973.9233,6609.4385,23.48],[0,0,1],172],
["Misc_cargo_cont_tiny",[4986.6396,6603.7856,23.5],[0,0,1],175],
["Misc_cargo_cont_tiny",[4986.5288,6606.1143,23.5],[0,0,1],88],
["FoldChair",[4984.2954,6604.1353,23.48],[0,0,1],181],
["Misc_cargo_cont_net1",[4981.3809,6616.6499,23.45],[0,0,1],88],
["Misc_cargo_cont_net1",[4981.187,6612.5479,23.45],[0,0,1]],
["FoldTable",[4973.6689,6614.916,23.48],[0,0,1],269],
["Barrels",[4973.4341,6616.8174,23.48],[0,0,1],92],
["Barrels",[4977.7178,6612.7295,23.48],[0,0,1],92],
["Fuel_can",[4973.0981,6613.0313,23.48],[0,0,1],92],
["Fuel_can",[4974.1353,6613.1196,23.48],[0,0,1],69],
["Fuel_can",[4973.6313,6612.6899,23.48],[0,0,1],69],
["Paleta1",[4971.3,6612.9463,23.48],[0,0,1],92],
["Paleta1",[4971.3,6614.7827,23.48],[0,0,1],92],
["Fuel_can",[4971.5698,6614.4155,23.68],[0,0,1],165],
["Fuel_can",[4971.44,6612.75,23.68],[0,0,1]],
["Fuel_can",[4971.3984,6613.2762,23.68],[0,0,1]],
["Land_Barrel_water",[4970.8035,6612.0013,23.68],[0,0,1]],
["Land_Barrel_water",[4971.627,6612.0021,23.68],[0,0,1]],
["Land_Barrel_sand",[4972.519,6611.8691,23.48],[0,0,1]],
["Land_Barrel_sand",[4970.8052,6613.3919,23.68],[0,0,1]],
["Land_Barrel_sand",[4971.2021,6616,23.48],[0,0,1]],
["Barrel4",[4971.5132,6614.8403,23.7],[0,0,1]],
["Misc_cargo_cont_net1",[4969.7671,6620.5503,23.45],[0,0,1],265],
["Misc_cargo_cont_net1",[4994.9761,6621.8188,23.45],[0,0,1],88],
["Misc_cargo_cont_net1",[4992.0557,6618.3994,23.45],[0,0,1],88],
["Misc_cargo_cont_net1",[4992.0996,6621.8604,23.45],[0,0,1],88],
["ns_kompiky",[4973.3091,6632.8042,23.6],[0,0,1],-88],
["ns_kompiky",[4976.229,6632.6499,23.6],[0,0,1],-267],
["ns_kompiky",[4977.6191,6632.4976,23.6],[0,0,1],-446],
["Fuel_can",[4972.9258,6627.8628,23.48],[0,0,1]],
["Misc_cargo_cont_tiny",[4981.8286,6637.7822,23.45],[0,0,1],175],
["Misc_cargo_cont_tiny",[4981.5898,6629.4341,23.50],[0,0,1],175],
["Notebook",[4981.0991,6629.2246,25.15],[0,0,1],-103],
["WoodChair",[4973.5703,6628.9707,23.6],[0,0,1],102],
["WoodChair",[4973.6123,6629.8154,23.6],[0,0,1],82],
["Land_Barrel_sand",[4965.5273,6617.0273,23.48],[0,0,1]],
["Land_Barrel_sand",[4965.7422,6616.0068,23.48],[0,0,1]],
["Land_Barrel_water",[4963.6167,6618.1294,23.48],[0,0,1]],
["Land_Barrel_water",[4963.3208,6617.189,23.48],[0,0,1]],
["Land_Barrel_water",[4963.3745,6615.9521,23.48],[0,0,1]],
["Paleta2",[4969.11,6612.95,23.48],[0,0,1],90],
["Land_Barrel_sand",[4966.5674,6612.2695,23.48],[0,0,1]],
["Land_Barrel_sand",[4967.2222,6612.2969,23.48],[0,0,1]],
// Second floor
["Land_Barrel_water",[4975.7256,6620.6211,16.4],[0,0,1]],
["Land_Barrel_sand",[4975.98,6621.3604,16.4],[0,0,1]],
["Land_Barrel_sand",[4976.5303,6620.7676,16.4],[0,0,1]],
["Land_Barrel_sand",[4981.1943,6644.4468,17.23],[0,0,1]],
["Land_Barrel_sand",[4980.1802,6644.6431,17.23],[0,0,1]],
["Land_Barrel_sand",[4979.2642,6645.1338,17.23],[0,0,1]],
["Land_Barrel_empty",[4981.0571,6645.0645,17.23],[0,0,1]],
["Land_Barrel_sand",[4980.1592,6645.5347,17.23],[0,0,1]],
["Land_Barrel_sand",[4982.0249,6644.4292,17.23],[0,0,1]],
["Land_Barrel_sand",[4978.6226,6648.9121,17.23],[0,0,1],15],
["Land_Barrel_empty",[4978.06,6649.4,17.23],[0,0,1],150],
["Land_Barrel_sand",[4979.49,6648.97,17.23],[0,0,1],210],
["Barrels",[4983.1167,6646.6553,17.23],[0,0,1],6],
["Barrel4",[4983.7129,6646.6138,17.23],[0,0,1]],
["Barrel5",[4984.8701,6646.5146,17.23],[0,0,1]],
["Barrel5",[4984.1704,6645.8159,17.23],[0,0,1]],
["FoldTable",[4984.21,6605.85,23.48],[0,0,1],85],
["PowerGenerator",[4977.99,6617.47,23.48],[0,0,1],92],
["Paleta2",[4971.95,6617.15,23.48],[0,0,1],181],
["Paleta2",[4964.46,6616.27,23.48],[0,0,1],181],
["Paleta2",[4969.77,6623.07,23.48],[0,0,1],0],
["ns_servery",[4974.46,6622.96,23.48],[0,0,1],-447],
["ns_servery",[4975.82,6622.8,23.48],[0,0,1],-447],
["ns_servery",[4972.88,6626.27,23.48],[0,0,1]],
["Misc_cargo_cont_tiny",[4977.7358,6624.0195,17.2],[0,0,1],-214],
["Misc_cargo_cont_tiny",[4976.4238,6625.7964,17.2],[0,0,1],-224],
["Misc_cargo_cont_net1",[4973.0718,6624.5732,16.4],[0,0,1],-219],
["Misc_cargo_cont_net1",[4974.8711,6622.3086,16.4],[0,0,1],-219],
["Misc_cargo_cont_net1",[4985.3965,6608.3174,16.4],[0,0,1],-217],
["Misc_cargo_cont_net1",[4984.2354,6609.8521,16.4],[0,0,1],-217],
["Misc_cargo_cont_net1",[4981.4805,6613.9399,16.4],[0,0,1],-307],
["Misc_cargo_cont_net1",[4980.3193,6615.4746,16.4],[0,0,1],-217]
];
//diag_log "[NAC AII SERVER] :: AII objects has been spawned.";

View File

@@ -0,0 +1,11 @@
// DZE Namalsk A2 Rail Gun Spawn Script by JasonTM
// Random Chance of an "Alien Super Weapon" spawning on the second floor of Object A2.
if (random 1 <= _this) then {
local _wh = "WeaponHolder" createVehicle [0,0,0];
_wh setPosATL [4978.17, 6647.25, 17.2435];
_wh setVariable ["permaLoot",true];
_wh addWeaponCargoGlobal ["nsw_er7s",1];
_wh addMagazineCargoGlobal ["nsw_er7mm",2];
//diag_log "Rail gun has spawned at object AII";
};

View File

@@ -0,0 +1,16 @@
/*
Add POI objects on server machine only.
Do not use execVM. This must be unscheduled to finish before server_monitor.sqf runs (vehicles or players can spawn on top)
Do not use createVehicleLocal for these. They contain trees and buildings (need chopped/destroyed status synchronized for all clients)
*/
{
if (typeName _x == "ARRAY") then {
(_x select 1) call compile preprocessFileLineNumbers ("\z\addons\dayz_code\system\mission\namalsk\poi\" + (_x select 0) + ".sqf");
} else {
call compile preprocessFileLineNumbers ("\z\addons\dayz_code\system\mission\namalsk\poi\" + _x + ".sqf");
};
//This is needed to process all setVehicleInit commands
processInitCommands;
} forEach _this;

View File

@@ -0,0 +1,18 @@
// Map fixes - objectA2 fall hazards and elevated Northern Army Base barracks entrances that you must vault to enter.
local _obj = objNull;
{
_obj = (_x select 0) createVehicle [0,0,0];
_obj setVectorDirAndUp (_x select 2);
_obj setPosATL (_x select 1);
_obj enableSimulation false;
} count [
["WoodFloorQuarter_DZ",[4990.341,6614.789,42.487],[[0.034,-0.999,0],[0,0,1]]],
["WoodFloorQuarter_DZ",[4990.185,6616.587,41.549],[[-0.02,0.573,-0.819],[-0.028,0.819,0.574]]],
["WoodFloorQuarter_DZ",[4991.7,6617.526,40.687],[[-0.98,0.199,0],[0,0,1]]],
["WoodFloorQuarter_DZ",[4965.494,6613.854,23.28],[[-0.78,-0.62,0.087],[0.068,0.054,0.996]]],
["WoodFloorQuarter_DZ",[4803.953,10802.216,-0.267],[[-0.85,0.459,0.259],[0.228,-0.123,0.966]]],
["WoodFloorQuarter_DZ",[4809.562,10811.947,-0.118],[[-0.844,0.469,0.259],[0.226,-0.126,0.966]]],
["WoodFloorQuarter_DZ",[4990.31,6612.955,41.728],[[-0.024,0.707,0.707],[0.024,-0.707,0.707]]]
];

View File

@@ -66,9 +66,9 @@ diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0; _dir = _worldspace select 0;
_uid = _worldspace call dayz_objectUID2; _uid = _worldspace call dayz_objectUID2;
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, _inv, _newHitpoints, _fuel,_uid]; _key = str formatText["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, _inv, _newHitpoints, _fuel,_uid];
#ifdef OBJECT_DEBUG #ifdef OBJECT_DEBUG
diag_log ("HIVE: WRITE: "+ str(_key)); diag_log ("HIVE: WRITE: "+ _key);
#endif #endif
_key call server_hiveWrite; _key call server_hiveWrite;

View File

@@ -79,9 +79,9 @@ diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0; _dir = _worldspace select 0;
_uid = _worldspace call dayz_objectUID2; _uid = _worldspace call dayz_objectUID2;
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, _inv, _newHitpoints, _fuel,_uid]; _key = str formatText["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, _inv, _newHitpoints, _fuel,_uid];
#ifdef OBJECT_DEBUG #ifdef OBJECT_DEBUG
diag_log ("HIVE: WRITE: "+ str(_key)); diag_log ("HIVE: WRITE: "+ _key);
#endif #endif
_key call server_hiveWrite; _key call server_hiveWrite;

View File

@@ -266,6 +266,36 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
if (_type isKindOf "StaticWeapon" || {_type in DZE_StaticWeapons}) then { if (_type isKindOf "StaticWeapon" || {_type in DZE_StaticWeapons}) then {
[_object,DZE_clearStaticAmmo,false] call fn_vehicleAddons; [_object,DZE_clearStaticAmmo,false] call fn_vehicleAddons;
if (DZE_StaticWeaponPlotCheck) then {
_object addEventHandler ["GetIn", {
local _weapon = _this select 0;
local _player = _this select 2;
local _nearPlots = _weapon nearEntities ["Plastic_Pole_EP1_DZ", (DZE_PlotPole select 0)];
if (count _nearPlots > 0) then {
local _nearestPlot = _nearPlots select 0;
local _plotFriends = _nearestPlot getVariable "plotfriends"; // owner is index 0.
local _playerUID = getPlayerUID _player;
local _isPlotFriend = false;
{
if((_x select 0) == _playerUID) exitWith {_isPlotFriend = true;};
} count _plotFriends;
if (!_isPlotFriend) then {
// "eject" action doesn't work on the static weapons for some reason.
moveOut _player;
/* uncomment to log the offender to the server rpt.
local _plotOwner = _plotFriends select 0;
local _plotOwnerUID = _plotOwner select 0;
local _plotOwnerName = _plotOwner select 1;
_plotOwnerName = [_plotOwnerName, (toString _plotOwnerName)] select (typeName _plotOwnerName == "ARRAY");
diag_log format ["Player [%1, %2] ejected from %3 on plot belonging to [%4, %5]",(name _player), _playerUID, (typeOf _weapon), _plotOwnerUID, _plotOwnerName];
*/
};
};
}];
};
}; };
_setGlobal = [false,true] select ((_type in DZE_LockedStorage) || (_type in DZE_DoorsLocked)); _setGlobal = [false,true] select ((_type in DZE_LockedStorage) || (_type in DZE_DoorsLocked));

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,16 @@
Changelog 25.05.2023
Server Files Updated:
[ADDED] New HiveExt.dll compatible with MySQL 8.0.33+
[ADDED] New Binaries: DatabaseMySql.dll, DatabasePostgre.dll, tbb.dll, tbbmalloc.dll to run the new HiveExt.dll
[FIXED] Upgrading or creating a key for a vehicle could fail if the vehicle had too many items in gear.
Mission Files Updated:
[FIXED] Maintain the Virtual Garage with Coins did not work properly.
[FIXED] Wooden bases with wooden walls and floors got not properly recognized as shelter.
[FIXED] Upgrading AAV_DZE to AAV_DZE1 did not work.
Not needed on a new server:
The mission check under 'dayz_server\init\mission_check.sqf' must be updated if you are upgrading your existing server with the newest updated missionfiles.

View File

@@ -34,7 +34,7 @@
5 displaySetEventHandler 5 displaySetEventHandler
1 DZE_doorManagementAdmins !="00, \nfalse, \n2 \n];\n\nDZE_PlotManagementAdmins = []; \nDZE_doorManagementAdmins = []; \n\nDZE_disableThermal = []; \nDZE_clearStaticAm" !="true; };\n} count _doorFriends;\n\n\n\n\nif(_playerUID in DZE_DoorManagementAdmins) then { _isDoorAdmin = true; };\n};\n\n\n[ _isOwner\n, _" 1 DZE_doorManagementAdmins !="00, \nfalse, \n2 \n];\n\nDZE_PlotManagementAdmins = []; \nDZE_doorManagementAdmins = []; \n\nDZE_disableThermal = []; \nDZE_clearStaticAm" !="true; };\n} count _doorFriends;\n\n\n\n\nif(_playerUID in DZE_DoorManagementAdmins) then { _isDoorAdmin = true; };\n};\n\n\n[ _isOwner\n, _"
1 DZE_PlotManagementAdmins !="3, \n.25, \n1, \n1, \n.2,\n10, \n0, \n400, \nfalse, \n2 \n];\n\nDZE_PlotManagementAdmins = []; \nDZE_doorManagementAdmins = []; \n\nDZE_disable" !="ay = []; \nlocal _isAdmin = dayz_playerUID in DZE_PlotManagementAdmins;\n\nlocal _dir = 0; \nlocal _vector = []; " !="_Pole_EP1_DZ\");\nlocal _isAdmin = dayz_playerUID in DZE_PlotManagementAdmins;\nlocal _canBuild = false;\nlocal _plotPoles = 0;\nlo" !="true; };\n} count _plotFriends;\n\n\n\n\nif(_playerUID in DZE_PlotManagementAdmins) then { _isPlotAdmin = true; };\n};\n\n\nif(_targetType" !="ove select 0) == _ownerPUID && (!(dayz_playerUID in DZE_PlotManagementAdmins) && !(dayz_playerUID == _ownerPUID))) exitWith {sys" 1 DZE_PlotManagementAdmins !="3, \n.25, \n1, \n1, \n.2,\n10, \n0, \n400, \nfalse, \n2 \n];\n\nDZE_PlotManagementAdmins = []; \nDZE_doorManagementAdmins = []; \n\nDZE_disable" !="ay = []; \nlocal _isAdmin = dayz_playerUID in DZE_PlotManagementAdmins;\n\nlocal _dir = 0; \nlocal _vector = []; " !="_Pole_EP1_DZ\");\nlocal _isAdmin = dayz_playerUID in DZE_PlotManagementAdmins;\nlocal _canBuild = false;\nlocal _plotPoles = 0;\nlo" !="true; };\n} count _plotFriends;\n\n\n\n\nif(_playerUID in DZE_PlotManagementAdmins) then { _isPlotAdmin = true; };\n};\n\n\nif(_targetType" !="ove select 0) == _ownerPUID && (!(dayz_playerUID in DZE_PlotManagementAdmins) && !(dayz_playerUID == _ownerPUID))) exitWith {sys"
5 enableEnvironment 5 enableEnvironment !="ze \"STR_OBJECTA2_ENTER\" call dayz_rollingMessages;\n};\n\nenableEnvironment false;\n\n\n{\nlocal _light = \"#LightPoint\" createVehicleLo"
5 endMission !"rendMission" !"clearWeaponCargo\",\n\"endMission\"," !"enablesimulation\", \"endMission\"," !"lize \"str_player_login_timeout\", \"PLAIN DOWN\"];\nuiSleep 5;\nendMission" !"\npublicVariableServer \"PVDZ_sec_atp\";\nendMission \"LOSER\";\n};\n" !"Terminate\",\"BACK\"];\ncamDestroy _camera;\n\nendMission" !"endMission \"END1\";\n\n\ndayz_authed = true" 5 endMission !"rendMission" !"clearWeaponCargo\",\n\"endMission\"," !"enablesimulation\", \"endMission\"," !"lize \"str_player_login_timeout\", \"PLAIN DOWN\"];\nuiSleep 5;\nendMission" !"\npublicVariableServer \"PVDZ_sec_atp\";\nendMission \"LOSER\";\n};\n" !"Terminate\",\"BACK\"];\ncamDestroy _camera;\n\nendMission" !"endMission \"END1\";\n\n\ndayz_authed = true"
5 entities !"nearEntities" !="\n if (isnil 'BIS_fnc_sceneCreateSoundEntities' || false) then {\n BIS_fnc_sceneCreateSoundEntities = {\n i" !="_loginCompleted = true;\n\n\ndayz_currentGlobalZombies = count entities \"zZombie_Base\";\n\n{\ncall compile preprocessFileLineNumbers (" !="haracterID)) then {\n_plotPoles = _plotPoles +1;\n};\n} count (entities \"Plastic_Pole_EP1_DZ\");\n};\n} else {\n_plotcheck = [player, f" !="VDZ_sec_atp\";\n};\n};\n\nif (isNull _grp) then { _grp = group ((entities 'FunctionsManager') select 0); };\nif (!isNull _grp) then {\n" !="_playerUID) then {\n_plotPoles = _plotPoles + 1;\n};\n} count (entities \"Plastic_Pole_EP1_DZ\"); \n};\n\nif ((DZE_limitPlots > 0) && (_" 5 entities !"nearEntities" !="\n if (isnil 'BIS_fnc_sceneCreateSoundEntities' || false) then {\n BIS_fnc_sceneCreateSoundEntities = {\n i" !="_loginCompleted = true;\n\n\ndayz_currentGlobalZombies = count entities \"zZombie_Base\";\n\n{\ncall compile preprocessFileLineNumbers (" !="haracterID)) then {\n_plotPoles = _plotPoles +1;\n};\n} count (entities \"Plastic_Pole_EP1_DZ\");\n};\n} else {\n_plotcheck = [player, f" !="VDZ_sec_atp\";\n};\n};\n\nif (isNull _grp) then { _grp = group ((entities 'FunctionsManager') select 0); };\nif (!isNull _grp) then {\n" !="_playerUID) then {\n_plotPoles = _plotPoles + 1;\n};\n} count (entities \"Plastic_Pole_EP1_DZ\"); \n};\n\nif ((DZE_limitPlots > 0) && (_"
1 execVM !"rexecVM" !"\"execVM\", " !="[] execVM \"initJIPcompatible.sqf\";" !="_script = [] execVM (BIS_MP_Path + BIS_PATH_SQF + \"JIPWaitFor.sqf\");" !"execVM \"\\ca\\Data\\" !"execVM '\\ca\\Data\\" !"execVM \"\\ca\\missions" !"execVM 'ca\\modules\\" !"execVM \"ca\\modules\\" !"'\\ca\\ui\\" !"\"\\ca\\ui\\" !"scriptName \"MP\\data\\script" !"_handle\"];\n_handle = [_display] execVM _script;\n}" !"execVM '\\z\\addons\\dayz_code\\" !"execVM 'z\\addons\\dayz_code\\" !"execVM \"z\\addons\\dayz_code\\" !"execVM \"\\z\\addons\\dayz_code\\" !"execVM (\"\\z\\addons\\dayz_code\\" !="dayz_rulesHandle = execVM \"rules.sqf\";" !"execvm '\\ASC\\" !"\\usec_ch53\\scripts\\" !"execVM (_actionDir + \"warn.sqf" !="_this execVM \"\\GNT_C185\\scr\\C185_Exhaust.sqf\";[_this select 0] execvm \"\\GNT_C185\\scr\\G_CheckEngine.sqf\";" !="dummy = _this execVM \"ca\\characters2\\OTHER\\scripts\\fly.sqf\"" 1 execVM !"rexecVM" !"\"execVM\", " !="[] execVM \"initJIPcompatible.sqf\";" !="_script = [] execVM (BIS_MP_Path + BIS_PATH_SQF + \"JIPWaitFor.sqf\");" !"execVM \"\\ca\\Data\\" !"execVM '\\ca\\Data\\" !"execVM \"\\ca\\missions" !"execVM 'ca\\modules\\" !"execVM \"ca\\modules\\" !"'\\ca\\ui\\" !"\"\\ca\\ui\\" !"scriptName \"MP\\data\\script" !"_handle\"];\n_handle = [_display] execVM _script;\n}" !"execVM '\\z\\addons\\dayz_code\\" !"execVM 'z\\addons\\dayz_code\\" !"execVM \"z\\addons\\dayz_code\\" !"execVM \"\\z\\addons\\dayz_code\\" !"execVM (\"\\z\\addons\\dayz_code\\" !="dayz_rulesHandle = execVM \"rules.sqf\";" !"execvm '\\ASC\\" !"\\usec_ch53\\scripts\\" !"execVM (_actionDir + \"warn.sqf" !="_this execVM \"\\GNT_C185\\scr\\C185_Exhaust.sqf\";[_this select 0] execvm \"\\GNT_C185\\scr\\G_CheckEngine.sqf\";" !="dummy = _this execVM \"ca\\characters2\\OTHER\\scripts\\fly.sqf\""

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -118,7 +118,7 @@ if (isServer) then {
["any","any","any","any",-1,"CrashSites"] ["any","any","any","any",-1,"CrashSites"]
]; ];
dayz_POIs = false; //Adds Point of Interest map additions (negatively impacts FPS) dayz_POIs = true; //Adds Point of Interest map additions (negatively impacts FPS)
DynamicVehicleDamageLow = 0; // Min damage random vehicles can spawn with DynamicVehicleDamageLow = 0; // Min damage random vehicles can spawn with
DynamicVehicleDamageHigh = 100; // Max damage random vehicles can spawn with DynamicVehicleDamageHigh = 100; // Max damage random vehicles can spawn with
DynamicVehicleFuelLow = 0; // Min fuel random vehicles can spawn with DynamicVehicleFuelLow = 0; // Min fuel random vehicles can spawn with
@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,8 +549,12 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Namalsk Object AII Light Intensity
DZE_ObjectA2lightIntensity = .10; // (RECOMMENDED VALUE = 0.10, 0 = off (dark), 1 = fully on (not recommended))
// Garage Door Opener // Garage Door Opener
DZE_GarageDoor_Opener = false; // Enables the option to open Garage Doors from the inside of a vehicle. DZE_GarageDoor_Opener = false; // Enables the option to open Garage Doors from the inside of a vehicle.
@@ -561,7 +568,7 @@ if (!isDedicated) then {
if (DZE_Service_Points) then { if (DZE_Service_Points) then {
// Valid vehicle config classes as an example: "Air", "AllVehicles", "All", "APC", "Bicycle", "Car", "Helicopter", "Land", "Motorcycle", "Plane", "Ship", "Tank" // Valid vehicle config classes as an example: "Air", "AllVehicles", "All", "APC", "Bicycle", "Car", "Helicopter", "Land", "Motorcycle", "Plane", "Ship", "Tank"
DZE_SP_Classes = ["Map_A_FuelStation_Feed","Land_A_FuelStation_Feed","FuelPump_DZ"]; // service point classes, You can also use dayz_fuelpumparray by its self for all the default fuel pumps. DZE_SP_Classes = ["Map_A_FuelStation_Feed","Land_A_FuelStation_Feed","FuelPump_DZ","land_fuelstation_w"]; // service point classes, You can also use dayz_fuelpumparray by its self for all the default fuel pumps.
DZE_SP_MaxDistance = 50; // maximum distance from a service point for the options to be shown DZE_SP_MaxDistance = 50; // maximum distance from a service point for the options to be shown
// Refuel Settings // Refuel Settings

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -53,7 +53,13 @@ initialized = true;
if (dayz_REsec == 1) then {call compile preprocessFileLineNumbers "\z\addons\dayz_code\system\REsec.sqf";}; if (dayz_REsec == 1) then {call compile preprocessFileLineNumbers "\z\addons\dayz_code\system\REsec.sqf";};
if (isServer) then { if (isServer) then {
if (dayz_POIs) then {call compile preprocessFileLineNumbers "\z\addons\dayz_code\system\mission\chernarus\poi\init.sqf";}; if (dayz_POIs) then {
[
"A2Objects", // Object A2 objects that were included by Sumrak in Namalsk Crisis.
["A2RailGun",.25], // Spawns rail gun on the second floor of object A2. Default chance: .25 (25%)
"mapFixes" // Fixes entrances to some barracks and prevents fall hazards in Object A2.
] call compile preprocessFileLineNumbers "\z\addons\dayz_code\system\mission\namalsk\poi\init.sqf";
};
call compile preprocessFileLineNumbers "\z\addons\dayz_server\system\dynamic_vehicle.sqf"; call compile preprocessFileLineNumbers "\z\addons\dayz_server\system\dynamic_vehicle.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_server\system\server_monitor.sqf"; call compile preprocessFileLineNumbers "\z\addons\dayz_server\system\server_monitor.sqf";
execVM "\z\addons\dayz_server\traders\namalsk.sqf"; //Add trader agents execVM "\z\addons\dayz_server\traders\namalsk.sqf"; //Add trader agents

View File

@@ -319,7 +319,7 @@ class Mission
class Sensors class Sensors
{ {
items=4; items=5;
#define TRGDEF a=100;b=100;activationBy="WEST";repeating=1;interruptable=1;age="UNKNOWN";class Effects{}; #define TRGDEF a=100;b=100;activationBy="WEST";repeating=1;interruptable=1;age="UNKNOWN";class Effects{};
class Item0 class Item0
{ {
@@ -357,6 +357,15 @@ class Mission
expActiv="[""Dock Trader"",true,""enter""] call player_traderCity;"; expActiv="[""Dock Trader"",true,""enter""] call player_traderCity;";
expDesactiv="[""Dock Trader"",true,""leave""] call player_traderCity;"; expDesactiv="[""Dock Trader"",true,""leave""] call player_traderCity;";
}; };
class Item4
{
position[]={4977.15,4.74,6624.89};
TRGDEF
name="zoneAII";
expCond="(player distance [4977.15,6624.89,0.74293]) < 41;";
expActiv="[true,""enter""] call player_objectAII;";
expDesactiv="[true,""leave""] call player_objectAII;";
};
}; };
}; };
class Intro class Intro

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

View File

@@ -0,0 +1,186 @@
/*
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_text","_requirementsTools","_upgradeName","_displayname","_vehicle","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
_upgrade = _this;
_vehicle = cursorTarget;
if (isNull _vehicle || !(_vehicle isKindOf "AllVehicles") || !(alive _vehicle)) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_ACTIONS_18" call dayz_rollingMessages;};
_classname = typeOf _vehicle;
_displayname = getText (configFile >> "CfgVehicles" >> _classname >> "displayname");
if (_classname in DZE_DisableVehicleUpgrade) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_NOT_ALLOWED",_displayname] call dayz_rollingMessages;};
if ((player distance _vehicle) > 10) exitWith {dayz_actionInProgress = false; format [localize "STR_EPOCH_VEHUP_DISTANCE_TOO_FAR",_displayname] call dayz_rollingMessages;};
if (count (crew _vehicle) == 0) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (local _vehicle && !_notNearestPlayer) then {
// lookup vehicle and find if any upgrades are available
_upgradeName = getText (configFile >> "CfgMagazines" >> _upgrade >> "displayname");
// Can be removed after a futher Epoch Update, fixes the AAV_DZE could not be upgraded due to a missing config entry
if (_classname == "AAV_DZE") then {
_upgrade = ["AAV_DZE1",["ItemToolbox","ItemCrowbar"],[],[["ItemTankORP",1],["PartEngine",6],["PartGeneric",2],["ItemScrews",2]]];
} else {
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
};
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
closeDialog 0;
_newclassname = _upgrade select 0;
_requirementsTools = _upgrade select 1;
if (["",_requirementsTools,"none"] call dze_requiredItemsCheck) then {
_requirementsWeapon = _upgrade select 2;
_requirementsMagazine = _upgrade select 3;
_missingQty = 0;
_missing = "";
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsMagazine;
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} count _requirementsWeapon;
if (_proceed) then {
[player,(getPosATL player),20,"repair"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
if (count (crew _vehicle) > 0) exitWith {format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array_mag = [];
_temp_removed_array_wep = [];
_removed_total = 0;
_tobe_removed_total = 0;
{
_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_mag set [count _temp_removed_array_mag,_x];
};
};
} count magazines player;
} forEach _requirementsMagazine;
{
_removed = 0;
_itemIn = _x;
_countIn = 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 >> "cfgWeapons" >> _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_wep set [count _temp_removed_array_wep,_x];
};
};
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
call player_forceSave;
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
if (_objectCharacterID == "-1") then {
localize "str_epoch_player_50" call dayz_rollingMessages;
} else {
// Get position
_location = getposATL _vehicle;
// Get direction
_dir = getDir _vehicle;
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,_objectCharacterID,player,dayz_authKey];
publicVariableServer "PVDZE_veh_Upgrade";
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_crafting_failed",_newclassname] call dayz_rollingMessages;
} else {
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
};
};
} else {
{player addMagazine _x;} count _temp_removed_array_mag;
{player addWeapon _x;} count _temp_removed_array_wep;
format[localize "str_epoch_player_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _requirementsMagazine > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _requirementsMagazine;
};
if (count _requirementsWeapon > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _requirementsWeapon;
};
};
};
} else {
format [localize "STR_EPOCH_VEHUP_NO_UPGRADE_FOR_VEHICLE",_upgradeName,_displayname] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_245" call dayz_rollingMessages;
};
} else {
format [localize "STR_CL_LOG_FAIL_PLAYER",_displayname] call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -5,4 +5,18 @@ if (isServer) then {
if (!isDedicated) then { if (!isDedicated) then {
//Add your custom or override functions here //Add your custom or override functions here
//fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
// All fixes down below can be removed in a future Epoch Update
// Fix Wooden bases with wooden walls and floors got not properly recognized as shelter.
fnc_issheltered = compile preprocessFileLineNumbers "dayz_code\compile\fn_isSheltered.sqf";
// Fix upgrading AAV_DZE to AAV_DZE1 did not work, only needed if you are using the AAV_DZE
player_upgradeVehicle = compile preprocessFileLineNumbers "dayz_code\compile\player_upgradeVehicle.sqf";
// Fix Maintain the Virtual Garage with Coins does not work properly
if (DZE_Virtual_Garage) then {
Player_MaintainVG = compile preprocessFileLineNumbers "dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
};
}; };

View File

@@ -147,6 +147,9 @@ if (isServer) then {
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max]. DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max]. DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
}; };
// Static Weapon Plot Access
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
}; };
// Client // Client
@@ -546,6 +549,7 @@ if (!isDedicated) then {
DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable. DZE_EVRDamageItemsChance = .20; // Chance that an EVR storm will damage items in inventory. From 0 to 1. Chance applies to each item. Set to 0 to disable.
DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP. DZE_EVRDamageItems = [["Binocular_Vector","Binocular_VectorBroken"],["NVGoggles_DZE","ItemNVGFullBroken_DZE"],["NVGoggles","ItemNVGBroken_DZE"],["ItemGPS","ItemGPSBroken_DZE"],["ItemRadio","ItemRadioBroken_DZE"],["Smartphone_DZE","SmartphoneBroken_DZE"]]; // [item (input), damaged item (output)]. Items that have a chance to be damaged by EMP.
DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation DZE_EVRBloodLoss = [4000,8000]; // Random number of blood loss if a player does not have an APSI and/or is not inside a building [min, max]. Player will not die, there is a minimum of 1000 after the calculation
DZE_EVRSafezoneExempt = true; // Players in safe zones are exempt from the effects of the EVR storms.
}; };
// Garage Door Opener // Garage Door Opener

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private["_itemText","_enoughMoney","_moneyInfo","_wealth","_success","_ownerPUID"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// fn_isSheltered.sqf
//
// Author: Victor the Cleaner
// Date: May 2022
//
// Calculate how much shelter the player has and represent it as variable DZE_sheltered.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Raycast and perform collision check
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _deepScan = {
local _objects = lineIntersectsWith [_pos1, _pos2, _unit, objNull, true]; // sorted (nearest last)
local _nearest = (count _objects) - 1; // nearest object
local _idx = _this; // weight index
scopeName "exit";
for "_n" from _nearest to 0 step -1 do {
local _object = _objects select _n;
call {
if (_object isKindOf "AllVehicles") exitWith {}; // exclude vehicles, zombies and other players
local _model = _object call fn_getModelName;
if (_model in DZE_allTrees) exitWith {}; // exclude trees
///////////////////////////////////////////////////////////////////////////
//
// Get object edge data
//
///////////////////////////////////////////////////////////////////////////
local _box = boundingBox _object;
local _edge = [_box select 1, _box select 0] call DZE_fnc_vectorDiff;
local _edgeX = _edge select 0;
local _edgeY = _edge select 1;
local _edgeZ = _edge select 2;
local _proceed = false;
call {
if (_edgeX > _e2 && {(_edgeY > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeY > _e2 && {(_edgeX > _e1 || {_edgeZ > _e1})}) exitWith {_proceed = true;};
if (_edgeZ > _e2 && {(_edgeX > _e1 || {_edgeY > _e1})}) exitWith {_proceed = true;};
};
if (_proceed) then {
_hitWgt set [_idx, (_hitWgt select _idx) + (_scanWgt select _idx)]; // object meets criteria
breakTo "exit";
};
};
};
};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// calculate ASL vector dome
//
///////////////////////////////////////////////////////////////////////////////////////////////////
local _unit = _this select 0; // vehicle player
local _dir = _this select 1; // align hemisphere to building if inside
local _rad = 50; // scan radius
local _seg = 8; // initial segments
local _spin = 0; // z spin offset per arc-cycle
local _e1 = 2.5; // minimum edge length
local _e2 = 4.6; // long edge length
local _scanWgt = [1,1.5,2]; // scan weighting index
local _hitWgt = [0,0,0]; // record hit weighting
local _total = 0; // total hits, adjusted for weighting
local _pos1 = aimPos _unit; // ASL from
local _pos2 = +_pos1; // ASL to
_pos2 set [2, (_pos2 select 2) + _rad]; // overhead pos
2 call _deepScan; // perform initial raycast
DZE_roofOverhead = (_hitWgt select 2) > 0; // valid sized object directly above
for "_r" from 0 to 2 do {
local _rx = 30 * _r; // aggregate x rotation above the horizon
local _arc = 360 / (_seg / (_r max 1)); // arc segments per z rotation
for "_a" from _arc to 360 step _arc do {
local _rz = _dir + _a + _spin; // world direction with radial offset (or aligned to building)
local _pz = sin _rx; // x rotation gives z height
local _py = cos _rx; // x rotation gives y pos
local _px = _py * -(sin _rz); // z rotation gives x pos
_py = _py * (cos _rz); // z rotation gives y pos refactor
_pos2 = [_px, _py, _pz]; // unit vector (relative)
for "_i" from 0 to 2 do { // multiply and add from/to vectors
_pos2 set [_i, ((_pos2 select _i) * _rad) + (_pos1 select _i)];
};
_r call _deepScan; // perform raycast
};
_spin = _spin + 22.5; // incremental z spin
_total = _total + (_hitWgt select _r); // hit weighting running total
};
DZE_sheltered = _total / 30;

Some files were not shown because too many files have changed in this diff Show More