country_decisions = {

	moroccan_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { exists = MOR }
			NOT = { tag = TUN }
			NOT = { tag = TLC }
			NOT = { tag = ALG }
			NOT = { tag = PAP }
			NOT = { tag = HLR }
			NOT = { tag = EUR }
			OR = {
				primary_culture = moroccan
				AND = {
					primary_culture = berber
					capital_scope = { region = moroccan_region }
				}
			}
			OR = {
				ai = no
				AND = {
					ai = yes
					num_of_cities = 5	#Any big Moroccan tag will try to usurp the title
				}
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
		}
		allow = {
			adm_tech = 42
			is_at_war = no
			is_subject = no
			owns_core_province = 343 #Fez
			owns_core_province = 344 #Marrekech
			OR = {
				owns_core_province = 348 #Sus
				owns_core_province = 346 #Tafilalt
			}
		}
		effect = {
			change_tag = MOR
			moroccan_region = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_claim = MOR
			}
			add_prestige = 25
			set_capital = 344 #Marrekech
			change_government = despotic_monarchy #Desert tribes settling down, theocracies become monarchies.
			change_primary_culture = moroccan
			swap_free_idea_group = yes		#keep progress
		}
		ai_will_do = {
			factor = 1
		}
		ai_importance = 400
	}
	
	algiers_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { tag = MOR }
			NOT = { tag = TUN }
			NOT = { tag = TLC }
			NOT = { tag = ALG }
			NOT = { tag = PAP }
			NOT = { tag = HLR }
			NOT = { tag = EUR }
			OR = {
				primary_culture = algerian
				AND = {
					primary_culture = berber
					capital_scope = { region = algerian_region }
				}
			}
			OR = {
				ai = no
				AND = {
					NOT = { exists = ALG }
					ai = yes
					num_of_cities = 5
				}
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
		}
		allow = {
			NOT = { exists = ALG }
			is_at_war = no
			is_subject = no
			owns_core_province = 338 #Algiers
			owns_core_province = 2576 #Dahra
			OR = {
				owns_core_province = 336 #Tlemcen
				owns_core_province = 339 #Kabylia
			}
		}
		effect = {
			change_tag = ALG
			change_primary_culture = algerian
			algerian_region = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_claim = ALG
			}
			if = {
				limit = {
					is_tribal = yes	#Desert tribes settling down.
				}
				change_government = despotic_monarchy
			}
			add_prestige = 25
			set_capital = 338 #Algiers
			swap_free_idea_group = yes		#keep progress
		}
		ai_will_do = {
			factor = 1
		}
		ai_importance = 400
	}
	
	tunisian_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { tag = MOR }
			NOT = { tag = TUN }
			NOT = { tag = TLC }
			NOT = { tag = ALG }
			NOT = { tag = PAP }
			NOT = { tag = HLR }
			NOT = { tag = EUR }
			OR = {
				primary_culture = tunisian
				AND = {
					primary_culture = berber
					capital_scope = { region = tunisian_region }
				}
			}
			OR = {
				ai = no
				AND = {
					NOT = { exists = TUN }
					ai = yes
					num_of_cities = 5
				}
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
		}
		allow = {
			NOT = { exists = TUN }
			is_at_war = no
			is_subject = no
			owns_core_province = 341 #Tunis
			owns_core_province = 2584 #Souss
			OR = {
				owns_core_province = 2583 #Kef
				owns_core_province = 354 #Tripoli
			}
		}
		effect = {
			change_tag = TUN
			change_primary_culture = tunisian
			tunisian_region = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_claim = TUN
			}
			if = {
				limit = {
					is_tribal = yes
				}
				change_government = despotic_monarchy #Desert tribes settling down.
			}
			add_prestige = 25
			set_capital = 341
			swap_free_idea_group = yes		#keep progress
		}
		ai_will_do = {
			factor = 1
		}
		ai_importance = 400
	}
	
	tripoli_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { tag = MOR }
			NOT = { tag = TUN }
			NOT = { tag = TLC }
			NOT = { tag = ALG }
			NOT = { tag = TRP }
			NOT = { tag = PAP }
			NOT = { tag = HLR }
			NOT = { tag = EUR }
			OR = {
				primary_culture = tunisian
				primary_culture = berber
			}
			capital_scope = {
				region = tripoli_region
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
		}
		allow = {
			NOT = { exists = TRP }
			is_at_war = no
			is_subject = no
			owns_core_province = 354 #Tripoli
			owns_core_province = 2589 #Thubaqt
			OR = {
				owns_core_province = 355 #Sirt
				owns_core_province = 353 #Djerba
			}
		}
		effect = {
			change_tag = TRP
			change_primary_culture = tunisian
			tripoli_region = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_claim = TRP
			}
			if = {
				limit = {
					is_tribal = yes #Desert tribes settling down.
				}
				change_government = despotic_monarchy
			}
			add_prestige = 25
			set_capital = 354 #Tripoli
			swap_free_idea_group = yes		#keep progress
		}
		ai_will_do = {
			factor = 1
		}
		#ai_importance = 400
	}
	
}
