#高昌
establish_tarim_supremacy_decision = {
	picture = {
		reference = "gfx/interface/illustrations/dunhuang.dds"
	}
	decision_group_type = major
	desc = establish_tarim_supremacy_decision_desc

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county
		OR = {
			culture = { has_cultural_pillar = heritage_turkic }
			culture = { has_cultural_pillar = heritage_mongolic }
			culture = { has_cultural_pillar = heritage_chinese }
			}
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:establish_tarim_supremacy_decision
			}
		}
	}

	is_valid = {
		completely_controls = title:d_kara_khoja
		custom_description = {
			text = "is_king_or_emperor"
			highest_held_title_tier >= tier_duchy
		}
		OR = {
			religion = religion:zoroastrianism_religion
			religion = religion:buddhism_religion
			faith = faith:manichean
			faith = faith:nestorian
		}
		prestige_level >= 2
		OR = {
			government_has_flag = government_is_feudal
			government_has_flag = government_is_clan
			government_allows = administrative
			government_has_flag = government_is_tribal
			government_has_flag = government_is_landless_adventurer
		}
		capital_province = {
			geographical_region = world_steppe
	}
}

	is_valid_showing_failures_only = {
		is_landed = yes
		is_adult = yes
		is_available = yes
		is_independent_ruler = yes
		is_at_war = no
	}

	cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:establish_tarim_supremacy_decision
		}

	 

		establish_tarim_supremacy_effect = yes

		# trigger_event = qayan.0011

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100
	}
}

