--mounting 3d model paths and texture paths 

mount_vfs_model_path	(current_mod_path.."/Shapes")
mount_vfs_liveries_path (current_mod_path.."/Liveries")
mount_vfs_texture_path  (current_mod_path.."/Textures")


--Ammunition MG 131
local tracer_on_time = 0.01
declare_weapon({category = CAT_SHELLS,name =   "MG_13x64_APT",
  user_name		= _("MG_13x64_APT"),
  model_name    = "tracer_bullet_green",
  v0    		= 710.0,
  Dv0   		= 0.0080,
  Da0    		= 0.0004,
  Da1     		= 0.0,
  mass      	= 0.038,
  round_mass 	= 0.09,
  explosive     = 0.0000,
  life_time     = 7,
  caliber     	= 13,
  s         	= 0.0,
  j         	= 0.0,
  l         	= 0.0,
  charTime      = 0,
  cx        	= {1.0,0.912,0.7,0.25,1.80},
  k1        	= 4.8e-08,
  tracer_off    = 1.5,
  tracer_on		= tracer_on_time,
  smoke_tail_life_time = 0.5,
  scale_tracer  = 1,
  cartridge 	= 0,
})
declare_weapon({category = CAT_SHELLS,name =   "MG_13x64_API",
  user_name		= _("MG_13x64_API"),
  model_name    = "tracer_bullet_yellow",
  v0    		= 750.0,
  Dv0   		= 0.0080,
  Da0    		= 0.0004,
  Da1     		= 0.0,
  mass      	= 0.034,
  round_mass 	= 0.086,
  explosive     = 0.0000,
  life_time     = 7,
  caliber     	= 13,
  s         	= 0.0,
  j         	= 0.0,
  l         	= 0.0,
  charTime      = 0,
  cx        	= {1.0,0.912,0.7,0.25,1.80},
  k1        	= 4.3e-08,
  tracer_off    = -1,
  tracer_on		= tracer_on_time,
  scale_tracer  = 0,
  cartridge 	= 0,
})
declare_weapon({category = CAT_SHELLS,name =   "MG_13x64_HEI",
  user_name		= _("MG_13x64_HEI"),
  model_name    = "tracer_bullet_white",
  v0    		= 750.0,
  Dv0   		= 0.0080,
  Da0    		= 0.0004,
  Da1     		= 0.0,
  mass      	= 0.034,
  round_mass 	= 0.086,
  explosive     = 0.0070,
  life_time     = 7,
  caliber     	= 13,
  s         	= 0.0,
  j         	= 0.0,
  l         	= 0.0,
  charTime      = 0,
  cx        	= {1.0,0.912,0.7,0.25,1.80},
  k1        	= 4.3e-08,
  tracer_off    = -1,
  tracer_on		= tracer_on_time,
  scale_tracer  = 0,
  cartridge 	= 0,
})

--Ammunition MG 151/20
declare_weapon({category = CAT_SHELLS,name =   "MG_20x82_HEI_T",
  user_name		= _("MG_20x82_HEI_T"),
  model_name    = "tracer_bullet_crimson",
  v0    		= 705.0,
  Dv0   		= 0.0080,
  Da0    		= 0.0004,
  Da1     		= 0.0,
  mass      	= 0.115,
  round_mass 	= 0.22,
  explosive     = 0.009,
  life_time     = 7,
  caliber     	= 20,
  s         	= 0.0,
  j         	= 0.0,
  l         	= 0.0,
  charTime      = 0,
  cx        	= {0, 0.77, 0.8, 0.23, 2.3},
  k1        	= 2e-08,
  tracer_off    = 3,
  tracer_on		= tracer_on_time,
  smoke_tail_life_time = 0.7,
  scale_tracer  = 1,
  cartridge 	= 0,
})
declare_weapon({category = CAT_SHELLS,name =   "MG_20x82_API",
  user_name		= _("MG_20x82_API"),
  model_name    = "tracer_bullet_yellow",
  v0    		= 705.0,
  Dv0   		= 0.0080,
  Da0    		= 0.0004,
  Da1     		= 0.0,
  mass      	= 0.115,
  round_mass 	= 0.22,
  explosive     = 0.009,
  life_time     = 7,
  caliber     	= 20,
  s         	= 0.0,
  j         	= 0.0,
  l         	= 0.0,
  charTime      = 0,
  cx        	= {0, 0.77, 0.8, 0.23, 2.3},
  k1        	= 2e-08,
  tracer_off    = -1,
  tracer_on		= tracer_on_time,
  scale_tracer  = 0,
  cartridge 	= 0,
})
declare_weapon({category = CAT_SHELLS,name =   "MG_20x82_MGsch",
  user_name		= _("MG_20x82_MGsch"),
  model_name    = "tracer_bullet_white",
  v0    		= 760.0,
  Dv0   		= 0.0080,
  Da0    		= 0.0004,
  Da1     		= 0.0,
  mass      	= 0.095,
  round_mass 	= 0.19,
  explosive     = 0.035,
  life_time     = 7,
  caliber     	= 20,
  s         	= 0.0,
  j         	= 0.0,
  l         	= 0.0,
  charTime      = 0,
  cx        	= {0,0.92,0.75,0.25,1.7},
  k1        	= 4.0e-08,
  tracer_off    = -1,
  tracer_on		= tracer_on_time,
  scale_tracer  = 0,
  cartridge 	= 0,
})

