require "DAMN_Parts";
require "DAMN_Spawns";

--***********************************************************
--**                   KI5 / bikinihorst                   **
--***********************************************************

DAMN.Parts:processConfigV2("FRB77", {
	["BumperFront"] = {
		partId = "FRB77BumperFront",
		itemToModel = {
			["Base.77firebirdBumperFront0"] = "BumperFront0",
			["Base.77firebirdBumperFrontA"] = "BumperFrontA",
            ["Base.77firebirdBullbarFrontA"] = "BullbarFrontA",
		},
		default = "first",
	},
	["BumperRear"] = {
		partId = "FRB77BumperRear",
		itemToModel = {
			["Base.77firebirdBumperRear"] = "BumperRear0",
		},
		default = "first",
	},
	["WindshieldArmor"] = {
		partId = "FRB77WindshieldArmor",
		itemToModel = {
			["Base.77firebirdWindshieldArmor"] = "FRB77winda0",
		},
	},
	["WindshieldRearArmor"] = {
		partId = "FRB77WindshieldRearArmor",
		itemToModel = {
			["Base.77firebirdWindshieldRearArmor"] = "FRB77windra",
		},
	},
	["FrontLeftArmor"] = {
		partId = "FRB77FrontLeftArmor",
		itemToModel = {
			["Base.77firebirdFrontWindowArmor"] = "FRB77leftdoora",
		},
	},
	["FrontRightArmor"] = {
		partId = "FRB77FrontRightArmor",
		itemToModel = {
			["Base.77firebirdFrontWindowArmor"] = "FRB77rightdoora",
		},
	},
	["Roof"] = {
		partId = "FRB77RoofPanels",
		itemToModel = {
			["Base.77firebirdRoofPanels3"] = "FRB77Roof",
		},
		default = "trve_random",
		noPartChance = 20,
	},
	["Roofrack"] = {
		partId = "FRB77Roofrack",
		itemToModel = {
			["Base.77firebirdRoofrack3"] = "FRB77Roofrack0",
		},
		default = "trve_random",
		noPartChance = 95,
	},
    ["SpareTire"] = {
		partId = "FRB77SpareTire",
		itemToModel = {
			["Base.77firebirdTire3"] = "FRB77Spare",
		},
		default = "trve_random",
		noPartChance = 50,
	},
});


function FRB77.ContainerAccess.Roofrack(vehicle, part, chr)
	if chr:getVehicle() then return false end
	if not vehicle:isInArea(part:getArea(), chr) then return false end
	return true
end