﻿on_game_start_cad_867 = {
	trigger = {
		game_start_date = 867.1.1
	}
	effect = {
		every_county = {
			if = {
				limit = {
					title_province = { geographical_region = 867_paulician_region }
				}
				set_county_faith = faith:paulician
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_tondrakian_region }
				}
				set_county_faith = faith:tondrakian
			}
			else_if = {
				limit = {
					AND = {
						religion = religion:christianity_religion
						title_province = { geographical_region = 867_bohemian_church_region }
					}
				}
				set_county_faith = faith:bohemian_catholic
			}
			else_if = {
				limit = {
					AND = {
						religion = religion:christianity_religion
						title_province = { geographical_region = 867_ambrosian_region }
					}
				}
				set_county_faith = faith:ambrosian
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_julianist_region }
				}
				set_county_faith = faith:julianists
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_maphrianate_region }
				}
				set_county_faith = faith:maphrianate
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_irenopolis_melkite_region }
				}
				set_county_faith = faith:irenopolis_melkite
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_marcionite_region }
				}
				set_county_faith = faith:marcionism
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_jacobite_region }
				}
				set_county_faith = faith:jacobite
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_carthage_region }
				}
				set_county_faith = faith:african_church
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_jovinianism_region }
				}
				set_county_faith = faith:jovinianism
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_maronite_region }
				}
				set_county_faith = faith:maronite
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_gaianite_region }
				}
				set_county_faith = faith:gaianites
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_romagyris_melkite_region }
				}
				set_county_faith = faith:romagyris_melkite
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_barsanuphians_region }
				}
				set_county_faith = faith:barsanuphianism
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_ivirs_region }
				}
				set_county_faith = faith:ivirs
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_tsat_region }
				}
				set_county_faith = faith:tsat
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_albanian_apostolic_region }
				}
				set_county_faith = faith:albanian_apostolic
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_ebionites_region }
				}
				set_county_faith = faith:ebionites
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_tascodrugites_region }
				}
				set_county_faith = faith:tascodrugites
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_novatianism_region }
				}
				set_county_faith = faith:novatianism
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_isawites_region }
				}
				set_county_faith = faith:isawites
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_yudghanites_region }
				}
				set_county_faith = faith:yudghanites
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_himyarites_region }
				}
				set_county_faith = faith:himyarites
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_elchasaites_region }
				}
				set_county_faith = faith:elcesaites
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 867_sabians_region }
				}
				set_county_faith = faith:sabianism
			}
		}

		every_ruler = {
			if = {
				limit = {
					AND = {
						has_faith = faith:catholic
						capital_province = { geographical_region = 867_bohemian_church_region }
					}
				}
				set_character_faith_with_conversion = faith:bohemian_catholic
			}
		}

		faith:bulgarian_orthodox = {
			remove_doctrine = orthodox_autocephaly_autocephalous
			add_doctrine = unavailable_doctrine
			remove_doctrine = tenet_unreformed_syncretism
			remove_doctrine = tenet_adaptive
			add_doctrine = tenet_communion
			add_doctrine = tenet_monasticism
		}
		faith:african_church = { 
			add_doctrine = special_doctrine_ecumenical_christian
		}
		faith:maphrianate = {
			remove_doctrine = special_doctrine_council_capharthutha
		}
		faith:jacobite = {
			remove_doctrine = special_doctrine_council_capharthutha
		}
	}
}

on_game_start_cad_1066 = {
	trigger = {
		game_start_date = 1066.9.15
	}
	effect = {
		every_county = {
			if = {
				limit = {
					AND = {
						faith = faith:orthodox
						title_province = { geographical_region = 1066_bulgarian_church_region  }
					}
				}
				set_county_faith = faith:bulgarian_orthodox
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1066_paulician_region }
				}
				set_county_faith = faith:paulician
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1066_maphrianate_region }
				}
				set_county_faith = faith:maphrianate
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1066_jacobite_region }
				}
				set_county_faith = faith:jacobite
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1066_maronite_region }
				}
				set_county_faith = faith:maronite
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1066_byzantine_uniate_region }
				}
				set_county_faith = faith:byzantine_uniate
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1066_patarines_region }
				}
				set_county_faith = faith:patarines
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1066_berengarian_region }
				}
				set_county_faith = faith:berengarism
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1066_albanian_apostolic_region }
				}
				set_county_faith = faith:albanian_apostolic
			}
		}
		every_ruler = {
			if = {
				limit = {
					AND = {
						has_faith = faith:orthodox
						culture = culture:bulgarian
					}
				}
				set_character_faith_with_conversion = faith:bulgarian_orthodox
			}
		}
		faith:bohemian_catholic = {
			add_doctrine = unavailable_doctrine
		}
	}
}

on_game_start_cad_1178 = {
	trigger = {
		game_start_date = 1178.10.1
	}
	effect = {
		every_county = {
			if = {
				limit = {
					AND = {
						faith = faith:orthodox
						title_province = { geographical_region = 1066_bulgarian_church_region  }
					}
				}
				set_county_faith = faith:bulgarian_orthodox
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_albanian_apostolic_region }
				}
				set_county_faith = faith:albanian_apostolic
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_maronite_region }
				}
				set_county_faith = faith:maronite
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_henrician_region }
				}
				set_county_faith = faith:henricians
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_arnoldist_region }
				}
				set_county_faith = faith:arnoldists
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_petrobrusian_region }
				}
				set_county_faith = faith:petrobrusians
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_waldensian_region }
				}
				set_county_faith = faith:waldensian
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_albanenses_region }
				}
				set_county_faith = faith:albanenses
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_bagnolenses_region }
				}
				set_county_faith = faith:bagnolenses
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_concorezzenses_region }
				}
				set_county_faith = faith:concorezzenses
			}
			else_if = {
				limit = {
					title_province = { geographical_region = 1178_pasagian_region }
				}
				set_county_faith = faith:pasagianism
			}
		}
		every_ruler = {
			if = {
				limit = {
					AND = {
						has_faith = faith:orthodox
						culture = culture:bulgarian
					}
				}
				set_character_faith_with_conversion = faith:bulgarian_orthodox
			}
		}
		faith:bohemian_catholic = {
			add_doctrine = unavailable_doctrine
		}
		faith:maronite = {
			remove_doctrine = doctrine_christology_monothelite
			add_doctrine = doctrine_christology_diophysite
			add_doctrine = catholic_autocephaly_autocephalous
		}
		faith:cathar = {
			remove_doctrine = doctrine_hierarchy_congregational
			add_doctrine = doctrine_hierarchy_episcopal
		}
	}
}