Add configurable loot refresh timer

Vanilla commits:

2eb963dc3f

657aaba83a
This commit is contained in:
ebayShopper
2017-11-17 17:47:28 -05:00
parent 01292cb036
commit 4953f33fdb
5 changed files with 41 additions and 38 deletions

View File

@@ -11,6 +11,7 @@
[NEW] Added basic server-side authentication to hive object creation/deletion for improved security. Affects Server_(DeleteObj|PublishObj|PublishVeh|SwapObj|UpdateObject), admins and script makers should review the changes if using PVDZ_obj_(Destroy|Publish), PVDZ_veh_Save, PVDZE_obj_Swap, PVDZE_veh_(Publish|Upgrade) or server_deleteObj and verify custom code is compliant with these changes (github.com/EpochModTeam/DayZ-Epoch/commit/42e0047) [NEW] Added basic server-side authentication to hive object creation/deletion for improved security. Affects Server_(DeleteObj|PublishObj|PublishVeh|SwapObj|UpdateObject), admins and script makers should review the changes if using PVDZ_obj_(Destroy|Publish), PVDZ_veh_Save, PVDZE_obj_Swap, PVDZE_veh_(Publish|Upgrade) or server_deleteObj and verify custom code is compliant with these changes (github.com/EpochModTeam/DayZ-Epoch/commit/42e0047)
[NEW] BAF_L85A2_RIS_TWS_DZ to emulate the old behavior of the now NV only BAF_L85A2_RIS_CWS. Server owners must add the weapon on their own #1983 [NEW] BAF_L85A2_RIS_TWS_DZ to emulate the old behavior of the now NV only BAF_L85A2_RIS_CWS. Server owners must add the weapon on their own #1983
[NEW] Admins can now define a maximum build height, see configVariables.sqf/DZE_BuildHeightLimit. @BigEgg17 [NEW] Admins can now define a maximum build height, see configVariables.sqf/DZE_BuildHeightLimit. @BigEgg17
[NEW] Admins can now change the lootRefreshTimer for each building type from the default 15 minutes. CfgLoot.hpp must be updated if using custom loot tables.
[UPDATED] Loot and zed spawn is now disabled in trader cities by default. This is configurable in mission\init.sqf via DZE_SafeZonePosArray. Added function to check positions against DZE_SafeZonePosArray "_PosInSafeZone = _positionToCheck call DZE_SafeZonePosCheck;" [UPDATED] Loot and zed spawn is now disabled in trader cities by default. This is configurable in mission\init.sqf via DZE_SafeZonePosArray. Added function to check positions against DZE_SafeZonePosArray "_PosInSafeZone = _positionToCheck call DZE_SafeZonePosCheck;"
[UPDATED] Zombie pathing. Zeds should now run more direct to players. [UPDATED] Zombie pathing. Zeds should now run more direct to players.

View File

