mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-27 02:01:49 +03:00
Add upgradable safes and lockboxes
- Safes and lockboxes can be upgraded now. - A winter lockbox version was added too. The current model and icon will be replaced later for the new lockbox. - Calling Child 308 on the DB has no room for storing coins, this is why we need to update coins and gear after swaping the object. Same for upgrade vehicle
This commit is contained in:
@@ -51,7 +51,7 @@ if ((vehicle player) == player) then {
|
||||
waitUntil {((_this select 0) != dayz_lastSave) || {diag_tickTime >= ((_this select 1) + 1)}}; //waiting is required otherwise player_forceSave will reset DZE_GearCheckBypass
|
||||
if (!dialog) then {
|
||||
DZE_GearCheckBypass = true;
|
||||
if ((((_this select 2) in DZE_isNewStorage) || {(_this select 2) == "LockboxStorage"} || {(_this select 2) isKindOf "Land_A_tent"} || {(_this select 2) isKindOf "WeaponHolder"} || {((!alive (_this select 3)) && {(_this select 2) isKindOf "Man"})}) && {!(locked (_this select 3))}) then {
|
||||
if ((((_this select 2) in DZE_isNewStorage) || {(_this select 2) isKindOf "Land_A_tent"} || {(_this select 2) isKindOf "WeaponHolder"} || {((!alive (_this select 3)) && {(_this select 2) isKindOf "Man"})}) && {!(locked (_this select 3))}) then {
|
||||
Player action ["GEAR", (_this select 3)];
|
||||
} else {
|
||||
createGearDialog [player, "RscDisplayGear"];
|
||||
|
||||
@@ -622,7 +622,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis
|
||||
};
|
||||
|
||||
//Allow owner to unlock vault
|
||||
if (_isClose && !keypadCancel && {(_typeOfCursorTarget in DZE_LockableStorage) && {_characterID != "0"}}) then {
|
||||
if (_isClose && !keypadCancel && {(_typeOfCursorTarget in DZE_LockedStorage) && {_characterID != "0"}}) then {
|
||||
if (s_player_unlockvault < 0) then {
|
||||
if (_typeOfCursorTarget in DZE_LockedStorage) then {
|
||||
if ((_characterID == dayz_combination) || {_ownerID == _uid}) then {
|
||||
@@ -706,17 +706,17 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis
|
||||
};
|
||||
|
||||
// inplace upgrade tool
|
||||
if (((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base") || (_cursorTarget isKindOf "DZE_Housebase") || (_cursorTarget isKindOf "DZ_storage_base") || (_typeOfCursorTarget in DZE_isNewStorage)) && !(_typeOfCursorTarget in DZE_DisableUpgrade)) then {
|
||||
if (((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base") || (_cursorTarget isKindOf "DZE_Housebase") || (_cursorTarget isKindOf "DZ_storage_base") || (_typeOfCursorTarget in DZE_UpgradableStorage)) && !(_typeOfCursorTarget in DZE_DisableUpgrade)) then {
|
||||
if ((s_player_lastTarget select 0) != _cursorTarget) then {
|
||||
if (s_player_upgrade_build > 0) then {
|
||||
player removeAction s_player_upgrade_build;
|
||||
s_player_upgrade_build = -1;
|
||||
};
|
||||
};
|
||||
if (s_player_upgrade_build < 0) then {
|
||||
_hasAccess = [player, _cursorTarget] call FNC_check_access;
|
||||
_upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding");
|
||||
if (((_hasAccess select 0) || {_hasAccess select 2} || {_hasAccess select 3}) && {(count _upgrade) > 0}) then {
|
||||
_upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding");
|
||||
if ((s_player_upgrade_build < 0) && {(count _upgrade) > 0}) then {
|
||||
_hasAccess = [player, _cursorTarget] call FNC_check_access;
|
||||
if ((_hasAccess select 0) || (_hasAccess select 2) || (_hasAccess select 3) || (_typeOfCursorTarget in DZE_UpgradableStorage) || (_typeOfCursorTarget isKindOf "DZ_storage_base")) then {
|
||||
s_player_lastTarget set [0,_cursorTarget];
|
||||
s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_UPGRADE",_text], "\z\addons\dayz_code\actions\player_upgrade.sqf",_cursorTarget, -1, false, true];
|
||||
};
|
||||
@@ -822,8 +822,8 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis
|
||||
player removeAction s_player_checkWallet;
|
||||
s_player_checkWallet = -1;
|
||||
};
|
||||
//if (_typeOfCursorTarget in DZE_MoneyStorageClasses && {!_isLocked} && {!(_typeOfCursorTarget in DZE_LockedStorage)}) then {
|
||||
if (!_isLocked && {_typeOfCursorTarget in DZE_MoneyStorageClasses}) then {
|
||||
|
||||
if (!_isLocked && {_typeOfCursorTarget in DZE_MoneyStorageClasses} && {!(_typeOfCursorTarget in DZE_LockedStorage)}) then {
|
||||
if (s_bank_dialog < 0) then {
|
||||
s_bank_dialog = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_CL_ZSC_ACCESS_BANK"],"\z\addons\dayz_code\actions\zsc\bankDialog.sqf",_cursorTarget,1,true,true];
|
||||
};
|
||||
|
||||
@@ -30,7 +30,7 @@ if (count (crew _vehicle) == 0) then {
|
||||
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
|
||||
|
||||
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
|
||||
closeDialog 0;
|
||||
closeDialog 0;
|
||||
_newclassname = _upgrade select 0;
|
||||
_requirementsTools = _upgrade select 1;
|
||||
|
||||
@@ -57,10 +57,13 @@ if (count (crew _vehicle) == 0) then {
|
||||
} count _requirementsWeapon;
|
||||
|
||||
if (_proceed) then {
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
[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 = [];
|
||||
@@ -107,7 +110,7 @@ if (count (crew _vehicle) == 0) then {
|
||||
|
||||
// all parts removed proceed
|
||||
if (_tobe_removed_total == _removed_total) then {
|
||||
|
||||
call player_forceSave;
|
||||
_objectID = _vehicle getVariable ["ObjectID","0"];
|
||||
_objectUID = _vehicle getVariable ["ObjectUID","0"];
|
||||
|
||||
@@ -125,7 +128,7 @@ if (count (crew _vehicle) == 0) then {
|
||||
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
|
||||
[_newclassname,objNull] call fn_waitForObject;
|
||||
dze_waiting = nil;
|
||||
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,true,_objectCharacterID,player,dayz_authKey];
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user