#回鹘
Uyghur_qayan_decision = {
	picture = {
		reference = "gfx/interface/illustrations/uyghurking.dds"
	}
	decision_group_type = major
	desc = Uyghur_qayan_decision_desc

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county
		culture = {
			OR = {
				this = culture:yughur
				this = culture:uyghur
				any_parent_culture_or_above = {
					OR = {
						this = culture:yughur
						this = culture:uyghur
					}
				}
			}
		}
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:Uyghur_qayan_decision
			}
		}
	}

	is_valid = {

		any_held_title = {
						count >= 3
						tier = tier_kingdom
					}
		OR = {
		completely_controls = title:k_mongolia
		completely_controls = title:k_dzungaria
		completely_controls = title:k_khotan
		completely_controls = title:k_xia
        completely_controls = title:k_syr_darya
		completely_controls = title:k_zhetysu
		completely_controls = title:k_kipchak
		completely_controls = title:k_tuva
	    }
		custom_description = {
			# text = "is_king_or_emperor"
			highest_held_title_tier >= tier_kingdom
		}
		OR = {
			religion = religion:buddhism_religion
			faith = faith:manichean
			faith = faith:tengri_pagan
			has_trait = Dinavari
		}
		prestige_level >= 3
		OR = {
			government_has_flag = government_is_feudal
			government_has_flag = government_is_clan
            government_has_flag = government_is_tribal
			government_has_flag = government_is_landless_adventurer
		}
		capital_province = {
			geographical_region = world_steppe
	}
}
	is_valid_showing_failures_only = {
		is_landed = yes
		is_adult = yes
		is_available = yes
		is_independent_ruler = yes
		is_at_war = no
	}

	cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:Uyghur_qayan_decision
		}


		Uyghur_qayan_effect = yes

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100
	}
}
#金山
xihan_jinshan_decision = {
	picture = {
		reference = "gfx/interface/illustrations/jinchang.dds"
	}
	decision_group_type = major
	desc = xihan_jinshan_decision_desc

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county
		culture = {
			OR = {
				this = culture:han
				any_parent_culture_or_above = {
					OR = {
						this = culture:han
					}
				}
			}
		}
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:xihan_jinshan_decision
			}
		}
	}

	is_valid = {
		OR = {
			completely_controls = title:d_liangzhou
			completely_controls = title:d_ganzhou
			completely_controls = title:d_guiyi
			}
		custom_description = {
			highest_held_title_tier >= tier_duchy
		}

		prestige_level >= 3

		OR = {
			government_has_flag = government_is_feudal
			government_allows = administrative
			government_has_flag = government_is_landless_adventurer
		}
		capital_province = {
			geographical_region = world_steppe
	}
}
	is_valid_showing_failures_only = {
		is_landed = yes
		is_adult = yes
		is_available = yes
		is_independent_ruler = yes
		is_at_war = no
	}

	cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:xihan_jinshan_decision
		}

		xihan_jinshan_effect = yes

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100
	}
}
#斡耳朵八里
Uyghur_Karabalgasun_decision = {
	picture = {
		reference = "gfx/interface/illustrations/Rebuild.dds"
	}
	desc = Uyghur_Karabalgasun_decision_desc
	decision_group_type = major

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county


		OR = {
		culture = { has_cultural_pillar = heritage_turkic }
		culture = { has_cultural_pillar = heritage_mongolic }
	    }

		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:uyghur_buddhism_followers_decision
			}
		}
	}

	is_valid = {

		piety_level >= 2
		prestige_level >= 2

		completely_controls = title:c_karabalgasun
	}	
	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes
		is_at_war = no
	}

	cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = Uyghur_Karabalgasun_modifier
		}

		karabalgasun_effect = yes

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100	
	}
}
#甘州
ganzhou_uyghur_decision = {
	picture = {
		reference = "gfx/interface/illustrations/huihugongzhu.dds"
	}
	decision_group_type = major
	desc = ganzhou_uyghur_decision_desc

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county
		culture = {
			OR = {
				this = culture:yughur
				this = culture:uyghur
				any_parent_culture_or_above = {
					OR = {
						this = culture:yughur
						this = culture:uyghur
					}
				}
			}
		}
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:ganzhou_uyghur_decision
			}
		}
	}

	is_valid = {
		completely_controls = title:d_yijinai
		custom_description = {
			# text = "is_king_or_emperor"
			highest_held_title_tier >= tier_duchy
		}
	    OR = {
		religion = religion:buddhism_religion
		faith = faith:manichean
		faith = faith:tengri_pagan
	    }

		prestige_level >= 2

		OR = {
			government_has_flag = government_is_feudal
			government_has_flag = government_is_clan
            government_has_flag = government_is_tribal
			government_has_flag = government_is_landless_adventurer
		}
		capital_province = {
			geographical_region = world_steppe
	}
}
	is_valid_showing_failures_only = {
		is_landed = yes
		is_adult = yes
		is_available = yes
		is_independent_ruler = yes
		is_at_war = no
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:ganzhou_uyghur_decision
		}


       ganzhou_uyghur_effect = yes

       save_scope_as = ganzhou

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100	
	}
}

#吐火罗叶护国
tocharian_yabghu_decision = {
	picture = {
		reference = "gfx/interface/illustrations/tuhuoluo.dds"
	}
	decision_group_type = major
	desc = tocharian_yabghu_decision_desc

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county
        current_year >= 750
		OR = {
			culture = { has_cultural_pillar = heritage_turkic }
			culture = { has_cultural_pillar = heritage_mongolic }
			}

		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:tocharian_yabghu_decision
			}
		}
	}

	is_valid = {
		completely_controls = title:d_kabul
		completely_controls = title:d_zabulistan

		highest_held_title_tier >= tier_kingdom

		OR = {
			religion = religion:buddhism_religion
			faith = faith:tengri_pagan
			has_trait =ashina_descendant
		}
		prestige_level >= 3
}
	is_valid_showing_failures_only = {
		is_landed = yes
		is_adult = yes
		is_available = yes
		is_independent_ruler = yes
		is_at_war = no
	}

	cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:tocharian_yabghu_decision
		}


		tocharian_yabghu_effect = yes

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100
	}
}

#景教

