Register

DonkeyPunch Community Gaming

GAME ON!!! -sTanG

News:

DayZ SA development well under way
Administrator
*****

DirtySanchez

December 17, 2016, 09:44:03 PM
Humanitarian Posts: 933 Humanity: +1337/-420
Have a broken loot table?
Cant find your answer?
Too many tables and positions?

HAHA

Override your ExileServer_system_lootManager_spawnLootInBuilding.sqf function.

Add at line 18:
Code: [Select]
diag_log format["eXpoch_Debug - SpawnLootInBuilding: _this:%1 - _Config:%2 - _lootTable:%3 - _localPositions:%4",_this,_buildingConfig, _lootTableName,_localPositions];
so that it looks like this:
Code: [Select]
_building = _this;
_building setVariable ["ExileLootSpawnedAt", time];
_building setVariable ["ExileHasLoot", true];
_buildingConfig = configFile >> "CfgBuildings" >> typeOf _building;
_lootTableName = getText (_buildingConfig >> "table");
_localPositions = getArray (_buildingConfig >> "positions");

diag_log format["eXpoch_Debug - SpawnLootInBuilding: _this:%1 - _Config:%2 - _lootTable:%3 - _localPositions:%4",_this,_buildingConfig, _lootTableName,_localPositions];

if ((getPosATL _building) call ExileClient_util_world_isInRadiatedZone) then
{
_lootTableName = "Radiation";
};
_lootConfig = missionConfigFile >> "CfgExileLootSettings";
_maximumNumberOfLootPositions = getNumber (_lootConfig >> "maximumNumberOfLootSpotsPerBuilding");
_maximumPositionCoverage = getNumber (_lootConfig >> "maximumPositionCoverage");
_maximumNumberOfItemsPerLootSpot = getNumber (_lootConfig >> "maximumNumberOfItemsPerLootSpot");
_numberOfPositionsToUse = 1 max (((count _localPositions) * _maximumPositionCoverage / 100) min _maximumNumberOfLootPositions);
_localPositions = _localPositions call ExileClient_util_array_shuffle;
_lootPositions = _localPositions select [0, _numberOfPositionsToUse];
_spawnedItemClassNames = [];
_lootWeaponHolderNetIDs = [];
{
_lootPosition = ASLToATL (AGLToASL (_building modelToWorld _x));
if (_lootPosition select 2 < 0.05) then
{
_lootPosition set [2, 0.05];
};
_lootHolder = objNull;
_numberOfItemsToSpawn = (floor (random _maximumNumberOfItemsPerLootSpot)) + 1;
for "_n" from 1 to _numberOfItemsToSpawn do
{
_itemClassName = _lootTableName call ExileServer_system_lootManager_dropItem;
if !(_itemClassName in _spawnedItemClassNames) then
{
if (isNull _lootHolder) then
{
_lootHolder = createVehicle ["LootWeaponHolder", _lootPosition, [], 0, "CAN_COLLIDE"];
_lootHolder setDir (random 360);
_lootHolder setPosATL _lootPosition;
_lootHolder setVariable ["ExileSpawnedAt", time];
_lootWeaponHolderNetIDs pushBack (netId _lootHolder);
};
_cargoType = _itemClassName call ExileClient_util_cargo_getType;
switch (_cargoType) do
{
case 1:
{
if (_itemClassName isEqualTo "Exile_Item_MountainDupe") then
{
_lootHolder addMagazineCargoGlobal [_itemClassName, 2];
}
else
{
_lootHolder addMagazineCargoGlobal [_itemClassName, 1];
};
};
case 3:
{
_lootHolder addBackpackCargoGlobal [_itemClassName, 1];
};
case 2:
{
_lootHolder addWeaponCargoGlobal [_itemClassName, 1];
if !(_itemClassName isKindOf ["Exile_Melee_Abstract", configFile >> "CfgWeapons"]) then
{
_magazineClassNames = getArray(configFile >> "CfgWeapons" >> _itemClassName >> "magazines");
if (count(_magazineClassNames) > 0) then
{
_magazineClassName = selectRandom _magazineClassNames;
_numberOfMagazines = 2 + floor(random 3);
_lootHolder addMagazineCargoGlobal [_magazineClassName, _numberOfMagazines];
_spawnedItemClassNames pushBack _magazineClassName;
};
};
_numberOfItemsToSpawn = -1;
};
default
{
_lootHolder addItemCargoGlobal [_itemClassName, 1];
};
};
_spawnedItemClassNames pushBack _itemClassName;
};
};
}
forEach _lootPositions;
_building setVariable ["ExileLootWeaponHolderNetIDs", _lootWeaponHolderNetIDs];
ExileServerBuildingNetIdsWithLoot pushBack (netId _building);

Now just run the server wait for the loot to break and check the last building were loot was suppose to spawn by checking your server side RPT and look for the debug code, it will be the last one in the RPT :)
« Last Edit: April 01, 2017, 12:05:15 AM by DirtySanchez »


Website: http://DonkeyPunch.INFO  |  Discord: https://discord.me/eXpoch  |  TeamSpeak: ts3.donkeypunch.info


 
1337-420