_f18 = _this select 0

?!(local _f18): exit

;;remove weapons (whew, long list!)

_f18 removeweapon "fz_f18_aim9x_2"
_f18 removeweapon "fz_f18_aim9m_2"
_f18 removeweapon "fz_f18_aim9p_2"
_f18 removeweapon "fz_f18_aim120_6"
_f18 removeweapon "fz_f18_aim120_4"
_f18 removeweapon "fz_f18_aim120_8"
_f18 removeweapon "fz_f18_aim120_10"
_f18 removeweapon "fz_f18_aim120"
_f18 removeweapon "fz_f18_aim120_outrk"
_f18 removeweapon "fz_f18_aim120_1"
_f18 removeweapon "fz_f18_aim7"
_f18 removeweapon "fz_f18_aim7_1"
_f18 removeweapon "fz_f18_aim7_3"
_f18 removeweapon "fz_f18_aim7_4"
_f18 removeweapon "fz_f18_mk82hd"
_f18 removeweapon "fz_f18_mk82hd_4"
_f18 removeweapon "fz_f18_mk82hd_8"
_f18 removeweapon "fz_f18_mk82hd_10"
_f18 removeweapon "fz_f18_mk83hd"
_f18 removeweapon "fz_f18_mk83hd_4"
_f18 removeweapon "fz_f18_mk83hd_8"
_f18 removeweapon "fz_f18_mk83hd_10"
_f18 removeweapon "fz_f18_agm65e"
_f18 removeweapon "fz_f18_agm65e_4"
_f18 removeweapon "fz_f18_agm65e_6"
_f18 removeweapon "fz_f18_rockeye_8"
_f18 removeweapon "fz_f18_rockeye_4"
_f18 removeweapon "fz_f18_rockeye_10"
_f18 removeweapon "fz_f18_rockeye"
_f18 removeweapon "fz_f18_mk84_4"
_f18 removeweapon "fz_f18_mk84_2"
_f18 removeweapon "fz_f18_zuni_8"
_f18 removeweapon "fz_f18_zuni_16"
_f18 removeweapon "fz_f18_gbu10_4"
_f18 removeweapon "fz_f18_gbu10_2"
_f18 removeweapon "fz_f18_agm88"
_f18 removeweapon "fz_f18_agm88_4"
_f18 removeweapon "fz_f18_agm88_6"
_f18 removeweapon "fz_f18_jsow_4"
_f18 removeweapon "fz_f18_jsow_2"
_f18 removeweapon "fz_f18_gbu12"
_f18 removeweapon "fz_f18_gbu12_4"
_f18 removeweapon "fz_f18_gbu12_8"
_f18 removeweapon "fz_f18_gbu12_10"
_f18 removeweapon "fz_f18_gbu16"
_f18 removeweapon "fz_f18_gbu16_4"
_f18 removeweapon "fz_f18_gbu16_8"
_f18 removeweapon "fz_f18_gbu16_10"
_f18 removeweapon "fz_f18_agm84_4"
_f18 removeweapon "fz_f18_agm84_2"

