module Base
{
    model Vehicle_ATAPetyarbuilt_short
    {
        mesh = vehicles/ATA_Petyarbuilt_body|body_short,
        shader = vehicle_norandom_multiuv,
        invertX = FALSE,
        scale = 0.05,
    }
    model Vehicle_ATAPetyarbuilt_long
    {
        mesh = vehicles/ATA_Petyarbuilt_body|body_long,
        shader = vehicle_norandom_multiuv,
        invertX = FALSE,
        scale = 0.05,
    }
    model Vehicle_ATAPetyarbuilt_sleeper
    {
        mesh = vehicles/ATA_Petyarbuilt_body|truck_sleeper,
        shader = vehicle_norandom_multiuv,
        invertX = FALSE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_sleeper
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_sleeper,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_leftArmor
    {
        mesh = vehicles/ATA_Petyarbuilt_body|anim_leftArmor,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_rightArmor
    {
        mesh = vehicles/ATA_Petyarbuilt_body|anim_rightArmor,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_headlights
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_headlights,
        shader = vehicle_norandom_multiuv,
        invertX = FALSE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_rooflights_front
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_lights_front,
        shader = vehicle_norandom_multiuv,
        invertX = FALSE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_rooflights_left
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_lights_side,
        shader = vehicle_norandom_multiuv,
        invertX = FALSE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_rooflights_right
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_lights_side,
        shader = vehicle_norandom_multiuv,
        invertX = TRUE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_rooflights_left_sleeper
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_lights_side_sleeper,
        shader = vehicle_norandom_multiuv,
        invertX = FALSE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_rooflights_right_sleeper
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_lights_side_sleeper,
        shader = vehicle_norandom_multiuv,
        invertX = TRUE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_front
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_front,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_left
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_left,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_right
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_right,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_upper
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_upper,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_wheels
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_wheels1,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_wheels_sleeper
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_wheels2,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_armor_gastank
    {
        mesh = vehicles/ATA_Petyarbuilt_body|armor_benz,
        texture = Vehicles/ATA_Petyarbuilt_items,

        scale = 0.05,
    }
    model ATAPetyarbuilt_WheelFront_R
    {
        mesh = vehicles/ATA_Petyarbuilt_wheel_front|wheel,
        texture = Vehicles/ATA_Petyarbuilt_wheel,

        invertX = TRUE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_WheelFront_L
    {
        mesh = vehicles/ATA_Petyarbuilt_wheel_front|wheel,
        texture = Vehicles/ATA_Petyarbuilt_wheel,

        invertX = FALSE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_WheelRear_R
    {
        mesh = vehicles/ATA_Petyarbuilt_wheel_rear,
        texture = Vehicles/ATA_Petyarbuilt_wheel,

        invertX = TRUE,
        scale = 0.05,
    }
    model ATAPetyarbuilt_WheelRear_L
    {
        mesh = vehicles/ATA_Petyarbuilt_wheel_rear,
        texture = Vehicles/ATA_Petyarbuilt_wheel,

        invertX = FALSE,
        scale = 0.05,
    }
    template vehicle ATAPetyarbuilt
    {
        part TCLConfig
        {
            category = nodisplay,
            table TCLConfig
            {
                airbrake = true,
                trailerOutside = false,
            }
        }
        
        model
        {
            file = Vehicle_ATAPetyarbuilt_short,
            scale = 0.6500,
            offset = 0.0000 1.0769 0.0000,
        }

        skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_beige,
        }
        skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_brown,
        }
        skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_bwr,
        }
        skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_green,
        }
        skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_mint,
        }
        skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_red,
        }
        skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_white,
        }
          skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_black,
        }      
          skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_blue,
        }      
          skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_pink,
        }   
          skin
        {
            texture = Vehicles/ATA_Petyarbuilt_base_vio,
        }   



        textureMask = Vehicles/ATA_Petyarbuilt_mask,
        textureLights = Vehicles/ATA_Petyarbuilt_light,
        textureDamage1Shell = Vehicles/ATA_Petyarbuilt_damage1,
        textureDamage2Shell = Vehicles/ATA_Petyarbuilt_damage2,
        textureDamage1Overlay = Vehicles/ATA_Petyarbuilt_blood,
        textureDamage2Overlay = Vehicles/ATA_Petyarbuilt_blood,
        textureRust = Vehicles/ATA_Petyarbuilt_rust,
        
        mechanicType = 2,
        offRoadEfficiency = 1.2,
        engineRepairLevel = 5,
        playerDamageProtection = 1.4,


        sound
        {
            backSignal = VehicleBackUpBeeper,
            engine = VehicleEngineStepVan,
            engineStart = VehicleEngineStepVan,
            engineTurnOff = VehicleEngineStepVan,
            horn = ATAVehicleHornTruck,
            ignitionFail = VehicleIgnitionFailStepVan,
        }
        
        mass = 950,
        engineForce = 4250,
        engineQuality = 80,
        engineLoudness = 120,
        maxSpeed = 70,
    
        engineRPMType = van,

        brakingForce = 155,
        stoppingMovementForce = 2.75f,    

        rollInfluence = 0.3f,
        steeringIncrement = 0.02,
        steeringClamp = 0.3f,

        suspensionStiffness = 66,

		suspensionCompression = 4.83,
		suspensionDamping = 3.88,

		maxSuspensionTravelCm = 45,
		suspensionRestLength = 1.95f,

        wheelFriction = 1.35f,
        
        frontEndHealth = 1500,
        rearEndHealth = 1000,
        seats = 2,
        
        
        wheel FrontLeft
        {
            front = true,
            offset = 1.5385 -1.3231 4.3385,
			radius = 0.85f,
            width = 0.2f,
        }

        wheel FrontRight
        {
            front = true,
            offset = -1.5385 -1.3231 4.3385,
			radius = 0.85f,
            width = 0.2f,
        }

        area XxX
        {
            xywh = 0.0 0.0 0.0 0.0,
        }

        area Engine
        {
            xywh = 2.6000 4.3538 1.4 1.4,
        }

        area GasTank
        {
            xywh = 2.6000 -0.0615 1.0 1.0,
        }

        area Engine
        {
            xywh = 2.6000 4.3538 1.4154 1.4154,
        }
        area FrontArea
        {
            xywh = 0.0000 6.6308 3.7846 1.4154,
        }
        area GasTank
        {
            xywh = 2.4154 -0.0615 1.0154 1.0154,
        }

        area TireFrontLeft
        {
            xywh = 2.4154 4.3538 1.0154 1.0154,
        }

        area TireFrontRight
        {
            xywh = -2.4154 4.3538 1.0154 1.0154,
        }

        area TireMiddleLeft
        {
            xywh = 2.4154 -4.2615 1.0154 1.0154,
        }

        area TireMiddleRight
        {
            xywh = -2.4154 -2.4308 1.0154 1.0154,
        }

        area TireRearLeft
        {
            xywh = 2.4154 -2.4615 1.0154 1.0154,
        }

        area TireRearRight
        {
            xywh = -2.4154 -4.2769 1.0154 1.0154,
        }

        area SeatFrontLeft
        {
            xywh = 2.4154 2.1385 1.0154 1.0154,
        }

        area SeatFrontRight
        {
            xywh = -2.4154 2.1385 1.0154 1.0154,
        }
        
        area TruckBed
        {
            xywh = 0.0000 -5.7231 3.8154 1.0154,
        }
        
        template = Trunk/part/TruckBed,

        part TruckBed
        {
            category = nodisplay,
            area = SeatFrontLeft,
            container
            {
                capacity = 20,
                conditionAffectsCapacity = false,
            }
        }
        template = Trunk/part/TruckBedOpen,
        part TruckBedOpen
        {
            category = nodisplay,
            area = SeatFrontRight,
            container
            {
                capacity = 20,
                conditionAffectsCapacity = false,
            }
        }

        template = Seat/part/SeatFrontLeft,
        template = Seat/part/SeatFrontRight,

        part Seat*
        {
            table install
            {
                skills = Mechanics:2,
                recipes = Intermediate Mechanics,
            }

            table uninstall
            {
                skills = Mechanics:2,
                recipes = Intermediate Mechanics,
            }
        }

        template = GloveBox,
        template = GasTank,

        part GasTank
        {
            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 = Intermediate Mechanics,
            }

            table uninstall
            {
                recipes = Intermediate Mechanics,
            }
        }

        template = EngineDoor,

        part EngineDoor
        {
            anim Open
            {
                sound = VehicleHoodOpenVan,
            }

            anim Close
            {
                sound = VehicleHoodCloseVan,
            }

            table install
            {
                recipes = Intermediate Mechanics,
            }

            table uninstall
            {
                recipes = Intermediate Mechanics,
            }
        }

        template = Heater,
        template = PassengerCompartment,

        template = Windshield/part/Windshield,
        part Windshield
        {
            table install
            {
                recipes = Intermediate Mechanics,
            }
            table uninstall
            {
                recipes = Intermediate Mechanics,
            }
        }
        
        template = Door/part/DoorFrontLeft,
        template = Door/part/DoorFrontRight,

        part Door*
        {
            anim Open
            {
                sound = VehicleDoorOpenVan,
            }

            anim Close
            {
                sound = VehicleDoorCloseVan,
            }

            anim Lock
            {
                sound = LockVehicleDoorVan,
            }

            anim Unlock
            {
                sound = UnlockVehicleDoorVan,
            }

            anim IsLocked
            {
                sound = VehicleDoorIsLockedVan,
            }

            table install
            {
                recipes = Intermediate Mechanics,
            }

            table uninstall
            {
                recipes = Intermediate Mechanics,
            }
        }
        
        template = Window/part/WindowFrontLeft,
        template = Window/part/WindowFrontRight,
        part Window*
        {
            table install
            {
                recipes = Intermediate Mechanics,
            }

            table uninstall
            {
                recipes = Intermediate Mechanics,
            }
        }

        template = Tire/part/TireFrontLeft,
        template = Tire/part/TireFrontRight,
        template = Tire/part/TireRearLeft,

        part TireFrontLeft
        {
            model InflatedTirePlusWheel
            {
                file = ATAPetyarbuilt_WheelFront_L,
            }
            model ATAProtection
            {
                file = ATAPetyarbuilt_WheelProtection_L,
            }
        }

        part TireFrontRight
        {
            model InflatedTirePlusWheel
            {
                file = ATAPetyarbuilt_WheelFront_R,
            }
            model ATAProtection
            {
                file = ATAPetyarbuilt_WheelProtection,
            }
        }

        part Tire*
        {
            setAllModelsVisible = false,
            table install
            {
                complete = ATA2Tuning.InstallComplete.TireNotAllModelsVisible,
            }
            
            table uninstall
            {
                complete = ATA2Tuning.UninstallComplete.TireNotAllModelsVisible,
            }
            
            lua
            {
                create = ATATuning2.Create.TireNotAllModelsVisible,
                init = ATATuning2.Init.TireNotAllModelsVisible,
                checkOperate = Vehicles.CheckOperate.Tire,
                update = Vehicles.Update.Tire,

            }
        }


        template = ATA6Wheels/part/TireMiddleLeft,
        part TireMiddleLeft
        {
            model InflatedTirePlusWheel
            {
                file = ATAPetyarbuilt_WheelRear_L,
                offset = 1.3 0.0 0.0,
            }
        }

        part TireRearLeft
        {
            model InflatedTirePlusWheel
            {
                file = ATAPetyarbuilt_WheelRear_L,
                offset = 1.3 0.0 0.0,
            }
        }

        template = ATA6Wheels/part/TireMiddleRight,


        part TireMiddleRight
        {
            model InflatedTirePlusWheel
            {
                file = ATAPetyarbuilt_WheelRear_R,
                offset = -1.3 0.0 0.0,
            }
        }

        template = Tire/part/TireRearRight,
        part TireRearRight
        {
            model InflatedTirePlusWheel
            {
                file = ATAPetyarbuilt_WheelRear_R,
                offset = -1.3 0.0 0.0,
            }
        }
        
        template = Brake/part/BrakeFrontLeft,
        template = Brake/part/BrakeFrontRight,
        template = Brake/part/BrakeRearLeft,
        template = ATA6Wheels/part/BrakeMiddleRight,
        template = ATA6Wheels/part/BrakeMiddleLeft,
        template = Brake/part/BrakeRearRight,
        part Brake*
        {
            table install
            {
                skills = Mechanics:6,
                recipes = Intermediate Mechanics,
            }

            table uninstall
            {
                skills = Mechanics:6,
                recipes = Intermediate Mechanics,
            }
        }

        template = Suspension/part/SuspensionFrontLeft,
        template = Suspension/part/SuspensionFrontRight,
        template = Suspension/part/SuspensionRearLeft,
        template = ATA6Wheels/part/SuspensionMiddleRight,
        template = ATA6Wheels/part/SuspensionMiddleLeft,
        template = Suspension/part/SuspensionRearRight,
        part Suspension*
        {
            table install
            {
                skills = Mechanics:6,
                recipes = Intermediate Mechanics,
            }

            table uninstall
            {
                skills = Mechanics:6,
                recipes = Intermediate Mechanics,
            }
        }

        template = Radio,
        template = Headlight,

        part Headlight*
        {

        table headlight
            {
                xOffset = 0.5,
                yOffset = 1.5,
                distance = 60,
                intensity = 1.75,
            }
        }
        physics box
        {
            offset = 0.0000 1.4000 3.2923,
            extents = 3.5000 3.0500 4.3167,
            rotate = 0.0000 0.0000 0.0000,
        }

        template = ATA2Protection/part/ATA2ProtectionWheelsFront,
        template = ATA2Protection/part/ATA2ProtectionRearWheels,
        part ATA2ProtectionRearWheels
        {
            model Default
            {
                file = ATAPetyarbuilt_armor_wheels,
            }
        }
        
        template = ATA2Protection/part/ATA2ProtectionSideLeft,
        part ATA2ProtectionSideLeft
        {
            model Default
            {
                file = ATAPetyarbuilt_armor_leftArmor,
            }
            model StaticPart
            {
                file = ATAPetyarbuilt_armor_left,
            }
        }
        
        template = ATA2Protection/part/ATA2ProtectionSideRight,
        part ATA2ProtectionSideRight
        {
            model Default
            {
                file = ATAPetyarbuilt_armor_rightArmor,
            }
            model StaticPart
            {
                file = ATAPetyarbuilt_armor_right,
            }
        }

        template = ATA2Protection/part/ATA2ProtectionSideFront,
        part ATA2ProtectionSideFront
        {
            model Default
            {
                file = ATAPetyarbuilt_armor_front,
            }
            model StaticPart
            {
                file = ATAPetyarbuilt_armor_headlights,
            }
        }

        template = ATA2Protection/part/ATA2ProtectionSideTop,
        part ATA2ProtectionSideTop
        {
            model Default
            {
                file = ATAPetyarbuilt_armor_upper,
            }
        }
        
  
        attachment trailerfront
        {
            offset = 0.0000 -1.5833 5.4500,
            rotate = 0.0000 0.0000 0.0000,
            zoffset = 1.0000,
        }
        template = PassengerSeat2,

        passenger FrontLeft
        {
            position inside
            {
                offset = 0.6769 0.3077 2.0154,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = 2.2615 -0.9846 1.7231,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatFrontLeft,
            }
        }

        passenger FrontRight
        {
            position inside
            {
                offset = -0.6769 0.3077 2.0154,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = -2.2615 -0.9846 1.7231,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatFrontRight,
            }
        }

        
    }
    
    template vehicle ATAPetyarbuiltSleep
    {
        template! = ATAPetyarbuilt,
        part ATASleeper
        {
            category = nodisplay,

            model Default
            {
                file = Vehicle_ATAPetyarbuilt_sleeper,
            }
                    table install
            {
                requireInstalled = ,
            }
            lua
            {
                create = ATATuning.Create.Chance0,
                init = ATATuning2.Init.setAllModelsVisible,
            }
        }
        
        template = Seat/part/SeatRearLeft,
        part SeatRearLeft
        {
            area = XxX,
        }
        template = Seat/part/SeatRearRight,
        part SeatRearRight
        {
            area = XxX,
        }
        template = Window/part/WindowRearLeft,
        part WindowRearLeft
        {
            area = SeatFrontLeft,
            table install
            {
                requireInstalled = ,
            }
        }
        template = Window/part/WindowRearRight,
        part WindowRearRight
        {
            area = SeatFrontRight,
            table install
            {
                requireInstalled = ,
            }
        }
        part Seat*
        {
            table install
            {
                skills = Mechanics:2,
                recipes = Intermediate Mechanics,
            }

            table uninstall
            {
                skills = Mechanics:2,
                recipes = Intermediate Mechanics,
            }
        }

        template = PassengerSeat4,
        
        passenger FrontLeft
        {
            position inside
            {
                offset = 0.6769 0.3077 2.0154,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = 2.2615 -0.9846 1.7231,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatFrontLeft,
            }
        }
        
        passenger FrontRight
        {
            position inside
            {
                offset = -0.6769 0.3077 2.0154,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = -2.2615 -0.9846 1.7231,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatFrontRight,
            }
        }
        
        passenger RearLeft
        {
            position inside
            {
                offset = 0.6769 0.3077 -0.1538,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = 2.2615 -0.9846 1.7231,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatFrontLeft,
            }
        }

        passenger RearRight
        {
            position inside
            {
                offset = -0.6769 0.3077 -0.1538,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = -2.2615 -0.9846 1.7231,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatFrontRight,
            }
        }
        
        template = ATA2Protection/part/ATA2ProtectionSleeper,

        part ATA2ProtectionSleeper
        {
            model Default
            {
                file = ATAPetyarbuilt_armor_sleeper,
            }
        }

        template = Fridges/part/FridgeRearLeft,
        template = Microwaves/part/MicrowaveRearRight,
        template = Mattresses/part/MattressRearLeft,
        template = Mattresses/part/MattressRearRight,
        template = Counters/part/CounterRearRight,

        part ATA2ProtectionRearWheels
        {
            model Default
            {
                file = ATAPetyarbuilt_armor_wheels,
            }
        }



    }
    
}
