ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Торговец Медикаментами"
ENT.Author = "MedicMod"
ENT.Spawnable = true
ENT.AdminSpawnable = true
ENT.Category = "Medic Mod"
ENT.AutomaticFrameAdvance = true

-- Кастомный ассортимент для этого NPC
ENT.ShopItems = {
	-- Энтити:
	["bloodbag_medicmod"] = { name = "Пакет крови", price = 500, model = "models/medicmod/bloodbag/bloodbag.mdl", isWeapon = false },
	
	-- Оружие (SWEP):
	["syringe_antidote"]  = { name = "Шприц-Антидот", price = 50, model = "models/medicmod/syringe/w_syringe.mdl", isWeapon = true },
	["analysis_notebook"] = { name = "Блокнот анализов", price = 100, model = "models/props_lab/clipboard.mdl", isWeapon = true }, 
	["syringe_morphine"]  = { name = "Шприц с морфием", price = 150, model = "models/medicmod/syringe/w_syringe.mdl", isWeapon = true },
}

function ENT:GetShopItems()
	local items = {}
	
	-- Список классов, которые мы не хотим показывать в магазине
	local ignoreList = {
		["drug_medicmod"] = true,       -- Empty drug jar
		["beaker_medicmod"] = true,     -- Empty beaker
		["drip_medicmod"] = true,       -- drip
		["defibrillator"] = true,       -- defibrillator
		["first_aid_kit"] = true,       -- first aid kit (SWEP)
		["firstaidkit_medicmod"] = true,-- first aid kit (ENT)
		["bandage"] = true,             -- повязка
		["syringe_poison"] = true,
	}
	
	-- Добавляем из конфигов мода
	if ConfigurationMedicMod then
		if ConfigurationMedicMod.MedicShopEntities then
			for k, v in pairs(ConfigurationMedicMod.MedicShopEntities) do
				if not ignoreList[k] then
					items[k] = { name = v.name, price = v.price, model = v.model, isWeapon = false }
				end
			end
		end
		if ConfigurationMedicMod.MedicShopWeapons then
			for k, v in pairs(ConfigurationMedicMod.MedicShopWeapons) do
				if not ignoreList[k] then
					items[k] = { name = v.name, price = v.price, model = v.model, isWeapon = true }
				end
			end
		end
		if ConfigurationMedicMod.Entities then
			for _, v in pairs(ConfigurationMedicMod.Entities) do
				if not ignoreList[v.ent] then
					items[v.ent] = { name = v.name, price = v.price, model = v.mdl, isWeapon = true }
				end
			end
		end
	end
	
	-- Добавляем/перезаписываем кастомными предметами
	if self.ShopItems then
		for k, v in pairs(self.ShopItems) do
			items[k] = v
		end
	end
	
	return items
end
