module Base
{
    model 82porsche911scWheelL
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911_tireN2,
		texture = vehicles/Vehicles_82porsche911turbo_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
	}

    model 82porsche911scWheelR
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911_tireN2,
		texture = vehicles/Vehicles_82porsche911turbo_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
        invertX = TRUE,
	}

	model 82porsche911turboWheelFL
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911_tireN,
		texture = vehicles/Vehicles_82porsche911turbo_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
	}

    model 82porsche911turboWheelFR
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911_tireN,
		texture = vehicles/Vehicles_82porsche911turbo_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
        invertX = TRUE,
	}

    model 82porsche911turboWheelRL
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911_tireW,
		texture = vehicles/Vehicles_82porsche911turbo_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
	}

    model 82porsche911turboWheelRR
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911_tireW,
		texture = vehicles/Vehicles_82porsche911turbo_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
        invertX = TRUE,
	}

    model 82porsche911rwbWheelFL
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911rwb_tireN,
		texture = vehicles/Vehicles_82porsche911rwb_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
	}

    model 82porsche911rwbWheelFR
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911rwb_tireN,
		texture = vehicles/Vehicles_82porsche911rwb_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
        invertX = TRUE,
	}

    model 82porsche911rwbWheelRL
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911rwb_tireW,
		texture = vehicles/Vehicles_82porsche911rwb_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
	}

    model 82porsche911rwbWheelRR
	{
		mesh = vehicles/Vehicles_82porsche911_Wheels|p911rwb_tireW,
		texture = vehicles/Vehicles_82porsche911rwb_Wheel,
		shader = vehiclewheel,
		scale = 0.1,
        invertX = TRUE,
	}


	template vehicle PRS82TiresTurbo
	{
		part TireFrontLeft
		{
            model PRSTireFL
			{
				file = 82porsche911turboWheelFL,
			}
            model PRSTire2FL
			{
				file = 82porsche911scWheelL,
			}

			area = TireFrontLeft,
			wheel = FrontLeft,
			table install
			{
				complete = PRS82.InstallComplete.TireFrontLeft,
				requireInstalled = BrakeFrontLeft;SuspensionFrontLeft,
			}
			table uninstall
			{
				complete = PRS82.UninstallComplete.TireFrontLeft,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = PRS82.Init.TireFrontLeft,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}

		}

		part TireFrontRight
		{
            model PRSTireFR
			{
				file = 82porsche911turboWheelFR,
			}
            model PRSTire2FR
			{
				file = 82porsche911scWheelR,
			}

			area = TireFrontRight,
			wheel = FrontRight,
			table install
			{
				complete = PRS82.InstallComplete.TireFrontRight,
				requireInstalled = BrakeFrontRight;SuspensionFrontRight,
			}
			table uninstall
			{
				complete = PRS82.UninstallComplete.TireFrontRight,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = PRS82.Init.TireFrontRight,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part TireRearLeft
		{
            model PRSTireRL
			{
				file = 82porsche911turboWheelRL,
			}
            model PRSTire2FL
			{
				file = 82porsche911scWheelL,
                offset = 0.0400 0.000 0.000,
			}

			area = TireRearLeft,
			wheel = RearLeft,
			table install
			{
				complete = PRS82.InstallComplete.TireRearLeft,
				requireInstalled = BrakeRearLeft;SuspensionRearLeft,
			}
            table uninstall
			{
				complete = PRS82.UninstallComplete.TireRearLeft,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = PRS82.Init.TireRearLeft,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part TireRearRight
		{
            model PRSTireRR
			{
				file = 82porsche911turboWheelRR,
			}
            model PRSTire2FR
			{
				file = 82porsche911scWheelR,
                offset = -0.0400 0.000 0.000,
			}

			area = TireRearRight,
			wheel = RearRight,
			table install
			{
				complete = PRS82.InstallComplete.TireRearRight,
				requireInstalled = BrakeRearRight;SuspensionRearRight,
			}
			table uninstall
			{
				complete = PRS82.UninstallComplete.TireRearRight,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = PRS82.Init.TireRearRight,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part Tire*
		{
			category = tire,
			specificItem = false,
			itemType = Base.82porsche911TurboTire;Base.82porsche911SCTire,
			container
			{
				capacity = 35,
				test = Vehicles.ContainerAccess.Tire,
				contentType = Air,
			}
			table install
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.InstallTest.Default,
			}
			table uninstall
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.UninstallTest.Default,
			}
		}
	}

    template vehicle PRS82TiresRWB
	{
		part TireFrontLeft
		{
            model PRSTireFL
			{
				file = 82porsche911rwbWheelFL,
			}

			area = TireFrontLeft,
			wheel = FrontLeft,
			table install
			{
				requireInstalled = BrakeFrontLeft;SuspensionFrontLeft,
			}

		}

		part TireFrontRight
		{
            model PRSTireFR
			{
				file = 82porsche911rwbWheelFR,
			}

			area = TireFrontRight,
			wheel = FrontRight,
			table install
			{
				requireInstalled = BrakeFrontRight;SuspensionFrontRight,
			}
		}

		part TireRearLeft
		{
            model PRSTireRL
			{
				file = 82porsche911rwbWheelRL,
			}

			area = TireRearLeft,
			wheel = RearLeft,
			table install
			{
				requireInstalled = BrakeRearLeft;SuspensionRearLeft,
			}
		}

		part TireRearRight
		{
            model PRSTireRR
			{
				file = 82porsche911rwbWheelRR,
			}

			area = TireRearRight,
			wheel = RearRight,
			table install
			{
				requireInstalled = BrakeRearRight;SuspensionRearRight,
			}
		}

		part Tire*
		{
			category = tire,
			specificItem = false,
			itemType = Base.82porsche911RWBTire,
			container
			{
				capacity = 35,
				test = Vehicles.ContainerAccess.Tire,
				contentType = Air,
			}
			table install
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.InstallTest.Default,
				complete = Vehicles.InstallComplete.Tire,
			}
			table uninstall
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.UninstallTest.Default,
				complete = Vehicles.UninstallComplete.Tire,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = Vehicles.Init.Tire,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}
	}

    template vehicle PRS82TiresSC
	{
		part TireFrontLeft
		{
            model PRSTireFL
			{
				file = 82porsche911scWheelL,
			}
            model PRSTire2FL
			{
				file = 82porsche911turboWheelFL,
			}


			area = TireFrontLeft,
			wheel = FrontLeft,
			table install
			{
				complete = PRS82.InstallComplete.TireFrontLeftSC,
				requireInstalled = BrakeFrontLeft;SuspensionFrontLeft,
			}
			table uninstall
			{
				complete = PRS82.UninstallComplete.TireFrontLeftSC,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = PRS82.Init.TireFrontLeftSC,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}

		}

		part TireFrontRight
		{
            model PRSTireFR
			{
				file = 82porsche911scWheelR,
			}
            model PRSTire2FR
			{
				file = 82porsche911turboWheelFR,
			}

			area = TireFrontRight,
			wheel = FrontRight,
			table install
			{
				complete = PRS82.InstallComplete.TireFrontRightSC,
				requireInstalled = BrakeFrontRight;SuspensionFrontRight,
			}
			table uninstall
			{
				complete = PRS82.UninstallComplete.TireFrontRightSC,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = PRS82.Init.TireFrontRightSC,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part TireRearLeft
		{
            model PRSTireRL
			{
				file = 82porsche911scWheelL,
			}
            model PRSTire2FL
			{
				file = 82porsche911turboWheelFL,
			}

			area = TireRearLeft,
			wheel = RearLeft,
			table install
			{
				complete = PRS82.InstallComplete.TireRearLeftSC,
				requireInstalled = BrakeRearLeft;SuspensionRearLeft,
			}
            table uninstall
			{
				complete = PRS82.UninstallComplete.TireRearLeftSC,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = PRS82.Init.TireRearLeftSC,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part TireRearRight
		{
            model PRSTireRR
			{
				file = 82porsche911scWheelR,
			}
            model PRSTire2FR
			{
				file = 82porsche911turboWheelFR,
			}

			area = TireRearRight,
			wheel = RearRight,
			table install
			{
				complete = PRS82.InstallComplete.TireRearRightSC,
				requireInstalled = BrakeRearRight;SuspensionRearRight,
			}
			table uninstall
			{
				complete = PRS82.UninstallComplete.TireRearRightSC,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = PRS82.Init.TireRearRightSC,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part Tire*
		{
			category = tire,
			specificItem = false,
			itemType = Base.82porsche911SCTire;Base.82porsche911TurboTire,
			container
			{
				capacity = 35,
				test = Vehicles.ContainerAccess.Tire,
				contentType = Air,
			}
			table install
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.InstallTest.Default,
			}
			table uninstall
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.UninstallTest.Default,
			}
		}
	}
}