_f18 removemagazine "fz_f18_aim9x_2"
_f18 removemagazine "fz_f18_aim9m_2"
_f18 removemagazine "fz_f18_aim9p_2"
_f18 removemagazine "fz_f18_aim120_6"
_f18 removemagazine "fz_f18_aim120_4"
_f18 removemagazine "fz_f18_aim120_8"
_f18 removemagazine "fz_f18_aim120_10"
_f18 removemagazine "fz_f18_aim120"
_f18 removemagazine "fz_f18_aim120_outrk"
_f18 removemagazine "fz_f18_aim120_1"
_f18 removemagazine "fz_f18_mk82hd"
_f18 removemagazine "fz_f18_mk82hd_4"
_f18 removemagazine "fz_f18_mk82hd_8"
_f18 removemagazine "fz_f18_mk82hd_10"
_f18 removemagazine "fz_f18_mk83hd"
_f18 removemagazine "fz_f18_mk83hd_4"
_f18 removemagazine "fz_f18_mk83hd_8"
_f18 removemagazine "fz_f18_mk83hd_10"
_f18 removemagazine "fz_f18_mk82ld"
_f18 removemagazine "fz_f18_mk82ld_4"
_f18 removemagazine "fz_f18_mk82ld_8"
_f18 removemagazine "fz_f18_mk82ld_10"
_f18 removemagazine "fz_f18_mk83ld"
_f18 removemagazine "fz_f18_mk83ld_4"
_f18 removemagazine "fz_f18_mk83ld_8"
_f18 removemagazine "fz_f18_mk83ld_10"
_f18 removemagazine "fz_f18_agm65e"
_f18 removemagazine "fz_f18_agm65e_4"
_f18 removemagazine "fz_f18_agm65e_6"
_f18 removemagazine "fz_f18_rockeye_8"
_f18 removemagazine "fz_f18_rockeye_4"
_f18 removemagazine "fz_f18_rockeye_10"
_f18 removemagazine "fz_f18_rockeye"
_f18 removemagazine "fz_f18_cbu78_8"
_f18 removemagazine "fz_f18_cbu78_4"
_f18 removemagazine "fz_f18_cbu78_10"
_f18 removemagazine "fz_f18_cbu78"
_f18 removemagazine "fz_f18_mk84_4"
_f18 removemagazine "fz_f18_mk84_2"
_f18 removemagazine "fz_f18_zuni_8"
_f18 removemagazine "fz_f18_zuni_16"
_f18 removemagazine "fz_f18_gbu10_4"
_f18 removemagazine "fz_f18_gbu10_2"
_f18 removemagazine "fz_f18_gbu12"
_f18 removemagazine "fz_f18_gbu12_4"
_f18 removemagazine "fz_f18_gbu12_8"
_f18 removemagazine "fz_f18_gbu12_10"
_f18 removemagazine "fz_f18_gbu16"
_f18 removemagazine "fz_f18_gbu16_4"
_f18 removemagazine "fz_f18_gbu16_8"
_f18 removemagazine "fz_f18_gbu16_10"
_f18 removemagazine "fz_f18_agm88"
_f18 removemagazine "fz_f18_agm88_4"
_f18 removemagazine "fz_f18_agm88_6"
_f18 removemagazine "fz_f18_aim7"
_f18 removemagazine "fz_f18_aim7_1"
_f18 removemagazine "fz_f18_aim7_3"
_f18 removemagazine "fz_f18_aim7_4"
_f18 removemagazine "fz_f18_jsow_4"
_f18 removemagazine "fz_f18_jsow_2"
_f18 removemagazine "fz_f18_agm84d_4"
_f18 removemagazine "fz_f18_agm84d_2"
_f18 removemagazine "fz_f18_agm84h_4"
_f18 removemagazine "fz_f18_agm84h_2"

;;_f18 vehiclechat "Standby. Loading weapons."
ctrlSetText [123, "LOADING..."]
~2

;;add weapons