nestorianism_followers_decision = {
	picture = {
		reference = "gfx/interface/illustrations/jingjiao.dds"
	}
	decision_group_type = major
	desc = nestorianism_followers_decision_desc

	ai_check_interval = 120
    
	is_shown = {
		highest_held_title_tier >= tier_county

		faith = faith:nestorian

		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nestorianism_followers_decision
			}
		}
	}

	is_valid = {

        piety_level >= 4
   
		prestige_level >= 2
		
		faith = faith:nestorian

		custom_description = {
			highest_held_title_tier >= tier_duchy
		}
	    OR = {
		completely_controls = title:d_kara_khoja #Many Nestorian scriptures have been discovered in the Gaochang area
		prestige_level >= 3
	}
}
	is_valid_showing_failures_only = {
		is_landed = yes
		is_adult = yes
		is_available = yes
		is_independent_ruler = yes
		is_at_war = no
	}

	cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:nestorianism_followers_decision
		}

		nestorianism_followers_effect = yes

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100	
	}
}


#摩尼教
manichaeism_followers_decision = {
	picture = {
		reference = "gfx/interface/illustrations/Mani.dds"
	}
	desc = manichaeism_followers_decision_desc
	decision_group_type = major

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county

		faith = faith:manichean

		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:manichaeism_followers_decision
			}
		}
	}

	is_valid = {
		faith = faith:manichean
		piety_level >= 4
		prestige_level >= 3

	}	
	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes
		is_at_war = no
	}

	cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:manichaeism_followers_decision
		}

		manichaeism_followers_effect = yes

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100	
	}
}


uyghur_buddhism_followers_decision = {
	picture = {
		reference = "gfx/interface/illustrations/hexi2.dds"
	}
	desc = uyghur_buddhism_followers_decision_desc
	decision_group_type = major

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county

		religion=religion:buddhism_religion

		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:uyghur_buddhism_followers_decision
			}
		}
	}

	is_valid = {

	    religion=religion:buddhism_religion

		piety_level >= 4
		prestige_level >= 3

	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes
		is_at_war = no
	}

    cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:uyghur_buddhism_followers_decision
		}

		uyghur_buddhism_followers_effect = yes

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100	
	}
}




#粟特

revitalize_sogdian_decision = {
	picture = {
		reference = "gfx/interface/illustrations/sogdian.dds"
	}
	decision_group_type = major
	desc = revitalize_sogdian_decision_desc

	ai_check_interval = 120

	is_shown = {
		highest_held_title_tier >= tier_county
		culture = {
			OR = {
				this = culture:sogdian
				any_parent_culture_or_above = {
					OR = {
						this = culture:sogdian
					}
				}
			}
		}
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:revitalize_sogdian_decision
			}
		}
	}

	is_valid = {
		completely_controls = title:d_chah
		completely_controls = title:k_transoxiana 
		completely_controls = title:d_merv
		custom_description = {
			text = "is_king_or_emperor"
			highest_held_title_tier >= tier_kingdom
		}
		OR = {
			religion = religion:zoroastrianism_religion
			religion = religion:buddhism_religion
			faith = faith:manichean
			faith = faith:nestorian
		}
		prestige_level >= 3
		OR = {
			government_has_flag = government_is_feudal
			government_has_flag = government_is_clan
			government_allows = administrative
			government_has_flag = government_is_landless_adventurer
		}
}

	is_valid_showing_failures_only = {
		is_landed = yes
		is_adult = yes
		is_available = yes
		is_independent_ruler = yes
	}

	cost = {
		gold = {
			value = massive_gold_value
		}
		prestige = {
			value = major_prestige_value
		}
	}

	effect = {
		# gain_heroic_legend_seed_tooltip_effect = yes

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:revitalize_sogdian_decision
		}

		revitalize_sogdian_effect = yes

		add_to_list = notification_sent
	}

	ai_will_do = {
		base = 100
	}
}


###回鹘的信仰选择

