namespace = vassalize_priest
character_event = {
	id = vassalize_priest.250001
	desc = vassalize_priest.250001.desc
	picture = "GFX_evt_bishop"
	is_triggered_only = yes
	
	immediate = {
	while = {
		limit = {
			any_demesne_title = {
				holding_type = temple
				tier = baron
				NOT = { tier = count }
				is_capital = no
			}
		}
		if = {
			limit = {
				any_demesne_title = {
					holding_type = temple
					tier = baron
					NOT = { tier = count }
					is_capital = no
				}
				OR = {
					religion = norse_pagan
					religion = norse_pagan_reformed
					religion = cathar
				}
			}
			create_random_priest = {
				random_traits = yes
				dynasty = none
				female = yes
				religion = ROOT
				culture = ROOT
			}
			new_character = {
				set_defacto_liege = ROOT
				if = { limit = { trait = ambitious } remove_trait = ambitious }
				liege = {
					random_demesne_title = {
						limit = {
							holding_type = temple
							tier = baron
							NOT = { tier = count }
							is_capital = no
						}
						grant_title = PREVPREV
					}
				}
			}
		}
		if = {
			limit = {
				any_demesne_title = {
					holding_type = temple
					tier = baron
					NOT = { tier = count }
					is_capital = no
				}
				NOR = {
					religion = norse_pagan
					religion = norse_pagan_reformed
					religion = cathar
				}
			}
			create_random_priest = {
				random_traits = yes
				dynasty = none
				female = no
				religion = ROOT
				culture = ROOT
			}
			new_character = {
				set_defacto_liege = ROOT
				if = { limit = { trait = ambitious } remove_trait = ambitious }
				liege = {
					random_demesne_title = {
						limit = {
							holding_type = temple
							tier = baron
							NOT = { tier = count }
							is_capital = no
						}
						grant_title = PREVPREV
					}
				}
			}
		}
	}
	}
	
	option = {
		name = vassalize_priest.250001.opta
	}
}