targetted_decisions = {
	
	convert_to_liege_religion = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai = no
		
		potential = {
			is_playable = yes
			liege = {
				NOT = { character = ROOT }
				NOT = { religion = ROOT }
				religion_group = ROOT
			}
			controls_religion = no
		}
		allow = {
			NOT = { trait = zealous }
			liege = { ROOTs_religion_is_playable_trigger = yes }
			holy_order = no
		}
		effect = {
			prestige = -500
			piety = 250
			if = {
				limit = { higher_tier_than = BARON }
				religion_authority = {
					modifier = ruler_converted_from
				}
			}
			liege = {
				reverse_religion = ROOT
			}
			if = {
				limit = { higher_tier_than = BARON }
				hidden_tooltip = {
					religion_authority = {
						modifier = ruler_converted_to
					}
				}
			}
			if = {
				limit = { liege = { trait = shaivist_hindu } }
				add_trait = shaivist_hindu
			}
			if = {
				limit = { liege = { trait = vaishnavist_hindu } }
				add_trait = vaishnavist_hindu
			}
			if = {
				limit = { liege = { trait = shaktist_hindu } }
				add_trait = shaktist_hindu
			}
			if = {
				limit = { liege = { trait = smartist_hindu } }
				add_trait = smartist_hindu
			}
			if = {
				limit = { liege = { trait = mahayana_buddhist } }
				add_trait = mahayana_buddhist
			}
			if = {
				limit = { liege = { trait = vajrayana_buddhist } }
				add_trait = vajrayana_buddhist
			}
			if = {
				limit = { liege = { trait = theravada_buddhist } }
				add_trait = theravada_buddhist
			}
			if = {
				limit = { liege = { trait = digambara_jain } }
				add_trait = digambara_jain
			}
			if = {
				limit = { liege = { trait = svetambara_jain } }
				add_trait = svetambara_jain
			}
			if = {
				limit = { liege = { trait = pagan_branch_1 } }
				add_trait = pagan_branch_1
			}
			if = {
				limit = { liege = { trait = pagan_branch_2 } }
				add_trait = pagan_branch_2
			}
			if = {
				limit = { liege = { trait = pagan_branch_3 } }
				add_trait = pagan_branch_3
			}
			if = {
				limit = { liege = { trait = pagan_branch_4 } }
				add_trait = pagan_branch_4
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	convert_to_liege_religion_on_liege = {
		only_playable = yes
		
		filter = liege
		ai_target_filter = liege
		ai_check_interval = 60
		
		from_potential = {
			ai = no
			is_playable = yes
			controls_religion = no
		}
		potential = {
			NOT = { character = FROM }
			NOT = { religion = FROM }
			religion_group = FROM
		}
		
		allow = {
			FROM = { NOT = { trait = zealous } }
		}
		
		effect = {
			FROM = {
				prestige = -500
				piety = 250
				if = {
					limit = { higher_tier_than = BARON }
					religion_authority = {
						modifier = ruler_converted_from
					}
				}
				religion = ROOT
				if = {
					limit = { higher_tier_than = BARON }
					hidden_tooltip = {
						religion_authority = {
							modifier = ruler_converted_to
						}
					}
				}
				if = {
					limit = { ROOT = { trait = shaivist_hindu } }
					add_trait = shaivist_hindu
				}
				if = {
					limit = { ROOT = { trait = vaishnavist_hindu } }
					add_trait = vaishnavist_hindu
				}
				if = {
					limit = { ROOT = { trait = shaktist_hindu } }
					add_trait = shaktist_hindu
				}
				if = {
					limit = { ROOT = { trait = smartist_hindu } }
					add_trait = smartist_hindu
				}
				if = {
					limit = { ROOT = { trait = mahayana_buddhist } }
					add_trait = mahayana_buddhist
				}
				if = {
					limit = { ROOT = { trait = vajrayana_buddhist } }
					add_trait = vajrayana_buddhist
				}
				if = {
					limit = { ROOT = { trait = theravada_buddhist } }
					add_trait = theravada_buddhist
				}
				if = {
					limit = { ROOT = { trait = digambara_jain } }
					add_trait = digambara_jain
				}
				if = {
					limit = { ROOT = { trait = svetambara_jain } }
					add_trait = svetambara_jain
				}
				if = {
					limit = { ROOT = { trait = pagan_branch_1 } }
					add_trait = pagan_branch_1
				}
				if = {
					limit = { ROOT = { trait = pagan_branch_2 } }
					add_trait = pagan_branch_2
				}
				if = {
					limit = { ROOT = { trait = pagan_branch_3 } }
					add_trait = pagan_branch_3
				}
				if = {
					limit = { ROOT = { trait = pagan_branch_4 } }
					add_trait = pagan_branch_4
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	convert_to_liege_culture_on_liege = {
		only_playable = yes
		
		filter = liege
		ai_target_filter = liege
		ai_check_interval = 60
		
		from_potential = {
			is_playable = yes
		}
		
		potential = {
			NOT = { character = FROM }
			NOT = { culture = FROM }
		}
		allow = {
			FROM = { prestige = 200 }
		}
		effect = {
			FROM = {
				prestige = -200
				culture = ROOT
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	convert_to_liege_culture = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			liege = {
				NOT = { character = ROOT }
				NOT = { culture = ROOT }
			}
		}
		allow = {
			prestige = 200
		}
		effect = {
			prestige = -200
			liege = {
				reverse_culture = ROOT
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	convert_to_local_culture = {
		only_playable = yes
		ai_check_interval = 24
		
		filter = self
		ai_target_filter = self
		
		potential = {
			is_playable = yes
			is_nomadic = no
			capital_scope = {
				NOT = { culture = ROOT }
			}
			OR = {
				independent = yes
				liege = {
					NOT = { culture = ROOT }
				}
			}
			holy_order = no
			mercenary = no
			has_dlc = "Rajas of India"
			NOT = { government = chinese_imperial_government }
		}
		allow = {
			prestige = 500
		}
		effect = {
			prestige = -500
			capital_scope = {
				reverse_culture = ROOT
			}
			hidden_tooltip = {
				any_child = {
					limit = {
						is_ruler = no
						liege = { character = ROOT }
					}
					culture = ROOT
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.25
			}
			modifier = {
				factor = 0
				primary_title = {
					is_conquered = yes
					conquest_culture = ROOT
				}
			}
			modifier = {
				factor = 0
				any_vassal = {
					culture = ROOT
					OR = {
						tier = duke
						tier = king
						AND = {
							tier = count
							ROOT = { tier = duke }
						}
					}
				}
			}
			modifier = {
				factor = 0
				capital_scope = {
					OR = {
						AND = {
							culture = norse
							NOT = {	has_global_flag = norse_culture_flipping }
							ROOT = {
								OR = {
									culture = swedish 
									culture = norwegian
									culture = danish
									culture = norman
								}
							}
						}
						AND = {
							culture = saxon
							ROOT = {
								OR = {
									culture = norman 
									culture = english
								}
							}
						}
						AND = {
							culture = norman
							ROOT = {
								OR = {
									culture = english 
									culture = saxon
								}
							}
						}
						AND = {
							culture_group = east_slavic
							ROOT = {
								culture = russian
							}
						}
						AND = {
							culture = pictish
							ROOT = {
								culture = scottish
							}
						}
						AND = {
							culture = lombard
							ROOT = {
								culture = italian
							}
						}
						AND = {
							culture = old_frankish
							ROOT = {
								culture = frankish
							}
						}
						AND = {
							culture = frisian
							ROOT = {
								culture = dutch
							}
						}
						AND = {
							culture = old_saxon
							ROOT = {
								culture = german
							}
						}
						AND = {
							culture = visigothic
							ROOT = {
								OR = {
									culture_group = iberian
									culture = andalusian_arabic
									culture = occitan
									religion_group = muslim
								}
							}
						}
					}
				}
			}
			modifier = {
				factor = 0
				culture = nahuatl
			}
			modifier = {
				factor = 0
				has_landed_title = e_china_west_governor
			}
			modifier = {
				factor = 0
				government = chinese_imperial_government
			}
			modifier = {
				factor = 0
				OR = {
					has_landed_title = k_jerusalem
					has_landed_title = e_outremer
					any_liege = {
						OR = {
							has_landed_title = k_jerusalem
							has_landed_title = e_outremer
						}
					}
				}
			}
			modifier = {
				factor = 0
				has_landed_title = e_latin_empire
			}
		}
	}
	
	convert_to_local_religion = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai = no
		
		potential = {
			is_playable = yes
			is_nomadic = no
			capital_scope = {
				NOT = { religion = ROOT }
			}
			OR = {
				independent = yes
				liege = {
					NOT = { religion = ROOT }
				}
			}
			
			# The Indian religions can convert to each other anyway
			OR = {
				NOT = { has_dharmic_religion_trigger = yes }
				capital_scope = {
					NOT = { has_dharmic_religion_trigger = yes }
				}
			}
			
			controls_religion = no
			holy_order = no
			
			has_dlc = "Rajas of India"
			
			NOT = {
				AND = {
					has_dlc = "Charlemagne"
					has_landed_title = e_byzantium  # May instead renounce iconoclasm
					has_landed_title = c_byzantion
					religion = iconoclast
					capital_scope = { religion = orthodox }
				}
			}
		}
		allow = {
			NOT = { trait = zealous }
			capital_scope = { ROOTs_religion_is_playable_trigger = yes }
			OR = {
				AND = {
					prestige = 500
					capital_scope = {
						true_religion_group = ROOT
					}
				}
				AND = {
					prestige = 1000
					capital_scope = {
						NOT = { true_religion_group = ROOT }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					capital_scope = {
						NOT = { true_religion_group = ROOT }
					}
				}
				prestige = -1000
			}
			if = {
				limit = {
					capital_scope = {
						true_religion_group = ROOT
					}
				}
				prestige = -500
			}
			piety = 250
			religion_authority = {
				modifier = ruler_converted_from
			}
			if = {
				limit = {
					religion_group = christian
					NOT = { trait = sympathy_christendom }
					capital_scope = {
						NOT = { true_religion_group = ROOT }
					}
				}
				random = {
					chance = 60
					add_trait = sympathy_christendom
				}
			}
			if = {
				limit = {
					religion_group = muslim
					NOT = { trait = sympathy_islam }
					capital_scope = {
						NOT = { true_religion_group = ROOT }
					}
				}
				random = {
					chance = 60
					add_trait = sympathy_islam
				}
			}
			if = {
				limit = {
					religion_group = pagan_group
					NOT = { trait = sympathy_pagans }
					capital_scope = {
						NOT = { true_religion_group = ROOT }
					}
				}
				random = {
					chance = 60
					add_trait = sympathy_pagans
				}
			}
			if = {
				limit = {
					religion_group = zoroastrian_group
					NOT = { trait = sympathy_zoroastrianism }
					capital_scope = {
						NOT = { true_religion_group = ROOT }
					}
				}
				random = {
					chance = 60
					add_trait = sympathy_zoroastrianism
				}
			}
			if = {
				limit = {
					religion_group = jewish_group
					NOT = { trait = sympathy_judaism }
					capital_scope = {
						NOT = { true_religion_group = ROOT }
					}
				}
				random = {
					chance = 60
					add_trait = sympathy_judaism
				}
			}
			if = {
				limit = {
					religion_group = indian_group
					NOT = { trait = sympathy_indian }
					capital_scope = {
						NOT = { true_religion_group = ROOT }
					}
				}
				random = {
					chance = 60
					add_trait = sympathy_indian
				}
			}
			custom_tooltip = { text = local_religion_conversion_tooltip }
			hidden_tooltip = {
				capital_scope = {
					reverse_religion = ROOT
				}
			}
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	convert_to_parent_religion = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai = no
		
		potential = {
			is_playable = yes
			independent = yes
			controls_religion = no
			is_heretic = yes
			NOT = {
				AND = {
					has_dlc = "Charlemagne"
					has_landed_title = e_byzantium  # May instead renounce iconoclasm
					has_landed_title = c_byzantion
					religion = iconoclast
					is_heresy_of = orthodox
				}
			}
		}
		allow = {
			NOT = { trait = zealous }
			holy_order = no
		}
		effect = {
			prestige = -500
			piety = 250
			if = {
				limit = { higher_tier_than = BARON }
				religion_authority = {
					modifier = ruler_converted_from
				}
			}
			
			abandon_heresy = yes
			
			if = {
				limit = { higher_tier_than = BARON }
				hidden_tooltip = {
					religion_authority = {
						modifier = ruler_converted_to
					}
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	convert_to_swedish = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = norse
			capital_scope = {
				region = custom_swedish
			}
			any_realm_province = {
				culture = swedish
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = norse
		}
		effect = {
			culture = swedish
			any_courtier = {
				limit = {
					culture = norse
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = swedish
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = { # Do not flip if we're in a huge Norse empire
				factor = 0
				top_liege = { culture = norse }
				290 = { # Uppland
					owner = {
						same_realm = ROOT
					}
				}
				272 = { # Akershus
					owner = {
						same_realm = ROOT
					}
				}
				266 = { # Sjaelland
					owner = {
						same_realm = ROOT
					}
				}
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = swedish }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = swedish }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = swedish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = swedish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = swedish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = swedish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = swedish
				}
			}
		}
	}
	convert_to_norwegian = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = norse
			capital_scope = {
				region = custom_norwegian
			}
			any_realm_province = {
				culture = norwegian
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = norse
		}
		effect = {
			culture = norwegian
			any_courtier = {
				limit = {
					culture = norse
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = norwegian
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = { # Do not flip if we're in a huge Norse empire
				factor = 0
				top_liege = { culture = norse }
				290 = { # Uppland
					owner = {
						same_realm = ROOT
					}
				}
				272 = { # Akershus
					owner = {
						same_realm = ROOT
					}
				}
				266 = { # Sjaelland
					owner = {
						same_realm = ROOT
					}
				}
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = norwegian }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = norwegian }
			}
			
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = norwegian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = norwegian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = norwegian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = norwegian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = norwegian
				}
			}
		}
	}
	convert_to_danish = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = norse
			capital_scope = {
				region = custom_danish
			}
			any_realm_province = {
				culture = danish
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = norse
		}
		effect = {
			culture = danish
			any_courtier = {
				limit = {
					culture = norse
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = danish
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = { # Do not flip if we're in a huge Norse empire
				factor = 0
				top_liege = { culture = norse }
				290 = { # Uppland
					owner = {
						same_realm = ROOT
					}
				}
				272 = { # Akershus
					owner = {
						same_realm = ROOT
					}
				}
				266 = { # Sjaelland
					owner = {
						same_realm = ROOT
					}
				}
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = danish }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = danish }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = danish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = danish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = danish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = danish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = danish
				}
			}
		}
	}
	convert_to_norman = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = norse
			capital_scope = {
				culture = norman
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = norse
		}
		effect = {
			culture = norman
			any_courtier = {
				limit = {
					culture = norse
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = norman
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = { # Do not flip if we're in a huge Norse empire
				factor = 0
				top_liege = { culture = norse }
				OR = {
					top_liege = {
						tier = emperor
					}
					AND = {
						290 = { # Uppland
							owner = {
								same_realm = ROOT
							}
						}
						272 = { # Akershus
							owner = {
								same_realm = ROOT
							}
						}
						266 = { # Sjaelland
							owner = {
								same_realm = ROOT
							}
						}
					}
				}
			}
			
			modifier = {
				factor = 1.2
				liege = { culture = norman }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = norman
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = norman
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = norman
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = norman
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = norman
				}
			}
		}
	}
	
	convert_to_reformed = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			is_heretic = yes
			OR = {
				religion = norse_pagan
				religion = finnish_pagan
				religion = baltic_pagan
				religion = tengri_pagan
				religion = slavic_pagan
				religion = aztec
				religion = west_african_pagan
				religion = bon
				religion = hellenic_pagan
			}
		}
		allow = {
			NOT = { trait = zealous }
			piety = 50
			holy_order = no
		}
		effect = {
			piety = -50
			if = {
				limit = { religion = norse_pagan }
				religion = norse_pagan_reformed
			}
			if = {
				limit = { religion = finnish_pagan }
				religion = finnish_pagan_reformed
			}
			if = {
				limit = { religion = baltic_pagan }
				religion = baltic_pagan_reformed
			}
			if = {
				limit = { religion = tengri_pagan }
				religion = tengri_pagan_reformed
			}
			if = {
				limit = { religion = slavic_pagan }
				religion = slavic_pagan_reformed
			}
			if = {
				limit = { religion = aztec }
				religion = aztec_reformed
			}
			if = {
				limit = { religion = west_african_pagan }
				religion = west_african_pagan_reformed
			}
			if = {
				limit = { religion = bon }
				religion = bon_reformed
			}
			if = {
				limit = { religion = hellenic_pagan }
				religion = hellenic_pagan_reformed
			}
			
			hidden_tooltip = {
				any_courtier = {
					limit = {
						is_heresy_of = ROOT
						employer = { character = ROOT }
					}
					religion = ROOT
				}
				any_vassal = {
					limit = {
						is_playable = no
						is_heresy_of = ROOT
					}
					religion = ROOT
				}
				capital_scope = {
					if = {
						limit = { is_heresy_of = ROOT }
						religion = ROOT
					}
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Generally quite a slow process - ca 40 years
			}
			modifier = {
				factor = 0.5
				OR = {
					trait = slow
					trait = dull
				}
			}
			modifier = {
				factor = 0.1
				trait = imbecile
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 2.0
				OR = {
					trait = quick
					trait = shrewd
				}
			}
			modifier = {
				factor = 4.0
				trait = genius
			}
			modifier = {
				factor = 5.0
				trait = cynical # It's the future..
			}
			modifier = {
				factor = 2.0
				trait = ambitious
			}
			modifier = {
				factor = 0
				independent = no
				any_liege = {
					religion = ROOT
				}
			}
			modifier = { #Easier for Proselytizers
				factor = 2.0
				OR = {
					AND = {
						religion = norse_pagan
						norse_pagan_reformed = { has_religion_feature = religion_proselytizing }
					}
					AND = {
						religion = tengri_pagan
						tengri_pagan_reformed = { has_religion_feature = religion_proselytizing }
					}
					AND = {
						religion = slavic_pagan
						slavic_pagan_reformed = { has_religion_feature = religion_proselytizing }
					}
					AND = {
						religion = baltic_pagan
						baltic_pagan_reformed = { has_religion_feature = religion_proselytizing }
					}
					AND = {
						religion = finnish_pagan
						finnish_pagan_reformed = { has_religion_feature = religion_proselytizing }
					}
					AND = {
						religion = aztec
						aztec_reformed = { has_religion_feature = religion_proselytizing }
					}
					AND = {
						religion = west_african_pagan
						west_african_pagan_reformed = { has_religion_feature = religion_proselytizing }
					}
					AND = {
						religion = bon
						bon_reformed = { has_religion_feature = religion_proselytizing }
					}
					AND = {
						religion = hellenic_pagan
						hellenic_pagan_reformed = { has_religion_feature = religion_proselytizing }
					}
				}
			}
		}
	}
	
	convert_to_hinduism = {
		only_playable = yes
		icon_religion = hindu
		
		filter = self
		ai_target_filter = self
		ai = no
	
		potential = {
			is_playable = yes
			has_dharmic_religion_trigger = yes
			NOT = { religion = hindu }
			is_theocracy = no
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			is_adult = yes
			prestige = 500
			NOT = { trait = zealous }
			any_realm_province = {
				religion = hindu
			}
			custom_tooltip = {
				text = indian_has_not_converted
				NOT = { has_character_flag = india_converted }
			}
			holy_order = no
		}
		effect = {
			if = {
				limit = { higher_tier_than = BARON }
				religion_authority = {
					modifier = ruler_converted_from
				}
			}
			religion = hindu
			if = {
				limit = { higher_tier_than = BARON }
				hidden_tooltip = {
					religion_authority = {
						modifier = ruler_converted_to
					}
				}
			}
			set_character_flag = india_converted
			prestige = -500
			piety = 100
			hidden_tooltip = { character_event = { id = RoI.110 } } # Choose branch
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}

	convert_to_buddhism = {
		only_playable = yes
		icon_religion = buddhist
		
		filter = self
		ai_target_filter = self
		ai = no
	
		potential = {
			is_playable = yes
			has_dharmic_religion_trigger = yes
			NOT = { religion = buddhist }
			is_theocracy = no
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			is_adult = yes
			prestige = 500
			NOT = { trait = zealous }
			any_realm_province = {
				religion = buddhist
			}
			custom_tooltip = {
				text = indian_has_not_converted
				NOT = { has_character_flag = india_converted }
			}
		}
		effect = {
			if = {
				limit = { higher_tier_than = BARON }
				religion_authority = {
					modifier = ruler_converted_from
				}
			}
			religion = buddhist
			if = {
				limit = { higher_tier_than = BARON }
				hidden_tooltip = {
					religion_authority = {
						modifier = ruler_converted_to
					}
				}
			}
			set_character_flag = india_converted
			prestige = -500
			piety = 100
			hidden_tooltip = { character_event = { id = RoI.111 } } # Choose branch
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}

	convert_to_jainism = {
		only_playable = yes
		icon_religion = jain
		
		filter = self
		ai_target_filter = self
		ai = no
	
		potential = {
			is_playable = yes
			has_dharmic_religion_trigger = yes
			NOT = { religion = jain }
			is_theocracy = no
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			is_adult = yes
			holy_order = no
			prestige = 500
			NOT = { trait = zealous }
			any_realm_province = {
				religion = jain
			}
			custom_tooltip = {
				text = indian_has_not_converted
				NOT = { has_character_flag = india_converted }
			}
		}
		effect = {
			if = {
				limit = { higher_tier_than = BARON }
				religion_authority = {
					modifier = ruler_converted_from
				}
			}
			religion = jain
			if = {
				limit = { higher_tier_than = BARON }
				hidden_tooltip = {
					religion_authority = {
						modifier = ruler_converted_to
					}
				}
			}
			set_character_flag = india_converted
			prestige = -500
			piety = 100
			hidden_tooltip = { character_event = { id = RoI.112 } } # Choose branch
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}

	convert_indian_branch = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai = no
		
		potential = {
			is_playable = yes
			is_adult = yes
			is_theocracy = no
			has_dharmic_religion_trigger = yes
		}
		allow = {
			NOT = { trait = zealous }
			prestige = 50
			custom_tooltip = {
				text = indian_has_not_converted
				NOT = { has_character_flag = india_branch_converted }
			}
		}
		effect = {
			set_character_flag = india_branch_converted
			prestige = -50
			piety = 25
			if = {
				limit = { religion = hindu }
				character_event = { id = RoI.115 } # Choose branch
			}
			if = {
				limit = { religion = buddhist }
				character_event = { id = RoI.116 } # Choose branch
			}
			if = {
				limit = { religion = jain }
				character_event = { id = RoI.117 } # Confirm conversion
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}

	# Carolingian renaissance - Old Frankish conversion to French
	convert_to_french = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
	
		potential = {
			is_playable = yes
			culture = old_frankish
			capital_scope = {
				region = world_europe_west_francia
			}
			any_realm_province = {
				culture = frankish
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = old_frankish
		}
		effect = {
			culture = frankish
			any_courtier = {
				limit = {
					culture = old_frankish
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = frankish
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = frankish }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = frankish }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = frankish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = frankish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = frankish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = frankish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = frankish
				}
			}
		}
	}
	
	# Pictish character may convert to Scottish
	convert_to_scottish = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = pictish
			capital_scope = {
				region = custom_scotland
			}
			any_realm_province = {
				culture = scottish
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = pictish
		}
		effect = {
			culture = scottish
			any_courtier = {
				limit = {
					culture = pictish
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = scottish
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = scottish }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = scottish }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = scottish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = scottish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = scottish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = scottish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = scottish
				}
			}
		}
	}
	
	# Arabic or Visigothic character may convert to Andalusian
	convert_to_andalusian = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			OR = {
				culture = visigothic
				culture_group = arabic
			}
			OR = {
				religion_group = muslim
				top_liege = { religion_group = muslim }
			}
			capital_scope = {
				region = custom_andalusian
			}
			any_realm_province = {
				culture = andalusian_arabic
			}
			NOT = {
				culture = andalusian_arabic
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		effect = {
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = andalusian_arabic
			}
			culture = andalusian_arabic
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = andalusian_arabic }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = andalusian_arabic }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = andalusian_arabic
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = andalusian_arabic
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = andalusian_arabic
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = andalusian_arabic
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = andalusian_arabic
				}
			}
		}
	}

	# Visigothic character may convert to Castillan
	convert_to_castillan = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = visigothic
			religion_group = christian
			capital_scope = {
				region = custom_castillian
			}
			any_realm_province = {
				culture = castillan
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = visigothic
		}
		effect = {
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = castillan
			}
			culture = castillan
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = castillan }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = castillan }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = castillan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = castillan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = castillan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = castillan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = castillan
				}
			}
		}
	}	

	# Visigothic character may convert to catalan
	convert_to_catalan = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = visigothic
			religion_group = christian
			capital_scope = {
				region = custom_catalan
			}
			any_realm_province = {
				culture = catalan
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = visigothic
		}
		effect = {
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = catalan
			}
			culture = catalan
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = catalan }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = catalan }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = catalan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = catalan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = catalan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = catalan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = catalan
				}
			}
		}
	}	

	# Suebi or Visigothic character may convert to Portuguese
	convert_to_portuguese = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			OR = {
				culture = suebi
				culture = visigothic
			}
			religion_group = christian
			capital_scope = {
				region = custom_portuguese
			}
			any_realm_province = {
				culture = portuguese
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			OR = {
				culture = suebi
				culture = visigothic
			}
		}
		effect = {
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = portuguese
			}
			culture = portuguese
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = portuguese }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = portuguese }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = portuguese
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = portuguese
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = portuguese
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = portuguese
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = portuguese
				}
			}
		}
	}
	
	# Old Frankish or Old Saxon character may convert to dutch
	convert_to_dutch = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			OR = {
				culture = old_frankish
				culture = old_saxon
				culture = frisian
			}
			capital_scope = {
				region = custom_frisia
			}
			any_realm_province = {
				culture = dutch
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = ROOT
		}
		effect = {
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = dutch
			}
			culture = dutch
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = dutch }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = dutch }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = dutch
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = dutch
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = dutch
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = dutch
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = dutch
				}
			}
		}
	}
	
	# Lombard character may convert to italian
	convert_to_italian = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = lombard
			capital_scope = {
				region = world_europe_south_italy
			}
			any_realm_province = {
				culture = italian
			}
			OR = {
				year = 786
				top_liege = {
					NOT = { culture = lombard }
				}
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = lombard
			capital_scope = {
				region = world_europe_south_italy
			}
			any_realm_province = {
				culture = italian
			}
		}
		effect = {
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = italian
			}
			culture = italian
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0
				OR = {
					independent = yes
					top_liege = { culture = lombard }
				}
			}

			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = italian }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = italian }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = italian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = italian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = italian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = italian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = italian
				}
			}
		}
	}
	
	# Visigothic character may convert to occitan
	convert_to_occitan = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture = visigothic
			religion_group = christian
			capital_scope = {
				region = world_europe_west_francia
			}
			any_realm_province = {
				culture = occitan
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture = ROOT
		}
		effect = {
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = occitan
			}
			culture = occitan
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = occitan }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = occitan }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = occitan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = occitan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = occitan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = occitan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = occitan
				}
			}
		}
	}

	# East Slavic character may convert to Russian
	convert_to_russian = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			culture_group = east_slavic
			NOT = { culture = russian }
			any_realm_province = {
				culture = russian
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			culture_group = east_slavic
			NOT = { culture = russian }
		}
		effect = {
			culture = russian
			any_courtier = {
				limit = {
					culture_group = east_slavic
					NOT = { culture = russian }
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = russian
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.5 # Slow it down a bit
			}
			
			modifier = {
				factor = 0.01
				capital_scope = {
					NOT = { culture = russian }
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = russian }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = russian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = russian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = russian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 8
					culture = russian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 10
					culture = russian
				}
			}
		}
	}

	# Latin character may convert to Outremer
	convert_to_outremer = {
		only_playable = yes
		
		filter = self
		ai_target_filter = self
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			OR = {
				culture_group = latin
				AND = {
					culture_group = arabic
					religion_group = christian
					liege = {
						culture_group = latin
						religion_group = christian
					}
				}
			}
			has_global_flag = christian_crusades_unlocked
			NOR = {
				culture = roman
				culture = outremer
			}
			OR = {
				religion_group = christian
				top_liege = { religion_group = christian }
			}
			OR = {
				capital_scope = {
					region = world_middle_east
				}
				capital_scope = {
					region = world_persia
				}
				capital_scope = {
					region = world_africa
				}
			}
			OR = {
				any_realm_province = {
					culture_group = arabic
				}
				top_liege = {
					culture = outremer
				}
			}
			NOT = { government = chinese_imperial_government }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
			OR = {
				ai = no
				top_liege = {
					culture = outremer
				}
			}
		}
		allow = {
			OR = {
				prestige = 10000
				has_landed_title = e_outremer
				top_liege = { has_landed_title = e_outremer }
				top_liege = { culture = outremer }
			}
		}
		effect = {
			custom_tooltip = { text = tooltip_courtiers_embrace_outremer }
			custom_tooltip = { text = tooltip_provinces_embrace_outremer }
			if = {
				limit = {
					capital_scope = { culture_group = arabic }
				}
				custom_tooltip = { text = tooltip_capital_embrace_outremer }
			}
			hidden_tooltip = {
				any_courtier = {
					limit = {
						culture = ROOT
						employer = { character = ROOT }
						dynasty = ROOT
					}
					culture = outremer
				}
				any_demesne_province = {
					limit = {
						culture_group = ROOT
					}
					culture = outremer
				}
				if = {
					limit = {
						capital_scope = { culture_group = arabic }
					}
					capital_scope = { culture = outremer }
				}
			}
			culture = outremer
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			#modifier = {
			#	factor = 0.01
			#	capital_scope = {
			#		NOT = { culture_group = arabic }
			#	}
			#}
			modifier = { #Small Crusader States will balkanize with their own culture or go native.
				factor = 0
				top_liege = {
					lower_real_tier_than = KING
				}
			}
			modifier = {
				factor = 30
				top_liege = {
					culture = outremer
					has_landed_title = e_outremer
				}
			}
			modifier = {
				factor = 1.5
				capital_scope = {
					region = world_middle_east_jerusalem
				}
			}
			modifier = {
				factor = 2.0
				liege = { culture = outremer }
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 2
					culture = outremer
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 4
					culture = outremer
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					value = 6
					culture = outremer
				}
			}
			modifier = {
				factor = 1.25
				num_culture_realm_provs = {
					value = 8
					culture = outremer
				}
			}
			modifier = {
				factor = 1.5
				num_culture_realm_provs = {
					value = 10
					culture = outremer
				}
			}
		}
	}

	convert_to_spouse_religion= {
		only_playable = yes
		filter = home_court
		ai_target_filter = home_court
		ai_check_interval = 60
	
		from_potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
		}
		
		potential = {
			OR = {
				spouse = {
					character = FROM
				}
				consort = {
					character = FROM
				}
			}
			OR = {
				religion_group = christian
				religion_group = muslim
				religion_group = zoroastrian_group
				religion_group = jewish_group
				religion_group = indian_group
			}
			is_alive = yes
		}
		
		allow = {
			FROM = { NOT = { trait = zealous } }
			FROMs_religion_is_playable_trigger = yes
		}
		
		effect = {
			FROM = {
				prestige = -500
				religion_authority = {
					modifier = ruler_converted_from
				}
			
				if = {
					limit = {
						trait = cynical
					}
					random = {
						chance = 60
						add_trait = sympathy_pagans
					}
				}
				if = {
					limit = {
						NOT = { trait = cynical }
					}
					random = {
						chance = 50
						add_trait = sympathy_pagans
					}
				}		
			
				religion = ROOT
				abdicate_holy_order_if_religion_changes_effect = yes
				
				#When spouse is Hindu
				if = {
					limit = {
						ROOT = {
							trait = shaivist_hindu
						}
					}
					add_trait = shaivist_hindu
				}
				if = {
					limit = {
						ROOT = {
							trait = vaishnavist_hindu
						}
					}
					add_trait = vaishnavist_hindu
				}
				if = {
					limit = {
						ROOT = {
							trait = shaktist_hindu
						}
					}
					add_trait = shaktist_hindu
				}
				if = {
					limit = {
						ROOT = {
							trait = smartist_hindu
						}
					}
					add_trait = smartist_hindu
				}
				
				#When spouse is Buddhist
				if = {
					limit = {
						ROOT = {
							trait = mahayana_buddhist
						}
					}
					add_trait = mahayana_buddhist
				}
				if = {
					limit = {
						ROOT = {
							trait = vajrayana_buddhist
						}
					}
					add_trait = vajrayana_buddhist
				}
				if = {
					limit = {
						ROOT = {
							trait = theravada_buddhist
						}
					}
					add_trait = theravada_buddhist
				}
				
				#When spouse is Jain
				if = {
					limit = {
						ROOT = {
							trait = digambara_jain
						}
					}
					add_trait = digambara_jain
				}
				if = {
					limit = {
						ROOT = {
							trait = svetambara_jain
						}
					}
					add_trait = svetambara_jain
				}
				if = {
					limit = {
						ROOT = {
							trait = pagan_branch_1
						}
					}
					add_trait = pagan_branch_1
				}
				if = {
					limit = {
						ROOT = {
							trait = pagan_branch_2
						}
					}
					add_trait = pagan_branch_2
				}
				if = {
					limit = {
						ROOT = {
							trait = pagan_branch_3
						}
					}
					add_trait = pagan_branch_3
				}
				if = {
					limit = {
						ROOT = {
							trait = pagan_branch_4
						}
					}
					add_trait = pagan_branch_4
				}
				
				hidden_tooltip = {
					religion_authority = {
						modifier = ruler_converted_to
					}
				}
				piety = 200
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
}

decisions = {
	
	# Weak or unreformed religions are allowed to convert to the attacker's religion when under Holy War
	convert_to_attacker_religion = {
		only_playable = yes
		ai_check_interval = 18
		
		is_high_prio = yes
		
		potential = {
			is_playable = yes
			OR = {
				AND = {
					religion_group = pagan_group
					is_reformed_religion = no
					NOT = { religion_authority = 0.4 }
				}
				NOT = { religion_authority = 0.3 }
				is_nomadic = yes
			}
			controls_religion = no
			NOT = { has_character_modifier = baptism_request_cooldown }
			
			war = yes
			any_war = {
				defender = { character = ROOT }
				attacker = {
					NOT = { religion = ROOT }
					religion_authority = 0.5
					OR = {
						NOT = { religion_group = pagan_group }
						is_reformed_religion = yes
					}
				}
				OR = {
					using_cb = crusade
					using_cb = new_crusade
					using_cb = religious
					using_cb = muslim_invasion
					using_cb = buddhist_holy_war
					using_cb = pagan_holy_war
				}
			}
		}
		
		allow = {
			NOT = { trait = zealous }
		}
		
		effect = {
			prestige = -500
			piety = 100
			abdicate_holy_order_if_religion_changes_effect = yes
			
			hidden_tooltip = {
				any_war = {
					limit = {
						defender = { character = ROOT }
						attacker = {
							NOT = { religion = ROOT }
							religion_authority = 0.5
							OR = {
								NOT = { religion_group = pagan_group }
								is_reformed_religion = yes
							}
						}
						OR = {
							using_cb = crusade
							using_cb = new_crusade
							using_cb = religious
							using_cb = muslim_invasion
							using_cb = buddhist_holy_war
							using_cb = pagan_holy_war
						}
					}
					attacker = {
						save_event_target_as = enemy_attacker
					}
				}
			}

			#If possible, perform mass baptism.
			if = {
				limit = { 
					has_dlc = "Holy Fury"
					is_tribal = yes
					religion_group = pagan_group 
					higher_real_tier_than = count 		
					NOT = { trait = incapable }
					NOT = { is_reformed_religion = yes }
					NOT = { has_character_flag = flag_converting_baptism }
					NOT = { has_character_modifier = baptism_request_cooldown } 
					independent = yes 
					prisoner = no
					has_regent = no
					primary_title = { 
						OR = { 
							has_law = tribal_organization_2 
							has_law = tribal_organization_3 
							has_law = tribal_organization_4 
						} 
					}
					any_war = {
						using_cb = new_crusade 
						defender = { character = ROOT }
						attacker = { #Special case.
							religion = catholic 
							NOT = { has_character_flag = flag_sponsoring_baptism }
						}
					}
				}
				hidden_effect = {
					add_character_modifier = {
						name = baptism_request_cooldown
						months = 1
						hidden = yes
					}
					event_target:enemy_attacker = {
						add_character_modifier = {
							name = baptism_request_cooldown
							months = 1
							hidden = yes
						}
					}
					opinion = {
						modifier = opinion_baptism_sponsor_target
						years = 20
						who = event_target:enemy_attacker
						origin_description = EVTTOOLTIPHFA20005
					}
					event_target:enemy_attacker = {
						opinion = {
							modifier = opinion_baptism_sponsor_target
							years = 20
							who = ROOT
							origin_description = EVTTOOLTIPHFB20005
						}
					}
				}
				event_target:enemy_attacker = { show_scope_change = no letter_event = { id = HF.20000 tooltip = tooltip_mass_convert_during_crusade } }
			}
			else = {
				if = {
					limit = { event_target:enemy_attacker = { NOT = { religion_group = ROOT } } }
					if = {
						limit = { religion_group = pagan_group }
						add_trait = sympathy_pagans
					}
					
					if = {
						limit = { religion_group = zoroastrian_group }
						add_trait = sympathy_zoroastrianism
					}
					
					if = {
						limit = { religion_group = christian }
						add_trait = sympathy_christendom
					}
					
					if = {
						limit = { religion_group = muslim }
						add_trait = sympathy_islam
					}
					
					if = {
						limit = { religion_group = jewish_group }
						add_trait = sympathy_judaism
					}
					
					if = {
						limit = { religion_group = indian_group }
						add_trait = sympathy_indian
					}
				}
				event_target:enemy_attacker = {
					hidden_tooltip = {
						letter_event = { id = 62800 }
						ROOT = {
							any_courtier = {
								limit = {
									religion = ROOT
									employer = { character = ROOT }
								}
								religion = PREVPREV
							}
							any_vassal = {
								limit = {
									is_playable = no
									religion = ROOT
								}
								religion = PREVPREV
							}
							capital_scope = {
								if = {
									limit = { religion = ROOT }
									religion = PREVPREV
								}
							}
						}
					}
					hidden_tooltip = {
						religion_authority = {
							modifier = ruler_converted_to
						}
					}
					reverse_religion = ROOT 
				}
				religion_authority = {
					modifier = ruler_converted_from
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
			}
			modifier = {
				factor = 0.05
				is_hard_to_convert = yes
			}
			modifier = {
				factor = 0
				NOT = {
					any_war = {
						defender = { character = ROOT }
						attacker = {
							NOT = { religion = ROOT }
							religion_authority = 0.45
							OR = {
								NOT = { religion_group = pagan_group }
								is_reformed_religion = yes
							}
						}
						OR = {
							using_cb = crusade
							using_cb = new_crusade
							using_cb = religious
							using_cb = muslim_invasion
							using_cb = buddhist_holy_war
							using_cb = pagan_holy_war
						}
						war_score = 50
						thirdparty_title_scope = {
							ROOT = {
								primary_title = {
									title = PREVPREV
								}
							}
						}
					}
				}
			}
			modifier = {
				factor = 2
				any_war = {
					defender = { character = ROOT }
					attacker = {
						NOT = { religion = ROOT }
						religion_authority = 0.45
						OR = {
							NOT = { religion_group = pagan_group }
							is_reformed_religion = yes
						}
					}
					OR = {
						using_cb = crusade
						using_cb = new_crusade
						using_cb = religious
						using_cb = muslim_invasion
						using_cb = buddhist_holy_war
						using_cb = pagan_holy_war
					}
					war_score = 75
					thirdparty_title_scope = {
						ROOT = {
							primary_title = {
								title = PREVPREV
							}
						}
					}
				}
			}
		}
	}
	
	# Byzantine Emperor may renounce Iconoclasm
	renounce_iconoclasm = {
		only_playable = yes
	
		icon_religion = orthodox
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			religion = iconoclast
			has_dlc = "Charlemagne"
			has_landed_title = e_byzantium
			NOT = { has_character_flag = renounced_iconoclasm }
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			has_landed_title = e_byzantium
			has_landed_title = c_byzantion
			any_realm_province = { religion = orthodox }
			NOT = { trait = zealous }
			war = no
			NOT = { year = 900 }
		}
		effect = {
			set_character_flag = renounced_iconoclasm
			religion_authority = {
				modifier = ruler_converted_from
			}
			religion = orthodox
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			custom_tooltip = {
				text = renounce_iconoclasm_muslim_opinion_tooltip
				hidden_tooltip = {
					generate_tooltip = no
					any_independent_ruler = {
						any_realm_lord = {
							limit = { religion_group = muslim }
							opinion = {
								who = ROOT
								modifier = opinion_idolater
								months = 120
							}
						}
					}
				}
			}
			custom_tooltip = {
				text = renounce_iconoclasm_province_tooltip
				hidden_tooltip = {
					any_realm_province = {
						if = {
							limit = { religion = orthodox }
							add_province_modifier = {
								name = appeased_religious
								months = 60
							}
						}
					}
				}
			}
			k_papal_state = {
				holder_scope = {
					opinion = {
						who = ROOT
						modifier = opinion_renounced_iconoclasm
						months = 120
					}
				}
			}
			hidden_tooltip = {
				any_realm_character = {
					limit = {
						religion = iconoclast
						NOT = { character = ROOT }
						can_change_religion = yes
					}
					character_event = { id = CM.4200 }
				}
			}
			activate_title = { title = k_orthodox status = yes }
			d_iconoclast = {
				holder_scope = {
					k_orthodox = {
						grant_title = PREV
					}
					unsafe_religion = orthodox  # Use this effect with care
					set_defacto_liege = ROOT
				}
				hidden_tooltip = { unsafe_destroy_landed_title = THIS }
			}
			activate_title = { title = d_iconoclast status = no }
			any_playable_ruler = {
				narrative_event = { id = CIML.900 days = 4 }
			}
			narrative_event = { id = CIML.900 days = 4 }
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5 # slow it down
			}
			modifier = {
				factor = 3
				trait = cynical
			}
		}
	}
	# Roman Emperor may restore Roman Culture
	roman_renaissance = {
		ai_check_interval = 120 #check only once every 120 months.
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			is_playable = yes
			OR = { 
				culture = italian 
				culture = greek
			}
			has_dlc = "Holy Fury"
			has_landed_title = e_roman_empire
			NOT = { government = chinese_imperial_government }
			NOT = { has_global_flag = flag_started_roman_renaissance }
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
		}
		allow = {
			show_only_failed_conditions = yes
			OR = { 
				religion_group = christian 
				religion = hellenic_pagan
				religion = hellenic_pagan_reformed
			}
			capital_scope = { province = 333 }
			ruled_years = 10
			war = no
		}
		effect = {
			set_global_flag = flag_started_roman_renaissance
			culture = roman
			hidden_tooltip = {
				any_courtier_or_vassal = { 
					limit = { lower_tier_than = COUNT }
					culture = roman
				}
			}
			capital_scope = { culture = roman }
			custom_tooltip = {
				text = tooltip_roman_culture_starts_spreading
				hidden_tooltip = {
					any_realm_province = {
						if = {
							limit = { any_neighbor_province = { province = 333 } }
							culture = roman
						}
						if = {
							limit = { 
								culture = italian
								NOT = { distance = { where = 333 distance = 100 } } 
							}
							random = { 
								chance = 40 
								culture = roman 
							}
						}
						if = {
							limit = { 
								culture_group = latin
								NOT = { distance = { where = 333 distance = 200 } } 
							}
							random = { 
								chance = 20 
								culture = roman 
							}
						}
						if = {
							limit = { 
								culture_group = latin
								NOT = { distance = { where = 333 distance = 400 } } 
							}
							random = { 
								chance = 5
								culture = roman 
							}
						}
					}
				}
			}
			hidden_tooltip = {
				if = { #Hellenic Emperor gets chance to spread Hellenism a bit alongside the culture.
					limit = { OR = { religion = hellenic_pagan religion = hellenic_pagan_reformed } }
					any_realm_province = {
						if = {
							limit = { any_neighbor_province = { province = 333 } }
							religion = ROOT
						}
						if = {
							limit = { 
								culture = roman
								NOT = { distance = { where = 333 distance = 100 } } 
							}
							random = { 
								chance = 10 
								religion = ROOT
							}
						}
						if = {
							limit = { 
								culture = roman
								NOT = { distance = { where = 333 distance = 200 } } 
							}
							random = { 
								chance = 5 
								religion = ROOT
							}
						}
					}
				}
			}
			hidden_tooltip = { #Special event if there are still enough christian provinces around (which is very likely)
				if = {
					limit = { 
						any_realm_province = { 
							religion_group = christian
							count = 10
						} 
					}
					character_event = { id = HF.23119 days = 150 random = 50 }
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 3
				religion = hellenic_pagan_reformed
			}
			modifier = {
				factor = 0.01 #Would consider it a step down.
				culture = greek
			}
		}
	}
	embrace_roman_culture = {
		ai_check_interval = 120 #check only once every 120 months.
		only_playable = yes
		
		potential = {
			is_playable = yes
			NOT = { culture = roman }
			OR = { 
				culture_group = latin 
				culture_group = byzantine
			}
			has_dlc = "Holy Fury"
			NOT = { government = chinese_imperial_government }
			has_global_flag = flag_started_roman_renaissance
			NOT = {
				has_alternate_start_parameter = { key = culture_names value = random }
			}
			top_liege = { has_landed_title = e_roman_empire }
		}
		allow = {
			show_only_failed_conditions = yes
			OR = { 
				culture_group = latin 
				culture_group = byzantine
			}
		}
		effect = {
			culture = roman
			hidden_tooltip = {
				any_courtier_or_vassal = { 
					limit = { lower_tier_than = COUNT }
					culture = roman
				}
			}
			capital_scope = { culture = roman }
			custom_tooltip = {
				text = tooltip_roman_culture_spreads
				hidden_tooltip = {
					any_demesne_province = {
						if = {
							limit = { any_neighbor_province = { province = 333 } }
							culture = roman
						}
						if = {
							limit = { 
								culture = italian
								capital_scope = { NOT = { distance = { where = PREV distance = 100 } } } 
							}
							random = { 
								chance = 40 
								culture = roman 
							}
						}
						if = {
							limit = { 
								culture_group = latin
								capital_scope = { NOT = { distance = { where = PREV distance = 200 } } } 
							}
							random = { 
								chance = 20 
								culture = roman 
							}
						}
						if = {
							limit = { 
								culture_group = latin
								capital_scope = { NOT = { distance = { where = PREV distance = 400 } } } 
							}
							random = { 
								chance = 5
								culture = roman 
							}
						}
					}
				}
			}
			if = { #Hellenic Emperor gets chance to spread Hellenism a bit alongside the culture.
				limit = { OR = { religion = hellenic_pagan religion = hellenic_pagan_reformed } }
				hidden_tooltip = {
					any_demesne_province = {
						if = {
							limit = { any_neighbor_province = { province = 333 } }
							religion = ROOT
						}
						if = {
							limit = { 
								culture = roman
								capital_scope = { NOT = { distance = { where = PREV distance = 100 } } } 
							}
							random = { 
								chance = 10 
								religion = ROOT
							}
						}
						if = {
							limit = { 
								culture = roman
								capital_scope = { NOT = { distance = { where = PREV distance = 200 } } } 
							}
							random = { 
								chance = 5 
								religion = ROOT
							}
						}
					}
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 3
				religion = hellenic_pagan_reformed
			}
			modifier = {
				factor = 3
				capital_scope = { culture = roman } 
			}
			modifier = {
				factor = 0.01 #Would consider it a step down.
				culture = greek
			}
		}
	}
}
