set_leader_HOR = {

	if = { limit = { check_variable = { ruling_party = 6 } }
		if = { limit = { check_variable = { Conservative_leader = 0 } }
			set_variable = { Conservative_leader = 1 }
			kill_country_leader = yes

			create_country_leader = {
				name = "Aguila Saleh Issa"
				picture = "Emerging_HoR_Aguila_Saleh_Issa.dds"
				ideology = Conservative
				traits = {
					emerging_Conservative
				}
			}

			if = { limit = { has_country_flag = do_not_retire } subtract_from_variable = { Conservative_leader = 1 } }
			set_temp_variable = { b = 1 }
		}
	}
	else_if = { limit = { check_variable = { ruling_party = 10 } }
		if = { limit = { check_variable = { Kingdom_leader = 0 } }
			add_to_variable = { Kingdom_leader = 1 }
			hidden_effect = { kill_country_leader = yes }

			create_country_leader = {
				name = "Rabee al-Madkhali"
				picture = "Rabee_Madkhali.dds" 
				ideology = Kingdom
				traits = {
					salafist_Kingdom
					writer 
					opposes_muslim_brotherhood
				}
			}

			if = { limit = { has_country_flag = do_not_retire } subtract_from_variable = { Kingdom_leader = 1 } }
			set_temp_variable = { b = 1 } 
		} 
	}
	else_if = { limit = { check_variable = { ruling_party = 11 } }
		if = { limit = { check_variable = { Caliphate_leader = 0 } }
			add_to_variable = { Caliphate_leader = 1 }
			hidden_effect = { kill_country_leader = yes }

			create_country_leader = {
				name = "Abdelhakim Belhaj"
				picture = "gfx/leaders/LBA/Abdel_Hakim_Belhadj.dds" 
				ideology = Caliphate
				traits = {
					salafist_Caliphate
					guerrilla_leader
				}
			}

			if = { limit = { has_country_flag = do_not_retire } subtract_from_variable = { Caliphate_leader = 1 } }
			set_temp_variable = { b = 1 }
		}
	}
	else_if = { limit = { check_variable = { ruling_party = 7 } }
		if = { limit = { check_variable = { Autocracy_leader = 0 } }
			add_to_variable = { Autocracy_leader = 1 }
			hidden_effect = { kill_country_leader = yes }

			create_country_leader = {
				name = "Saif al-Islam Gaddafi" 
				picture = "gfx/leaders/LBA/Saif_al_Islam_Gaddafi.dds"
				ideology = Autocracy
				traits = {
					emerging_Autocracy
					ex_engineer
					humble
					Reformer
				}
			}

			if = { limit = { has_country_flag = do_not_retire } subtract_from_variable = { Autocracy_leader = 1 } }
			set_temp_variable = { b = 1 }
		} 
	} 
	else_if = { limit = { check_variable = { ruling_party = 22 } }
		if = { limit = { check_variable = { Nat_Autocracy_leader = 0 } }
			add_to_variable = { Nat_Autocracy_leader = 1 }
			hidden_effect = { kill_country_leader = yes }

			create_country_leader = {
				name = "Gen. Khalifa Hafter"
				picture = "HOR_Khalifa_Hafter.dds"
				ideology = Nat_Autocracy
				traits = {
					nationalist_Nat_Autocracy 
					military_career 
					political_dancer 
					ruthless 
					pro_american 
					pro_russia 
					opposes_muslim_brotherhood
				}
			}

			if = { limit = { has_country_flag = do_not_retire } subtract_from_variable = { Nat_Autocracy_leader = 1 } }
			set_temp_variable = { b = 1 }
		}
	}
}