-- by Eric et Patrick Cuesta
 local Agm114_MQ9 =
{
	category		= CAT_MISSILES,
	name			= "Agm114_MQ9",
	user_name		= _("Agm114_MQ9"),
	wsTypeOfWeapon 	= {wsType_Weapon, wsType_Missile, wsType_AS_Missile, WSTYPE_PLACEHOLDER},
	scheme			= "AGM-65E",             
	class_name		= "wAmmunitionSelfHoming",                          
	model			= "Agm114_MQ9",
	 mass = 100,--292
	
	
	
	 Escort = 1,
        Head_Type = 4,
		sigma = {5, 5, 5},
        M = 286.0,--286
        H_max = 10000.0,
        H_min = -1,
        Diam = 305.0,
        Cx_pil = 4,
        D_max = 11112.0,
        D_min = 1000.0,
        Head_Form = 0,
        Life_Time = 110,
        Nr_max = 16,
        v_min = 50.0,
        v_mid = 290.0,
        Mach_max = 1.5,
        t_b = 0.0,
        t_acc = 4.0,
        t_marsh = 0.0,
        Range_max = 11112.0,
        H_min_t = 0.0,
        Fi_start = 0.5,
        Fi_rak = 3.14152,
        Fi_excort = 1.05,
        Fi_search = 99.9,
        OmViz_max = 99.9,
        --warhead = warheads["AGM_65E"],
        exhaust = {0.75, 0.75, 0.75, 0.1},
        X_back = -0.879,
        Y_back = -0.155,
        Z_back = 0.0,
        Reflection = 0.063,
        KillDistance = 5.0,
	 
	shape_table_data =
	{
		{
			name	 = "Agm114_MQ9",
			file	 = "Agm114_MQ9",
			life	 = 1,
			fire	 = { 0, 1},
			username = _("Agm114_MQ9"),
			index	 = WSTYPE_PLACEHOLDER,
				
			
		},
	},
	
	
	fm = {
		mass        = 100,  
		caliber     = 0.305,  
		cx_coeff    = {1,0.39,0.38,0.236,1.31},
		L           = 2.49,
		I           = 1 / 12 * 209 * 2.49 * 2.49,
		Ma          = 0.68,
		Mw          = 1.116,
		wind_sigma	= 0.0,
		wind_time	= 0.0,
		Sw			= 0.55,
		dCydA		= {0.07, 0.036},
		A			= 0.36,
		maxAoa		= 0.23,
		finsTau		= 0.1,
		Ma_x		= 3,
		Kw_x		= 0.03,
		I_x			= 40,
	},
	
	laser_spot_seeker = {
		FOV					= 0.558,
		max_seeker_range	= 18520,
	},

	PN_autopilot = {
		K			= 0.014,
		Ki			= 0,
		Kg			= 2.5,
		Kx			= 0.02,
		fins_limit	= 0.3,
		K_GBias		= 0.26,
	},
	
	march = {
		smoke_color			= {0.8, 0.8, 0.8},
		smoke_transparency	= 0.7,
	},
		
	
	warhead = simple_warhead(500.0, 500.0),
	warhead_air = simple_warhead(500.0, 500.0),
   
}

declare_weapon(Agm114_MQ9)

declare_loadout({
	category 		= CAT_MISSILES,
	CLSID	 		= "{Agm114_MQ9}",
	attribute		= Agm114_MQ9.wsTypeOfWeapon,
	Count 			= 1,
	Cx_pil			= Agm114_MQ9.Cx,
	Picture			= "Agm114_MQ9.png",
	displayName		= Agm114_MQ9.user_name,
	Weight			= 45.0,       --MQ9_AGM114.mass,
	Elements  		= {{ShapeName = Agm114_MQ9.model}},
	
})

	
	
  declare_loadout({ -- Ajout Pylônes lau-115 + 2xlau-127 + 2xMETEOR 
	category	= CAT_MISSILES,
	CLSID			= "{Agm114_MQ9 X 2}",
	attribute	= {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
	wsTypeOfWeapon	= Agm114_MQ9.wsTypeOfWeapon,
	Count		= 2,	--count of weapon
	Cx_pil		= 0.001, -- drag index of whole rack
	Picture		=	'agm114.png',
	displayName		= _("Agm114_MQ9 X 2"),
	Weight		= 25 + 2 * 65,-- weight adapter + weapon
	Elements	=
	{
			[1]	=
			{
				Position	=	{0.10,	0,	0},
				ShapeName	=	"PYLON_MQ9", IsAdapter = true,
					},
			[2]	=
			{	
				Rotation	=	{0, 0, 0.5},
				Position	=	{0.45, -0.18, -0.15},
				ShapeName	=	"Agm114_MQ9",
					},
			[3]	=
			{
				Rotation	=	{-0, 0, -0.5},
				Position	=	{0.45, -0.18,  0.15},
				ShapeName	=	"Agm114_MQ9",
					},
	}
})
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		
	
	
