namespace = sang-pape-fraticelli
######################################
####### Vatican				   #######
######################################
character_event = {
    id = sang-pape-fraticelli.1
	hide_window = yes
	is_triggered_only = yes	
	only_rulers = yes
    trigger = {
		is_alive = yes
        trait = Pape-Fraticelli
		NOT = {
			trait = trait_Sede_Vacante
		}
        NOT = {
			any_owned_bloodline = {
				has_bloodline_flag = Pape-Fraticelli_bloodline
				founder = {
					character = ROOT
				}
			}	
		}
    }
    immediate = {
		if = {
			limit = {
				not = {
					any_owned_bloodline = {
						has_bloodline_flag = Pape-Fraticelli_bloodline
						founder = {
							character = ROOT
						}
					}
				}
			}
			create_bloodline = {
				type = Pape-Fraticelli_bloodline
				inheritance = all_descendants
			}
		}
    }
}

character_event = {
    id = sang-pape-fraticelli.2
    hide_window = yes
    is_triggered_only = yes
    only_rulers = yes
    trigger = {
        FROM = {
			title = d_fraticelli 
		}
		FROMFROM = {
            is_alive = yes
			is_dying = no
            NOT = {
                has_landed_title = d_fraticelli
            }
            any_owned_bloodline = {
                has_bloodline_flag = Pape-Fraticelli_bloodline
                founder = {
                    character = ROOT_FROMFROM
                }
            }
        }
    }
    immediate = {
        FROMFROM = {
            any_bloodline = {
                limit = {
                    has_bloodline_flag = Pape-Fraticelli_bloodline
                    founder = {
                        character = ROOT_FROMFROM
                    }
                }
                destroy_bloodline = yes
            }
        }
    }
}