@@ -407,6 +407,37 @@ class Land_AII_upper_part: Military
lootPos[] = {{-0.616211, -3.80762, -2.31434}, {-2.62158, -1.05127, -2.32196}, {-2.30322, 2.0415, -2.32196}}; lootPos[] = {{-0.616211, -3.80762, -2.31434}, {-2.62158, -1.05127, -2.32196}, {-2.30322, 2.0415, -2.32196}};
}; };
class Land_Mil_Guardhouse_EP1: Military //Not enterable, Takistan version
{
zombieClass[] =
{
"z_soldier",
"z_soldier",
"z_policeman"
};
lootPos[] = {{-3.05859,1.76514,-1.59003},{-3.16895,3.45361,-1.59003},{-3.19922,-0.323242,-1.59003}};
};
class Land_Mil_Guardhouse: Military //Enterable zero_building
{
zombieClass[] =
{
"z_soldier",
"z_soldier",
"z_policeman"
};
lootChance = 0.5;
maxRoaming = 3;
zedPos[] = {{-2.44727,0.250977,-1.70563},{-2.44873,3.00293,-1.70285}};
lootPos[] = {
//{-2.44727,0.250977,-1.70563},{-2.44873,3.00293,-1.70285}
{4.65381,-3.61914,-1.46277},{2.99756,3.54102,-0.712769}
};
lootPosSmall[] = {
{-0.798828,-3.51758,-1.46277},{3.73047,-3.95996,-1.32278},{-0.283203,-3.15723,-1.32278},{-0.996582,3.81445,-1.14279},{-1.33008,2.26563,-0.762787},{0.289063,3.66211,-0.0827942},{-1.17383,-0.112305,-1.48279}
};
};
//DZE ADDED BELOW //DZE ADDED BELOW
class land_vstup: Military { class land_vstup: Military {
lootPos[] = {{-11.51,-2.64844,-1.53312},{-6.24463,-2.85059,-1.53312},{-1.16992,-2.84961,-1.53312},{2.70898,-2.85059,-1.53312}}; lootPos[] = {{-11.51,-2.64844,-1.53312},{-6.24463,-2.85059,-1.53312},{-1.16992,-2.84961,-1.53312},{2.70898,-2.85059,-1.53312}};
@@ -483,16 +514,6 @@ class Land_vez: Military
lootPos[] = {{-0.0585938,1.51367,1.36331}}; lootPos[] = {{-0.0585938,1.51367,1.36331}};
zedPos[] = {{-0.116699,-0.801758,-2.81857}}; zedPos[] = {{-0.116699,-0.801758,-2.81857}};
}; };
class Land_Mil_Guardhouse_EP1: Military
{
zombieClass[] =
{
"z_soldier",
"z_soldier",
"z_policeman"
};
lootPos[] = {{-3.05859,1.76514,-1.59003},{-3.16895,3.45361,-1.59003},{-3.19922,-0.323242,-1.59003}};
};
class Land_fortified_nest_big_EP1: Military class Land_fortified_nest_big_EP1: Military
{ {
lootPos[] = { lootPos[] = {
@@ -519,27 +540,6 @@ class HMMWVWreck: Military
maxRoaming = 2; maxRoaming = 2;
lootPos[] = {}; lootPos[] = {};
}; };
class Land_Mil_Guardhouse: Military //MOVED FROM RESIDENTIAL
{
zombieClass[] =
{
"z_soldier",
"z_soldier",
"z_policeman"
};
lootChance = 0.5;
maxRoaming = 3;
zedPos[] = {{-2.44727,0.250977,-1.70563},{-2.44873,3.00293,-1.70285}};
lootPos[] = {
//{-2.44727,0.250977,-1.70563},{-2.44873,3.00293,-1.70285}
{4.65381,-3.61914,-1.46277},{2.99756,3.54102,-0.712769}
};
lootPosSmall[] = {
{-0.798828,-3.51758,-1.46277},{3.73047,-3.95996,-1.32278},{-0.283203,-3.15723,-1.32278},{-0.996582,3.81445,-1.14279},{-1.33008,2.26563,-0.762787},{0.289063,3.66211,-0.0827942},{-1.17383,-0.112305,-1.48279}
};
};
class UH60_NAVY_Wreck_DZ: Military { class UH60_NAVY_Wreck_DZ: Military {
zombieClass[] = {"z_soldier_pilot","z_soldier_heavy"}; zombieClass[] = {"z_soldier_pilot","z_soldier_heavy"};
zombieChance = 0.3; zombieChance = 0.3;

View File

@@ -706,7 +706,7 @@ class Land_House_K_6_EP1: Residential // tak 3 story cement open door red blanke
{ {
lootPos[] = {{2.36108,1.41309,-1.60797},{-2.57178,1.42285,-1.59425},{-4.81445,2.98193,1.48639},{-0.123047,3.83203,1.47144},{2.7063,0.193359,4.42145},{-4.3584,-2.99609,4.33153},{-0.0888672,3.0293,4.42143},{2.10864,0.180664,1.47076},{-4.10083,-2.09082,1.55551}}; lootPos[] = {{2.36108,1.41309,-1.60797},{-2.57178,1.42285,-1.59425},{-4.81445,2.98193,1.48639},{-0.123047,3.83203,1.47144},{2.7063,0.193359,4.42145},{-4.3584,-2.99609,4.33153},{-0.0888672,3.0293,4.42143},{2.10864,0.180664,1.47076},{-4.10083,-2.09082,1.55551}};
}; };
//Land_Mil_Guardhouse_EP1 in Military.hpp
//land_seb_bouda3 in Industrial.hpp //land_seb_bouda3 in Industrial.hpp
class land_seb_mine_maringotka: Residential { // Nm class land_seb_mine_maringotka: Residential { // Nm
lootPos[] = {{0.423828,0.721191,-0.612675},{-0.976563,-1.32764,-0.612675}}; lootPos[] = {{0.423828,0.721191,-0.612675},{-0.976563,-1.32764,-0.612675}};

View File

@@ -108,6 +108,7 @@ class CfgLoot
}; };
lootChance = 0; lootChance = 0;
lootRefreshTimer = 900;
lootGroup = ""; lootGroup = "";
lootPos[] = {}; lootPos[] = {};
}; };
@@ -115,4 +116,4 @@ class CfgLoot
// Buildings // Buildings
#include "CfgBuildingPos.hpp" #include "CfgBuildingPos.hpp"
}; };
}; };

