namespace = HF

# Written by Joachim
# HF.40100 - HF.40199

# Check if a character is eligible for Worshipping
character_event = {
	id = HF.40100

	is_triggered_only = yes # on_death
	hide_window = yes

	only_playable = yes
	has_dlc = "Holy Fury"
	min_age = 16

	trigger = {
		death_in_china_trigger = no
		death_no_trace_trigger = no
		prestige >= 1000
		OR = {
			has_religion_feature = religion_beatification
			### ACR ###
			has_religion_feature = religion_feature_baltic
			has_religion_feature = religion_feature_egyptian
			religion = britannic_pagan
		}

		OR = {
			has_religion_feature = religion_temporal_head
			has_religion_feature = religion_theocratic_head
			has_religion_feature = religion_autocephaly
			### ACR ###
			religion = britannic_pagan
		}
	}

	immediate = {
		save_event_target_as = saint_person
		check_if_ancestor_worship_worthy_effect = yes
	}
}

# Religious Head is notified about potential Ancestor material
character_event = {
	id = HF.40101
	desc = EVTDESC_HF_40020_B
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # check_if_ancestor_worship_worthy_effect, through HF.40100

	immediate = {
		sound_effect = saint_proclaimed
		save_event_target_as = canonizer_person
	}

	option = {
		name = EVTOPTA_HF_40020

		custom_tooltip = {
			text = pagan_pope_cannonize_choice_TT

			# Titles and Bloodlines
			event_target:saint_person = {
				set_special_character_title = BLESSED_TITLE

				random_list = {
					10 = {
						mult_modifier = {
							factor = 0.4

							any_owned_bloodline = {
								has_bloodline_flag = bloodline_heroes
								bloodline_is_active_for = PREV
							}
						}

						if = {
							limit = { is_female = yes }

							create_bloodline = {
								type = ancestor_worship_bloodline_01
								religion = event_target:saint_person
								inheritance = matrilineal
							}
						}
						else = {
							create_bloodline = {
								type = ancestor_worship_bloodline_01
								religion = event_target:saint_person
							}
						}

						if = {
							limit = { can_apply_average_nickname_trigger = yes }
							give_nickname = nick_the_great
						}
					}

					30 = {
						trigger = {
							OR = {
								trait = bastard
								trait = legit_bastard
								### ACR ###
								trait = child_of_consort
								trait = child_of_consort_male
							}
						}

						mult_modifier = {
							factor = 0.1

							any_owned_bloodline = {
								has_bloodline_flag = bloodline_legitimize
								bloodline_is_active_for = PREV
							}
						}

						if = {
							limit = { is_female = yes }

							create_bloodline = {
								type = ancestor_worship_bloodline_02
								religion = event_target:saint_person
								inheritance = matrilineal
							}
						}
						else = {
							create_bloodline = {
								type = ancestor_worship_bloodline_02
								religion = event_target:saint_person
							}
						}

						if = {
							limit = { can_apply_lame_nickname_trigger = yes }
							give_nickname = nick_the_bastard
						}
					}

					20 = {
						trigger = {
							OR = {
								religion_openly_bon_or_reformed_trigger = yes

								trigger_if = {
									limit = { is_nomadic = yes }
									religion_openly_tengri_or_reformed_trigger = yes
								}
								
								### ACR ###
								trait = falconer
								trait = hunter
							}
						}

						mult_modifier = {
							factor = 0.2

							any_owned_bloodline = {
								has_bloodline_flag = bloodline_sky_burial
								bloodline_is_active_for = PREV
							}
						}

						if = {
							limit = { is_female = yes }

							create_bloodline = {
								type = ancestor_worship_bloodline_03
								religion = event_target:saint_person
								inheritance = matrilineal
							}
						}
						else = {
							create_bloodline = {
								type = ancestor_worship_bloodline_03
								religion = event_target:saint_person
							}
						}

						if = {
							limit = { can_apply_average_nickname_trigger = yes }
							give_nickname = nick_the_guide
						}
					}

					20 = {
						trigger = {
							OR = {
								is_nomadic = yes
								### ACR ###
								trait = adventurer
								trait = peasant_leader 
								trait = varangian
								trait = fian
								trait = celtic_knight
								trait = wolf
								trait = toe_guard
								trait = toe_guard_captain
								trait = inspiring_leader 
							}
						}

						mult_modifier = {
							factor = 0.1

							any_owned_bloodline = {
								has_bloodline_flag = bloodline_mercenary_traditions
								bloodline_is_active_for = PREV
							}
						}

						if = {
							limit = { is_female = yes }

							create_bloodline = {
								type = ancestor_worship_bloodline_04
								religion = event_target:saint_person
								inheritance = matrilineal
							}
						}
						else = {
							create_bloodline = {
								type = ancestor_worship_bloodline_04
								religion = event_target:saint_person
							}
						}

						if = {
							limit = { can_apply_cool_nickname_trigger = yes }
							give_nickname = nick_the_scourge
						}
					}

					30 = {
						trigger = {
							OR = {
								has_law = succ_tanistry
								### ACR ###
								trait = twin
								trigger_if = {
									limit = {
										OR = {
											has_education_diplomacy_trigger = yes
											has_lifestyle_diplomacy_trigger = yes
										}
									}
									OR = {
										trait = child_of_consort
										trait = child_of_consort_male
									}
								}
							}
						}

						mult_modifier = {
							factor = 0.1

							any_owned_bloodline = {
								has_bloodline_flag = bloodline_tanistry
								bloodline_is_active_for = PREV
							}
						}

						if = {
							limit = { is_female = yes }

							create_bloodline = {
								type = ancestor_worship_bloodline_05
								religion = event_target:saint_person
								inheritance = matrilineal
							}
						}
						else = {
							create_bloodline = {
								type = ancestor_worship_bloodline_05
								religion = event_target:saint_person
							}
						}

						if = {
							limit = { can_apply_cool_nickname_trigger = yes }
							give_nickname = nick_the_lawgiver
						}
					}

					30 = {
						trigger = {
							OR = {
								this_is_sea_raider_trigger = yes
								### ACR ###
								trait = adventurer
								trait = aggressive_leader
							}
						}

						mult_modifier = {
							factor = 0.1

							any_owned_bloodline = {
								has_bloodline_flag = more_raiders_bloodline
								bloodline_is_active_for = PREV
							}
						}

						if = {
							limit = { is_female = yes }

							create_bloodline = {
								type = ancestor_worship_bloodline_06
								religion = event_target:saint_person
								inheritance = matrilineal
							}

							if = {
								limit = { can_apply_cool_nickname_trigger = yes }
								give_nickname = nick_the_valkyrie
							}
						}
						else = {
							create_bloodline = {
								type = ancestor_worship_bloodline_06
								religion = event_target:saint_person
							}

							if = {
								limit = { can_apply_cool_nickname_trigger = yes }
								give_nickname = the_unrestrained
							}
						}
					}

					20 = {
						trigger = {
							OR = {
								trait = duelist
								### ACR ###
								trait = scarred_mid 
								trait = scarred_high
							}
						}

						mult_modifier = {
							factor = 0.1

							any_owned_bloodline = {
								has_bloodline_flag = duelist_bloodline
								bloodline_is_active_for = PREV
							}
						}

						if = {
							limit = { is_female = yes }

							create_bloodline = {
								type = ancestor_worship_bloodline_07
								religion = event_target:saint_person
								inheritance = matrilineal
							}
						}
						else = {
							create_bloodline = {
								type = ancestor_worship_bloodline_07
								religion = event_target:saint_person
							}
						}

						if = {
							limit = { can_apply_average_nickname_trigger = yes }
							give_nickname = nick_bloodaxe
						}
					}
				
					### ACR ###
					30 = {
						trigger = {
							OR = {
								trait = zealous
								trait = holy_warrior
								has_crusade_trait_trigger = yes
								trait = shieldmaiden
							}
						}
						if = {
							limit = { religion = norse_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_germanic_01
									religion = norse_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_germanic_01
									religion = norse_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = baltic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_romuva_01
									religion = baltic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_romuva_01
									religion = baltic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = slavic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_slavic_01
									religion = slavic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_slavic_01
									religion = slavic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = tengri_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_tengri_01
									religion = tengri_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_tengri_01
									religion = tengri_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = finnish_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_suomenusko_01
									religion = finnish_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_suomenusko_01
									religion = finnish_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = aztec_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_aztec_01
									religion = aztec_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_aztec_01
									religion = aztec_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = west_african_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_african_01
									religion = west_african_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_african_01
									religion = west_african_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = zun_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_zun_01
									religion = zun_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_zun_01
									religion = zun_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = hellenic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_hellenic_01
									religion = hellenic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_hellenic_01
									religion = hellenic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = celtic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_celtic_01
									religion = celtic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_celtic_01
									religion = celtic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = britannic_pagan }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_britannic_01
									religion = britannic_pagan
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_britannic_01
									religion = britannic_pagan
								}
							}
						}
						else_if = {
							limit = { religion = egyptian_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_egyptian_01
									religion = egyptian_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_egyptian_01
									religion = egyptian_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = bon_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_bon_01
									religion = bon_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_bon_01
									religion = bon_pagan_reformed
								}
							}
						}
						if = {
							limit = { can_apply_average_nickname_trigger = yes }
							give_nickname = nick_the_fearless
						}
					}
					10 = {
						if = {
							limit = { religion = norse_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_germanic_03
									religion = norse_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_germanic_03
									religion = norse_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = baltic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_romuva_03
									religion = baltic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_romuva_03
									religion = baltic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = slavic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_slavic_03
									religion = slavic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_slavic_03
									religion = slavic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = tengri_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_tengri_03
									religion = tengri_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_tengri_03
									religion = tengri_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = finnish_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_suomenusko_03
									religion = finnish_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_suomenusko_03
									religion = finnish_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = aztec_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_aztec_03
									religion = aztec_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_aztec_03
									religion = aztec_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = west_african_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_african_03
									religion = west_african_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_african_03
									religion = west_african_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = zun_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_zun_03
									religion = zun_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_zun_03
									religion = zun_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = hellenic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_hellenic_03
									religion = hellenic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_hellenic_03
									religion = hellenic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = celtic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_celtic_03
									religion = celtic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_celtic_03
									religion = celtic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = britannic_pagan }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_britannic_03
									religion = britannic_pagan
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_britannic_03
									religion = britannic_pagan
								}
							}
						}
						else_if = {
							limit = { religion = egyptian_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_egyptian_03
									religion = egyptian_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_egyptian_03
									religion = egyptian_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = bon_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_bon_03
									religion = bon_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_bon_03
									religion = bon_pagan_reformed
								}
							}
						}
						if = {
							limit = { can_apply_average_nickname_trigger = yes }
							give_nickname = nick_the_righteous
						}
					}
					30 = {
						trigger = {
							OR = {
								trait = zealous
								trait = holy_warrior
								has_crusade_trait_trigger = yes
								trait = shieldmaiden
							}
						}
						if = {
							limit = { religion = norse_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_germanic_04
									religion = norse_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_germanic_04
									religion = norse_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = baltic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_romuva_04
									religion = baltic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_romuva_04
									religion = baltic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = slavic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_slavic_04
									religion = slavic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_slavic_04
									religion = slavic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = tengri_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_tengri_04
									religion = tengri_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_tengri_04
									religion = tengri_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = finnish_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_suomenusko_04
									religion = finnish_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_suomenusko_04
									religion = finnish_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = aztec_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_aztec_04
									religion = aztec_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_aztec_04
									religion = aztec_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = west_african_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_african_04
									religion = west_african_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_african_04
									religion = west_african_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = zun_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_zun_04
									religion = zun_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_zun_04
									religion = zun_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = hellenic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_hellenic_04
									religion = hellenic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_hellenic_04
									religion = hellenic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = celtic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_celtic_04
									religion = celtic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_celtic_04
									religion = celtic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = britannic_pagan }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_britannic_04
									religion = britannic_pagan
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_britannic_04
									religion = britannic_pagan
								}
							}
						}
						else_if = {
							limit = { religion = egyptian_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_egyptian_04
									religion = egyptian_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_egyptian_04
									religion = egyptian_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = bon_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_bon_04
									religion = bon_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_bon_04
									religion = bon_pagan_reformed
								}
							}
						}
						if = {
							limit = { can_apply_average_nickname_trigger = yes }
							give_nickname = nick_the_avenger
						}
					}
					50 = {
						trigger = {
							OR = {
								trait = sympathy_christendom
								trait = sympathy_islam
								trait = sympathy_judaism
								trait = sympathy_zoroastrianism
								trait = sympathy_indian
							}
						}
						if = {
							limit = { religion = norse_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_germanic_05
									religion = norse_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_germanic_05
									religion = norse_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = baltic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_romuva_05
									religion = baltic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_romuva_05
									religion = baltic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = slavic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_slavic_05
									religion = slavic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_slavic_05
									religion = slavic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = tengri_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_tengri_05
									religion = tengri_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_tengri_05
									religion = tengri_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = finnish_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_suomenusko_05
									religion = finnish_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_suomenusko_05
									religion = finnish_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = aztec_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_aztec_05
									religion = aztec_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_aztec_05
									religion = aztec_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = west_african_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_african_05
									religion = west_african_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_african_05
									religion = west_african_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = zun_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_zun_05
									religion = zun_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_zun_05
									religion = zun_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = hellenic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_hellenic_05
									religion = hellenic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_hellenic_05
									religion = hellenic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = celtic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_celtic_05
									religion = celtic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_celtic_05
									religion = celtic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = britannic_pagan }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_britannic_05
									religion = britannic_pagan
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_britannic_05
									religion = britannic_pagan
								}
							}
						}
						else_if = {
							limit = { religion = egyptian_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_egyptian_05
									religion = egyptian_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_egyptian_05
									religion = egyptian_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = bon_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_bon_05
									religion = bon_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_bon_05
									religion = bon_pagan_reformed
								}
							}
						}
						if = {
							limit = { can_apply_average_nickname_trigger = yes }
							give_nickname = nick_the_wise
						}
					}
					10 = {
						if = {
							limit = { religion = norse_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_germanic_06
									religion = norse_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_germanic_06
									religion = norse_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = baltic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_romuva_06
									religion = baltic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_romuva_06
									religion = baltic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = slavic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_slavic_06
									religion = slavic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_slavic_06
									religion = slavic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = tengri_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_tengri_06
									religion = tengri_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_tengri_06
									religion = tengri_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = finnish_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_suomenusko_06
									religion = finnish_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_suomenusko_06
									religion = finnish_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = aztec_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_aztec_06
									religion = aztec_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_aztec_06
									religion = aztec_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = west_african_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_african_06
									religion = west_african_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_african_06
									religion = west_african_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = zun_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_zun_06
									religion = zun_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_zun_06
									religion = zun_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = hellenic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_hellenic_06
									religion = hellenic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_hellenic_06
									religion = hellenic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = celtic_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_celtic_06
									religion = celtic_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_celtic_06
									religion = celtic_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = britannic_pagan }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_britannic_06
									religion = britannic_pagan
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_britannic_06
									religion = britannic_pagan
								}
							}
						}
						else_if = {
							limit = { religion = egyptian_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_egyptian_06
									religion = egyptian_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_egyptian_06
									religion = egyptian_pagan_reformed
								}
							}
						}
						else_if = {
							limit = { religion = bon_pagan_reformed }
							if = {
								limit = { is_female = yes }
								create_bloodline = {
									type = saintly_bloodline_bon_06
									religion = bon_pagan_reformed
									inheritance = matrilineal
								}
							}
							else = {
								create_bloodline = {
									type = saintly_bloodline_bon_06
									religion = bon_pagan_reformed
								}
							}
						}
						if = {
							limit = { can_apply_average_nickname_trigger = yes }
							give_nickname = nick_the_pious
						}
					}
				}

				new_bloodline = {
					set_name = blessed_bloodline_name
					set_description = blessed_bloodline_description
				}
			}

			# Messages
			any_playable_ruler = {
				limit = {
					religion = ROOT
					NOT = { dynasty = event_target:saint_person }
				}

				narrative_event = { id = HF.40025 }
			}

			event_target:saint_person = {
				any_dynasty_member = {
					limit = { religion_group = ROOT }
					narrative_event = { id = HF.40025 }
				}
			}

			narrative_event = { id = HF.40025 }
		}
	}

	option = {
		name = EVTOPTB_HF_40020
	}
}