diff --git a/Server_Install_Pack/@epochhive/epochconfig.hpp b/Server_Install_Pack/@epochhive/epochconfig.hpp index 6af055c9..3a93d922 100644 --- a/Server_Install_Pack/@epochhive/epochconfig.hpp +++ b/Server_Install_Pack/@epochhive/epochconfig.hpp @@ -40,6 +40,22 @@ removevehmagazinesturret[] = { // Remove these Magazines from the given Turret f {"200Rnd_40mm_G_belt",{0}} }; +// BaseBuilding +UseIndestructible = false; // Enable / Disable Indestructible BaseObjects +IndestructibleBaseObjects[] = { // Can be Names or Classes + "Constructions_static_F", + "Buildable_Storage", + "PlotPole_EPOCH", + "LockBox_EPOCH", + "Safe_EPOCH" + }; +ExceptedBaseObjects[] = { // Not Indestructible, also if in a Class of IndestructibleBaseObjects + "CinderWallGarage_EPOCH", + "WoodLargeWallDoorL_EPOCH", + "WoodLargeWallDoor_EPOCH", + "WoodWall4_EPOCH" + }; + // Traders taxRate = 0.1; // controls the price increase for purchases starterTraderItems[] = { { "ItemSodaBurst", "meatballs_epoch", "MortarBucket", "CinderBlocks", "VehicleRepair", "CircuitParts", "ItemCorrugated", "PartPlankPack", "ItemRock", "ItemRope", "ItemStick" }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 } }; // Starter Items for fresh spawned trader first array is classnames second is quantity. diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf index 70155baf..57ba3528 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf @@ -14,6 +14,10 @@ */ _maxTTL = parseNumber EPOCH_expiresBuilding; +_serverSettingsConfig = configFile >> "CfgEpochServer"; +_UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry; +_IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry; +_ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry; _cfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig; _cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig; _buildingJammerRange = getNumber(_cfgEpochClient >> "buildingJammerRange"); @@ -74,6 +78,15 @@ for "_i" from 0 to _this do { if (isClass (configFile >> "CfgVehicles" >> _class) && (_damage < 1) && !(_class isKindOf 'Constructions_lockedstatic_F')) then { _baseObj = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"]; + if (_UseIndestructible) then { + if ({_baseObj iskindof _x} count _ExceptedBaseObjects == 0) then { + { + if (_baseObj iskindof _x) exitwith { + _baseObj allowdamage false; + }; + } foreach _IndestructibleBaseObjects; + }; + }; _baseObj setVectorDirAndUp _worldspace; _baseObj setposATL _location; diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf index 808f1af9..70762910 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf @@ -23,6 +23,10 @@ _playerUID = getPlayerUID _player; if (!isNull ropeAttachedTo _vehicle) exitWith{}; _oemType = typeOf _vehicle; +_serverSettingsConfig = configFile >> "CfgEpochServer"; +_UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry; +_IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry; +_ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry; _cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig; _staticClassConfig = (_cfgBaseBuilding >> _oemType >> "staticClass"); if (isText _staticClassConfig) then { @@ -39,7 +43,17 @@ if (isText _staticClassConfig) then { _vehiclePos = getposATL _vehicle; _storageObj = [_staticClass,_vehicle] call EPOCH_swapBuilding; - + + if (_UseIndestructible) then { + if ({_storageObj iskindof _x} count _ExceptedBaseObjects == 0) then { + { + if (_storageObj iskindof _x) exitwith { + _storageObj allowdamage false; + }; + } foreach _IndestructibleBaseObjects; + }; + }; + if (getNumber(_cfgBaseBuilding >> _staticClass >> "isSecureStorage") == 1) then{ _storageObj setVariable["EPOCH_Locked", false, true]; }; @@ -73,6 +87,17 @@ if (isText _staticClassConfig) then { if (_objSlot != -1) then { _newVehicle = [_vehicle, false] call EPOCH_server_simulSwap; + + if (_UseIndestructible) then { + if ({_newVehicle iskindof _x} count _ExceptedBaseObjects == 0) then { + { + if (_newVehicle iskindof _x) exitwith { + _newVehicle allowdamage false; + }; + } foreach _IndestructibleBaseObjects; + }; + }; + _newVehicle setVariable["BUILD_OWNER", _playerUID, true]; _newVehicle call EPOCH_saveBuilding; }; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf index 4fa7b36f..31da38ad 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf @@ -15,6 +15,11 @@ private ["_inventory","_location","_dir","_textures","_colors","_textureSelectionIndex","_selections","_count","_color","_cfgBaseBuilding","_objTypes","_objQty","_wMags","_wMagsArray","_attachments","_magazineSizeMax","_magazineName","_magazineSize","_qty","_objType","_marker","_class_raw","_damage","_class","_worldspace","_wsCount","_vehicle","_arr","_storageSlotIndex","_vehHiveKey","_response","_diag"]; params [["_maxStorageLimit",0]]; +_serverSettingsConfig = configFile >> "CfgEpochServer"; +_UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry; +_IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry; +_ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry; + _diag = diag_tickTime; EPOCH_StorageSlots = []; for "_i" from 1 to _maxStorageLimit do { @@ -67,6 +72,16 @@ for "_i" from 1 to _maxStorageLimit do { _vehicle = createVehicle[_class, [0,0,0], [], 0, "CAN_COLLIDE"]; + if (_UseIndestructible) then { + if ({_vehicle iskindof _x} count _ExceptedBaseObjects == 0) then { + { + if (_vehicle iskindof _x) exitwith { + _vehicle allowdamage false; + }; + } foreach _IndestructibleBaseObjects; + }; + }; + if (_dir isEqualType []) then { _vehicle setVectorDirAndUp _dir; _vehicle setposATL _location;