function get_springfieldXD9_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.SpringfieldXD9Mag");
	Inventory:AddItem("QG.SpringfieldXD9HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_beretta92_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Ber92Mag");
	Inventory:AddItem("QG.Beretta92HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_beretta93R_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Ber93RMag");
	Inventory:AddItem("QG.Beretta92HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_rugerSR9_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.RugerSR9Mag");
	Inventory:AddItem("QG.RugerSR9HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_glock17_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Glock17Mag");
	Inventory:AddItem("QG.Glock17HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_glock17L33_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Glock17Mag33");
	Inventory:AddItem("QG.Glock17HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_glockSup(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Glock17Suppressor");
	local player = getPlayer();
end
function get_glock19_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Glock17Mag");
	Inventory:AddItem("QG.Glock19HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_glock19L33_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Glock17Mag33");
	Inventory:AddItem("QG.Glock19HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_glock18_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Glock17Mag");
	Inventory:AddItem("QG.Glock18HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_glock18L33_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Glock17Mag33");
	Inventory:AddItem("QG.Glock18HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_taurus809_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Taurus809Mag");
	Inventory:AddItem("QG.Taurus809HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_taurus1911_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Taurus1911Mag");
	Inventory:AddItem("QG.Taurus1911HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_coltDefender_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.ColtDefenderMag");
	Inventory:AddItem("QG.ColtDefenderHandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_coltcommander_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.ColtCommanderMag");
	Inventory:AddItem("QG.ColtCommanderHandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_colt1911_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Colt1911Suppressor");
	Inventory:AddItem("QG.Colt1911HandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_colt1911Sup(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.Colt1911Suppressor");
	local player = getPlayer();