;;4 wing pylon weapons and fuse
?(hp3wep == 1 and hp2wep == 3 and hp1wep == 2): _f18 addmagazine "fz_f18_mk82hd_10"; _f18 addweapon "fz_f18_mk82hd_10"
?(hp3wep == 3 and hp2wep == 4 and hp1wep == 3): _f18 addmagazine "fz_f18_mk83hd_10"; _f18 addweapon "fz_f18_mk83hd_10"
?(hp3wep == 2 and hp2wep == 5 and hp1wep == 4): _f18 addmagazine "fz_f18_rockeye_10"; _f18 addweapon "fz_f18_rockeye_10"
?(hp3wep == 6 and hp2wep == 11 and hp1wep == 11): _f18 addmagazine "fz_f18_cbu78_10"; _f18 addweapon "fz_f18_rockeye_10"
?(hp3wep == 4 and hp2wep == 8 and hp1wep == 7): _f18 addmagazine "fz_f18_agm65e_6"; _f18 addweapon "fz_f18_agm65e_6"
?(hp2wep == 6 and hp1wep == 5): _f18 addmagazine "fz_f18_mk84_4"; _f18 addweapon "fz_f18_mk84_4"
?(hp2wep == 7 and hp1wep == 6): _f18 addmagazine "fz_f18_gbu10_4"; _f18 addweapon "fz_f18_gbu10_4"
?(hp2wep == 10 and hp1wep == 10): _f18 addmagazine "fz_f18_jsow_4"; _f18 addweapon "fz_f18_jsow_4"
?(hp2wep == 9 and hp1wep == 8 and hp3wep == 5): _f18 addmagazine "fz_f18_agm88_6"; _f18 addweapon "fz_f18_agm88_6"
?(hp1wep == 1 and hp2wep == 1 and leftfusewep == 1 and rightfusewep == 1): _f18 addmagazine "fz_f18_aim120_10"; _f18 addweapon "fz_f18_aim120_10"
?(hp2wep == 2 and leftfusewep == 2 and rightfusewep == 2): _f18 addmagazine "fz_f18_aim7_4"; _f18 addweapon "fz_f18_aim7_4"
?(hp2wep == 2 and leftfusewep != 2 and rightfusewep == 2): _f18 addmagazine "fz_f18_aim7_3"; _f18 addweapon "fz_f18_aim7_3"
?(hp2wep == 16 and hp1wep == 15): _f18 addmagazine "fz_f18_agm84h_4"; _f18 addweapon "fz_f18_agm84_4"
?(hp2wep == 15 and hp1wep == 14): _f18 addmagazine "fz_f18_agm84d_4"; _f18 addweapon "fz_f18_agm84_4"
;;gbu16s
?(hp3wep == 8 and hp2wep == 14 and hp1wep == 13): _f18 addmagazine "fz_f18_gbu16_10"; _f18 addweapon "fz_f18_gbu16_10"
;;gbu12s
?(hp3wep == 7 and hp2wep == 13 and hp1wep == 12): _f18 addmagazine "fz_f18_gbu12_10"; _f18 addweapon "fz_f18_gbu12_10"
;;two inner pylons
?(hp1wep == 1 and hp2wep == 1 and leftfusewep != 1): _f18 addmagazine "fz_f18_aim120_8"; _f18 addweapon "fz_f18_aim120_8"
?(hp3wep != 4 and hp2wep == 8 and hp1wep == 7): _f18 addmagazine "fz_f18_agm65e_4"; _f18 addweapon "fz_f18_agm65e_4"
?(hp3wep == 4 and hp2wep != 8 and hp1wep == 7): _f18 addmagazine "fz_f18_agm65e_4"; _f18 addweapon "fz_f18_agm65e_4"
?(hp3wep == 4 and hp2wep == 8 and hp1wep != 7): _f18 addmagazine "fz_f18_agm65e_4"; _f18 addweapon "fz_f18_agm65e_4"
?(hp3wep != 1 and hp2wep == 3 and hp1wep == 2): _f18 addmagazine "fz_f18_mk82hd_8"; _f18 addweapon "fz_f18_mk82hd_8"
?(hp3wep != 3 and hp2wep == 4 and hp1wep == 3): _f18 addmagazine "fz_f18_mk83hd_8"; _f18 addweapon "fz_f18_mk83hd_8"
?(hp3wep != 2 and hp2wep == 5 and hp1wep == 4): _f18 addmagazine "fz_f18_rockeye_8"; _f18 addweapon "fz_f18_rockeye_8"
?(hp3wep != 6 and hp2wep == 11 and hp1wep == 11): _f18 addmagazine "fz_f18_cbu78_8"; _f18 addweapon "fz_f18_rockeye_8"
?(hp2wep == 9 and hp1wep == 8 and hp3wep != 5): _f18 addmagazine "fz_f18_agm88_4"; _f18 addweapon "fz_f18_agm88_4"
?(hp2wep != 9 and hp1wep == 8 and hp3wep == 5): _f18 addmagazine "fz_f18_agm88_4"; _f18 addweapon "fz_f18_agm88_4"
?(hp2wep == 9 and hp1wep != 8 and hp3wep == 5): _f18 addmagazine "fz_f18_agm88_4"; _f18 addweapon "fz_f18_agm88_4"
;;gbu16s
?(hp3wep != 8 and hp2wep == 14 and hp1wep == 13): _f18 addmagazine "fz_f18_gbu16_8"; _f18 addweapon "fz_f18_gbu16_8"
;;gbu12s
?(hp3wep != 7 and hp2wep == 13 and hp1wep == 12): _f18 addmagazine "fz_f18_gbu12_8"; _f18 addweapon "fz_f18_gbu12_8"
;;agm84
?(hp2wep == 15 and hp1wep != 14): _f18 addmagazine "fz_f18_agm84d_2"; _f18 addweapon "fz_f18_agm84_2"
?(hp2wep == 16 and hp1wep != 15): _f18 addmagazine "fz_f18_agm84h_2"; _f18 addweapon "fz_f18_agm84_2"
;;innermost pylons
?(hp3wep != 4 and hp2wep != 8 and hp1wep == 7): _f18 addmagazine "fz_f18_agm65e"; _f18 addweapon "fz_f18_agm65e"
?(hp2wep != 3 and hp1wep == 2): _f18 addmagazine "fz_f18_mk82hd_4"; _f18 addweapon "fz_f18_mk82hd_4"
?(hp2wep != 4 and hp1wep == 3): _f18 addmagazine "fz_f18_mk83hd_4"; _f18 addweapon "fz_f18_mk83hd_4"
?(hp2wep != 5 and hp1wep == 4): _f18 addmagazine "fz_f18_rockeye_4"; _f18 addweapon "fz_f18_rockeye_4"
?(hp2wep != 11 and hp1wep == 11): _f18 addmagazine "fz_f18_cbu78_4"; _f18 addweapon "fz_f18_rockeye_4"
?(hp2wep != 6 and hp1wep == 5): _f18 addmagazine "fz_f18_mk84_2"; _f18 addweapon "fz_f18_mk84_2"
?(hp2wep != 7 and hp1wep == 6): _f18 addmagazine "fz_f18_gbu10_2"; _f18 addweapon "fz_f18_gbu10_2"
?(hp2wep != 10 and hp1wep == 10): _f18 addmagazine "fz_f18_jsow_2"; _f18 addweapon "fz_f18_jsow_2"
?(hp2wep != 9 and hp1wep == 8 and hp3wep != 5): _f18 addmagazine "fz_f18_agm88"; _f18 addweapon "fz_f18_agm88"
?(hp2wep != 1 and hp1wep == 1 and leftfusewep != 1): _f18 addmagazine "fz_f18_aim120_4"; _f18 addweapon "fz_f18_aim120_4"
?(hp2wep != 1 and hp1wep == 1 and leftfusewep == 1): _f18 addmagazine "fz_f18_aim120_6"; _f18 addweapon "fz_f18_aim120_6"
;;gbu16s
?(hp3wep == 8 and hp2wep != 14 and hp1wep == 13): _f18 addmagazine "fz_f18_gbu16_4"; _f18 addweapon "fz_f18_gbu16_4"
?(hp3wep != 8 and hp2wep != 14 and hp1wep == 13): _f18 addmagazine "fz_f18_gbu16_4"; _f18 addweapon "fz_f18_gbu16_4"
;;gbu12s
?(hp3wep != 7 and hp2wep != 13 and hp1wep == 12): _f18 addmagazine "fz_f18_gbu12_4"; _f18 addweapon "fz_f18_gbu12_4"
?(hp3wep == 7 and hp2wep != 13 and hp1wep == 12): _f18 addmagazine "fz_f18_gbu12_4"; _f18 addweapon "fz_f18_gbu12_4"
;;agm84
?(hp1wep == 14 and hp2wep != 15): _f18 addmagazine "fz_f18_agm84d_2"; _f18 addweapon "fz_f18_agm84_2"
?(hp1wep == 15 and hp2wep != 16): _f18 addmagazine "fz_f18_agm84h_2"; _f18 addweapon "fz_f18_agm84_2"
;;mid pylons
?(hp3wep != 4 and hp2wep == 8 and hp1wep != 7): _f18 addmagazine "fz_f18_agm65e"; _f18 addweapon "fz_f18_agm65e"
?(hp2wep == 3 and hp1wep != 2): _f18 addmagazine "fz_f18_mk82hd_4"; _f18 addweapon "fz_f18_mk82hd_4"
?(hp2wep == 4 and hp1wep != 3): _f18 addmagazine "fz_f18_mk83hd_4"; _f18 addweapon "fz_f18_mk83hd_4"
?(hp2wep == 5 and hp1wep != 4): _f18 addmagazine "fz_f18_rockeye_4"; _f18 addweapon "fz_f18_rockeye_4"
?(hp2wep == 11 and hp1wep != 11): _f18 addmagazine "fz_f18_cbu78_4"; _f18 addweapon "fz_f18_rockeye_4"
?(hp2wep == 6 and hp1wep != 5): _f18 addmagazine "fz_f18_mk84_2"; _f18 addweapon "fz_f18_mk84_2"
?(hp2wep == 7 and hp1wep != 6): _f18 addmagazine "fz_f18_gbu10_2"; _f18 addweapon "fz_f18_gbu10_2"
?(hp2wep == 10 and hp1wep != 10): _f18 addmagazine "fz_f18_jsow_2"; _f18 addweapon "fz_f18_jsow_2"
?(hp2wep == 9 and hp1wep != 8 and hp3wep != 5): _f18 addmagazine "fz_f18_agm88"; _f18 addweapon "fz_f18_agm88"
?(hp2wep == 1 and hp1wep != 1 and leftfusewep != 1): _f18 addmagazine "fz_f18_aim120_4"; _f18 addweapon "fz_f18_aim120_4"
?(hp2wep == 1 and hp1wep != 1 and leftfusewep == 1): _f18 addmagazine "fz_f18_aim120_6"; _f18 addweapon "fz_f18_aim120_6"
?(hp2wep == 2 and leftfusewep != 2 and rightfusewep != 2): _f18 addmagazine "fz_f18_aim7"; _f18 addweapon "fz_f18_aim7"
;;gbu16s
?(hp3wep != 8 and hp2wep == 14 and hp1wep != 13): _f18 addmagazine "fz_f18_gbu16_4"; _f18 addweapon "fz_f18_gbu16_4"
?(hp3wep == 8 and hp2wep == 14 and hp1wep != 13): _f18 addmagazine "fz_f18_gbu16_4"; _f18 addweapon "fz_f18_gbu16_4"
;;gbu12s
?(hp3wep != 7 and hp2wep == 13 and hp1wep != 12): _f18 addmagazine "fz_f18_gbu12_4"; _f18 addweapon "fz_f18_gbu12_4"
?(hp3wep == 7 and hp2wep == 13 and hp1wep != 12): _f18 addmagazine "fz_f18_gbu12_4"; _f18 addweapon "fz_f18_gbu12_4"
;;outer pylons
?(hp3wep == 4 and hp2wep != 8 and hp1wep != 7): _f18 addmagazine "fz_f18_agm65e"; _f18 addweapon "fz_f18_agm65e"
?(hp3wep == 1 and hp2wep != 3 and hp1wep != 2 or hp3wep == 1 and hp2wep != 3 and hp1wep == 2 or hp3wep == 1 and hp2wep == 3 and hp1wep != 2): _f18 addmagazine "fz_f18_mk82hd"; _f18 addweapon "fz_f18_mk82hd"
?(hp3wep == 3 and hp2wep != 4 and hp1wep != 3): _f18 addmagazine "fz_f18_mk83hd"; _f18 addweapon "fz_f18_mk83hd"
?(hp3wep == 3 and hp2wep == 4 and hp1wep != 3): _f18 addmagazine "fz_f18_mk83hd"; _f18 addweapon "fz_f18_mk83hd"
?(hp3wep == 3 and hp2wep != 4 and hp1wep == 3): _f18 addmagazine "fz_f18_mk83hd"; _f18 addweapon "fz_f18_mk83hd"
?(hp3wep == 2 and hp2wep != 5 and hp1wep != 4 or hp3wep == 2 and hp2wep == 5 and hp1wep != 4 or hp3wep == 2 and hp2wep != 5 and hp1wep == 4): _f18 addmagazine "fz_f18_rockeye"; _f18 addweapon "fz_f18_rockeye"
?(hp3wep == 6 and hp2wep == 11 and hp1wep != 11 or hp3wep == 6 and hp1wep == 11 and hp2wep != 11 or hp3wep == 6 and hp1wep != 11 and hp2wep != 11): _f18 addmagazine "fz_f18_cbu78"; _f18 addweapon "fz_f18_rockeye"
?(hp3wep == 5 and hp2wep != 9 and hp1wep != 8): _f18 addmagazine "fz_f18_agm88"; _f18 addweapon "fz_f18_agm88"
;;gbu16s
?(hp3wep == 8 and hp2wep != 14 and hp1wep != 13): _f18 addmagazine "fz_f18_gbu16"; _f18 addweapon "fz_f18_gbu16"
?(hp3wep == 8 and hp2wep == 14 and hp1wep != 13): _f18 addmagazine "fz_f18_gbu16"; _f18 addweapon "fz_f18_gbu16"
?(hp3wep == 8 and hp2wep != 14 and hp1wep == 13): _f18 addmagazine "fz_f18_gbu16"; _f18 addweapon "fz_f18_gbu16"
;;gbu12s
?(hp3wep == 7 and hp2wep != 13 and hp1wep != 12): _f18 addmagazine "fz_f18_gbu12"; _f18 addweapon "fz_f18_gbu12"
?(hp3wep == 7 and hp2wep == 13 and hp1wep != 12): _f18 addmagazine "fz_f18_gbu12"; _f18 addweapon "fz_f18_gbu12"
?(hp3wep == 7 and hp2wep != 13 and hp1wep == 12): _f18 addmagazine "fz_f18_gbu12"; _f18 addweapon "fz_f18_gbu12"
;;aim120
?(hp3wep == 9): _f18 addmagazine "fz_f18_aim120_outrk"; _f18 addweapon "fz_f18_aim120_outrk"
;;fuselage points
?(rightfusewep == 1 and leftfusewep != 1): _f18 addmagazine "fz_f18_aim120_1"; _f18 addweapon "fz_f18_aim120_1"
?(rightfusewep == 2 and leftfusewep != 2 and hp2wep !=2): _f18 addmagazine "fz_f18_aim7_1"; _f18 addweapon "fz_f18_aim7_1"
?(rightfusewep == 1 and leftfusewep == 1 and hp1wep != 1 and hp2wep != 1): _f18 addmagazine "fz_f18_aim120"; _f18 addweapon "fz_f18_aim120"
?(hp2wep != 2 and rightfusewep == 2 and leftfusewep == 2): _f18 addmagazine "fz_f18_aim7"; _f18 addweapon "fz_f18_aim7"
?(wingtipwep == 1): _f18 addmagazine "fz_f18_aim9x_2"; _f18 addweapon "fz_f18_aim9x_2"
?(wingtipwep == 2): _f18 addmagazine "fz_f18_aim9m_2"; _f18 addweapon "fz_f18_aim9m_2"
;;center pylon
?(cntrtnk == 0): _f18 animate ["auxtank_switch",0.7]
?(cntrtnk == 1): _f18 animate ["auxtank_switch",0.5]
?(cntrtnk == 3): _f18 animate ["auxtank_switch",0]
?(cntrtnk == 4): _f18 animate ["auxtank_switch",0.4]
?(cntrtnk == 5): _f18 animate ["auxtank_switch",0.2]
?(cntrtnk == 6): _f18 animate ["auxtank_switch",0.25]

ctrlSetText [123, "PREPARING FCS..."]
~1
?(cntrtnk == 0): _f18 animate ["auxtank_switch",0.5]
ctrlSetText [123, "FIT CHECK..."]
~1
?(cntrtnk == 0): _f18 animate ["auxtank_switch",0.7]
ctrlSetText [123, "ARMING..."]
~1
?(cntrtnk == 0): _f18 animate ["auxtank_switch",0.75]
ctrlSetText [123, "READY!"]
exit

#aim120_10
;;addweps

exit

#aim120_8
;;addweps

exit