country_decisions = {
	
	egyptian_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			NOT = { has_country_flag = formed_egypt_flag }
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { tag = HLR }
			NOT = { tag = PAP }
			NOT = { tag = EUR }
			NOT = { tag = TUR }
			NOT = { tag = ARB }
			NOT = { exists = EGY }
			NOT = { government = celestial_empire }
			primary_culture = al_misr_arabic
			capital = 361 # Cairo
			OR = {
				ai = no
				AND = {
					ai = yes
					num_of_cities = 3
				}
			}
		}
		allow = {
			adm_tech = 65
			is_free_or_tributary_trigger = yes
			is_nomad = no
			is_at_war = no
			owns_core_province = 361 # Cairo
			owns_core_province = 362 # Rashid
			owns_core_province = 363 # Dumyat
			owns_core_province = 358 # Alexandria
			owns_core_province = 359 # Faiyum
		}
		effect = {
			change_tag = EGY
			if = {
				limit = {
					is_part_of_hre = yes
					NOT = { has_country_modifier = european_union }
					is_elector = no
					is_emperor = no
				}
				every_owned_province = {
					limit = {
						is_part_of_hre = yes
					}
					set_in_empire = no
				}
			}
			if = {
				limit = {
					NOT = { government_rank = 2 }
				}
				set_government_rank = 2
			}
			add_prestige = 25
			change_government = despotic_monarchy
			add_country_modifier = {
				name = "centralization_modifier"
				duration = 7300
			}
			random_owned_province = {
				limit = { culture = al_misr_arabic }
				add_base_tax = 1
			}
			set_country_flag = formed_egypt_flag
		}
		ai_will_do = {
			factor = 1
		}
	}

}
