decisions = {
	
	convert_to_liege_religion = {
		potential = {
			ai = no
			NOT = { 
				OR = {
					has_landed_title = d_swiss_company
					has_landed_title = d_latinikon
					has_landed_title = d_alan_band
					has_landed_title = d_breton_company
					has_landed_title = d_bulgarian_company  
					has_landed_title = d_catalan_company  
					has_landed_title = d_company_of_st_george  
					has_landed_title = d_cuman_company  
					has_landed_title = d_danelaw_band  
					has_landed_title = d_druzhina_polish  
					has_landed_title = d_druzhina_rus  
					has_landed_title = d_finnish_band  
					has_landed_title = d_fjord_riders  
					has_landed_title = d_genoese_band  
					has_landed_title = d_ghanan_band  
					has_landed_title = d_great_company  
					has_landed_title = d_irish_band  
					has_landed_title = d_knights_brass_cross  
					has_landed_title = d_mamluks  
					has_landed_title = d_nubian_band  
					has_landed_title = d_old_saxon_band  
					has_landed_title = d_pannonian_band  
					has_landed_title = d_pictish_host  
					has_landed_title = d_rose_company  
					has_landed_title = d_rus_company  
					has_landed_title = d_scottish_band  
					has_landed_title = d_shiite_bedouin_company  
					has_landed_title = d_shiite_turkic_company  
					has_landed_title = d_sunni_bedouin_company  
					has_landed_title = d_sunni_berber_company  
					has_landed_title = d_sunni_turkic_company  
					has_landed_title = d_varangian_guard
					has_landed_title = d_victual_brothers
					has_landed_title = d_white_company
					has_landed_title = d_zoroastrian_band
				} 
			}
			is_playable = yes
			liege = {
				NOT = { character = ROOT }
				NOT = { religion = ROOT }
				religion_group = ROOT
			}
		}
		allow = {
			NOT = { trait = zealous }
		}
		effect = {
			prestige = -500
			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
			}
			piety = 200
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	convert_to_liege_culture = {
		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 = {
		potential = {
			is_playable = yes
			capital_scope = {
				NOT = { culture = ROOT }
			}
			OR = {
				independent = yes
				liege = {
					NOT = { culture = ROOT }
				}
			}
			holy_order = no
			has_dlc = "Rajas of India"
		}
		allow = {
			prestige = 500
		}
		effect = {
			prestige = -500
			capital_scope = {
				reverse_culture = ROOT
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.01
			}
			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
								}
							}
						}
					}
				}
			}
		}
	}
	
	convert_to_local_religion = {
		potential = {
			ai = no
			NOT = { 
				OR = {
					has_landed_title = d_swiss_company
					has_landed_title = d_latinikon
					has_landed_title = d_alan_band
					has_landed_title = d_breton_company
					has_landed_title = d_bulgarian_company  
					has_landed_title = d_catalan_company  
					has_landed_title = d_company_of_st_george  
					has_landed_title = d_cuman_company  
					has_landed_title = d_danelaw_band  
					has_landed_title = d_druzhina_polish  
					has_landed_title = d_druzhina_rus  
					has_landed_title = d_finnish_band  
					has_landed_title = d_fjord_riders  
					has_landed_title = d_genoese_band  
					has_landed_title = d_ghanan_band  
					has_landed_title = d_great_company  
					has_landed_title = d_irish_band  
					has_landed_title = d_knights_brass_cross  
					has_landed_title = d_mamluks  
					has_landed_title = d_nubian_band  
					has_landed_title = d_old_saxon_band  
					has_landed_title = d_pannonian_band  
					has_landed_title = d_pictish_host  
					has_landed_title = d_rose_company  
					has_landed_title = d_rus_company  
					has_landed_title = d_scottish_band  
					has_landed_title = d_shiite_bedouin_company  
					has_landed_title = d_shiite_turkic_company  
					has_landed_title = d_sunni_bedouin_company  
					has_landed_title = d_sunni_berber_company  
					has_landed_title = d_sunni_turkic_company  
					has_landed_title = d_varangian_guard
					has_landed_title = d_victual_brothers
					has_landed_title = d_white_company
					has_landed_title = d_zoroastrian_band
				} 
			}
			is_playable = yes
			capital_scope = {
				NOT = { religion = ROOT }
			}
			OR = {
				independent = yes
				liege = {
					NOT = { religion = ROOT }
				}
			}
			
			# The Indian religions can convert to each other anyway
			OR = {
				NOT = { religion_group = indian_group }
				capital_scope = {
					NOT = { religion_group = indian_group }
				}
			}
			
			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 = {
			OR = {
				AND = {
					piety = 500
					capital_scope = {
						religion_group = ROOT
					}
				}
				AND = {
					piety = 1000
					capital_scope = {
						NOT = { religion_group = ROOT }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					capital_scope = {
						NOT = { religion_group = ROOT }
					}
				}
				piety = -1000
			}
			if = {
				limit = {
					capital_scope = {
						religion_group = ROOT
					}
				}
				piety = -500
			}
			religion_authority = {
				modifier = ruler_converted_from
			}
			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 = {
		potential = {
			ai = no
			NOT = { 
				OR = {
					has_landed_title = d_swiss_company
					has_landed_title = d_latinikon
					has_landed_title = d_alan_band
					has_landed_title = d_breton_company
					has_landed_title = d_bulgarian_company  
					has_landed_title = d_catalan_company  
					has_landed_title = d_company_of_st_george  
					has_landed_title = d_cuman_company  
					has_landed_title = d_danelaw_band  
					has_landed_title = d_druzhina_polish  
					has_landed_title = d_druzhina_rus  
					has_landed_title = d_finnish_band  
					has_landed_title = d_fjord_riders  
					has_landed_title = d_genoese_band  
					has_landed_title = d_ghanan_band  
					has_landed_title = d_great_company  
					has_landed_title = d_irish_band  
					has_landed_title = d_knights_brass_cross  
					has_landed_title = d_mamluks  
					has_landed_title = d_nubian_band  
					has_landed_title = d_old_saxon_band  
					has_landed_title = d_pannonian_band  
					has_landed_title = d_pictish_host  
					has_landed_title = d_rose_company  
					has_landed_title = d_rus_company  
					has_landed_title = d_scottish_band  
					has_landed_title = d_shiite_bedouin_company  
					has_landed_title = d_shiite_turkic_company  
					has_landed_title = d_sunni_bedouin_company  
					has_landed_title = d_sunni_berber_company  
					has_landed_title = d_sunni_turkic_company  
					has_landed_title = d_varangian_guard
					has_landed_title = d_victual_brothers
					has_landed_title = d_white_company
					has_landed_title = d_zoroastrian_band
				} 
			}
			is_playable = yes
			independent = yes
			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 }
		}
		effect = {
			prestige = -500
			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
					}
				}
			}
			piety = 200
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans are allowed to convert to the attacker's religion when under holy war
	convert_to_attacker_religion = {
		is_high_prio = yes
		
		potential = {
			is_playable = yes
			OR = {
				religion = norse_pagan
				religion = slavic_pagan
				religion = baltic_pagan
				religion = finnish_pagan
				religion = tengri_pagan	
				religion = west_african_pagan
				religion = zun_pagan
				religion = aztec
				religion = zoroastrian
			}
			controls_religion = no
			war = yes
			any_war = {
				defender = { character = ROOT }
				attacker = {
					OR = {
						religion_group = muslim
						religion_group = christian
					}
				}
				OR = {
					using_cb = crusade
					using_cb = religious
					using_cb = muslim_invasion
				}
			}
		}
		
		allow = {
			NOT = { trait = zealous }
		}
		
		effect = {
			prestige = -500
			religion_authority = {
				modifier = ruler_converted_from
			}
			
			if = {
				limit = { religion_group = pagan_group }
				add_trait = sympathy_pagans
			}
			if = {
				limit = { religion_group = zoroastrian_group }
				add_trait = sympathy_zoroastrianism
			}
			
			any_war = {
				limit = {
					defender = { character = ROOT }
					attacker = {
						OR = {
							religion_group = muslim
							religion_group = christian
						}
					}
					OR = {
						using_cb = crusade
						using_cb = religious
						using_cb = muslim_invasion
					}
				}
				attacker = {
					hidden_tooltip = {
						letter_event = { id = 62800 }
					}
					hidden_tooltip = {
						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
								}
							}
						}
					}
					reverse_religion = ROOT 
				}
			}
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
			}
			modifier = {
				factor = 0
				NOT = {
					any_war = {
						defender = { character = ROOT }
						attacker = {
							OR = {
								religion_group = muslim
								religion_group = christian
							}
						}
						OR = {
							using_cb = crusade
							using_cb = religious
							using_cb = muslim_invasion
						}
						war_score = 50
						thirdparty_title_scope = {
							ROOT = {
								primary_title = {
									title = PREVPREV
								}
							}
						}
					}
				}
			}
			modifier = {
				factor = 2
				any_war = {
					defender = { character = ROOT }
					attacker = {
						OR = {
							religion_group = muslim
							religion_group = christian
						}
					}
					OR = {
						using_cb = crusade
						using_cb = religious
						using_cb = muslim_invasion
					}
					war_score = 75
					thirdparty_title_scope = {
						ROOT = {
							primary_title = {
								title = PREVPREV
							}
						}
					}
				}
			}
		}
	}
	
	convert_to_swedish = {
		potential = {
			culture = norse
			is_ruler = yes
			capital_scope = {
				kingdom = { title = k_sweden }
			}
			any_realm_province = {
				culture = swedish
			}
		}
		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.2 # 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 = {
					num = 2
					culture = swedish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = swedish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = swedish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = swedish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = swedish
				}
			}
		}
	}
	convert_to_norwegian = {
		potential = {
			culture = norse
			is_ruler = yes
			capital_scope = {
				kingdom = { title = k_norway }
			}
			any_realm_province = {
				culture = norwegian
			}
		}
		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.2 # 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 = {
					num = 2
					culture = norwegian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = norwegian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = norwegian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = norwegian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = norwegian
				}
			}
		}
	}
	convert_to_danish = {
		potential = {
			culture = norse
			is_ruler = yes
			capital_scope = {
				kingdom = { title = k_denmark }
			}
			any_realm_province = {
				culture = danish
			}
		}
		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.2 # 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 = {
					num = 2
					culture = danish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = danish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = danish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = danish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = danish
				}
			}
		}
	}
	convert_to_norman = {
		potential = {
			culture = norse
			is_ruler = yes
			capital_scope = {
				culture = norman
			}
		}
		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.2 # 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 = {
					num = 2
					culture = norman
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = norman
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = norman
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = norman
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = norman
				}
			}
		}
	}
	
	convert_to_reformed = {
		potential = {
			is_playable = yes
			is_heretic = yes
			NOT = { 
				OR = {
					has_landed_title = d_swiss_company
					has_landed_title = d_latinikon
					has_landed_title = d_alan_band
					has_landed_title = d_breton_company
					has_landed_title = d_bulgarian_company  
					has_landed_title = d_catalan_company  
					has_landed_title = d_company_of_st_george  
					has_landed_title = d_cuman_company  
					has_landed_title = d_danelaw_band  
					has_landed_title = d_druzhina_polish  
					has_landed_title = d_druzhina_rus  
					has_landed_title = d_finnish_band  
					has_landed_title = d_fjord_riders  
					has_landed_title = d_genoese_band  
					has_landed_title = d_ghanan_band  
					has_landed_title = d_great_company  
					has_landed_title = d_irish_band  
					has_landed_title = d_knights_brass_cross  
					has_landed_title = d_mamluks  
					has_landed_title = d_nubian_band  
					has_landed_title = d_old_saxon_band  
					has_landed_title = d_pannonian_band  
					has_landed_title = d_pictish_host  
					has_landed_title = d_rose_company  
					has_landed_title = d_rus_company  
					has_landed_title = d_scottish_band  
					has_landed_title = d_shiite_bedouin_company  
					has_landed_title = d_shiite_turkic_company  
					has_landed_title = d_sunni_bedouin_company  
					has_landed_title = d_sunni_berber_company  
					has_landed_title = d_sunni_turkic_company  
					has_landed_title = d_varangian_guard
					has_landed_title = d_victual_brothers
					has_landed_title = d_white_company
					has_landed_title = d_zoroastrian_band
					
				} 
			}
			OR = {
				religion = norse_pagan
				religion = finnish_pagan
				religion = baltic_pagan
				religion = tengri_pagan
				religion = slavic_pagan
				religion = aztec
				religion = west_african_pagan
			}
		}
		allow = {
			NOT = { trait = zealous }
			piety = 50
		}
		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
			}
			
			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 # On average ca 1 year before taken
			modifier = {
				factor = 0.025 # Generally quite a slow process - ca 40 years
			}
			modifier = {
				factor = 0.5
				trait = slow
			}
			modifier = {
				factor = 0.1
				trait = imbecile
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 2.0
				trait = quick
			}
			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
				}
			}
		}
	}
	
	# Pagans can convert to the Catholic faith if their wife or a concubine is Catholic
	convert_to_spouse_catholic = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = catholic
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = catholic
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = catholic
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Cathar faith if their wife or a concubine is Cathar
	convert_to_spouse_cathar = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = cathar
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = cathar
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = cathar
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	# Pagans can convert to the Fraticelli faith if their wife or a concubine is Fraticelli
	convert_to_spouse_fraticelli = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = fraticelli
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = fraticelli
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = fraticelli
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	# Pagans can convert to the Waldensian faith if their wife or a concubine is Waldensian
	convert_to_spouse_waldensian = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = waldensian
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = waldensian
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = waldensian
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	# Pagans can convert to the Lollard faith if their wife or a concubine is Lollard
	convert_to_spouse_lollard = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = lollard
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = lollard
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = lollard
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	# Pagans can convert to the Bogomilist faith if their wife or a concubine is Bogomilist
	convert_to_spouse_bogomilist = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = bogomilist
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = bogomilist
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = bogomilist
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Nestorian faith if their wife or a concubine is Nestorian
	convert_to_spouse_nestorian = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = nestorian
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = nestorian
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = nestorian
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Messalian faith if their wife or a concubine is Messalian
	convert_to_spouse_messalian = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = messalian
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = messalian
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = messalian
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Monothelite faith if their wife or a concubine is Monothelite
	convert_to_spouse_monothelite = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = monothelite
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = monothelite
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = monothelite
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Iconoclast faith if their wife or a concubine is Iconoclast
	convert_to_spouse_iconoclast = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = iconoclast
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = iconoclast
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = iconoclast
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Orthodox faith if their wife or a concubine is Orthodox
	convert_to_spouse_orthodox = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = orthodox
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = orthodox
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = orthodox
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Paulician faith if their wife or a concubine is Paulician
	convert_to_spouse_paulician = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = paulician
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = paulician
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = paulician
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Sunni faith if their wife or a concubine is Sunni
	convert_to_spouse_sunni = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = sunni
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = sunni
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = sunni
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Zikri faith if their wife or a concubine is Zikri
	convert_to_spouse_zikri = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = zikri
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = zikri
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = zikri
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Yazidi faith if their wife or a concubine is Yazidi
	convert_to_spouse_yazidi = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = yazidi
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = yazidi
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = yazidi
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Ibadi faith if their wife or a concubine is Ibadi
	convert_to_spouse_ibadi = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = ibadi
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = ibadi
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = ibadi
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Kharijite faith if their wife or a concubine is Kharijite
	convert_to_spouse_kharijite = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = kharijite
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = kharijite
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = kharijite
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Shiite faith if their wife or a concubine is Shiite
	convert_to_spouse_shiite = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = shiite
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = shiite
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = shiite
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Druze faith if their wife or a concubine is Druze
	convert_to_spouse_druze = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = druze
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = druze
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = druze
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Hurufi faith if their wife or a concubine is Hurufi
	convert_to_spouse_hurufi = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = hurufi
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = hurufi
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = hurufi
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Zoroastrian faith if their wife or a concubine is a believer
	convert_to_spouse_zoroastrian = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = zoroastrian
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = zoroastrian
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = zoroastrian
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Mazdaki faith if their wife or a concubine is a believer
	convert_to_spouse_mazdaki = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = mazdaki
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = mazdaki
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = mazdaki
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Manichean faith if their wife or a concubine is a believer
	convert_to_spouse_manichean = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = manichean
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = manichean
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = manichean
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Miaphysite faith if their wife or a concubine is a believer
	convert_to_spouse_miaphysite = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = miaphysite
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = miaphysite
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = miaphysite
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Monophysite faith if their wife or a concubine is a believer
	convert_to_spouse_monophysite = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = monophysite
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = monophysite
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = monophysite
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Jewish faith if their wife or a concubine is a believer
	convert_to_spouse_jewish = {
		potential = {
			ai = no
			has_dlc = "Sons of Abraham"
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = jewish
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = jewish
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = jewish
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	# Pagans can convert to the Samaritan faith if their wife or a concubine is a believer
	convert_to_spouse_samaritan = {
		potential = {
			ai = no
			has_dlc = "Sons of Abraham"
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = samaritan
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = samaritan
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = samaritan
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	# Pagans can convert to the Karaite faith if their wife or a concubine is a believer
	convert_to_spouse_karaite = {
		potential = {
			ai = no
			has_dlc = "Sons of Abraham"
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = karaite
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = karaite
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = karaite
			
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	convert_to_hinduism = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = indian_group
			NOT = { religion = hindu }
			is_theocracy = no
		}
		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 }
			}
		}
		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 = 1

			modifier = { # Slow down
				factor = 0.1
			}
			modifier = { # Don't convert away from liege's religion
				factor = 0
				liege = { religion = ROOT }
			}
			modifier = { # Don't start rocking the boat if all your provinces are under foreign religious influence
				factor = 0
				NOT = {
					any_realm_province = {
						religion_group = indian_group
					}
				}
			}
			modifier = { # NEVER consider it unless your liege or, if independent, all your vassals are Hindu and they don't like you
				factor = 0
				NOT = {
					OR = {
						AND = {
							independent = yes
							NOT = {
								any_vassal = {
									NOT = { religion = hindu }
								}
							}
							NOT = {
								any_vassal = {
									opinion = {
										who = ROOT
										value = 25
									}
								}
							}
						}
						AND = {
							liege = { religion = hindu }
							opinion = {
								who = liege
								value = 25
							}
						}
					}
				}
			}
			modifier = { # More likely to do it sooner
				factor = 3
				trait = cynical
			}
			modifier = { # Sometimes you really need to hurry up
				factor = 5
				higher_tier_than = DUKE
				num_of_vassals = 5
			}
		}
	}

	convert_to_buddhism = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = indian_group
			NOT = { religion = buddhist }
			is_theocracy = no
		}
		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 = 1

			modifier = { # Slow down
				factor = 0.1
			}
			modifier = { # Don't convert away from liege's religion
				factor = 0
				liege = { religion = ROOT }
			}
			modifier = { # Don't start rocking the boat if all your provinces are under foreign religious influence
				factor = 0
				NOT = {
					any_realm_province = {
						religion_group = indian_group
					}
				}
			}
			modifier = { # NEVER consider it unless your liege or, if independent, all your vassals are Buddhist and they don't like you
				factor = 0
				NOT = {
					OR = {
						AND = {
							independent = yes
							NOT = {
								any_vassal = {
									NOT = { religion = buddhist }
								}
							}
							NOT = {
								any_vassal = {
									opinion = {
										who = ROOT
										value = 25
									}
								}
							}
						}
						AND = {
							liege = { religion = buddhist }
							opinion = {
								who = liege
								value = 25
							}
						}
					}
				}
			}
			modifier = { # More likely to do it sooner
				factor = 3
				trait = cynical
			}
			modifier = { # Sometimes you really need to hurry up
				factor = 5
				higher_tier_than = DUKE
				num_of_vassals = 5
			}
		}
	}

	convert_to_jainism = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = indian_group
			NOT = { religion = jain }
			is_theocracy = no
		}
		allow = {
			is_adult = yes
			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 = 1

			modifier = { # Slow down
				factor = 0.1
			}
			modifier = { # Don't convert away from liege's religion
				factor = 0
				liege = { religion = ROOT }
			}
			modifier = { # Don't start rocking the boat if all your provinces are under foreign religious influence
				factor = 0
				NOT = {
					any_realm_province = {
						religion_group = indian_group
					}
				}
			}
			modifier = { # NEVER consider it unless your liege or, if independent, all your vassals are Jain and they don't like you
				factor = 0
				NOT = {
					OR = {
						AND = {
							independent = yes
							NOT = {
								any_vassal = {
									NOT = { religion = jain }
								}
							}
							NOT = {
								any_vassal = {
									opinion = {
										who = ROOT
										value = 25
									}
								}
							}
						}
						AND = {
							liege = { religion = jain }
							opinion = {
								who = liege
								value = 25
							}
						}
					}
				}
			}
			modifier = { # More likely to do it sooner
				factor = 3
				trait = cynical
			}
			modifier = { # Sometimes you really need to hurry up
				factor = 5
				higher_tier_than = DUKE
				num_of_vassals = 5
			}
		}
	}

	convert_indian_branch = {
		potential = {
			ai = no
			is_playable = yes
			is_adult = yes
			is_theocracy = no
			religion_group = indian_group
		}
		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
		}
	}

	# Pagans can convert to the Hindu faith if their wife or a concubine is a believer
	convert_to_spouse_hindu = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = hindu
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = hindu
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			prestige = -500
			religion_authority = {
				modifier = ruler_converted_from
			}
			
			if = {
				limit = {
					trait = cynical
				}
				random = {
					chance = 60
					add_trait = sympathy_pagan
				}
			}
			if = {
				limit = {
					NOT = { trait = cynical }
				}
				random = {
					chance = 50
					add_trait = sympathy_pagan
				}
			}		
			
			religion = hindu

			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = shaivist_hindu
					}
				}
				add_trait = shaivist_hindu
			}
			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = vaishnavist_hindu
					}
				}
				add_trait = vaishnavist_hindu
			}
			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = shaktist_hindu
					}
				}
				add_trait = shaktist_hindu
			}
			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = smartist_hindu
					}
				}
				add_trait = smartist_hindu
			}
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	# Pagans can convert to the Buddhist faith if their wife or a concubine is a believer
	convert_to_spouse_buddhist = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = buddhist
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = buddhist
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = buddhist
			
			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = mahayana_buddhist
					}
				}
				add_trait = mahayana_buddhist
			}
			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = vajrayana_buddhist
					}
				}
				add_trait = vajrayana_buddhist
			}
			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = theravada_buddhist
					}
				}
				add_trait = theravada_buddhist
			}
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	# Pagans can convert to the Jain faith if their wife or a concubine is a believer
	convert_to_spouse_jain = {
		potential = {
			ai = no
			is_playable = yes
			religion_group = pagan_group
			controls_religion = no
			NOT = { trait = zealous }
			OR = {
				any_spouse = {
					religion = jain
					hidden_tooltip = {
						is_alive = yes
					}
				}
				any_consort = {
					religion = jain
					hidden_tooltip = {
						is_alive = yes
					}
				}
			}
		}
		
		effect = {
			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 = jain
			
			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = digambara_jain
					}
				}
				add_trait = digambara_jain
			}
			if = {
				limit = {
					any_courtier = {
						OR = {
							spouse = { character = ROOT }
							is_consort = ROOT
						}
						religion = hindu
						hidden_tooltip = {
							is_alive = yes
						}
						trait = svetambara_jain
					}
				}
				add_trait = svetambara_jain
			}
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
			piety = 200
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}

	# Carolingian renaissance - Old Frankish conversion to French
	convert_to_french = {
		potential = {
			culture = old_frankish
			is_ruler = yes
			capital_scope = {
				kingdom = { title = k_france }
			}
			any_realm_province = {
				culture = frankish
			}
		}
		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.2 # 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 = {
					num = 2
					culture = frankish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = frankish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = frankish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = frankish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = frankish
				}
			}
		}
	}
	
	# Pictish character may convert to Scottish
	convert_to_scottish = {
		potential = {
			culture = pictish
			is_ruler = yes
			capital_scope = {
				kingdom = { title = k_scotland }
			}
			any_realm_province = {
				culture = scottish
			}
		}
		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.2 # 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 = {
					num = 2
					culture = scottish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = scottish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = scottish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = scottish
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = scottish
				}
			}
		}
	}
	
	# Arabic or Visigothic character may convert to Andalusian
	convert_to_andalusian = {
		potential = {
			is_ruler = yes
			OR = {
				religion_group = muslim
				top_liege = { religion_group = muslim }
			}
			OR = {
				culture = visigothic
				culture_group = arabic
			}
			capital_scope = {
				kingdom = { title = k_andalusia }
			}
			any_realm_province = {
				culture = andalusian_arabic
			}
			NOT = {
				culture = andalusian_arabic
			}
		}
		effect = {
			culture = andalusian_arabic
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = andalusian_arabic
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.2 # 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 = {
					num = 2
					culture = andalusian_arabic
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = andalusian_arabic
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = andalusian_arabic
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = andalusian_arabic
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = andalusian_arabic
				}
			}
		}
	}

	# Visigothic character may convert to Castillan
	convert_to_castillan = {
		potential = {
			is_ruler = yes
			culture = visigothic
			religion_group = christian
			capital_scope = {
				OR = {
					kingdom = { title = k_castille }
					kingdom = { title = k_asturias }
					kingdom = { title = k_leon }
				}
			}
			any_realm_province = {
				culture = castillan
			}
		}
		allow = {
			culture = visigothic
		}
		effect = {
			culture = castillan
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = castillan
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.2 # 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 = {
					num = 2
					culture = castillan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = castillan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = castillan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = castillan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = castillan
				}
			}
		}
	}	

	# Visigothic character may convert to catalan
	convert_to_catalan = {
		potential = {
			is_ruler = yes
			culture = visigothic
			religion_group = christian
			capital_scope = {
				kingdom = { title = k_aragon }
			}
			any_realm_province = {
				culture = catalan
			}
		}
		allow = {
			culture = visigothic
		}
		effect = {
			culture = catalan
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = catalan
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.2 # 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 = {
					num = 2
					culture = catalan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = catalan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = catalan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = catalan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = catalan
				}
			}
		}
	}	

	# Suebi or Visigothic character may convert to Portuguese
	convert_to_portuguese = {
		potential = {
			is_ruler = yes
			OR = {
				culture = suebi
				culture = visigothic
			}
			religion_group = christian
			capital_scope = {
				OR = {
					kingdom = { title = k_portugal }
					kingdom = { title = k_spanish_galicia }
				}
			}
			any_realm_province = {
				culture = portuguese
			}
		}
		allow = {
			OR = {
				culture = suebi
				culture = visigothic
			}
		}
		effect = {
			culture = portuguese
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = portuguese
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.2 # 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 = {
					num = 2
					culture = portuguese
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = portuguese
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = portuguese
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = portuguese
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = portuguese
				}
			}
		}
	}
	
	# Old Frankish or Old Saxon character may convert to dutch
	convert_to_dutch = {
		potential = {
			is_ruler = yes
			OR = {
				culture = old_frankish
				culture = old_saxon
				culture = frisian
			}
			capital_scope = {
				kingdom = { title = k_frisia }
			}
			any_realm_province = {
				culture = dutch
			}
		}
		allow = {
			culture = ROOT
		}
		effect = {
			culture = dutch
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = dutch
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.2 # 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 = {
					num = 2
					culture = dutch
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = dutch
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = dutch
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = dutch
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = dutch
				}
			}
		}
	}
	
	# Lombard character may convert to italian
	convert_to_italian = {
		potential = {
			is_ruler = yes
			culture = lombard
			capital_scope = {
				empire = { title = e_italy }
			}
			any_realm_province = {
				culture = italian
			}
			OR = {
				year = 786
				top_liege = {
					NOT = { culture = lombard }
				}
			}
		}
		allow = {
			culture = lombard
			capital_scope = {
				empire = { title = e_italy }
			}
			any_realm_province = {
				culture = italian
			}
		}
		effect = {
			culture = italian
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = italian
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0
				OR = {
					independent = yes
					top_liege = { culture = lombard }
				}
			}

			modifier = {
				factor = 0.1 # 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 = {
					num = 2
					culture = italian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = italian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = italian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = italian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = italian
				}
			}
		}
	}
	
	# Visigothic character may convert to occitan
	convert_to_occitan = {
		potential = {
			is_ruler = yes
			religion_group = christian
			culture = visigothic
			capital_scope = {
				empire = { title = e_france }
			}
			any_realm_province = {
				culture = occitan
			}
		}
		allow = {
			culture = ROOT
		}
		effect = {
			culture = occitan
			any_courtier = {
				limit = {
					culture = ROOT
					employer = { character = ROOT }
					dynasty = ROOT
				}
				culture = occitan
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.2 # 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 = {
					num = 2
					culture = occitan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = occitan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = occitan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = occitan
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = occitan
				}
			}
		}
	}

	# East Slavic character may convert to Russian
	convert_to_russian = {
		potential = {
			culture_group = east_slavic
			NOT = { culture = russian }
			is_ruler = yes
			any_realm_province = {
				culture = russian
			}
		}
		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.2 # 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 = {
					num = 2
					culture = russian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 4
					culture = russian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 6
					culture = russian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 8
					culture = russian
				}
			}
			modifier = {
				factor = 1.1
				num_culture_realm_provs = {
					num = 10
					culture = russian
				}
			}
		}
	}

	# Byzantine Emperor may renounce Iconoclasm
	renounce_iconoclasm = {
		potential = {
			has_dlc = "Charlemagne"
			has_landed_title = e_byzantium
			religion = iconoclast
			NOT = { has_character_flag = renounced_iconoclasm }
		}
		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 = {
					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 }
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # slow it down
			}
			modifier = {
				factor = 3
				trait = cynical
			}
		}
	}
}