country_decisions = {
	persian_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			was_never_end_game_tag_trigger = yes
			NOT = { has_country_flag = formed_persia_flag }
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			OR = {
				is_free_or_tributary_trigger = yes
				ai = no
			}
			OR = {
				ai = no
				NOT = { exists = PER }
			}
			if = {
				limit = {
					OR = {
						tag = QAR
						was_tag = QAR
						tag = AKK
						was_tag = AKK
					}
					has_dlc = "King of Kings"
				}
				has_country_flag = turkoman_can_form_persia
			}
			NOT = { tag = MUG }
			NOT = { tag = PER }
			NOT = { tag = ERS }
			NOT = { tag = HLR }
			NOT = { tag = ROM }
			NOT = { tag = PAP }
			NOT = { tag = TUR }
			NOT = { tag = BYZ }
			NOT = { tag = ARB }
			if = {
				limit = { has_dlc = "King of Kings" }
				OR = {
					culture_group = iranian
					primary_culture = azerbaijani
					primary_culture = azeri_culture # Religions & Cultures Expanded
				}
			}
			else = {
				OR = {
					culture_group = iranian
					primary_culture = azerbaijani
					primary_culture = azeri_culture # Religions & Cultures Expanded
					tag = AKK
				}
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
		}
		provinces_to_highlight = {
			OR = {
				and = {
					root = { tag = TIM }
					or = {
						owned_by = TRS
						owned_by = AFG
						owned_by = SIS
						owned_by = FRS
						owned_by = KHO
						owned_by = QOM
						owned_by = LRI
						owned_by = ARD
					}
				}
				province_id = 414		# Hamadan
				province_id = 429		# Isfahan
				province_id = 433		# Yazd
				province_id = 2213		# Qom
				province_id = 2215		# Qazvin
				AND = {
					province_id = 426
					ROOT = { NOT = { owns_core_province = 2218 } }
				}
				AND = {
					province_id = 2218
					ROOT = { NOT = { owns_core_province = 426 } }
				}
				AND = {
					province_id = 416
					ROOT = { NOT = { owns_core_province = 432 } }
					ROOT = { NOT = { owns_core_province = 2221 } }
				}
				AND = {
					province_id = 432
					ROOT = { NOT = { owns_core_province = 416 } }
					ROOT = { NOT = { owns_core_province = 2221 } }
				}
				AND = {
					province_id = 2221
					ROOT = { NOT = { owns_core_province = 416 } }
					ROOT = { NOT = { owns_core_province = 432 } }
				}
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		}
		allow = {
			is_free_or_tributary_trigger = yes
			is_nomad = no
			is_at_war = no
			is_tribal = no
			NOT = { exists = PER }
			NOT = { exists = ERS }
			owns_core_province = 414		# Hamadan
			owns_core_province = 429		# Isfahan
			owns_core_province = 433		# Yazd
			owns_core_province = 2213		# Qom
			owns_core_province = 2215		# Qazvin
			OR = {
				owns_core_province = 426		# Amol
				owns_core_province = 2218		# Shiraz
			}
			OR = {
				owns_core_province = 416		# Tabriz
				owns_core_province = 432		# Kerman
				owns_core_province = 2221		# Mashhad
			}
			if = {
				limit = {
					tag = TIM
				}
				not = { exists = TRS }
				not = { exists = AFG }
				not = { exists = SIS }
				not = { exists = FRS }
				not = { exists = KHO }
				not = { exists = QOM }
				not = { exists = LRI }
				not = { exists = ARD }
			}
		}
		effect = {
			change_tag = PER
			swap_non_generic_missions = yes
			on_change_tag_effect = yes
			remove_non_electors_emperors_from_empire_effect = yes
			if = {
				limit = {
					NOT = { government = monarchy }
					is_revolutionary = no
				}
				change_government = monarchy
			}
			set_government_rank = 3
			if = {
				limit = { is_revolutionary = no NOT = { religion_group = zoroastrian_group } }
				add_government_reform = persian_government_reform
			}
			if = {
				limit = { is_revolutionary = no religion_group = zoroastrian_group }
				add_government_reform = zoroastrian_persian_government_reform
			}
			if = {
				limit = {
					has_reform = states_general_reform
				}
				remove_government_reform = states_general_reform
			}
			persia_region = {
				limit = {
					NOT = { owned_by = ROOT }
					NOT = { is_core = ROOT }
				}
				add_permanent_claim = PER
			}
			add_country_modifier = {
				name = "centralization_modifier"
				duration = 7300
			}
			add_prestige = 25
			# Religions & Cultures Expanded
			if = {
				limit = {
					primary_culture = azeri_culture
				}
				change_primary_culture = azerbaijani
				add_accepted_culture_or_dip_power = { culture = azeri_culture dip_reward = no free = yes }
			}
			# Vanilla (was an if, not an else_if)
			else_if = {
				limit = {
					OR = {
						NOT = { has_dlc = "King of Kings" }
						NOT = { primary_culture = mazandarani }
					}
					NOT = { primary_culture = persian }
				}
				change_primary_culture = persian
			}
			set_country_flag = formed_persia_flag
			if = {
				limit = { has_custom_ideas = no }
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
			if = {
				limit = { has_dlc = "King of Kings" }
				unlock_estate = {
					estate = estate_qizilbash
				}
			}

			if = {
				limit = {
					has_country_modifier = TIM_dev_cost_until_persia_formation
				}
				custom_tooltip = " "
				remove_country_modifier = TIM_dev_cost_until_persia_formation
			}
		}
		ai_will_do = {
			factor = 10
			modifier = {
				factor = 0
				NOT = {
					calc_true_if = {
						owns_core_province = 414		# Hamadan
						owns_core_province = 429		# Isfahan
						owns_core_province = 433		# Yazd
						owns_core_province = 2213		# Qom
						owns_core_province = 2215		# Qazvin
						OR = {
							owns_core_province = 426		# Amol
							owns_core_province = 2218		# Shiraz
						}
						OR = {
							owns_core_province = 416		# Tabriz
							owns_core_province = 432		# Kerman
							owns_core_province = 2221		# Mashhad
						}
						amount = 5
					}
				}
			}
		}
		ai_importance = 400
	}
	rename_to_iran = {
		potential = {
			or = {
				tag = ERS
				tag = PER
			}
			is_revolutionary = yes
			NOT = { has_country_flag = is_revolutionary_iran_flag }
		}
		allow = {
			is_at_war = no
		}
		effect = {
			restore_country_name = yes
			override_country_name = REV_IRAN_STRING
			set_country_flag = is_revolutionary_iran_flag
		}
		ai_will_do = {
			factor = 0
		}
		ai_importance = 0
	}
	rename_to_iran_non_rev = {
		potential = {
			or = {
				tag = ERS
				tag = PER
			}
			is_revolutionary = no
			NOT = { has_country_flag = is_iran_flag }
		}
		allow = {
			is_at_war = no
		}
		effect = {
			restore_country_name = yes
			override_country_name = IRAN_STRING
			set_country_flag = is_iran_flag
		}
		ai_will_do = {
			factor = 0
		}
		ai_importance = 0
	}
}