View File

@@ -1,7 +1,7 @@
private ["_isWreck","_maxControlledZombies","_looted","_zombied","_doNothing","_spawnZedRadius","_serverTime","_age","_nearbyBuildings","_position","_speed","_radius","_maxlocalspawned","_maxWeaponHolders","_currentWeaponHolders","_maxtoCreate","_inVehicle","_isAir","_isLand","_isSea","_Controlledzeddivided","_totalcrew","_nearby","_type","_config","_canSpawn","_dis","_checkLoot","_islocal","_bPos","_zombiesNum"]; private ["_isWreck","_maxControlledZombies","_looted","_zombied","_doNothing","_spawnZedRadius","_serverTime","_age","_nearbyBuildings","_position","_speed","_radius","_maxlocalspawned","_maxWeaponHolders","_currentWeaponHolders","_maxtoCreate","_inVehicle","_isAir","_isLand","_isSea","_Controlledzeddivided","_totalcrew","_nearby","_type","_config","_canSpawn","_dis","_checkLoot","_islocal","_bPos","_zombiesNum"];
_age = -1; _age = -1;
//_nearbyBuildings = []; //_nearbyBuildings = [];
_position = [player] call FNC_GetPos; _position = [player] call fnc_getPos;
_speed = speed (vehicle player); _speed = speed (vehicle player);
_radius = 200; //150*0.707; Pointless Processing (106.5) _radius = 200; //150*0.707; Pointless Processing (106.5)
_spawnZedRadius = 20; _spawnZedRadius = 20;
@@ -122,12 +122,13 @@ if (_maxlocalspawned > 0) then { _spawnZedRadius = _spawnZedRadius * 3; };
//Loot //Loot
if (getNumber(_config >> "lootChance") > 0) then { if (getNumber(_config >> "lootChance") > 0) then {
if (_currentWeaponHolders < _maxWeaponHolders) then { if (_currentWeaponHolders < _maxWeaponHolders) then {
//Baisc loot check //Basic loot check
if ((_dis < 125) and (_dis > 30) and !_inVehicle and _checkLoot) then { if ((_dis < 125) and (_dis > 30) and !_inVehicle and _checkLoot) then {
_serverTime = serverTime; _serverTime = serverTime;
_looted = (_x getVariable ["looted",_serverTime]); _looted = (_x getVariable ["looted",_serverTime]);
_age = _serverTime - _looted; _age = _serverTime - _looted;
if ((_age == 0) or (_age > 900)) then { //Building refresh rate
if (_age == 0 or (_age > getNumber(_config >> "lootRefreshTimer"))) then {
_x setVariable ["looted",_serverTime,!_islocal]; _x setVariable ["looted",_serverTime,!_islocal];
_x call building_spawnLoot; _x call building_spawnLoot;
if (!(_x in dayz_buildingBubbleMonitor)) then { if (!(_x in dayz_buildingBubbleMonitor)) then {
@@ -152,7 +153,7 @@ if (_maxlocalspawned > 0) then { _spawnZedRadius = _spawnZedRadius * 3; };
if (!_isWreck) then { if (!_isWreck) then {
if ((dayz_spawnZombies < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then { if ((dayz_spawnZombies < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then {
_bPos = getPosATL _x; _bPos = getPosATL _x;
_zombiesNum = {alive _x} count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]); _zombiesNum = count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]);
if (_zombiesNum == 0) then { if (_zombiesNum == 0) then {
_x setVariable ["zombieSpawn",_serverTime,!_islocal]; _x setVariable ["zombieSpawn",_serverTime,!_islocal];
@@ -169,7 +170,7 @@ if (_maxlocalspawned > 0) then { _spawnZedRadius = _spawnZedRadius * 3; };
}; };
} else { } else {
_bPos = getPosATL _x; _bPos = getPosATL _x;
_zombiesNum = {alive _x} count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 30)]); _zombiesNum = count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 30)]);
//Should be a wreck //Should be a wreck
if (_zombiesNum == 0) then { [_x,_isWreck] call building_spawnZombies; }; if (_zombiesNum == 0) then { [_x,_isWreck] call building_spawnZombies; };
}; };