--mounting 3d model paths and texture paths 

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

mount_vfs_texture_path  (current_mod_path.."/Textures/C130J.zip")
mount_vfs_liveries_path (current_mod_path.."/Liveries")
mount_vfs_texture_path  (current_mod_path.."/Textures/C130J COCKPIT")

C130J =  {
        
	Name 				=   'C130J',
	DisplayName			= _('C-130J FLIGHT TRAINING'),
	Cannon = "yes",
	HumanCockpit 		= true,
	HumanCockpitPath    = current_mod_path..'/Cockpit/',
	
	
	Picture 			= "C130J.png",
	Rate 				= "70", -- RewardPoint in Multiplayer
	Shape 				= "C130J",
	WorldID 		    =  C130J, 
	shape_table_data 	= 
	{
		{
			file  	 = 'C130J';
			life  	 = 20; -- lifebar
			vis   	 = 3; -- visibility gain.
			desrt    = 'C_130_destr'; -- Name of destroyed object file name
			fire  	 = { 300, 2}; -- Fire on the ground after destoyed: 300sec 2m
			username = 'C130J';
			index    =  WSTYPE_PLACEHOLDER ;  
			--classname   = "lLandPlane";
			--positioning = "BYNORMAL";

		},
		{
			name  = "c-130-oblomok";
			file  = "c-130-oblomok";
			fire  = { 240, 2};
		},

	},

	
	 
	mapclasskey 		= "P0091000024",
	--sounderName = "Aircraft/Planes/A-10A",
	attribute  	= {wsType_Air, wsType_Airplane, wsType_Fighter, WSTYPE_PLACEHOLDER, "Bombers", "Refuelable",},
Categories= {"{78EFB7A2-FD52-4b57-A6A6-3BF0E1D6555F}", "Interceptor",},
	
	-------------------------
	M_empty	=	36400,
		M_nominal	=	70000,
		M_max	=	79380,
		M_fuel_max	=	20830,
		H_max	=	9315,
		average_fuel_consumption	=	0.06,
		CAS_min	=	54,
		V_opt	=	174,
		V_take_off	=	58,
		V_land	=	61,
		has_afteburner	=	false,
		has_speedbrake	=	false,
		has_differential_stabilizer = false,
		main_gear_pos = 	{-2.654,	-2.40,	2.746},     --main_gear_pos = 	{-2.654,	-2.48,	2.746},
		radar_can_see_ground	=	false,
		
		nose_gear_pos = 	{12.133,	-2.25,	0},              --nose_gear_pos = 	{12.133,	-2.48,	0},
		AOA_take_off	=	0.17,
		stores_number	=	0,
		bank_angle_max	=	45,
		Ny_min	=	0.5,
		Ny_max	=	2.5,
		tand_gear_max	=	0.577,
		V_max_sea_level	=	167.5,
		V_max_h	=	172.5,
		wing_area	=	172.1,
		wing_span	=	35.0, --29.75
		thrust_sum_max	=	44400,
		thrust_sum_ab	=	44400,
		Vy_max	=	9.1,
		length	=	29.79,
		height	=	11.66,
		flaps_maneuver	=	0.5,
		Mach_max	=	0.63,
		range	=	8260,
		RCS	=	80,
		Ny_max_e	=	2,
		detection_range_max	=	0,
		IR_emission_coeff	=	1,
		IR_emission_coeff_ab	=	0,
		engines_count	=	4,
		wing_tip_pos = 	{-6.00,	3.60,	19.9},
		nose_gear_wheel_diameter	=	0.754,
		main_gear_wheel_diameter	=	0.972,
		air_refuel_receptacle_pos = 	{7.9,	1.8576,	0.574},
		tanker_type	=	2,
		
		engines_nozzles = 
		{
              [1] = 
			{
				pos = 	{-0.73,	1.105,	-10.335},
				elevation	=	0,
				diameter	=	1.523,
				exhaust_length_ab	=	11.794,
				exhaust_length_ab_K	=	0.76,
				smokiness_level     = 	0.1, 
			}, 	
              [2] = 
			{
				pos = 	{-0.742,	1.248,	10.152},
				elevation	=	0,
				diameter	=	1.523,
				exhaust_length_ab	=	11.794,
				exhaust_length_ab_K	=	0.76,
				smokiness_level     = 	0.1, 
			},
             [3] = 
			{
				pos = 	{-0.742,	1.248,	5.152},
				elevation	=	0,
				diameter	=	1.523,
				exhaust_length_ab	=	11.794,
				exhaust_length_ab_K	=	0.76,
				smokiness_level     = 	0.1, 
			}, 
            [4] = 
			{
				pos = 	{-0.73,	1.105,	10.335},
				elevation	=	0,
				diameter	=	1.523,
				exhaust_length_ab	=	11.794,
				exhaust_length_ab_K	=	0.76,
				smokiness_level     = 	0.1, 
			

		}, -- end of [4]
	}, -- end of engines_nozzles
---------------------------------------------------------------------------------
--  Equipage
---------------------------------------------------------------------------------

	crew_size	 = 10,
	crew_members = 
	{
			[1] = 
			{		ejection_seat_name	= "M-2000C_pilotseat",
			pilot_name		   	=  "M-2000C_pilot",
			drop_canopy_name	= "RAF_canopy",
			drop_parachute_name =  "M-2000C_parachute",
			pos					= {2.679, 0.512, 0.0 },
			canopy_pos			= {2.739, 0.677, 0.0},
			g_suit 			    =  5
			}, -- end of [1]
			[2] = 
			{	pilot_name          = "pilot_usa",--Copilote
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{4.5,	0.25,	0.15},
			}, -- end of [2]
                          [3] = 
			{	pilot_name          = "pilot_f86", --Equipage
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{-6.4,	-0.20,	 1.10},
			}, -- end of [3]
			[4] = 
			{	pilot_name          = "pilot_f86", --Equipage
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{-7.4,	 -0.20,	  0.10},
			}, -- end of [4]
                        [5] = 
			{	pilot_name          = "pilot_f86", --Equipage
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{-6.0,	-0.20,	 -0.10},
			}, -- end of [5]
			[6] = 
			{	pilot_name          = "pilot_f86", --Equipage
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{-7.0,	 -0.20,	  -0.10},
			}, -- end of [6]
                        [7] = 
			{	pilot_name          = "pilot_f86", --Equipage
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{-5.50,	-0.20,	 -0.10},
			}, -- end of [7]
			[8] = 
			{	pilot_name          = "pilot_f86", --Equipage
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{4.5,	 -1.00,	  -0.00},
			}, -- end of [8]
                         [9] = 
			{	pilot_name          = "pilot_f86", --Equipage
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{4.50,	-0.20,	 0.20},
			}, -- end of [9]
			[10] = 
			{	pilot_name          = "pilot_f86", --Equipage
				ejection_seat_name	=	0,
				drop_canopy_name	=	0,
				pos = 	{-8.0,	 -1.00,	  -0.10},
			}, -- end of [10]
            







			
	}, -- end of crew_members
	

	fires_pos = 
		{
			[1] = 	{4.33,	1.807,	0},
			[2] = 	{-2.333,	1.807,	5.463},
			[3] = 	{-2.333,	1.807,	-5.463},
			[4] = 	{-0.82,	0.265,	2.774},
			[5] = 	{-0.82,	0.265,	-2.774},
			[6] = 	{-0.82,	0.255,	4.274},
			[7] = 	{-0.82,	0.255,	-4.274},
			[8] = 	{0.586,	1.66,	4.841},
			[9] = 	{0.586,	1.66,	-4.841},
			[10] = 	{0.586,	1.546,	10.05},
			[11] = 	{0.586,	1.546,	-10.05},
		}, -- end of fires_pos
	
net_animation = { 
					
					},
	 -- Countermeasures
	passivCounterm = {
		CMDS_Edit = true,
		SingleChargeTotal = 100,
		-- 30 cartridges per magazine, increment by 2 magazines
		chaff = {default = 100, increment = 120, chargeSz = 2},
		-- 15 cartridges per magazine, increment by 2 magazines
		flare = {default = 100, increment = 60, chargeSz = 4}
        },
	
	-- Countermeasures
	SingleChargeTotal	 	= 100,
	CMDS_Incrementation 	= 4,
	ChaffDefault 			= 100, 
	ChaffChargeSize 		= 1,
	FlareDefault 			= 100, 
	FlareChargeSize 		= 1,
	CMDS_Edit 				= true,
	chaff_flare_dispenser 	= {
		[1] = 
		{
			dir =  {0, -1, 1},
			pos =  {-3, -1, 2},
		}, -- end of [1]
		[2] = 
		{
			dir =  {0, -1, -1},
			pos =  {-3, -1, -2},
		}, -- end of [2]
	}, -- end of chaff_flare_dispenser

	--sensors
	
	detection_range_max		 = 60,
	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 = {
		RWR = "Abstract RWR", -- RWR type
		RADAR = "N-019", -- Radar type
        OPTIC = "Shkval",
		},
	HumanRadio = {
		frequency = 127.5,  -- Radio Freq
		editable = true,
		minFrequency = 100.000,
		maxFrequency = 156.000,
		modulation = MODULATION_AM
	},
	


	Guns = {			
	         
		
		gun_mount("DEFA_554", { count = 5 },{muzzle_pos = { 8.90, -0.50, -1.50000},azimuth_initial = 0.0,elevation_initial = -16.0, supply_position = {6.05, -0.50, -3.00000},fire_effect(351,7.02,4),effect_arg_number = 351}),
		gun_mount("DEFA_554", { count = 5 },{muzzle_pos = { 8.90, -0.50,  1.50000},azimuth_initial = 0.0,elevation_initial = -17.0, supply_position = {5.90, -0.50, -3.00000},fire_effect(351,7.02,4),effect_arg_number = 351})
        --gun_mount("2A42", { count1 = 540, count2 = 540 },{muzzle_pos = { 3.65, -1.05, -4.10000},azimuth_initial = 120.0,elevation_initial = -19.0, supply_position = {3.90, -0.40, -0.0000},fire_effect(351,7.02,4),effect_arg_number = 351}),
        --gun_mount("2A42", { count1 = 540, count2 = 540 },{muzzle_pos = { 3.70, -1.05, -4.10000},azimuth_initial = 120.0,elevation_initial = -20.0, supply_position = {3.90, -0.40, -0.0000},fire_effect(351,7.02,4),effect_arg_number = 351}),
        --gun_mount("2A42", { count1 = 540, count2 = 540 },{muzzle_pos = { 3.67, -1.05, -4.10000},azimuth_initial = 120.0,elevation_initial = -21.0, supply_position = {3.90, -0.40, -0.0000},fire_effect(351,7.02,4),effect_arg_number = 351})
		},
	           

	 
	 Pylons =     {
       
		pylon(1, 0, -5.50000, 0.0000, -1.00000,
            {
				
				-- FiY = 270,DisplayName = _("GI"),   --Please  do not change or problem  
			  
            },
            {
			  
			  
			   
			    -- {  CLSID = "PARA_TROUP_AC130",arg_value = 1, attach_point_position =  {0.00000, -0.300, 0.00000} },--Please  do not change or problem
				-- {  CLSID = "SOLDIER_AC130", arg_value = 1, attach_point_position = {0, -1.30 ,0 } },--Please  do not change or problem
            }
--
        ),
		
		pylon(2, 0, -5.50000, 0.0000, 1.00000,
            {
				
				-- FiY = 180, DisplayName = _("Soldat"),
            },
            {
			   --{  CLSID = "PARA_TROUP_AC130",arg_value = 1, attach_point_position = {0.0, -0.3000, -0.20000 } },--Please  do not change or problem
			  --{  CLSID = "SOLDIER_AC130",arg_increment = 1.0, attach_point_position = {0, -1.30 ,0 } }, --Please  do not change or problem
            }

        ),
		 
		
    },
	
	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(CAP),
      -- aircraft_task(Transport), 
  --  },	
	--DefaultTask =   aircraft_task(Transport),
	
	SFM_Data = {
		aerodynamics = -- Cx = Cx_0 + Cy^2*B2 +Cy^4*B4
		{
			Cy0		=	0.0,      -- zero AoA lift coefficient
			Mzalfa		=	6.6,  -- coefficients for pitch agility
			Mzalfadt	=	1,    -- coefficients for pitch agility
			kjx		=	2.85,    
			kjz		=	0.00125, 
			Czbe		=	-0.012, -- coefficient, along Z axis (perpendicular), affects yaw, negative value means force orientation in FC coordinate system
			cx_gear		=	0.015,    -- coefficient, drag, gear
			cx_flap		=	0.08,   -- coefficient, drag, full flaps
			cy_flap		=	1,    -- coefficient, normal force, lift, flaps
			cx_brk		=	0.06,   -- coefficient, drag, breaks
			table_data  = 
			{
				[1] = 	{0,	0.024,	0.1,	0.0384,	0.000001,	0.5,	11,	1.2},
				[2] = 	{0.2,	0.024,	0.1,	0.0384,	0.000001,	0.8,	12,	1.2},
				[3] = 	{0.4,	0.024,	0.1,	0.0384,	0.000001,	1.0,	13,	1.2},
				[4] = 	{0.5,	0.024,	0.1,	0.0384,	0.000001,	1.1,	14,	1.2},
				[5] = 	{0.6,	0.027,	0.1,	0.0,	0.3,		1.2,	15,	1.2},
				[6] = 	{0.7,	0.031,	0.1,	0.045,	0.9,		1.3,	16,	1},
				[7] = 	{0.8,	0.036,	0.1,	0.107,	1,		1.3,	15,	0.8},
				[8] = 	{0.9,	0.045,	0.1,	0.148,	0.058,		1.35,	10,	0.6},
				[9] = 	{1,	0.054,	0.1,	0.199,	0.1,		1.4,	7,	0.53333333333333},
				[10] = 	{1.5,	0.054,	0.1,	0.199,	0.1,		1.5,	3,	0.2},
			}, -- end of table_data
			-- M - Mach number
			-- Cx0 - Coefficient, drag, profile, of the airplane
			-- Cya - Normal force coefficient of the wing and body of the aircraft in the normal direction to that of flight. Inversely proportional to the available G-loading at any Mach value. (lower the Cya value, higher G available) per 1 degree AOA
			-- B - Polar quad coeff
			-- B4 - Polar 4th power coeff
			-- Omxmax - roll rate, rad/s
			-- Aldop - Alfadop Max AOA at current M - departure threshold
			-- Cymax - Coefficient, lift, maximum possible (ignores other calculations if current Cy > Cymax)
		}, -- 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	=	3, --3
			--[[
				E_TURBOJET = 0
				E_TURBOJET_AB = 1
				E_PISTON = 2
				E_TURBOPROP = 3
				E_TURBOFAN = 4
				E_TURBOSHAFT = 5
			--]]
			
			hMaxEng	=	19.5, -- Max altitude for safe engine operation in km
			dcx_eng	=	0.0044,--0.0085, -- Engine drag coeficient
			cemax	=	1.24, -- 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	=  6600,	--4820, --  altitude coefficient for max thrust
			dpdh_f	= 13200,	--4820,  --  altitude coefficient for AB thrust
			table_data = 
			{		--   M		Pmax		 Pfor	
				[1] = 	{0.0,	050792},
				[2] = 	{0.1,	148288},
				[3] = 	{0.2,	323532},
				[4] = 	{0.3,	203802},
				[5] = 	{0.4,	187547},         -- [5] = 	{0.4,	387547},
				[6] = 	{0.5,	091709},      --	[6] = 	{0.5,	371709},
			                                   --	[7] = 	{0.6,	358459},
			                                    --	[8] = 	{0.7,	348624},
			                                    --	[9] = 	{0.8,	341439},
			                                    --	[10] = 	{0.9,	333000},

				--[7] = 	{0.6,	158459},
				--[8] = 	{0.7,	148624},
				--[9] = 	{0.8,	141439},
				--[10] = 	{0.9,	133000}
			





				}, -- 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] = "C-130-OBLOMOK-WING-R", -- wing R
		[2] = "C-130-OBLOMOK-WING-L", -- wing L
		[3] = "Wunderluft-part-nose", -- nose
		[4] = "Wunderluft-part-tail", -- tail
	},












	
	lights_data = {
		typename = "collection",
		lights = {
			[2] = { typename = "collection", -- form lights aft
				lights = {
					{typename = "spotlight", pos_correction  = {4.50, -1.0, 0.0},argument = 208}, -- form front
					
					
				},
			},
			[3] = { typename = "collection", -- left nav light
				lights = {
					{typename = "argumentlight",argument = 190}, -- left nav light
					{typename = "argumentlight",argument = 191}, -- tail nav light
					{typename = "argumentlight",argument = 192}, -- right nav light
				},
			},
			[4] = { typename = "collection", -- tail nav light
				lights = {
                    --{typename = "argumentlight",argument = 200}, -- FORMATION LIGHTS
                    --{typename = "argumentlight",argument = 201}, -- FORMATION LIGHTS
					{typename = "argnatostrobelight",connector = "TOP_BEACON",argument = 83,period = 2.0,color = {1.0, 0.0, 0.0},phase_shift = 0.0},
					{typename = "argnatostrobelight",connector = "BOTTOM_BEACON",argument = 193,period = 2.0,color = {1.0, 0.0, 0.0},phase_shift = 0.0}, --802
					
				},
			},
		}
	}, -- end lights_data
					
}

add_aircraft(C130J)
