module Base
{
	model M163
	{
		mesh = vehicles/M163|Base_M163,
		shader = vehicle_noreflect,
		invertX = FALSE,
		invertY = TRUE,
		scale = 0.01,	
	}
	model M163_Turrent
	{
		mesh = vehicles/M163_Turrent|Turret_M163,
		shader = vehicle_noreflect,
		invertX = FALSE,
		invertY = FALSE,
		scale = 0.01,
		static = FALSE,
		boneWeight = Bone_Base_Turrent 1.0,
	}
	model M163_Muzzle
	{
		mesh = vehicles/M163_Turrent|M163_Muzzle,
		shader = vehicle_noreflect,
		invertX = FALSE,
		invertY = FALSE,
		scale = 0.01,
		static = FALSE,
		boneWeight = Bone_Base_Turrent 1.0,
	}
	model M163_Cannon
	{
		mesh = vehicles/M163_Turrent|Cannon_M163,
		shader = vehicle_noreflect,
		invertX = FALSE,
		invertY = FALSE,
		scale = 0.01,
		static = FALSE,
		boneWeight = Bone_Cannon 1.0,
	}
	model M163_Interior
	{
		mesh = vehicles/M163|M163_ Interior,
		shader = basicEffect,
		texture = Vehicles/M163_Interior,
		invertX = FALSE,
		invertY = TRUE,
		scale = 0.01,
	}
	model M113_Tire
	{
		mesh = vehicles/M163_Tracks_1|Tire,
		shader = vehicle_noreflect,
		scale = 0.01,
		static = FALSE,
		boneWeight = Bone_Base_Tire 1.0,
		boneWeight = Bone_Base_Tire1 1.0,
		boneWeight = Bone_Base_Tire2 1.0,
		boneWeight = Bone_Base_Tire3 1.0,
		boneWeight = Bone_Base_Tire4 1.0,
		boneWeight = Bone_Base_Tire5 1.0,
		boneWeight = Bone_Base_Tire6 1.0,

	}
	model M113_Track_1
	{
		mesh = vehicles/M163_Tracks_1,
		shader = vehicle_noreflect,
		scale = 0.01,
		static = FALSE,
		boneWeight = Bone_Base.070 1.0,
		boneWeight = Bone_Base.069 1.0,
		boneWeight = Bone_Base.068 1.0,
		boneWeight = Bone_Base.067 1.0,
		boneWeight = Bone_Base.066 1.0,
		boneWeight = Bone_Base.065 1.0,
		boneWeight = Bone_Base.064 1.0,
		boneWeight = Bone_Base.063 1.0,
		boneWeight = Bone_Base.062 1.0,
		boneWeight = Bone_Base.061 1.0,
		boneWeight = Bone_Base.060 1.0,
		boneWeight = Bone_Base.059 1.0,
		boneWeight = Bone_Base.058 1.0,
		boneWeight = Bone_Base.057 1.0,
		boneWeight = Bone_Base.056 1.0,
		boneWeight = Bone_Base.055 1.0,
		boneWeight = Bone_Base.054 1.0,
		boneWeight = Bone_Base.053 1.0,
		boneWeight = Bone_Base.052 1.0,
		boneWeight = Bone_Base.051 1.0,
		boneWeight = Bone_Base.050 1.0,
		boneWeight = Bone_Base.049 1.0,
		boneWeight = Bone_Base.048 1.0,
		boneWeight = Bone_Base.047 1.0,
		boneWeight = Bone_Base.046 1.0,
		boneWeight = Bone_Base.045 1.0,
		boneWeight = Bone_Base.044 1.0,
		boneWeight = Bone_Base.043 1.0,
		boneWeight = Bone_Base.042 1.0,
		boneWeight = Bone_Base.041 1.0,
		boneWeight = Bone_Base.040 1.0,
		boneWeight = Bone_Base.039 1.0,
		boneWeight = Bone_Base.038 1.0,
		boneWeight = Bone_Base.037 1.0,
		boneWeight = Bone_Base.036 1.0,
	}
	model M113_Track_2
	{
		mesh = vehicles/M163_Tracks_2,
		shader = vehicle_noreflect,
		scale = 0.01,
		static = FALSE,
		boneWeight = Bone_Base.070_2 1.0,
		boneWeight = Bone_Base.069_2 1.0,
		boneWeight = Bone_Base.068_2 1.0,
		boneWeight = Bone_Base.067_2 1.0,
		boneWeight = Bone_Base.066_2 1.0,
		boneWeight = Bone_Base.065_2 1.0,
		boneWeight = Bone_Base.064_2 1.0,
		boneWeight = Bone_Base.063_2 1.0,
		boneWeight = Bone_Base.062_2 1.0,
		boneWeight = Bone_Base.061_2 1.0,
		boneWeight = Bone_Base.060_2 1.0,
		boneWeight = Bone_Base.059_2 1.0,
		boneWeight = Bone_Base.058_2 1.0,
		boneWeight = Bone_Base.057_2 1.0,
		boneWeight = Bone_Base.056_2 1.0,
		boneWeight = Bone_Base.055_2 1.0,
		boneWeight = Bone_Base.054_2 1.0,
		boneWeight = Bone_Base.053_2 1.0,
		boneWeight = Bone_Base.052_2 1.0,
		boneWeight = Bone_Base.051_2 1.0,
		boneWeight = Bone_Base.050_2 1.0,
		boneWeight = Bone_Base.049_2 1.0,
		boneWeight = Bone_Base.048_2 1.0,
		boneWeight = Bone_Base.047_2 1.0,
		boneWeight = Bone_Base.046_2 1.0,
		boneWeight = Bone_Base.045_2 1.0,
		boneWeight = Bone_Base.044_2 1.0,
		boneWeight = Bone_Base.043_2 1.0,
		boneWeight = Bone_Base.042_2 1.0,
		boneWeight = Bone_Base.041_2 1.0,
		boneWeight = Bone_Base.040_2 1.0,
		boneWeight = Bone_Base.039_2 1.0,
		boneWeight = Bone_Base.038_2 1.0,
		boneWeight = Bone_Base.037_2 1.0,
		boneWeight = Bone_Base.036_2 1.0,
	}
	vehicle M163
	{
		mechanicType = 2,
		offRoadEfficiency = 1.3,
		engineRepairLevel = 8,
		playerDamageProtection = 0.8,
		engineRPMType = van,

		model
		{
			file = M163,
			scale = 0.9500,
			offset = 0.0000 -0.1368 0.0000,
			rotate = 0 180 0,
		}

		spawnOffsetY = 0.12999995,

		skin
		{
			texture = Vehicles/M163_Green,
		}

		skin
		{
			texture = Vehicles/M163_Black,
		}

		skin
		{
			texture = Vehicles/M163_Desert,
		}

		textureMask = Vehicles/M113_Mask,
		textureLights = Vehicles/M113_Lights,
		textureDamage1Overlay = Vehicles/no_texture_tank,
		textureDamage2Overlay = Vehicles/no_texture_tank,
		textureDamage1Shell = Vehicles/no_texture_tank,
		textureDamage2Shell = Vehicles/no_texture_tank,
		textureRust = Vehicles/M113_Rust,

		sound
		{
			engine = VehicleEngineOffRoad,
			engineStart = VehicleEngineOffRoad,
			engineTurnOff = VehicleEngineOffRoad,
			horn = VehicleHornJeep,
			ignitionFail = VehicleIgnitionFailOffRoad,
		}

		extents = 2.6947 1.6211 4.7789,
		mass = 1104,
		physicsChassisShape = 2.6947 2.1263 4.7789,
		centerOfMassOffset = 0.0000 1.3158 0.0000,
		shadowExtents = 2.6832 4.7882,
		shadowOffset = 0.0000 0.0000,
		engineForce = 5600,
		engineLoudness = 90,
		engineQuality = 90,
		maxSpeed = 25f,
		gearRatioCount = 1,
		gearRatioR = 5.5,
		gearRatio1 = 10.0,
		brakingForce = 80,
		stoppingMovementForce = 5.0f,
		rollInfluence = 0.7f,
		steeringIncrement = 1.04,
		steeringClamp = 1.3,
		suspensionStiffness = 50,
		suspensionCompression = 4.1,
		suspensionDamping = 3.4,
		maxSuspensionTravelCm = 20,
		suspensionRestLength = 0.2,
		wheelFriction = 1.8f,
		frontEndHealth = 5000,
		rearEndHealth = 3000,
		isSmallVehicle = false,
		seats = 3,

		wheel FrontLeft
		{
			front = true,
			offset = 1.0737 -0.0211 1.8632,
			radius = 0.15f,
			width = 0.2f,
		}

		wheel FrontRight
		{
			front = true,
			offset = -1.1789 -0.0211 1.8632,
			radius = 0.15f,
			width = 0.2f,
		}

		wheel RearLeft
		{
			front = false,
			offset = 1.0737 -0.0211 -1.9368,
			radius = 0.15f,
			width = 0.2f,
		}

		wheel RearRight
		{
			front = false,
			offset = -1.1789 -0.0211 -1.9368,
			radius = 0.15f,
			width = 0.2f,
		}

		area Engine
		{
			xywh = 0.0000 2.7053 1.8947 0.6316,
		}

		area TruckBed
		{
			xywh = -0.4105 -2.7053 1.4316 0.6316,
		}

		area SeatFrontLeft
		{
			xywh = 1.6632 1.0632 0.6316 0.6316,
		}

		area SeatFrontRight
		{
			xywh = -1.6632 0.0000 0.6316 0.6316,
		}

		area SeatRearLeft
		{
			xywh = 0.6211 -2.7053 0.6316 0.6316,
		}

		area GasTank
		{
			xywh = 1.6632 -1.8947 0.6316 0.6316,
		}

		area TireFrontLeft
		{
			xywh = 1.0947 1.6526 0.5053 0.5053,
		}

		area TireFrontRight
		{
			xywh = -1.0947 1.5474 0.5053 0.5053,
		}

		area TireRearLeft
		{
			xywh = 1.0947 -1.4000 0.5053 0.5053,
		}

		area TireRearRight
		{
			xywh = -1.0947 -1.3895 0.5053 0.5053,
		}

		template = TrunkDoor,

		part TrunkDoor
		{
			itemType = Base.M113_TrunkDoor,
			repairMechanic = true,

			table install
			{
				recipes = Advanced Mechanics,
			}

			table uninstall
			{
				recipes = Advanced Mechanics,
			}

			model Default
			{
				file = M113_Back_Door,
				offset = -0.0100 0.8000 -0.2850,
				rotate = 270.0000 0.0000 180.0000,
				scale = 1.0,
			}

			anim Close
			{
				anim = Door,
				reverse = TRUE,
				rate = 2.0,
			}

			anim Open
			{
				anim = Door,
				reverse = FALSE,
				rate = 2.0,
			}

			anim Closed
			{
				anim = Door,
				reverse = FALSE,
				animate = FALSE,
			}

			anim Opened
			{
				anim = Door,
				reverse = TRUE,
				animate = FALSE,
			}

			mechanicRequireKey = false,

			anim ActorOpen
			{
				anim = WindowOpenSuccess,
				rate = 0.15,
				angle = 0.0 0.0 0.0,
			}

			anim ActorClose
			{
				anim = Attack_Shove,
				rate = 0.3,
				angle = 0.0 0.0 0.0,
			}
		}

		template = TankTrack/part/Track_1,
		template = TankTrack/part/Track_2,
		template = TankTrack/part/Tire,

		part Track_1
		{
			itemType = Base.TankTrack,
			repairMechanic = true,
			mechanicArea = Engine,
			mechanicRequireKey = true,
			durability = 10,

			model Default
			{
				file = M113_Track_1,
				offset = 0.0000 0.0000 -0.3500,
				rotate = 0.0000 180.0000 0.0000,
				scale = 1.0,
			}
		}

		part Track_2
		{
			model Default
			{
				file = M113_Track_2,
				offset = 0.0000 0.0000 -0.3500,
				rotate = 0.0000 180.0000 0.0000,
				scale = 1.0,
			}
		}

		part Tire
		{
			model Default
			{
				file = M113_Tire,
				offset = 0.0000 0.8000 -0.3500,
				rotate = 90.0000 180.0000 0.0000,
				scale = 1.0,
			}
		}

		template = TankMachinegun/part/Vulcan_M61,

		part Vulcan_M61
		{
			model Default
			{
				file = M163_Cannon,
				offset = 0.0000 0.0000 -0.2700,
				rotate = 0.0000 0.0000 0.0000,
				scale = 1.0,
			}

			model Muzzle
			{
				file = M163_Muzzle,
				offset = 0.0000 0.0000 -0.2700,
				rotate = 0.0000 0.0000 0.0000,
				scale = 1.0,
			}
		}

		template = Turrent,

		part Turrent
		{
			category = Turrent,
			itemType = Base.TankTurret,
			repairMechanic = true,

			model Default
			{
				file = M163_Turrent,
				offset = 0.0000 0.0000 -0.2700,
				rotate = 0.0000 0.0000 0.0000,
				scale = 1.0,
			}

			lua
			{
				create = Vehicles.Create.TORRENTA,
				init = Vehicles.Init.TORRENTA,
				update = Vehicles.Update.TORRENTA,
			}
		}

		template = Trunk/part/TruckBed,

		part TruckBed
		{
			container
			{
				conditionAffectsCapacity = false,
				capacity = 100,
				test = Vehicles.ContainerAccess.TruckBedOpenInside,
			}
		}

		template = GloveBox,

		part GloveBox
		{
			model Default
			{
				file = M163_Interior,
				offset = 0.0000 0.0000 0.0000,
				rotate = 0.0000 180.0000 0.0000,
				scale = 1.0,
			}

			contanier
			{
				capacity = 20,
			}
		}

		template = GasTank,

		part GasTank
		{
			container
			{
				conditionAffectsCapacity = false,
				capacity = 95,
			}

			install
			{
				skills = Mechanics:7,
				recipes = Intermediate Mechanics,
			}

			uninstall
			{
				skills = Mechanics:7,
				recipes = Intermediate Mechanics,
			}
		}

		template = Battery,
		template = Engine,
		template = Muffler,

		part Muffler
		{
			table install
			{
				recipes = Advanced Mechanics,
			}

			table uninstall
			{
				recipes = Advanced Mechanics,
			}
		}

		template = EngineDoor,

		part EngineDoor
		{
			itemType = Base.M113_EngineDoor,
			repairMechanic = true,

			model Default
			{
				file = M113_Hood,
				offset = 0.0000 0.0000 0.0000,
				rotate = 0.0000 180.0000 0.0000,
				scale = 1.0,
			}

			anim Close
			{
				anim = Door,
				reverse = TRUE,
				rate = 2.0,
			}

			anim Open
			{
				anim = Door,
				reverse = FALSE,
				rate = 2.0,
			}

			anim Closed
			{
				anim = Door,
				reverse = FALSE,
				animate = FALSE,
			}

			anim Opened
			{
				anim = Door,
				reverse = TRUE,
				animate = FALSE,
			}

			anim ActorOpen
			{
				anim = WindowOpenSuccess,
				rate = 0.15,
				angle = 0.0 0.0 0.0,
			}

			anim ActorClose
			{
				anim = Attack_Shove,
				rate = 0.3,
				angle = 0.0 0.0 0.0,
			}

			table install
			{
				recipes = Advanced Mechanics,
			}

			table uninstall
			{
				recipes = Advanced Mechanics,
			}

			anim ActorOpen
			{
				sound = VehicleHoodOpenSportsCar,
			}

			anim Close
			{
				sound = VehicleHoodCloseSportsCar,
			}
		}
		
		part EngineDoorArmor
		{
			category = Armor,
			itemType = Base.M113_EngineDoorArmorA;Base.M113_EngineDoorArmorB,
			repairMechanic = true,
			area = Engine,
			parent = EngineDoor,
			table SpawnInfo
			{
				spawnChance = 75,
			}

			model M113_EngineDoorArmorA
			{
				file = M113_Hood_ArmorA,
				offset = 0 0 0,
				rotate = 0.0000 180.0000 0.0000,
				scale = 1.0,
			}
			model M113_EngineDoorArmorB
			{
				file = M113_Hood_ArmorB,
				offset = 0 0 0,
				rotate = 0.0000 180.0000 0.0000,
				scale = 1.0,
			}

			anim Close
			{
				anim = Door,
				reverse = TRUE,
				rate = 2.0,
			}

			anim Open
			{
				anim = Door,
				reverse = FALSE,
				rate = 2.0,
			}

			anim Closed
			{
				anim = Door,
				reverse = FALSE,
				animate = FALSE,
			}

			anim Opened
			{
				anim = Door,
				reverse = TRUE,
				animate = FALSE,
			}

			anim ActorOpen
			{
				anim = WindowOpenSuccess,
				rate = 0.15,
				angle = 0.0 0.0 0.0,
			}

			anim ActorClose
			{
				anim = Attack_Shove,
				rate = 0.3,
				angle = 0.0 0.0 0.0,
			}

			table install
			{
				requireInstalled = EngineDoor,

				items
				{
					item
					{
						type = Base.Wrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}

				time = 300,
				skills = Mechanics:3,
				recipes = Basic Mechanics,
				test = Vehicles.InstallTest.Default,
				complete = Vehicles.InstallComplete.PC_Default,
			}

			table uninstall
			{
				items
				{
					item
					{
						type = Base.Wrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}

				time = 300,
				skills = Mechanics:3,
				recipes = Basic Mechanics,
				test = Vehicles.UninstallTest.Default,
				complete = Vehicles.UninstallComplete.PC_Default,
			}

			lua
			{
				create = Vehicles.Create.DefaultRAMDOM,
				init = Vehicles.Init.PC_Default,
			}
		}
		

		template = SeatM163/part/SeatFrontLeft,
		template = SeatM163/part/SeatGunner,
		template = SeatM163/part/SeatRearLeft,
		template = PassengerM163,

		part PassengerCompartment
		{
			category = nodisplay,

			passenger*
			{
				hasRoof = false,
			}

			lua
			{
				update = Vehicles.Update.PassengerCompartment,
			}
		}

		template = TankArmor,

		part Armor
		{
			table ArmorData
			{
				thickness = 24,
			}

			itemType = Base.TankArmor,
			repairMechanic = true,
			mechanicArea = Engine,
			mechanicRequireKey = true,
			durability = 10,
			category = Armor,
			area = Engine,
			
			model Armor1
			{				
				file = M113_Armor_1,
				offset = 0 0 0,
				rotate = 0 180 0,
				scale = 1.0,
			}
			model Armor2
			{				
				file = M113_Armor_2,
				offset = 0 0 0,
				rotate = 0 180 0,
				scale = 1.0,
			}
			model Armor3
			{				
				file = M113_Armor_3,
				offset = 0 0 0,
				rotate = 0 180 0,
				scale = 1.0,
			}

			lua
			{
				create = Vehicles.Create.ARMOR,
				init = Vehicles.Init.ARMOR,
				update = Vehicles.Update.ARMOR,
			}
		}

		template = Door/part/DoorFrontLeft,

		part DoorFrontLeft
		{
			itemType = Base.M113_FrontHatch,
			repairMechanic = true,
			mechanicArea = SeatFrontLeft,
			area = SeatFrontLeft,

			model Default
			{
				file = M113_FL_Door,
				offset = -0.0100 0.8000 -0.2850,
				rotate = 270.0000 0.0000 180.0000,
				scale = 1.0,
			}

			anim Close
			{
				anim = Door,
				reverse = TRUE,
				rate = 2.0,
			}

			anim Open
			{
				anim = Door,
				reverse = FALSE,
				rate = 2.0,
			}

			anim Closed
			{
				anim = Door,
				reverse = FALSE,
				animate = FALSE,
			}

			anim Opened
			{
				anim = Door,
				reverse = TRUE,
				animate = FALSE,
			}

			anim ActorOpen
			{
				anim = Climb_WindowB,
				rate = 0.23,
				sound =,
				angle = 0.0 270.0 0.0,
			}

			anim ActorClose
			{
				angle = 0.0 270.0 0.0,
			}
		}

		template = Door/part/DoorFrontRight,

		part DoorFrontRight
		{
			category = nodisplay,
			area = SeatFrontRight,
			parent = Turrent,
		}

		template = Tire,

		part TireFrontLeft
		{
			category = nodisplay,

			model InflatedTirePlusWheel
			{
				file = fake_wheel,
				offset = 0.0000 0.0000 0.0000,
				rotate = 0.0000 0.0000 0.0000,
			}

			lua
			{
				update = Vehicles.Update.TANKTIRE,
			}
		}

		template = Door/part/DoorRearLeft,

		part DoorRearLeft
		{
			area = SeatRearLeft,
			category = nodisplay,

			anim ActorOpen
			{
				angle = 0.0 270.0 0.0,
			}

			anim ActorClose
			{
				angle = 0.0 270.0 0.0,
			}

			lua
			{
				create = Vehicles.Create.Door,
				init = Vehicles.Init.Door,
				use = Vehicles.Use.DoorSEAT,
			}
		}

		part TireRearLeft
		{
			category = nodisplay,

			model InflatedTirePlusWheel
			{
				file = fake_wheel,
				offset = 0.0000 0.0000 0.0000,
				rotate = 0.0000 0.0000 0.0000,
			}

			lua
			{
				update = Vehicles.Update.TANKTIRE,
			}
		}

		part TireFrontRight
		{
			category = nodisplay,

			model InflatedTirePlusWheel
			{
				file = fake_wheel,
				rotate = 0.0000 180.0000 0.0000,
				offset = 0.0000 0.0000 0.0000,
			}

			lua
			{
				update = Vehicles.Update.TANKTIRE,
			}
		}

		part TireRearRight
		{
			category = nodisplay,

			model InflatedTirePlusWheel
			{
				file = fake_wheel,
				rotate = 0.0000 180.0000 0.0000,
				offset = 0.0000 0.0000 0.0000,
			}

			lua
			{
				update = Vehicles.Update.TANKTIRE,
			}
		}

		template = TankBrake,

		part Brake*
		{
			table install
			{
				skills = Mechanics:7,
				recipes = Advanced Mechanics,
			}

			table uninstall
			{
				skills = Mechanics:7,
				recipes = Advanced Mechanics,
			}
		}

		template = TankSuspension,

		part Suspension*
		{
			table install
			{
				skills = Mechanics:7,
				recipes = Advanced Mechanics,
			}

			table uninstall
			{
				skills = Mechanics:7,
				recipes = Advanced Mechanics,
			}
		}

		template = Radio,

		part Heater
		{
			category = engine,

			lua
			{
				update = Vehicles.Update.Heater,
			}
		}

		part Extra_GasCan
		{
			category = addons,
			area = TruckBed,
			itemType = Base.Military_PetrolCan_20L,

			table SpawnInfo
			{
				spawnChance = 20,
			}

			model Military_PetrolCan_20L
			{
				file = Military_Extra_GasCan_Part,
				rotate = 86.0000 90.0000 -96.0000,
				offset = 1.0842 1.0718 -2.1895,
			}

			table install
			{
				time = 100,
				skills = Mechanics:0,
				test = Vehicles.InstallTest.Default,
				complete = Vehicles.InstallComplete.PC_Default,
			}

			table uninstall
			{
				time = 100,
				skills = Mechanics:0,
				test = Vehicles.UninstallTest.Default,
				complete = Vehicles.UninstallComplete.PC_Default,
			}

			lua
			{
				create = Vehicles.Create.DefaultRAMDOM,
			}
		}

		template = Headlight,

		physics box
		{
			offset = -1.1288 0.5263 0.0000,
			extents = 0.4000 1.0526 4.4000,
			rotate = 0.0000 0.0000 0.0000,
		}

		physics box
		{
			offset = 1.1368 0.5263 0.0000,
			extents = 0.4000 1.0526 4.4000,
			rotate = 0.0000 0.0000 0.0000,
		}

		attachment trailer
		{
			offset = 0.0000 0.3529 -2.3882,
			rotate = 0.0000 0.0000 0.0000,
			zoffset = -1.0000,
		}

		attachment trailerfront
		{
			offset = 0.0000 0.3529 2.4000,
			rotate = 0.0000 0.0000 0.0000,
			zoffset = 1.0000,
		}
	}
}