end
function get_browningHP_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.BrowningHPMag");
	Inventory:AddItem("QG.BrowningHPHandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end
function get_browningHPL15_pieces(items, result, player)
	local Inventory = player:getInventory();
	Inventory:AddItem("QG.BrowningHPMag15");
	Inventory:AddItem("QG.BrowningHPHandleBar");
	local player = getPlayer();
	player:playSound("QGDisassemblePistol", false);
end

function play_assembling_gun(items, result, player)
	local player = getPlayer();
	player:playSound("QGAssemblePistol", false);
end

function QGDistr(_roomName, _containerType, _containerFilled)
	local diff = ReloadManager[1]:getDifficulty();
	local quantity = 0
	local quantity1 = 0
	if _roomName == "all" and _containerType == "inventorymale" then
		if rnd(1000) >= 990 then
			if rnd(10) < 8 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
					quantity = rnd(15)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 9 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWCBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWCBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 7 then
							quantity = rnd(2)
							if CWCMagTable[GunIndex] ~= "" then
								while quantity ~=0 do
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
									quantity = quantity-1
								end
							end
						end
					end
				elseif rnd (10) < 8 then 
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
					quantity = rnd(15)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 9 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWRBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWRBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 7 then
							quantity = rnd(2)
							if CWRMagTable[GunIndex] ~= "" then
								while quantity ~=0 do
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
									quantity = quantity-1
								end
							end
						end
					end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
					quantity = rnd(15)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 9 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWSRBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWSRBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 7 then
							quantity = rnd(2)
							if CWSRMagTable[GunIndex] ~= "" then
								while quantity ~=0 do
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
									quantity = quantity-1
								end
							end
						end
					end		
				end
			else
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Body")
						quantity = rnd(15)
						if rnd(10) >= 9 then
							while quantity ~=0 do
								_containerFilled:AddItem(PWCAmmoTable2[GunIndex]);
								quantity = quantity-1
							end
						else
							while quantity ~=0 do
								_containerFilled:AddItem(PWCAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						end
						if rnd(10) >= 9 then
							if rnd(10) >= 9 then
								_containerFilled:AddItem(PWCBoxTable2[GunIndex]);
							else
								_containerFilled:AddItem(PWCBoxTable[GunIndex]);
							end
						end
						if diff >= 2 then
							if rnd(10) >= 7 then
								quantity = rnd(2)
								if PWCMagTable[GunIndex] ~= "" then
									while quantity ~=0 do
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Body")
										quantity = quantity-1
									end
								end
							end
						end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Body")
						quantity = rnd(15)
						if rnd(10) >= 9 then
							while quantity ~=0 do
								_containerFilled:AddItem(PWRAmmoTable2[GunIndex]);
								quantity = quantity-1
							end
						else
							while quantity ~=0 do
								_containerFilled:AddItem(PWRAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						end
						if rnd(10) >= 9 then
							if rnd(10) >= 9 then
								_containerFilled:AddItem(PWRBoxTable2[GunIndex]);
							else
								_containerFilled:AddItem(PWRBoxTable[GunIndex]);
							end
						end
						if diff >= 2 then
							if rnd(10) >= 7 then
								quantity = rnd(2)
								if PWRMagTable[GunIndex] ~= "" then
									while quantity ~=0 do
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Body")
										quantity = quantity-1
									end
								end
							end
						end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Body")
						quantity = rnd(15)
						if rnd(10) >= 9 then
							while quantity ~=0 do
								_containerFilled:AddItem(MWCAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						else
							while quantity ~=0 do
								_containerFilled:AddItem(MWCAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						end
						if rnd(10) >= 9 then
							if rnd(10) >= 9 then
								_containerFilled:AddItem(MWCBoxTable[GunIndex]);
							else
								_containerFilled:AddItem(MWCBoxTable[GunIndex]);
							end
						end
						if diff >= 2 then
							if rnd(10) >= 7 then
								quantity = rnd(2)
								if MWCMagTable[GunIndex] ~= "" then
									while quantity ~=0 do
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Body")
										quantity = quantity-1
									end
								end
							end
						end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Body")
						quantity = rnd(15)
						if rnd(10) >= 9 then
							while quantity ~=0 do
								_containerFilled:AddItem(MWRAmmoTable2[GunIndex]);
								quantity = quantity-1
							end
						else
							while quantity ~=0 do
								_containerFilled:AddItem(MWRAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						end
						if rnd(10) >= 9 then
							if rnd(10) >= 9 then
								_containerFilled:AddItem(MWRBoxTable2[GunIndex]);
							else
								_containerFilled:AddItem(MWRBoxTable[GunIndex]);
							end
						end
						if diff >= 2 then
							if rnd(10) >= 7 then
								quantity = rnd(2)
								if MWRMagTable[GunIndex] ~= "" then
									while quantity ~=0 do
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Body")
										quantity = quantity-1
									end
								end
							end
						end
					end
				end
			end
		end
	elseif _roomName == "all" and _containerType == "inventoryfemale" then
		if rnd(1000) >= 990 then
			if rnd(10) < 8 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
					quantity = rnd(15)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 9 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWCBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWCBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 7 then
							quantity = rnd(2)
							if CWCMagTable[GunIndex] ~= "" then
								while quantity ~=0 do
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
									quantity = quantity-1
								end
							end
						end
					end
				elseif rnd (10) < 8 then 
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
					quantity = rnd(15)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 9 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWRBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWRBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 7 then
							quantity = rnd(2)
							if CWRMagTable[GunIndex] ~= "" then
								while quantity ~=0 do
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
									quantity = quantity-1
								end
							end
						end
					end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
					quantity = rnd(15)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 9 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWSRBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWSRBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 7 then
							quantity = rnd(2)
							if CWSRMagTable[GunIndex] ~= "" then
								while quantity ~=0 do
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Body")
									quantity = quantity-1
								end
							end
						end
					end		
				end
			else
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Body")
						quantity = rnd(15)
						if rnd(10) >= 9 then
							while quantity ~=0 do
								_containerFilled:AddItem(PWCAmmoTable2[GunIndex]);
								quantity = quantity-1
							end
						else
							while quantity ~=0 do
								_containerFilled:AddItem(PWCAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						end
						if rnd(10) >= 9 then
							if rnd(10) >= 9 then
								_containerFilled:AddItem(PWCBoxTable2[GunIndex]);
							else
								_containerFilled:AddItem(PWCBoxTable[GunIndex]);
							end
						end
						if diff >= 2 then
							if rnd(10) >= 7 then
								quantity = rnd(2)
								if PWCMagTable[GunIndex] ~= "" then
									while quantity ~=0 do
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Body")
										quantity = quantity-1
									end
								end
							end
						end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Body")
						quantity = rnd(15)
						if rnd(10) >= 9 then
							while quantity ~=0 do
								_containerFilled:AddItem(PWRAmmoTable2[GunIndex]);
								quantity = quantity-1
							end
						else
							while quantity ~=0 do
								_containerFilled:AddItem(PWRAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						end
						if rnd(10) >= 9 then
							if rnd(10) >= 9 then
								_containerFilled:AddItem(PWRBoxTable2[GunIndex]);
							else
								_containerFilled:AddItem(PWRBoxTable[GunIndex]);
							end
						end
						if diff >= 2 then
							if rnd(10) >= 7 then
								quantity = rnd(2)
								if PWRMagTable[GunIndex] ~= "" then
									while quantity ~=0 do
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Body")
										quantity = quantity-1
									end
								end
							end
						end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Body")
						quantity = rnd(15)
						if rnd(10) >= 9 then
							while quantity ~=0 do
								_containerFilled:AddItem(MWCAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						else
							while quantity ~=0 do
								_containerFilled:AddItem(MWCAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						end
						if rnd(10) >= 9 then
							if rnd(10) >= 9 then
								_containerFilled:AddItem(MWCBoxTable[GunIndex]);
							else
								_containerFilled:AddItem(MWCBoxTable[GunIndex]);
							end
						end
						if diff >= 2 then
							if rnd(10) >= 7 then
								quantity = rnd(2)
								if MWCMagTable[GunIndex] ~= "" then
									while quantity ~=0 do
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Body")
										quantity = quantity-1
									end
								end
							end
						end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Body")
						quantity = rnd(15)
						if rnd(10) >= 9 then
							while quantity ~=0 do
								_containerFilled:AddItem(MWRAmmoTable2[GunIndex]);
								quantity = quantity-1
							end
						else
							while quantity ~=0 do
								_containerFilled:AddItem(MWRAmmoTable[GunIndex]);
								quantity = quantity-1
							end
						end
						if rnd(10) >= 9 then
							if rnd(10) >= 9 then
								_containerFilled:AddItem(MWRBoxTable2[GunIndex]);
							else
								_containerFilled:AddItem(MWRBoxTable[GunIndex]);
							end
						end
						if diff >= 2 then
							if rnd(10) >= 7 then
								quantity = rnd(2)
								if MWRMagTable[GunIndex] ~= "" then
									while quantity ~=0 do
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Body")
										quantity = quantity-1
									end
								end
							end
						end
					end
				end
			end
		end
	elseif _roomName == "bedroom" and _containerType == "wardrobe" then
		if rnd (100) > 85 then
			if rnd (100) < 80 then
				GunIndex = rnd(#CivWepTableCom);
				if rnd(10) >= 9 then
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "House")
					quantity = rnd(6)
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if rnd(10) >= 9 then
					quantity = rnd(22)
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if diff >= 2 then
					if rnd(10) >= 9 then
						if rnd (10) >= 9 then
							quantity = 2
						else
							quantity = 1
						end
						while quantity ~= 0 do
							local item = CWCMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "House")
							quantity = quantity-1
						end
					end
				end
				if rnd(10) >= 9 then
					if rnd (10) >= 9 then
						quantity = 2
					else
						quantity = 1
					end
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWCBoxTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWCBoxTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if rnd(100) >= 95 then
					ModIndex = rnd(#CivModTable);
					_containerFilled:AddItem(CivModTable[ModIndex]);
				end
				if rnd(100) >= 95 then
					RepairIndex = rnd(#RepairTable);
					_containerFilled:AddItem(RepairTable[RepairIndex]);
				end
			elseif rnd (10) >= 8 then
				GunIndex = rnd(#CivWepTableRare);
				if rnd(10) >= 9 then
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "House")
					quantity = rnd(6)
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if rnd(10) >= 9 then
					quantity = rnd(22)
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if diff >= 2 then
					if rnd(10) >= 9 then
						if rnd (10) >= 9 then
							quantity = 2
						else
							quantity = 1
						end
						while quantity ~= 0 do
							local item = CWRMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "House")
							quantity = quantity-1
						end
					end
				end
				if rnd(10) >= 9 then
					if rnd (10) >= 9 then
						quantity = 2
					else
						quantity = 1
					end
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWRBoxTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWRBoxTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if rnd(100) >= 95 then
					ModIndex = rnd(#CivModTable);
					_containerFilled:AddItem(CivModTable[ModIndex]);
				end
				if rnd(100) >= 95 then
					RepairIndex = rnd(#RepairTable);
					_containerFilled:AddItem(RepairTable[RepairIndex]);
				end
			else
				GunIndex = rnd(#CivWepTableSuperRare);
				if rnd(10) >= 9 then
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "House")
					quantity = rnd(6)
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if rnd(10) >= 9 then
					quantity = rnd(22)
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if diff >= 2 then
					if rnd(10) >= 9 then
						if rnd (10) >= 9 then
							quantity = 2
						else
							quantity = 1
						end
						while quantity ~= 0 do
							local item = CWSRMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "House")
							quantity = quantity-1
						end
					end
				end
				if rnd(10) >= 9 then
					if rnd (10) >= 9 then
						quantity = 2
					else
						quantity = 1
					end
					if rnd(10) >= 8 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRBoxTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRBoxTable[GunIndex]);
							quantity = quantity-1
						end
					end
				end
				if rnd(100) >= 95 then
					ModIndex = rnd(#CivModTable);
					_containerFilled:AddItem(CivModTable[ModIndex]);
				end
				if rnd(100) >= 95 then
					RepairIndex = rnd(#RepairTable);
					_containerFilled:AddItem(RepairTable[RepairIndex]);
				end
			end
		end
	elseif _roomName == "zippeestore" and _containerType == "counter" then
		if rnd(100) >=90 then
			GunIndex = rnd(#CivSGTable);
			if rnd(10) >= 8 then
				local item = CivSGTable[GunIndex]
				QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Gas")
				if rnd (10) >= 6 then
					quantity = rnd (4)
				else
					quantity = 1
				end
				while quantity ~= 0 do
					_containerFilled:AddItem("QG.12gRounds");
					quantity = quantity-1
				end
				if rnd(10) >= 8 then
					_containerFilled:AddItem("QG.12gBox");
				end
			end
		end
	elseif _roomName == "fossoil" and _containerType == "counter" then
		if rnd(100) >=90 then
			GunIndex = rnd(#CivSGTable);
			if rnd(10) >= 8 then
				local item = CivSGTable[GunIndex]
				QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Gas")
				if rnd (10) >= 6 then
					quantity = rnd (4)
				else
					quantity = 1
				end
				while quantity ~= 0 do
					_containerFilled:AddItem("QG.12gRounds");
					quantity = quantity-1
				end
				if rnd(10) >= 8 then
					_containerFilled:AddItem("QG.12gBox");
				end
			end
		end
	elseif _roomName == "gasstore" and _containerType == "counter" then
		if rnd(100) >=90 then
			GunIndex = rnd(#CivSGTable);
			if rnd(10) >= 8 then
				local item = CivSGTable[GunIndex]
				QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Gas")
				if rnd (10) >= 6 then
					quantity = rnd (4)
				else
					quantity = 1
				end
				while quantity ~= 0 do
					_containerFilled:AddItem("QG.12gRounds");
					quantity = quantity-1
				end
				if rnd(10) >= 8 then
					_containerFilled:AddItem("QG.12gBox");
				end
			end
		end
	elseif _roomName == "bar" and _containerType == "counter" then
		if rnd(100) >=70 then
			GunIndex = rnd(#CivSGTable);
			if rnd(10) >= 8 then
				local item = CivSGTable[GunIndex]
				QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Gas")
				if rnd (10) >= 6 then
					quantity = rnd (4)
				else
					quantity = 1
				end
				while quantity ~= 0 do
					_containerFilled:AddItem("QG.12gRounds");
					quantity = quantity-1
				end
				if rnd(10) >= 8 then
					_containerFilled:AddItem("QG.12gBox");
				end
			end
		end
	elseif _roomName == "policestorage" then
		quantity = rnd(1)
		while quantity ~= 0 do
			if rnd (10) < 7 then
				if rnd (10) < 8 then
					GunIndex = rnd(#PolWepTableCom);
					if rnd(10) >= 4 then
					local item = PolWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Police", "Police")
					end
					if rnd (10) < 8 then
						quantity1 = 1
						if rnd(10) >=4 then
							quantity1 = quantity1 + rnd(2)
						end
						if rnd(10) >=8 then
							quantity1 = quantity1 + rnd(2)
						end
						while quantity1 ~= 0 do
							_containerFilled:AddItem(PWCBoxTable[GunIndex]);
							quantity1 = quantity1 - 1
						end
					else
						_containerFilled:AddItem(PWCCanTable[GunIndex]);					
					end
					if diff >= 2 then
						if rnd(10) >= 4 then
							quantity1 = 1
							if rnd(10) >= 6 then
								quantity1 = quantity1 + rnd(2)
							end
							while quantity1 ~= 0 do
								local item = PWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Police", "Police")
								quantity1 = quantity1 - 1
							end
						end
					end
					if rnd(10) >= 7 then
						ModIndex = rnd(#NonCivModTable);
						_containerFilled:AddItem(NonCivModTable[ModIndex]);
					end
					if rnd(10) >= 6 then
						RepairIndex = rnd(#RepairTable);
						_containerFilled:AddItem(RepairTable[RepairIndex]);
					end
				else
					GunIndex = rnd(#PolWepTableRare);
					if rnd(10) >= 4 then
					local item = PolWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Police", "Police")
					end
					if rnd (10) < 8 then
						quantity1 = 1
						if rnd(10) >=4 then
							quantity1 = quantity1 + rnd(2)
						end
						if rnd(10) >=8 then
							quantity1 = quantity1 + rnd(2)
						end
						while quantity1 ~= 0 do
							_containerFilled:AddItem(PWRBoxTable[GunIndex]);
							quantity1 = quantity1 - 1
						end
					else
						_containerFilled:AddItem(PWRCanTable[GunIndex]);					
					end
					if diff >= 2 then
						if rnd(10) >= 4 then
							quantity1 = 1
							if rnd(10) >= 6 then
								quantity1 = quantity1 + rnd(2)
							end
							while quantity1 ~= 0 do
								local item = PWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Police", "Police")
								quantity1 = quantity1 - 1
							end
						end
					end
					if rnd(10) >= 7 then
						ModIndex = rnd(#NonCivModTable);
						_containerFilled:AddItem(NonCivModTable[ModIndex]);
					end
					if rnd(10) >= 6 then
						RepairIndex = rnd(#RepairTable);
						_containerFilled:AddItem(RepairTable[RepairIndex]);
					end
				end
			else
				if rnd (10) < 8 then
					GunIndex = rnd(#MilWepTableCom);
					if rnd(10) >= 4 then
					local item = MilWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Military", "Police")
					end
					if rnd (10) < 8 then
						quantity1 = 1
						if rnd(10) >=4 then
							quantity1 = quantity1 + rnd(2)
						end
						if rnd(10) >=8 then
							quantity1 = quantity1 + rnd(2)
						end
						while quantity1 ~= 0 do
							_containerFilled:AddItem(MWCBoxTable[GunIndex]);
							quantity1 = quantity1 - 1
						end
					else
						_containerFilled:AddItem(MWCCanTable[GunIndex]);					
					end
					if diff >= 2 then
						if rnd(10) >= 4 then
							quantity1 = 1
							if rnd(10) >= 6 then
								quantity1 = quantity1 + rnd(2)
							end
							while quantity1 ~= 0 do
								local item = MWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Military", "Police")
								quantity1 = quantity1 - 1
							end
						end
					end
					if rnd(10) >= 7 then
						ModIndex = rnd(#NonCivModTable);
						_containerFilled:AddItem(NonCivModTable[ModIndex]);
					end
					if rnd(10) >= 6 then
						RepairIndex = rnd(#RepairTable);
						_containerFilled:AddItem(RepairTable[RepairIndex]);
					end
				else
					GunIndex = rnd(#MilWepTableRare);
					if rnd(10) >= 4 then
					local item = MilWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Military", "Police")
					end
					if rnd (10) < 8 then
						quantity1 = 1
						if rnd(10) >=4 then
							quantity1 = quantity1 + rnd(2)
						end
						if rnd(10) >=8 then
							quantity1 = quantity1 + rnd(2)
						end
						while quantity1 ~= 0 do
							_containerFilled:AddItem(MWRBoxTable[GunIndex]);
							quantity1 = quantity1 - 1
						end
					else
						_containerFilled:AddItem(MWRCanTable[GunIndex]);					
					end
					if diff >= 2 then
						if rnd(10) >= 4 then
							quantity1 = 1
							if rnd(10) >= 6 then
								quantity1 = quantity1 + rnd(2)
							end
							while quantity1 ~= 0 do
								local item = MWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Military", "Police")
								quantity1 = quantity1 - 1
							end
						end
					end
					if rnd(10) >= 7 then
						ModIndex = rnd(#NonCivModTable);
						_containerFilled:AddItem(NonCivModTable[ModIndex]);
					end
					if rnd(10) >= 6 then
						RepairIndex = rnd(#RepairTable);
						_containerFilled:AddItem(RepairTable[RepairIndex]);
					end
				end
				quantity = quantity -1
			end
		end
	elseif _roomName == "gunstore" and _containerType == "locker" then
		if rnd(20) >= 1 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 2 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 3 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 4 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 5 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 6 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 7 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 9 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 11 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 13 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 15 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 17 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(20) >= 19 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(4) >= 1 then
			RepairIndex = rnd(#RepairTable);
			local item = _containerFilled:AddItem(RepairTable[RepairIndex]);
		end
	elseif _roomName == "gunstore" and _containerType == "counter" then
		if rnd(20) >= 2 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 4 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 6 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 8 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 10 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 12 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 14 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 16 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 18 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(20) >= 20 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(5) >= 2 then
			RepairIndex = rnd(#RepairTable);
			_containerFilled:AddItem(RepairTable[RepairIndex]);
		end
	elseif _roomName == "gunstore" and _containerType == "displaycase" then
		if rnd(100) >= 5 then
			if rnd(100) < 85 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				elseif rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end	
				end
			else		
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				end
			end
		end
		if rnd(100) >= 25 then
			if rnd(100) < 85 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				elseif rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end	
				end
			else		
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				end
			end
		end
		if rnd(5) >= 2 then
			if rnd(10) < 9 then
				ModIndex = rnd(#CivModTable);
				_containerFilled:AddItem(CivModTable[ModIndex]);
			else
				ModIndex = rnd(#NonCivModTable);
				_containerFilled:AddItem(NonCivModTable[ModIndex]);
			end
		end
	elseif _roomName == "gunstorestorage" and _containerType == "metal_shelves" then
		if rnd(100) >= 5 then
			if rnd(100) < 85 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				elseif rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end	
				end
			else		
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				end
			end
		end
		if rnd(100) >= 25 then
			if rnd(100) < 85 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				elseif rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end	
				end
			else		
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				end
			end
		end
		if rnd(5) >= 2 then
			if rnd(10) < 9 then
				ModIndex = rnd(#CivModTable);
				_containerFilled:AddItem(CivModTable[ModIndex]);
			else
				ModIndex = rnd(#NonCivModTable);
				_containerFilled:AddItem(NonCivModTable[ModIndex]);
			end
		end
		if rnd(5) >= 42 then
			if rnd(10) < 9 then
				ModIndex = rnd(#CivModTable);
				_containerFilled:AddItem(CivModTable[ModIndex]);
			else
				ModIndex = rnd(#NonCivModTable);
				_containerFilled:AddItem(NonCivModTable[ModIndex]);
			end
		end
		if rnd(20) >= 2 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 4 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 6 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 8 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 10 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 12 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 14 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 16 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 18 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(20) >= 20 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(5) >= 2 then
			RepairIndex = rnd(#RepairTable);
			local item = _containerFilled:AddItem(RepairTable[RepairIndex]);
		end
	elseif _roomName == "gunstorestorage" and _containerType == "crate" then
		if rnd(100) >= 1 then
			if rnd(100) < 85 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				elseif rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end	
				end
			else		
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				end
			end
		end
		if rnd(100) >= 20 then
			if rnd(100) < 85 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				elseif rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end	
				end
			else		
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				end
			end
		end
		if rnd(100) >= 60 then
			if rnd(100) < 85 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				elseif rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						if diff >= 2 then
							if rnd(10) >= 3 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
							if rnd(10) >= 7 then
								local item = CWSRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							end
						end	
				end
			else		
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = PWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
								if rnd(10) >= 7 then
									local item = MWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								end
							end
					end
				end
			end
		end
		if rnd(5) >= 1 then
			if rnd(10) < 9 then
				ModIndex = rnd(#CivModTable);
				_containerFilled:AddItem(CivModTable[ModIndex]);
			else
				ModIndex = rnd(#NonCivModTable);
				_containerFilled:AddItem(NonCivModTable[ModIndex]);
			end
		end
		if rnd(5) >= 2 then
			if rnd(10) < 9 then
				ModIndex = rnd(#CivModTable);
				_containerFilled:AddItem(CivModTable[ModIndex]);
			else
				ModIndex = rnd(#NonCivModTable);
				_containerFilled:AddItem(NonCivModTable[ModIndex]);
			end
		end
		if rnd(20) >= 2 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 4 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 6 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 8 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 10 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 12 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 14 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 16 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 18 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(20) >= 20 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(5) >= 2 then
			RepairIndex = rnd(#RepairTable);
			_containerFilled:AddItem(RepairTable[RepairIndex]);
		end
		if rnd(20) >= 2 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 4 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 6 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 8 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 10 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 12 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 14 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 16 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 18 then
			ammoindex = rnd(#AllBoxTable);
			_containerFilled:AddItem(AllBoxTable[ammoindex]);
		end
		if rnd(20) >= 20 then
			ammoindex = rnd(#AllCanTable);
			_containerFilled:AddItem(AllCanTable[ammoindex]);
		end
		if rnd(5) >= 2 then
			RepairIndex = rnd(#RepairTable);
			_containerFilled:AddItem(RepairTable[RepairIndex]);
		end
	elseif _roomName == "storageunit" and _containerType == "crate" then
		if rnd(100) >= 85 then
			if rnd(100) >= 5 then
				if rnd(100) < 85 then
					if rnd (10) < 8 then
						GunIndex = rnd(#CivWepTableCom);
						local item = CivWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					elseif rnd (10) < 8 then
						GunIndex = rnd(#CivWepTableRare);
						local item = CivWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					else
						GunIndex = rnd(#CivWepTableSuperRare);
						local item = CivWepTableSuperRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					end
				else		
					if rnd (10) < 7 then
						if rnd (10) < 8 then
							GunIndex = rnd(#PolWepTableCom);
							local item = PolWepTableCom[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
									if rnd(10) >= 7 then
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
								end
						else
							GunIndex = rnd(#PolWepTableRare);
							local item = PolWepTableRare[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
									if rnd(10) >= 7 then
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
								end
						end
					else
						if rnd (10) < 8 then
							GunIndex = rnd(#MilWepTableCom);
							local item = MilWepTableCom[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
									if rnd(10) >= 7 then
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
								end
						else
							GunIndex = rnd(#MilWepTableRare);
							local item = MilWepTableRare[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
									if rnd(10) >= 7 then
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
								end
						end
					end
				end
			end
			if rnd(100) >= 25 then
				if rnd(100) < 85 then
					if rnd (10) < 8 then
						GunIndex = rnd(#CivWepTableCom);
						local item = CivWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					elseif rnd (10) < 8 then
						GunIndex = rnd(#CivWepTableRare);
						local item = CivWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					else
						GunIndex = rnd(#CivWepTableSuperRare);
						local item = CivWepTableSuperRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					end
				else		
					if rnd (10) < 7 then
						if rnd (10) < 8 then
							GunIndex = rnd(#PolWepTableCom);
							local item = PolWepTableCom[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
									if rnd(10) >= 7 then
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
								end
						else
							GunIndex = rnd(#PolWepTableRare);
							local item = PolWepTableRare[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
									if rnd(10) >= 7 then
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
								end
						end
					else
						if rnd (10) < 8 then
							GunIndex = rnd(#MilWepTableCom);
							local item = MilWepTableCom[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
									if rnd(10) >= 7 then
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
								end
						else
							GunIndex = rnd(#MilWepTableRare);
							local item = MilWepTableRare[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
									if rnd(10) >= 7 then
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
								end
						end
					end
				end
			end
			if rnd(5) >= 2 then
				if rnd(10) < 9 then
					ModIndex = rnd(#CivModTable);
					_containerFilled:AddItem(CivModTable[ModIndex]);
				else
					ModIndex = rnd(#NonCivModTable);
					_containerFilled:AddItem(NonCivModTable[ModIndex]);
				end
			end
			if rnd(5) >= 42 then
				if rnd(10) < 9 then
					ModIndex = rnd(#CivModTable);
					_containerFilled:AddItem(CivModTable[ModIndex]);
				else
					ModIndex = rnd(#NonCivModTable);
					_containerFilled:AddItem(NonCivModTable[ModIndex]);
				end
			end
			if rnd(20) >= 2 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 4 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 6 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 8 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 10 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 12 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 14 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 16 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 18 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 20 then
				ammoindex = rnd(#AllCanTable);
				_containerFilled:AddItem(AllCanTable[ammoindex]);
			end
			if rnd(5) >= 2 then
				RepairIndex = rnd(#RepairTable);
				local item = _containerFilled:AddItem(RepairTable[RepairIndex]);
			end
		end
	elseif _roomName == "garagestorage" and _containerType == "smallbox" then
		if rnd(100) >= 85 then
			if rnd(100) >= 5 then
				if rnd(100) < 85 then
					if rnd (10) < 8 then
						GunIndex = rnd(#CivWepTableCom);
						local item = CivWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					elseif rnd (10) < 8 then
						GunIndex = rnd(#CivWepTableRare);
						local item = CivWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					else
						GunIndex = rnd(#CivWepTableSuperRare);
						local item = CivWepTableSuperRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					end
				else		
					if rnd (10) < 7 then
						if rnd (10) < 8 then
							GunIndex = rnd(#PolWepTableCom);
							local item = PolWepTableCom[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
									if rnd(10) >= 7 then
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
								end
						else
							GunIndex = rnd(#PolWepTableRare);
							local item = PolWepTableRare[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
									if rnd(10) >= 7 then
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
								end
						end
					else
						if rnd (10) < 8 then
							GunIndex = rnd(#MilWepTableCom);
							local item = MilWepTableCom[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
									if rnd(10) >= 7 then
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
								end
						else
							GunIndex = rnd(#MilWepTableRare);
							local item = MilWepTableRare[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
									if rnd(10) >= 7 then
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
								end
						end
					end
				end
			end
			if rnd(100) >= 25 then
				if rnd(100) < 85 then
					if rnd (10) < 8 then
						GunIndex = rnd(#CivWepTableCom);
						local item = CivWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWCMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					elseif rnd (10) < 8 then
						GunIndex = rnd(#CivWepTableRare);
						local item = CivWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					else
						GunIndex = rnd(#CivWepTableSuperRare);
						local item = CivWepTableSuperRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
							if diff >= 2 then
								if rnd(10) >= 3 then
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
								if rnd(10) >= 7 then
									local item = CWSRMagTable[GunIndex]
									QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
								end
							end
					end
				else		
					if rnd (10) < 7 then
						if rnd (10) < 8 then
							GunIndex = rnd(#PolWepTableCom);
							local item = PolWepTableCom[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
									if rnd(10) >= 7 then
										local item = PWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
								end
						else
							GunIndex = rnd(#PolWepTableRare);
							local item = PolWepTableRare[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
									if rnd(10) >= 7 then
										local item = PWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
									end
								end
						end
					else
						if rnd (10) < 8 then
							GunIndex = rnd(#MilWepTableCom);
							local item = MilWepTableCom[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
									if rnd(10) >= 7 then
										local item = MWCMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
								end
						else
							GunIndex = rnd(#MilWepTableRare);
							local item = MilWepTableRare[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
								if diff >= 2 then
									if rnd(10) >= 3 then
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
									if rnd(10) >= 7 then
										local item = MWRMagTable[GunIndex]
										QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
									end
								end
						end
					end
				end
			end
			if rnd(5) >= 2 then
				if rnd(10) < 9 then
					ModIndex = rnd(#CivModTable);
					_containerFilled:AddItem(CivModTable[ModIndex]);
				else
					ModIndex = rnd(#NonCivModTable);
					_containerFilled:AddItem(NonCivModTable[ModIndex]);
				end
			end
			if rnd(5) >= 42 then
				if rnd(10) < 9 then
					ModIndex = rnd(#CivModTable);
					_containerFilled:AddItem(CivModTable[ModIndex]);
				else
					ModIndex = rnd(#NonCivModTable);
					_containerFilled:AddItem(NonCivModTable[ModIndex]);
				end
			end
			if rnd(20) >= 2 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 4 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 6 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 8 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 10 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 12 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 14 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 16 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 18 then
				ammoindex = rnd(#AllBoxTable);
				_containerFilled:AddItem(AllBoxTable[ammoindex]);
			end
			if rnd(20) >= 20 then
				ammoindex = rnd(#AllCanTable);
				_containerFilled:AddItem(AllCanTable[ammoindex]);
			end
			if rnd(5) >= 2 then
				RepairIndex = rnd(#RepairTable);
				local item = _containerFilled:AddItem(RepairTable[RepairIndex]);
			end
		end
	elseif _roomName == "hunting" and _containerType == "metal_shelves" then
		if rnd(100) >= 35 then
			if rnd(10) < 8 then
				if rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableCom);
					local item = CivWepTableCom[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
					quantity = rnd(20)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWCAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 6 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWCBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWCBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 4 then
							local item = CWCMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						end
						if rnd(10) >= 8 then
							local item = CWCMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						end
					end
				elseif rnd (10) < 8 then
					GunIndex = rnd(#CivWepTableRare);
					local item = CivWepTableRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
					quantity = rnd(20)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 6 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWRBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWRBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 4 then
							local item = CWRMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						end
						if rnd(10) >= 8 then
							local item = CWRMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						end
					end
				else
					GunIndex = rnd(#CivWepTableSuperRare);
					local item = CivWepTableSuperRare[GunIndex]
					QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
					quantity = rnd(20)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(CWSRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 6 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(CWSRBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(CWSRBoxTable[GunIndex]);
						end
					end
					if diff >= 2 then
						if rnd(10) >= 4 then
							local item = CWSRMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						end
						if rnd(10) >= 8 then
							local item = CWSRMagTable[GunIndex]
							QGItemGen:GenerateItem(_containerFilled, item, "Civilian", "Store")
						end
					end
				end
			else		
				if rnd (10) < 7 then
					if rnd (10) < 8 then
						GunIndex = rnd(#PolWepTableCom);
						local item = PolWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
					quantity = rnd(20)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(PWCAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(PWCAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 6 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(PWCBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(PWCBoxTable[GunIndex]);
						end
					end
						if diff >= 2 then
							if rnd(10) >= 4 then
								local item = PWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							end
							if rnd(10) >= 8 then
								local item = PWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							end
						end
					else
						GunIndex = rnd(#PolWepTableRare);
						local item = PolWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
					quantity = rnd(20)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(PWRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(PWRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 6 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(PWRBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(PWRBoxTable[GunIndex]);
						end
					end
						if diff >= 2 then
							if rnd(10) >= 4 then
								local item = PWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							end
							if rnd(10) >= 8 then
								local item = PWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Police", "Store")
							end
						end
					end
				else
					if rnd (10) < 8 then
						GunIndex = rnd(#MilWepTableCom);
						local item = MilWepTableCom[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
					quantity = rnd(20)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(MWCAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(MWCAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 6 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(MWCBoxTable[GunIndex]);
						else
							_containerFilled:AddItem(MWCBoxTable[GunIndex]);
						end
					end
						if diff >= 2 then
							if rnd(10) >= 4 then
								local item = MWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							end
							if rnd(10) >= 8 then
								local item = MWCMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							end
						end
					else
						GunIndex = rnd(#MilWepTableRare);
						local item = MilWepTableRare[GunIndex]
						QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
					quantity = rnd(20)
					if rnd(10) >= 9 then
						while quantity ~=0 do
							_containerFilled:AddItem(MWRAmmoTable2[GunIndex]);
							quantity = quantity-1
						end
					else
						while quantity ~=0 do
							_containerFilled:AddItem(MWRAmmoTable[GunIndex]);
							quantity = quantity-1
						end
					end
					if rnd(10) >= 6 then
						if rnd(10) >= 9 then
							_containerFilled:AddItem(MWRBoxTable2[GunIndex]);
						else
							_containerFilled:AddItem(MWRBoxTable[GunIndex]);
						end
					end
						if diff >= 2 then
							if rnd(10) >= 4 then
								local item = MWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							end
							if rnd(10) >= 8 then
								local item = MWRMagTable[GunIndex]
								QGItemGen:GenerateItem(_containerFilled, item, "Military", "Store")
							end
						end
					end
				end
			end
		end
	end
end
	
	CivWepTableCom = {	
	"QG.SpringfieldXD9",
	"QG.Ber92",		
	"QG.Glock17",	
	"QG.Glock18",
	"QG.Glock19",	
	"QG.RugerSR9",
		};
	
	CivWepTableRare = {
	"QG.Colt1911",	
	"QG.Ber93R",
	"QG.Glock17Sup",
	"QG.Taurus1911",
	"QG.BrowningHP",	
		};
		
	CivWepTableSuperRare = {
	"QG.Colt1911Sup",
	"QG.Glock17L33Sup",	
	"QG.ColtDefender",	
	"QG.Taurus809",
		};
		
	CivSGTable = {		
	"QG.SpringfieldXD9",		
	"QG.Glock17",	
	"QG.Glock17L33",	
	"QG.Glock18",	
	"QG.Glock18L33",
	"QG.Taurus809",
	"QG.ColtDefender",
	"QG.ColtCommander",	
	"QG.BrowningHP",	
	"QG.BrowningHPL15",
	"QG.RugerSR9",
	"QG.Taurus1911",
		};
	
	PolWepTableCom = {	
	"QG.Colt1911",	
	"QG.Ber92",	
	"QG.RugerSR9",	
	"QG.Glock17",
	"QG.Glock18",	
	"QG.Glock19",	
	"QG.Glock17Sup",	
		};

	PolWepTableRare = {	
	"QG.Taurus809",
	"QG.Taurus1911",	
	"QG.ColtDefender",
	"QG.ColtCommander",	
	"QG.BrowningHP",
	"QG.Glock17Sup",
	};
		
	MilWepTableCom = {	
	"QG.Ber92",	
	"QG.Ber92L32",	
	"QG.Ber93R",			
	"QG.Taurus1911",
	"QG.BrowningHP",
	"QG.Glock17Sup",
		};
		
	MilWepTableRare = {	
	"QG.Taurus809",
	"QG.ColtDefender",
	"QG.ColtCommander",	
	"QG.BrowningHP",	
	"QG.Ber93RL15",
	"QG.BrowningHPL15",
	"QG.Glock17Sup",
		};
		
	CWCAmmoTable = {	
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	CWCAmmoTable2 = {	
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
	
	CWCBoxTable = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	CWCBoxTable2 = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	CWCCanTable = {	
	"QG.9mmCan",
		};
		
	CWCCanTable2 = {	
	"QG.9mmCan",
		};
		
	CWCMagTable = {	
	"",
		};
	
	CWRAmmoTable = {
	"QG.45ACPRounds";
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	CWRAmmoTable2 = {
	"QG.45ACPRounds";	
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
	
	CWRBoxTable = {	
	"QG.45ACPBox";
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	CWRBoxTable2 = {
	"QG.45ACPBox";	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	CWRCanTable = {	
	"QG.45ACPCan";
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
		};
		
	CWRCanTable2 = {	
	"QG.45ACPCan";
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
		};
		
	CWRMagTable = {	
	"",
		};
		
	CWSRAmmoTable = {	
	"QG.45ACPRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	CWSRAmmoTable2 = {	
	"QG.45ACPRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	CWSRBoxTable = {	
	"QG.45ACPBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	CWSRBoxTable2 = {	
	"QG.45ACPBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	CWSRCanTable = {	
	"QG.45ACPCan",
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
		};
	
	CWSRCanTable = {	
	"QG.45ACPCan",
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
		};
		
	CWSRMagTable = {	
	"",
		};

	PWCAmmoTable = {	
	"QG.45ACPRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	PWCAmmoTable2 = {	
	"QG.45ACPRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	PWCBoxTable = {	
	"QG.45ACPBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	PWCBoxTable2 = {	
	"QG.45ACPBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	PWCCanTable = {	
	"QG.45ACPBox",
	"QG.9mmCan",
	"QG.9mmCan",
		};
		
	PWCCanTable2 = {	
	"QG.45ACPBox",
	"QG.9mmCan",
	"QG.9mmCan",
		};
		
	PWCMagTable = {
		"",
		};
		
	PWRAmmoTable = {	
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	PWRAmmoTable2 = {	
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	PWRBoxTable = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	PWRBoxTable2 = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	PWRCanTable = {	
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
		};
		
	PWRCanTable2 = {	
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
		};
		
	PWRMagTable = {
		"",
		};
	
	MWCAmmoTable = {	
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};

	MWCBoxTable = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	MWCCanTable = {	
	"QG.9mmCan",
	"QG.9mmCan",
	"QG.9mmCan",
		};
		
	MWCMagTable = {
		"",
		};
				
	MWRAmmoTable = {	
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	MWRAmmoTable2 = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	MWRBoxTable = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	MWRBoxTable2 = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	MWRCanTable = {
		"",
		};
		

	MWRMagTable = {
		"",
		};
		
	AllRoundsTable = {	
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
	"QG.9mmRounds",
		};
		
	AllBoxTable = {	
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
	"QG.9mmBox",
		};
		
	AllCanTable = {	
	"QG.9mmCan",
		};
		
	CivModTable = {
		"",
		};
		
	NonCivModTable = {
		"",
		};
		
	RepairTable = {	
	"QG.WD40",	
	"QG.Brushkit",	
	"QG.Maintkit",
	"QG.Glock17Mag33",
	"QG.Ber93RMag",
	"QG.BrowningHPMag15",
	"QG.Glock17Suppressor",
	"QG.Colt1911Suppressor",
		};
		
function rnd(_value)
	return ZombRand(_value) + 1;
end

Events.OnFillContainer.Add(QGDistr);

WeaponUpgrades = {

};