function MG_131(tbl)

	tbl.category = CAT_GUN_MOUNT 
	tbl.name 	 = "MG_131"
	tbl.supply 	 = 
	{
		shells = {"MG_13x64_APT","MG_13x64_API","MG_13x64_HEI"},
		mixes  = {{1,2,3,1,2,3}}, --  
		count  = 475,
	}
	if tbl.mixes then 
	   tbl.supply.mixes =  tbl.mixes
	   tbl.mixes	    = nil
	end
	tbl.gun = 
	{
		max_burst_length = 150,
		rates 			 = {900},-- unsync mount
		recoil_coeff 	 = 1.0,
		barrels_count 	 = 1,
	}
	if tbl.rates then 
	   tbl.gun.rates    =  tbl.rates
	   tbl.rates	    = nil
	end	
	tbl.ejector_pos 		= tbl.ejector_pos or {0.0, 0.05, 0.0}
	tbl.ejector_dir 		= {0,-1,0}
	tbl.effect_arg_number	= tbl.effect_arg_number or 436
	tbl.supply_position  	= tbl.supply_position   or {0,  0.3, -0.3}
	tbl.aft_gun_mount 			= false
	tbl.effective_fire_distance = 1000
	tbl.drop_cartridge 			= 204
	tbl.muzzle_pos				= {0,0,0} -- all position from connector
	tbl.azimuth_initial 		=  tbl.azimuth_initial  or 0   
	tbl.elevation_initial 		=  tbl.elevation_initial  or 0   
	
	return declare_weapon(tbl)
end

function MG_151_20(tbl)
	tbl.category = CAT_GUN_MOUNT 
	tbl.name 	 = "MG_151_20"
	tbl.supply 	 = 
	{
		shells = {"MG_20x82_HEI_T","MG_20x82_API","MG_20x82_MGsch"},
		mixes  = {{1,2,3,1,2,3}}, --  
		count  = 250,
	}
	if tbl.mixes then 
	   tbl.supply.mixes =  tbl.mixes
	   tbl.mixes	    = nil
	end
	tbl.gun = 
	{
		max_burst_length = 150,
		rates 			 = {700},-- unsync mount
		recoil_coeff 	 = 1.0,
		barrels_count 	 = 1,
	}
	if tbl.rates then 
	   tbl.gun.rates    =  tbl.rates
	   tbl.rates	    = nil
	end	
	tbl.ejector_pos 		= tbl.ejector_pos or {0.0, 0.05, 0.0}
	tbl.ejector_dir 		= {0,-1,0}
	tbl.effect_arg_number	= tbl.effect_arg_number or 436
	tbl.supply_position  	= tbl.supply_position   or {0, -0.3, -1.5}
	tbl.aft_gun_mount 			= false
	tbl.effective_fire_distance = 1000
	tbl.drop_cartridge 			= 204
	tbl.muzzle_pos				= {0,0,0} -- all position from connector
	tbl.azimuth_initial 		=  tbl.azimuth_initial  or 0   
	tbl.elevation_initial 		=  tbl.elevation_initial  or 0   
	
	return declare_weapon(tbl)
end
 


