// ------------------------------------------------------ Naming ------------------------------------------------------
Name Mil Mi-28 Havoc
ShortName Mi-28
// ------------------------------------------------------ Visuals ------------------------------------------------------
Icon iconmi28
Model russia.mi28
Texture mi28
//Third Person Camera Distance
CameraDistance 18
//Resting Pitch. Set this so the plane spawns level. It will fall onto its collision boxes automatically, but this lets you start it flat
RestingPitch 0.0
HasGear False
// ------------------------------------------------------ Movement ------------------------------------------------------
//Mode : One of Plane, Heli or VTOL. The VTOL has a toggle button that switches some model aesthetics and the flight mode
Mode Heli
//Throttle
MaxThrottle 1.0
MaxNegativeThrottle 0.0
//Yaw modifiers
TurnLeftSpeed 4
TurnRightSpeed 4
//Pitch modifiers
LookUpSpeed 4.25
LookDownSpeed 4.25
//Roll modifiers
RollLeftSpeed 2.5
RollRightSpeed 2.5
//Drag 1.0 is standard. Modify to make the plane / heli more or less sluggish
Drag 1
//Lift
//Lift 2.5
//Wheels (Fake wheels imitating skids)
NumWheels 3
WheelPosition 0 4 -17 -22
WheelPosition 1 4 -17 22
WheelPosition 2 -200 -10 0
WheelSpringStrength 0.125
//Propeller <ID> <x> <y> <z> <planePart> <recipeItem>
HeliPropeller 0 3 69 0 blades metalPropeller
HeliTailPropeller 0 172 59 -7 blades metalPropeller
// ------------------------------------------------------ Weaponry ------------------------------------------------------
//Weapon types. Options are Missile, Bomb, Gun, Shell, None
Primary Gun
Secondary Missile
//Time between shots in 1/20ths of seconds
ShootDelayPrimary 4
ShootDelaySecondary 75
//Whether to alternate or fire all together
AlternatePrimary True
AlternateSecondary True
//Firing modes. One of SemiAuto, FullAuto or Minigun
ModePrimary FullAuto
ModeSecondary SemiAuto
//Add shoot origins. These are the points on your vehicle from which bullets / missiles / shells / bombs appear
ShootPointPrimary 14 7 -35 leftWing rpg
ShootPointPrimary 14 7 35 rightWing rpg
ShootPointSecondary -4 6 -49 leftWing
ShootPointSecondary -4 6 49 rightWing
// ------------------------------------------------------ Inventory ------------------------------------------------------
CargoSlots 0
BombSlots 0
MissileSlots 8
AllowAllAmmo True
//Fuel Tank Size (1 point of fuel will keep one propeller going with throttle at 1 for 1 tick)
FuelTankSize 5000
// ------------------------------------------------------ Passengers ------------------------------------------------------
Pilot 21 26 0
Passengers 1
Passenger 1 47 18 0 core -360 360 -90 5 minigun PassengerGun1
GunOrigin 1 -54 6 0
// ------------------------------------------------------ Sounds ------------------------------------------------------
StartSound Engine_Hel_Havoc
StartSoundLength 20
EngineSound Engine_Hel_Havoc
EngineSoundLength 20
ShootSoundPrimary Shoot_RocketPod
ShootSoundSecondary Shoot_Ataka
// ------------------------------------------------------ Recipe ------------------------------------------------------
//Each section of the plane may have many parts
//The sections are tailWheel, tail, bay, topWing, leftWingWheel, leftWing, rightWingWheel,
//rightWing, nose, turret, coreWheel, core
AddRecipeParts core 3 passengerBay
AddRecipeParts nose 1 advancedMetalCockpit
AddRecipeParts coreWheel 4 wheel
AddRecipeParts blades 6 helicopterBlade
AddRecipeParts tail 1 metalTail
//Dye colours are "black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"
AddDye 16 green
// ------------------------------------------------------ Health and hitboxes ------------------------------------------------------
SetupPart core 600 -76 11 -23 155 48 46
SetupPart tail 450 -216 15 -14 140 24 28
SetupPart rightWing 350 -33 10 23 30 30 40
SetupPart leftWing 350 -33 10 -63 30 30 40
BulletDetection 8
ShootParticlesPrimary flansmod.fmflame -0.5 0 0.1
ShootParticlesPrimary flansmod.fmflame -0.5 0 0.1
ShootParticlesPrimary flansmod.fmflame -0.5 0 0.1
ShootParticlesPrimary flansmod.fmflame -0.5 0 0.1
ShootParticlesPrimary flansmod.fmsmoke -0.8 0 0.25
ShootParticlesPrimary flansmod.fmsmoke -0.8 0 -0.25
ShootParticlesPrimary flansmod.fmsmoke -0.8 -0.25 0
ShootParticlesPrimary flansmod.fmsmoke -0.8 0.25 0

//Damage
AddEmitter flame 1 [-79,29,32] [12,1,12] [-0.15,-0.25,0] -1 1 0 0.15 core
AddEmitter flame 1 [-79,29,-32] [12,1,12] [-0.15,-0.25,0] -1 1 0 0.15 core
AddEmitter flansmod.fmsmoke 1 [-79,29,32] [12,1,12] [-0.15,-0.25,0] -1 1 0 0.3 core
AddEmitter flansmod.fmsmoke 1 [-79,29,-32] [12,1,12] [-0.15,-0.25,0] -1 1 0 0.3 core

HasGear false
ModelScale 1
IsExplosionWhenDestroyed true
SpinWithoutTail true

HasFlare True
FlareDelay 250
FlareSound FlareDeploy
TimeFlareUsing 3
LockedOnSound LockonWarning
SoundTime 14
LockedOnSoundRange 5