require "DAMN_Parts";
require "DAMN_Spawns";

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

DAMN.Parts:processConfigV2("R32", {
    ["Muffler"] = {
		partId = "R32Muffler",
		itemToModel = {
			["Base.R32muffler0"] = "Muffler0",
			["Base.R32muffler1"] = "Muffler1",
		},
		default = "trve_random",
		noPartChance = 10,
	},
	["Bumper"] = {
		partId = "R32Bumper",
		itemToModel = {
			["Base.R32Bumper0"] = "Bumper0",
			["Base.R32Bumper1"] = "Bumper1",
            ["Base.R32Bumper2"] = "Bumper2",
			["Base.R32Bumper3"] = "Bumper3",
			["Base.R32BumperA"] = "BumperA",
		},
        allowedForRandom = {
            "Base.R32Bumper0", "Base.R32Bumper1", "Base.R32Bumper2", "Base.R32Bumper3"
        },
		default = "trve_random",
		noPartChance = 10,
	},
	["BumperRear"] = {
		partId = "R32BumperRear",
		itemToModel = {
			["Base.R32BumperRear0"] = "BumperRear0",
			["Base.R32BumperRear1"] = "BumperRear1",
            ["Base.R32BumperRear2"] = "BumperRear2",
			["Base.R32BumperRear3"] = "BumperRear3",
			["Base.R32BumperRearA"] = "BumperRearA",
		},
        allowedForRandom = {
            "Base.R32BumperRear0", "Base.R32BumperRear1", "Base.R32BumperRear2", "Base.R32BumperRear3"
        },
		default = "trve_random",
		noPartChance = 10,
	},
	["WindshieldArmor"] = {
		partId = "R32WindshieldArmor",
		itemToModel = {
			["Base.R32WindshieldArmor"] = "WindshieldArmor",
		},
	},
	["RearWindshieldArmor"] = {
		partId = "R32RearWindshieldArmor",
		itemToModel = {
			["Base.R32WindshieldRearArmor"] = "RearWindshieldArmor",
		},
	},
	["DoorFrontLeftArmor"] = {
		partId = "R32DoorFrontLeftArmor",
		itemToModel = {
			["Base.R32DoorArmor"] = "DoorFrontLeftArmor",
		},
	},
	["DoorFrontRightArmor"] = {
		partId = "R32DoorFrontRightArmor",
		itemToModel = {
			["Base.R32DoorArmor"] = "DoorFrontRightArmor",
		},
	},
	["WindowRearLeftArmor"] = {
		partId = "R32WindowRearLeftArmor",
		itemToModel = {
			["Base.R32RearWindowArmor"] = "WindowRearLeftArmor",
		},
	},
	["WindowRearRightArmor"] = {
		partId = "R32WindowRearRightArmor",
		itemToModel = {
			["Base.R32RearWindowArmor"] = "WindowRearRightArmor",
		},
	},
	["Spoiler"] = {
		partId = "R32Spoiler",
		itemToModel = {
			["Base.R32Spoiler0"] = "Spoiler0",
			["Base.R32Spoiler1"] = "Spoiler1",
            ["Base.R32Spoiler2"] = "Spoiler2",
			["Base.R32Spoiler3"] = "Spoiler3",
		},
		default = "trve_random",
		noPartChance = 10,
	},
	["Sideskirts"] = {
		partId = "R32Sideskirts",
		itemToModel = {
			["Base.R32Sideskirts1"] = "Sideskirts1",
			["Base.R32Sideskirts2"] = "Sideskirts2",
            ["Base.R32Sideskirts3"] = "Sideskirts3",
			["Base.R32SideskirtsA"] = "SideskirtsA",
		},
        allowedForRandom = {
            "Base.R32Sideskirts1", "Base.R32Sideskirts2", "Base.R32Sideskirts3"
        },
		default = "trve_random",
		noPartChance = 35,
	},
	["TireFrontLeft"] = {
		partId = "TireFrontLeft",
		itemToModel = {
			["Base.R32Tire0"] = "R32Tire0",
			["Base.R32Tire1"] = "R32Tire1",
            ["Base.R32Tire2"] = "R32Tire2",
			["Base.R32TireA"] = "R32TireA",
		},
	},
	["TireFrontRight"] = {
		partId = "TireFrontRight",
		itemToModel = {
			["Base.R32Tire0"] = "R32Tire0",
			["Base.R32Tire1"] = "R32Tire1",
            ["Base.R32Tire2"] = "R32Tire2",
			["Base.R32TireA"] = "R32TireA",
		},
	},
	["TireRearLeft"] = {
		partId = "TireRearLeft",
		itemToModel = {
			["Base.R32Tire0"] = "R32Tire0",
			["Base.R32Tire1"] = "R32Tire1",
            ["Base.R32Tire2"] = "R32Tire2",
			["Base.R32TireA"] = "R32TireA",
		},
	},
	["TireRearRight"] = {
		partId = "TireRearRight",
		itemToModel = {
			["Base.R32Tire0"] = "R32Tire0",
			["Base.R32Tire1"] = "R32Tire1",
            ["Base.R32Tire2"] = "R32Tire2",
			["Base.R32TireA"] = "R32TireA",
		},
	},
    ["SpareTire"] = {
		partId = "R32SpareTire",
		itemToModel = {
			["Base.R32Tire0"] = "R32Tire0",
			["Base.R32Tire1"] = "R32Tire1",
            ["Base.R32Tire2"] = "R32Tire2",
			["Base.R32TireA"] = "R32TireA",
		},
        default = "trve_random",
		noPartChance = 20,
	},
});


function R32.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