SM_79 =  {
        
	Name 				=   'SM-79',
	DisplayName			= _('SM-79'),
	
	HumanCockpit 		= true,
	HumanCockpitPath    = current_mod_path..'/Cockpit/',
	
	Picture 			= "Old_P38D.png",
	Rate 				= 40, -- RewardPoint in Multiplayer
	Shape 				= "SM-79",
	
	shape_table_data 	= 
	{
		{
			file  	 	= 'SM-79';
			life  	 	= 18; -- lifebar
			vis   	 	= 3; -- visibility gain.
			desrt    	= 'SM-79-oblomok'; -- Name of destroyed object file name
			fire  	 	= { 300, 2}; -- Fire on the ground after destoyed: 300sec 2m
			username	= 'SM-79';
			index    	=  WSTYPE_PLACEHOLDER;
			classname 	= "lLandPlane";
			positioning = "BYNORMAL";
			drawonmap 	= true;
		},
		{
			name  = "SM-79-oblomok";
			file  = "SM-79-oblomok";
			fire  = { 240, 2};
		},

	},
	mapclasskey 		= "P0091000025",
	attribute  			= {wsType_Air, wsType_Airplane, wsType_Fighter, WSTYPE_PLACEHOLDER ,"Battleplanes",},
	Categories 			= {"{78EFB7A2-FD52-4b57-A6A6-3BF0E1D6555F}", "Interceptor",},	
	-------------------------
	M_empty 					= 2005, -- kg
	M_nominal 					= 2250, -- kg
	M_max 						= 2665, -- kg
	M_fuel_max 					= 284, -- kg --2225
	H_max 					 	= 11000, -- m
	stores_number				=	0,
	average_fuel_consumption 	= 0.059, -- this is highly relative, but good estimates are 36-40l/min = 28-31kg/min = 0.47-0.52kg/s -- 45l/min = 35kg/min = 0.583kg/s
	CAS_min 					= 50, -- if this is not OVERAL FLIGHT TIME, but jus LOITER TIME, than it sholud be 10-15 minutes.....CAS capability in minute (for AI)
	V_opt 						= 104,-- Cruise speed (for AI)
	V_take_off 					= 33, -- Take off speed in m/s (for AI)
	V_land 						= 31, -- Land speed in m/s (for AI)
	V_max_sea_level 			= 139, -- Max speed at sea level in m/s (for AI)
	V_max_h 					= 155, -- Max speed at max altitude in m/s (for AI)
	Vy_max 						= 18, -- Max climb speed in m/s (for AI)
	Mach_max 					= 0.8, -- Max speed in Mach (for AI)
	Ny_min 						= -3, -- Min G (for AI)
	Ny_max 						= 8.0,  -- Max G (for AI)
	Ny_max_e 					= 8.0,  -- Max G (for AI)
	AOA_take_off 				= 0.14, -- AoA in take off (for AI)
	bank_angle_max 				= 60, -- Max bank angle (for AI)
		
		
	has_afteburner 				= false, -- AFB yes/no
	has_speedbrake 				= false, -- Speedbrake yes/no
	nose_gear_pos				= 	{-10.522,	0.536,	0}, -- nosegear coord 3.769,	-2.353,	0
	--nose_gear_pos				= 	{3.769,	-2.353,	0}, 
	main_gear_pos 				= 	{0.635,	-1.640,	2.534}, -- main gear coords 0.072,	-2.374,	2.341
	tand_gear_max				= 0.577,
	tanker_type 				= 0, -- Tanker type if the plane is airrefuel capable
	wing_area 					= 16.1651, -- wing area in m2
	wing_span 					= 9.87, -- wing spain in m
	wing_type 					= 0,
	thrust_sum_max 				= 460, -- thrust in kg (44kN)
	thrust_sum_ab 				= 460, -- thrust inkg (71kN)
	length 						= 8.65, -- full lenght in m
	height 						= 2.6, -- height in m
	flaps_maneuver 				= 0.5, -- Max flaps in take-off and maneuver (0.5 = 1st stage; 1.0 = 2nd stage) (for AI)
	range 						= 665, -- Max range in km (for AI)
	RCS 						= 2.5, -- Radar Cross Section m2
	IR_emission_coeff 			= 0.1, -- Normal engine -- IR_emission_coeff = 1 is Su-27 without afterburner. It is reference.
	IR_emission_coeff_ab 		= 0, -- With afterburner
	wing_tip_pos 				= 	{-0.228,	1.025,	10.025}, -- wingtip coords for visual effects
	nose_gear_wheel_diameter 	= 0.604, -- in m
	main_gear_wheel_diameter 	= 0.257, -- in m
	brakeshute_name 			= 0, -- Landing - brake chute visual shape after separation
	is_tanker 					= false, -- Tanker yes/no
	air_refuel_receptacle_pos 	= {0, 0, 0}, -- refuel coords
	engines_count				= 1, -- Engines count
	engines_nozzles = {
		[1] = 
		{
			pos 		=  {1.693,-0.115, 2.991}, -- nozzle coords
			elevation   =  0, -- AFB cone elevation
			diameter	 = 0.6, -- AFB cone diameter
			exhaust_length_ab   = 8.631, -- lenght in m
			exhaust_length_ab_K = 0.76, -- AB animation
			engine_number  = 1, --both to first engine
		}, -- end of [1]
		[2] = 
		{
			pos 		=  {1.693,-0.115, -2.991}, -- nozzle coords
			elevation   =  0, -- AFB cone elevation
			diameter	 = 0.6, -- AFB cone diameter
			exhaust_length_ab   = 8.631, -- lenght in m
			exhaust_length_ab_K = 0.76, -- AB animation
			engine_number  = 1, --both to first engine
		}, -- end of [1]
		[3] = 
		{
			pos 		=  {3.364,0.482, 0.510}, -- nozzle coords
			elevation   =  0, -- AFB cone elevation
			diameter	 = 0.6, -- AFB cone diameter
			exhaust_length_ab   = 8.631, -- lenght in m
			exhaust_length_ab_K = 0.76, -- AB animation
			engine_number  = 1, --both to first engine
		}, -- end of [1]
	}, -- end of engines_nozzles
	crew_members = 
	{
		[1] = 
		{
			pilot_name		  	 = 56,
			ejection_seat_name	=	17,
			drop_canopy_name	=	20,
			pos					 =  {1.359000,2.111000,0.000000},
			canopy_pos = {1.359000,2.111000,0.000000},
		}, -- end of [1]
		[2] = 
		{
		    pilot_name		  	 = 56,
			ejection_seat_name	=	17,
			drop_canopy_name	=	20,
			pos = 	{1.359000,2.111000,0.350000},
		}, -- end of [2]
		[3] = 
		{
			pilot_name		  	 = 56,
			ejection_seat_name	=	17,
			drop_canopy_name	=	0,
			pos = 	{-0.840000,	2.897000,0.000000},
		}, -- end of [3]
		[4] =
		{
			pilot_name		  	 = 56,
			ejection_seat_name	=	17,
			drop_canopy_name	=	0,
			pos = 	{-4.666000,1.538000,0.372000},
		}, -- end of [4]
	}, -- end of crew_members

	fires_pos = 
		{
			[1] = 	{-2,	0.595,	0.5},
			[2] = 	{0,	0,	2.237},
			[3] = 	{0,	0,	-2.237},
			[4] = 	{0.265,	0,	1.5},
			[5] = 	{-0.265,	0,	-1.5},
			[6] = 	{0.5,	0,	4.274},
			[7] = 	{0.5,	0,	-4.274},
			[8] = 	{-5,	0.5,	0},
			[9] = 	{-5,	0.5,	0},
			[10] = 	{-5,	0.5,	0},
			[11] = 	{-5,	0.5,	0},
		}, -- end of fires_pos
	
	
	-- Countermeasures
	SingleChargeTotal	 	= 0,
	CMDS_Incrementation 	= 0,
	ChaffDefault 			= 0, 
	ChaffChargeSize 		= 0,
	FlareDefault 			= 0, 
	FlareChargeSize 		= 0,
	CMDS_Edit 				= false,

	--sensors
	
	detection_range_max		 = 0,
	radar_can_see_ground 	 = false, -- this should be examined (what is this exactly?)
	CanopyGeometry = {
		azimuth   = {-160.0, 160.0}, -- pilot view horizontal (AI)
		elevation = {-50.0, 90.0} -- pilot view vertical (AI)
	},
	Sensors = {
		OPTIC = "Merkury LLTV", -- For night goggles imitation
   	},
	HumanRadio = {
		frequency = 127.5,  -- Radio Freq
		editable = true,
		minFrequency = 100.000,
		maxFrequency = 156.000,
		modulation = MODULATION_AM
	},
	
	
	Guns =  {	MG_131	 ({muzzle_pos_connector	= "Gun_point_03",rates = {875},effect_arg_number = 435,mixes = {{1,2,3,2}},azimuth_initial = 0.092,elevation_initial = 0.385,aft_gun_mount = true,supply_position = {-5.883,  1.538, 1.242}}), 
				MG_131	 ({muzzle_pos_connector	= "Gun_point_02",rates = {883},effect_arg_number = 432,mixes = {{3,2,1,2}},azimuth_initial = 0.092,elevation_initial = 0.385,aft_gun_mount = true,supply_position = {-6.697,  0.357,  0.056}}), 
				MG_151_20({muzzle_pos_connector	= "Gun_point_04",rates = {688},effect_arg_number = 436,mixes = {{1,2,2,3,3}},azimuth_initial = -0.092,elevation_initial = 0.563,supply_position = {2.285, -1.085, 9.111}}), 
				MG_131	 ({muzzle_pos_connector	= "Gun_point_01",rates = {875},effect_arg_number = 435,mixes = {{1,2,3,2}},azimuth_initial = 0.092,elevation_initial = 0.385,aft_gun_mount = true,supply_position = {-2.143,  2.888, 0.000}}),  
				MG_151_20({muzzle_pos_connector	= "Gun_point_05",rates = {679},effect_arg_number = 350,mixes = {{3,3,1,2,2}},azimuth_initial =  0.092,elevation_initial = 0.563,supply_position = {2.285, -1.085, -9.111}}),
				MG_151_20({muzzle_pos_connector	= "Gun_point_06",rates = {679},effect_arg_number = 350,mixes = {{3,3,1,2,2}},azimuth_initial =  0.092,elevation_initial = 0.563,supply_position = {1.207, 2.634, 0.000}}),
			},
	
	Pylons =  {  
             pylon(1, 0, 0.372, -0.115, -4.125,  {use_full_connector_position=true,connector = "PYLON_1",arg = 308,arg_value = -1.0},
		         {
					--[[
			       { CLSID = "{HVAR}",arg = 308,arg_value = 0.5},
			       { CLSID = "{HVAR_SMOKE_GENERATOR}",arg = 308,arg_value = 0.5},
				   { CLSID = "{DB434044-F5D0-4F1F-9BA9-B73027E18DD3}" },
                   { CLSID = "{BCE4E030-38E9-423E-98ED-24BE3DA87C32}" }, -- MK-82				
				   { CLSID = "LAU-105_1*AIM-9M_L" },
				   { CLSID = "LAU-105" },
				   { CLSID = "LAU-105_2*CATM-9M" },
				   { CLSID = "LAU-105_1*CATM-9M_L" },
				   { CLSID = "{6D21ECEA-F85B-4E8D-9D51-31DC9B8AA4EF}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E741}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E742}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E743}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E744}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E745}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E746}" },
				   { CLSID = "{DB769D48-67D7-42ED-A2BE-108D566C8B1E}" }, -- GBU-12
				   { CLSID = "{51F9AAE5-964F-4D21-83FB-502E3BFE5F8A}" }, -- GBU-10 
				   { CLSID = "{BDU-50LD}" },
				   { CLSID = "{BDU-50LGB}" }, -- BDU-50LGB
				   { CLSID = "{BDU-50HD}" },
				   { CLSID = "{Mk82AIR}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "ALQ_184" }, -- ALQ-184		
				   { CLSID = "{5335D97A-35A5-4643-9D9B-026C75961E52}" }, -- CBU-97
				   { CLSID = "{GBU-31}" },
				   { CLSID = "{GBU-38}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "{CBU_105}" }, -- CBU-105
				   { CLSID = "{CBU_103}" }, -- CBU-103
				   { CLSID = "{AN-M64}",arg = 312,arg_value = 0.5},
				   --]]
		         }),					
             pylon(2, 0, 1.111, -1.423, -1.015, {use_full_connector_position=true,connector = "PYLON_2",arg = 309,arg_value = -1.0},
		         {
				  --[[
			       { CLSID = "{HVAR}",arg = 309,arg_value = 0.5},
			       { CLSID = "{HVAR_SMOKE_GENERATOR}",arg = 309,arg_value = 0.5},
				   { CLSID = "{BCE4E030-38E9-423E-98ED-24BE3DA87C32}" }, -- MK-82
                   { CLSID = "{A111396E-D3E8-4b9c-8AC9-2432489304D5}" }, -- AAQ-2
				   { CLSID = "{BDU-50LD}" },
				   { CLSID = "{BDU-50HD}" },
				   { CLSID = "{Mk82AIR}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "{FC85D2ED-501A-48ce-9863-49D468DDD5FC}" }, -- LAU-68 with Mk1
				   { CLSID = "{174C6E6D-0C3D-42ff-BCB3-0853CB371F5C}" }, -- LAU-68 with Mk5
				   { CLSID = "{65396399-9F5C-4ec3-A7D2-5A8F4C1D90C4}" }, -- LAU-68 with Mk61
				   { CLSID = "{A021F29D-18AB-4d3e-985C-FC9C60E35E9E}" }, -- LAU-68 with Mk151
				   { CLSID = "{4F977A2A-CD25-44df-90EF-164BFA2AE72F}" }, -- LAU-68 with Mk156
				   { CLSID = "{1F7136CB-8120-4e77-B97B-945FF01FB67C}" }, -- LAU-68 with WTU1B
				   { CLSID = "{647C5F26-BDD1-41e6-A371-8DE1E4CC0E94}" }, -- LAU-68 with M257
				   { CLSID = "{0877B74B-5A00-4e61-BA8A-A56450BA9E27}" }, -- LAU-68 with M274
				   { CLSID = "{9115A5AF-6D5C-4b6b-BEA9-31D48B5C6001}" }, -- LAU-68 with M278
				   { CLSID = "{D22C2D63-E5C9-4247-94FB-5E8F3DE22B71}" }, -- LAU-131 with Mk1
				   { CLSID = "{319293F2-392C-4617-8315-7C88C22AF7C4}" }, -- LAU-131 with Mk5
				   { CLSID = "{1CA5E00B-D545-4ff9-9B53-5970E292F14D}" }, -- LAU-131 with Mk61
				   { CLSID = "{69926055-0DA8-4530-9F2F-C86B157EA9F6}" }, -- LAU-131 with Mk151
				   { CLSID = "{2AF2EC3F-9065-4de5-93E1-1739C9A71EF7}" }, -- LAU-131 with Mk156
				   { CLSID = "{DDCE7D70-5313-4181-8977-F11018681662}" }, -- LAU-131 with WTU1B
				   { CLSID = "{DAD45FE5-CFF0-4a2b-99D4-5D044D3BC22F}" }, -- LAU-131 with M257
				   { CLSID = "{6D6D5C07-2A90-4a68-9A74-C5D0CFFB05D9}" }, -- LAU-131 with M274
				   { CLSID = "{1FE353C6-5EB6-4d22-9CFD-6DB384EC7296}" }, -- LAU-131 with M278
				   { CLSID = "{5335D97A-35A5-4643-9D9B-026C75961E52}" }, -- CBU-97
				   { CLSID = "{BDU-50LGB}" }, -- BDU-50LGB
				   { CLSID = "{CAE48299-A294-4bad-8EE6-89EFC5DCDF00}" }, -- SUU-25
				   --]]
		         }),
             pylon(3, 0, 1.111, -1.423, -0.723, {use_full_connector_position=true,connector = "PYLON_3",arg = 310,arg_value = -1.0},
		         {
				  --[[
			       { CLSID = "{HVAR}",arg = 310,arg_value = 0.5},
			       { CLSID = "{HVAR_SMOKE_GENERATOR}",arg = 310,arg_value = 0.5},
				   { CLSID = "{BCE4E030-38E9-423E-98ED-24BE3DA87C32}" },
                   { CLSID = "{AB8B8299-F1CC-4359-89B5-2172E0CF4A5A}" },
  				   { CLSID = "{DB769D48-67D7-42ED-A2BE-108D566C8B1E}" },
				   { CLSID = "{BDU-50LD}" },
				   { CLSID = "{BDU-50HD}" },
				   { CLSID = "{Mk82AIR}" },				   
				   { CLSID = "MXU-648-TP" }, --MXU-648 Travel Pod
				   { CLSID = "BRU-42_LS" },
				   { CLSID = "BRU-42_3*BDU-33"},				   
				   { CLSID = "{BDU-50LGB}" }, -- BDU-50LGB
				   --{ CLSID = "{60CC734F-0AFA-4E2E-82B8-93B941AB11CF}" }, -- TER 3*MK82
				   --{ CLSID = "{BRU-42_3*Mk-82AIR}" },
				   --]]
		         }),
             pylon(4, 0, 1.111, -1.423, 0.723, {use_full_connector_position=true,connector = "PYLON_4",arg = 311,arg_value = -1.0},
		         {
				  --[[
			       { CLSID = "{HVAR}",arg = 311,arg_value = 0.5},
			       { CLSID = "{HVAR_SMOKE_GENERATOR}",arg = 311,arg_value = 0.5},
				   { CLSID = "{BCE4E030-38E9-423E-98ED-24BE3DA87C32}" },
                   { CLSID = "{AB8B8299-F1CC-4359-89B5-2172E0CF4A5A}" },
  				   { CLSID = "{DB769D48-67D7-42ED-A2BE-108D566C8B1E}" },
				   { CLSID = "{BDU-50LD}" },
				   { CLSID = "{BDU-50HD}" },
				   { CLSID = "{Mk82AIR}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "MXU-648-TP" }, --MXU-648 Travel Pod
				   { CLSID = "BRU-42_LS" },
				   { CLSID = "BRU-42_3*BDU-33"},
				   --{ CLSID = "{5335D97A-35A5-4643-9D9B-026C75961E52}" }, -- CBU-97
				   { CLSID = "{BDU-50LGB}" }, -- BDU-50LGB
				   { CLSID = "Fuel_Tank_FT600" },
				   --]]
		         }),
             pylon(5, 0, 1.111, -1.423, 1.015, {use_full_connector_position=true,connector = "PYLON_5",arg = 312,arg_value = -1.0},
		         {
				   --[[
			       { CLSID = "{HVAR}",arg = 312,arg_value = 0.5},
				   { CLSID = "{BCE4E030-38E9-423E-98ED-24BE3DA87C32}" }, -- MK-82
                   { CLSID = "{A111396E-D3E8-4b9c-8AC9-2432489304D5}" }, -- AAQ-28
				   { CLSID = "{BDU-50LD}" },
				   { CLSID = "{BDU-50HD}" },
				   { CLSID = "{Mk82AIR}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "{FC85D2ED-501A-48ce-9863-49D468DDD5FC}" }, -- LAU-68 with Mk1
				   { CLSID = "{174C6E6D-0C3D-42ff-BCB3-0853CB371F5C}" }, -- LAU-68 with Mk5
				   { CLSID = "{65396399-9F5C-4ec3-A7D2-5A8F4C1D90C4}" }, -- LAU-68 with Mk61
				   { CLSID = "{A021F29D-18AB-4d3e-985C-FC9C60E35E9E}" }, -- LAU-68 with Mk151
				   { CLSID = "{4F977A2A-CD25-44df-90EF-164BFA2AE72F}" }, -- LAU-68 with Mk156
				   { CLSID = "{1F7136CB-8120-4e77-B97B-945FF01FB67C}" }, -- LAU-68 with WTU1B
				   { CLSID = "{647C5F26-BDD1-41e6-A371-8DE1E4CC0E94}" }, -- LAU-68 with M257
				   { CLSID = "{0877B74B-5A00-4e61-BA8A-A56450BA9E27}" }, -- LAU-68 with M274
				   { CLSID = "{9115A5AF-6D5C-4b6b-BEA9-31D48B5C6001}" }, -- LAU-68 with M278
				   { CLSID = "{D22C2D63-E5C9-4247-94FB-5E8F3DE22B71}" }, -- LAU-131 with Mk1
				   { CLSID = "{319293F2-392C-4617-8315-7C88C22AF7C4}" }, -- LAU-131 with Mk5
				   { CLSID = "{1CA5E00B-D545-4ff9-9B53-5970E292F14D}" }, -- LAU-131 with Mk61
				   { CLSID = "{69926055-0DA8-4530-9F2F-C86B157EA9F6}" }, -- LAU-131 with Mk151
				   { CLSID = "{2AF2EC3F-9065-4de5-93E1-1739C9A71EF7}" }, -- LAU-131 with Mk156
				   { CLSID = "{DDCE7D70-5313-4181-8977-F11018681662}" }, -- LAU-131 with WTU1B
				   { CLSID = "{DAD45FE5-CFF0-4a2b-99D4-5D044D3BC22F}" }, -- LAU-131 with M257
				   { CLSID = "{6D6D5C07-2A90-4a68-9A74-C5D0CFFB05D9}" }, -- LAU-131 with M274
				   { CLSID = "{1FE353C6-5EB6-4d22-9CFD-6DB384EC7296}" }, -- LAU-131 with M278
				   { CLSID = "{5335D97A-35A5-4643-9D9B-026C75961E52}" }, -- CBU-97
				   { CLSID = "{BDU-50LGB}" }, -- BDU-50LGB
				   { CLSID = "{CAE48299-A294-4bad-8EE6-89EFC5DCDF00}" }, -- SUU-25
             --{ CLSID = "{AN-M64}",arg = 312,arg_value = 0.5},
             --{CLSID = "{DT75GAL}",arg = 312,arg_value = 0.5},
			 --]]
		         }),
             pylon(6, 0, 0.372, -0.115, 4.125, {use_full_connector_position=true,connector = "PYLON_6",arg = 313,arg_value = -1.0},
		         {
				 --[[
			       { CLSID = "{HVAR}",arg = 313,arg_value = 0.5},
				   { CLSID = "{DB434044-F5D0-4F1F-9BA9-B73027E18DD3}" },
                   { CLSID = "{BCE4E030-38E9-423E-98ED-24BE3DA87C32}" }, -- MK-82				
				   { CLSID = "LAU-105_1*AIM-9M_L" },
				   { CLSID = "LAU-105" },
				   { CLSID = "LAU-105_2*CATM-9M" },
				   { CLSID = "LAU-105_1*CATM-9M_L" },
				   { CLSID = "{6D21ECEA-F85B-4E8D-9D51-31DC9B8AA4EF}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E741}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E742}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E743}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E744}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E745}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E746}" },
				   { CLSID = "{DB769D48-67D7-42ED-A2BE-108D566C8B1E}" }, -- GBU-12
				   { CLSID = "{BDU-50LD}" },
				   { CLSID = "{BDU-50LGB}" }, -- BDU-50LGB
				   { CLSID = "{BDU-50HD}" },
				   { CLSID = "{Mk82AIR}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "ALQ_184" }, -- ALQ-184		
				   { CLSID = "{5335D97A-35A5-4643-9D9B-026C75961E52}" }, -- CBU-97
				   { CLSID = "{GBU-31}" },
				   { CLSID = "{GBU-38}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "{CBU_105}" }, -- CBU-105
				   { CLSID = "{CBU_103}" }, -- CBU-103
				   { CLSID = "{AN-M64}",arg = 312,arg_value = 0.5},
             { CLSID = "{AN-M64}",arg = 313,arg_value = 0.5},
             --{CLSID = "{DT75GAL}",arg = 313,arg_value = 0.5},
			  --]]
		         }),
              pylon(7, 0, 1.292, -1.247, 0, {use_full_connector_position=true,connector = "PYLON_7",arg = 314,arg_value = -1.0},
		         { 
				   --[[
			       { CLSID = "{HVAR}",arg = 314,arg_value = 0.5},				  				  
				   { CLSID = "{6D21ECEA-F85B-4E8D-9D51-31DC9B8AA4EF}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E741}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E742}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E743}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E744}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E745}" },
                   { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E746}" },
				   { CLSID = "{DB769D48-67D7-42ED-A2BE-108D566C8B1E}" }, -- GBU-12
				   { CLSID = "{51F9AAE5-964F-4D21-83FB-502E3BFE5F8A}" }, -- GBU-10 
				   { CLSID = "{BDU-50LD}" },
				   { CLSID = "{BDU-50LGB}" }, -- BDU-50LGB
				   { CLSID = "{BDU-50HD}" },
				   { CLSID = "{Mk82AIR}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "ALQ_184" }, -- ALQ-184		
				   { CLSID = "{5335D97A-35A5-4643-9D9B-026C75961E52}" }, -- CBU-97
				   { CLSID = "{GBU-31}" },
				   { CLSID = "{GBU-38}" },
				   { CLSID = "{CBU-87}" },
				   { CLSID = "{CBU_105}" }, -- CBU-105
				   { CLSID = "{CBU_103}" }, -- CBU-103
				   { CLSID = "{8A0BE8AE-58D4-4572-9263-3144C0D06364}" },
             { CLSID = "{AN-M64}",arg = 314,arg_value = 0.5},
             --{CLSID = "{DT75GAL}",arg = 314,arg_value = 0.5},
			 --]]

		         }),
    },
	
	Tasks = {
        aircraft_task(CAP),
		aircraft_task(Escort),
        aircraft_task(FighterSweep),
		aircraft_task(GroundAttack),
        aircraft_task(CAS),
        aircraft_task(AFAC),
		aircraft_task(RunwayAttack),
		aircraft_task(AntishipStrike),
    },	
	DefaultTask = aircraft_task(CAS),

	SFM_Data = {
		aerodynamics = -- Cx = Cx_0 + Cy^2*B2 +Cy^4*B4
		{
			Cy0			=	0.1,      -- zero AoA lift coefficient
			Mzalfa		=	4.355,  -- coefficients for pitch agility
			Mzalfadt	=	0.8,    -- coefficients for pitch agility
			kjx			=	2.25,    
			kjz			=	0.00125, 
			Czbe		=	-0.016, -- coefficient, along Z axis (perpendicular), affects yaw, negative value means force orientation in FC coordinate system
			cx_gear		=	0.012,    -- coefficient, drag, gear 0.0277
			cx_flap		=	0.095,   -- coefficient, drag, full flaps
			cy_flap		=	0.31,    -- coefficient, normal force, lift, flaps
			cx_brk		=	0.06,   -- coefficient, drag, breaks
			table_data  = 
			{	--        M		 Cx0	 Cya	  B		 B4	    Omxmax	   Aldop   Cymax
				[1] = 	{0,		0.024,	0.07,	0.075,	0.12,	0.5,		30,		1.2},
				[2] = 	{0.1,	0.024,	0.07,	0.075,	0.12,	1.5,		30,		1.2},
				[3] = 	{0.2,	0.024,	0.07,	0.075,	0.12,	0.79,		30,		1.2},
				[4] = 	{0.3,	0.0239,	0.073,	0.075,	0.12,	1.24,		30,		1.2},
				[5] = 	{0.4,	0.024,	0.076,	0.075,	0.12,	1.323,		28.7,	1.18},
				[6] = 	{0.5,	0.0235,	0.079,	0.075,	0.12,	1.13,		27.3,	1.16},
				[7] = 	{0.6,	0.025,	0.083,	0.075,	0.125,	0.94,		26,		1.14},
				[8] = 	{0.7,	0.044,	0.085,	0.14,	0.1,	0.67,		24.7,	1.12},
				[9] = 	{0.8,	0.0465,	0.0855,	0.1775,	0.125,	0.57,		24,		1.11},
				[10] = 	{0.9,	0.049,	0.086,	0.215,	0.15,	0.456,		18,		1.1},
				[11] = 	{1.9,	0.049,	0.083,	0.228,	0.17,	0.32,		17,		1.05},
			}, -- end of table_data
			
		}, -- end of aerodynamics
		engine = 
		{
			Nmg	=	67.5, -- RPM at idle
			MinRUD	=	0, -- Min state of the throttle
			MaxRUD	=	1, -- Max state of the throttle
			MaksRUD	=	1, -- Military power state of the throttle
			ForsRUD	=	1, -- Afterburner state of the throttle
			typeng	=	2,
			--[[
				E_TURBOJET = 0
				E_TURBOJET_AB = 1
				E_PISTON = 2
				E_TURBOPROP = 3
				E_TURBOFAN	= 4
				E_TURBOSHAFT = 5
			--]]
			
			hMaxEng	=	12.5, -- Max altitude for safe engine operation in km
			dcx_eng	=	0.0015, -- Engine drag coeficient
			cemax	=	0.37, -- not used for fuel calulation , only for AI routines to check flight time ( fuel calculation algorithm is built in )
			cefor	=	0.37, -- not used for fuel calulation , only for AI routines to check flight time ( fuel calculation algorithm is built in )
			dpdh_m	=	1800, --  altitude coefficient for max thrust
			dpdh_f	=	1800,  --  altitude coefficient for AB thrust
			k_adiab_1			= 0.037923,
			k_adiab_2			= 0.0562,
			MAX_Manifold_P_1	= 155774,		
			MAX_Manifold_P_2	= 206570,		
			MAX_Manifold_P_3	= 226648,		
			k_after_cool		= 0.54,
			Displ				= 27,
			k_Eps				= 6,
			Stroke				= 0.152,
			V_pist_0			= 12,
			Nu_0				= 1.2,
			Nu_1				= 0.9,
			Nu_2				= 0.001,
			N_indic_0			= 1023040,
			N_fr_0				= 0.072,
			N_fr_1				= 0.02,
			Init_Mom			= 220,
			D_prop				= 3.45,
			MOI_prop			= 65,
			k_gearbox			= 2.088,
			P_oil				= 495438,
			k_boost				= 3,
			k_cfug				= 0.003,
			k_oil				= 0.00004,
			k_piston			= 3000,
			k_reg				= 0.003,
			k_vel				= 0.017,
			table_data = 
			{		--   M		Pmax		 Pfor	
				{0.0,		14958.0},
				{0.1,		14040.0},
				{0.2,		12906.0},
				{0.3,		11988.0},
				{0.4,		11007.0},
				{0.5,		10170.0},
				{0.6,		 9540.0},
				{0.7,		 9045.0},
				{0.8,		 8838.0},
				{0.9,		 5312.0},
				{1.9,		 3122.0}
			}, -- end of table_data
			-- M - Mach number
			-- Pmax - Engine thrust at military power
			-- Pfor - Engine thrust at AFB
		}, -- end of engine
	},
	--damage , index meaning see in  Scripts\Aircrafts\_Common\Damage.lua
	Damage = {
				[0]		= {critical_damage = 5, args = {146}},
				[3]		= {critical_damage = 20,args = {65}}  ,
				[4]		= {critical_damage = 20, args = {150}},
				[5]		= {critical_damage = 20, args = {147}},
				[7]		= {critical_damage = 4, args = {249}} ,
				[9]		= {critical_damage = 3, args = {154}},
				[10]	= {critical_damage = 3, args = {153}},
				[11]	= {critical_damage = 3, args = {167}},
				[12]	= {critical_damage = 3, args = {161}},
				[15]	= {critical_damage = 5, args = {267}},
				[16]	= {critical_damage = 5, args = {266}},
				[23]	= {critical_damage = 8, args = {223}, deps_cells = {25}},
				[24]	= {critical_damage = 8, args = {213}, deps_cells = {26, 60}},
				[25]	= {critical_damage = 3, args = {226}},
				[26]	= {critical_damage = 3, args = {216}},
				[29]	= {critical_damage = 9, args = {224}, deps_cells = {31, 25, 23}},
				[30]	= {critical_damage = 9, args = {214}, deps_cells = {32, 26, 24, 60}},
				[31]	= {critical_damage = 4, args = {229}},
				[32]	= {critical_damage = 4, args = {219}},
				[35]	= {critical_damage = 10, args = {225}, deps_cells = {29, 31, 25, 23}},
				[36]	= {critical_damage = 10, args = {215}, deps_cells = {30, 32, 26, 24, 60}} ,
				[37]	= {critical_damage = 4, args = {227}},
				[38]	= {critical_damage = 4, args = {217}},
				[39]	= {critical_damage = 7,	args = {244}, deps_cells = {53}},
				[40]	= {critical_damage = 7, args = {241}, deps_cells = {54}},
				[45]	= {critical_damage = 9, args = {235}, deps_cells = {39, 51, 53}},
				[46]	= {critical_damage = 9, args = {233}, deps_cells = {40, 52, 54}},
				[51]	= {critical_damage = 3, args = {239}},
				[52]	= {critical_damage = 3, args = {237}},
				[53]	= {critical_damage = 3, args = {248}},
				[54]	= {critical_damage = 3, args = {247}},
				[55]	= {critical_damage = 20, args = {81}, deps_cells = {39, 40, 45, 46, 51, 52, 53, 54}},
				[59]	= {critical_damage = 5, args = {148}},
				[60]	= {critical_damage = 1, args = {144}},

				[83]	= {critical_damage = 3, args = {134}} ,-- nose wheel
				[84]	= {critical_damage = 3, args = {136}}, -- left wheel
				[85]	= {critical_damage = 3, args = {135}} ,-- right wheel
	},
	
	DamageParts = 
	{  
		[1] = "SM-79-oblomok-wing-r", -- wing R
		[2] = "SM-79-oblomok-wing-l", -- wing L
		[3] = "SM-79-oblomok-tail-l", -- nose
		[4] = "SM-79-oblomok-tail-r", -- tail
	},
	
	lights_data = {	typename = "collection", lights = {
    [1] = {typename = "collection",lights = {}},
	[2] = {typename = "collection",
			lights = {-- Landing light
					  {typename = "spotlight",
					   connector = "MAIN_SPOT_PTR_02",
					   argument = 209,
					   dir_correction = {elevation = math.rad(-1)}
					  },
					  {-- Landing/Taxi light
					   typename = "spotlight",
					   connector = "MAIN_SPOT_PTR_01",
					   argument = 208,
					   dir_correction = {elevation = math.rad(3)}
					  }
					 }
			},
    [3]	= {typename = "collection",
			lights = {-- Left Position Light (red)
					  {typename = "omnilight",
					   connector = "BANO_1",
					   color = {0.99, 0.11, 0.3},
					   pos_correction  = {0, 0, -0.2},
					   argument  = 190
					  },
					  -- Right Position Light (green)
					  {typename = "omnilight",
					   connector = "BANO_2",
					   color = {0, 0.894, 0.6},
					   pos_correction = {0, 0, 0.2},
					   argument  = 191
					   },
					  -- Tail Position Light (white)
					  {typename = "omnilight",
					  connector = "BANO_0",
					  color = {1, 1, 1},
					  pos_correction  = {0, 0, 0},
					  argument  = 192
					  }}
			},
    [4] = {typename = "collection",lights = {}},
	[5]	= {typename = "collection",lights = {}},
	}}, -- end lights_data
	
	Countries = {"Spain","Italy"},
}

add_aircraft(SM_79)