adopt_a_new_faith_for_uyghur_decision = {
	ai_check_interval = 12
	picture = {
		reference = "gfx/interface/illustrations/zhaoli.dds"
	}
	sort_order = -20
	decision_group_type = major

	desc= adopt_a_new_faith_for_uyghur_decision_desc
	
	cooldown = { years = 30 }

	is_shown = {
		culture = {
			OR = {
				this = culture:yughur
				this = culture:uyghur
		is_landed = yes
	 	}
 	}
}
	
	is_valid_showing_failures_only = = {
		is_landed = yes
		is_adult = yes
		is_available = yes
		is_independent_ruler = yes
		is_at_war = no
	}

	is_valid = {
		
	}
	
	widget = {
		gui = "decision_view_widget_generic_multichoice_with_effects"
		controller = decision_option_list_controller
		decision_to_second_step_button = "CHOOSE_UYGHUR_FAITH"
		show_from_start = yes
		
		### mahayana
		item = {
			value = choose_mahayana
			is_valid = {
				NOT = { faith = faith:mahayana }
			}
			current_description = choose_mahayana_desc
			localization = choose_mahayana_name
			icon = "gfx/interface/icons/faith/mahayana.dds"
			ai_chance = {
				value = 0
				if = {
					limit = {
						highest_held_title_tier >= tier_kingdom
						ai_boldness >= 25
					}
					add = 20
				}
				if = {
					limit = {
						any_sub_realm_county = {
							faith = faith:mahayana
						}
					}
					add = 10
				}
				if = {
					limit = {
						any_independent_ruler = {
							faith = faith:mahayana
						}
					}
					multiply = 4
				}
			}
		}
		### alevi
		item = {
			value = choose_alevi
			is_valid = {
				NOT = { faith = faith:alevi }
			}
			current_description = choose_alevi_desc
			localization = choose_alevi_name
			icon = "gfx/interface/icons/faith/alevi.dds"
			ai_chance = {
				value = 0
				if = {
					limit = {
						any_sub_realm_county = {
							faith = faith:alevi
						}
					}
					add = 10
				}
				if = {
					limit = {
						exists = title:d_sunni.holder
						opinion = {
							target = title:d_sunni.holder
							value < -20
						}
						culture = { has_cultural_pillar = heritage_turkic }
					}
					add = 20
				}
				if = {
					limit = {
						any_independent_ruler = {
							faith = faith:alevi
						}
						culture = { has_cultural_pillar = heritage_turkic }
					}
					multiply = 2
				}
			}
		}
		### lamaism
		item = {
			value = choose_lamaism
			is_valid = {
				NOT = { faith = faith:lamaism }
			}
			current_description = choose_lamaism_desc
			localization = choose_lamaism_name
			icon = "gfx/interface/icons/faith/lamaism_buddhism.dds"
		}

		
		### theravada
		item = {
			value = choose_theravada
			is_valid = {
				NOT = { faith = faith:theravada }
				has_trait = scholar      
			}
			current_description = choose_theravada_desc
			localization = choose_theravada_name
			icon = "gfx/interface/icons/faith/buddhism.dds"
		}

		### manichean
		item = {
			value = choose_manichean
			is_valid = {
				NOT = { faith = faith:manichean }
                has_trait = lifestyle_mystic
			}
			current_description = choose_manichean_desc
			localization = choose_manichean_name
			icon = "gfx/interface/icons/faith/manichean.dds"
		}


		### khurmazta
		item = {
			value = choose_khurmazta
			is_valid = {
				NOT = { faith = faith:khurmazta }
				has_trait = theologian
			}
			current_description = choose_khurmazta_desc
			localization = choose_khurmazta_name
			icon = "gfx/interface/icons/faith/khurmazta.dds"
		}


		### ari
		item = {
			value = choose_ari
			is_valid = {
				NOT = { faith = faith:ari }
				has_trait = eccentric
			}
			current_description = choose_ari_desc
			localization = choose_ari_name
			icon = "gfx/interface/icons/faith/ari_buddhism.dds"
		}
		### bon 
		item = {
			value = choose_bon
			is_valid = {
				NOT = { faith = faith:bon }
				has_trait = witch
			}
			current_description = choose_bon_desc
			localization = choose_bon_name
			icon = "gfx/interface/icons/faith/bon.dds"
			}

### tengri_pagan 
		item = {
			value = choose_tengri_pagan
			is_valid = {
				NOT = { faith = faith:tengri_pagan }
			 	has_trait = greatest_of_khans
			}
			current_description = choose_tengri_pagan_desc
			localization = choose_tengri_pagan_name
			icon = "gfx/interface/icons/faith/tengri.dds"
		}

### nestorian 
		item = {
			value = choose_nestorian
			is_valid = {
				NOT = { faith = faith:nestorian }
				has_trait = theologian
			}
			current_description = choose_nestorian_desc
			localization = choose_nestorian_name
			icon = "gfx/interface/icons/faith/nestorian.dds"
		}
	}

	effect = {
		if = {
			limit = { scope:choose_manichean = yes }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:manichean }
			}
			show_as_tooltip = { set_character_faith = faith:manichean }
			hidden_effect = {
				set_character_faith_with_conversion = faith:manichean
			}
			faith:manichean = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:choose_khurmazta = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:khurmazta }
			}
			show_as_tooltip = { set_character_faith = faith:khurmazta }
			hidden_effect = {
				set_character_faith_with_conversion = faith:khurmazta
			}
			faith:khurmazta = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:choose_mahayana = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:mahayana }
			}
			show_as_tooltip = { set_character_faith = faith:mahayana }
			hidden_effect = {
				set_character_faith_with_conversion = faith:mahayana
			}
			faith:mahayana = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:choose_alevi = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:alevi }
			}
			show_as_tooltip = { set_character_faith = faith:alevi }
			hidden_effect = {
				set_character_faith_with_conversion = faith:alevi
			}
			faith:alevi = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:choose_lamaism = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:lamaism }
			}
			show_as_tooltip = { set_character_faith = faith:lamaism }
			hidden_effect = {
				set_character_faith_with_conversion = faith:lamaism
			}
			faith:lamaism = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:choose_theravada = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:theravada }
			}
			show_as_tooltip = { set_character_faith = faith:theravada }
			hidden_effect = {
				set_character_faith_with_conversion = faith:theravada
			}
			faith:theravada = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:choose_ari = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:ari }
			}
			show_as_tooltip = { set_character_faith = faith:ari }
			hidden_effect = {
				set_character_faith_with_conversion = faith:ari
			}
			faith:ari = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:choose_bon = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:bon }
			}
			show_as_tooltip = { set_character_faith = faith:bon }
			hidden_effect = {
				set_character_faith_with_conversion = faith:bon
			}
			faith:bon = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:choose_tengri_pagan = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:tengri_pagan }
			}
			show_as_tooltip = { set_character_faith = faith:tengri_pagan }
			hidden_effect = {
				set_character_faith_with_conversion = faith:tengri_pagan
			}
			faith:tengri_pagan = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		else_if = {
			limit = { scope:nestorian = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:nestorian }
			}
			show_as_tooltip = { set_character_faith = faith:nestorian }
			hidden_effect = {
				set_character_faith_with_conversion = faith:nestorian
			}
			faith:nestorian = {
				change_fervor = {
					value = 15
					desc = fervor_gain_persian_fervor
				}
			}
		}
		capital_county = {
			add_county_modifier = {
				modifier = religious_settler_influx
				years = 25
			}
		}
	}
	
	cost = {
		piety = {
			value = major_piety_value
		}
	}
	
	ai_potential = {
		highest_held_title_tier >= tier_county
		title:d_sunni.holder.faith ?= faith
		is_landed = yes
		is_at_war = no
	}

	ai_will_do = {
		base = 20
		
		modifier = {
			add = {
				value = ai_zeal
				multiply = -0.5
			}
		}
		
		modifier = {
			add = -20
			has_trait = craven
		}
		
		modifier = {
			add = 20
			has_trait = ambitious
		}
	  }
	}
