Merge pull request #70 from Johnmatic/master

rare loot fix
This commit is contained in:
eraser1
2020-12-07 15:12:57 -06:00
committed by GitHub
3 changed files with 22 additions and 2 deletions

View File

@ -1230,6 +1230,9 @@ DMS_SpawnMissions_Scheduled = false; // Whether or not to spawn missions in a sc
"Exile_Item_CodeLock"
];
DMS_RareLootChance = 10; // Percentage Chance to spawn rare loot in any crate | Default: 10%
DMS_RareLootSpawnMagazines = true; //If spawned rare loot is weapon, spawn magazines for it too
DMS_RareLootMinMagazines = DMS_MinimumMagCount; //We can spawn different count of magazines for rare weapons
DMS_RareLootMaxMagazines = DMS_MaximumMagCount;
// Vehicles
DMS_ArmedVehicles = [ // List of armed vehicles that can spawn

View File

@ -46,6 +46,7 @@ if (DMS_Use_Map_Config) then
};
DMS_MagRange = DMS_MaximumMagCount - DMS_MinimumMagCount;
DMS_RareMagRange = DMS_RareLootMaxMagazines - DMS_RareLootMinMagazines;
/*
Original Functions from

View File

@ -286,14 +286,30 @@ if (DMS_RareLoot) then
};
// (Maybe) Add rare loot
if(random 100 < _rareLootChance) then
for "_i" from 1 to DMS_RareLootAmount do
{
for "_i" from 1 to DMS_RareLootAmount do
if((random 100) < _rareLootChance) then
{
_item = selectRandom DMS_RareLootList;
if (_item isEqualType "") then
{
private _ammo = "";
if (DMS_RareLootSpawnMagazines) then
{
_ammo = _item call DMS_fnc_selectMagazine;
};
_item = [_item,1];
if (_ammo isEqualType "") then
{
if !(_ammo in ["Exile_Magazine_Swing","Exile_Magazine_Boing","Exile_Magazine_Swoosh", ""]) then
{
_crate addItemCargoGlobal [_ammo, (DMS_RareLootMinMagazines + floor(random DMS_RareMagRange))];
};
};
};
_crate addItemCargoGlobal _item;
};