namespace = Archeveque_orthodox
######################################
####### Orthodox			   #######
######################################
character_event = {
	id = Archeveque_orthodox.1
	hide_window = yes
	is_triggered_only = yes	
	trigger = {
		FROMFROM = {
			any_courtier = {
				has_minor_title = title_archdeacon_orthodox
			}
		}
	}
	immediate = {
		FROMFROM = {
			any_courtier = {
				limit = {
					has_minor_title = title_archdeacon_orthodox
				}
				set_character_flag = Archeveque_orthodox_successor_of_@PREV
				save_event_target_as = pope_heir_orthodox
			}
			abdicate_to = event_target:pope_heir_orthodox
			remove_claim = FROM
			transfer_scaled_wealth = {
				to = event_target:pope_heir_orthodox
				value = all
			}
			any_artifact = {
				transfer_artifact = {
					from = ROOT
					to = event_target:pope_heir_orthodox
				}
			}
			event_target:pope_heir_orthodox = {
				religion = orthodox
	#			set_government_type = theocracy_government
				remove_title = title_archdeacon_orthodox
			}
			set_character_flag = Archeveque_has_successor_orthodox
		}
		FROMFROM = {
			any_courtier = {
				move_character = event_target:pope_heir_orthodox
			}
		}
	}
}

character_event = {
	id = Archeveque_orthodox.2
	hide_window = yes
	is_triggered_only = yes	
	trigger = {
		FROMFROM = {
			has_character_flag = Archeveque_has_successor_orthodox
		}
	}
	immediate = {
		any_character = {
			limit = {
				has_character_flag = Archeveque_orthodox_successor_of_@FROMFROM
			}
			save_event_target_as = pope_heir_orthodox
			clr_character_flag = Archeveque_orthodox_successor_of_@FROMFROM
		}
		abdicate_to = event_target:pope_heir_orthodox
		remove_claim = FROM
		event_target:pope_heir_orthodox = {
	#		set_government_type = theocracy_government
			remove_title = title_archdeacon_orthodox
		}
		clr_character_flag = Archeveque_has_successor_orthodox
		k_orthodox = {
			holder_scope = {
				character_event = {
					id = Archeveque_orthodox.4
				#	days = 1
				}
			}
		}
	}
}

character_event = {
	id = Archeveque_orthodox.3
	hide_window = yes
	is_triggered_only = yes
	trigger = {
		has_minor_title = title_archdeacon_orthodox
	}
	immediate = {
		any_courtier = {
			limit = {
				has_minor_title = title_archdeacon_orthodox
			}
			k_orthodox = {
				holder_scope = {
					save_event_target_as = pope_Archeveque_orthodox
				}
			}
			move_character = event_target:pope_Archeveque_orthodox
	#		set_government_type = feudal_government
			remove_title = title_archdeacon_orthodox
		}	
	}
}

character_event = {
    id = Archeveque_orthodox.4
    desc = EVTDESC_Archeveque_orthodox_4
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	portrait = event_target:pope_heir_orthodox
    option = {
        name = OK
    }
}

character_event = {
	id = Archeveque_orthodox.5
	hide_window = yes
	only_rulers = yes
	mean_time_to_happen = { 
		days = 1
	}
	trigger = {
		any_courtier = {
			has_minor_title = title_archdeacon_orthodox
		}
		OR = {
			any_liege = {
				has_claim = k_orthodox
			}	
			has_claim = k_orthodox
			any_vassal = {
				has_claim = k_orthodox
			}
			top_liege = {
				any_realm_character = {
					has_claim = k_orthodox
				}
			}
			NOT = {
				is_theocracy = yes
			}
			NOT = {
				religion = orthodox
			}
		#	crownlaw_title = {
		#		holder_scope = {
		#			is_liege_or_above_of = ROOT
		#			has_law = investiture_law_1
		#		}	
		#	}
		}
	}
	immediate = {
		k_orthodox = {
			holder_scope = {
				save_event_target_as = pope_Archeveque_orthodox
			}
		}
		any_realm_character = {
			limit = {
				has_minor_title = title_archdeacon_orthodox
			}
			move_character = event_target:pope_Archeveque_orthodox
	#		set_government_type = feudal_government
			remove_title = title_archdeacon_orthodox
		}
	}
}

character_event = {
	id = Archeveque_orthodox.6
	hide_window = yes
	is_triggered_only = yes	
	only_rulers = yes
	trigger = {
		any_courtier = {
			has_minor_title = title_archdeacon_orthodox
		}
		OR = {
			any_liege = {
				has_claim = k_orthodox
			}	
			has_claim = k_orthodox
			any_vassal = {
				has_claim = k_orthodox
			}
			top_liege = {
				any_realm_character = {
					has_claim = k_orthodox
				}
			}
			NOT = {
				is_theocracy = yes
			}
			NOT = {
				religion = orthodox
			}
		#	crownlaw_title = {
		#		holder_scope = {
		#			is_liege_or_above_of = ROOT
		#			has_law = investiture_law_1
		#		}	
		#	}
		}
	}
	immediate = {
		k_orthodox = {
			holder_scope = {
				save_event_target_as = pope_Archeveque_orthodox
			}
		}
		any_realm_character = {
			limit = {
				has_minor_title = title_archdeacon_orthodox
			}
			move_character = event_target:pope_Archeveque_orthodox
	#		set_government_type = feudal_government
			remove_title = title_archdeacon_orthodox
		}
	}
}