country_decisions = {
    xorme_ai_easy_formables_MAM_RUM = {
		major = yes
		potential = {
			ai = yes
			normal_or_historical_nations = yes
			was_never_end_game_tag_trigger = yes
			NOT = { has_country_flag = formed_rum_flag }
			tag = MAM
		}

		allow = {
			total_development = 750
			is_at_war = no
			is_nomad = no
			religion_group = muslim
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 20
				culture = turkish
			}
		}

		effect = {
			change_primary_culture = turkish
			change_tag = RUM
			on_change_tag_effect = yes
			restore_country_name = yes
			RUM = {
				if = {
					limit = {
						NOT = { government = monarchy }
						is_revolutionary = no
					}
					change_government = monarchy
				}
				if = {
					limit = { is_revolutionary = no }
					add_government_reform = sultanate_of_rum_reform
				}
			}
			remove_non_electors_emperors_from_empire_effect = yes
			if = {
				limit = {
					NOT = { government_rank = 2 }
				}
				set_government_rank = 2
			}
			anatolia_region = {
				limit = {
					NOT = { owned_by = ROOT }
					NOT = { is_core = ROOT }
				}
				add_permanent_claim = RUM
			}
			add_country_modifier = {
				name = "centralization_modifier"
				duration = 7300
			}
			if = {
				limit = { has_custom_ideas = no }
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
			add_prestige = 25
			set_country_flag = formed_rum_flag
			swap_non_generic_missions = yes
		}
		ai_will_do = {
			factor = 100
		}
		ai_importance = 400
	}
}