Gem Trading mostly finished

Sometimes displays incorrect total price in advanced trading menu.
This commit is contained in:
icomrade
2016-04-30 11:17:41 -04:00
parent b5c2c6c7bd
commit 83694a452e
9 changed files with 309 additions and 54 deletions

View File

@@ -206,9 +206,16 @@ if (_proceed) then {
if (_isMine) then {
if((random 10) <= 4) then {
_gems = ["ItemTopaz","ItemObsidian","ItemSapphire","ItemAmethyst","ItemEmerald","ItemCitrine","ItemRuby"];
_gem = _gems select (floor(random (count _gems)));
_selectedRemoveOutput set [(count _selectedRemoveOutput),[_gem,1]];
_gems = [];
_weights = [];
{
_gems set [(count _gems), (_x select 0)];
_weights set [(count _weights), (_x select 1)];
} count DZE_GemOccurance;
diag_log [_gems, _weights];
_gemSelected = [_gems, _weights] call BIS_fnc_selectRandomWeighted;
diag_log _gemSelected;
_selectedRemoveOutput set [(count _selectedRemoveOutput),[_gemSelected,1]];
};
};