# Written by Flavio

namespace=HFP

#Expanded pregnancy events.

##########################################MISSING REGENT WARNING##################

#Pregnant ruler notified she hasn't appointed a regent.
character_event = {
	id = HFP.20400
	desc = EVTDESCHFP20400
	picture = GFX_evt_recovery

	ai = no
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTBHFP20400		#I know just the guy
		trigger = { 
			any_courtier_or_vassal = { #Option only available if you have at least SOMEBODY that doesn't hate you in your court.
				opinion = {  
					who = ROOT
					value = 20
				} 
			} 
			NOR = { #Not if you already have a regent.
				any_courtier_or_vassal = {  
					has_minor_title = title_appointed_regent
				} 
				any_courtier_or_vassal = {  
					has_minor_title = title_regent
				} 
			} 
		}
		set_dynasty_flag = pregnancy_regent_warning
		#First search for person that both likes you, is trustworthy, and is competent.
		if = { 
			limit = { 
				any_courtier_or_vassal = { 
					is_adult = yes
					prisoner = no
					NOT = { trait = incapable }
					has_regent = no
					OR = {
						opinion = {  
							who = ROOT
							value = 50
						}
						is_friend = ROOT
						is_lover = ROOT
					}
					NOR = {
						trait = deceitful
						trait = ambitious
					}
					stewardship = 10
				} 
			}
			random_courtier_or_vassal = {
				limit = {
					is_adult = yes
					prisoner = no
					NOT = { trait = incapable }
					has_regent = no
					OR = {
						opinion = {  
							who = ROOT
							value = 50
						}
						is_friend = ROOT
						is_lover = ROOT
					}
					NOR = {
						trait = deceitful
						trait = ambitious
					}
					stewardship = 10
				}
				give_minor_title = title_appointed_regent
			}
			break = yes
		}
		#Then search for person that likes you and is trustworthy.
		if = { 
			limit = { 
				NOT = { 
					any_courtier_or_vassal = { 
						is_adult = yes
						prisoner = no
						NOT = { trait = incapable }
						has_regent = no
						OR = {
							opinion = {  
								who = ROOT
								value = 50
							}
							is_friend = ROOT
							is_lover = ROOT
						}
						NOR = {
							trait = deceitful
							trait = ambitious
						}
						stewardship = 10
					} 
				}
				any_courtier_or_vassal = { 
					is_adult = yes
					prisoner = no
					NOT = { trait = incapable }
					has_regent = no
					OR = {
						opinion = {  
							who = ROOT
							value = 30
						}
						is_friend = ROOT
						is_lover = ROOT
					}
					NOR = {
						trait = deceitful
						trait = ambitious
					}
				} 
			}
			random_courtier_or_vassal = {
				limit = {
					is_adult = yes
					prisoner = no
					NOT = { trait = incapable }
					has_regent = no
					OR = {
						opinion = {  
							who = ROOT
							value = 30
						}
						is_friend = ROOT
						is_lover = ROOT
					}
					NOR = {
						trait = deceitful
						trait = ambitious
					}
				}
				give_minor_title = title_appointed_regent
			}
			break = yes
		}
		#Then search for person that likes you.
		if = { 
			limit = { 
				NOR = { 
					any_courtier_or_vassal = { 
						is_adult = yes
						prisoner = no
						NOT = { trait = incapable }
						has_regent = no
						OR = {
							opinion = {  
								who = ROOT
								value = 50
							}
							is_friend = ROOT
							is_lover = ROOT
						}
						NOR = {
							trait = deceitful
							trait = ambitious
						}
						stewardship = 10
					}
					any_courtier_or_vassal = { 
						is_adult = yes
						prisoner = no
						NOT = { trait = incapable }
						has_regent = no
						OR = {
							opinion = {  
								who = ROOT
								value = 30
							}
							is_friend = ROOT
							is_lover = ROOT
						}
						NOR = {
							trait = deceitful
							trait = ambitious
						}
					} 
				}
				any_courtier_or_vassal = { 
					is_adult = yes
					prisoner = no
					NOT = { trait = incapable }
					has_regent = no
					OR = {
						opinion = {  
							who = ROOT
							value = 20
						}
						is_friend = ROOT
						is_lover = ROOT
					}
				} 
			}
			random_courtier_or_vassal = {
				limit = {
					is_adult = yes
					prisoner = no
					NOT = { trait = incapable }
					has_regent = no
					OR = {
						opinion = {  
							who = ROOT
							value = 20
						}
						is_friend = ROOT
						is_lover = ROOT
					}
				}
				give_minor_title = title_appointed_regent
			}
			break = yes
		}
	}
	option = { 
		name = EVTOPTAHFP20400		#I'll think about it.
		set_dynasty_flag = pregnancy_regent_warning
	}
}

#on_pregnancy, set clock for finishing phase at 2 months
character_event = {
	id = HFP.20401
	hide_window = yes
	
	is_triggered_only = yes

	immediate = { 
		character_event = { id = HFP.20402 days = 170 }
	}
}

character_event = {
	id = HFP.20402
	hide_window = yes
	
	trigger = { 
		trait = pregnant
		has_game_rule = {
			name = pregnancy_flavor
			value = on
		}
	}

	is_triggered_only = yes

	immediate = { 
		add_trait = pregnancy_finishing
	}
}

#on_birth (fired on the child), remove the trait and check all flavor flags.
character_event = {
	id = HFP.20403
	hide_window = yes
	
	#trigger = { 
#		mother = { trait = pregnancy_finishing } 
#	}

	is_triggered_only = yes

	immediate = { 
		mother = { 
			remove_trait = pregnancy_finishing
			remove_trait = in_hiding
			remove_trait = travelling
			remove_character_modifier = mother_praying_health
			remove_character_modifier = mother_resting_health
			remove_character_modifier = mother_partying_health
			clr_character_flag = mother_asked_retirement 
			clr_character_flag = flag_mother_dark_rest
			clr_character_flag = mother_gossip_listening #Safety check, they should already have been removed
			clr_character_flag = mother_gossip_talking
			clr_character_flag = mother_gossip_trusting
			clr_character_flag = mother_gossip_plotting
			clr_character_flag = mother_gossip_envious
			clr_character_flag = mother_gossip_shy
			clr_character_flag = mother_gossip_learning
			clr_character_flag = mother_gossip_content
			clr_character_flag = mother_gossip_gluttonous

			character_event = { id = HFP.20597 days = 35 } #Clears persistent Physician targets. They are still on on_birth since post-partum complications may require their services.
		} 
		#Mother took part in fertility feast, chance of blessed girl.
		if = { 
			limit = { 
				mother = { 
					has_character_modifier = mother_fertility_festival_2
				}
				is_female = yes
			}
			random_list = { 
				40 = { 
					modifier = {  
						factor = 1.75
						mother_even_if_dead = { trait = ugly }
					}
					modifier = {  
						factor = 1.75
						father_even_if_dead = { trait = ugly }
					}
					modifier = {  
						factor = 0.5
						mother_even_if_dead = { trait = fair }
					}
					modifier = {  
						factor = 0.5
						father_even_if_dead = { trait = fair }
					}
					modifier = {  
						factor = 1.75
						mother_even_if_dead = { any_child = { trait = fair } } #Avoid entire litters of them.
					}
					modifier = {  
						factor = 1.75
						father_even_if_dead = { any_child = { trait = fair } } #Avoid entire litters of them.
					}
				}
				60 = { 
					remove_trait = hunchback
					remove_trait = dwarf
					remove_trait = ugly
					remove_trait = inbred
					remove_trait = sickly
					remove_trait = harelip
					remove_trait = lisp
					mother = { character_event = { id = HFP.20055 days = 3600 random = 200 } } 
					father = { character_event = { id = HFP.20055 days = 3600 random = 200 } } 
				}
			}
		} 

		#Catholic/Orthodox Kings/Emperors: chance for special baptism.
		father = { save_event_target_as = scoped_father }
		mother = { save_event_target_as = scoped_mother }
		ROOT = { save_event_target_as = scoped_baby }
		if = { 
			limit = { 
				OR = { 
					event_target:scoped_father = { higher_tier_than = event_target:scoped_mother }
					event_target:scoped_father = { 
						real_tier = event_target:scoped_mother 
						is_married_matrilineally = no
					}
				}
			}
			event_target:scoped_father = { character_event = { id = HF.20100 days = 12 } }
		}
		if = { 
			limit = { 
				OR = { 
					event_target:scoped_mother = { higher_tier_than = event_target:scoped_father }
					event_target:scoped_mother = { 
						real_tier = event_target:scoped_father 
						is_married_matrilineally = yes
					}
				}
			}
			event_target:scoped_mother = { character_event = { id = HF.20100 days = 12 } }
		} 
		father = { clear_event_target = scoped_father }
		mother = { clear_event_target = scoped_mother }
		ROOT = { clear_event_target = scoped_baby }

		#Catholic/Orthodox rulers: chance of Churching after the first pregnancy is over.
		if = { 
			limit = { 
				mother = { 
					OR = { 
						religion = catholic
						religion = orthodox
					}
					is_married = yes
					NOT = { num_of_children = 2 }
					NOT = { society_member_of = the_satanists }
					OR = { 
						is_ruler = yes
						spouse = { is_ruler = yes }
					}
					NOR = { 
						has_character_modifier = adulteress
						has_character_modifier = incestuous_adulteress 
					}
				}
			}
			mother = { character_event = { id = HFP.20018 days = 24 } }
		} 

		#Mother drunk/had drugs during pregnancy, chance of dumb child.
		if = {
			limit = { 
				mother = { 
					trait = drunkard 
				} 
			}
			random = { 
				chance = 30
				set_character_flag = flag_drunk_birth
				if = { 
					limit = { trait = slow }
					remove_trait = slow
					add_trait = imbecile
					mother = { character_event = { id = HFP.20001 days = 451 } }
					father = { character_event = { id = HFP.20002 days = 450 } }
				}
				if = { 
					limit = { 
						NOR = { 
							trait = genius 
							trait = quick 
							trait = slow 
							trait = imbecile 
						} 
					}
					add_trait = slow
					mother = { character_event = { id = HFP.20001 days = 451 } }
					father = { character_event = { id = HFP.20002 days = 450 } }
				}
				if = { 
					limit = { trait = quick }
					remove_trait = quick
				}
				if = { 
					limit = { trait = genius }
					remove_trait = genius
					add_trait = quick 
				}
			}
		}
		if = {
			limit = { 
				mother = { 
					has_character_modifier = hashish_addict
				} 
			}
			random = { 
				chance = 30
				set_character_flag = flag_drugged_birth
				if = { 
					limit = { trait = slow }
					remove_trait = slow
					add_trait = imbecile
					mother = { character_event = { id = HFP.20001 days = 551 } }
					father = { character_event = { id = HFP.20002 days = 550 } }
				}
				if = { 
					limit = { 
						NOR = { 
							trait = genius 
							trait = quick 
							trait = slow 
							trait = imbecile 
						} 
					}
					add_trait = slow
					mother = { character_event = { id = HFP.20001 days = 551 } }
					father = { character_event = { id = HFP.20002 days = 550 } }
				}
				if = { 
					limit = { trait = quick }
					remove_trait = quick
				}
				if = { 
					limit = { trait = genius }
					remove_trait = genius
					add_trait = quick 
				}
			}
		}
		random_list = { #Chance of imprinting (mother)
			50 = { 
				modifier = {  
					factor = 0.5
					mother = { num_of_children = 2 }
				}
				modifier = {  
					factor = 0.35
					mother = { num_of_children = 3 }
				}
				modifier = {  
					factor = 0.25
					mother = { num_of_children = 4 }
				}
				modifier = {  
					factor = 0.1
					mother = { num_of_children = 5 }
				}
				modifier = {  
					factor = 0.5
					mother = { age = 30 }
				}
				modifier = {  
					factor = 1.5
					mother = { trait = kind }
				}
				modifier = {  
					factor = 1.5
					mother = { trait = charitable }
				}
				modifier = {  
					factor = 0.5
					mother = { trait = envious }
				}
				modifier = {  
					factor = 0.5
					mother = { trait = cruel }
				}
				mother = { character_event = { id = HFP.20599 days = 70 } } 
			} 
			50 = {  } 
		}
		random_list = { #Chance of imprinting (father)
			50 = { 
				modifier = {  
					factor = 0.5
					father = { num_of_children = 2 }
				}
				modifier = {  
					factor = 0.35
					father = { num_of_children = 3 }
				}
				modifier = {  
					factor = 0.25
					father = { num_of_children = 4 }
				}
				modifier = {  
					factor = 0.1
					father = { num_of_children = 5 }
				}
				modifier = {  
					factor = 0.5
					father = { age = 30 }
				}
				modifier = {  
					factor = 1.5
					father = { trait = kind }
				}
				modifier = {  
					factor = 1.5
					father = { trait = charitable }
				}
				modifier = {  
					factor = 0.5
					father = { trait = envious }
				}
				modifier = {  
					factor = 0.5
					father = { trait = cruel }
				}
				father = { character_event = { id = HFP.20000 days = 700 random = 500 } } 
			} 
			50 = {  } 
		}

		if = { 
			limit = { #The Papal orgy bears fruits.
				mother = { has_character_flag = flag_vatican_prince } 
			} 
			mother = { 
				clr_character_flag = flag_vatican_prince 
				character_event = { id = HFP.20598 days = 7 random = 7 } #Notify mother.
			} 
		}
		if = { 
			limit = { 
				mother = { trait = troubled_pregnancy } 
			} 
			random_list = {
				80 = { set_character_flag = flag_troubled_pregnancy_child
				}
				20 = { } #Nothing happens
			} 
		}
		if = { 
			limit = { 
				mother = { trait = stressed } 
			} 
			random_list = {
				30 = { 
					mother = { 
						character_event = { id = HFP.20581 days = 30 random = 50 } #chance to recover from stressed.
					}
				}
				70 = { } #Nothing happens
			} 
		}
		if = { 
			limit = { 
				mother = { has_character_flag = mother_craved_quail } 
			} 
			random_list = {
				70 = { 
					add_trait = clubfooted
					mother = { 
						character_event = { id = HFP.20582 days = 950 random = 550 } #Notify mother child gains 2 diplomacy.
						clr_character_flag = mother_craved_quail 
					}
				}
				30 = { mother = { clr_character_flag = mother_craved_quail } } #Nothing happens
			} 
		}
		if = { 
			limit = { 
				mother = { has_character_flag = mother_craved_hare } 
			} 
			random_list = {
				70 = { 
					add_trait = harelip
					mother = { 
						character_event = { id = HFP.20583 days = 950 random = 550 } #Notify mother child gains 2 intrigue.
						clr_character_flag = mother_craved_hare 
					}
				}
				30 = { mother = { clr_character_flag = mother_craved_hare } } #Nothing happens
			} 
		}
		if = { 
			limit = { 
				mother = { has_character_flag = mother_craved_trout } 
			} 
			random_list = {
				70 = { 
					add_trait = ugly
					mother = { 
						character_event = { id = HFP.20584 days = 950 random = 550 } #Notify mother child gains 2 learning.
						clr_character_flag = mother_craved_trout 
					}
				}
				30 = { mother = { clr_character_flag = mother_craved_trout } } #Nothing happens
			} 
		}
		if = { 
			limit = { 
				mother = { has_character_flag = mom_hopes_child_warrior } 
			} 
			#Small chance of child actually gaining positive trait.
			random_list = {
				20 = { 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = weak } 
					} 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = feeble } 
					} 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = inbred } 
					} 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = hunchback } 
					} 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = dwarf } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = weak } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = feeble } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = inbred } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = hunchback } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = dwarf } 
					} 
					if = { 
						limit = { trait = weak } 
						remove_trait = weak
					} 
					if = { 
						limit = { trait = feeble } 
						remove_trait = feeble
					} 
					if = { 
						limit = { trait = inbred } 
						remove_trait = inbred
					} 
					if = { 
						limit = { trait = hunchback } 
						remove_trait = hunchback
					} 
					if = { 
						limit = { trait = dwarf } 
						remove_trait = dwarf
					} 
					if = { 
						limit = { trait = sickly } 
						remove_trait = sickly
					} 

				} 
				80 = { #No luck.

				} 
			}
			#Notify mother. 
			if = { 
				limit = { 
					NOR = { 
						trait = weak
						trait = feeble
						trait = inbred
						trait = hunchback
						trait = dwarf
						trait = sickly
					}
				}
				mother = { 
					character_event = { id = HFP.20585 days = 250 random = 250 } #Notify mother child gains 2 martial.
					clr_character_flag = mom_hopes_child_warrior
				} 
			} 
		} #Close what if warrior child

		#Mother offered sacrifice for strong child
		if = { 
			limit = { 
				mother = { has_character_flag = mom_hopes_child_strong } 
			} 
			#Small chance of child actually gaining positive trait.
			random_list = {
				20 = { 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = weak } 
					} 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = feeble } 
					} 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = inbred } 
					} 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = hunchback } 
					} 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = dwarf } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = weak } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = feeble } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = inbred } 
					}   
					remove_trait = weak
					remove_trait = sickly
					add_trait = strong

				} 
				80 = { #No luck.
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = strong } 
					}   
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = strong } 
					}   

				} 
			}
			#Notify mother. 
			if = { 
				limit = { trait = strong
				}
				mother = { 
					character_event = { id = HFP.20586 days = 250 random = 250 } #Notify mother child is growing strong.
					clr_character_flag = mom_hopes_child_strong
				} 
			} 
			mother = { clr_character_flag = mom_hopes_child_strong }
		} 
		#Mother offered sacrifice for pretty child
		if = { 
			limit = { 
				mother = { has_character_flag = mom_hopes_child_pretty } 
			} 
			#Small chance of child actually gaining positive trait.
			random_list = {
				20 = { 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = ugly } 
					} 
					modifier = { 
						factor = 2
						mother_even_if_dead = { trait = fair } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = ugly } 
					} 
					modifier = { 
						factor = 2
						father_even_if_dead = { trait = fair } 
					}   
					remove_trait = harelip
					remove_trait = ugly
					add_trait = fair

				} 
				80 = { #No luck.

				} 
			}
			#Notify mother. 
			if = { 
				limit = { trait = fair }
				mother = { 
					character_event = { id = HFP.20587 days = 250 random = 250 } #Notify mother child is growing strong.
					clr_character_flag = mom_hopes_child_pretty
				} 
			} 
			mother = { clr_character_flag = mom_hopes_child_pretty }
		}
		#Mother offered sacrifice for smart child
		if = { 
			limit = { 
				mother = { has_character_flag = mom_hopes_child_smart } 
			} 
			#Small chance of child actually gaining positive trait.
			random_list = {
				20 = { 
					modifier = { 
						factor = 0.5
						mother_even_if_dead = { trait = slow } 
					} 
					modifier = { 
						factor = 0.25
						mother_even_if_dead = { trait = imbecile } 
					} 
					modifier = { 
						factor = 1.5
						mother_even_if_dead = { trait = quick } 
					} 
					modifier = { 
						factor = 2
						mother_even_if_dead = { trait = genius } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = slow } 
					} 
					modifier = { 
						factor = 0.25
						father_even_if_dead = { trait = imbecile } 
					} 
					modifier = { 
						factor = 0.5
						father_even_if_dead = { trait = ugly } 
					} 
					modifier = { 
						factor = 1.5
						father_even_if_dead = { trait = quick } 
					} 
					modifier = { 
						factor = 2
						father_even_if_dead = { trait = genius } 
					} 
					remove_trait = slow
					remove_trait = imbecile
					if = { 
						limit = { trait = quick } 
						remove_trait = quick
						add_trait = genius
					} 
					if = { 
						limit = { NOT = { trait = quick } } 
						add_trait = quick
					} 
				} 
				80 = { #No luck.

				} 
			}
			#Notify mother. 
			if = { 
				limit = { 
					OR = { 
						trait = quick 
						trait = genius
					} 
				}
				mother = { 
					character_event = { id = HFP.20588 days = 450 random = 450 } #Notify mother child is growing smart.
					clr_character_flag = mom_hopes_child_smart
				} 
			} 
			mother = { clr_character_flag = mom_hopes_child_smart }
		}
		#Mother wanted a boy/girl 
		if = { 
			limit = { 
				mother = { 
					OR = { 
						has_character_flag = mom_hopes_child_boy
						has_character_flag = mom_hopes_child_girl
					}
				} 
			}
			mother = { 
				character_event = { id = HFP.20589 days = 15 random = 15 } #Did the bet pay out?
			} 
		}
		#Mother made a vow to the Holy Virgin
		if = { 
			limit = { 
				mother = { 
					OR = { 
						has_character_modifier = mother_vow_chastity
						has_character_modifier = mother_vow_humility
						has_character_modifier = mother_vow_charity
						has_character_modifier = mother_vow_temperance
					}
				} 
			}
			#Possible divine intervention
			random_list = { 
				70 = { #Nothing happens
				}
				30 = { 
					#Broke the vow, decreased chance.
					modifier = { 
						factor = 0.5
						mother = { 
							has_character_modifier = mother_vow_temperance 
							OR = { 
								trait = gluttonous
								trait = hedonist
							} 
						} 
					}
					modifier = { 
						factor = 0.5
						mother = { 
							has_character_modifier = mother_vow_charity 
							trait = greedy
						} 
					}
					modifier = { 
						factor = 0.5
						mother = { 
							has_character_modifier = mother_vow_humility 
							trait = proud
						} 
					}
					modifier = { 
						factor = 0.5
						mother = { 
							has_character_modifier = mother_vow_chastity 
							trait = lustful
						} 
					}


					#Remained true to the vow, increased chance.
					modifier = { 
						factor = 1.75
						mother = { 
							has_character_modifier = mother_vow_temperance 
							trait = temperate
						} 
					}
					modifier = { 
						factor = 1.75
						mother = { 
							has_character_modifier = mother_vow_charity 
							trait = charitable
						} 
					}
					modifier = { 
						factor = 1.75
						mother = { 
							has_character_modifier = mother_vow_humility 
							trait = humble
						} 
					}
					modifier = { 
						factor = 1.75
						mother = { 
							has_character_modifier = mother_vow_chastity 
							OR = { 
								trait = chaste
								trait = celibate
							} 
						} 
					} 
					remove_trait = sickly
					remove_trait = inbred
					remove_trait = harelip
					remove_trait = clubfooted
					remove_trait = hunchback
					remove_trait = lisp
					remove_trait = stutter
					remove_trait = ugly
					remove_trait = dwarf
					remove_trait = slow
					remove_trait = imbecile
					remove_trait = weak
				}
			}
			mother = { 
				character_event = { id = HFP.20590 days = 25 random = 25 } #Did it work? If so, does she keep her word?
			} 
		}
	}
}

#Hard pregnancy starts
character_event = {
	id = HFP.20404
	desc = EVTDESCHFP20404
	picture = GFX_evt_bad_news_female

	trigger = { 
		trait = pregnant
	}

	immediate = { add_trait = hard_pregnancy }
	
	is_triggered_only = yes

	option = { #Abort
		name = EVTOPTZHFP20404
		trigger = { 
			is_ruler = yes
			is_playable = yes
			OR = {
				is_married_matrilineally = yes
				is_married = no
			}
			NOR = { 
				AND = { 
					religion_group = christian 
					trait = zealous 
				} 
				trait = kind 
			} 
		}
		custom_tooltip = { text = tooltip_20404_abortion }
		tiered_piety_negative_effect = yes
		remove_trait = hard_pregnancy
		remove_trait = pregnant
		add_character_modifier = { modifier = aborted_child years = 4 }
		hidden_tooltip = { 
			ROOT = { cancel_pregnancy = yes }
			random_list = { 
				25 = { character_event = { id = HFP.20064 days = 35 } } #Mother becomes depressed/insane.
				25 = { character_event = { id = HFP.20065 days = 35 } } #Mother accidentally reveals the deed.
				25 = { character_event = { id = HFP.20066 days = 35 } } #Mother permanently loses fertility.
				25 = {  } #Nothing happens.
			}
			if = { 
				limit = { 
					is_married = yes 
					NOR = { 
						has_religion_feature = religion_matriarchal
						AND = {	# MOD
							has_game_rule = {
								name = flavor_events
								value = enatic
							}
							OR = {
								religion = norse_pagan
								religion = norse_pagan_reformed
							}
						}
					} 
					spouse = { 
						NOR = {
							trait = slow
							trait = imbecile
							trait = trusting
							trait = inbred 
							trait = incapable 
						} 
						is_inaccessible_trigger = no
					}
				}
				spouse = { character_event = { id = HFP.20061 days = 15 } } 
			}
		}
		ai_chance = { 
			factor = 1 
			modifier = { 
				factor = 10
				trait = craven
			}
			modifier = { 
				factor = 5
				OR = { 
					has_religion_feature = religion_matriarchal
					AND = {	# MOD
						has_game_rule = {
							name = flavor_events
							value = enatic
						}
						OR = {
							religion = norse_pagan
							religion = norse_pagan_reformed
						}
					}
				}
			}
			modifier = { 
				factor = 3
				trait = cruel
			}
			modifier = { 
				factor = 3
				trait = envious
			}
			modifier = { 
				factor = 0
				trait = brave
			}
		}
 	}

	option = { 
		name = EVTOPTAHFP20404
		tooltip = { add_trait = hard_pregnancy }
		hidden_tooltip = { 
			if = { 
				limit = { is_married = yes } 
				spouse = { 
					character_event = { id = HFP.20405 } 
				}
				break = yes
			}
			if = { 
				limit = { 
					is_married = no 
					any_courtier_or_vassal = { has_minor_title = title_court_physician }
				} 
				random_courtier_or_vassal = { 
					limit = { has_minor_title = title_court_physician }
					character_event = { id = HFP.20405 } 
				}
				break = yes
			}
			character_event = { id = HFP.20407 days = 6 } # If lonely, decide if to temporarily retire from rule.
		}
		ai_chance = { factor = 99 }
	}
}

#Spouse/Physician informed of a hard pregnancy.
character_event = {
	id = HFP.20405
	desc = EVTDESCHFP20405
	picture = GFX_evt_bad_news_female

	trigger = { 
		FROM = { is_alive = yes }
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20405
		hidden_tooltip = { 
			FROM = { character_event = { id = HFP.20406 days = 3 } } # Encourage spouse to keep safe.
		}
		ai_chance = {
			factor = 90
			modifier = { 
				factor = 0.1
				NOT = { 
					opinion = { 
						who = FROM
						value = 20 
					} 
				} 
			}
		}
	}
	option = { 	#Do nothing.
		name = EVTOPTBHFP20405
		FROM ={ character_event = { id = HFP.20407 days = 6 } } # If lonely, decide if to temporarily retire from rule.
		ai_chance = {
			factor = 10
		}
	}
}

#Mother adviced by spouse to stop retire for the pregnancy.
character_event = {
	id = HFP.20406
	desc = {
		trigger = {
			FROM = { is_married = ROOT } #Desc for Spouse.
		}
		text = EVTDESCHFPA20406	
		picture = GFX_evt_quarrel
	}
	desc = {
		trigger = {
			FROM = { has_minor_title = title_court_physician } #Desc for Physician.
		}
		text = EVTDESCHFPB20406	
		picture = GFX_evt_court_physician
	}
	picture = GFX_evt_quarrel

	is_triggered_only = yes
	

	immediate = { set_character_flag = mother_asked_retirement }

	option = { #Yes, staying at court.
		name = EVTOPTAHFP20406
		trigger = {  
			NOR = {
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				trait = travelling
			}
		}
		custom_tooltip = { text = mother_staying_court }
		add_trait = in_hiding
		hidden_tooltip = { FROM = { character_event = { id = HFP.20408 } } } # Notify.
		hidden_tooltip = { 
			random_list = { 
				70 = { character_event = { id = HFP.20411 } } #Home hard pregnancy negative randomized events.
				30 = { #Pregnancy goes well, without any more issues.
					modifier = { 
						factor = 0.8
						trait = paranoid 
					}
					modifier = { 
						factor = 0.7
						trait = stressed 
					}
					modifier = { 
						factor = 0.5
						trait = depressed 
					}
					modifier = { 
						factor = 0.7
						trait = lunatic 
					}
					modifier = { 
						factor = 0.7
						trait = possessed 
					}
					modifier = { 
						factor = 0.7
						has_disease_trigger = yes
					}
				} 
			}
		} 
		FROM = { 
			opinion = {
				modifier = opinion_kind
				years = 5
				who = ROOT
			}
		}
		ai_chance = {
			factor = 50
			modifier = { 
				factor = 2
				trait = slothful
			}
			modifier = { 
				factor = 1.5
				opinion = { 
					who = FROM
					value = 20 
				} 
			}
			modifier = { 
				factor = 1.5
				opinion = { 
					who = FROM
					value = 40 
				} 
			}
			modifier = { 
				factor = 1.5
				opinion = { 
					who = FROM
					value = 60 
				} 
			}
		}
	}
	option = { #Yes, going out.
		name = EVTOPTBHFP20406
		custom_tooltip = { text = mother_going_countryside }
		hidden_tooltip = { FROM = { character_event = { id = HFP.20409 } } } # Notify.
		add_trait = travelling
		hidden_tooltip = { 
			random_list = { 
				60 = { character_event = { id = HFP.20412 } } #Countryside hard pregnancy negative randomized events.
				40 = { #Pregnancy goes well, without any more issues.
					modifier = { 
						factor = 0.8
						trait = paranoid 
					}
					modifier = { 
						factor = 0.7
						trait = stressed 
					}
					modifier = { 
						factor = 0.5
						trait = depressed 
					}
					modifier = { 
						factor = 0.7
						trait = feeble 
					}
					modifier = { 
						factor = 0.7
						trait = weak 
					}
					modifier = { 
						factor = 0.5
						has_disease_trigger = yes
					}
				} 
			}
		}
		FROM = { 
			opinion = {
				modifier = opinion_kind
				years = 5
				who = ROOT
			}
		}
		ai_chance = {
			factor = 10
			modifier = { 
				factor = 0.5
				trait = slothful
			}
			modifier = { 
				factor = 2
				trait = falconer
			}
			modifier = { 
				factor = 2
				trait = hunter
			}
			modifier = { 
				factor = 1.5
				trait = duelist
			}
			modifier = { 
				factor = 1.5
				trait = gardener
			}
		}
	}
	option = { 	#No.
		name = EVTOPTCHFP20406
		trigger = { is_ruler = yes }
		custom_tooltip = { text = mother_keeps_ruling }
		hidden_tooltip = { FROM = { character_event = { id = HFP.20410 } } } # Notify.
		hidden_tooltip = { 
			random_list = { 
				30 = { 
					modifier = { 
						factor = 1.2
						tier = COUNT
					}
					modifier = { 
						factor = 1.3
						tier = DUKE
					}
					modifier = { 
						factor = 1.5
						tier = KING
					}
					modifier = { 
						factor = 1.75
						tier = EMPEROR
					}
					modifier = { 
						factor = 1.75
						age = 40
					}
					modifier = { 
						factor = 1.75
						num_of_children = 4
					}
					troubled_pregnancy_chance_low_effect = yes  #Critical Failure: Troubled Pregnancy saving throw.
				} 
				60 = { character_event = { id = HFP.20411 } } #Home hard pregnancy negative randomized events.
				10 = { #Pregnancy goes well, without any more issues.
					modifier = { 
						factor = 0.8
						trait = paranoid 
					}
					modifier = { 
						factor = 0.7
						trait = stressed 
					}
					modifier = { 
						factor = 0.5
						trait = depressed 
					}
					modifier = { 
						factor = 0.7
						trait = feeble 
					}
					modifier = { 
						factor = 0.7
						trait = weak 
					}
					modifier = { 
						factor = 0.5
						has_disease_trigger = yes
					}
				} 
			}
		}
		FROM = { 
			opinion = {
				modifier = opinion_dislike
				years = 5
				who = ROOT
			}
		}
		ai_chance = {
			factor = 30
			modifier = { 
				factor = 2 
				trait = stubborn
			}
			modifier = { 
				factor = 0.5
				trait = slothful
			}
			modifier = { 
				factor = 0.75
				is_ill = yes
			}
		}
	}
}


#Lonely mother decides if she wants to start regency or not.
character_event = {
	id = HFP.20407
	desc = EVTDESCHFPA20407
	picture = GFX_evt_bad_news_female

	is_triggered_only = yes
	

	trigger = { NOT = { has_character_flag = mother_asked_retirement } }

	option = { #Yes, staying at court.
		name = EVTOPTAHFP20407
		custom_tooltip = { text = mother_staying_court_2 }
		add_trait = in_hiding
		hidden_tooltip = { 
			random_list = { 
				70 = { character_event = { id = HFP.20411 } } #Home hard pregnancy negative randomized events.
				30 = { #Pregnancy goes well, without any more issues.
					modifier = { 
						factor = 0.8
						trait = paranoid 
					}
					modifier = { 
						factor = 0.7
						trait = stressed 
					}
					modifier = { 
						factor = 0.5
						trait = depressed 
					}
					modifier = { 
						factor = 0.7
						trait = lunatic 
					}
					modifier = { 
						factor = 0.7
						trait = possessed 
					}
					modifier = { 
						factor = 0.7
						has_disease_trigger = yes
					}
				} 
			}
		}
		ai_chance = {
			factor = 40
			modifier = { 
				factor = 2
				trait = slothful
			}
		}
	}
	option = { #Yes, going out.
		name = EVTOPTBHFP20407
		custom_tooltip = { text = mother_going_countryside_2 }
		trigger = { NOT = { trait = incapable } }
		add_trait = travelling
		hidden_tooltip = { 
			random_list = { 
				60 = { character_event = { id = HFP.20412 } } #Countryside hard pregnancy negative randomized events.
				40 = { #Pregnancy goes well, without any more issues.
					modifier = { 
						factor = 0.8
						trait = paranoid 
					}
					modifier = { 
						factor = 0.7
						trait = stressed 
					}
					modifier = { 
						factor = 0.5
						trait = depressed 
					}
					modifier = { 
						factor = 0.7
						trait = feeble 
					}
					modifier = { 
						factor = 0.7
						trait = weak 
					}
					modifier = { 
						factor = 0.5
						has_disease_trigger = yes
					}
				} 
			}
		}
		ai_chance = {
			factor = 10
			modifier = { 
				factor = 0.5
				trait = slothful
			}
			modifier = { 
				factor = 2
				trait = falconer
			}
			modifier = { 
				factor = 2
				trait = hunter
			}
			modifier = { 
				factor = 1.5
				trait = duelist
			}
			modifier = { 
				factor = 1.5
				trait = gardener
			}
		}
	}
	option = { 	#No.
		name = EVTOPTCHFP20407
		trigger = { is_ruler = yes }
		custom_tooltip = { text = mother_keeps_ruling_2 }
		hidden_tooltip = { 
			random_list = { 
				30 = { 
					modifier = { 
						factor = 1.2
						tier = COUNT
					}
					modifier = { 
						factor = 1.3
						tier = DUKE
					}
					modifier = { 
						factor = 1.5
						tier = KING
					}
					modifier = { 
						factor = 1.75
						tier = EMPEROR
					}
					modifier = { 
						factor = 1.75
						age = 40
					}
					modifier = { 
						factor = 1.75
						num_of_children = 4
					}
				troubled_pregnancy_chance_low_effect = yes  #Critical Failure: chance of Troubled Pregnancy.
				} 
				60 = { character_event = { id = HFP.20411 } } #Home hard pregnancy negative randomized events.
				10 = { #Pregnancy goes well, without any more issues.
					modifier = { 
						factor = 0.8
						trait = paranoid 
					}
					modifier = { 
						factor = 0.7
						trait = stressed 
					}
					modifier = { 
						factor = 0.5
						trait = depressed 
					}
					modifier = { 
						factor = 0.7
						trait = feeble 
					}
					modifier = { 
						factor = 0.7
						trait = weak 
					}
					modifier = { 
						factor = 0.5
						has_disease_trigger = yes
					}
				} 
			}
		}
		ai_chance = {
			factor = 40
			modifier = { 
				factor = 2 
				trait = stubborn
			}
			modifier = { 
				factor = 0.5
				trait = slothful
			}
			modifier = { 
				factor = 0.75
				is_ill = yes
			}
		}
	}
}

#Spouse/Physician informed mother will rest.
character_event = {
	id = HFP.20408
	desc = EVTDESCHFP20408
	picture = GFX_evt_lovers

	trigger = { 
		FROM = { is_alive = yes }
	}

	notification = yes

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20408
	}
}

#Spouse/Physician informed mother will rest outside.
character_event = {
	id = HFP.20409
	desc = EVTDESCHFP20409
	picture = GFX_evt_lovers

	trigger = { 
		FROM = { is_alive = yes }
	}
	
	notification = yes

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20409
	}
}

#Spouse/Physician informed mother will not rest.
character_event = {
	id = HFP.20410
	desc = EVTDESCHFP20410
	picture = GFX_evt_quarrel

	trigger = { 
		FROM = { is_alive = yes }
	}
	
	notification = yes

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20410
	}
}

#Hidden random list for possible bad effects during hard pregnancy at home.
character_event = {
	id = HFP.20411
	hide_window = yes

	trigger = { 
		trait = hard_pregnancy
	}
	
	is_triggered_only = yes

	immediate = { 
		clr_character_flag = mother_asked_retirement #If still active.
		random_list = {

			35 = {
				modifier = { 
					factor = 1.5
					trait = stressed
				}
				modifier = { 
					factor = 1.5
					trait = cruel
				}
				modifier = { 
					factor = 1.5
					trait = envious 
				}
				modifier = { 
					factor = 1.5 #Additives cause risk of troubled pregnancy.
					trait = wroth
				}
				modifier = { 
					factor = 0.5 
					trait = depressed
				}
				modifier = { 
					factor = 0.5 
					trait = kind
				}
				modifier = { 
					factor = 0.5 
					trait = patient
				}

				character_event = { id = HFP.20413 days = 30 random = 30 } #Wroth pregnant.
			}
			35 = {
				modifier = { 
					factor = 1.5
					trait = stressed
				}
				modifier = { 
					factor = 1.5
					trait = hedonist
				}
				modifier = { 
					factor = 1.5
					trait = slothful
				}
				modifier = { 
					factor = 1.5 #Additives cause risk of troubled pregnancy.
					trait = gluttonous
				}
				modifier = { 
					factor = 0.5 
					trait = temperate
				}
				modifier = { 
					factor = 0.5 
					trait = patient
				}

				character_event = { id = HFP.20414 days = 30 random = 30 } #Glutton pregnant.
			}
			25 = {
				modifier = { 
					factor = 1.5
					trait = envious
				}
				modifier = { 
					factor = 1.5
					trait = slothful
				}
				modifier = { 
					factor = 1.5 #Additives cause risk of troubled pregnancy.
					trait = depressed
				}
				modifier = { 
					factor = 0.5 
					trait = humble
				}
				modifier = { 
					factor = 0.5 
					trait = ambitious
				}

				character_event = { id = HFP.20415 days = 30 random = 30 } #Depressed pregnant.
			}
			15 = {
				modifier = { 
					factor = 1.5
					trait = depressed
				}
				modifier = { 
					factor = 1.5
					trait = slothful
				}
				modifier = { 
					factor = 1.5
					trait = hedonist
				}
				modifier = { 
					factor = 1.5 #Additives cause risk of troubled pregnancy.
					trait = drunkard
				}
				modifier = { 
					factor = 0.5 
					trait = temperate
				}
				modifier = { 
					factor = 0.5 
					trait = diligent
				}

				character_event = { id = HFP.20416 days = 30 random = 30 } #Drunkard pregnant.
			}
		}
	}
}

#Hidden random list for possible bad effects during hard pregnancy outside.
character_event = {
	id = HFP.20412
	hide_window = yes

	trigger = { 
		trait = hard_pregnancy
	}
	
	is_triggered_only = yes

	immediate = { 
		clr_character_flag = mother_asked_retirement #If still active.
		random_list = {

			10 = {
				modifier = { 
					factor = 2
					trait = robust
				}
				modifier = { 
					factor = 2
					trait = strong
				}
				modifier = { 
					factor = 1.5
					trait = diligent
				}
				modifier = { 
					factor = 1.5
					trait = falconer
				}
				modifier = { 
					factor = 1.5
					trait = hunter
				}
				modifier = { 
					factor = 1.5
					trait = duelist
				}
				modifier = { 
					factor = 1.5
					trait = shieldmaiden
				}

				#Nothing happens. Pregnancy goes well.
			}
			20 = {
				modifier = { 
					factor = 1.5
					trait = wounded
				}
				modifier = { 
					factor = 1.5
					trait = weak
				}
				modifier = { 
					factor = 1.5
					trait = feeble
				}
				modifier = { 
					factor = 1.5
					trait = slow
				}
				modifier = { 
					factor = 1.75
					trait = imbecile
				}

				character_event = { id = HFP.20417 days = 30 random = 30 } #Riding accident.
			}
			50 = {
				modifier = { 
					factor = 1.5
					trait = stressed
				}
				modifier = { 
					factor = 1.5
					trait = depressed
				}
				modifier = { 
					factor = 1.75
					is_ill = yes
				}
				modifier = { 
					factor = 0.5
					trait = strong
				}
				modifier = { 
					factor = 0.5
					trait = robust
				}
				modifier = { 
					factor = 0.5
					trait = diligent
				}
				modifier = { 
					factor = 0.5
					trait = falconer
				}

				character_event = { id = HFP.20418 days = 30 random = 30 } #Getting sick.
			}
			20 = {
				modifier = { 
					factor = 1.5
					trait = drunkard
				}
				modifier = { 
					factor = 1.5
					trait = gluttonous
				}
				modifier = { 
					factor = 1.5
					trait = hedonist
				}
				modifier = { 
					factor = 1.5
					trait = slothful
				}

				character_event = { id = HFP.20419 days = 30 random = 30 } #Bad weather. (localized by region).
			}
		}
	}
}

#Became wroth pregnant
character_event = { 
	id = HFP.20413
	desc = EVTDESCHFP20413
	picture = GFX_evt_quarrel

	trigger = { trait = hard_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20413
		hidden_tooltip = {
			if = { 
				limit = { trait = wroth } #If you already have the bad trait before this event, small chance of troubled pregnancy.
				random = { 
					chance = 1
					modifier = { 
						factor = 1.5
						trait = stressed
					} 
					modifier = { 
						factor = 1.5
						trait = feeble
					} 
					modifier = { 
						factor = 1.5
						trait = weak
					} 
					modifier = { 
						factor = 1.75
						is_ill = yes
					} 
					troubled_pregnancy_chance_low_effect = yes  #Critical Failure: chance of Troubled Pregnancy.
				}
			}  
		}
		if = { 
			limit = { NOT = { trait = wroth } }
			set_character_flag = wroth_pregnant 	#check to see if trait is temporary, so that after pregnancy is over there is greater chance of recovery.
		}
		add_trait = wroth
		hidden_tooltip = { character_event = { id = HFP.20442 days = 5 random = 10 } }  #Confirmation.
		hidden_tooltip = { character_event = { id = HFP.20422 days = 200 } }  #Post-pregnancy recovery.
		ai_chance = { factor = 100 }
	}
	option = { 
		name = EVTOPTBHFP20413
		if = { 
			limit = { NOT = { trait = depressed } }
			random = { 
				chance = 40
				modifier = { 
					factor = 1.25
					trait = stressed
				} 
				modifier = { 
					factor = 1.5
					trait = paranoid
				} 
				modifier = { 
					factor = 0.5
					trait = patient #Countertrait
				} 
				modifier = { 
					factor = 0.75
					trait = kind
				} 
				modifier = { 
					factor = 2
					trait = wroth
				} 
				tooltip = { add_trait = depressed }
				hidden_tooltip = { character_event = { id = HFP.20415 days = 5 random = 5 } } #Depressed pregnant.
			}
			break = yes  
		}
		hidden_tooltip = {
			if = { 
				limit = { trait = depressed }
				random = { 
					chance = 20
					modifier = { 
						factor = 1.5
						trait = stressed
					} 
					modifier = { 
						factor = 1.5
						trait = feeble
					} 
					modifier = { 
						factor = 1.5
						trait = weak
					} 
					modifier = { 
						factor = 1.75
						is_ill = yes
					} 
					troubled_pregnancy_chance_low_effect = yes  #Critical Failure: chance of Troubled Pregnancy.
				}
			}  
		}
		ai_chance = { factor = 0 }
	}
}

#Became gluttonous pregnant
character_event = { 
	id = HFP.20414
	desc = EVTDESCHFP20414
	picture = GFX_evt_fancy_feast

	trigger = { trait = hard_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20414
		hidden_tooltip = {
			if = { 
				limit = { trait = gluttonous } #If you already have the bad trait before this event, small chance of troubled pregnancy.
				random = { 
					chance = 1
					modifier = { 
						factor = 1.5
						trait = stressed
					} 
					modifier = { 
						factor = 1.5
						trait = feeble
					} 
					modifier = { 
						factor = 1.5
						trait = weak
					} 
					modifier = { 
						factor = 1.75
						is_ill = yes
					} 
					troubled_pregnancy_chance_low_effect = yes  #Critical Failure: chance of Troubled Pregnancy.
				}
			}  
		}
		random = { 
			chance = 40
			add_trait = gluttonous 
			hidden_tooltip = { character_event = { id = 38277 } } #Notification

		}
		gain_weight_small_effect = yes
		weight_trait_check_effect = yes
		if = { 
			limit = { NOT = { has_character_flag = gluttonous_pregnant } }
			hidden_tooltip = { character_event = { id = HFP.20441 days = 15 random = 10 } }  #Confirmation.
			hidden_tooltip = { character_event = { id = HFP.20421 days = 200 } }   #Post-pregnancy recovery.
		}
		set_character_flag = gluttonous_pregnant 	#Avoid double event if fired by weird cravings, facilitate post-birth recovery.
		ai_chance = { factor = 100 }
	}
	option = { 
		name = EVTOPTBHFP20414
		if = { 
			limit = { NOT = { trait = depressed } }
			random = { 
				chance = 40
				modifier = { 
					factor = 1.25
					trait = stressed
				} 
				modifier = { 
					factor = 1.5
					trait = paranoid
				} 
				modifier = { 
					factor = 0.5
					trait = temperate #Countertrait
				} 
				modifier = { 
					factor = 1.75
					trait = hedonist
				} 
				modifier = { 
					factor = 2
					trait = gluttonous
				}
				tooltip = { add_trait = depressed }
				hidden_tooltip = { character_event = { id = HFP.20415  days = 5 random = 5 } } #Depressed pregnant.
			}
			break = yes  
		}
		hidden_tooltip = {
			if = { 
				limit = { trait = depressed }
				random = { 
					chance = 20
					modifier = { 
						factor = 1.5
						trait = stressed
					} 
					modifier = { 
						factor = 1.5
						trait = feeble
					} 
					modifier = { 
						factor = 1.5
						trait = weak
					} 
					modifier = { 
						factor = 1.75
						is_ill = yes
					} 
					troubled_pregnancy_chance_low_effect = yes  #Critical Failure: chance of Troubled Pregnancy.
				}
			}  
		}
		ai_chance = { factor = 0 }
	}
}

#Became depressed pregnant
character_event = { 
	id = HFP.20415
	desc = EVTDESCHFP20415
	picture = GFX_evt_bad_news_female

	trigger = { trait = hard_pregnancy }
	
	is_triggered_only = yes

	option = {
		name = EVTOPTAHFP20415
		trigger = { trait = poet }
		tooltip_info = poet
		tiered_prestige_reward_effect = yes
		if = { 
			limit = { NOT = { trait = depressed } }
			set_character_flag = depressed_pregnant 	#check to see if trait is temporary, so that after pregnancy is over there is greater chance of recovery.
		}
		add_trait = depressed
		hidden_tooltip = { character_event = { id = HFP.20443 days = 5 random = 10 } }  #Confirmation.
		hidden_tooltip = { character_event = { id = HFP.20423 days = 200 } }   #Post-pregnancy recovery.
		ai_chance = { factor = 100 }
	}
	option = { 
		name = EVTOPTBHFP20415
		trigger = { NOT = { trait = poet } }
		hidden_tooltip = {
			if = { 
				limit = { trait = depressed }
				random = { 
					chance = 20
					modifier = { 
						factor = 1.5
						trait = stressed
					} 
					modifier = { 
						factor = 1.5
						trait = feeble
					} 
					modifier = { 
						factor = 1.5
						trait = weak
					} 
					modifier = { 
						factor = 1.75
						is_ill = yes
					} 
					troubled_pregnancy_chance_low_effect = yes  #Critical Failure: chance of Troubled Pregnancy.
				}
			}  
		}
		if = { 
			limit = { NOT = { trait = depressed } }
			set_character_flag = depressed_pregnant 	#check to see if trait is temporary, so that after pregnancy is over there is greater chance of recovery.
		}
		add_trait = depressed
		hidden_tooltip = { character_event = { id = HFP.20423 days = 200 } }   #Post-pregnancy recovery.
		ai_chance = { factor = 100 }
	}
}

#Became drunkard pregnant
character_event = { 
	id = HFP.20416
	desc = EVTDESCHFP20416
	picture = GFX_evt_drunk

	trigger = { trait = hard_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20416
		hidden_tooltip = {
			if = { 
				limit = { trait = drunkard } #If you already have the bad trait before this event, small chance of troubled pregnancy.
				random = { 
					chance = 1
					modifier = { 
						factor = 1.5
						trait = stressed
					} 
					modifier = { 
						factor = 1.5
						trait = feeble
					} 
					modifier = { 
						factor = 1.5
						trait = weak
					} 
					modifier = { 
						factor = 1.75
						is_ill = yes
					} 
					troubled_pregnancy_chance_low_effect = yes  #Critical Failure: chance of Troubled Pregnancy.
				}
			}  
		}
		if = { 
			limit = { NOT = { trait = drunkard } }
			set_character_flag = drunkard_pregnant	 	#check to see if trait is temporary, so that after pregnancy is over there is greater chance of recovery.
		}
		hidden_tooltip = { character_event = { id = HFP.20440 days = 5 random = 10 } }  #Confirmation.
		add_trait = drunkard
		set_character_flag = drunk_pregnant
		hidden_tooltip = { character_event = { id = HFP.20420 days = 200 } }   #Post-pregnancy recovery.
		ai_chance = { factor = 100 }
	}
	option = { 
		name = EVTOPTBHFP20416
		if = { 
			limit = { NOT = { trait = depressed } }
			random = { 
				chance = 40
				modifier = { 
					factor = 1.25
					trait = stressed
				} 
				modifier = { 
					factor = 1.5
					trait = paranoid
				} 
				modifier = { 
					factor = 0.5
					trait = temperate #Countertrait
				} 
				modifier = { 
					factor = 1.75
					trait = hedonist
				} 
				modifier = { 
					factor = 2
					trait = drunkard
				}
				tooltip = { add_trait = depressed }
				hidden_tooltip = { character_event = { id = HFP.20415  days = 5 random = 5 } } #Depressed pregnant.
			}
			break = yes  
		}
		hidden_tooltip = {
			if = { 
				limit = { trait = depressed }
				random = { 
					chance = 20
					modifier = { 
						factor = 1.5
						trait = stressed
					} 
					modifier = { 
						factor = 1.5
						trait = feeble
					} 
					modifier = { 
						factor = 1.5
						trait = weak
					} 
					modifier = { 
						factor = 1.75
						is_ill = yes
					} 
					modifier = { 
						factor = 1.75
						is_ill = yes
					} 
					troubled_pregnancy_chance_low_effect = yes  #Critical Failure: chance of Troubled Pregnancy.
				}
			}  
		}
		ai_chance = { factor = 0 }
	}
}

#Countryside: Riding accident.
character_event = { 
	id = HFP.20417
	desc = EVTDESCHFP20417
	picture = GFX_evt_carriage

	trigger = { trait = hard_pregnancy }
	
	is_triggered_only = yes

	option = { #Take control of the horses.
		name = EVTOPTAHFP20417
		trigger = { 
			OR = { 
				trait = hunter 
				trait = falconer
				trait = duelist
				martial = 15
			} 
		}
		tooltip_info = martial
		tiered_prestige_reward_effect = yes
		troubled_pregnancy_chance_low_effect = yes #Critical failure: chance of Troubled Pregnancy.
		ai_chance = { factor = 100 }
	}
	option = { 
		name = EVTOPTBHFP20417
		trigger = { 
			NOR = { 
				trait = hunter 
				trait = falconer
				trait = duelist
				martial = 15
			} 
		}
		add_trait = wounded
		troubled_pregnancy_chance_medium_effect = yes #Critical failure: chance of Troubled Pregnancy.
		ai_chance = { factor = 10 }
	}
}

#Countryside: Health is dropping during travel.
character_event = { 
	id = HFP.20418
	desc = EVTDESCHFP20418
	picture = GFX_evt_carriage

	trigger = { trait = hard_pregnancy }
	
	is_triggered_only = yes

	immediate = { 
		if = { limit = { any_courtier_or_vassal = { has_minor_title = title_court_physician } } 
			random_courtier_or_vassal = { limit = { has_minor_title = title_court_physician } 
				save_event_target_as = localize_physician
			}
		}
	}

	option = { #Knows how to treat herself.
		name = EVTOPTAHFP20418
		trigger = { 
			OR = { 
				trait = scholar 
				trait = gardener
				trait = mystic
				trait = physician
				learning = 15
			} 
		}
		tooltip_info = learning
		health = -0.25
		troubled_pregnancy_chance_low_effect = yes  #Critical failure: chance of Troubled Pregnancy.
		ai_chance = { factor = 70 }
	}
	option = { #Ask my Physician
		name = EVTOPTBHFP20418
		trigger = { 
			is_ruler = yes
			any_courtier_or_vassal = { has_minor_title = title_court_physician }
		}
		show_portrait = event_target:localize_physician
		wealth = -15
		health = -0.25
		ai_chance = { factor = 100 }
	}
	option = { #Ask my spouse's Physician
		name = EVTOPTCHFP20418
		trigger = { 
			is_ruler = no
			spouse = { 
				is_ruler = yes
				any_courtier_or_vassal = { has_minor_title = title_court_physician } 
			}
		}
		health = -0.25
		ai_chance = { factor = 100 }
	}
	option = { 
		name = EVTOPTDHFP20418
		trigger = { 
			NOR = { 
				trait = scholar 
				trait = gardener
				trait = mystic
				trait = physician
				learning = 15
				any_courtier_or_vassal = { has_minor_title = title_court_physician }
				spouse = { 
					is_ruler = yes
					any_courtier_or_vassal = { has_minor_title = title_court_physician } 
				}
			} 
		}
		health = -0.75
		troubled_pregnancy_chance_medium_effect = yes  #Critical failure: chance of Troubled Pregnancy.
		ai_chance = { factor = 10 }
	}
}

#Countryside: Bad weather.
character_event = { 
	id = HFP.20419
	desc = EVTDESCHFP20419		#Loc key tied to regions.
	picture = GFX_evt_carriage

	trigger = { trait = hard_pregnancy }
	
	is_triggered_only = yes

	option = { #Endure
		name = EVTOPTAHFP20419
		trigger = { 
			trait = brave
		}
		tooltip_info = brave
		health = -0.25
		ai_chance = { factor = 100 }
	}
	option = { #Endure
		name = EVTOPTAHFP20419
		trigger = { 
			trait = stubborn
		}
		tooltip_info = stubborn
		health = -0.25
		troubled_pregnancy_chance_low_effect = yes  #Critical failure: chance of Troubled Pregnancy.
		ai_chance = { factor = 100 }
	}
	option = { 
		name = EVTOPTBHFP20419
		trigger = { 
			NOR = { 
				trait = stubborn
				trait = brave
			}
		}
		health = -0.75
		troubled_pregnancy_chance_medium_effect = yes  #Critical failure: chance of Troubled Pregnancy.
		ai_chance = { factor = 0 }
	}
}


############After Hard Pregnancy recovery###############
character_event = { #if drunk pregnant
	id = HFP.20420
	desc = EVTDESCHFP20420
	picture = GFX_evt_birth

	trigger = { trait = drunkard }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20420
		custom_tooltip = { text = tooltip_recover_drunkard }
		if = { 
			limit = { NOT = { trait = stressed } }
			random = { 
				chance = 30
				add_trait = stressed 
				hidden_tooltip = { character_event = { id = 38282 } } 
			}
		}
		hidden_tooltip = {
			random_list = {
				50 = { 
					modifier = { 
						factor = 1.5 
						has_character_flag = drunk_pregnant
					}
					remove_trait = drunkard
				}
				50 = { 
					hidden_tooltip = { 
						spouse = { 
							character_event = { id = HFP.20426 days = 100 random = 100 } 
						} 
					} 
				}
			}
		}
		clr_character_flag = drunk_pregnant 
	}
	option = { 
		name = EVTOPTBHFP20420
		clr_character_flag = drunk_pregnant 
		hidden_tooltip = { spouse = { character_event = { id = HFP.20426 days = 100 random = 100 } } } 
	}
}

character_event = { #if gluttonous pregnant
	id = HFP.20421
	desc = EVTDESCHFP20421
	picture = GFX_evt_birth

	trigger = { trait = gluttonous }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20421
		lose_weight_small_effect = yes
		weight_trait_check_effect = yes
		custom_tooltip = { text = tooltip_recover_gluttonous }
		if = { 
			limit = { NOT = { trait = stressed } }
			random = { 
				chance = 30
				add_trait = stressed 
				hidden_tooltip = { character_event = { id = 38282 } } 
			}
		}
		hidden_tooltip = {
			random_list = {
				50 = { 
					modifier = { 
						factor = 1.5 
						has_character_flag = gluttonous_pregnant
					}
					remove_trait = gluttonous
				}
				50 = { 
					hidden_tooltip = { spouse = { character_event = { id = HFP.20424 days = 100 random = 100 } }  } 
				}
			}
		}
		clr_character_flag = gluttonous_pregnant 
		ai_chance = { factor = 40 }
	}
	option = { 
		name = EVTOPTBHFP20421
		gain_weight_small_effect = yes
		weight_trait_check_effect = yes
		hidden_tooltip = { spouse = { character_event = { id = HFP.20424 days = 100 random = 100 } } } 
		clr_character_flag = gluttonous_pregnant 
		ai_chance = { factor = 60 }
	}
}

character_event = { #if wroth pregnant
	id = HFP.20422
	desc = EVTDESCHFP20422
	picture = GFX_evt_birth

	trigger = { trait = wroth }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20422
		custom_tooltip = { text = tooltip_recover_wroth }
		if = { 
			limit = { NOT = { trait = stressed } }
			random = { 
				chance = 30
				add_trait = stressed 
				hidden_tooltip = { character_event = { id = 38282 } } 
			}
		}
		hidden_tooltip = {
			random_list = {
				50 = { 
					modifier = { 
						factor = 1.5 
						has_character_flag = wroth_pregnant
					}
					remove_trait = wroth
				}
				50 = { 
					hidden_tooltip = { spouse = { character_event = { id = HFP.20428 days = 100 random = 100 } }  } 
				}
			}
		}
		clr_character_flag = wroth_pregnant 
		ai_chance = { factor = 70 }
	}

	option = { 
		name = EVTOPTBHFP20422
		hidden_tooltip = { 
			spouse = { 
				character_event = { id = HFP.20428 days = 100 random = 100 } 
			}
		} 
		clr_character_flag = wroth_pregnant 
		ai_chance = { factor = 30 }
	}
}

character_event = { #if depressed pregnant
	id = HFP.20423
	desc = EVTDESCHFP20423
	picture = GFX_evt_birth

	trigger = { trait = depressed }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20423
		custom_tooltip = { text = tooltip_recover_depressed }
		gain_weight_small_effect = yes
		weight_trait_check_effect = yes
		if = { 
			limit = { NOT = { trait = stressed } }
			random = { 
				chance = 30
				add_trait = stressed 
				hidden_tooltip = { character_event = { id = 38282 } } 
			}
		}
		hidden_tooltip = {
			random_list = {
				50 = { 
					modifier = { 
						factor = 1.5 
						has_character_flag = depressed_pregnant
					}
					remove_trait = depressed
					hidden_tooltip = { character_event = { id = 38314 } }
				}
				50 = { 
					hidden_tooltip = { spouse = { character_event = { id = HFP.20430 days = 100 random = 100 } }  } 
				}
			}
		}
		clr_character_flag = depressed_pregnant 
		ai_chance = { factor = 80 }
	}
	option = { 
		name = EVTOPTBHFP20423
		lose_weight_small_effect = yes
		weight_trait_check_effect = yes
		clr_character_flag = depressed_pregnant 
		hidden_tooltip = { spouse = { character_event = { id = HFP.20430 days = 100 random = 100 } } } 
		ai_chance = { factor = 20 }
	}
}

############Spouse responses###########

####Spouse complains about fat wife###
character_event = {
	id = HFP.20424
	desc = {
		text = EVTDESCHFP20424
		trigger = { 
			NOT = { 
				FROM = { 
					has_opinion_modifier = { 
						who = ROOT
						modifier = opinion_cravings 
					}
				}
			}
		}
	}
	desc = {
		text = EVTDESCBHFP20424
		trigger = { 
			FROM = { 
				has_opinion_modifier = { 
					who = ROOT
					modifier = opinion_cravings 
				}
			}
		}
	}
	picture = GFX_evt_birth
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { 
			trait = gluttonous
			is_alive = yes
			is_married = ROOT
		}
	}

	option = {
		name = EVTOPTZHFP20424
		trigger = { trait = gluttonous }
		tooltip_info = gluttonous
		custom_tooltip = { text = tooltip_HFP20424_Z }
		tiered_prestige_reward_effect = yes
		reverse_opinion = { who = FROM modifier = opinion_kindred_spirit years = 10 } 
		hidden_tooltip = {
			opinion = { who = FROM modifier = opinion_kindred_spirit years = 10 } 
			FROM = { character_event = { id = HFP.20069 } }
		}
		ai_chance = { 
			factor = 60 
			modifier = { 
				factor = 1.5
				trait = charitable
			}
			modifier = { 
				factor = 1.2
				trait = patient
			}
			modifier = { 
				factor = 1.2
				trait = proud
			}
			modifier = { 
				factor = 1.2
				trait = hedonist
			}
			modifier = { 
				factor = 1.75
				trait = kind
			}
		}
	}

	option = {
		name = {
			text = EVTOPTAHFP20424
			trigger = {
				NOT = { 
					FROM = { 
						has_opinion_modifier = { 
							who = ROOT
							modifier = opinion_cravings 
						}
					}
				}
			}
		}
		name = {
			text = EVTOPTAHFP20424_B
			trigger = {
				FROM = { 
					has_opinion_modifier = { 
						who = ROOT
						modifier = opinion_cravings 
					}
				}
			}
		}
		custom_tooltip = { text = tooltip_HFP20424_A }
		FROM = {
			character_event = { id = HFP.20425 }
			opinion = { 
				modifier = opinion_angry
				who = ROOT
				years = 1 
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.2
				trait = temperate
			}
			modifier = { 
				factor = 1.2
				trait = wroth
			}
			modifier = { 
				factor = 1.2
				trait = proud
			}
			modifier = { 
				factor = 1.2
				trait = kind
			}
			modifier = { 
				factor = 1.2
				trait = gregarious
			}
			modifier = { 
				factor = 1.2
				trait = honest
			}
		}
	}
	option = {
		name = EVTOPTBHFP20424
		custom_tooltip = { text = tooltip_HFP20424_B }
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.2
				trait = shy
			}
			modifier = { 
				factor = 1.2
				trait = content
			}
			modifier = { 
				factor = 1.5
				trait = gluttonous
			}
			modifier = { 
				factor = 1.2
				trait = slothful
			}
			modifier = { 
				factor = 1.2
				trait = drunkard
			}
			modifier = { 
				factor = 1.2
				trait = envious
			}
			modifier = { 
				factor = 0.5
				is_friend = FROM
			}
			modifier = { 
				factor = 0.5
				is_lover = FROM
			}
			modifier = { 
				factor = 2
				is_rival = FROM
			}
		}
	}
}

####Fat wife receives complaint###
character_event = {
	id = HFP.20425
	desc = EVTDESCHFP20425
	picture = GFX_evt_quarrel
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTAHFP20425
		random = { 
			chance = 75
			if = { 
				limit = { trait = stressed }
				remove_trait = stressed 
				hidden_tooltip = { character_event = { id = 38313 } }
			}
			lose_weight_small_effect = yes
			weight_trait_check_effect = yes
			remove_trait = gluttonous 
			clr_character_flag = gluttonous_pregnant
			hidden_tooltip = { remove_opinion = { who = FROM modifier = opinion_angry } }
			hidden_tooltip = { FROM = { character_event = { id = HFP.20432 days = 12 } } }
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.35
				is_ruler = no
				FROM = { is_ruler = yes }
			}
			modifier = { 
				factor = 1.2
				trait = patient
			}
			modifier = { 
				factor = 1.2
				trait = humble
			}
			modifier = { 
				factor = 1.2
				trait = diligent
			}
			modifier = { 
				factor = 1.2
				trait = ambitious
			}
			modifier = { 
				factor = 1.2
				trait = just
			}
			modifier = { 
				factor = 1.2
				trait = honest
				}
			}
		}
	option = { 
		name = EVTOPTBHFP20425
		gain_weight_small_effect = yes
		weight_trait_check_effect = yes
		hidden_tooltip = { FROM = { character_event = { id = HFP.20433 days = 12 } } }
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.2
				trait = slothful
			}
			modifier = { 
				factor = 1.2
				trait = proud
			}
			modifier = { 
				factor = 1.2
				trait = drunkard
			}
			modifier = { 
				factor = 1.2
				trait = shy
			}
			modifier = { 
				factor = 1.2
				trait = content
			}
			modifier = { 
				factor = 1.2
				trait = arbitrary
			}
			modifier = { 
				factor = 1.2
				trait = wroth
			}
			modifier = { 
				factor = 0.5
				is_friend = FROM
			}
			modifier = { 
				factor = 0.5
				is_lover = FROM
			}
			modifier = { 
				factor = 2
				is_rival = FROM
			}
		}
	}
}

####Spouse complains about drunkard wife###
character_event = {
	id = HFP.20426
	desc = EVTDESCHFP20426
	picture = GFX_evt_birth
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { 
			trait = drunkard
			is_alive = yes
			is_married = ROOT
		}
	}
	
	option = {
		name = EVTOPTAHFP20426
		custom_tooltip = { text = tooltip_HFP20426_A }
		FROM = {
			hidden_tooltip = { character_event = { id = HFP.20427 } }
			opinion = { 
				modifier = opinion_angry
				who = ROOT
				years = 1 
			}
		}
		ai_chance = { 
			factor = 60 
			modifier = { 
				factor = 1.35
				is_ruler = no
				FROM = { is_ruler = yes }
			}
			modifier = { 
				factor = 1.2
				trait = temperate
			}
			modifier = { 
				factor = 1.2
				trait = wroth
			}
			modifier = { 
				factor = 1.2
				trait = proud
			}
			modifier = { 
				factor = 1.2
				trait = kind
			}
			modifier = { 
				factor = 1.2
				trait = gregarious
			}
			modifier = { 
				factor = 1.2
				trait = honest
			}
		}
	}
	option = {
		name = EVTOPTBHFP20426
		custom_tooltip = { text = tooltip_HFP20426_B }
		ai_chance = { 
			factor = 40 
			modifier = { 
				factor = 1.2
				trait = shy
			}
			modifier = { 
				factor = 1.2
				trait = content
			}
			modifier = { 
				factor = 1.2
				trait = gluttonous
			}
			modifier = { 
				factor = 1.2
				trait = slothful
			}
			modifier = { 
				factor = 1.5
				trait = drunkard
			}
			modifier = { 
				factor = 1.2
				trait = envious
			}
			modifier = { 
				factor = 0.5
				is_friend = FROM
			}
			modifier = { 
				factor = 0.5
				is_lover = FROM
			}
			modifier = { 
				factor = 2
				is_rival = FROM
			}
		}
	}
}

####Drunkard wife receives complaint###
character_event = {
	id = HFP.20427
	desc = EVTDESCHFP20427
	picture = GFX_evt_quarrel
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTAHFP20427
		random = { 
			chance = 75
			remove_trait = drunkard
			if = { 
				limit = { trait = stressed }
				remove_trait = stressed 
				hidden_tooltip = { character_event = { id = 38313 } }
			}
			clr_character_flag = drunkard_pregnant
			hidden_tooltip = { remove_opinion = { who = FROM modifier = opinion_angry } }
			hidden_tooltip = { 
				FROM = { 
					character_event = { id = HFP.20434 days = 12 } 
				}
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.35
				is_ruler = no
				FROM = { is_ruler = yes }
			}
			modifier = { 
				factor = 1.5
				trait = trusting
			}
			modifier = { 
				factor = 1.2
				trait = patient
			}
			modifier = { 
				factor = 1.2
				trait = humble
			}
			modifier = { 
				factor = 1.2
				trait = diligent
			}
			modifier = { 
				factor = 1.2
				trait = ambitious
			}
			modifier = { 
				factor = 1.2
				trait = just
			}
			modifier = {
				factor = 1.2
				trait = honest
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20427
		hidden_tooltip = { FROM = { character_event = { id = HFP.20435 days = 12 } } }
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.5
				trait = stubborn
			}
			modifier = { 
				factor = 1.2
				trait = slothful
			}
			modifier = { 
				factor = 1.2
				trait = proud
			}
			modifier = { 
				factor = 1.2
				trait = gluttonous
			}
			modifier = { 
				factor = 1.2
				trait = shy
			}
			modifier = { 
				factor = 1.2
				trait = content
			}
			modifier = { 
				factor = 1.2
				trait = arbitrary
			}
			modifier = { 
				factor = 1.2
				trait = wroth
			}
			modifier = { 
				factor = 0.5
				is_friend = FROM
			}
			modifier = { 
				factor = 0.5
				is_lover = FROM
			}
			modifier = { 
				factor = 2
				is_rival = FROM
			}
		}
	}
}

####Spouse complains about wroth wife###
character_event = {
	id = HFP.20428
	desc = EVTDESCHFP20428
	picture = GFX_evt_birth
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { 
			NOT = { trait = pregnant }
			trait = wroth
			is_alive = yes
			is_married = ROOT
		}
	}

	option = {
		name = EVTOPTAHFP20428
		custom_tooltip = { text = tooltip_HFP20428_A }
		FROM = {
			hidden_tooltip = { character_event = { id = HFP.20429 } }
			opinion = { 
				modifier = opinion_angry
				who = ROOT
				years = 1 
			}
		}
		ai_chance = { 
			factor = 40 
			modifier = { 
				factor = 1.5
				trait = brave
			}
			modifier = { 
				factor = 1.2
				trait = wroth
			}
			modifier = { 
				factor = 1.2
				trait = proud
			}
			modifier = { 
				factor = 1.2
				trait = kind
			}
			modifier = { 
				factor = 1.2
				trait = gregarious
			}
			modifier = { 
				factor = 1.2
				trait = honest
			}
		}
	}
	option = {
		name = EVTOPTBHFP20428
		custom_tooltip = { text = tooltip_HFP20428_B }
		ai_chance = { 
			factor = 60 
			modifier = { 
				factor = 1.2
				trait = shy
			}
			modifier = { 
				factor = 1.2
				trait = content
			}
			modifier = { 
				factor = 1.2
				trait = gluttonous
			}
			modifier = { 
				factor = 1.5
				trait = craven
			}
			modifier = { 
				factor = 1.2
				trait = slothful
			}
			modifier = { 
				factor = 1.5
				trait = drunkard
			}
			modifier = { 
				factor = 1.2
				trait = humble
			}
			modifier = { 
				factor = 0.5
				is_friend = FROM
			}
			modifier = { 
				factor = 0.5
				is_lover = FROM
			}
			modifier = { 
				factor = 2
				is_rival = FROM
			}
		}
	}
}

####Wroth wife receives complaint###
character_event = {
	id = HFP.20429
	desc = EVTDESCHFP20429
	picture = GFX_evt_quarrel
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTAHFP20429
		random = { 
			chance = 60
			if = { 
				limit = { trait = stressed }
				remove_trait = stressed 
				hidden_tooltip = { character_event = { id = 38313 } }
			}
			remove_trait = wroth
			clr_character_flag = wroth_pregnant
			hidden_tooltip = { remove_opinion = { who = FROM modifier = opinion_angry } }
			hidden_tooltip = { 
				FROM = { 
					character_event = { id = HFP.20436 days = 12 } 
				}
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.35
				is_ruler = no
				FROM = { is_ruler = yes }
			}
			modifier = { 
				factor = 1.5
				trait = trusting
			}
			modifier = { 
				factor = 1.2
				trait = shy
			}
			modifier = { 
				factor = 1.2
				trait = humble
			}
			modifier = { 
				factor = 1.2
				trait = temperate
			}
			modifier = { 
				factor = 1.2
				trait = diligent
			}
			modifier = { 
				factor = 1.2
				trait = content
			}
			modifier = { 
				factor = 1.2
				trait = just
			}
			modifier = { 
				factor = 1.2
				trait = honest
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20429
		random = { 
			chance = 40
			FROM  = { add_trait = wounded }
			hidden_tooltip = { FROM = { character_event = { id = HFP.20437 days = 1 } } } 
			}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.5
				trait = stubborn
			}
			modifier = { 
				factor = 1.2
				trait = slothful
			}
			modifier = { 
				factor = 1.5
				trait = proud
			}
			modifier = { 
				factor = 1.2
				trait = gregarious
			}
			modifier = { 
				factor = 1.2
				trait = ambitious
			}
			modifier = { 
				factor = 1.2
				trait = arbitrary
			}
			modifier = { 
				factor = 1.2
				trait = strong
			}
			modifier = { 
				factor = 0.5
				is_friend = FROM
			}
			modifier = { 
				factor = 0.5
				is_lover = FROM
			}
			modifier = { 
				factor = 2
				is_rival = FROM
			}
		}
	}
}

####Spouse complains about depressed wife###
character_event = {
	id = HFP.20430
	desc = EVTDESCHFP20430
	picture = GFX_evt_birth
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { 
			trait = depressed
			is_alive = yes
			is_married = ROOT
		}
	}

	option = {
		name = EVTOPTZHFP20430
		trigger = { trait = shy }
		tooltip_info = shy
		custom_tooltip = { text = tooltip_HFP20430_Z }
		tiered_piety_reward_effect = yes
		reverse_opinion = { who = FROM modifier = opinion_kindred_spirit years = 10 } 
		hidden_tooltip = {
			opinion = { who = FROM modifier = opinion_kindred_spirit years = 10 } 
			FROM = { character_event = { id = HFP.20070 } }
		}
		ai_chance = { 
			factor = 60 
			modifier = { 
				factor = 1.5
				trait = charitable
			}
			modifier = { 
				factor = 1.2
				trait = patient
			}
			modifier = { 
				factor = 1.2
				trait = humble
			}
			modifier = { 
				factor = 1.2
				trait = poet
			}
			modifier = { 
				factor = 1.75
				trait = kind
			}
			modifier = { 
				factor = 1.2
				trait = depressed
			}
		}
	}
	option = {
		name = EVTOPTAHFP20430
		custom_tooltip = { text = tooltip_HFP20430_A }
		FROM = {
			hidden_tooltip = { character_event = { id = HFP.20431 } }
		}
		ai_chance = { 
			factor = 60 
			modifier = { 
				factor = 1.5
				trait = charitable
			}
			modifier = { 
				factor = 1.2
				trait = patient
			}
			modifier = { 
				factor = 1.2
				trait = humble
			}
			modifier = { 
				factor = 1.2
				trait = just
			}
			modifier = { 
				factor = 1.75
				trait = kind
			}
			modifier = { 
				factor = 1.2
				trait = gregarious
			}
			modifier = { 
				factor = 1.2
				trait = honest
			}
		}
	}
	option = {
		name = EVTOPTBHFP20430
		custom_tooltip = { text = tooltip_HFP20430_B }
		hidden_tooltip = { 
			random = { 
				chance = 60
				remove_trait = kind 
				hidden_tooltip = { character_event = { id = 38307 } }
			} 
		}
		ai_chance = { 
			factor = 60 
			modifier = { 
				factor = 1.2
				trait = shy
			}
			modifier = { 
				factor = 1.2
				trait = content
			}
			modifier = { 
				factor = 1.2
				trait = proud
			}
			modifier = { 
				factor = 1.75
				trait = cruel
			}
			modifier = { 
				factor = 1.2
				trait = slothful
			}
			modifier = { 
				factor = 1.5
				trait = drunkard
			}
			modifier = { 
				factor = 0.5
				is_friend = FROM
			}
			modifier = { 
				factor = 0.5
				is_lover = FROM
			}
			modifier = { 
				factor = 2
				is_rival = FROM
			}
		}
	}
}

####Depressed wife receives complaint###
character_event = {
	id = HFP.20431
	desc = EVTDESCHFP20431
	picture = GFX_evt_quarrel
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTAHFP20431
		gain_weight_small_effect = yes
		weight_trait_check_effect = yes
		random = { 
			chance = 75
			if = { 
				limit = { trait = stressed }
				remove_trait = stressed 
				hidden_tooltip = { character_event = { id = 38313 } }
			}
			remove_trait = depressed
			clr_character_flag = depressed_pregnant
 			hidden_tooltip = { FROM = { character_event = { id = HFP.20438 days = 12 } } } 
 		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.35
				is_ruler = no
				FROM = { is_ruler = yes }
			}
			modifier = { 
				factor = 1.5
				trait = trusting
			}
			modifier = { 
				factor = 1.2
				trait = wroth
			}
			modifier = { 
				factor = 1.5
				trait = proud
			}
			modifier = { 
				factor = 1.2
				trait = ambitious
			}
			modifier = { 
				factor = 1.2
				trait = gregarious
			}
			modifier = { 
				factor = 1.2
				trait = lustful
			}
			modifier = { 
				factor = 1.2
				trait = just
			}
			modifier = { 
				factor = 1.2
				trait = strong
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20431
		lose_weight_small_effect = yes
		weight_trait_check_effect = yes
		random = { 
			chance = 80
			health = -1.0
 			hidden_tooltip = { FROM = { character_event = { id = HFP.20439 days = 12 } } } 
 		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.5
				trait = stubborn
			}
			modifier = { 
				factor = 1.2
				trait = slothful
			}
			modifier = { 
				factor = 1.5
				trait = humble
			}
			modifier = { 
				factor = 1.2
				trait = weak
			}
			modifier = { 
				factor = 1.2
				trait = shy
			}
			modifier = { 
				factor = 1.2
				trait = content
			}
			modifier = { 
				factor = 1.2
				trait = envious
			}
			modifier = { 
				factor = 1.2
				trait = patient
			}
			modifier = { 
				factor = 0.5
				is_friend = FROM
			}
			modifier = { 
				factor = 0.5
				is_lover = FROM
			}
			modifier = { 
				factor = 2
				is_rival = FROM
			}
		}
	}
}

############Spouse receives comunication of success/failure###########

character_event = { #wife's back in shape
	id = HFP.20432
	desc = EVTDESCHFP20432
	picture = GFX_evt_lovers
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20432 
	}
}

character_event = { #wife's become fat
	id = HFP.20433
	desc = EVTDESCHFP20433
	picture = GFX_evt_fancy_feast

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20433 
	}
}

character_event = { #wife's sober again
	id = HFP.20434
	desc = EVTDESCHFP20434
	picture = GFX_evt_lovers
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20434 
	}
}

character_event = { #wife still drinks
	id = HFP.20435
	desc = EVTDESCHFP20435
	picture = GFX_evt_lovers
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20435 
	}
}
character_event = { #wife's calm now
	id = HFP.20436
	desc = EVTDESCHFP20436
	picture = GFX_evt_lovers
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20436 
	}
}

character_event = { #wife's wounded husband!
	id = HFP.20437
	desc = EVTDESCHFP20437
	picture = GFX_evt_quarrel
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20437
		opinion = { 
			modifier = opinion_angry
			who = FROM
			years = 1 
		}
	}
}
character_event = { #wife's happy again
	id = HFP.20438
	desc = EVTDESCHFP20438
	picture = GFX_evt_lovers
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20438 
	}
}

character_event = { #wife's become hollow
	id = HFP.20439
	desc = EVTDESCHFP20439
	picture = GFX_evt_bad_news_female
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20439 
	}
}
########################################
#Pre-notifications during pregnancy

character_event = { #wife enjoys drinking
	id = HFP.20440
	desc = EVTDESCHFP20440
	picture = GFX_evt_drunk
	
	trigger = { 
		trait = drunkard
		trait = hard_pregnancy 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20440 
		tooltip_info = drunkard
	}
}

character_event = { #wife enjoys eating
	id = HFP.20441
	desc = EVTDESCHFP20441
	picture = GFX_evt_fancy_feast
	
	trigger = { 
		trait = gluttonous
		NOT = { trait = troubled_pregnancy }
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20441 
		tooltip_info = gluttonous
	}
}

character_event = { #wife enjoys yelling
	id = HFP.20442
	desc = EVTDESCHFP20442
	picture = GFX_evt_quarrel
	
	trigger = { 
		trait = wroth
		trait = hard_pregnancy 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20442 
		tooltip_info = wroth
	}
}

character_event = { #wife enjoys crying
	id = HFP.20443
	desc = EVTDESCHFP20443
	picture = GFX_evt_bad_news_female
	
	trigger = { 
		trait = depressed
		trait = hard_pregnancy 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20443
		tooltip_info = depressed
	}
}
###############################################################################

#HFP.20500 Troubled Pregnancy begins.
character_event = { 
	id = HFP.20500 
	desc = EVTDESCHFP20500
	picture = GFX_evt_illness

	is_triggered_only = yes

	immediate = { 
		remove_trait = hard_pregnancy 
		add_trait = troubled_pregnancy
	}

	option = {
		name = EVTOPTAHFP20500
		tooltip = { add_trait = troubled_pregnancy }
		hidden_tooltip = { 
			set_variable =  { which = troubled_pregnancy_variable value = 2 } #Used to determine if the mother dies or not, and if there are complications after the pregnancy.
			
			if = {  #If married, spouse may offer assistance.
				limit = { is_married = yes } 
				spouse = { character_event = { id = HFP.20501 days = 4 } } 
			} 

			if = {  #If regent likes you, he'll try to help you, as if he were your spouse.
				limit = { 
					any_courtier_or_vassal = { 
						OR = { 
							has_minor_title = title_regent 
							has_minor_title = title_appointed_regent
						}
						NOT = { is_married = FROM } #Don't fire twice if the spouse is also the regent.
						opinion = { 
							who = ROOT 
							value = -50 
						} 
					}
				} 
				random_courtier_or_vassal = { 
					limit = { 
						OR = { 
							has_minor_title = title_regent 
							has_minor_title = title_appointed_regent
						}
						opinion = {
							who = ROOT 
							value = -50 
						} 
					}
					character_event = { id = HFP.20501 days = 6 } 
				} 
			}
			if = { #If regent doesn't like you, he may try to kill you in your vulnerable state.
				limit = { 
					any_courtier_or_vassal = { 
						OR = { 
							has_minor_title = title_regent 
							has_minor_title = title_appointed_regent
						}
						NOT = { 
							opinion = {  
								who = ROOT 
								value = -50 
							} 
						} 
					}
				} 
				random_courtier_or_vassal = { 
					limit = { 
						OR = { 
							has_minor_title = title_regent 
							has_minor_title = title_appointed_regent
						}
						NOT = { 
						opinion = {
							who = ROOT 
							value = -50 
							} 
						} 
					}
					character_event = { id = HFP.20502 days = 3 random = 3 } 
				} 
			}
			if = { #Chance of a strange birth.
				limit = { NOT = { has_dynasty_flag = flag_vision_baby } }
				random_list = { 
					70 = { } 									#No vision
					15 = { 
						modifier = { 
							factor = 0 
							NOR = { 
								religion_group = christian
								religion_group = muslim
								religion = tengri_pagan
								religion = tengri_pagan_reformed
								religion = norse_pagan
								religion = norse_pagan_reformed
							} 
						} 
						set_dynasty_flag = flag_vision_baby		#Positive
						character_event = { id = HFP.20503 days = 43 random = 20 }  
					} 
					15 = { 
						modifier = { 
							factor = 0 
							NOR = { 
								religion_group = christian
								religion_group = muslim
								religion = tengri_pagan
								religion = tengri_pagan_reformed
								religion = norse_pagan
								religion = norse_pagan_reformed
							} 
						}
						set_dynasty_flag = flag_vision_baby 	#Negative
						character_event = { id = HFP.20504 days = 33 random = 20 }  
					} 
				} 
			}

			character_event = { id = HFP.20520 days = 10 random = 7 } #Give mom chance to help herself.
		}
		ai_chance = { factor = 100 }
	}
}

#Notify Spouse and Regent of the ruler about what is happening and prompt either to offer help if possible.
character_event = { 
	id = HFP.20501
	desc = {
		text = EVTDESCHFPA20501	
		picture = GFX_evt_bad_news
		trigger = {
			ROOT = { is_married = FROM } #Desc for Spouse.
		}
	}
	desc = {
		text = EVTDESCHFPB20501	
		picture = GFX_evt_illness
		trigger = {
			ROOT = { has_minor_title = title_regent } #Desc for Regent.
		}
	}
	picture = GFX_evt_bad_news

	is_triggered_only = yes


	option = { #Send Physician
		name = EVTOPTAHFP20501
		custom_tooltip = { text = EVTOOLTIPAHFP20501 }
		wealth = -50
		trigger = { 
			is_ruler = yes
			any_courtier_or_vassal = { has_minor_title = title_court_physician }
		}
		if = { 
			limit = { is_married = FROM } 
			random_courtier_or_vassal = { 
				limit = { has_minor_title = title_court_physician } 
				save_event_target_as = pregnancy_spouse_physician
			}
		}
		if = { 
			limit = { 
				has_minor_title = title_regent
				NOT = { is_married = FROM } #Don't fire twice if the spouse is also the regent.
			} 
			random_courtier_or_vassal = { 
				limit = { has_minor_title = title_court_physician } 
				save_event_target_as = pregnancy_regent_physician
			}
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20505 days = 1 } } } #Notify woman
		ai_chance = { 
			factor = 70 
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					trait = quick 
				}
			}
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					trait = genius 
				}
			}
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					learning = 20
				}
			}
			modifier = { 
				factor = 0.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					NOT = { learning = 10 }
				}
			}
		}
	}

	option = { #Send Physician (no Reaper's Due)
		name = EVTOPTAHFP20501
		custom_tooltip = { text = EVTOOLTIPAHFP20501 }
		wealth = -50
		trigger = { 
			is_ruler = yes
			FROM = { is_ruler = no }
			NOT = { has_dlc = "Reapers" }
		}
		FROM = { set_character_flag = pregnancy_healer_help }
		ai_chance = { 
			factor = 70 
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					trait = quick 
				}
			}
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					trait = genius 
				}
			}
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					learning = 20
				}
			}
			modifier = { 
				factor = 0.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					NOT = { learning = 10 }
				}
			}
		}
	}

	option = { #No Physician, but I am a Scholar myself
		name = EVTOPTBHFP20501
		custom_tooltip = { text = EVTOOLTIPBHFP20501 }
		trigger = { 
			NOT = { any_courtier_or_vassal = { has_minor_title = title_court_physician } }
			is_inaccessible_trigger = no
			prisoner = no
			NOT = { trait = incapable }
			OR = { 
				trait = scholar 
				trait = mystic
				trait = physician
				learning = 15
			}
		}
		if = { 
			limit = { is_married = FROM } 
			save_event_target_as = pregnancy_spouse_physician
		}
		if = { 
			limit = { has_minor_title = title_regent } 
			save_event_target_as = pregnancy_regent_physician
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20506 } } } #Notify woman
		ai_chance = { 
			factor = 70 
			modifier = { 
				factor = 1.5
				trait = quick
			}
			modifier = { 
				factor = 1.5
				trait = genius
			}
			modifier = { 
				factor = 1.5
				learning = 20
			}
			modifier = { 
				factor = 0.5
				NOT = { learning = 10 }
			}
		}
	}

	option = { #Send a Priest
		name = EVTOPTCHFP20501
		custom_tooltip = { text = EVTOOLTIPCHFP20501 }
		hidden_tooltip = { FROM = { character_event = { id = HFP.20509 days = 1 } } } #Notify woman
		trigger = { 
			OR = { 
				is_reformed_religion = yes 
				NOT = { religion_group = pagan_group }
			}
			NOT = { FROM = { has_character_flag = pregnancy_priest_comfort } }
			NOT = { FROM = { has_character_flag = pregnancy_shaman_comfort } }
		}
		FROM = { set_character_flag = pregnancy_priest_comfort }
		piety = 100
		wealth = -20
		ai_chance = { 
			factor = 10 
			modifier = { 
				factor = 2
				trait = zealous
			}
		}
	}
	option = { #Send a Shaman
		name = EVTOPTDHFP20501
		custom_tooltip = { text = EVTOOLTIPDHFP20501 }
		hidden_tooltip = { FROM = { character_event = { id = HFP.20510 } } } #Notify woman
		trigger = { 
			is_reformed_religion = no 
			religion_group = pagan_group
			NOT = { FROM = { has_character_flag = pregnancy_shaman_comfort } }
			NOT = { FROM = { has_character_flag = pregnancy_priest_comfort } }
		}
		FROM = { set_character_flag = pregnancy_shaman_comfort }
		piety = 50
		prestige = 50
		wealth = -5
		ai_chance = { 
			factor = 20 
			modifier = { 
				factor = 2
				is_tribal = yes
			}
			modifier = { 
				factor = 2.5
				is_nomadic = yes
			}
			modifier = { 
				factor = 2
				trait = zealous
			}
		}
	}

	option = { #Offer moral support
		name = EVTOPTEHFP20501
		custom_tooltip = { text = EVTOOLTIPEHFP20501 }
		hidden_tooltip = { FROM = { character_event = { id = HFP.20519 } } } #Notify woman
		trigger = { is_married = FROM }
		FROM = { set_character_flag = pregnancy_spouse_comfort }
		if = { 
			limit = { 
				FROM = { 
					opinion = { 
						who = FROM 
						value = -50 
					} 
				}
			}
			FROM = { 
				opinion = { 
					modifier = comforted_opinion
					who = ROOT
					years = 5 
				}
			}
		}
		ai_chance = { 	
			factor = 30 
			modifier = { 
				factor = 0.1
				NOT = { trait = slow }
				NOT = { trait = imbecile }
				NOT = { trait = inbred }
				OR = { 		#If you have a better option, you'd need to be an idiot not use that.
					trait = zealous 
					trait = cruel
					AND = { 
						is_inaccessible_trigger = no
						prisoner = no
						NOT = { trait = incapable }
						OR = { 
							trait = scholar 
							trait = mystic
							trait = physician 
							learning = 15
						} 
					}
					AND = { 
						is_ruler =  yes
						any_courtier_or_vassal = { has_minor_title = title_court_physician } 
					}
				}
			}
		}
	}

	option = { #Do nothing.
		name = EVTOPTFHFP20501
		ai_chance = { 
			factor = 1 
			modifier = { 
				factor = 0
				is_lover = FROM
			}
			modifier = { 
				factor = 0
				is_friend = FROM
			}
			modifier = { 
				factor = 50
				is_rival = FROM
			}
			modifier = { 
				factor = 10
				trait = greedy
				NOT =  { wealth = 0 } 
			}
			modifier = { 
				factor = 10
				NOT = { 
					opinion = { 
						who = FROM 
						value = -50 
					} 
				} 
			}
			modifier = { 
				factor = 30
				NOT = { 
					opinion = { 
						who = FROM 
						value = -90 
					} 
				} 
			}
		}
	}
}

#Naughty Regent: So, how do we do it?
character_event = {
	id = HFP.20502
	desc = EVTDESCHFP20502
	picture = GFX_evt_shadow

	trigger = { 
		FROM = { trait = troubled_pregnancy } 
		OR = { 
			has_minor_title = title_regent 
			has_minor_title = title_appointed_regent
		}
	}
	
	is_triggered_only = yes

	option = { #Poison
		name = EVTOPTAHFP20502
		custom_tooltip = { text = EVTOOLTIPAHFP20502 }
		set_character_flag = flag_poisoning_mother
		hidden_tooltip = { 
			random_list = { 
				50 = { #Success
					modifier = { 
						factor = 0.5
						NOT = { intrigue = 5 }
					}
					modifier = { 
						factor = 0.75
						NOT = { intrigue = 10 }
					}
					modifier = { 
						factor = 1.25
						intrigue = 10
					}
					modifier = { 
						factor = 1.25
						intrigue = 15
					}
					modifier = { 
						factor = 1.5
						intrigue = 20
					}
					modifier = { 
						factor = 1.75
						intrigue = 25
					}
					modifier = { 
						factor = 1.2
						trait = amateurish_plotter
					}
					modifier = { 
						factor = 1.3
						trait = flamboyant_schemer
					}
					modifier = { 
						factor = 1.4
						trait = intricate_webweaver
					}
					modifier = { 
						factor = 1.5
						trait = elusive_shadow
					}
					modifier = { 
						factor = 1.5
						trait = schemer
					}
					modifier = { 
						factor = 1.5
						trait = quick
					}
					modifier = { 
						factor = 1.75
						trait = genius
					}
					modifier = { 
						factor = 1.25
						trait = deceitful
					}
					modifier = { 
						factor = 0.5
						trait = slow
					}
					modifier = { 
						factor = 0.25
						trait = imbecile
					}
					modifier = { 
						factor = 0.25
						trait = inbred
					}
					FROM = { character_event = { id = HFP.20511 } } 
				} 
				50 = { #Failure
					FROM = { character_event = { id = HFP.20515 } } 
				} 
			} 
		}
		ai_chance = { 
			factor = 40 
			modifier = { 
				factor = 0.5
				NOT = { intrigue = 5 }
			}
			modifier = { 
				factor = 0.75
				NOT = { intrigue = 10 }
			}
			modifier = { 
				factor = 0.85
				NOT = { intrigue = 15 }
			}
			modifier = { 
				factor = 1.25
				trait = deceitful
			}
			modifier = { 
				factor = 1.5
				trait = schemer
			}
		}
	}
	
	option = { #Smothering
		name = EVTOPTBHFP20502
		custom_tooltip = { text = EVTOOLTIPBHFP20502 }
		set_character_flag = flag_smothering_mother
		hidden_tooltip = { 
			random_list = { 
				50 = { #Success
					modifier = { 
						factor = 0.5
						NOT = { combat_rating = 5 }
					}
					modifier = { 
						factor = 0.75
						NOT = { combat_rating = 10 }
					}
					modifier = { 
						factor = 1.25
						combat_rating = 10
					}
					modifier = { 
						factor = 1.25
						combat_rating = 15
					}
					modifier = { 
						factor = 1.5
						combat_rating = 20
					}
					modifier = { 
						factor = 1.75
						combat_rating = 25
					}
					modifier = { 
						factor = 1.2
						trait = misguided_warrior
					}
					modifier = { 
						factor = 1.3
						trait = tough_soldier
					}
					modifier = { 
						factor = 1.4
						trait = skilled_tactician
					}
					modifier = { 
						factor = 1.5
						trait = brilliant_strategist
					}
					modifier = { 
						factor = 1.5
						trait = duelist
					}
					modifier = { 
						factor = 1.5
						trait = robust
					}
					modifier = { 
						factor = 1.75
						trait = strong
					}
					modifier = { 
						factor = 1.25
						trait = hunter
					}
					modifier = { 
						factor = 0.5
						trait = feeble
					}
					modifier = { 
						factor = 0.25
						trait = weak
					}
					modifier = { 
						factor = 0.75
						trait = inbred
					}
					FROM = { character_event = { id = HFP.20513 } } 
				} 
				50 = { #Failure
					FROM = { character_event = { id = HFP.20518 } } 
				} 
			} 
		}
		ai_chance = { 
			factor = 40 
			modifier = { 
				factor = 0.5
				trait = weak 
			}
			modifier = { 
				factor = 0.5
				trait = craven 
			}
			modifier = { 
				factor = 0.5
				trait = feeble
			}
			modifier = { 
				factor = 0.5
				NOT = { combat_rating = 10 }
			}
			modifier = { 
				factor = 1.5
				trait = strong
			}
			modifier = { 
				factor = 1.5
				trait = robust
			}
		}
	}
	
	option = { #Not doing it.
		name = EVTOPTCHFP20502
		piety = 50
		ai_chance = { 
			factor = 5 
			modifier = { 
				factor = 0.1
				FROM = { current_heir = { character = ROOT } }
			}
			modifier = { 
				factor = 2
				trait = honest
			}
			modifier = { 
				factor = 0.75
				trait = deceitful
			}
			modifier = { 
				factor = 0.5
				trait = cruel 
			}
			modifier = { 
				factor = 0.5
				trait = lunatic 
			}
			modifier = { 
				factor = 0.5
				trait = possessed 
			}
			modifier = { 
				factor = 0.5
				is_rival = FROM
			}
			modifier = { 
				factor = 0.75
				intrigue = 12
			}
		}
	}
}

#Rare strange positive dream during pregnancy will cause strange birth. (happens only once per dynasty)
character_event = {
	id = HFP.20503
	desc = {
		text = EVTDESCHFPA20503	
		picture = GFX_evt_icon
		trigger = {
			OR = { 
				religion_group = christian
				religion_group = muslim
			} 
		}
	}
	desc = {
		text = EVTDESCHFPB20503
		picture = GFX_evt_comet
		trigger = {
			OR = { 
				religion = norse_pagan
				religion = norse_pagan_reformed
			} 
		}
	}
	desc = {
		text = EVTDESCHFPC20503
		picture = GFX_evt_wolf
		trigger = {
			OR = { 
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			} 
		}
	}
	picture = GFX_evt_comet

	trigger = { trait = pregnant }

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20503
		trigger = { 
			OR = { 
				religion_group = christian
				religion_group = muslim
			} 
		}
		set_character_flag = gabriel_baby
	}
	option = { 
		name = EVTOPTBHFP20503
		trigger = { 
			OR = { 
				religion = norse_pagan
				religion = norse_pagan_reformed
			} 
		}
		set_character_flag = thor_baby
	}
	option = { 
		name = EVTOPTCHFP20503
		trigger = { 
			OR = { 
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			} 
		}
		set_character_flag = tengri_baby
	}
}

#Rare strange negative dream during pregnancy will cause strange birth. (happens only once per dynasty)
character_event = {
	id = HFP.20504
	desc = {
		text = EVTDESCHFPA20504
		picture = GFX_evt_icon
		trigger = {
			religion_group = christian
		}
	}
	desc = {
		text = EVTDESCHFPB20504
		picture = GFX_evt_irminsul_burning
		trigger = {
			religion_group = muslim
		}
	}
	desc = {
		text = EVTDESCHFPC20504
		picture = GFX_evt_torture
		trigger = {
			OR = { 
				religion = norse_pagan
				religion = norse_pagan_reformed
			} 
		}
	}
	desc = {
		text = EVTDESCHFPD20504
		picture = GFX_evt_illness
		trigger = {
			OR = { 
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			} 
		}
	}
	picture = GFX_evt_illness

	trigger = { trait = pregnant }

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20504
		trigger = { 
			religion_group = christian
		}
		set_character_flag = lucifer_baby
	}
	option = { 
		name = EVTOPTBHFP20504
		trigger = { 
			religion_group = muslim
		}
		set_character_flag = iblis_baby
	}
	option = { 
		name = EVTOPTCHFP20504
		trigger = { 
			OR = { 
				religion = norse_pagan
				religion = norse_pagan_reformed
			} 
		}
		set_character_flag = loki_baby
	}
	option = { 
		name = EVTOPTDHFP20504
		trigger = { 
			OR = { 
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			} 
		}
		set_character_flag = erlik_baby
	}
}

#Notification: Spouse/Regent has sent his physician to help. Do you want him?
character_event = {
	id = HFP.20505
	desc = EVTDESCHFPA20505
	picture = GFX_evt_court_physician
	
	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20505
		hidden_tooltip = {
			FROM = { character_event = { id = HFP.20507 } } 
			ROOT = {
				if = {
					limit = {
						event_target:pregnancy_spouse_physician = {
							always = yes
						}
					}
					save_persistent_event_target = { name = pregnancy_spouse_physician_per scope = event_target:pregnancy_spouse_physician }
				}
			}
			ROOT = {
				if = {
					limit = {
						event_target:pregnancy_regent_physician = {
							always = yes
						}
					}
					save_persistent_event_target = { name = pregnancy_regent_physician_per scope = event_target:pregnancy_regent_physician }
				}
			}
		}
		FROM = { 
			opinion = { 
				modifier = opinion_relieved
				who = ROOT
				years = 1
			}
		}
		ai_chance = { 
			factor = 80 
			modifier = { 
				factor = 0.5 
				FROM = { is_married = ROOT }
				NOT = { persistent_event_target:pregnancy_spouse_physician_per = { learning = 10 } }
			}
			modifier = { 
				factor = 0.5 
				FROM = { NOT = { is_married = ROOT } }
				NOT = { persistent_event_target:pregnancy_regent_physician_per = { learning = 10 } }
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20505
		hidden_tooltip = {
			FROM = { character_event = { id = HFP.20508 } } 
			if = { 
				limit = { is_married = FROM } 
				clear_event_target = pregnancy_spouse_physician
			}
			if = { 
				limit = { NOT = { is_married = FROM } } 
				clear_event_target = pregnancy_regent_physician
			}
		}
		ai_chance = { 
			factor = 20
			modifier = { 
				factor = 1.5
				trait = stubborn
			}
			modifier = { 
				factor = 1.5
				trait = envious
			}
			modifier = { 
				factor = 1.5 
				trait = zealous
			}
			modifier = { 
				factor = 1.5 
				is_rival = FROM
			}
			modifier = { 
				factor = 0 
				is_ruler = no
			}
		}
	}
}

#Notification: Spouse/Regent wishes to offer his services as physician. Do you want him?
character_event = {
	id = HFP.20506
	desc = EVTDESCHFPA20506
	picture = GFX_evt_library
	
	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20506
		FROM = { 
			opinion = { 
				modifier = opinion_relieved
				who = ROOT
				years = 1
			}
		}
		hidden_tooltip = {
			FROM = { character_event = { id = HFP.20507 } } 
			if = { 
				limit = { event_target:pregnancy_spouse_physician = { is_alive = yes } }
				ROOT = { save_persistent_event_target = { name = pregnancy_spouse_physician_per scope = event_target:pregnancy_spouse_physician } }
			}
			if = { 
				limit = { event_target:pregnancy_regent_physician = { is_alive = yes } }
				ROOT = { save_persistent_event_target = { name = pregnancy_regent_physician_per scope = event_target:pregnancy_regent_physician } }
			}
		}
		ai_chance = { 
			factor = 80 
			modifier = { 
				factor = 0.5 
				FROM = { NOT = { learning = 10 } }
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20506
		hidden_tooltip = {
			FROM = { character_event = { id = HFP.20508 } }
			if = { 
				limit = { is_married = FROM } 
				clear_event_target = pregnancy_spouse_physician
			}
			if = { 
				limit = { NOT = { is_married = FROM } } 
				clear_event_target = pregnancy_regent_physician
			}
		}
		ai_chance = { 
			factor = 20
			modifier = { 
				factor = 1.5
				trait = stubborn
			}
			modifier = { 
				factor = 1.5
				trait = envious
			}
			modifier = { 
				factor = 1.5 
				trait = zealous
			}
			modifier = { 
				factor = 1.5 
				is_rival = FROM
			}
			modifier = { 
				factor = 0 
				is_ruler = no
			}
		}
	}
}

#Notify regent/spouse that his physician will help woman.
character_event = {
	id = HFP.20507
	desc = {
		text = EVTDESCHFPA20507
		trigger = {			#If spouse/regent receiving notification is also the physician.
			OR = { 
				persistent_event_target:pregnancy_spouse_physician_per = { character = ROOT }
				persistent_event_target:pregnancy_regent_physician_per = { character = ROOT }
			}
		}
	}
	desc = {
		text = EVTDESCHFPB20507
		trigger = {
			NOR = { 
				persistent_event_target:pregnancy_spouse_physician_per = { character = ROOT }
				persistent_event_target:pregnancy_regent_physician_per = { character = ROOT }
			}
		}
	}
	picture = GFX_evt_bad_news

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20507
		tooltip = { 
			opinion = { 
				modifier = opinion_relieved
				who = FROM
				years = 1
			}
		}
	}
}

#Notify regent/spouse that woman needs no help.
character_event = {
	id = HFP.20508
	desc = EVTDESCHFPA20508
	picture = GFX_evt_bad_news

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20508
		opinion = { 
			modifier = opinion_worried
			who = FROM
			years = 1
		}
	}
}

#Mother: Spouse/Regent sent a priest.
character_event = {
	id = HFP.20509
	desc = EVTDESCHFPA20509
	picture = GFX_evt_library

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20509
		piety = 50
	}
}
#Mother: Spouse/Regent sent a shaman.
character_event = {
	id = HFP.20510
	desc = EVTDESCHFPA20510
	picture = GFX_evt_library

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20510
		piety = 25
	}
}

#Mother: Regent succeeds in poisoning you.
character_event = {
	id = HFP.20511
	desc = EVTDESCHFPA20511
	picture = GFX_evt_shadow
	hide_from = yes

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20511
		death = { death_reason = death_troubled_pregnancy }
		hidden_tooltip = { 
			random_courtier_or_vassal = {
				limit = { has_minor_title = title_regent }
				character_event = { id = HFP.20512 }
			}
		}
	}
}

#Notify regent that he has succeeded in poisoning pregnant woman.
character_event = {
	id = HFP.20512
	desc = EVTDESCHFPA20512
	picture = GFX_evt_shadow
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20512
	}
}

#Mother: Regent succeeds in smothering you.
character_event = {
	id = HFP.20513
	desc = EVTDESCHFPA20513
	picture = GFX_evt_shadow
	hide_from = yes

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20513
		death = { 
			death_reason = death_childbirth
		}
		hidden_tooltip = { 
			random_courtier_or_vassal = {
				limit = { has_minor_title = title_regent }
				character_event = { id = HFP.20514 }
			}
		}
	}
}

#Notify regent that he has succeeded in smothering pregnant woman.
character_event = {
	id = HFP.20514
	desc = EVTDESCHFPA20514
	picture = GFX_evt_shadow
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20514
	}
}
#Mother: Regent is discovered trying to use poison.
character_event = {
	id = HFP.20515
	desc = EVTDESCHFPA20515
	picture = GFX_evt_shadow
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20515
		#Guards! Seize [From.GetHerHim]!"
		opinion = { 
			modifier = opinion_traitor
			who = FROM
			years = 30
		}
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_regent }
			imprison = ROOT 
			remove_title = title_regent
			hidden_tooltip = { character_event = { id = HFP.20516 } }
		}
		ai_chance = { factor = 50 }
	}

	option = { 
		name = EVTOPTBHFP20515 
		#Guards! Kill [From.GetHerHim]!"
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_regent }
			imprison = ROOT 
			hidden_tooltip = { character_event = { id = HFP.20517 } }
		}
	ai_chance = { factor = 50 }
	}
}

#Regent imprisoned for his deed.
character_event = {
	id = HFP.20516
	desc = EVTDESCHFPA20516
	picture = GFX_evt_into_the_dungeon
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFPA20516
		piety = -300 
		tooltip = { 
			FROM = { 
				opinion = { 
					modifier = opinion_traitor
					who = ROOT
					years = 30
				}
			}
		}
	}
}

#Regent killed for his deed.
character_event = {
	id = HFP.20517
	desc = EVTDESCHFPA20517
	picture = GFX_evt_beheading
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFPA20517
		death = { 
			death_reason = death_execution 
			killer = FROM 
		}
		piety = -300 
	}
}

#Mother: Regent is discovered trying to smother you.
character_event = {
	id = HFP.20518
	desc = EVTDESCHFPA20518
	picture = GFX_evt_shadow
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20518
		#Guards! Seize [FromFrom.GetHerHim]!"
		opinion = { 
			modifier = opinion_traitor
			who = FROM
			years = 30
		}
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_regent }
			imprison = ROOT 
			remove_title = title_regent
			hidden_tooltip = { character_event = { id = HFP.20516 } }
		}
		ai_chance = { factor = 50 }
	}

	option = { 
		name = EVTOPTBHFP20518
		#Guards! Kill [FromFrom.GetHerHim]!"
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_regent }
			tooltip = { 
				death = { 
					death_reason = death_execution 
					killer = FROM 
				}
			}
			hidden_tooltip = { character_event = { id = HFP.20517 } }
		}
	ai_chance = { factor = 50 }
	}
}

#Mother: Spouse/Regent offers moral support.
character_event = {
	id = HFP.20519
	desc = EVTDESCHFPA20519
	picture = GFX_evt_lovers

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20519
	}
}

#Mother in troubled pregnancy: Offer chance to do something about it.
character_event = {
	id = HFP.20520
	desc = EVTDESCHFPA20520
	picture = GFX_evt_illness

	is_triggered_only = yes

	option = { #My Physician will help me.
		name = EVTOPTAHFP20520
		#custom_tooltip = { text = EVTOOLTIPAHFP20520 }
		wealth = -50
		trigger = { 
			is_ruler = yes
			any_courtier_or_vassal = { has_minor_title = title_court_physician }
		}
		random_courtier_or_vassal = { 
			limit = { has_minor_title = title_court_physician } 
			save_event_target_as = pregnancy_mother_physician
		}
		ROOT = { save_persistent_event_target = { name = pregnancy_mother_physician_per scope = event_target:pregnancy_mother_physician } }
		ai_chance = { 
			factor = 70 
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					trait = quick 
				}
			}
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					trait = genius 
				}
			}
			modifier = { 
				factor = 1.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					learning = 20
				}
			}
			modifier = { 
				factor = 0.5
				any_courtier_or_vassal = { 
					has_minor_title = title_court_physician
					NOT = { learning = 10 }
				}
			}
		}
	}
	option = { #Call for a Healer (don't have Physicians due to lack of Reaper's Due DLC)
		name = EVTOPTBHFP20520
		#custom_tooltip = { text = EVTOOLTIPBHFP20520 }
		trigger = { 
			is_ruler = yes
			NOT = { has_dlc = "Reapers" }
		}
		set_character_flag = pregnancy_healer_help
		wealth = -50
		ai_chance = { 
			factor = 10 
			modifier = { 
				factor = 0.75
				trait = zealous
			}
		}
	}
	option = { #Call for a Priest
		name = EVTOPTCHFP20520
		#custom_tooltip = { text = EVTOOLTIPCHFP20520 }
		trigger = { 
			NOT = { has_character_flag = pregnancy_priest_comfort } #Already taken from the spouse/regent
			NOT = { has_character_flag = pregnancy_shaman_comfort }
			is_ruler = yes
			OR = { 
				is_reformed_religion = yes 
				NOT = { religion_group = pagan_group }
			}
		}
		set_character_flag = pregnancy_priest_comfort
		piety = 100
		wealth = -20
		ai_chance = { 
			factor = 10 
			modifier = { 
				factor = 2
				trait = zealous
			}
		}
	}
	option = { #Call for a Shaman
		name = EVTOPTDHFP20520
		#custom_tooltip = { text = EVTOOLTIPDHFP20520 }
		trigger = { 
			is_ruler = yes
			is_reformed_religion = no 
			religion_group = pagan_group
			NOT = { has_character_flag = pregnancy_shaman_comfort } #Already taken from the spouse/regent
			NOT = { has_character_flag = pregnancy_priest_comfort }
		}
		set_character_flag = pregnancy_shaman_comfort
		piety = 50
		prestige = 50
		wealth = -5
		ai_chance = { 
			factor = 20 
			modifier = { 
				factor = 2
				is_tribal = yes
			}
			modifier = { 
				factor = 2.5
				is_nomadic = yes
			}
			modifier = { 
				factor = 2
				trait = zealous
			}
		}
	}

	option = { #Do nothing.
		name = EVTOPTEHFP20520
		ai_chance = { 
			factor = 1
		}
	}
	after = { #Now for randomized pain.
		character_event = { id = HFP.20521 }
	}
}

character_event = {
	id = HFP.20521
	hide_window = yes

	is_triggered_only = yes

	immediate = { 
		random_list = { 
			5 = { 
				modifier = { 
					factor = 0.25
					trait = cough
				}
				character_event = { id = HFP.20522 days = 15 random = 15 } } #Asthma
			5 = { 
				modifier = { 
					factor = 0.25
					trait = vomiting
				}
				character_event = { id = HFP.20523 days = 15 random = 15  } } #Vomiting
			5 = { 
				modifier = { 
					factor = 0.25
					trait = rash
				}
				character_event = { id = HFP.20524 days = 15 random = 15  } } #Hair and rashes
			5 = { 
				modifier = { 
					factor = 0.25
					trait = malaise
				}
				character_event = { id = HFP.20525 days = 15 random = 15  } } #metalmouth
			5 = { 
				modifier = { 
					factor = 0.25
					trait = fever
				}
				character_event = { id = HFP.20526 days = 15 random = 15  } } #fever and sweath
			5 = { 
				modifier = { 
					factor = 0.25
					trait = headache
				}
				character_event = { id = HFP.20527 days = 15 random = 15  } } #amnesia
			5 = { character_event = { id = HFP.20528 days = 15 random = 15  } } #panic attack

			5 = { character_event = { id = HFP.20529 days = 15 random = 15  } } #undernourishment
			5 = { 
				modifier = { 
					factor = 0.25
					trait = stressed
				}
				character_event = { id = HFP.20530 days = 15 random = 15  } } #epileptic episode
			10 = { 
				modifier = { 
					factor = 0.25
					trait = cramps
				}
				character_event = { id = HFP.20531 days = 15 random = 15  } } #blood and cramps
			5 = { 
				modifier = { 
					factor = 0.25
					trait = infection
				}
				character_event = { id = HFP.20532 days = 15 random = 15  } } #teeth hurting and falling
			5 = { 
				modifier = { 
					factor = 0.25
					trait = fatigue
				}
				character_event = { id = HFP.20533 days = 15 random = 15  } } #insomnia
			5 = { 
				modifier = { 
					factor = 0.25
					trait = fatigue
				}
				character_event = { id = HFP.20534 days = 15 random = 15 } } #hallucinations
			5 = { 
				modifier = { 
					factor = 0.25
					trait = fatigue
				}
				character_event = { id = HFP.20535 days = 15 random = 15  } } #sleepwalking
			3 = { 
				modifier = { 
					factor = 0.9
					NOT = { health = 2 }
				}
				modifier = { 
					factor = 0.8
					age = 40
				}
				modifier = { 
					factor = 1.25
					has_character_modifier = mother_comforted 
				}
				modifier = { 
					factor = 0.95		#Fasting
					has_character_modifier = mother_vow_temperance 
				}
				modifier = { 
					factor = 1.15
					has_character_modifier = mother_vow_charity 
				}
				modifier = { 
					factor = 1.15
					has_character_modifier = mother_vow_humility 
				}
				modifier = { 
					factor = 1.15
					has_character_modifier = mother_vow_chastity 
				}
				modifier = { 
					factor = 0.9
					has_character_modifier = mother_bad_omen  
				}
				modifier = { 
					factor = 1.15
					has_character_modifier = mother_good_omen  
				}
				modifier = { 
					factor = 1.25
					has_character_modifier = mother_minor_rest  
				}
				modifier = { 
					factor = 1.45
					has_character_modifier = mother_resting_health 
				}
				modifier = { 
					factor = 1.15
					has_character_modifier = mother_praying_health 
				}
				modifier = { 
					factor = 0.9
					has_character_modifier = mother_partying_health 
				}
				modifier = { 
					factor = 0.8
					has_character_modifier = mother_exposed_to_elements
				}
				modifier = { 
					factor = 0.7
					persistent_event_target:pregnancy_mother_physician_per = { NOT = { learning = 5 } }
				}
				modifier = { 
					factor = 0.8
					persistent_event_target:pregnancy_mother_physician_per = { NOT = { learning = 10 } }
				}
				modifier = { 
					factor = 0.9
					persistent_event_target:pregnancy_mother_physician_per = { trait = slow }
				}
				modifier = { 
					factor = 0.8
					persistent_event_target:pregnancy_mother_physician_per = { trait = imbecile }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_mother_physician_per = { trait = scholar }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_mother_physician_per = { trait = physician }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_mother_physician_per = { trait = quick }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_mother_physician_per = { trait = genius }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_mother_physician_per = { learning = 10 }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_mother_physician_per = { learning = 15 }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_mother_physician_per = { learning = 20 }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_mother_physician_per = { learning = 25 }
				}
				modifier = { 
					factor = 0.7
					persistent_event_target:pregnancy_spouse_physician_per = { NOT = { learning = 5 } }
				}
				modifier = { 
					factor = 0.8
					persistent_event_target:pregnancy_spouse_physician_per = { NOT = { learning = 10 } }
				}
				modifier = { 
					factor = 0.9
					persistent_event_target:pregnancy_spouse_physician_per = { trait = slow }
				}
				modifier = { 
					factor = 0.8
					persistent_event_target:pregnancy_spouse_physician_per = { trait = imbecile }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_spouse_physician_per = { trait = scholar }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_spouse_physician_per = { trait = physician }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_spouse_physician_per = { trait = quick }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_spouse_physician_per = { trait = genius }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_spouse_physician_per = { learning = 10 }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_spouse_physician_per = { learning = 15 }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_spouse_physician_per = { learning = 20 }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_spouse_physician_per = { learning = 25 }
				}
				modifier = { 
					factor = 0.7
					persistent_event_target:pregnancy_regent_physician_per = { NOT = { learning = 5 } }
				}
				modifier = { 
					factor = 0.8
					persistent_event_target:pregnancy_regent_physician_per = { NOT = { learning = 10 } }
				}
				modifier = { 
					factor = 0.9
					persistent_event_target:pregnancy_regent_physician_per = { trait = slow }
				}
				modifier = { 
					factor = 0.8
					persistent_event_target:pregnancy_regent_physician_per = { trait = imbecile }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_regent_physician_per = { trait = scholar }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_regent_physician_per = { trait = physician }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_regent_physician_per = { trait = quick }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_regent_physician_per = { trait = genius }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_regent_physician_per = { learning = 10 }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_regent_physician_per = { learning = 15 }
				}
				modifier = { 
					factor = 1.25
					persistent_event_target:pregnancy_regent_physician_per = { learning = 20 }
				}
				modifier = { 
					factor = 1.5
					persistent_event_target:pregnancy_regent_physician_per = { learning = 25 }
				}
				modifier = { #Every successful healing on random event reduces variable, lower the variable, more likely mother is to recover.
					factor = 1.25
					check_variable =  { which = troubled_pregnancy_variable value = -1 }
				}
				modifier = { 
					factor = 1.25
					check_variable =  { which = troubled_pregnancy_variable value = -2 }
				}
				modifier = { 
					factor = 1.5
					check_variable =  { which = troubled_pregnancy_variable value = -4 }
				}
				modifier = { 
					factor = 1.75
					check_variable =  { which = troubled_pregnancy_variable value = -6 }
				}
				character_event = { id = HFP.20536 days = 15 random = 15  } #RECOVERY
			}
			1 = { 
				modifier = { #Every failed healing on random event increases variable, higher the variable, more likely mother is to die.
					factor = 1.25
					check_variable =  { which = troubled_pregnancy_variable value = 1 }
				}
				modifier = { 
					factor = 1.25
					check_variable =  { which = troubled_pregnancy_variable value = 2 }
				}
				modifier = { 
					factor = 1.5
					check_variable =  { which = troubled_pregnancy_variable value = 3 }
				}
				modifier = { 
					factor = 2
					check_variable =  { which = troubled_pregnancy_variable value = 4 }
				}
				modifier = { 
					factor = 3
					check_variable =  { which = troubled_pregnancy_variable value = 5 }
				}

				character_event = { id = HFP.20537 days = 15 random = 15  } #DEATH
			} 
		}
	}
}

#Troubled pregnancy: Asthma
character_event = {
	id = HFP.20522
	desc = EVTDESCHFPA20522			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20522
		custom_tooltip = { text = tooltip_troubled_pregnancy_helpers522 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.05
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = cough
			}
			health = -0.05
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = cough
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_easy_effect = yes
		}
	}
}

#Troubled pregnancy: Vomiting
character_event = {
	id = HFP.20523
	desc = EVTDESCHFPA20523			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20523
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_523 }
		lose_weight_small_effect = yes
		weight_trait_check_effect = yes
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.05
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = vomiting
				}
			health = -0.05
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = vomiting
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_easy_effect = yes
		}
	}
}

#Troubled pregnancy: Hair and Rashes
character_event = {
	id = HFP.20524
	desc = EVTDESCHFPA20524			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20524
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_524 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.05
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = rash
				}
			health = -0.05
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = rash
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_easy_effect = yes
		}
	}
}

#Troubled pregnancy: Metalmouth
character_event = {
	id = HFP.20525
	desc = EVTDESCHFPA20525			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20525
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_525 }
		lose_weight_small_effect = yes
		weight_trait_check_effect = yes
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.05
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = malaise
				}
			health = -0.05
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = malaise
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_easy_effect = yes
		}
	}
}

#Troubled pregnancy: Fever and Sweath
character_event = {
	id = HFP.20526
	desc = EVTDESCHFPA20526			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20526
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_526 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.05
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = fever
				}
			health = -0.05
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = fever
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_easy_effect = yes
		}
	}
}

#Troubled pregnancy: Amnesia
character_event = {
	id = HFP.20527
	desc = EVTDESCHFPA20527		#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20527
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_527 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.05
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = headache
				}
			health = -0.05
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = headache
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_easy_effect = yes
		}
	}
}

#Troubled pregnancy: Panic Attack
character_event = {
	id = HFP.20528
	desc = EVTDESCHFPA20528			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20528
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_528 }
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_easy_effect = yes
		}
	}
}

#####More Dangerous ones.

#Troubled pregnancy: Undernourishment
character_event = {
	id = HFP.20529
	desc = EVTDESCHFPA20529			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20529
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_529 }
		lose_weight_medium_effect = yes
		weight_trait_check_effect = yes
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_hard_effect = yes
		}
	}
}

#Troubled pregnancy: Epilectic Episode
character_event = {
	id = HFP.20530
	desc = EVTDESCHFPA20530			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20530
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_530 }
		if = {
			limit = {
				trait = stressed
			}
			health = -0.05
		}
		if = {
			limit = {
				NOT = {
					trait = stressed
				}
			}
			add_trait = stressed
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_hard_effect = yes
		}
	}
}

#Troubled pregnancy: Blood and Cramps
character_event = {
	id = HFP.20531
	desc = EVTDESCHFPA20531			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20531
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_531 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.07
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = cramps
			}
			health = -0.07
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = cramps
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_hard_effect = yes
		}
	}
}

#Troubled pregnancy: Teeth Hurting and Falling
character_event = {
	id = HFP.20532
	desc = EVTDESCHFPA20532			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20532
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_532 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.07
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = infection
			}
			health = -0.07
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = infection
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_hard_effect = yes
		}
	}
}

#Troubled pregnancy: Insomnia
character_event = {
	id = HFP.20533
	desc = EVTDESCHFPA20533			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20533
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_533 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.05
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = fatigue
			}
			health = -0.05
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = fatigue
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_hard_effect = yes
		}
	}
}

#Troubled pregnancy: Hallucinations
character_event = {
	id = HFP.20534
	desc = EVTDESCHFPA20534			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20534
		custom_tooltip = {  text = tooltip_troubled_pregnancy_helpers_534 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.02
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = fatigue
			}
			health = -0.02
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = fatigue
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_hard_effect = yes
		}
	}
}

#Troubled pregnancy: Sleepwalking
character_event = {
	id = HFP.20535
	desc = EVTDESCHFPA20535			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20535
		custom_tooltip = { text = tooltip_troubled_pregnancy_helpers_535 }
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				trait = ill
			}
			health = -0.07
		}
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
				NOT = {
					trait = ill
				}
			}
			add_trait = ill
		}
		if = {
			limit = { 
				has_dlc = "Reapers" 
				trait = fatigue
			}
			health = -0.07
		}
		if = {
			limit = { has_dlc = "Reapers" }
			add_trait = fatigue
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20521 days = 10 random = 10 }
			troubled_pregnancy_variable_hard_effect = yes
		}
	}
}

#Troubled pregnancy: Recovery
character_event = {
	id = HFP.20536
	desc = EVTDESCHFPA20536			#Possible custom loc keys added to describe help from spouse/physicians/priests.
	picture = GFX_evt_recovery

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20536
		hidden_tooltip = { 
			remove_trait = cough
			remove_trait = fever
			remove_trait = vomiting
			remove_trait = cramps
			remove_trait = rash
			remove_trait = headache
			remove_trait = fatigue
			remove_trait = malaise
			remove_trait = infection
			remove_trait = stressed
			health = 0.1
			clr_character_flag = pregnancy_healer_help
			clr_character_flag = pregnancy_priest_comfort
			clr_character_flag = pregnancy_shaman_comfort
			clr_character_flag = pregnancy_spouse_comfort
			clr_character_flag = mother_asked_retirement
			#Send notifications to all doctors.
			persistent_event_target:pregnancy_mother_physician_per = { character_event = { id = HFP.20553 } }
			persistent_event_target:pregnancy_spouse_physician_per = { character_event = { id = HFP.20553 } }
			persistent_event_target:pregnancy_regent_physician_per = { character_event = { id = HFP.20553 } }
			#And to the spouse, if he already isn't one of them.
			if = { 
				limit = { 
					persistent_event_target:pregnancy_mother_physician_per = { NOT = { is_married = ROOT } }
					persistent_event_target:pregnancy_spouse_physician_per = { NOT = { is_married = ROOT } }
					persistent_event_target:pregnancy_regent_physician_per = { NOT = { is_married = ROOT } } 
				} 
			spouse = { character_event = { id = HFP.20554 } }
			} 
		}
		hidden_tooltip = { change_variable =  { which = troubled_pregnancy_variable value = -4 } } #Not set to 0, still small chance of post-birth complications.
		remove_trait = troubled_pregnancy
		set_character_flag = survivor_mom		#More likely to have difficult pregnancies in the future, unlocks chance to go celibate for rulers.
	}
}

#physician notified of mother recovering from troubled pregnancy before childbirth.
character_event = {
	id = HFP.20553
	desc = EVTDESCHFPA20553

	picture = GFX_evt_bad_news_female
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20553 
		piety = 30
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
	}
}
#spouse (who is not a physician) notified of mother recovering from troubled pregnancy before childbirth.
character_event = {
	id = HFP.20554
	desc = EVTDESCHFPA20554

	picture = GFX_evt_bad_news_female
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20554
		piety = 30
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
	}
}
#Troubled pregnancy: DEATH before birth
character_event = {
	id = HFP.20537
	desc = EVTDESCHFPA20537	
	picture = GFX_evt_illness

	trigger = { 
		trait = troubled_pregnancy
		trait = pregnant 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20537
		hidden_tooltip = { 
			remove_trait = cough
			remove_trait = fever
			remove_trait = diarrhea
			remove_trait = vomiting
			remove_trait = chest_pain
			remove_trait = cramps
			remove_trait = rash
			remove_trait = headache
			remove_trait = abdominal_pain
			remove_trait = fatigue
			remove_trait = malaise
			remove_trait = infection
		}
		if = {
			limit = { any_spouse = { always = yes } }
			spouse = { save_event_target_as = scoped_father }
		}
		#Hollow child is born in this circumstance, giving another chance to avoid game over.
		custom_tooltip = { text = tooltip_HFP20537_A }
		hidden_tooltip = {
			random_list = { 
				50 = {
					create_character = {
						random_traits = no
						dynasty = ROOT
						culture = ROOT
						religion = ROOT
						female = no
						age = 0
					}
				} 
				50 = {
					create_character = {
						random_traits = no
						dynasty = ROOT
						culture = ROOT
						religion = ROOT
						female = yes
						age = 0
					}
				}
			}
			new_character = {
				set_mother = ROOT
				random = { 
					chance = 5
					add_trait = clubfooted
				}
				random = { 
					chance = 5 
					add_trait = ugly
				}
				lose_weight_large_effect = yes
				lose_weight_medium_effect = yes
				add_trait = is_malnourished
				save_event_target_as = hollow_baby
				set_character_flag = flag_hollow_child_primed
				if = { #If a dad exists...
					limit = { event_target:scoped_father = { always = yes } }
					set_father = event_target:scoped_father
					if = { # and mom is not matrilineally married...
						limit = { ROOT = { is_married_matrilineally = no } }
						event_target:hollow_baby = { 
							dynasty = event_target:scoped_father 
							culture = event_target:scoped_father
							religion = event_target:scoped_father
						}  
					}
				}
			}
			#event_target:hollow_baby = { character_event = { id = HFP.20057 days = 820 } } 
		}
		hidden_tooltip = { 
			event_target:scoped_father = { #Check if father likes mother
				if = { 
					limit = { 
						opinion = { 
							who = ROOT
							value = 40 
						} 
					}
					set_character_flag = flag_loved_dead_mother 
				}
				character_event = { id = HFP.20056 } 
			} 	
			death = { death_reason = death_troubled_pregnancy }
		}
	}
}

#on_birth baby vision child event
character_event = {
	id = HFP.20538
	desc = EVTDESCHFP20538
	picture = GFX_evt_comet
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20538 #Yay! I'm vision baby!"
	if = { 
		limit = { 
			mother = { has_character_flag = gabriel_baby } 
		}
		change_diplomacy = 2
		mother = { character_event = { id = HFP.20539 days = 1 } }
		father = { character_event = { id = HFP.20539 days = 1 } }
		remove_trait = hunchback
		remove_trait = dwarf
		remove_trait = inbred
		remove_trait = lisp
		remove_trait = stutter
		#remove_trait = blind_birth
		remove_trait = freckles
		remove_trait = clubfooted
		remove_trait = slow
		remove_trait = imbecile
		remove_trait = harelip
		remove_trait = ugly
		remove_trait = weak
		remove_trait = sickly
		random_list = { 
			50 = { add_trait = fair }
			50 = { 
				if = { 
					limit = { 
						NOT = { trait = genius } 
					}
					add_trait = quick 
				}
			}
		}
	}
	if = { 
		limit = { mother = { has_character_flag = lucifer_baby } }
		change_intrigue = 1
		mother = { character_event = { id = HFP.20540 days = 1 } }
		father = { character_event = { id = HFP.20540 days = 1 } }
		add_trait = lefthanded
	}
	if = { 
		limit = { mother = { has_character_flag = iblis_baby } }
		change_learning = 1
		mother = { character_event = { id = HFP.20540 days = 1 } }
		father = { character_event = { id = HFP.20540 days = 1 } }
		add_trait = hunchback
	}
	if = { 
		limit = { mother = { has_character_flag = thor_baby } }
		change_martial = 2
		mother = { character_event = { id = HFP.20539 days = 1 } }
		father = { character_event = { id = HFP.20539 days = 1 } }
		remove_trait = hunchback
		remove_trait = dwarf
		remove_trait = inbred
		remove_trait = lisp
		remove_trait = stutter
		#remove_trait = blind_birth
		remove_trait = freckles
		remove_trait = clubfooted
		remove_trait = slow
		remove_trait = imbecile
		remove_trait = harelip
		remove_trait = ugly
		remove_trait = weak
		remove_trait = sickly
		add_trait = strong
	}
	if = { 
		limit = { mother = { has_character_flag = loki_baby } }
		change_intrigue = 1
		mother = { character_event = { id = HFP.20540 days = 1 } }
		father = { character_event = { id = HFP.20540 days = 1 } }
		add_trait = blinded
		add_trait = giant 
	}
	if = { 
		limit = { mother = { has_character_flag = tengri_baby } }
		change_martial = 2
		mother = { character_event = { id = HFP.20539 days = 1 } }
		father = { character_event = { id = HFP.20539 days = 1 } }
		remove_trait = hunchback
		remove_trait = dwarf
		remove_trait = inbred
		remove_trait = lisp
		remove_trait = stutter
		#remove_trait = blind_birth
		#remove_trait = freckles
		remove_trait = clubfooted
		remove_trait = slow
		remove_trait = imbecile
		remove_trait = harelip
		remove_trait = ugly
		remove_trait = weak
		remove_trait = sickly
		add_trait = shrewd
		}
	if = { 
		limit = { mother = { has_character_flag = erlik_baby } }
		change_stewardship = 1
		mother = { character_event = { id = HFP.20540 days = 1 } }
		father = { character_event = { id = HFP.20540 days = 1 } }
		add_trait = feeble
		}
	}
}


#mother/father receive news of miraculous birth
character_event = {
	id = HFP.20539
	desc = EVTDESCHFP20539
	picture = GFX_evt_recovery
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20539
		clr_character_flag = gabriel_baby
		clr_character_flag = lucifer_baby
		clr_character_flag = iblis_baby
		clr_character_flag = thor_baby
		clr_character_flag = loki_baby
		clr_character_flag = tengri_baby
		clr_character_flag = erlik_baby
	}
}

#mother/father receive news of ominous birth
character_event = {
	id = HFP.20540
	desc = EVTDESCHFP20540
	picture = GFX_evt_recovery
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20540 #I'm just glad this is over."
		clr_character_flag = gabriel_baby
		clr_character_flag = lucifer_baby
		clr_character_flag = iblis_baby
		clr_character_flag = thor_baby
		clr_character_flag = loki_baby
		clr_character_flag = tengri_baby
		clr_character_flag = erlik_baby
	}
}

#############################POST BIRTH TROUBLED PREGNANCY OUTCOMES#######################
#post-fever
character_event = {
	id = HFP.20541
	desc = EVTDESCHFP20541
	picture = GFX_evt_illness

	trigger = { trait = troubled_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20541 #Why am I shaking?
		custom_tooltip = { text = tooltip_troubled_pregnancy_helpers_541 }
		hidden_tooltip = { 
			random_list = { 
				25 = { 

		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_mother_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_mother_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_mother_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_mother_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { learning = 25 }
		}
		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_spouse_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_spouse_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_spouse_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_spouse_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 25 }
		}
		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_regent_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_regent_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_regent_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_regent_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { learning = 25 }
		}
					character_event = { id = HFP.20544 days = 5 random = 5 } } #recovers completely
				45 = { character_event = { id = HFP.20545 days = 5 random = 5 } } #recovers weakened
				20 = { character_event = { id = HFP.20546 days = 5 random = 5 } } #remains infirm
				5 = { character_event = { id = HFP.20547 days = 5 random = 5 } } #DEATH
			}
		}
	}
}

#hair loss
character_event = {
	id = HFP.20542
	desc = EVTDESCHFP20542
	picture = GFX_evt_illness

	trigger = { trait = troubled_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20542 #What's happening to me?!
		custom_tooltip = { text = tooltip_troubled_pregnancy_helpers_542 }
		hidden_tooltip = { 
			random_list = { 
				35 = { 

		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_mother_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_mother_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_mother_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_mother_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { learning = 25 }
		}
		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_spouse_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_spouse_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_spouse_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_spouse_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 25 }
		}
		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_regent_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_regent_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_regent_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_regent_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { learning = 25 }
		}
				character_event = { id = HFP.20544 days = 5 random = 5 } } #recovers completely
				50 = { character_event = { id = HFP.20545 days = 5 random = 5 } } #recovers weakened
				10 = { character_event = { id = HFP.20546 days = 5 random = 5 } } #remains infirm
				5 = { character_event = { id = HFP.20547 days = 5 random = 5 } } #DEATH
			}
		}
	}
}

#blood
character_event = {
	id = HFP.20543
	desc = EVTDESCHFP20543
	picture = GFX_evt_illness

	trigger = { trait = troubled_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20543 #I will bleed out!
		custom_tooltip = { text = tooltip_troubled_pregnancy_helpers_531 }
		lose_weight_small_effect = yes
		weight_trait_check_effect = yes
		hidden_tooltip = { 
			random_list = { 
				10 = { 

		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_mother_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_mother_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_mother_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_mother_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_mother_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_mother_physician_per = { learning = 25 }
		}
		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_spouse_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_spouse_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_spouse_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_spouse_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_spouse_physician_per = { learning = 25 }
		}
		modifier = { 
			factor = 0.7
			persistent_event_target:pregnancy_regent_physician_per = { NOT = { learning = 5 } }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_regent_physician_per = { NOT = { learning = 10 } }
		}
		modifier = { 
			factor = 0.9
			persistent_event_target:pregnancy_regent_physician_per = { trait = slow }
		}
		modifier = { 
			factor = 0.8
			persistent_event_target:pregnancy_regent_physician_per = { trait = imbecile }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { trait = scholar }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { trait = physician }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { trait = quick }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { trait = genius }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 10 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 15 }
		}
		modifier = { 
			factor = 1.25
			persistent_event_target:pregnancy_regent_physician_per = { learning = 20 }
		}
		modifier = { 
			factor = 1.5
			persistent_event_target:pregnancy_regent_physician_per = { learning = 25 }
		}
					character_event = { id = HFP.20544 days = 5 random = 5 } } #recovers completely
				40 = { character_event = { id = HFP.20545 days = 5 random = 5 } } #recovers weakened
				20 = { character_event = { id = HFP.20546 days = 5 random = 5 } } #remains infirm
				30 = { character_event = { id = HFP.20547 days = 5 random = 5 } } #DEATH
			}
		}
	}
}

#complete recovery
character_event = {
	id = HFP.20544
	desc = EVTDESCHFP20544
	picture = GFX_evt_recovery

	trigger = { trait = troubled_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20544 #I won't mind getting up now.
		hidden_tooltip = {	
			remove_trait = cough
			remove_trait = fever
			remove_trait = vomiting
			remove_trait = cramps
			remove_trait = rash
			remove_trait = headache
			remove_trait = fatigue
			remove_trait = malaise
			remove_trait = infection
			remove_trait = stressed 
			clr_character_flag = pregnancy_healer_help
			clr_character_flag = pregnancy_priest_comfort
			clr_character_flag = pregnancy_shaman_comfort
			clr_character_flag = pregnancy_spouse_comfort
			clr_character_flag = mother_asked_retirement
		}
		remove_trait = troubled_pregnancy
		set_character_flag = survivor_mom
		if = { 
			limit = { is_married = yes } 
			spouse = { character_event = { id = HFP.20548 } } 
		}
	}
}

#partial recovery
character_event = {
	id = HFP.20545
	desc = EVTDESCHFP20545
	picture = GFX_evt_recovery

	trigger = { trait = troubled_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20545 #I think I'll rest another couple of days still...
		if = { 
			limit = { 
					trait = feeble
			} 
			health = -1.0
		}
		if = { 
			limit = { 
				NOR = { 
					trait = robust 
					trait = feeble
				}  
			} 
			add_trait = feeble 
		}
		if = { 
			limit = { trait = robust } 
			remove_trait = robust 
		}
		hidden_tooltip = {	
			remove_trait = cough
			remove_trait = fever
			remove_trait = vomiting
			remove_trait = cramps
			remove_trait = rash
			remove_trait = headache
			remove_trait = fatigue
			remove_trait = malaise
			remove_trait = infection
			remove_trait = stressed 
			clr_character_flag = pregnancy_healer_help
			clr_character_flag = pregnancy_priest_comfort
			clr_character_flag = pregnancy_shaman_comfort
			clr_character_flag = pregnancy_spouse_comfort
			clr_character_flag = mother_asked_retirement
		}
		remove_trait = troubled_pregnancy
		set_character_flag = survivor_mom
		if = { 
			limit = { is_married = yes } 
			spouse = { character_event = { id = HFP.20549 } } 
		}
	}
}

#remains infirm
character_event = {
	id = HFP.20546
	desc = EVTDESCHFP20546
	picture = GFX_evt_recovery

	trigger = { trait = troubled_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20546 #Who goes there?
		if = { 
			limit = { 
					trait = infirm
			} 
			health = -1.0
		}
		if = { 
			limit = { 
					NOT = { trait = infirm } 
			} 
			add_trait = infirm
		}
		hidden_tooltip = {	
			remove_trait = cough
			remove_trait = fever
			remove_trait = vomiting
			remove_trait = cramps
			remove_trait = rash
			remove_trait = headache
			remove_trait = fatigue
			remove_trait = malaise
			remove_trait = infection
			remove_trait = stressed 
			clr_character_flag = pregnancy_healer_help
			clr_character_flag = pregnancy_priest_comfort
			clr_character_flag = pregnancy_shaman_comfort
			clr_character_flag = pregnancy_spouse_comfort
			clr_character_flag = mother_asked_retirement
		}
		remove_trait = troubled_pregnancy
		set_character_flag = survivor_mom
		if = { 
			limit = { is_married = yes } 
			spouse = { character_event = { id = HFP.20550 } } 
		}
	}
}

#Death after birth
character_event = {
	id = HFP.20547
	desc = EVTDESCHFP20547
	picture = GFX_evt_recovery

	trigger = { trait = troubled_pregnancy }
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20547 #I'll rest just a little more...
		hidden_tooltip = {	
			remove_trait = cough
			remove_trait = fever
			remove_trait = vomiting
			remove_trait = cramps
			remove_trait = rash
			remove_trait = headache
			remove_trait = fatigue
			remove_trait = malaise
			remove_trait = infection
			remove_trait = stressed 
			clr_character_flag = pregnancy_healer_help
			clr_character_flag = pregnancy_priest_comfort
			clr_character_flag = pregnancy_shaman_comfort
			clr_character_flag = pregnancy_spouse_comfort
			clr_character_flag = mother_asked_retirement
		}
		death = { death_reason = death_troubled_pregnancy }
		if = { 
			limit = { is_married = yes } 
			spouse = { character_event = { id = HFP.20551 } } 
		}
	}
}

#spouse notified of full recovery
character_event = {
	id = HFP.20548
	desc = EVTDESCHFP20548
	picture = GFX_evt_recovery
	ai = no
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20548 #That's a relif. To when the next son?
	}
}

#spouse notified of partial recovery
character_event = {
	id = HFP.20549
	desc = EVTDESCHFP20549
	picture = GFX_evt_recovery
	ai = no
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20549 #It can still manage another couple of toddlers, right?
	}
}

#spouse notified of infirmity
character_event = {
	id = HFP.20550
	desc = EVTDESCHFP20550
	picture = GFX_evt_bad_news_female
	ai = no
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20550 #It can still manage another couple of toddlers, right?
	}
}

#spouse notified of death
character_event = {
	id = HFP.20551
	desc = EVTDESCHFP20551
	picture = GFX_evt_bad_news_female
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20551 #My darling!
		if = { 
			limit = { 
				OR = { 
					is_lover = FROM 
					opinion = { 
						who = FROM
						value = 50 
					}
				} 
			}
			random = { 
				chance = 40
				add_trait = depressed
				hidden_tooltip = { 
					character_event = { id = 38288 } 
				}
			}
		}
	}
}

#spouse notified of troubled pregnancy after birth
character_event = {
	id = HFP.20552
	desc = {
		text = EVTDESCHFPA20552
		trigger = {
			FROM = { has_character_flag = troubled_pregnancy_relapse }
		}
	}
	desc = {
		text = EVTDESCHFPB20552
		trigger = { 
			NOT = {
				FROM = { has_character_flag = troubled_pregnancy_relapse }
			}
		}
	}
	picture = GFX_evt_bad_news_female
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20552 #That's unfortunate.
		FROM = { clr_character_flag = troubled_pregnancy_relapse }
	}
}

##20553 and 20554 ids taken by notifications to physician/spouse of recovery during pregnancy.


#clear hard pregnancy on_birth.
character_event = {
	id = HFP.20555
	hide_window = yes
	
	trigger = { mother = { trait = hard_pregnancy } }

	is_triggered_only = yes

	immediate = { 
		mother = {
			remove_trait = hard_pregnancy
			remove_trait = in_hiding
			remove_trait = travelling
			clr_character_flag = mother_asked_retirement #If still on for whatever reason.
		}
	}
}

#########################################

#on_pregnancy positive events.
character_event = {
	id = HFP.20556
	hide_window = yes

	trigger = { 
		OR = {
			has_game_rule = {
				name = pregnancy_flavor
				value = on
			}
			has_game_rule = {
				name = pregnancy_flavor
				value = limited
			}
		}
	}
	
	is_triggered_only = yes

	immediate = { 
		clr_character_flag = flag_mother_dark_rest
		clr_character_flag = mother_gossip_listening #Safety check, they should already have been removed
		clr_character_flag = mother_gossip_talking
		clr_character_flag = mother_gossip_trusting
		clr_character_flag = mother_gossip_plotting
		clr_character_flag = mother_gossip_envious
		clr_character_flag = mother_gossip_shy
		clr_character_flag = mother_gossip_learning
		clr_character_flag = mother_gossip_content
		clr_character_flag = mother_gossip_gluttonous
		clr_character_flag = flag_mother_festival_gregarious
		clr_character_flag = flag_mother_festival_kind
		clr_character_flag = flag_mother_festival_piety
		clr_character_flag = flag_mother_festival_proud
		clr_character_flag = flag_mother_festival_ambitious
		clr_character_flag = flag_mother_festival_prestige
		clr_character_flag = flag_mother_festival_peasants
		clr_character_flag = flag_mother_festival_vassals
		clr_character_flag = flag_mother_festival_gluttonous
		clr_character_flag = flag_mother_festival_drunkard
		clr_character_flag = flag_mother_festival_chaste
		clr_character_flag = flag_mother_festival_lustful
		any_lover = {  
			limit = {
				ai = no
				is_female = no # So lesbian lovers will not believe the child is theirs.
			}
			character_event = { id = HFP.20067 }
		}
		#First pregnancy scare. 
		random_list = {
			20 = {}
			80 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { 
					factor = 1.5
					NOT = { age = 20 }
				}
				modifier = { 
					factor = 0
					num_of_children = 1
				}
				modifier = { 
					factor = 1.5
					is_married = no
				}
				modifier = { 
					factor = 1.75
					trait = craven
				}
				modifier = { 
					factor = 0.5
					trait = brave
				}

				character_event = { id = HFP.20557 days = 7 random = 5 }
			}
		}
		#Random stuff 
		random_list = {
			#Pregnancy Glow
			10 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.35
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.25
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.15
					num_of_children = 5
				}
				modifier = { 
					factor = 1.5
					NOT = { age = 25 }
				}
				modifier = { 
					factor = 0.25
					age = 35
				}
				modifier = { 
					factor = 0.1
					age = 45
				}
				character_event = { id = HFP.20003 days = 25 random = 10 }
			}
			#Dark Rest
			10 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.35
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.25
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.15
					num_of_children = 5
				}
				modifier = { 
					factor = 1.5
					NOT = { age = 25 }
				}
				modifier = { 
					factor = 0
					NOT = { higher_tier_than = BARON }
					spouse = { lower_tier_than = COUNT }
				}
				modifier = { 
					factor = 0.25
					age = 35
				}
				modifier = { 
					factor = 0.1
					age = 45
				}
				#Fires for woman if landed, otherwise husband.
				if = { 
					limit = { is_ruler = yes } 
					character_event = { id = HFP.20030 days = 60 random = 10 }
				}
				else = { spouse = { character_event = { id = HFP.20030 days = 60 random = 10 } } } 
			}
			#Baby kicks
			20 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.35
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.25
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.15
					num_of_children = 5
				}
				character_event = { id = HFP.20558 days = 80 random = 20 }
			}
			#Gender wager
			30 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.35
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.25
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.15
					num_of_children = 5
				}
				modifier = { 
					factor = 0
					NOT = { num_of_children = 1 }
				}
				modifier = { #Already have an heir
					factor = 0
					any_child = { 
						is_female = no
					}
					OR = { 
						has_law = agnatic_succession
						has_law = cognatic_succession
					}
				}
				modifier = { #Already have an heir
					factor = 0
					any_child = { 
						is_female = yes
					}
					OR = { 
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
				}
				modifier = { #Doesn't really matter.
					factor = 0.5
					OR = { 
						has_law = status_of_women_4
						has_law = true_cognatic_succession
					}
				}
				character_event = { id = HFP.20559 days = 60 random = 10 }
			}
			#Ordering new dresses
			15 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.35
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.25
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.15
					num_of_children = 5
				}
				modifier = { 
					factor = 0.5
					trait = temperate
				}
				modifier = { 
					factor = 1.5
					trait = gluttonous
				}
				modifier = { 
					factor = 0.25
					trait = is_malnourished
				}
				modifier = { 
					factor = 1.75
					trait = is_fat
				}
				modifier = { 
					factor = 1.5
					trait = sturdy
				}
				modifier = { 
					factor = 0.5
					trait = feeble
				}
				character_event = { id = HFP.20560 days = 80 random = 100 }
			}
			#Positive omen
			5 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.35
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.25
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.15
					num_of_children = 5
				}
				modifier = { 
					factor = 1.5
					trait = zealous
				}
				modifier = { 
					factor = 0.5
					trait = cynical
				}
				modifier = { 
					factor = 1.5
					is_tribal = yes
				}
				modifier = { 
					factor = 1.5
					is_nomadic = yes
				}
				character_event = { id = HFP.20565 days = 65 random = 20 }
			}
			#Negative omen
			5 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.35
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.25
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.15
					num_of_children = 5
				}
				modifier = { 
					factor = 1.5
					trait = zealous
				}
				modifier = { 
					factor = 0.5
					trait = cynical
				}
				modifier = { 
					factor = 1.5
					is_tribal = yes
				}
				modifier = { 
					factor = 1.5
					is_nomadic = yes
				}
				character_event = { id = HFP.20567 days = 65 random = 20 }
			}
			#Nothing
			15 = {
				modifier = { 
					factor = 0.5
					NOT = { num_of_children = 1 }
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 1.5
					num_of_children = 1
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 1.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 1.5
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 1.75
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 1.8
					num_of_children = 5
				}
				modifier = { 
					factor = 1.5
					age = 35
				}
				modifier = { 
					factor = 1.75
					age = 40
				}
			}
		}
		#Vows and sacrifices for healthy child (rulers only).
		random_list = {
			#Holy Virgin for Christians
			45 = {
				trigger = { 
					is_ruler = yes
					religion_group = christian
					NOT = { society_member_of = the_satanists }
					NOT = { num_of_children = 3 }
					NOT = { is_devil_worshiper_trigger = yes }
				}
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { 
					factor = 0.25
					num_of_children = 1
				}
				character_event = { id = HFP.20569 days = 15 random = 8 }
			}
			#Fertility festival for baltic, norse, finnish pagans.
			90 = {
				trigger = { 
					is_married = yes
					is_main_spouse = yes
					NOR = { 
						num_of_children = 3 
						has_character_modifier = mother_fertility_festival_1
						has_character_modifier = mother_fertility_festival_2
						has_character_modifier = mother_festival_blessing
					}
					OR = { 
						higher_real_tier_than = COUNT
						spouse = { higher_real_tier_than = COUNT } 
					} 
					spouse = { 
						OR = { 
							religion = norse_pagan
							religion = norse_pagan_reformed
							religion = baltic_pagan
							religion = baltic_pagan_reformed
							religion = finnish_pagan
							religion = finnish_pagan_reformed 
						}  
						NOR = { 
							trait = incapable 
							prisoner = yes
							is_inaccessible_trigger = yes
						}
					}
					OR = { 
						religion = norse_pagan
						religion = norse_pagan_reformed
						religion = baltic_pagan
						religion = baltic_pagan_reformed
						religion = finnish_pagan
						religion = finnish_pagan_reformed 
					} 
				}
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { 
					factor = 0.25
					num_of_children = 1
				}
				modifier = { 
					factor = 1.5
					is_attractive_trigger = yes
				}
				modifier = { 
					factor = 1.5
					NOT = { age = 30 }
				}
				modifier = { 
					factor = 1.5
					OR = { 
						real_tier = KING
						spouse = { real_tier = KING }
					}
				}
				modifier = { 
					factor = 1.75
					OR = { 
						real_tier = EMPEROR
						spouse = { real_tier = EMPEROR }
					}
				}
				modifier = { 
					factor = 0.85
					is_ill = yes
				}
				spouse = { character_event = { id = HFP.20043 days = 15 random = 8 } }
			}
			#Sacrifices for Pagans
			50 = {
				trigger = { 
					is_ruler = yes
					religion_group = pagan_group
					OR = { 
						is_tribal = yes
						is_nomadic = yes
					}
				}
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { #If she qualifies for Fertility Festival, prioritize that instead.
					factor = 0.2
					is_married = yes
					is_main_spouse = yes
					NOR = { 
						num_of_children = 3 
						has_character_modifier = mother_fertility_festival_1
						has_character_modifier = mother_fertility_festival_2
						has_character_modifier = mother_festival_blessing
					}
					OR = { 
						higher_real_tier_than = COUNT
						spouse = { higher_real_tier_than = COUNT } 
					} 
					spouse = { 
						OR = { 
							religion = norse_pagan
							religion = norse_pagan_reformed
							religion = baltic_pagan
							religion = baltic_pagan_reformed
							religion = finnish_pagan
							religion = finnish_pagan_reformed 
						}  
						NOR = { 
							trait = incapable 
							prisoner = yes
							is_inaccessible_trigger = yes
						}
					}
					OR = { 
						religion = norse_pagan
						religion = norse_pagan_reformed
						religion = baltic_pagan
						religion = baltic_pagan_reformed
						religion = finnish_pagan
						religion = finnish_pagan_reformed 
					} 
				}
				modifier = { 
					factor = 0.5
					num_of_children = 1
				}
				modifier = { 
					factor = 1.25
					trait = weak
				}
				modifier = { 
					factor = 1.25
					trait = feeble
				}
				modifier = { 
					factor = 1.5
					trait = inbred
				}
				modifier = { 
					factor = 1.25
					trait = hunchback
				}
				modifier = { 
					factor = 1.25
					trait = dwarf
				}
				modifier = { 
					factor = 1.25
					father_even_if_dead = { trait = weak }
				}
				modifier = { 
					factor = 1.25
					father_even_if_dead = { trait = feeble }
				}
				modifier = { 
					factor = 1.25
					father_even_if_dead = { trait = inbred }
				}
				modifier = { 
					factor = 1.25
					father_even_if_dead = { trait = hunchback }
				}
				modifier = { 
					factor = 1.25
					father_even_if_dead = { trait = dwarf }
				}
				character_event = { id = HFP.20571 days = 15 random = 8 }
			}
			#Nothing
			45 = {
				modifier = { 
					factor = 0.5
					NOT = { num_of_children = 1 }
				}
				modifier = { 
					factor = 0.75	#Young mom is scared.
					NOT = { age = 20 }
				}
				modifier = { 
					factor = 0.75	#Old mom is scared.
					age = 37
				}
				modifier = { 
					factor = 1.5
					is_ill = no
				}
				modifier = { 
					factor = 0.75
					trait = zealous
				}
				modifier = { 
					factor = 1.5
					trait = cynical
				}
				modifier = { 
					factor = 2
					num_of_children = 4
				}
				modifier = { 
					factor = 3
					num_of_children = 5
				}
				modifier = { 
					factor = 1.5
					age = 35
				}
			}
		}
		#Mother has weird cravings.
		random_list = {
			#Yes
			10 = {
				modifier = { 
					factor = 1.5
					NOR = { num_of_children = 3 } 
					NOR = { 
						any_child = { trait = harelip } 
						any_child = { trait = ugly } 
						any_child = { trait = clubfooted } 
					}
				}
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { 
					factor = 1.75
					trait = hedonist
				}
				modifier = { 
					factor = 1.5
					trait = gluttonous
				}
				modifier = { 
					factor = 0.35
					trait = temperate
				}
				character_event = { id = HFP.20573 days = 40 random = 10 }
			}
			#No
			90 = {
				modifier = { 
					factor = 0.5
					NOT = { num_of_children = 1 }
				}
				modifier = { 
					factor = 1.75
					num_of_children = 3
				}
				modifier = { 
					factor = 2
					num_of_children = 4
				}
				modifier = { 
					factor = 3
					num_of_children = 5
				}

			}
		}
		#Mother receives solace from...
		random_list = {
			#Other sons
			30 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { 
					factor = 0
					NOT = { 
						any_child = { 
							is_alive = yes 
							age = 6
							is_inaccessible_trigger = no
							NOT = { trait = incapable }
							prisoner = no
						}
					}
				}
				modifier = { 
					factor = 0.75
					NOT = { 
						any_child = { 
							is_alive = yes 
							age = 6
							is_inaccessible_trigger = no
							NOT = { trait = incapable }
							prisoner = no
							trait = kind
						}
					}
				}
				random_child = { 
					limit = { 
						is_alive = yes 
						age = 6
						is_inaccessible_trigger = no
						NOT = { trait = incapable }
						prisoner = no
					}
					character_event = { id = HFP.20574 days = 120 random = 20 }
				}
			}
			#Spouse 
			30 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { 
					factor = 0.15
					is_ruler = no
					is_main_spouse = no
				}
				modifier = { 
					factor = 0.25
					has_character_modifier = adulteress
				}
				modifier = { 
					factor = 0.25
					has_character_modifier = incestuous_adulteress
				}
				modifier = { 
					factor = 0
					NOT = { 
						any_spouse = { 
							is_alive = yes 
							is_inaccessible_trigger = no
							NOT = { trait = incapable }
							prisoner = no
						}
					}
				}
				modifier = { 
					factor = 0.75
					NOT = { 
						any_spouse = { 
							is_alive = yes 
							is_inaccessible_trigger = no
							NOT = { trait = incapable }
							prisoner = no
							trait = kind
						}
					}
				}
				random_spouse = { 
					limit = { 
						is_alive = yes 
						is_inaccessible_trigger = no
						NOT = { trait = incapable }
						prisoner = no
					}
					character_event = { id = HFP.20574 days = 120 random = 20 }
				}
			}
			#Lover
			30 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { 
					factor = 0
					is_consort = yes
				}
				modifier = { 
					factor = 0
					NOT = { 
						any_lover = { 
							is_alive = yes 
							is_inaccessible_trigger = no
							NOT = { trait = incapable }
							NOT = { is_married = ROOT } #Loving husbands get event above.
							prisoner = no
						}
					}
				}
				random_lover = { 
					limit = { 
						is_alive = yes 
						is_inaccessible_trigger = no
						NOT = { trait = incapable }
						NOT = { is_married = ROOT }
						prisoner = no
					}
					character_event = { id = HFP.20575 days = 120 random = 20 }
				}
			}
			#Spouse organizes Gossiping
			40 = {
				modifier = { 
					factor = 0.5
					has_game_rule = {
						name = pregnancy_flavor
						value = limited
					}
				}
				modifier = { 
					factor = 0
					is_main_spouse = no
				}
				modifier = { 
					factor = 0
					is_married = no
				}
				modifier = {
					factor = 0
					spouse = { trait = incapable }
				}
				modifier = {
					factor = 0
					spouse = { prisoner = yes }
				}
				modifier = { #Only for rulers with vassals (or spouses of rulers)
					factor = 0
					spouse = { lower_tier_than = COUNT }
					lower_tier_than = COUNT
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.5
					num_of_children = 2
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.35
					num_of_children = 3
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.25
					num_of_children = 4
				}
				modifier = { #Make events less likely to become recurring at every pregnancy.
					factor = 0.15
					num_of_children = 5
				}
				modifier = { 
					factor = 1.65
					trait = gregarious
				}
				modifier = { 
					factor = 1.5
					NOT = { age = 25 }
				}
				modifier = { 
					factor = 0.25
					age = 35
				}
				modifier = { 
					factor = 0.1
					age = 45
				}
				spouse = { character_event = { id = HFP.20005 days = 120 random = 20 } } #Fires on husband first.
			}
			#Nobody
			40 = {
				modifier = { 
					factor = 0.85
					NOT = { num_of_children = 1 }
				}
				modifier = { 
					factor = 1.25
					num_of_children = 1
				}
				modifier = { 
					factor = 1.5
					num_of_children = 2
				}
				modifier = { 
					factor = 1.75
					num_of_children = 3
				}
				modifier = { 
					factor = 2
					num_of_children = 4
				}
				modifier = { 
					factor = 3
					num_of_children = 5
				}

			}
		}
	}
}

#First pregnancy scare.
character_event = {
	id = HFP.20557
	desc = EVTDESCHFPA20557
	picture = GFX_evt_princess_byzantine

	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
	}
	
	is_triggered_only = yes

	option = { #Pray for good health
		name = EVTOPTAHFP20557
		add_character_modifier = {
			name = mother_praying_health
			duration = -1 #Removed on birth
		}
		ai_chance = { 
			factor = 40 
			modifier = { 
				factor = 2
				trait = zealous
			}
			modifier = { 
				factor = 0.5
				trait = cynical
			}
		}
	}
	option = { #Rest
		name = EVTOPTBHFP20557
		add_character_modifier = {
			name = mother_resting_health
			duration = -1 #Removed on birth
		}
		ai_chance = { 
			factor = 40 
			modifier = { 
				factor = 2
				trait = temperate
			}
			modifier = { 
				factor = 2
				trait = shrewd
			}

		}
	}
	option = { #Go out, distract yourself
		name = EVTOPTCHFP20557
		add_character_modifier = {
			name = mother_partying_health
			duration = -1 #Removed on birth
		}
		ai_chance = { factor = 20 
			modifier = { 
				factor = 2
				trait = hedonist
			}
			modifier = { 
				factor = 2
				trait = gregarious
			}
		}
	}
}

#Baby kicks.
character_event = {
	id = HFP.20558
	desc = EVTDESCHFPA20558
	picture = GFX_evt_princess_byzantine
	
	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
	}

	is_triggered_only = yes

	option = { #Hope he's a warrior.
		name = EVTOPTAHFP20558
		custom_tooltip = { text = tooltip_hoping_child_warrior }
		random = { 
			chance = 30 
			add_trait = stressed
			hidden_tooltip = { character_event = { id = 38282 } }
		}
		set_character_flag = mom_hopes_child_warrior
		ai_chance = { factor = 50 }
	}
	option = { #Rest a moment
		name = EVTOPTBHFP20558
		prestige = -50
		if = { 
			limit = { 
				trait = stressed 
			} 
			remove_trait = stressed
		}
		add_character_modifier = {
			name = mother_minor_rest
			duration = 20
		}
		ai_chance = { factor = 50 }
	}
}

#Mother of one thinks about what will her next child be.
character_event = {
	id = HFP.20559
	desc = {
		text = EVTDESCHFPA20559
		trigger = {
			OR = { 
				has_law = agnatic_succession
				has_law = cognatic_succession
			}
		}
	}
	desc = {
		text = EVTDESCHFPB20559
		trigger = { 
			OR = { 
				has_law = enatic_succession
				has_law = enatic_cognatic_succession
			}
		}
	}
	desc = {
		text = EVTDESCHFPC20559
		trigger = { 
			has_law = true_cognatic_succession
		}
	}
	picture = GFX_evt_princess_byzantine
	
	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
	}

	is_triggered_only = yes

	option = { #Hope he's a boy
		name = EVTOPTAHFP20559
		custom_tooltip = { text = tooltip_hoping_child_boy }
		set_character_flag = mom_hopes_child_boy
		ai_chance = { factor = 50 }
	}
	option = { #Hope he's a girl
		name = EVTOPTBHFP20559
		custom_tooltip = { text = tooltip_hoping_child_girl }
		set_character_flag = mom_hopes_child_girl
		ai_chance = { factor = 50 }
	}
	option = { #Doesn't matter
		name = EVTOPTCHFP20559
		ai_chance = { factor = 10 }
	}
}

#Mother needs new dresses.
character_event = {
	id = HFP.20560
	desc = EVTDESCHFPA20560
	picture = GFX_evt_princess_byzantine
	
	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
	}

	is_triggered_only = yes

	option = { #Eat less
		name = EVTOPTAHFP20560
		trigger = { 
			trait = gluttonous
		}
		lose_weight_small_effect = yes
		weight_trait_check_effect = yes
		tooltip_info = gluttonous
		tiered_prestige_negative_effect = yes
		remove_trait = gluttonous
		clr_character_flag = gluttonous_pregnant
		random = { 
			chance = 30 
			add_trait = stressed
			hidden_tooltip = { character_event = { id = 38282 } }
		}
		ai_chance = { factor = 10 }
	}
	option = { #Ask husband
		name = EVTOPTBHFP20560
		trigger = { 
			is_married = yes 
			spouse = { 
				is_inaccessible_trigger = no 
				prisoner = no
				NOT = { trait = incapable }
				is_ruler = yes
			}
		}
		custom_tooltip = { text = tooltip_ask_dress_husband }
		hidden_tooltip = { spouse = { character_event = { id = HFP.20561 } } }
		ai_chance = { factor = 50 }
	}
	option = { #Buy new dresses
		name = EVTOPTCHFP20560
		trigger = { is_ruler = yes }
		scaled_wealth = -0.1
		tiered_prestige_reward_effect = yes
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = humble
			}
		}
	}
	option = { #Doesn't matter
		name = EVTOPTDHFP20560
		tiered_prestige_negative_effect = yes
		tiered_piety_reward_effect = yes
		if = { 
			limit = { trait = proud } 
			remove_trait = proud
		}
		random = { 
			chance = 25
			add_trait = stressed
			hidden_tooltip = { character_event = { id = 38282 } }
		}
		ai_chance = { 
			factor = 10 
			modifier = { 
				factor = 0.5 
				trait = proud
			}
		}
	}
}

#Husband: pregnant wife wants new dresses.
character_event = {
	id = HFP.20561
	desc = EVTDESCHFPA20561
	picture = GFX_evt_daughter_asking_father

	is_triggered_only = yes

	option = { #Flattery
		name = EVTOPTAHFP20561
		trigger = { diplomacy = 10 }
		tooltip_info = diplomacy
		FROM = {
			show_scope_change = no
			opinion = {
				modifier = opinion_flattered
				years = 5
				who = ROOT
			}
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20562 } } }
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 1.5 
				trait = quick
			}
			modifier = { 
				factor = 1.5 
				trait = genius
			}
		}
	}
	option = { #Buy clothes for her
		name = EVTOPTBHFP20561
		scaled_wealth = -0.1
		FROM = {
			tiered_prestige_reward_effect = yes
			opinion = {
				modifier = opinion_flattered
				years = 5
				who = ROOT
			}
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20563 } } }
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = greedy
			}
			modifier = { 
				factor = 1.75 
				trait = charitable
			}
		}
	}
	option = { #No.
		name = EVTOPTCHFP20561
		FROM = {
			opinion = {
				modifier = opinion_denied_request
				years = 5
				who = ROOT
			}
		}
		tooltip = {
			FROM = { 
				show_scope_change = no
				random = { 
					chance = 40
					add_trait = stressed
				}
			}
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20564 } } }
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = charitable
			}
			modifier = { 
				factor = 1.75 
				trait = greedy
			}
		}
	}
}
#Wife flattered by husband
character_event = {
	id = HFP.20562
	desc = EVTDESCHFPA20562
	picture = GFX_evt_lovers

	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20562
		tooltip = {
			opinion = {
				modifier = opinion_flattered
				years = 5
				who = FROM
			}
		}
		ai_chance = { 
			factor = 50 
		}
	}
}

#Wife gets clothes from husband.
character_event = {
	id = HFP.20563
	desc = EVTDESCHFPA20563
	picture = GFX_evt_daughter_asking_father
	trigger = { NOT = { trait = troubled_pregnancy } }

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20563
		tooltip = {
			tiered_prestige_reward_effect = yes
			opinion = {
				modifier = opinion_flattered
				years = 5
				who = FROM
			}
		}
		ai_chance = { 
			factor = 50 
		}
	}
}

#Wife doesn't get clothes from husband.
character_event = {
	id = HFP.20564
	desc = EVTDESCHFPA20564
	picture = GFX_evt_quarrel
	trigger = { NOT = { trait = troubled_pregnancy } }

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20564
		tooltip = {
			opinion = {
				modifier = opinion_denied_request
				years = 5
				who = FROM
			}
		}
		random = { 
			chance = 40
			add_trait = stressed
			hidden_tooltip = { character_event = { id = 38282 } }
		}
		ai_chance = { 
			factor = 50 
		}
	}
}

#Mother gets positive omen.
character_event = {
	id = HFP.20565
	desc = EVTDESCHFPA20565
	picture = GFX_evt_comet

	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
	}

	is_triggered_only = yes

	option = { #Interpret
		name = EVTOPTAHFP20565
		trigger = { learning = 10 }
		tooltip_info = learning
		piety = 300
		add_character_modifier = {
			name = mother_good_omen
			duration = 150
		}
		hidden_tooltip = { spouse = { character_event = { id = HFP.20566 } }
			if = { #Chance of a strange positive birth.
				limit = { NOT = { has_dynasty_flag = flag_vision_baby } }
				random_list = { 
					90 = { } 									#No vision
					10 = { 
						modifier = { 
							factor = 0 
							NOR = { 
								religion_group = christian
								religion_group = muslim
								religion = tengri_pagan
								religion = tengri_pagan_reformed
								religion = norse_pagan
								religion = norse_pagan_reformed
							} 
						} 
						set_dynasty_flag = flag_vision_baby		#Positive
						character_event = { id = HFP.20503 days = 43 random = 20 }  
					} 
				} 
			}
		}
		ai_chance = { 
			factor = 100 
		}
	}
	option = { 
		name = EVTOPTBHFP20565
		tiered_piety_reward_effect = yes
		hidden_tooltip = { spouse = { character_event = { id = HFP.20566 } }
			if = { #Chance of a strange positive birth.
				limit = { NOT = { has_dynasty_flag = flag_vision_baby } }
				random_list = { 
					99 = { } 									#No vision
					1 = { 
						modifier = { 
							factor = 0 
							NOR = { 
								religion_group = christian
								religion_group = muslim
								religion = tengri_pagan
								religion = tengri_pagan_reformed
								religion = norse_pagan
								religion = norse_pagan_reformed
							} 
						} 
						set_dynasty_flag = flag_vision_baby		#Positive
						character_event = { id = HFP.20503 days = 43 random = 20 }  
					} 
				} 
			}
		}
		add_character_modifier = {
			name = mother_good_omen
			duration = 100
		}
		ai_chance = { 
			factor = 50 
		}
	}
}
#Husband notified.
character_event = {
	id = HFP.20566
	desc = EVTDESCHFPA20566
	picture = GFX_evt_comet

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20566
		ai_chance = { 
			factor = 50 
		}
	}
}
#Mother gets negative omen.
character_event = {
	id = HFP.20567
	desc = EVTDESCHFPA20567
	picture = GFX_evt_comet

	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
	}

	is_triggered_only = yes

	option = { #Interpret
		name = EVTOPTAHFP20567
		trigger = { learning = 10 }
		tooltip_info = learning
		piety = -50
		add_character_modifier = {
			name = mother_bad_omen
			duration = 50
		}
		random = { 
			chance = 15 
			add_trait = stressed
			hidden_tooltip = { character_event = { id = 38282 } }
		}
		hidden_tooltip = { spouse = { character_event = { id = HFP.20568 } }

			if = { #Chance of a strange bad birth.
				limit = { NOT = { has_dynasty_flag = flag_vision_baby } }
				random_list = { 
					99 = { } 									#No vision
					1 = { 
						modifier = { 
							factor = 0 
							NOR = { 
								religion_group = christian
								religion_group = muslim
								religion = tengri_pagan
								religion = tengri_pagan_reformed
								religion = norse_pagan
								religion = norse_pagan_reformed
							} 
						}
						set_dynasty_flag = flag_vision_baby 	#Negative
						character_event = { id = HFP.20504 days = 33 random = 20 }  
					} 
				} 
			}
		}
		ai_chance = { 
			factor = 100 
		}
	}
	option = { 
		name = EVTOPTBHFP20567
		tiered_piety_negative_effect = yes
		add_character_modifier = {
			name = mother_bad_omen
			duration = 100
		}
		if = {
			limit = {
				NOT = {
					trait = stressed
				}
			}
			random = { 
				chance = 30 
				add_trait = stressed
				hidden_tooltip = { character_event = { id = 38282 } }
			}
		}

		hidden_tooltip = { spouse = { character_event = { id = HFP.20568 } }

			if = { #Chance of a strange bad birth.
				limit = { NOT = { has_dynasty_flag = flag_vision_baby } }
				random_list = { 
					90 = { } 									#No vision
					10 = { 
						modifier = { 
							factor = 0 
							NOR = { 
								religion_group = christian
								religion_group = muslim
								religion = tengri_pagan
								religion = tengri_pagan_reformed
								religion = norse_pagan
								religion = norse_pagan_reformed
							} 
						}
						set_dynasty_flag = flag_vision_baby 	#Negative
						character_event = { id = HFP.20504 days = 33 random = 20 }  
					} 
				} 
			}
		}
		ai_chance = { 
			factor = 50 
		}
	}
}

#Husband notified.
character_event = {
	id = HFP.20568
	desc = EVTDESCHFPA20568
	picture = GFX_evt_comet

	is_triggered_only = yes

	option = { #Reinterpret the signs
		name = EVTOPTAHFP20568
		trigger = { learning = 10 }
		tooltip_info = learning

		FROM = {
			hidden_tooltip = {	#Remove the older one first.
			remove_character_modifier = mother_bad_omen
		}
			add_character_modifier = {
				name = mother_bad_omen
				duration = 50
			}
		}
		ai_chance = { 
			factor = 50 
		}
	}
	option = { 
		name = {
			text = EVTOPTBHFP20568_A
			trigger = {
				is_lover = FROM
			}
		}
		name = {
			text = EVTOPTBHFP20568_B
			trigger = {
				NOT = { 
					is_lover = FROM
				}
			}
		}
		if = { 
			limit = { 
				is_lover = FROM
			}
			random = { 
				chance = 30 
				add_trait = stressed
			}
		}
		tooltip = { 
			FROM = { 
				add_character_modifier = {
					name = mother_bad_omen
					duration = 100
				}
				random = { 
					chance = 30 
					add_trait = stressed
				}
			}
		}
		ai_chance = { 
			factor = 50 
		}
	}
}

#Christian Mother can make vow to the Holy Virgin.
character_event = {
	id = HFP.20569
	desc = EVTDESCHFPA20569
	picture = GFX_evt_virgin_mary_icon
	border = GFX_event_normal_frame_religion
	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
		religion_group = christian
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20569
		custom_tooltip = { text = tooltip_mary_vow }
		hidden_tooltip = { character_event = { id = HFP.20570 } } #Pick one.
		ai_chance = { 
			factor = 80 
			modifier = { 
				factor = 0.35 
				trait = cynical
			}
		}
	}
	option = { #No
		name = EVTOPTBHFP20569
		if = { 
			limit = { trait = cynical } 
			tiered_piety_negative_effect = yes
			tiered_prestige_reward_effect = yes
		}
		if = { 
			limit = { 
				NOT = { trait = cynical } 
			} 
			random = { 
				chance = 50
				add_trait = cynical
				hidden_tooltip = { character_event = { id = 38258 } }
			}
		}
		if = { 
			limit = { trait = zealous } 
			random = { 
				chance = 50
				remove_trait = zealous
				hidden_tooltip = { character_event = { id = 38269 } }
			}
		}
		ai_chance = { 
			factor = 20 
			modifier = { 
				factor = 0.5 
				trait = zealous
			}
		}
	}
}

#Holy Virgin: What vow are you going to take?
character_event = {
	id = HFP.20570
	desc = EVTDESCHFPA20570
	picture = GFX_evt_virgin_mary_icon
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	#Chastity
	#Humility
	#Charity
	#Temperance
	option = { 
		name = EVTOPTAHFP20570
		custom_tooltip = { text = tooltip_vow_chastity }
		hidden_tooltip = {	
			add_character_modifier = {
				name = mother_vow_chastity
				duration = -1 #Removed post-birth
			} 
		}
		if = { 
			limit = { trait = lustful } 
			random = { 
				chance = 25 
				remove_trait = lustful
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = lustful
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20570
		custom_tooltip = { text = tooltip_vow_humility }
		hidden_tooltip = {	
			add_character_modifier = {
				name = mother_vow_humility
				duration = -1 #Removed post-birth
			}
		}
		if = { 
			limit = { trait = proud } 
			random = { 
				chance = 25 
				remove_trait = proud
				hidden_tooltip = { character_event = { id = 38300 } }
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = proud
			}
		}
	}
	option = { 
		name = EVTOPTCHFP20570
		custom_tooltip = { text = tooltip_vow_charity }
		hidden_tooltip = {	
			add_character_modifier = {
				name = mother_vow_charity
				duration = -1 #Removed post-birth
			}
		}
		if = { 
			limit = { trait = greedy } 
			random = { 
				chance = 25 
				remove_trait = greedy
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = greedy
			}
		}
	}
	option = { 
		name = EVTOPTDHFP20570
		custom_tooltip = { text = tooltip_vow_temperance }
		lose_weight_medium_effect = yes
		weight_trait_check_effect = yes
		hidden_tooltip = {	
			add_character_modifier = {
				name = mother_vow_temperance
				duration = -1 #Removed post-birth
			}
		}
		if = { 
			limit = { trait = gluttonous } 
			random = { 
				chance = 25 
				remove_trait = gluttonous
				hidden_tooltip = { character_event = { id = 38300 } }
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = gluttonous
			}
		}
	}
}

#Pagan Mother can go offer sacrifice to the gods for healthy child.
character_event = {
	id = HFP.20571
	desc = EVTDESCHFPA20571
	picture = GFX_evt_pagan
	border = GFX_event_normal_frame_religion
	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
		religion_group = pagan_group
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20571
		custom_tooltip = { text = tooltip_pagan_mom_sacrifice }
		hidden_tooltip = { character_event = { id = HFP.20572 days = 3 } } #Pick one.
		scaled_wealth = { value = -1 min = -5 max = -50 } 
		add_character_modifier = {
			name = mother_exposed_to_elements
			duration = 60
		}
		ai_chance = { 
			factor = 70 
			modifier = { 
				factor = 0.35 
				trait = cynical
			}
			modifier = { 
				factor = 0.5 
				trait = craven
			}
			modifier = { 
				factor = 0.5 
				trait = paranoid
			}
			modifier = { 
				factor = 0.5 
				trait = feeble
			}
			modifier = { 
				factor = 0.5 
				is_ill = yes
			}
			modifier = { 
				factor = 0
				trait = in_hiding
			}
		}
	}
	option = { #No
		name = EVTOPTBHFP20571
		if = { 
			limit = { trait = cynical } 
			tiered_piety_negative_effect = yes
			tiered_prestige_reward_effect = yes
		}
		if = { 
			limit = { 
				NOT = { trait = cynical } 
			} 
			random = { 
				chance = 50
				add_trait = cynical
				hidden_tooltip = { character_event = { id = 38258 } }
			}
		}
		if = { 
			limit = { trait = zealous } 
			random = { 
				chance = 50
				remove_trait = zealous
				hidden_tooltip = { character_event = { id = 38269 } }
			}
		}
		ai_chance = { 
			factor = 30 
			modifier = { 
				factor = 0.5 
				trait = zealous
			}
		}
	}
}

#Pagan sacrifice: what are you wishing for?
character_event = {
	id = HFP.20572
	desc = EVTDESCHFPA20572
	picture = GFX_evt_mysterious_forest
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	#Strong child
	#Beautiful child
	#Bright child
	option = { 
		name = EVTOPTAHFP20572
		custom_tooltip = { text = tooltip_mom_hopes_strong }
		set_character_flag = mom_hopes_child_strong
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = strong
			}
			modifier = { 
				factor = 0.5 
				trait = robust
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20572
		custom_tooltip = { text = tooltip_mom_hopes_pretty }
		set_character_flag = mom_hopes_child_pretty
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = fair
			}
		}
	}
	option = { 
		name = EVTOPTCHFP20572
		custom_tooltip = { text = tooltip_mom_hopes_smart }
		set_character_flag = mom_hopes_child_smart
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = slow
			}
			modifier = { 
				factor = 0.25 
				trait = imbecile
			}
		}
	}
}

#Mother has weird cravings.
character_event = {
	id = HFP.20573
	desc = EVTDESCHFPA20573
	picture = GFX_evt_fancy_feast

	is_triggered_only = yes

	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
	}

	#Everything
	#Quail's leg
	#Hare's head
	#Trout's eye

	option = { 
		name = EVTOPTAHFP20573
		trigger = { 
			trait = gluttonous 
			is_ruler = yes
		}
		tooltip_info = gluttonous
		custom_tooltip = { text = tooltip_mother_craved_all }
		gain_weight_small_effect = yes
		weight_trait_check_effect = yes
		tiered_prestige_reward_effect = yes
		scaled_wealth = -0.05
		if = { 
			limit = { NOT = { has_character_flag = gluttonous_pregnant } }
			hidden_tooltip = { character_event = { id = HFP.20441 days = 15 random = 10 } }  #Confirmation.
			hidden_tooltip = { character_event = { id = HFP.20421 days = 200 } }   #Post-pregnancy recovery.
		}
		add_character_modifier = {
				name = well_fed
				years = 2
		}
		ai_chance = { 
			factor = 50
		}
	}
	option = { 
		name = EVTOPTAHFP20573
		trigger = { 
			NOT = { trait = gluttonous } 
			is_ruler = yes
		}
		custom_tooltip = { text = tooltip_mother_craved_all }
		random = { 
			chance = 20
			add_trait = gluttonous 
			hidden_tooltip = { character_event = { id = 38277 } } #Notification

		}
		tiered_prestige_reward_effect = yes
		scaled_wealth = { value = -0.05 min = -5 max = -100 }
		add_character_modifier = {
				name = well_fed
				years = 2
		}
		ai_chance = { 
			factor = 50
		}
	}
	option = { #Quail's leg
		name = EVTOPTBHFP20573
		trigger = { is_ruler = yes }
		custom_tooltip = { text = tooltip_mother_craved_quail }
		scaled_wealth = { value = -0.01 min = -1 max = -30 }
		set_character_flag = mother_craved_quail
		ai_chance = { 
			factor = 20
		}
	}
	option = { #Hare's head
		name = EVTOPTCHFP20573
		trigger = { is_ruler = yes }
		custom_tooltip = { text = tooltip_mother_craved_hare }
		scaled_wealth = { value = -0.01 min = -1 max = -30 }
		set_character_flag = mother_craved_hare
		ai_chance = { 
			factor = 20
		}
	}
	option = { #Trout's eye
		name = EVTOPTDHFP20573
		trigger = { is_ruler = yes }
		custom_tooltip = { text = tooltip_mother_craved_trout }
		scaled_wealth = { value = -0.01 min = -1 max = -30 }
		set_character_flag = mother_craved_trout
		ai_chance = { 
			factor = 20
		}
	}
	option = { #Useless courtier needs to ask her husband (if she has any).
		name = EVTOPTEHFP20573
		trigger = { 
			is_ruler = no
			is_main_spouse = yes #Prevent concubine spamming 
		}
		hidden_tooltip = { spouse = { character_event = { id = HFP.20596 } } }
		ai_chance = { 
			factor = 20
		}
	}
	option = { #Useless courtier is not even the main wife and does nothing.
		name = EVTOPTEHFP20573
		trigger = { 
			is_ruler = no
			is_main_spouse = no
		}
		ai_chance = { 
			factor = 20
		}
	}
}

#Spouse: Mother has weird cravings.
character_event = {
	id = HFP.20596
	desc = EVTDESCHFPA20596
	picture = GFX_evt_fancy_feast

	is_triggered_only = yes

	trigger = { 
		is_ruler = yes 
		FROM = { is_alive = yes is_married = ROOT } 
	}

	#Everything
	#Quail's leg
	#Hare's head
	#Trout's eye

	option = { 
		name = EVTOPTAHFP20596
		trigger = { NOT = {	trait = greedy } } 
		custom_tooltip = { text = tooltip_father_gave_all }
		scaled_wealth = -0.05
		FROM = { 
			show_scope_change = no
			opinion = { 
				who = ROOT
				modifier = opinion_cravings 
				years = 2
			}
			gain_weight_small_effect = yes
			weight_trait_check_effect = yes
			if = { 
				limit = { NOT = { has_character_flag = gluttonous_pregnant } }
				hidden_tooltip = { character_event = { id = HFP.20441 days = 15 random = 10 } }  #Confirmation.
				hidden_tooltip = { character_event = { id = HFP.20421 days = 200 } }   #Post-pregnancy recovery.
			}
			random = { 
				chance = 40
				add_trait = gluttonous 
				hidden_tooltip = { character_event = { id = 38277 } } #Notification
			}
			add_character_modifier = {
				name = well_fed
				years = 2
			} 
		}
		ai_chance = { 
			factor = 20
		}
	}
	option = { #Quail's leg
		name = EVTOPTBHFP20596
		custom_tooltip = { text = tooltip_father_gave_quail }
		scaled_wealth = -0.01
		FROM = { 
		set_character_flag = mother_craved_quail
		}
		ai_chance = { 
			factor = 20
		}
	}
	option = { #Hare's head
		name = EVTOPTCHFP20596
		custom_tooltip = { text = tooltip_father_gave_hare }
		scaled_wealth = -0.01
		FROM = { 
		set_character_flag = mother_craved_hare
		}
		ai_chance = { 
			factor = 20
		}
	}
	option = { #Trout's eye
		name = EVTOPTDHFP20596
		custom_tooltip = { text = tooltip_father_gave_trout }
		scaled_wealth = -0.01
		FROM = { 
		set_character_flag = mother_craved_trout
		}
		ai_chance = { 
			factor = 20
		}
	}
	option = { 
		name = EVTOPTEHFP20596
		trigger = { trait = greedy }
		tooltip_info = greedy
		FROM = { 
			random = { 
				chance = 30 
				add_trait = stressed
				hidden_tooltip = { character_event = { id = 38282 } }
			}
			opinion = { 
				modifier = opinion_angry
				who = ROOT
				years = 4
			}
		}
		ai_chance = { 
			factor = 70
		}
	}
}

#Son/Spouse: chance to offer solace to pregnant mother/wife.
character_event = {
	id = HFP.20574
	desc = {
		text = EVTDESCHFPA20574
		trigger = {		
			NOT = { is_married = FROM }
			NOT = { 
				age = 16
			}
		}
	}
	desc = {
		text = EVTDESCHFPB20574
		trigger = {
			NOT = { is_married = FROM }
			age = 16
		}
	}
	desc = {
		text = EVTDESCHFPC20574
		trigger = {
			is_married = FROM
			NOR = {
				FROM = { has_character_modifier = adulteress }
				FROM = { has_character_modifier = incestuous_adulteress }
			}
		}
	}
	desc = {
		text = EVTDESCHFPD20574
		trigger = {
			is_married = FROM
			OR = {
				FROM = { has_character_modifier = adulteress }
				FROM = { has_character_modifier = incestuous_adulteress }
			}
		}
	}
	picture = GFX_evt_bad_news_female

	is_triggered_only = yes

	trigger = {
		FROM = {
			is_alive = yes
			trait = pregnant
			OR = {
				is_married = ROOT
				is_mother = ROOT
			}
			NOR = {
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				trait = travelling
			}
		}
	}

	option = { #Buy something (spouse)
		name = EVTOPTAHFP20574
		custom_tooltip = { text = tooltip_buy_to_woman }
		trigger = { 
			is_married = FROM
		}
		tooltip = {
			FROM = {
				show_scope_change = no
				add_character_modifier = {
					name = mother_comforted
					duration = 60
					stacking = yes
				}
			}
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20576 } } }
		scaled_wealth = { value = -0.1 min = -5 max = -150 }
		if = { 
			limit = { 
				NOT = { trait = charitable } 
			} 
			random = { 
				chance = 15
				add_trait = charitable
				hidden_tooltip = { character_event = { id = 38273 } }
			}
		}
		if = { 
			limit = { 
				NOT = { trait = kind } 
			} 
			random = { 
				chance = 5
				add_trait = kind
				hidden_tooltip = { character_event = { id = 38268 } }
			}
		}
		ai_chance = { 
			factor = 60
			modifier = { 
				factor = 0.1 
				is_rival = FROM
			}
		}
	}
	option = { #Spend time
		name = EVTOPTBHFP20574
		custom_tooltip = { text = tooltip_spend_time_woman }
		trigger = { 
			OR = { 
				is_child_of = FROM
				is_lover = FROM
			}
		}
		tooltip = {
			FROM = {
				show_scope_change = no
				add_character_modifier = {
					name = mother_comforted
					duration = 30
					stacking = yes
				}
			}
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20578 } } }
		if = { 
			limit = { 
				NOT = { trait = kind } 
			} 
			random = { 
				chance = 5
				add_trait = kind
				hidden_tooltip = { character_event = { id = 38268 } }
			}
		}
		ai_chance = { 
			factor = 70
			modifier = { 
				factor = 0.1 
				is_rival = FROM
			}
		}
	}
	option = { #Do not do anything.
		name = { 
			text = EVTOPTCHFP20574 
			trigger = { 
				NOR = {
					FROM = { has_character_modifier = adulteress }
					FROM = { has_character_modifier = incestuous_adulteress }
				}
			}
		}
		name = { 
			text = EVTOPTCHFP20574_B 
			trigger = { 
				OR = {
					FROM = { has_character_modifier = adulteress }
					FROM = { has_character_modifier = incestuous_adulteress }
				}
			}
		}

		tiered_piety_negative_effect = yes
		#if = { 
		#	limit = { 
		#		NOT = { trait = cruel } 
		#	} 
		#	random = { 
		#		chance = 5
		#		add_trait = cruel
		#		hidden_tooltip = { character_event = { id = 38259 } }
		#	}
		#}
		ai_chance = { 
			factor = 30
			modifier = { 
				factor = 1.75
				trait = shy
			}
			modifier = { 
				factor = 1.75
				trait = greedy
			}
			modifier = { 
				factor = 1.5
				FROM = { has_character_modifier = adulteress }
			}
			modifier = { 
				factor = 1.5
				FROM = { has_character_modifier = incestuous_adulteress }
			}
			modifier = { 
				factor = 0.5
				FROM = { trait = hard_pregnancy }
			}
			modifier = { 
				factor = 0.1 
				is_friend = FROM
			}
			modifier = { 
				factor = 0.1 
				is_lover = FROM
			}
			modifier = { 
				factor = 1.75
				NOT = { opinion = { who = FROM value = 0 } }
			}
		}
	}
}

#Lover: chance to visit pregnant lover in secret.
character_event = {
	id = HFP.20575
	desc = {
		text = EVTDESCHFPA20575
		trigger = {		
			is_female = no
		}
	}
	desc = {
		text = EVTDESCHFPB20575
		trigger = {		
			is_female = yes
		}
	}
	picture = GFX_evt_bad_news_female

	is_triggered_only = yes

	trigger = {
		FROM = {
			trait = pregnant
			is_alive = yes
			is_lover = ROOT
			NOR = {
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				trait = travelling
			}
		}
	}

	option = { #Visit
		name = EVTOPTAHFP20575
		custom_tooltip = { text = tooltip_visit_lover }
		tooltip = {
			FROM = {
				show_scope_change = no
				add_character_modifier = {
					name = mother_comforted
					duration = 30
					stacking = yes
				}
			}
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20580 } } }
		ai_chance = { 
			factor = 70
			modifier = { 
				factor = 1.5
				trait = brave
			}
			modifier = { 
				factor = 1.5
				trait = lustful
			}
		}
	}
	option = { #No
		name = EVTOPTBHFP20575
		ai_chance = { 
			factor = 30
			modifier = { 
				factor = 1.75
				trait = shy
			}
			modifier = { 
				factor = 1.75
				trait = paranoid
			}
			modifier = { 
				factor = 2
				trait = craven
			}
		}
	}
}

#Mother: Spouse gives presents to make you feel better.
character_event = {
	id = HFP.20576
	desc = EVTDESCHFPA20576
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes

	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
		FROM = { is_alive = yes is_married = ROOT } 
	}

	option = { #Chance for lover
		name = EVTOPTAHFP20576
		trigger = { 
			NOT = { is_lover = FROM } 
			trait = trusting
		}
		tooltip_info = trusting
		add_lover = FROM
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
		add_character_modifier = {
			name = mother_comforted
			duration = 60
			stacking = yes
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20577 } } }
		ai_chance = { 
			factor = 30
			modifier = { 
				factor = 1.5
				trait = lustful
			}
			modifier = { 
				factor = 0.5
				trait = chaste
			}
			modifier = { 
				factor = 0.5
				trait = shy
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20576
		add_character_modifier = {
			name = mother_comforted
			duration = 60
			stacking = yes
		}
		ai_chance = { 
			factor = 70
			modifier = { 
				factor = 1.5
				trait = greedy
			}
			modifier = { 
				factor = 1.5
				trait = paranoid
			}
		}
	}
}

#Notify spouse that woman has fallen in love with him.
character_event = {
	id = HFP.20577
	desc = EVTDESCHFPA20577
	picture = GFX_evt_lovers

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20577
		add_lover = FROM
		ai_chance = { factor = 100 }
	}
}

#Mother: Loving husband/child spends time with her.
character_event = {
	id = HFP.20578
	desc = {
		text = EVTDESCHFPA20578
		trigger = {		
			NOT = { is_married = FROM }
			NOT = { 
				FROM = { age = 16 }
			}
		}
	}
	desc = {
		text = EVTDESCHFPB20578
		trigger = {
			NOT = { is_married = FROM }
			FROM = { age = 16 }
		}
	}
	desc = {
		text = EVTDESCHFPC20578
		trigger = {
			is_married = FROM
		}
	}
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes

	trigger = { 
		trait = pregnant
		NOT = { trait = troubled_pregnancy } 
		FROM = { 
			is_alive = yes 
			OR = {
				is_married = ROOT
				is_mother = ROOT
			}
		} 
	}

	option = { #Chance for mother becoming child's friend
		name = EVTOPTAHFP20578
		trigger = { 
			NOT = { num_of_friends = 3 }
			NOR = { 
				is_married = FROM 
				is_friend = FROM
				is_rival = FROM
			}
		}
		add_friend = FROM
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
		add_character_modifier = {
			name = mother_comforted
			duration = 30
			stacking = yes
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20579 } } }
		ai_chance = { 
			factor = 50
			modifier = { 
				factor = 1.5
				trait = gregarious
			}
			modifier = { 
				factor = 0.5
				trait = cruel
			}
			modifier = { 
				factor = 0.5
				trait = shy
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20578
		add_character_modifier = {
			name = mother_comforted
			duration = 30
			stacking = yes
		}
		ai_chance = { 
			factor = 50
			modifier = { 
				factor = 1.5
				trait = kind
			}
			modifier = { 
				factor = 1.5
				trait = paranoid
			}
		}
	}
}
#Notify child that mother loves him.
character_event = {
	id = HFP.20579
	desc = {
		text = EVTDESCHFPA20579
		trigger = {		
			NOT = { age = 16 }
		}
	}
	desc = {
		text = EVTDESCHFPB20579
		trigger = { age = 16 }
	}
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20579
		add_friend = FROM
		ai_chance = { factor = 100 }
	}
}

#Mother is visited by lover.
character_event = {
	id = HFP.20580
	desc = EVTDESCHFPA20580
	picture = GFX_evt_lovers

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20580
		if = { 
			limit = { trait = depressed } 
			remove_trait = depressed
			clr_character_flag = depressed_pregnant
		}
		add_character_modifier = {
			name = mother_comforted
			duration = 30
			stacking = yes
		}
		ai_chance = { factor = 100 }
	}
}

#################### Post-birth notifications ######################

#Mother recovers from stress after pregnancy.
character_event = {
	id = HFP.20581
	desc = EVTDESCHFPA20581
	picture = GFX_evt_recovery

	trigger = { 
		trait = stressed 
		FROM = { is_alive = yes }
		FROM = { NOT = { trait = sickly } }		#Baby needs to be alive and well for mother to feel relieved.
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20581
		remove_trait = stressed
		ai_chance = { factor = 100 }
	}
}

#Mother craved for quail's leg: child is good at talking but clubfooted.
character_event = {
	id = HFP.20582
	desc = EVTDESCHFPA20582
	picture = GFX_evt_birth
	
	trigger = { 
		FROM = { 
			trait = clubfooted 
			is_alive = yes
		}
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20582
		FROM = { change_diplomacy = 2 } 
		ai_chance = { factor = 100 }
	}
}

#Mother craved for hare's head: child is good at spying but harelipped.
character_event = {
	id = HFP.20583
	desc = EVTDESCHFPA20583
	picture = GFX_evt_birth
	
	trigger = { 
		FROM = { 
			trait = harelip
			is_alive = yes
			}
		}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20583
		FROM = { change_intrigue = 2 } 
		ai_chance = { factor = 100 }
	}
}

#Mother craved for trout's eye: child is good at learning but ugly.
character_event = {
	id = HFP.20584
	desc = EVTDESCHFPA20584
	picture = GFX_evt_birth
	
	trigger = { 
		FROM = { 
			trait = ugly 
			is_alive = yes
		} 
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20584
		FROM = { change_learning = 2 } 
		ai_chance = { factor = 100 }
	}
}

#Mother hoped for a warrior and she got one.
character_event = {
	id = HFP.20585
	desc = EVTDESCHFPA20585
	picture = GFX_evt_birth
	
	trigger = { 
		FROM = { 
			is_alive = yes
			NOR = { 
				trait = weak
				trait = feeble
				trait = inbred
				trait = hunchback
				trait = dwarf
				trait = sickly
			}
		}
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20585
		FROM = { change_martial = 2 } 
		tiered_prestige_reward_effect = yes
		ai_chance = { factor = 100 }
	}
}
#Mother sacrificed to gods for strong kid and got one.
character_event = {
	id = HFP.20586
	desc = EVTDESCHFPA20586
	picture = GFX_evt_birth
	border = GFX_event_normal_frame_religion
	
	trigger = { 
		FROM = { 
			is_alive = yes
			trait = strong
		}
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20586
		tiered_piety_reward_effect = yes
		ai_chance = { factor = 100 }
	}
}

#Mother sacrificed to gods for pretty kid and got one.
character_event = {
	id = HFP.20587
	desc = EVTDESCHFPA20587
	picture = GFX_evt_birth
	border = GFX_event_normal_frame_religion
	
	trigger = { 
		FROM = { 
			is_alive = yes
			trait = fair
		}
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20587
		tiered_piety_reward_effect = yes
		ai_chance = { factor = 100 }
	}
}
#Mother sacrificed to gods for smart kid and got one.
character_event = {
	id = HFP.20588
	desc = EVTDESCHFPA20588
	picture = GFX_evt_birth
	border = GFX_event_normal_frame_religion
	
	trigger = { 
		FROM = { 
			is_alive = yes
			OR = { 
				trait = quick
				trait = genius
			}
		}
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20588
		tiered_piety_reward_effect = yes
		ai_chance = { factor = 100 }
	}
}
#Mother wanted a boy/girl and she got a...
character_event = {
	id = HFP.20589
	desc = {
		text = EVTDESCHFPA20589
		trigger = {
			OR = { 
				AND = { 
					FROM = { is_female = yes } 
					has_character_flag = mom_hopes_child_girl
				}
				AND = { 
					FROM = { is_female = no } 
					has_character_flag = mom_hopes_child_boy
				}
			}
		}
	}
	desc = {
		text = EVTDESCHFPB20589
		trigger = {
			OR = { 
				AND = { 
					FROM = { is_female = no } 
					has_character_flag = mom_hopes_child_girl
				}
				AND = { 
					FROM = { is_female = yes } 
					has_character_flag = mom_hopes_child_boy
				}
			}
		}
	}
	
	picture = GFX_evt_birth
	
	trigger = { 
		FROM = { is_alive = yes }
	}

	is_triggered_only = yes

	option = { #Success
		name = EVTOPTAHFP20589
		trigger = {
			OR = { 
				AND = { 
					FROM = { is_female = yes } 
					has_character_flag = mom_hopes_child_girl
				}
				AND = { 
					FROM = { is_female = no } 
					has_character_flag = mom_hopes_child_boy
				}
			}
		}
		tiered_prestige_reward_effect = yes
		opinion = {
			modifier = opinion_kind
			years = 40
			who = FROM
		}
		ai_chance = { factor = 100 }
	}
	option = { #Failure - But still likes child.
		name = EVTOPTBHFP20589
		trigger = {
			trait = kind
			OR = { 
				AND = { 
					FROM = { is_female = no } 
					has_character_flag = mom_hopes_child_girl
				}
				AND = { 
					FROM = { is_female = yes } 
					has_character_flag = mom_hopes_child_boy
				}
			}
		}
		tooltip_info = kind
		tiered_prestige_negative_effect = yes
		ai_chance = { factor = 100 }
	}
	option = { #Failure
		name = EVTOPTCHFP20589
		trigger = {
			NOT = { trait = kind }
			OR = { 
				AND = { 
					FROM = { is_female = no } 
					has_character_flag = mom_hopes_child_girl
				}
				AND = { 
					FROM = { is_female = yes } 
					has_character_flag = mom_hopes_child_boy
				}
			}
		}
		tiered_prestige_negative_effect = yes
		opinion = {
			modifier = opinion_dislike
			years = 40
			who = FROM
		}
		ai_chance = { factor = 100 }
	}
	after = { 
		clr_character_flag = mom_hopes_child_boy 
		clr_character_flag = mom_hopes_child_girl 
	}
}

#Mother made vow to the Holy Virgin, if child is healthy, time to pay up.
character_event = {
	id = HFP.20590
	desc = { #Success - Child is alive and healthy
		text = EVTDESCHFPA20590
		trigger = {
			FROM = { 
				is_alive = yes
				NOR = { 
					trait = sickly
					trait = inbred
					trait = harelip
					trait = clubfooted
					trait = hunchback
					trait = lisp
					trait = stutter
					trait = ugly
					trait = dwarf
					trait = slow
					trait = imbecile
					trait = weak
				}
			}
		}
	}
	desc = { #Failure - Child was born but is not healthy
		text = EVTDESCHFPB20590
		trigger = {
			FROM = { 
					is_alive = yes
				OR = { 
					trait = sickly
					trait = inbred
					trait = harelip
					trait = clubfooted
					trait = hunchback
					trait = lisp
					trait = stutter
					trait = ugly
					trait = dwarf
					trait = slow
					trait = imbecile
					trait = weak
				}
			}
		}
	}
	desc = { #Critical failure - the child is dead
		text = EVTDESCHFPC20590
		trigger = {
			FROM = { 
					is_alive = no
			}
		}
	}
	picture = GFX_evt_virgin_mary_icon
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20590
		trigger = {
			FROM = { 
				is_alive = yes
				NOR = { 
					trait = sickly
					trait = inbred
					trait = harelip
					trait = clubfooted
					trait = hunchback
					trait = lisp
					trait = stutter
					trait = ugly
					trait = dwarf
					trait = slow
					trait = imbecile
					trait = weak
				}
			}
		}
		if = { 
			limit = {
				has_character_modifier =  mother_vow_chastity
			} 
			remove_character_modifier = mother_vow_chastity

			if = { 
				limit = { trait = chaste } 
				remove_trait = chaste
				if = { 
					limit = { NOT = { trait = celibate } } 
					add_trait = celibate
				}
				piety = 200
			}
			if = { 
				limit = { trait = lustful } 
				remove_trait = lustful
			}
			if = { 
				limit = { 
					NOR = { 
						trait = lustful
						trait = chaste
					}
				} 
				add_trait = chaste
				piety = 100
			}
		}
		if = { 
			limit = {
				has_character_modifier =  mother_vow_humility
			} 
			remove_character_modifier = mother_vow_humility

			if = { 
				limit = { trait = humble } 
				if = { 
					limit = { NOT = { trait = content } } 
					add_trait = content
				}
				piety = 200
			}
			if = { 
				limit = { trait = proud } 
				remove_trait = proud
			}
			if = { 
				limit = { 
					NOR = { 
						trait = proud
						trait = humble
					}
				} 
				add_trait = humble
				piety = 100
			}
		}
		if = { 
			limit = {
				has_character_modifier =  mother_vow_charity
			} 
			remove_character_modifier = mother_vow_charity

			if = { 
				limit = { trait = charitable } 
				wealth = -100
				piety = 300
			}
			if = { 
				limit = { trait = greedy } 
				remove_trait = greedy
			}
			if = { 
				limit = { 
					NOR = { 
						trait = charitable
						trait = greedy
					}
				} 
				add_trait = charitable
				piety = 100
			}
		}
		if = { 
			limit = {
				has_character_modifier =  mother_vow_temperance
			} 
			remove_character_modifier = mother_vow_temperance

			if = { 
				limit = { trait = temperate } 
				#More later
				piety = 200
			}
			if = { 
				limit = { trait = gluttonous } 
				remove_trait = gluttonous
			}
			if = { 
				limit = { 
					NOR = { 
						trait = temperate
						trait = gluttonous
					}
				} 
				add_trait = temperate
				piety = 100
				lose_weight_small_effect = yes
				weight_trait_check_effect = yes
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.25
				trait = lustful
				has_character_modifier = mother_vow_chastity
			}
			modifier = { 
				factor = 0.25
				trait = greedy
				has_character_modifier = mother_vow_charity
			}
			modifier = { 
				factor = 0.25
				trait = gluttonous
				has_character_modifier = mother_vow_temperance
			}
			modifier = { 
				factor = 0.25
				trait = proud
				has_character_modifier = mother_vow_humility
			}
		}
	}
	option = { #No, I won't keep my vow
		name = EVTOPTBHFP20590
		trigger = {
			FROM = { 
				is_alive = yes
				NOR = { 
					trait = sickly
					trait = inbred
					trait = harelip
					trait = clubfooted
					trait = hunchback
					trait = lisp
					trait = stutter
					trait = ugly
					trait = dwarf
					trait = slow
					trait = imbecile
					trait = weak
				}
			}
		}
		tiered_piety_negative_effect = yes
		if = { 
			limit = { has_character_modifier = mother_vow_chastity } 
			remove_character_modifier = mother_vow_chastity
		}
		if = { 
			limit = { has_character_modifier = mother_vow_temperance } 
			remove_character_modifier = mother_vow_temperance
		}
		if = { 
			limit = { has_character_modifier = mother_vow_charity } 
			remove_character_modifier = mother_vow_charity
		}
		if = { 
			limit = { has_character_modifier = mother_vow_humility } 
			remove_character_modifier = mother_vow_humility
		}
		hidden_tooltip = { 
			random_list = { 
				85 = {  } 
				15 = { #The Virgin strikes son with sickness.
					FROM = { character_event = { id = 6063 days = 25 } } 
					character_event = { id = HFP.20591 days = 27 } #Notify
				} 
			}
		}
		
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 3
				trait = cynical
			}
		}
	}
	option = { #Child is not well or is dead, vow was useless
		name = EVTOPTCHFP20590
		trigger = {
			FROM = { 
				OR = { 
					is_alive = no
					trait = sickly
					trait = inbred
					trait = harelip
					trait = clubfooted
					trait = hunchback
					trait = lisp
					trait = stutter
					trait = ugly
					trait = dwarf
					trait = slow
					trait = imbecile
					trait = weak
				}
			}
		}
		tiered_piety_negative_effect = yes
		if = { 
			limit = { has_character_modifier = mother_vow_chastity } 
			remove_character_modifier = mother_vow_chastity
		}
		if = { 
			limit = { has_character_modifier = mother_vow_temperance } 
			remove_character_modifier = mother_vow_temperance
		}
		if = { 
			limit = { has_character_modifier = mother_vow_charity } 
			remove_character_modifier = mother_vow_charity
		}
		if = { 
			limit = { has_character_modifier = mother_vow_humility } 
			remove_character_modifier = mother_vow_humility
		}
	}
}

#Mother: you broke your vow and now your child is sick.
character_event = {
	id = HFP.20591
	desc = EVTDESCHFPA20591
	picture = GFX_evt_bad_news_female
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20591
		tiered_piety_negative_effect = yes
		random = {  
			chance = 25
			add_trait = depressed
			hidden_tooltip = { character_event = { id = 38288 } }
		}
		ai_chance = { factor = 100 }
	}
}

#On adulthood: hidden event to determine if child of troubled birth will talk to mother about the event.
character_event = {
	id = HFP.20592
	hide_window = yes

	has_character_flag = flag_troubled_pregnancy_child 

	trigger = {
		mother = { 
			is_alive = yes
			NOT = { trait = incapable }
			prisoner = no
		}
	}

	is_triggered_only = yes

	immediate = { 
		mother = { character_event = { id = HFP.20593 } } #hidden ping for portrait
	}
}
#portrait ping.
character_event = {
	id = HFP.20593
	hide_window = yes

	is_triggered_only = yes

	immediate = { character_event = { id = HFP.20594 days = 30 random = 30 } } #Actual event for child
}

#Child of troubled birth: approach mother about subject?
character_event = {
	id = HFP.20594
	desc = EVTDESCHFPA20594
	picture = GFX_evt_son_asking_father
	
	trigger = { 
		mother = { 
			is_alive = yes
		}
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20594
		custom_tooltip = { text = tooltip_troubled_child_talks }
		hidden_tooltip = { character_event = { id = HFP.20595 } }
		clr_character_flag = flag_troubled_pregnancy_child 
		tooltip = {
			FROM = {
				opinion = {
					modifier = opinion_kind
					years = 15
					who = ROOT
				}
			}
		}
		if = {
			limit = { trait = kind }
			piety = 100
		}
		if = {
			limit = { NOT = { trait = kind } }
			random = {
				chance = 20
				add_trait = kind
				character_event = { id = 38268 }
			}
		}
		ai_chance = { 
			factor = 70
		}
	}
	option = { 
		name = EVTOPTBHFP20594
		clr_character_flag = flag_troubled_pregnancy_child 
		if = {
			limit = { trait = cruel }
			tiered_prestige_reward_effect = yes
		}
		if = {
			limit = { NOT = { trait = cruel } }
			random = {
				chance = 20
				add_trait = cruel
				character_event = { id = 38259 }
			}
		}
		ai_chance = { 
			factor = 30 
			modifier = { 
				factor = 2
				trait = slow
			}
			modifier = { 
				factor = 3
				trait = imbecile
			}
			modifier = { 
				factor = 3
				trait = cruel
			}
			modifier = { 
				factor = 0.5
				trait = kind
			}
		}
	}
}
#Mother is grateful for the child's kindness.
character_event = {
	id = HFP.20595
	desc = EVTDESCHFPA20595
	picture = GFX_evt_son_asking_father

	is_triggered_only = yes
	
	option = { 
		name = EVTOPTBHFP20595
		tiered_prestige_reward_effect = yes
		opinion = {
			modifier = opinion_kind
			years = 15
			who = FROM
		}
	}
}

#id 20596 taken by husband version of weird cravings

#Clean up event 35 days post-birth to clear all persistent event targets.
character_event = {
	id = HFP.20597
	hide_window = yes

	is_triggered_only = yes
	
	immediate = { 
		clear_persistent_event_target = pregnancy_mother_physician_per
		clear_persistent_event_target = pregnancy_spouse_physician_per
		clear_persistent_event_target = pregnancy_regent_physician_per
	}
}

#Mother thinks about her son/daughter being the son/daughter of the Pope.
character_event = {
	id = HFP.20598
	desc = EVTDESCHFPA20598
	picture = GFX_evt_pope_feast

	trigger = { 
		FROM = { 
			is_alive = yes 
			religion = catholic
			OR = { 
				trait = bastard
				trait = legit_bastard
			} 
		} 
		religion = catholic
	}
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTBHFP20598
		FROM = { 
			if = { 
				limit = { 
					is_female = no	
				} 
				give_nickname = nick_the_vatican_prince
			} 
			if = { 
				limit = { 
					is_female = yes	
				} 
				give_nickname = nick_the_vatican_princess
			}
		}
		if = { 
			limit = { tier = COUNT }
			FROM = {
				prestige = 100
				piety = -100
			}
		}
		if = { 
			limit = { tier = DUKE }
			FROM = {
				prestige = 150
				piety = -150
			}
		}
		if = { 
			limit = { tier = KING }
			FROM = {
				prestige = 300
				piety = -300
			}
		}
		if = { 
			limit = { tier = EMPEROR }
			FROM = {
				prestige = 500
				piety = -500
			}
		}
	}
}

#delayed from on_birth event. Mother develops bond with child.
character_event = {
	id = HFP.20599
	desc = {
		text = EVTDESCHFPA20599
		trigger = {
			NOT = { has_character_flag = survivor_mom }
			NOT = { trait = kind } 
		}
	}
	desc = {
		text = EVTDESCHFPB20599
		trigger = {
			NOT = { has_character_flag = survivor_mom }
			trait = kind
		}
	}
	desc = {
		text = EVTDESCHFPC20599
		trigger = {
			has_character_flag = survivor_mom
			NOT = { trait = kind }
		}
	}
	desc = {
		text = EVTDESCHFPD20599
		trigger = {
			has_character_flag = survivor_mom
			trait = kind
		}
	}
	picture = GFX_evt_birth

	trigger = { 
		prisoner = no
		NOT = { trait = incapable }
		FROM = { 
			is_alive = yes 
			prisoner = no
			NOT = { trait = incapable }
			NOT = { trait = sickly }
			OR = { 
				host = { character = ROOT }
				at_location = ROOT
				guardian = { character = ROOT }
			}
		} 
	}
	is_triggered_only = yes
	
	option = { #In love
		name = EVTOPTAHFP20599
		trigger = { NOT = { trait = cruel } }
		custom_tooltip = { text = tooltip_20599_A }
		add_character_modifier = { 
			modifier = breastfeeding_infant 
			years = 2
		}
		opinion = { 
			modifier = opinion_motherly_love 
			who = FROM
			years = 10
		}
		random_list = { 
			20 = { FROM = { change_diplomacy = 1 } }
			20 = { FROM = { change_martial = 1 } }
			20 = { FROM = { change_stewardship = 1 } }
			20 = { FROM = { change_intrigue = 1 } }
			20 = { FROM = { change_learning = 1 } }
		}
		random = { 
			chance = 30
			if = { 
				limit = { trait = kind } 
				piety = 25
			}
			if = { 
				limit = { NOT = { trait = kind } } 
				add_trait = kind
				hidden_tooltip = { character_event = { id = 38268 } } 
			}
		}
		hidden_tooltip = { 
			FROM = { health = 0.2 } 
			gain_weight_small_effect = yes
		}
		ai_chance = { factor = 50 }
	}
	option = { #Just relieved
		name = EVTOPTBHFP20599
		custom_tooltip = { text = tooltip_20599_B }
		ai_chance = { factor = 50 }
	}
	option = { #Annoyed
		name = EVTOPTCHFP20599
		custom_tooltip = { text = tooltip_20599_C }
		trigger = { 
			OR = { 
				trait = cruel
				has_character_flag = survivor_mom
			}
		}
		hidden_tooltip = { 
			FROM = { health = -0.2 } 
			balance_weight_small_effect = yes
		}
		opinion = { 
			modifier = opinion_upset_mother 
			who = FROM
			years = 10
		}
		random = { 
			chance = 30
			if = { 
				limit = { trait = cruel } 
				piety = -25
			}
			if = { 
				limit = { NOT = { trait = cruel } } 
				add_trait = cruel
				hidden_tooltip = { character_event = { id = 38259 } } 
			}
		}
		ai_chance = { factor = 40 } 
	}
}

#delayed from on_birth event (of a few years). Father develops bond with child.
character_event = {
	id = HFP.20000
	desc = {
		text = EVTDESCHFPA20000
		trigger = {
			NOT = { trait = kind }
		}
	}
	desc = {
		text = EVTDESCHFPB20000
		trigger = {
			trait = kind
		}
	}
	picture = GFX_evt_family

	trigger = { 
		prisoner = no
		NOT = { trait = incapable }
		FROM = { 
			is_alive = yes 
			prisoner = no
			NOT = { trait = sickly }
			NOT = { trait = bastard }
			NOT = { trait = incapable }
			OR = { 
				host = { character = ROOT }
				at_location = ROOT
				guardian = { character = ROOT }
			}
		} 
	}
	is_triggered_only = yes
	
	option = { #In love
		name = EVTOPTAHFP20000
		trigger = { NOT = { trait = cruel } }
		custom_tooltip = { text = tooltip_20000_A }
		opinion = { 
			modifier = opinion_fatherly_love 
			who = FROM
			years = 10
		}
		random_list = { 
			20 = { FROM = { change_diplomacy = 1 } }
			20 = { FROM = { change_martial = 1 } }
			20 = { FROM = { change_stewardship = 1 } }
			20 = { FROM = { change_intrigue = 1 } }
			20 = { FROM = { change_learning = 1 } }
		}
		random = { 
			chance = 30
			if = { 
				limit = { trait = kind } 
				piety = 25
			}
			if = { 
				limit = { NOT = { trait = kind } } 
				add_trait = kind
				hidden_tooltip = { character_event = { id = 38268 } } 
			}
		}
		hidden_tooltip = { 
			FROM = { health = 0.2 } 
			gain_weight_small_effect = yes
		}
		ai_chance = { factor = 50 }
	}
	option = { #Annoyed
		name = EVTOPTBHFP20000
		custom_tooltip = { text = tooltip_20000_B }
		trigger = { NOT = { trait = kind } }
		hidden_tooltip = { 
			FROM = { health = -0.2 } 
			balance_weight_small_effect = yes
		}
		opinion = { 
			modifier = opinion_upset_father 
			who = FROM
			years = 10
		}
		random = { 
			chance = 20
			if = { 
				limit = { trait = cruel } 
				piety = -25
			}
			if = { 
				limit = { NOT = { trait = cruel } } 
				add_trait = cruel
				hidden_tooltip = { character_event = { id = 38259 } } 
			}
		}
		ai_chance = { factor = 50 } 
	}
}

#Mother drunk/drugged during pregnancy, child is growing dumb.
character_event = {
	id = HFP.20001
	desc = {
		text = EVTDESCHFPA20001
		trigger = {
			FROM = { has_character_flag = flag_drunk_birth }
		}
	}
	desc = {
		text = EVTDESCHFPB20001
		trigger = {
			FROM = { has_character_flag = flag_drugged_birth }
		}
	}
	picture = GFX_evt_birth

	trigger = { 
		FROM = { 
			is_alive = yes 
			NOT = { trait = incapable }
			OR = { 
				host = { character = ROOT }
				at_location = ROOT
				guardian = { character = ROOT }
			}
			OR = { 
				trait = slow
				trait = imbecile
			}
		} 
	}
	is_triggered_only = yes
	
	option = { # Concerned, try stopping the bad habit if still into it.
		name = {
			text = EVTOPTAHFP20001_A 	#Still drinking
			trigger = { 
				trait = drunkard
				FROM = {
					has_character_flag = flag_drunk_birth
				}
			}
		}
		name = {
			text = EVTOPTAHFP20001_B 	#Still smoking
			trigger = { 
				has_character_modifier = hashish_addict
				FROM = {
					has_character_flag = flag_drugged_birth
				}
			}
		}
		name = {
			text = EVTOPTAHFP20001_C 	#Stopped drinking
			trigger = { 
				NOT = { trait = drunkard }
				FROM = {
					has_character_flag = flag_drunk_birth
				}
			}
		}
		name = {
			text = EVTOPTAHFP20001_D 	#Stopped smoking
			trigger = { 
				NOT = { has_character_modifier = hashish_addict }
				FROM = {
					has_character_flag = flag_drugged_birth
				}
			}
		}
		tiered_piety_negative_effect = yes
		tooltip = { 
			FROM = {	
				father = {
					opinion = { 
						modifier = opinion_irresponsible_mother
						who = ROOT
						years = 20
					}
				}	
			}
		}
		if = { 
			limit = {
				has_character_modifier = hashish_addict 
				FROM = { has_character_flag = flag_drugged_birth } 
			} 
			if = { 
				limit = { NOT = { has_character_modifier = withdrawal_symptoms } }
				add_character_modifier = {
					name = withdrawal_symptoms
					duration = 150
				}
			}
			random = {
				chance = 20
				add_trait = stressed
				remove_character_modifier = hashish_addict
				if = { 
					limit = { has_character_modifier = withdrawal_symptoms }
					remove_character_modifier = withdrawal_symptoms
				}
			}
		}
		if = { 
			limit = {
				trait = drunkard
				FROM = { has_character_flag = flag_drunk_birth } 
			} 
			random = {
				chance = 20
				add_trait = stressed
				remove_trait = drunkard
			}
		}
	}
	option = { # Not concerned but still addicted.
		name = EVTOPTBHFP20001 	
		trigger = { 
			NOT = { trait = kind }
			OR = { 
				AND = { 
					trait = drunkard
					FROM = { has_character_flag = flag_drunk_birth } 
				} 
				AND = { 
					has_character_modifier = hashish_addict 
					FROM = { has_character_flag = flag_drugged_birth } 
				} 
			}
		}
	}
	after = {
		FROM = { 
			clr_character_flag = flag_drugged_birth
			clr_character_flag = flag_drunk_birth
		}
	}
}

#Father: Mother drunk/drugged during pregnancy, child is growing dumb.
character_event = {
	id = HFP.20002
	desc = {
		text = EVTDESCHFPA20002
		trigger = {
			FROM = { has_character_flag = flag_drunk_birth }
		}
	}
	desc = {
		text = EVTDESCHFPB20002
		trigger = {
			FROM = { has_character_flag = flag_drugged_birth }
		}
	}
	picture = GFX_evt_birth

	trigger = { 
		FROM = { 
			is_alive = yes 
			NOT = { trait = incapable }
			NOT = { trait = bastard }
			OR = { 
				host = { character = ROOT }
				at_location = ROOT
				guardian = { character = ROOT }
			}
			OR = { 
				trait = slow
				trait = imbecile
			}
		} 
	}
	is_triggered_only = yes
	
	option = { 
		name = {
			text = EVTOPTAHFP20002_A 	#Still drinking
			trigger = { 
				FROM = { 
					mother = { 
						trait = drunkard 
						is_alive = yes 
					}
					has_character_flag = flag_drunk_birth
				}
			}
		}
		name = {
			text = EVTOPTAHFP20002_B 	#Still smoking
			trigger = { 
				FROM = {
					mother = { 
						has_character_modifier = hashish_addict 
						is_alive = yes 
					}
					has_character_flag = flag_drugged_birth
				}
			}
		}
		name = {
			text = EVTOPTAHFP20002_C 	#Mother no longer addicted.
			trigger = { 
				FROM = {
					mother = { 
						is_alive = yes
						NOT = { trait = drunkard } 
						NOT = { has_character_modifier = hashish_addict } 
					}
				}
			}
		}
		name = {
			text = EVTOPTAHFP20002_D 	#Mother died in the meantime
			trigger = { 
				FROM = {
					mother = { 
						is_alive = no 
					}
				}
			}
		}
		FROM = { 
			mother = { 
				reverse_opinion = { 
					modifier = opinion_irresponsible_mother
					who = ROOT
					years = 20
				}
			}
		}
	}
}

##############################################

#Pregnancy glow
character_event = {
	id = HFP.20003
	desc = {
		text = EVTDESCHFPA20003
		trigger = {
			is_attractive_trigger = yes
		}
	}
	desc = {
		text = EVTDESCHFPB20003
		trigger = {
			NOR = {
				is_attractive_trigger = yes
				is_unattractive_trigger = yes
			}
		}
	}
	desc = {
		text = EVTDESCHFPC20003
		trigger = {
			is_unattractive_trigger = yes
		}
	}
	picture = GFX_evt_homage_hf

	trigger = { 
		trait = pregnant
		NOT = { trait = incapable }
		NOT = { trait = hard_pregnancy }
		NOT = { trait = troubled_pregnancy }
	}

	is_triggered_only = yes
	
	option = { #Bask in it
		name = EVTOPTAHFP20003
		tiered_prestige_reward_effect = yes
		add_character_modifier = { 
			modifier = mother_pregnancy_glow
			duration = 80 
		}
		if = { 
			limit = { is_main_spouse = yes } 
			hidden_tooltip = { spouse = { character_event = { id = HFP.20004 days = 15 random = 5 } } } 
		}
		ai_chance = { 
			factor = 75 
			modifier = { 
				factor = 0.5
				trait = shy
			} 
			modifier = { 
				factor = 0.5
				trait = humble
			}
		} 
	}

	option = { #Be humble about it
		name = EVTOPTBHFP20003
		if = { 
			limit = { trait = proud }
			random = { 
				chance = 30
				remove_trait = proud 
				hidden_tooltip = { character_event = { id = 38300 } }
				break = yes
			}
		}
		if = { 
			limit = { 
				NOR = { 
					trait = proud 
					trait = humble 
				} 
			}
			random = { 
				chance = 30
				add_trait = humble 
				hidden_tooltip = { character_event = { id = 38260 } }
				break = yes
			}
		}
		if = { 
			limit = { trait = humble }
			tiered_piety_reward_effect = yes
		}
		ai_chance = { 
			factor = 25
			modifier = { 
				factor = 0.5
				trait = gregarious
			} 
			modifier = { 
				factor = 0.5
				trait = proud
			}
		}
	}
}

#Pregnancy glow - Spouse notified
character_event = {
	id = HFP.20004
	desc = {
		text = EVTDESCHFPA20004
		trigger = {
			FROM = { 
				is_attractive_trigger = yes
			}
		}
	}
	desc = {
		text = EVTDESCHFPB20004
		trigger = {
			FROM = {
				NOR = {
					is_attractive_trigger = yes
					is_unattractive_trigger = yes
				}
			}
		}
	}
	desc = {
		text = EVTDESCHFPC20004
		trigger = {
			FROM = {
				is_unattractive_trigger = yes
			}
		}
	}
	picture = GFX_evt_homage_hf

	trigger = { 
		FROM = { is_alive = yes is_married = ROOT }  
	} 

	is_triggered_only = yes
	
	option = { #Appreciate it
		name = EVTOPTAHFP20004
		tiered_piety_negative_effect = yes
		tooltip = {
			FROM = {
				show_scope_change = no 
				opinion = { 
					who = ROOT 
					modifier = opinion_flattered 
					years = 5
				}
			}
		}
		hidden_tooltip = { FROM = { character_event = { id = HFP.20029 } } }
		if = { 
			limit = { trait = celibate }
			remove_trait = celibate
		}
		if = { 
			limit = { trait = chaste }
			random = { 
				chance = 25
				remove_trait = chaste 
				hidden_tooltip = { character_event = { id = 38303 } }
				break = yes
			}
		}
		if = { 
			limit = { 
				NOR = { 
					trait = lustful 
					trait = chaste 
				} 
			}
			random = { 
				chance = 25
				add_trait = lustful 
				hidden_tooltip = { character_event = { id = 38272 } }
				break = yes
			}
		}
		ai_chance = { 
			factor = 50
			modifier = { 
				factor = 1.5
				trait = lustful
			}
			modifier = { 
				factor = 0.5
				trait = chaste
			}
			modifier = { 
				factor = 0.01
				trait = celibate
			}
			modifier = { 
				factor = 0.25
				FROM = { has_character_modifier = incestuous_adulteress }
			}
			modifier = { 
				factor = 0.25
				FROM = { has_character_modifier = adulteress }
			}
		}
	}
	option = { #Not appropriate
		name = EVTOPTBHFP20004
		if = { 
			limit = { trait = lustful }
			random = { 
				chance = 25
				remove_trait = lustful 
				break = yes
			}
		}
		if = { 
			limit = { 
				NOR = { 
					trait = lustful 
					trait = chaste 
				} 
			}
			random = { 
				chance = 25
				add_trait = chaste 
				hidden_tooltip = { character_event = { id = 38274 } }
				break = yes
			}
		}
		if = { 
			limit = { trait = chaste }
			tiered_piety_reward_effect = yes
		}
		ai_chance = { 
			factor = 50
			modifier = { 
				factor = 1.5
				trait = chaste
			}
			modifier = { 
				factor = 0.5
				trait = lustful
			}
			modifier = { 
				factor = 0.1
				trait = hedonist
			}
		}
	}
}

#Pregnancy glow - Spouse is flattering you.
character_event = {
	id = HFP.20029
	desc = EVTDESCHFPA20029
	picture = GFX_evt_homage_hf

	is_triggered_only = yes
	
	option = { 
		name = EVTOPTAHFP20029
		opinion = { 
			who = FROM 
			modifier = opinion_flattered 
			years = 2
		}
	}
}

##############################################

#The Gossiping - Only for rulers or spouses of rulers (COUNT or higher)
#Husband receives event to call other women to entertain wife.
character_event = {
	id = HFP.20005
	desc = EVTDESCHFPA20005
	picture = GFX_evt_princess_byzantine

	trigger = { 
		FROM = { 
			trait = pregnant
			is_married = ROOT
			is_alive = yes
			NOR = {
				trait = incapable
				trait = troubled_pregnancy
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				trait = travelling
			}
		}
	}

	is_triggered_only = yes
	
	option = { #Call relatives to entertain
		name = EVTOPTAHFP20005 
		custom_tooltip = { text = tooltip_HFP20005_A } 
		trigger = {
			OR = {
				ROOT = { 
					is_ruler = yes
					any_courtier_or_vassal = { 
						OR = { 
							dynasty = FROM
							dynasty = ROOT 
						}
						is_inaccessible_trigger = no
						NOT = { trait = incapable }
						NOT = { character = FROM } 
						NOT = { character = ROOT }
						prisoner = no
						is_female = yes
						is_adult = yes
						count = 2
					}
				}
				FROM = { 
					is_ruler = yes
					any_courtier_or_vassal = { 
						OR = { 
							dynasty = FROM
							dynasty = ROOT 
						}
						is_inaccessible_trigger = no
						NOT = { trait = incapable }
						NOT = { character = FROM } 
						NOT = { character = ROOT }
						prisoner = no
						is_female = yes
						is_adult = yes
						count = 2
					}
				}
			}
		}
		prestige = 30
		piety = 10
		tooltip = {
			FROM = {
				show_scope_change = no
				add_character_modifier = {
					name = mother_comforted
					duration = 60
					stacking = yes
				}
				opinion = { 
					who = ROOT 
					modifier = opinion_swayed_2 
					years = 2
				}
			}
		}
		hidden_tooltip = { 
			FROM = { 
				set_character_flag = flag_gossiping_relatives
				character_event = { id = HFP.20006 days = 10 random = 15 } #Notification
			}
			if = { #If husband is ruler, pick from his court.
				limit = { is_ruler = yes }
				#Ping player first. 
				random_courtier_or_vassal = { 
					limit = { 
						OR = { 
							dynasty = FROM
							dynasty = ROOT 
						}
						is_inaccessible_trigger = no
						NOT = { trait = incapable }
						NOT = { character = FROM } 
						NOT = { character = ROOT }
						prisoner = no
						is_female = yes
						is_adult = yes
						ai = no
					}
					character_event = { id = HFP.20010 days = 5 random = 5 }
					break = yes
				}
				#Otherwise random AI.
				random_courtier_or_vassal = { 
					limit = { 
						OR = { 
							dynasty = FROM
							dynasty = ROOT 
						}
						is_inaccessible_trigger = no
						NOT = { trait = incapable }
						NOT = { character = FROM } 
						NOT = { character = ROOT }
						prisoner = no
						is_female = yes
						is_adult = yes
						ai = yes
					}
					character_event = { id = HFP.20010 days = 5 random = 5 }
					break = yes
				}	
			}
			if = { #If husband is not ruler, pick from her court.
				limit = { is_ruler = no }
				#Ping player first. 
				FROM = { 
					random_courtier_or_vassal = { 
						limit = { 
							OR = { 
								dynasty = FROM
								dynasty = ROOT 
							}
							is_inaccessible_trigger = no
							NOT = { trait = incapable }
							NOT = { character = FROM } 
							NOT = { character = ROOT }
							prisoner = no
							is_female = yes
							is_adult = yes
							ai = no
						}
						character_event = { id = HFP.20010 days = 5 random = 5 }
						break = yes
					}
				}
				#Otherwise random AI.
				FROM = { 
					random_courtier_or_vassal = { 
						limit = { 
							OR = { 
								dynasty = FROM
								dynasty = ROOT 
							}
							is_inaccessible_trigger = no
							NOT = { trait = incapable }
							NOT = { character = FROM } 
							NOT = { character = ROOT }
							prisoner = no
							is_female = yes
							is_adult = yes
							ai = no
						}
						character_event = { id = HFP.20010 days = 5 random = 5 }
						break = yes
					}
				}	
			}
		}
		ai_chance = { 
			factor = 100 
			modifier = { 
				factor = 0.1 
				trait = cruel
			}
			modifier = { 
				factor = 0.1 
				trait = envious
			}
			modifier = { 
				factor = 0.25 
				FROM = { has_character_modifier = adulteress }
			}
			modifier = { 
				factor = 0.25 
				FROM = { has_character_modifier = incestuous_adulteress }
			}
		}
	}
	option = { #Hire servants
		name = EVTOPTBHFP20005
		custom_tooltip = { text = tooltip_HFP20005_B } 
		hidden_tooltip = { FROM = { character_event = { id = HFP.20006 days = 10 random = 15 } } }
		scaled_wealth = { value = -0.05 min = -10 max = -75 }
		piety = 10
		tooltip = {
			FROM = {
				show_scope_change = no
				add_character_modifier = {
					name = mother_comforted
					duration = 60
					stacking = yes
				}
				opinion = { 
					who = ROOT 
					modifier = opinion_swayed_2 
					years = 2
				}
			}
		}
		ai_chance = { 
			factor = 50 
			modifier = { 
				factor = 0.5 
				trait = greedy
			}
			modifier = { 
				factor = 0.1 
				trait = cruel
			}
			modifier = { 
				factor = 0.1 
				trait = envious
			}
			modifier = { 
				factor = 0.25 
				FROM = { has_character_modifier = adulteress }
			}
			modifier = { 
				factor = 0.25 
				FROM = { has_character_modifier = incestuous_adulteress }
			}
		}
	}
	option = { #Do nothing
		name = EVTOPTCHFP20005
		piety = -10
		ai_chance = { 
			factor = 10 
			modifier = { 
				factor = 0.1 
				trait = kind
			}
			modifier = { 
				factor = 0.1 
				trait = charitable
			}
			modifier = { 
				factor = 2
				trait = cruel
			}
			modifier = { 
				factor = 2
				trait = envious
			}
			modifier = { 
				factor = 3
				FROM = { has_character_modifier = adulteress }
			}
			modifier = { 
				factor = 3
				FROM = { has_character_modifier = incestuous_adulteress }
			}
		}
	}
}

#Mother: gossiping has been organized.
character_event = {
	id = HFP.20006
	desc = {
		text = EVTDESCHFPA20006
		trigger = {
			has_character_flag = flag_gossiping_relatives
		}
	}
	desc = {
		text = EVTDESCHFPB20006
		trigger = {
			NOT = { has_character_flag = flag_gossiping_relatives }
		}
	}
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	
	trigger = { 
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
	}

	option = { 
		name = EVTOPTAHFP20006
		trigger = { trait = gregarious }
		tooltip_info = gregarious
		if = { 
			limit = { trait = depressed } 
			remove_trait = depressed
		}
		add_character_modifier = {
			name = mother_comforted
			duration = 60
			stacking = yes
		}
		opinion = { 
			who = FROM 
			modifier = opinion_swayed_2 
			years = 2
		}
	}
	option = { 
		name = EVTOPTBHFP20006
		trigger = { NOT = { trait = gregarious } }
		add_character_modifier = {
			name = mother_comforted
			duration = 60
			stacking = yes
		}
		opinion = { 
			who = FROM 
			modifier = opinion_swayed_2 
			years = 2
		}	
	}
	after = { 
		clr_character_flag = flag_gossiping_relatives 
		hidden_tooltip = { 
			#Fallback events if the mother either has no relative or if the random relative pinged either refused the gossiping or died in the meantime.
		random_list = { 
				#Mother enjoys herself, either becomes gregarious or trusting (patient offers chance for +1 learning).
				45 = { character_event = { id = HFP.20007 days = 20 random = 5 } } 
				#Mother not enjoying herself, either becomes envious or shy (deceitful offers chance for +1 intrigue).
				10 = { character_event = { id = HFP.20008 days = 20 random = 5 } } 
				#Mother pampered, either becomes content or gluttonous (diligent offers chance for +1 diplomacy)
				45 = { character_event = { id = HFP.20009 days = 20 random = 5 } } 
			}
		}
	}
}

#Mother: enjoying the gossiping.
character_event = {
	id = HFP.20007
	desc = EVTDESCHFPA20007
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	
	trigger = { 
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
		NOT = { has_character_modifier = pregnancy_gossip_cooldown }
	}

	option = { #Listen and learn
		name = EVTOPTAHFP20007
		trigger = { trait = patient }
		tooltip_info = patient
		change_learning = 1
		ai_chance = { factor = 80 }
	}
	option = { #Becoming gregarious
		name = EVTOPTBHFP20007
		if = { 
			limit = { trait = shy } 
			random = { 
				chance = 50
				remove_trait = shy
				hidden_tooltip = { character_event = { id = 38295 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = shy
					trait = gregarious 
				}  
			} 
			random = { 
				chance = 50
				add_trait = gregarious
				hidden_tooltip = { character_event = { id = 38265 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = gregarious } 
			random = { 
				chance = 50
				change_diplomacy = 1 
			}
			break = yes
		}
		ai_chance = { factor = 50 }
	}
	option = { #Relaxed and trusting
		name = EVTOPTCHFP20007
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
		if = { 
			limit = { trait = paranoid } 
			random = { 
				chance = 50
				remove_trait = paranoid
				hidden_tooltip = { character_event = { id = 38305 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = trusting
					trait = paranoid 
				}  
			} 
			random = { 
				chance = 50
				add_trait = trusting
				hidden_tooltip = { character_event = { id = 38250 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = trusting } 
			random = { 
				chance = 50
				change_diplomacy = 1 
			}
			break = yes
		}
		ai_chance = { factor = 20 }
	}
}

#Mother: not enjoying the gossiping.
character_event = {
	id = HFP.20008
	desc = EVTDESCHFPA20008
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	
	trigger = { 
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
		NOT = { has_character_modifier = pregnancy_gossip_cooldown }
	}

	option = { #Listen and plot
		name = EVTOPTAHFP20008
		trigger = { trait = deceitful }
		tooltip_info = deceitful
		change_intrigue = 1
		ai_chance = { factor = 80 }
	}
	option = { #Envy
		name = EVTOPTBHFP20008
		if = { 
			limit = { trait = kind } 
			random = { 
				chance = 50
				remove_trait = kind
				hidden_tooltip = { character_event = { id = 38307 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = kind
					trait = envious 
				}  
			} 
			random = { 
				chance = 50
				add_trait = envious
				hidden_tooltip = { character_event = { id = 38271 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = envious } 
			random = { 
				chance = 50
				change_intrigue = 1 
			}
			break = yes
		}
		ai_chance = { factor = 50 }
	}
	option = { #Need some space
		name = EVTOPTCHFP20008
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
		if = { 
			limit = { trait = gregarious } 
			random = { 
				chance = 50
				remove_trait = gregarious
				hidden_tooltip = { character_event = { id = 38297 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = shy
					trait = gregarious 
				}  
			} 
			random = { 
				chance = 50
				add_trait = shy
				hidden_tooltip = { character_event = { id = 38263 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = shy } 
			random = { 
				chance = 50
				change_intrigue = 1 
			}
			break = yes
		}
		ai_chance = { factor = 20 }
	}
}

#Mother: pampered during gossiping.
character_event = {
	id = HFP.20009
	desc = EVTDESCHFPA20009
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	
	trigger = { 
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
		NOT = { has_character_modifier = pregnancy_gossip_cooldown }
	}

	option = { #Do your part
		name = EVTOPTAHFP20009
		trigger = { trait = diligent }
		tooltip_info = diligent
		change_stewardship = 1
		ai_chance = { factor = 80 }
	}
	option = { #Becoming content
		name = EVTOPTBHFP20009
		if = { 
			limit = { trait = ambitious } 
			random = { 
				chance = 50
				remove_trait = ambitious
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = content
					trait = ambitious 
				}  
			} 
			random = { 
				chance = 50
				add_trait = content
				hidden_tooltip = { character_event = { id = 38279 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = content } 
			random = { 
				chance = 50
				change_stewardship = 1 
			}
			break = yes
		}
		ai_chance = { factor = 40 }
	}
	option = { #Becoming gluttonous
		name = EVTOPTCHFP20009
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
		if = { 
			limit = { trait = temperate } 
			random = { 
				chance = 50
				remove_trait = temperate
				hidden_tooltip = { character_event = { id = 38276 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = temperate
					trait = gluttonous 
				}  
			} 
			random = { 
				chance = 50
				add_trait = gluttonous
				gain_weight_small_effect = yes
				weight_trait_check_effect = yes
				hidden_tooltip = { character_event = { id = 38277 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = gluttonous } 
			random = { 
				chance = 50
				change_diplomacy = 1 
				gain_weight_medium_effect = yes
				weight_trait_check_effect = yes
			}
			break = yes
		}
		ai_chance = { factor = 20 }
	}
}

#Relative: you have been invited to the gossiping.
character_event = {
	id = HFP.20010
	desc = EVTDESCHFPA20010
	picture = GFX_evt_princess_byzantine
	show_from_from = yes

	is_triggered_only = yes
	
	trigger = { 
		FROMFROM = {
			is_alive = yes 
			NOT = { trait = incapable }
			NOT = { trait = troubled_pregnancy }
		}
	}

	option = { #Very well
		name = EVTOPTAHFP20010
		hidden_tooltip = { 
			random_list = { 
					90 = { character_event = { id = HFP.20011 days = 12 random = 5 } } #Gossip imput
					10 = { 
						modifier = { 
							factor = 0
							num_of_friends = 3
						}
						modifier = { 
							factor = 0
							is_friend = FROMFROM
						}
						modifier = { 
							factor = 0
							is_rival = FROMFROM
						}
						modifier = { 
							factor = 0
							is_lover = FROMFROM
						}
						modifier = { 
							factor = 0
							NOT = {
								opinion = {
									who = FROMFROM
									value = -30
								}  
							}
						}
						modifier = { 
							factor = 0
							FROMFROM = { num_of_friends = 3 }
						}
						modifier = { 
							factor = 1.5
							trait = kind
						}
						modifier = { 
							factor = 1.5
							trait = charitable
						}
						modifier = { 
							factor = 1.5
							trait = gregarious
						}
						modifier = { 
							factor = 0.5
							trait = shy
						}
						modifier = { 
							factor = 0.5
							FROMFROM = { trait = shy }
						}
						FROMFROM = { character_event = { id = HFP.20016 days = 12 random = 5 } } #Becoming friends with mother.
					}
			}  
		}
		ai_chance = { factor = 80 }
	}
	option = { #No time for it.
		name = EVTOPTBHFP20010
		trigger = { 
			OR = {
				ai = no
				trait = shy
				trait = cruel
			} 
		}
		piety = -5
		FROM = { 
			show_scope_change = no
			opinion = { 
				who = ROOT
				modifier = opinion_disappointed
				years = 5 
			}
		}
		FROMFROM = { 
			show_scope_change = no
			opinion = { 
				who = ROOT
				modifier = opinion_offended
				years = 5 
			}
		}
		ai_chance = { factor = 20 }
	}
}

#Relative: gossiping input.
character_event = {
	id = HFP.20011
	desc = EVTDESCHFPA20011
	picture = GFX_evt_princess_byzantine
	show_from_from_from = yes

	is_triggered_only = yes
	
	trigger = { 
		FROMFROMFROM = {
			is_alive = yes 
			NOT = { trait = incapable }
			NOT = { trait = troubled_pregnancy }
		}
	}
	immediate = { 
		FROMFROMFROM = { 
			add_character_modifier = { #Prevents the solo-events from firing instead of these.
				name = pregnancy_gossip_cooldown
				hidden = yes 
				duration = 60 
			}
		}
	}

	option = { #Be talkative
		name = EVTOPTAHFP20011
		custom_tooltip = { text = tooltip_evt20011_A }
		hidden_tooltip = { FROMFROMFROM = { character_event = { id = HFP.20012 } } }
		ai_chance = { 
			factor = 40 
			modifier = { 
				factor = 0.1 
				is_rival = FROMFROMFROM
			}
			modifier = { 
				factor = 1.5 
				trait = gregarious
			}
			modifier = { 
				factor = 1.5 
				trait = socializer
			}
			modifier = { 
				factor = 1.5 
				trait = patient
			}
			modifier = { 
				factor = 1.5 
				trait = shrewd
			}
		}
	}
	option = { #Be supportive
		name = EVTOPTBHFP20011
		custom_tooltip = { text = tooltip_evt20011_B }
		hidden_tooltip = { FROMFROMFROM = { character_event = { id = HFP.20013 } } }
		ai_chance = { 
			factor = 40 
			modifier = { 
				factor = 0.1 
				is_rival = FROMFROMFROM
			}
			modifier = { 
				factor = 0.1 
				is_rival = FROMFROMFROM
			}
			modifier = { 
				factor = 1.5 
				trait = kind
			}
			modifier = { 
				factor = 1.5 
				trait = hedonist
			}
			modifier = { 
				factor = 1.5 
				trait = charitable
			}
			modifier = { 
				factor = 1.5 
				trait = dull
			}
		}
	}
	option = { #Be mean
		name = EVTOPTCHFP20011
		custom_tooltip = { text = tooltip_evt20011_C }
		hidden_tooltip = { FROMFROMFROM = { character_event = { id = HFP.20014 } } }
		ai_chance = { 
			factor = 20 
			modifier = { 
				factor = 0.1 
				is_friend = FROMFROMFROM
			}
			modifier = { 
				factor = 0.1 
				is_lover = FROMFROMFROM
			}
			modifier = { 
				factor = 0.1 
				is_rival = FROMFROMFROM
			}
			modifier = { 
				factor = 1.5 
				trait = cruel
			}
			modifier = { 
				factor = 1.5 
				trait = envious
			}
			modifier = { 
				factor = 1.5 
				trait = proud
			}
			modifier = { 
				factor = 1.5 
				trait = stubborn
			}
		}
	}
}

#Mother: enjoying the gossiping. - Relative version
character_event = {
	id = HFP.20012
	desc = EVTDESCHFPA20012
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	
	trigger = { 
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
	}

	option = { #Listen and learn
		name = EVTOPTAHFP20007
		trigger = { trait = patient }
		tooltip_info = patient
		change_learning = 1
		set_character_flag = mother_gossip_listening
		ai_chance = { factor = 80 }
	}
	option = { #Becoming gregarious
		name = EVTOPTBHFP20007
		set_character_flag = mother_gossip_talking
		if = { 
			limit = { trait = shy } 
			random = { 
				chance = 50
				remove_trait = shy
				hidden_tooltip = { character_event = { id = 38295 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = shy
					trait = gregarious 
				}  
			} 
			random = { 
				chance = 50
				add_trait = gregarious
				hidden_tooltip = { character_event = { id = 38265 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = gregarious } 
			random = { 
				chance = 50
				change_diplomacy = 1 
			}
			break = yes
		}
		ai_chance = { factor = 50 }
	}
	option = { #Relaxed and trusting
		name = EVTOPTCHFP20007
		set_character_flag = mother_gossip_trusting
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
		if = { 
			limit = { trait = paranoid } 
			random = { 
				chance = 50
				remove_trait = paranoid
				hidden_tooltip = { character_event = { id = 38305 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = trusting
					trait = paranoid 
				}  
			} 
			random = { 
				chance = 50
				add_trait = trusting
				hidden_tooltip = { character_event = { id = 38250 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = trusting } 
			random = { 
				chance = 50
				change_diplomacy = 1 
			}
			break = yes
		}
		ai_chance = { factor = 20 }
	}
	after = { hidden_tooltip = { FROM = { character_event = { id = HFP.20015 } } } } #Notification to relative
}

#Mother: not enjoying the gossiping. - Relative version
character_event = {
	id = HFP.20013
	desc = EVTDESCHFPA20013
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	
	trigger = { 
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
	}

	option = { #Listen and plot
		name = EVTOPTAHFP20008
		set_character_flag = mother_gossip_plotting
		trigger = { trait = deceitful }
		tooltip_info = deceitful
		change_intrigue = 1
		ai_chance = { factor = 80 }
	}
	option = { #Envy
		name = EVTOPTBHFP20008
		set_character_flag = mother_gossip_envious
		if = { 
			limit = { trait = kind } 
			random = { 
				chance = 50
				remove_trait = kind
				hidden_tooltip = { character_event = { id = 38307 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = kind
					trait = envious 
				}  
			} 
			random = { 
				chance = 50
				add_trait = envious
				hidden_tooltip = { character_event = { id = 38271 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = envious } 
			random = { 
				chance = 50
				change_intrigue = 1 
			}
			break = yes
		}
		ai_chance = { factor = 50 }
	}
	option = { #Need some space
		name = EVTOPTCHFP20008
		set_character_flag = mother_gossip_shy
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
		if = { 
			limit = { trait = gregarious } 
			random = { 
				chance = 50
				remove_trait = gregarious
				hidden_tooltip = { character_event = { id = 38297 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = shy
					trait = gregarious 
				}  
			} 
			random = { 
				chance = 50
				add_trait = shy
				hidden_tooltip = { character_event = { id = 38263 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = shy } 
			random = { 
				chance = 50
				change_intrigue = 1 
			}
			break = yes
		}
		ai_chance = { factor = 20 }
	}
	after = { hidden_tooltip = { FROM = { character_event = { id = HFP.20015 } } } } #Notification to relative
}

#Mother: pampered during gossiping. - Relative version
character_event = {
	id = HFP.20014
	desc = EVTDESCHFPA20014
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	
	trigger = { 
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
	}

	option = { #Do your part
		name = EVTOPTAHFP20009
		set_character_flag = mother_gossip_learning
		trigger = { trait = diligent }
		tooltip_info = diligent
		change_learning = 1
		ai_chance = { factor = 80 }
	}
	option = { #Becoming content
		name = EVTOPTBHFP20009
		set_character_flag = mother_gossip_content
		if = { 
			limit = { trait = ambitious } 
			random = { 
				chance = 50
				remove_trait = ambitious
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = content
					trait = ambitious 
				}  
			} 
			random = { 
				chance = 50
				add_trait = content
				hidden_tooltip = { character_event = { id = 38279 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = content } 
			random = { 
				chance = 50
				change_stewardship = 1 
			}
			break = yes
		}
		ai_chance = { factor = 40 }
	}
	option = { #Becoming gluttonous
		name = EVTOPTCHFP20009
		set_character_flag = mother_gossip_gluttonous
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		}
		if = { 
			limit = { trait = temperate } 
			random = { 
				chance = 50
				remove_trait = temperate
				hidden_tooltip = { character_event = { id = 38276 } } 
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = temperate
					trait = gluttonous 
				}  
			} 
			random = { 
				chance = 50
				add_trait = gluttonous
				gain_weight_small_effect = yes
				weight_trait_check_effect = yes
				hidden_tooltip = { character_event = { id = 38277 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = gluttonous } 
			random = { 
				chance = 50
				change_diplomacy = 1 
				gain_weight_medium_effect = yes
				weight_trait_check_effect = yes
			}
			break = yes
		}
		ai_chance = { factor = 20 }
	}
	after = { hidden_tooltip = { FROM = { character_event = { id = HFP.20015 } } } } #Notification to relative
}

#Relative: notified of mother's reaction
character_event = {
	id = HFP.20015
	desc = {
		text = EVTDESCHFPA20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_listening
			}
		}
	}
	desc = {
		text = EVTDESCHFPB20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_talking
			}
		}
	}
	desc = {
		text = EVTDESCHFPC20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_trusting
			}
		}
	}
	desc = {
		text = EVTDESCHFPD20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_plotting
			}
		}
	}
	desc = {
		text = EVTDESCHFPE20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_envious
			}
		}
	}
	desc = {
		text = EVTDESCHFPF20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_shy
			}
		}
	}
	desc = {
		text = EVTDESCHFPG20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_learning
			}
		}
	}
	desc = {
		text = EVTDESCHFPH20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_content
			}
		}
	}
	desc = {
		text = EVTDESCHFPI20015
		trigger = {
			FROM = { 
				has_character_flag = mother_gossip_gluttonous
			}
		}
	}
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes


	option = {
		name = {
			text = EVTOPTAHFP20015_A
			trigger = {
				FROM = { has_character_flag = mother_gossip_listening }
			}
		}
		name = {
			text = EVTOPTAHFP20015_B
			trigger = {
				FROM = { has_character_flag = mother_gossip_talking }
			}
		}
		name = {
			text = EVTOPTAHFP20015_C
			trigger = {
				FROM = { has_character_flag = mother_gossip_trusting }
			}
		}
		name = {
			text = EVTOPTAHFP20015_D
			trigger = {
				FROM = { has_character_flag = mother_gossip_plotting }
			}
		}
		name = {
			text = EVTOPTAHFP20015_E
			trigger = {
				FROM = { has_character_flag = mother_gossip_envious }
			}
		}
		name = {
			text = EVTOPTAHFP20015_F
			trigger = {
				FROM = { has_character_flag = mother_gossip_shy }
			}
		}
		name = {
			text = EVTOPTAHFP20015_G
			trigger = {
				FROM = { has_character_flag = mother_gossip_learning }
			}
		}
		name = {
			text = EVTOPTAHFP20015_H
			trigger = {
				FROM = { has_character_flag = mother_gossip_content }
			}
		}
		name = {
			text = EVTOPTAHFP20015_I
			trigger = {
				FROM = { has_character_flag = mother_gossip_gluttonous }
			}
		}
		if = {
			limit = {
				FROM = { 
					has_character_flag = mother_gossip_listening #Mother took the reward instead.
				}
			}
			prestige = 20
			reverse_opinion = { 
				modifier = opinion_delighted
				who = FROM
				years = 3
			}
		}
		if = {
			limit = {
				FROM = { 
					OR = { 
						has_character_flag = mother_gossip_talking 
						has_character_flag = mother_gossip_trusting 
					} 
				}
			}
			random = {
				chance = 25 
				change_diplomacy = 1 
			}
			reverse_opinion = { 
				modifier = opinion_delighted
				who = FROM
				years = 3
			}
		}
		if = {
			limit = {
				FROM = { 
					has_character_flag = mother_gossip_plotting #Mother took the reward instead.
				}
			}
			prestige = 20
			reverse_opinion = { 
				modifier = opinion_irritated
				who = FROM
				years = 3
			}
		}
		if = {
			limit = {
				FROM = { 
					OR = { 
						has_character_flag = mother_gossip_envious 
						has_character_flag = mother_gossip_shy 
					} 
				}
			}
			random = {
				chance = 25 
				change_intrigue = 1 
			}
			reverse_opinion = { 
				modifier = opinion_irritated
				who = FROM
				years = 3
			}
		}
		if = {
			limit = {
				FROM = { 
					has_character_flag = mother_gossip_learning #Mother took the reward instead.
				}
			}
			piety = 10
			reverse_opinion = { 
				modifier = opinion_delighted
				who = FROM
				years = 3
			}
		}
		if = {
			limit = {
				FROM = { 
					OR = { 
						has_character_flag = mother_gossip_content 
						has_character_flag = mother_gossip_gluttonous 
					} 
				}
			}
			random = {
				chance = 25 
				change_stewardship = 1 
			}
			reverse_opinion = { 
				modifier = opinion_delighted
				who = FROM
				years = 3
			}
		}

		ai_chance = { factor = 80 }
	}
	after = {
		FROM = { 
			clr_character_flag = mother_gossip_listening
			clr_character_flag = mother_gossip_talking
			clr_character_flag = mother_gossip_trusting
			clr_character_flag = mother_gossip_plotting
			clr_character_flag = mother_gossip_envious
			clr_character_flag = mother_gossip_shy
			clr_character_flag = mother_gossip_learning
			clr_character_flag = mother_gossip_content
			clr_character_flag = mother_gossip_gluttonous
		}
	}
}
#Mother: becoming friend with relative
character_event = {
	id = HFP.20016
	desc = EVTDESCHFPA20016
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	
	trigger = { 
		FROM = { 
			is_alive = yes 
			NOT = { trait = incapable }
		}
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
	}

	option = { #Yes
		name = EVTOPTAHFP20016
		add_friend = FROM
		hidden_tooltip = { FROM = { character_event = { id = HFP.20017 } } } #Notification to relative
		ai_chance = { factor = 80 }
	}
	option = { #No
		name = EVTOPTBHFP20016
		trigger = { ai = no }
		ai_chance = { factor = 0 }
	}
}

#Relative: becoming friend with mother
character_event = {
	id = HFP.20017
	desc = EVTDESCHFPA20017
	picture = GFX_evt_princess_byzantine

	is_triggered_only = yes
	

	option = { #Yes
		name = EVTOPTAHFP20017
		add_friend = FROM
		ai_chance = { factor = 100 }
	}
}

##############################################
#Post-partum Churching of the Mother (one month after on_birth) - Only for Catholic Rulers (or main spouses of Rulers) who are married and have produced a(n apparently) legitimate child.

#Does mother want to go?
character_event = {
	id = HFP.20018
	desc = EVTDESCHFPA20018
	picture = GFX_evt_birth
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = { 
		OR = { 
			religion = catholic
			religion = orthodox
		}
		NOT = { trait = incapable }
		NOT = { trait = troubled_pregnancy }
	}

	immediate = { 
		FROM = { save_event_target_as = newborn_baby } #Needed later
	}
	
	option = { #Yes
		name = EVTOPTAHFP20018
		custom_tooltip = { text = tooltip_HFP20018_A } 
		hidden_tooltip = { character_event = { id = HFP.20019 } }
		ai_chance = { factor = 95 }
	}
	option = { #No
		name = EVTOPTBHFP20018
		trigger = {
			OR = {
				trait = cynical
				society_member_of = the_satanists 
				ai = no 
			}
		}
		if = {
			limit = { trait = zealous }
			remove_trait = zealous
		}
		tiered_piety_negative_effect = yes
		ai_chance = { factor = 5 }
	}
}

#What does mother do?
character_event = {
	id = HFP.20019
	desc = EVTDESCHFPA20019
	picture = GFX_evt_woman_praying_hf
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { #Making donation
		name = EVTOPTAHFP20019
		scaled_wealth = { value = -0.1 min = -50 max = -150 }
		set_character_flag = flag_churching_wealth
		ai_chance = { factor = 40 }
	}
	option = { #Humbling yourself
		name = EVTOPTBHFP20019
		tiered_prestige_negative_effect = yes
		set_character_flag = flag_churching_prestige
		ai_chance = { factor = 30 }
	}
	option = { #Confessing sins
		name = EVTOPTCHFP20019
		tiered_piety_negative_effect = yes
		set_character_flag = flag_churching_piety
		ai_chance = { factor = 30 }
	}
	option = { #Nothing
		name = EVTOPTDHFP20019
		tiered_prestige_reward_effect = yes
		set_character_flag = flag_churching_nothing
		ai_chance = { factor = 5 }
	}
	after = { 
		hidden_tooltip = { 
			random_list = {
				7 = { #Ecstatic vision
					modifier = {
						factor = 0.1
						trait = cynical
					}
					modifier = {
						factor = 0.75
						has_character_flag = flag_churching_nothing
					}
					modifier = {
						factor = 0.1
						society_member_of = the_satanists
					}
					modifier = {
						factor = 0 #Nothing to celebrate
						event_target:newborn_baby = { 
							is_alive = no 
						}
					}
					modifier = {
						factor = 0 #Jesus knows... somehow.
						event_target:newborn_baby = { 
							real_father_even_if_dead = { 
								event_target:newborn_baby = { 
									father_even_if_dead = { 
										NOT = { character = PREVPREV } 
									} 
								} 
							} 
						}
					}
					modifier = {
						factor = 1.25
						trait = trusting
					}
					modifier = {
						factor = 1.35
						trait = zealous
					}
					modifier = {
						factor = 1.5
						trait = celibate
					}
					modifier = {
						factor = 1.35
						trait = chaste
					}
					modifier = {
						factor = 1.35
						trait = temperate
					}
					modifier = {
						factor = 1.35
						trait = humble
					}
					modifier = {
						factor = 1.35
						trait = charitable
					}
					modifier = {
						factor = 1.35
						trait = kind
					}
					modifier = {
						factor = 1.35
						trait = patient
					}
					modifier = {
						factor = 1.35
						trait = diligent
					}
					modifier = {
						factor = 1.15
						piety = 150
					}
					modifier = {
						factor = 1.15
						piety = 250
					}
					modifier = {
						factor = 1.25
						piety = 350
					}
					modifier = {
						factor = 1.25
						piety = 450
					}
					set_character_flag = flag_churching_vision 
				} 	
				50 = { #Good feeling
					modifier = {
						factor = 0.75 #Jesus knows... somehow.
						event_target:newborn_baby = { 
							real_father_even_if_dead = { 
								event_target:newborn_baby = { 
									father_even_if_dead = { 
										NOT = { character = PREVPREV } 
									} 
								} 
							} 
						}
					}
					modifier = {
						factor = 0.75
						society_member_of = the_satanists
					}
					set_character_flag = flag_churching_positive 
				} 
				50 = { #Bad feeling
					modifier = {
						factor = 0.9
						piety = 25
					}
					modifier = {
						factor = 0.9
						piety = 50
					}
					modifier = {
						factor = 0.9
						piety = 75
					}
					modifier = {
						factor = 0.9
						piety = 100
					}
					modifier = {
						factor = 0.8
						piety = 150
					}
					modifier = {
						factor = 1.5
						trait = possessed
					}
					modifier = {
						factor = 1.5
						trait = lunatic
					}
					modifier = {
						factor = 1.5
						trait = kinslayer
					}
					modifier = {
						factor = 1.45
						trait = familial_kinslayer
					}
					modifier = {
						factor = 1.25
						trait = dynastic_kinslayer
					}
					modifier = {
						factor = 0.65
						has_character_flag = flag_churching_wealth
					}
					modifier = {
						factor = 0.75
						has_character_flag = flag_churching_piety
					}
					modifier = {
						factor = 0.85
						has_character_flag = flag_churching_prestige
					}
					modifier = {
						factor = 1.25
						has_character_flag = flag_churching_nothing
					}
					set_character_flag = flag_churching_negative 
				} 
				7 = { #Choke on Communion
					modifier = {
						factor = 0.1 #Nothing to fight over.
						event_target:newborn_baby = { 
							is_alive = no 
						}
					}
					modifier = {
						factor = 1.5
						society_member_of = the_satanists
					}
					modifier = {
						factor = 0.5
						has_character_flag = flag_churching_wealth
					}
					modifier = {
						factor = 0.65
						has_character_flag = flag_churching_piety
					}
					modifier = {
						factor = 0.75
						has_character_flag = flag_churching_prestige
					}
					modifier = {
						factor = 1.75
						has_character_flag = flag_churching_nothing
					}
					modifier = {
						factor = 0.5
						trait = cynical
					}
					modifier = {
						factor = 5 #Jesus knows... somehow.
						event_target:newborn_baby = { 
							real_father_even_if_dead = { 
								event_target:newborn_baby = { 
									father_even_if_dead = { 
										NOT = { character = PREVPREV } 
									} 
								} 
							} 
						}
					}
					modifier = {
						factor = 1.5
						trait = possessed
					}
					modifier = {
						factor = 1.5
						trait = lunatic
					}
					modifier = {
						factor = 1.5
						trait = kinslayer
					}
					modifier = {
						factor = 1.45
						trait = familial_kinslayer
					}
					modifier = {
						factor = 1.25
						trait = dynastic_kinslayer
					}
					modifier = {
						factor = 1.5
						trait = paranoid
					}
					modifier = {
						factor = 1.25
						trait = hedonist
					}
					modifier = {
						factor = 1.25
						trait = lustful
					}
					modifier = {
						factor = 1.25
						trait = gluttonous
					}
					modifier = {
						factor = 1.25
						trait = proud
					}
					modifier = {
						factor = 1.25
						trait = greedy
					}
					modifier = {
						factor = 1.25
						trait = envious
					}
					modifier = {
						factor = 1.25
						trait = wroth
					}
					modifier = {
						factor = 1.25
						trait = slothful
					}
					set_character_flag = flag_churching_sinner 
				} 
			}
			character_event = { id = HFP.20020 } 
		} 
	}
}

#Response
character_event = {
	id = HFP.20020
	desc = {
		text = EVTDESCHFPA20020
		trigger = {
			has_character_flag = flag_churching_vision
		}
	}
	desc = {
		text = EVTDESCHFPB20020
		trigger = {
			has_character_flag = flag_churching_positive
		}
	}
	desc = {
		text = EVTDESCHFPC20020
		trigger = {
			has_character_flag = flag_churching_negative
		}
	}
	desc = { #As she chokes, mother calls out for real father's name
		text = EVTDESCHFPD20020
		trigger = {
			has_character_flag = flag_churching_sinner
		}
	}
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_woman_praying_hf

	immediate = {
		clr_character_flag = flag_churching_wealth
		clr_character_flag = flag_churching_prestige
		clr_character_flag = flag_churching_piety
		clr_character_flag = flag_churching_nothing
	}

	is_triggered_only = yes
	
	option = { 
		name = {
			text = EVTOPTAHFP20020_A
			trigger = {
				has_character_flag = flag_churching_vision
			}
		}
		name = {
			text = EVTOPTAHFP20020_B
			trigger = {
				has_character_flag = flag_churching_positive
			}
		}
		name = {
			text = EVTOPTAHFP20020_C
			trigger = {
				has_character_flag = flag_churching_negative
			}
		}
		name = {
			text = EVTOPTAHFP20020_D
			trigger = {
				has_character_flag = flag_churching_sinner
			}
		}

		#Churching resulted in very positive vision:
		if = {
			limit = {
				has_character_flag = flag_churching_vision
			}
			tiered_piety_reward_effect = yes
			if = { 
				limit = { 
					trait = stressed 
				}
				remove_trait = stressed
			} 
			if = { 
				limit = { 
					trait = cynical 
				}
				random = { 
					chance = 30 
					remove_trait = cynical
					hidden_tooltip = { character_event = { id = 38316 } }
				}
			} 
			hidden_tooltip = { 
				spouse = { character_event = { id = HFP.20021 } } #Notify husband
				event_target:newborn_baby = { character_event = { id = HFP.20027 days = 2500 random = 250 } } #Child is blessed
			}
		}
		#Churching resulted in positive feeling:
		if = {
			limit = {
				has_character_flag = flag_churching_positive
			}
			tiered_piety_reward_effect = yes
			hidden_tooltip = { 
				spouse = { character_event = { id = HFP.20021 } } #Notify husband
			}
		}
		#Churching resulted in negative feeling:
		if = {
			limit = {
				has_character_flag = flag_churching_negative
			}
			tiered_piety_negative_effect = yes
			if = { 
				limit = { 
					NOT = { trait = stressed }  
				}
				random = { chance = 40 add_trait = stressed } 
			} 
			hidden_tooltip = { 
				spouse = { character_event = { id = HFP.20021 } } #Notify husband
			}
		}
		#Churching resulted in very negative omen:
		if = {
			limit = {
				has_character_flag = flag_churching_sinner
			}
			tiered_piety_negative_effect = yes
			if = { 
				limit = { 
					trait = stressed
					NOT = { trait = paranoid }  
				}
				add_trait = paranoid
			}
			if = { 
				limit = { 
					NOT = { trait = stressed }  
				}
				add_trait = stressed
			} 
			event_target:newborn_baby = { prestige = -100 }

			hidden_tooltip = { 
				if = { #If child is not actually illegitimate
					limit = { 
						event_target:newborn_baby = { 
							real_father_even_if_dead = { 
								event_target:newborn_baby = { 
									father_even_if_dead = { 
										character = PREVPREV
									} 
								} 
							} 
						}
					}
					event_target:newborn_baby = { 
						real_father_even_if_dead = { 
							event_target:newborn_baby = { 
								set_father = 0 
							} 
						} 
					}
				}
				if = { #If child is actually illegitimate
					limit = { 
						event_target:newborn_baby = { 
							real_father_even_if_dead = { 
								event_target:newborn_baby = { 
									father_even_if_dead = { 
										NOT = { character = PREVPREV } 
									} 
								} 
							} 
						}
					}
					event_target:newborn_baby = { 
						real_father_even_if_dead = {
							character_event = { id = HFP.20025 } #Notify real father
							event_target:newborn_baby = { 
								set_father = PREV 
							} 
						} 
					}
				} 
			} 
			if = { #If spouse is higher tier, the child is no longer an heir.
				limit = { 
					spouse = { 
						higher_tier_than = ROOT 
					}
				}
				event_target:newborn_baby = { 
					add_trait = bastard 
					dynasty = mother_bastard
				}
			}
			hidden_tooltip = { 
				spouse = { character_event = { id = HFP.20021 } } #Notify husband
			}
		}
		ai_chance = { factor = 100 }
	}
	after = { 
		hidden_tooltip = { character_event = { id = HFP.20026 days = 30 } } #Clear all flags
	}
}

#Husband notified of the Churching.
character_event = {
	id = HFP.20021
	desc = {
		text = EVTDESCHFPA20021
		trigger = {
			FROM = { has_character_flag = flag_churching_vision }
		}
	}
	desc = {
		text = EVTDESCHFPB20021
		trigger = {
			FROM = { has_character_flag = flag_churching_positive }
		}
	}
	desc = {
		text = EVTDESCHFPC20021
		trigger = {
			FROM = { has_character_flag = flag_churching_negative }
		}
	}
	desc = { 
		text = EVTDESCHFPD20021
		trigger = {
			FROM = { has_character_flag = flag_churching_sinner }
		}
	}
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_woman_praying_hf

	trigger = {
		FROM = { is_married = ROOT is_alive = yes }
	}

	is_triggered_only = yes
	
	option = { #Single option because Churching was positive.
		trigger = {
			FROM = {
				OR = { 
					has_character_flag = flag_churching_vision 
					has_character_flag = flag_churching_positive 
				}
			}
		}
		name = {
			text = EVTOPTAHFP20021_A
			trigger = {
				FROM = { has_character_flag = flag_churching_vision }
			}
		}
		name = {
			text = EVTOPTAHFP20021_B
			trigger = {
				FROM = { has_character_flag = flag_churching_positive }
			}
		}
		#Churching resulted in very positive vision:
		if = {
			limit = {
				FROM = { has_character_flag = flag_churching_vision }
			}
			tiered_piety_reward_effect = yes
			if = { 
				limit = { 
					trait = stressed 
				}
				remove_trait = stressed
			} 
			if = { 
				limit = { 
					trait = depressed 
				}
				remove_trait = depressed
			} 
		}
		#Churching resulted in positive feeling:
		if = {
			limit = {
				has_character_flag = flag_churching_positive
			}
			tiered_piety_reward_effect = yes
			if = { 
				limit = { 
					trait = stressed 
				}
				remove_trait = stressed
			}
		}
		ai_chance = { factor = 100 }
	}
	option = { #Churching was negative, high diplomacy offers comfort
		name = EVTOPTBHFP20021
		trigger = {
			diplomacy = 10
			FROM = {
				has_character_flag = flag_churching_negative
			}
		}
		tooltip_info = diplomacy
		FROM = {
			show_scope_change = no
			hidden_tooltip = { character_event = { id = HFP.20022 } } #Spouse comforted.
			if = { 
				limit = { 
					trait = stressed 
				}
				remove_trait = stressed
			}
			opinion = { 
				modifier = comforted_opinion
				who = ROOT
				years = 2
			}
		}
		if = { 
			limit = { trait = cruel } 
			random = { 
				chance = 30
				remove_trait = cruel
			}
			break = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = cruel
					trait = kind 
				}  
			} 
			random = { 
				chance = 30
				add_trait = kind
				hidden_tooltip = { character_event = { id = 38268 } } 
			}
			break = yes
		}
		if = { 
			limit = { trait = kind } 
			tiered_piety_reward_effect = yes
			break = yes
		}
		ai_chance = { factor = 100 }
	}
	option = { #Churching was negative
		name = EVTOPTCHFP20021
		trigger = {
			FROM = {
				has_character_flag = flag_churching_negative
			}
		}
		ai_chance = { factor = 10 }
	}
	option = { #Churching was horrible, but husband forgives wife.
		name = EVTOPTDHFP20021
		trigger = {
			FROM = {
				has_character_flag = flag_churching_sinner
			}
			NOR = {
				trait = cruel
				trait = envious
			}
		}
		FROM = {
			if = { 
				limit = { 
					trait = stressed 
				}
				remove_trait = stressed
			}
			opinion = { 
				modifier = comforted_opinion
				who = ROOT
				years = 10
			}
			hidden_tooltip = { character_event = { id = HFP.20023 } } #Spouse forgiven.
		}
		tiered_piety_reward_effect = yes
		tiered_prestige_negative_effect = yes
		if = { 
			limit = { 
				NOT = { trait = kind }  
			} 
			random = { 
				chance = 50
				add_trait = kind
				hidden_tooltip = { character_event = { id = 38268 } } 
			}
		}
		ai_chance = { 
			factor = 30
			modifier = { 
				factor = 1.75
				trait = kind 
			} 
			modifier = { 
				factor = 1.75
				trait = patient 
			} 
			modifier = { 
				factor = 1.5
				trait = humble 
			} 
		}
	}
	option = { #Churching was horrible, and husband is outraged.
		name = EVTOPTEHFP20021
		trigger = {
			FROM = {
				has_character_flag = flag_churching_sinner
			}
		}
		FROM = {
			hidden_tooltip = { character_event = { id = HFP.20024 } } #Spouse denounced.
			if = { 
				limit = { 
					higher_tier_than = FROM 
				}
				tiered_prestige_negative_effect = yes
			}
			add_character_modifier = {
				modifier = adulteress
				years = 10
			}
		}
		ai_chance = { 
			factor = 30 
			modifier = { 
				factor = 1.75
				trait = wroth 
			} 
			modifier = { 
				factor = 1.75
				trait = paranoid 
			} 
			modifier = { 
				factor = 1.5
				trait = envious 
			} 
			modifier = { 
				factor = 1.5
				trait = cruel
			}
			modifier = { 
				factor = 1.5
				trait = zealous
			}
		}
	}
}

#Mother: husband comforted you.
character_event = {
	id = HFP.20022
	desc = EVTDESCHFPA20022
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	
	option = {
		name = EVTOPTAHFP20022
		tooltip = { 
			if = { 
				limit = { 
					trait = stressed 
				}
				remove_trait = stressed
			}
			opinion = { 
				modifier = comforted_opinion
				who = FROM
				years = 2
			}
		}
	}
}

#Mother: husband forgave you.
character_event = {
	id = HFP.20023
	desc = EVTDESCHFPA20023
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20023
		tooltip = { 
			if = { 
				limit = { 
					trait = stressed 
				}
				remove_trait = stressed
			}
			opinion = { 
				modifier = comforted_opinion
				who = FROM
				years = 10
			}
		}
	}
}

#Mother: husband is upset.
character_event = {
	id = HFP.20024
	desc = EVTDESCHFPA20024
	picture = GFX_evt_quarrel
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20024
		tooltip = { 
			if = { 
				limit = { 
					lower_tier_than = FROM 
				}
				tiered_prestige_negative_effect = yes
			}
			add_character_modifier = {
				modifier = adulteress
				years = 10
			}
		}
	}
}

#Real father notified mother revealed his identity.
character_event = {
	id = HFP.20025
	desc = EVTDESCHFPA20025
	picture = GFX_evt_woman_praying_hf
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20025
		tiered_piety_negative_effect = yes
	}
}

#Churching flags on the mother cleared after a month.
character_event = {
	id = HFP.20026
	hide_window = yes

	is_triggered_only = yes
	
	immediate = {
		clr_character_flag = flag_churching_vision
		clr_character_flag = flag_churching_positive
		clr_character_flag = flag_churching_negative
		clr_character_flag = flag_churching_sinner
	}
}

#Child is blessed, give random trait.
character_event = {
	id = HFP.20027
	hide_window = yes

	is_triggered_only = yes
	
	immediate = {
		random_list = {
			5 = {
				remove_trait = dull
				remove_trait = imbecile
				remove_trait = slow
				remove_trait = quick
				add_trait = genius
			}
			10 = {
				remove_trait = dull
				remove_trait = imbecile
				remove_trait = slow
				add_trait = quick
			}
			15 = {
				remove_trait = weak
				remove_trait = feeble
				add_trait = strong
			}
			20 = {
				remove_trait = ugly
				add_trait = fair
			}
			25 = {
				remove_trait = dull
				remove_trait = imbecile
				remove_trait = slow
				add_trait = shrewd
			}
			25 = {
				remove_trait = weak
				remove_trait = feeble
				add_trait = robust
			}
		}
		mother = { character_event = { id = HFP.20028 } }
		father = { character_event = { id = HFP.20028 } }
	}
}
#Parents notified of blessed child.
character_event = {
	id = HFP.20028
	desc = {
		text = EVTDESCHFPA20028
		trigger = {
			is_female = yes
		}
	}
	desc = {
		text = EVTDESCHFPB20028
		trigger = {
			is_female = no
		}
	}
	picture = GFX_evt_guardian

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20028
	}
}

#Duplicate id fix: HFP.20029 taken for notification.

#Dark rest. Fires for female rulers, or, if unlanded, for their spouse.
character_event = {
	id = HFP.20030
	desc = {
		text = EVTDESCHFPA20030
		trigger = {
			trait = pregnant
		}
	}
	desc = {
		text = EVTDESCHFPB20030
		trigger = {
			NOT = { trait = pregnant }
		}
	}
	picture = GFX_evt_woman_praying_hf

	trigger = { 
		FROM = {
			trait = pregnant
			is_alive = yes
			OR = {
				is_married = ROOT
				character = ROOT
			}
			NOR = {
				trait = incapable
				trait = troubled_pregnancy
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				trait = travelling
			}
		}
	}

	is_triggered_only = yes
	
	option = { #Resting in the dark
		name = {
			text = EVTOPTAHFP20030_A
			trigger = {
				trait = pregnant
			}
		}
		name = {
			text = EVTOPTAHFP20030_B
			trigger = {
				NOT = { trait = pregnant }
			}
		}
		if = {
			limit = {
				NOT = { trait = pregnant }
			}
			FROM = { #Wife scope
				add_character_modifier = {
					modifier = mother_dark_rest
					months = 5
				}
				set_character_flag = flag_mother_dark_rest #Reduces chance of child being born sickly.
				hidden_tooltip = { 
					random_list = { 
						25 = { character_event = { id = HFP.20031 days = 10 random = 10 } #Becomes learned
						} 
						25 = { 
							modifier = {
								factor = 0.5
								trait = shy
							}
							character_event = { id = HFP.20033 days = 10 random = 10 } #Becomes paranoid
						} 
						25 = { 
							modifier = {
								factor = 0.5
								trait = gregarious
							}
							character_event = { id = HFP.20035 days = 10 random = 10 } #Becomes calmer
						} 
						25 = { #Nothing 
						} 
					} 
				}
			}
		}
		if = {
			limit = {
				trait = pregnant
			}
			add_character_modifier = {
				modifier = mother_dark_rest
				months = 5
			}
			set_character_flag = flag_mother_dark_rest
			hidden_tooltip = { 
				random_list = { 
					25 = { character_event = { id = HFP.20031 days = 10 random = 10 } #Becomes learned
					} 
					25 = { 
						modifier = {
							factor = 0.5
							trait = shy
						}
						character_event = { id = HFP.20033 days = 10 random = 10 } #Becomes paranoid
					} 
					25 = { 
						modifier = {
							factor = 0.5
							trait = gregarious
						}
						character_event = { id = HFP.20035 days = 10 random = 10 } #Becomes calmer
					} 
					25 = { #Nothing 
					} 
				} 
			}
		}
		ai_chance = { 
			factor = 30
			modifier =  {
				factor = 0.1
				trait = gregarious 
			} 
			modifier =  {
				factor = 0.1
				trait = wroth 
			} 
		}
	}
	option = { #Talking 
		name = {
			text = EVTOPTBHFP20030_A
			trigger = {
				trait = pregnant
			}
		}
		name = {
			text = EVTOPTBHFP20030_B
			trigger = {
				NOT = { trait = pregnant }
			}
		}
		if = {
			limit = {
				NOT = { trait = pregnant }
			}
			FROM = { #Wife scope
				add_character_modifier = {
					modifier = mother_chatting
					months = 5
				}
				hidden_tooltip = { 
					random_list = { 
						35 = { character_event = { id = HFP.20037 days = 10 random = 10 } #Becomes more gregarious
						} 
						35 = { character_event = { id = HFP.20039 days = 10 random = 10 } #Becomes more popular
						} 
						5 = { 
							modifier = {
								factor = 0 
								NOR = { 
									trait = kind
									has_focus = focus_family
									trait = socializer
									trait = gregarious 
								}
							}
							modifier = {
								factor = 0 
								ROOT = { 
									NOR = { 
										trait = kind
										has_focus = focus_family
										trait = socializer
										trait = gregarious 
									}
								}
							}
							modifier = {
								factor = 0 
								ROOT = { 
									num_of_lovers = 1 
								}
							}
							modifier = {
								factor = 0 
								prefers_men_trigger = yes
							}
							modifier = {
								factor = 0
								ROOT = { prefers_men_trigger = no }
							}
							modifier = {
								factor = 0 
								is_main_spouse = no
							}
							modifier = {
								factor = 0 
								num_of_lovers = 1 
							}
							character_event = { id = HFP.20041 days = 10 random = 10 } #Falls in love with husband
						} 
						25 = { #Nothing 
						} 
					} 
				}
			}
		}
		if = {
			limit = {
				trait = pregnant
			}
			add_character_modifier = {
				modifier = mother_chatting
				months = 5
			}
			hidden_tooltip = { 
				random_list = { 
					35 = { character_event = { id = HFP.20037 days = 10 random = 10 } #Becomes more gregarious
					} 
					35 = { character_event = { id = HFP.20039 days = 10 random = 10 } #Becomes more popular
					} 
					5 = { 
						modifier = {
							factor = 0 
							NOR = { 
								trait = kind
								has_focus = focus_family
								trait = socializer
								trait = gregarious 
							}
						}
						modifier = {
							factor = 0 
							spouse = { 
								NOR = { 
									trait = kind
									has_focus = focus_family
									trait = socializer
									trait = gregarious 
								}
							}
						}
						modifier = {
							factor = 0 
							prefers_men_trigger = no
						}
						modifier = {
							factor = 0
							spouse = { prefers_men_trigger = yes }
						}
						modifier = {
							factor = 0 
							is_main_spouse = no
						}
						modifier = {
							factor = 0 
							spouse = { 
								num_of_lovers = 1 
							}
						}
						modifier = {
							factor = 0 
							num_of_lovers = 1 
						}
						character_event = { id = HFP.20041 days = 10 random = 10 } #Falls in love with husband
					} 
					25 = { #Nothing 
					} 
				} 
			}
		}
		ai_chance = { 
			factor = 30
			modifier =  {
				factor = 0.1
				trait = shy 
			} 
			modifier =  {
				factor = 0.1
				trait = paranoid 
			} 
		}
	}
	option = { #Keep working
		trigger = {
			trait = pregnant
		}
		name = EVTOPTCHFP20030
		ai_chance = { factor = 0 }
	}
}

#Dark rest: mother's learning increases.
character_event = {
	id = HFP.20031
	desc = EVTDESCHFPA20031
	picture = GFX_evt_woman_praying_hf

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20031
		change_learning = 1
		hidden_tooltip = { spouse = { character_event = { id = HFP.20032 } } }
	}
}

#Dark rest: mother's learning increases. - Spouse notified.
character_event = {
	id = HFP.20032
	desc = EVTDESCHFPA20032
	picture = GFX_evt_woman_praying_hf

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20032
	}
}
#Dark rest: mother becomes paranoid due to seclusion.
character_event = {
	id = HFP.20033
	desc = EVTDESCHFPA20033
	picture = GFX_evt_woman_praying_hf

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20033
		if = { 
			limit = { trait = paranoid } 
			custom_tooltip = { text = tooltip_health_deteriorates }
			hidden_tooltip = { health = -0.25 }
		}
		if = { 
			limit = { 
				NOR = { 
					trait = trusting
					trait = paranoid 
				} 
			}
			add_trait = paranoid 
		}
		if = { 
			limit = { 
				trait = trusting
			}
			remove_trait = trusting 
		}
		hidden_tooltip = { spouse = { character_event = { id = HFP.20034 } } }
	}
}

#Dark rest: mother becomes paranoid due to seclusion. - Spouse notified.
character_event = {
	id = HFP.20034
	desc = EVTDESCHFPA20034
	picture = GFX_evt_woman_praying_hf

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20034
	}
}

#Dark rest: mother becomes calmer due to seclusion.
character_event = {
	id = HFP.20035
	desc = EVTDESCHFPA20035
	picture = GFX_evt_recovery

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20035
		if = { 
			limit = { NOT = { trait = stressed } } 
			custom_tooltip = { text = tooltip_health_improves }
			hidden_tooltip = { health = 0.25 } 
		} 
		if = { 
			limit = { trait = stressed } 
			remove_trait = stressed
		} 
		hidden_tooltip = { spouse = { character_event = { id = HFP.20036 } } }
	}
}

#Dark rest: mother becomes calmer due to seclusion. - Spouse notified.
character_event = {
	id = HFP.20036
	desc = EVTDESCHFPA20036
	picture = GFX_evt_recovery

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20036
	}
}

#Dark rest: mother becomes more gregarious.
character_event = {
	id = HFP.20037
	desc = EVTDESCHFPA20037
	picture = GFX_evt_state_diplomacy

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20037
		if = { 
			limit = { trait = gregarious } 
			change_diplomacy = 1
		}
		if = { 
			limit = { 
				NOR = { 
					trait = shy
					trait = gregarious 
				} 
			}
			add_trait = gregarious 
		}
		if = { 
			limit = { 
				trait = shy
			}
			remove_trait = shy 
		}
		hidden_tooltip = { spouse = { character_event = { id = HFP.20038 } } }
	}
}

#Dark rest:  mother becomes more gregarious. - Spouse notified.
character_event = {
	id = HFP.20038
	desc = EVTDESCHFPA20038
	picture = GFX_evt_state_diplomacy

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20038
	}
}

#Dark rest: mother becomes more popular.
character_event = {
	id = HFP.20039
	desc = EVTDESCHFPA20039
	picture = GFX_evt_homage_hf

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20039
		add_character_modifier = {
			modifier = mother_popular
			years = 5
		}
		hidden_tooltip = { spouse = { character_event = { id = HFP.20040 } } }
	}
}

#Dark rest:  mother becomes more popular. - Spouse notified.
character_event = {
	id = HFP.20040
	desc = EVTDESCHFPA20040
	picture = GFX_evt_homage_hf

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20040
	}
}

#Dark rest: mother falls in love with husband.
character_event = {
	id = HFP.20041
	desc = EVTDESCHFPA20041
	picture = GFX_evt_lovers

	is_triggered_only = yes
	
	immediate = {
		spouse = { save_event_target_as = scoped_spouse }
	}
	option = {
		name = EVTOPTAHFP20041
		add_lover = event_target:scoped_spouse	
		hidden_tooltip = { spouse = { character_event = { id = HFP.20042 } } }
	}
}

#Dark rest: mother falls in love with husband. - Spouse notified.
character_event = {
	id = HFP.20042
	desc = EVTDESCHFPA20042
	picture = GFX_evt_lovers

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20042
		add_lover = FROM
	}
	option = {
		name = EVTOPTBHFP20042
		trigger = { ai = no }
		FROM = { remove_lover = ROOT }
	}
}

#############################################################
#Pagan festival of fertility
#Only for Count or higher married rulers (or their main spouse).
#Only for Norse, Finnish, Romuva.
#Goddesses mentioned for loc: Freyja (norse), Zemyna (Romuva/baltic), Akka (Finnish)


#Spouse: organize fertility festival for wife.
character_event = {
	id = HFP.20043
	desc = EVTDESCHFPA20043
	picture = GFX_evt_viking_throneroom_oldgods
	border = GFX_event_normal_frame_religion

	trigger = {
		NOT = {	trait = incapable }
		FROM = { 
			trait = pregnant
			is_alive = yes
			is_married = ROOT
			OR = { #Can be of different but similar religion.
				religion = baltic_pagan
				religion = baltic_pagan_reformed
				religion = norse_pagan
				religion = norse_pagan_reformed
				religion = finnish_pagan
				religion = finnish_pagan_reformed
			}
			NOR = {
				trait = incapable
				has_character_modifier = out_traveling
				trait = travelling
				trait = troubled_pregnancy
				has_character_modifier = mother_fertility_festival_1
				has_character_modifier = mother_fertility_festival_2
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				trait = travelling
			} 
		}
		OR = {
			religion = baltic_pagan
			religion = baltic_pagan_reformed
			religion = norse_pagan
			religion = norse_pagan_reformed
			religion = finnish_pagan
			religion = finnish_pagan_reformed
		}
	}

	is_triggered_only = yes
	
	option = { #Organize full festival.
		name = EVTOPTAHFP20043
		if = { 
			limit = { ai = no }
			scaled_wealth = { value = -0.25 min = -25 max = -100 }
		}
		tiered_piety_reward_effect = yes
		spouse = {
			show_scope_change = no
			add_character_modifier = { 
				modifier = mother_fertility_festival_2
				years = 4
			}  
		}
		spouse = { 
			show_scope_change = no
			opinion = {
				who = ROOT 
				modifier = opinion_swayed_2
				years = 4
			}  
			hidden_tooltip = { character_event = { id = HFP.20045 } }
		}
		ai_chance = { 
			factor = 60
			modifier =  {
				factor = 1.5
				trait = zealous 
			} 
			modifier =  {
				factor = 1.5
				trait = charitable
			} 
			modifier =  {
				factor = 0.5
				trait = greedy 
			} 
			modifier =  {
				factor = 0.5
				NOT = { wealth = 25 }  
			} 
		}
	}
	option = { #Give proper offerings
		name = EVTOPTBHFP20043
		if = { 
			limit = { ai = no }
			scaled_wealth = { value = -0.05 min = -5 max = -50 }
		}
		spouse = {
			show_scope_change = no
			add_character_modifier = { 
				modifier = mother_fertility_festival_1
				years = 2
			}  
		}
		spouse = { 
			show_scope_change = no
			opinion = {
				who = ROOT 
				modifier = opinion_swayed_1 
				years = 2
			}  
			hidden_tooltip = { character_event = { id = HFP.20044 } } #Notify wife, end line.
		}
		ai_chance = { 
			factor = 20
			modifier =  {
				factor = 0.5
				trait = greedy 
			} 
			modifier =  {
				factor = 0.5
				NOT = { wealth = 0 }  
			} 
		}
	}
	option = { #Not interested.
		name = EVTOPTCHFP20043
		tiered_piety_negative_effect = yes
		ai_chance = { factor = 10 }
	}
}

#Fertility festival: Mother has just been honored.
character_event = {
	id = HFP.20044
	desc = EVTDESCHFPA20044
	picture = GFX_evt_viking_throneroom_oldgods
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20044
		tooltip = {
			add_character_modifier = { 
				modifier = mother_fertility_festival_1
				years = 2
			}
			opinion = {
				who = FROM 
				modifier = opinion_swayed_1
				years = 2
			}    
		}
	}
}

#Mother: festival has been organized for you.
character_event = {
	id = HFP.20045
	desc = EVTDESCHFPA20045
	picture = GFX_evt_viking_throneroom_oldgods
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { #Excited
		name = EVTOPTAHFP20045
		trigger = { 
			OR = { 
				trait = gregarious
				trait = proud
				trait = socializer
				trait = hedonist 
			} 
		}
		set_character_flag = flag_mother_festival_excited
		tiered_prestige_reward_effect = yes
		ai_chance = { factor = 40 }
	}
	option = { #Flattered
		name = EVTOPTBHFP20045
		ai_chance = { factor = 20 }
	}
	option = { #Humbled
		name = EVTOPTCHFP20045
		trigger = { 
			OR = { 
				trait = shy
				trait = chaste
				trait = humble
			} 
		}
		set_character_flag = flag_mother_festival_humbled
		tiered_piety_reward_effect = yes
		ai_chance = { factor = 40 }
	}

	after = {
		tooltip = {
			add_character_modifier = { 
				modifier = mother_fertility_festival_2
				years = 4
			}
			opinion = {
				who = FROM 
				modifier = opinion_swayed_2
				years = 4
			}    
		}
		hidden_tooltip = { 
			random_list = {
				 
				20 = { # Mother of the realm 
					modifier =  {
						factor = 0.2
						has_character_flag = flag_mother_festival_excited
					} 
					modifier =  {
						factor = 1.25
						trait = humble
					} 
					modifier =  {
						factor = 1.25
						trait = kind
					} 
					modifier =  {
						factor = 1.25
						trait = charitable
					} 
					modifier =  {
						factor = 0.75
						trait = proud
					} 
					modifier =  {
						factor = 0.75
						trait = envious
					} 
					modifier =  {
						factor = 0.75
						trait = cruel
					} 
					character_event = { id = HFP.20046 days = 5 random = 5 }
				} 
				20 = { # A goddess am I
					modifier =  {
						factor = 0.2
						has_character_flag = flag_mother_festival_humbled
					} 
					modifier =  {
						factor = 1.25
						trait = proud
					} 
					modifier =  {
						factor = 1.25
						trait = envious
					} 
					modifier =  {
						factor = 1.25
						trait = cruel
					} 
					modifier =  {
						factor = 0.85
						trait = humble
					} 
					modifier =  {
						factor = 0.75
						trait = shy
					} 
					character_event = { id = HFP.20047 days = 5 random = 5 }
				} 
				10 = { # The people rejoice
					modifier =  {
						factor = 1.15
						trait = charitable
					} 
					modifier =  {
						factor = 1.15
						trait = gregarious
					} 
					modifier =  {
						factor = 1.25
						is_attractive_trigger = yes
					} 
					modifier =  {
						factor = 0.75
						is_unattractive_trigger = yes
					} 
					character_event = { id = HFP.20049 days = 5 random = 5 }
				} 
				10 = { # Vassals are happy
					modifier =  {
						factor = 1.15
						trait = kind
					} 
					modifier =  {
						factor = 1.15
						trait = gregarious
					} 
					modifier =  {
						factor = 1.25
						is_attractive_trigger = yes
					} 
					modifier =  {
						factor = 0.75
						is_unattractive_trigger = yes
					} 
					character_event = { id = HFP.20050 days = 5 random = 5 }
				} 
				20 = { # Avatar of fertility
					modifier =  {
						factor = 0.2
						trait = celibate
					} 
					modifier =  {
						factor = 1.25
						trait = hedonist
					} 
					modifier =  {
						factor = 0.5
						trait = temperate
					} 
					modifier =  {
						factor = 0.1
						age = 40
					} 
					character_event = { id = HFP.20052 days = 5 random = 5 }
				} 
				20 = { # The virtue of the goddess
					modifier =  {
						factor = 1.25
						NOR = { 
							trait = lustful 
							trait = chaste 
							trait = celibate 
						}
					} 
					character_event = { id = HFP.20053 days = 5 random = 5 }
				} 
			} 
			clr_character_flag = flag_mother_festival_excited
			clr_character_flag = flag_mother_festival_humbled
		}
	}
}

#Mother: Festival - Mother of the realm.
character_event = {
	id = HFP.20046
	desc = EVTDESCHFPA20046
	picture = GFX_evt_homage_hf
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { #Gregarious
		name = EVTOPTAHFP20046
		if = { 
			limit = { trait = gregarious }
			change_diplomacy = 1 
		}
		if = { 
			limit = { NOT = { trait = gregarious } }
			add_trait = gregarious
		}
		if = { 
			limit = { trait = shy }
			remove_trait = shy
		}
		set_character_flag = flag_mother_festival_gregarious
		ai_chance = { factor = 40 }
	}
	option = { #Kind
		name = EVTOPTBHFP20046
		if = { 
			limit = { trait = kind }
			change_diplomacy = 1 
		}
		if = { 
			limit = { NOT = { trait = kind } }
			add_trait = kind
		}
		if = { 
			limit = { trait = envious }
			remove_trait = envious
		}
		if = { 
			limit = { trait = cruel }
			remove_trait = cruel
		}
		set_character_flag = flag_mother_festival_kind
		ai_chance = { factor = 40 }
	}
	option = { #Piety
		name = EVTOPTCHFP20046
		tiered_piety_reward_effect = yes
		set_character_flag = flag_mother_festival_piety
		ai_chance = { factor = 20 }
	}
	after = { 
		hidden_tooltip = { 
			if = { 
				limit = { is_married = yes }	
				spouse =  { character_event = { id = HFP.20054 } } #Spouse notified 
			}
			else =  { 
				clr_character_flag = flag_mother_festival_gregarious
				clr_character_flag = flag_mother_festival_kind
				clr_character_flag = flag_mother_festival_piety
			}
		}
	}
}

#Mother: Festival - A goddess am I.
character_event = {
	id = HFP.20047
	desc = EVTDESCHFPA20047
	picture = GFX_evt_homage_hf
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { #Proud
		name = EVTOPTAHFP20047
		trigger = { NOT = { trait = proud } }
		if = { 
			limit = { NOT = { trait = proud } }
			add_trait = proud
		}
		if = { 
			limit = { trait = humble }
			remove_trait = humble
		}
		set_character_flag = flag_mother_festival_proud
		ai_chance = { factor = 50 }
	}
	option = { #Ambitious
		name = EVTOPTBHFP20047
		trigger = { NOT = { trait = ambitious } }
		if = { 
			limit = { NOT = { trait = ambitious } }
			add_trait = ambitious
		}
		if = { 
			limit = { trait = content }
			remove_trait = content
		}
		if = { 
			limit = { NOT = { trait = lunatic } }
			random = { 
				chance = 30
				add_trait = lunatic 
				hidden_tooltip =  { character_event = { id = HFP.20048 } }
			}
		}
		set_character_flag = flag_mother_festival_ambitious
		ai_chance = { factor = 10 }
	}
	option = { #Piety
		name = EVTOPTCHFP20047
		tiered_prestige_reward_effect = yes
		set_character_flag = flag_mother_festival_prestige
		ai_chance = { factor = 40 }
	}
	after = { 
		hidden_tooltip = { 
			if = { 
				limit = { is_married = yes }	
				spouse =  { character_event = { id = HFP.20054 } } #Spouse notified 
			}
			else =  { 
				clr_character_flag = flag_mother_festival_proud
				clr_character_flag = flag_mother_festival_ambitious
				clr_character_flag = flag_mother_festival_prestige
			}
		}
	}
}

#Mother: Festival - Gone insane.
character_event = {
	id = HFP.20048
	desc = EVTDESCHFPA20048
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20048
		tooltip_info = lunatic
		ai_chance = { factor = 100 }
	}
}

#Mother: Festival - People are happy.
character_event = {
	id = HFP.20049
	desc = EVTDESCHFPA20049
	picture = GFX_evt_viking_throneroom_oldgods
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20049
		if = { 
			limit = { higher_tier_than = BARON }
			capital_scope = {
				show_scope_change = no
				add_province_modifier = {
					name = fertility_festival_province
					duration = 730
				}
			}
		}
		set_character_flag = flag_mother_festival_peasants
		ai_chance = { factor = 100 }
	}
	after = { 
		hidden_tooltip = { 
			if = { 
				limit = { is_married = yes }	
				spouse =  { character_event = { id = HFP.20054 } } #Spouse notified 
			}
			else =  { 
				clr_character_flag = flag_mother_festival_peasants
			}
		}
	}
}
#Mother: Festival - Vassals are happy.
character_event = {
	id = HFP.20050
	desc = EVTDESCHFPA20050
	picture = GFX_evt_viking_throneroom_oldgods
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20050
		if = { 
			limit = { higher_tier_than = BARON }
			custom_tooltip = { text = tooltip_HFPA20050 }
			hidden_tooltip = {
				any_courtier_or_vassal = {
					limit = {
						religion = ROOT
						age = 16
						OR = { 
							is_theocracy = yes
							trait = zealous
							trait = theologian 
						}
					}
					character_event = { id = HFP.20051 }
					opinion = {
						modifier = opinion_mother_goddess
						years = 5
						who = ROOT
					}
				}
			}
		}
		set_character_flag = flag_mother_festival_vassals
		ai_chance = { factor = 100 }
	}
	after = { 
		hidden_tooltip = { 
			if = { 
				limit = { is_married = yes }	
				spouse =  { character_event = { id = HFP.20054 } } #Spouse notified 
			}
			else =  { 
				clr_character_flag = flag_mother_festival_vassals
			}
		}
	}
}
#Vassals notified of popular festival.
character_event = {
	id = HFP.20051
	desc = EVTDESCHFPA20051
	picture = GFX_evt_viking_throneroom_oldgods
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTAHFP20051
		tooltip = {
			opinion = {
				modifier = opinion_mother_goddess
				years = 5
				who = FROM
			}
		}
		ai_chance = { factor = 100 }
	}
}

#Mother: Festival - Fertility bonus.
character_event = {
	id = HFP.20052
	desc = EVTDESCHFPA20052
	picture = GFX_evt_homage_hf
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { #Gluttonous
		name = EVTOPTAHFP20052
		if = { 
			limit = { trait = gluttonous }
			gain_weight_small_effect = yes
			weight_trait_check_effect = yes
		}
		if = { 
			limit = { 
				NOR = { 
					trait = gluttonous 
					trait = temperate
				} 
			}
			add_trait = gluttonous
		}
		if = { 
			limit = { trait = temperate }
			remove_trait = temperate
		}
		set_character_flag = flag_mother_festival_gluttonous
		ai_chance = { factor = 50 }
	}
	option = { #Drunkard
		name = EVTOPTBHFP20052
		if = { 
			limit = { trait = drunkard }
			gain_weight_small_effect = yes
			weight_trait_check_effect = yes
		}
		if = { 
			limit = { NOT = { trait = drunkard } }
			add_trait = drunkard
		}
		set_character_flag = flag_mother_festival_drunkard
		ai_chance = { factor = 30 }
	}
	after = { 
		add_character_modifier = { 
			modifier = mother_festival_blessing
			years = 5 
		}
		hidden_tooltip = { 
			if = { 
				limit = { is_married = yes }	
				spouse =  { character_event = { id = HFP.20054 } } #Spouse notified 
			}
			else = { 
				clr_character_flag = flag_mother_festival_gluttonous
				clr_character_flag = flag_mother_festival_drunkard
			}
		}
	}
}

#Mother: Festival - Godly virtues.
character_event = {
	id = HFP.20053
	desc = EVTDESCHFPA20053
	picture = GFX_evt_homage_hf
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { #Chaste
		name = EVTOPTAHFP20053
		if = { 
			limit = { trait = chaste }
			tiered_piety_reward_effect = yes
		}
		if = { 
			limit = { NOT = { trait = chaste } }
			add_trait = chaste
		}
		if = { 
			limit = { trait = lustful }
			remove_trait = lustful
		}
		set_character_flag = flag_mother_festival_chaste
		ai_chance = { 
			factor = 30
			modifier = { 
				factor = 0.2
				trait = lustful
			} 
		}
	}
	option = { #Lustful
		name = EVTOPTBHFP20053
		if = { 
			limit = { trait = lustful }
			tiered_prestige_reward_effect = yes
		}
		if = { 
			limit = { NOT = { trait = lustful } }
			add_trait = lustful
		}
		if = { 
			limit = { trait = chaste }
			remove_trait = chaste
		}
		set_character_flag = flag_mother_festival_lustful
		ai_chance = { 
			factor = 30
			modifier = { 
				factor = 0.2
				trait = chaste
			} 
		}
	}
	after = { 
		hidden_tooltip = { 
			if = { 
				limit = { is_married = yes }	
				spouse =  { character_event = { id = HFP.20054 } } #Spouse notified 
			}
			else = { 
				clr_character_flag = flag_mother_festival_chaste
				clr_character_flag = flag_mother_festival_lustful
			}
		}
	}
}

#Husband: Notification event.
character_event = {
	id = HFP.20054
	desc = {
		text = EVTDESCHFPA20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_gregarious }
		}
	}
	desc = {
		text = EVTDESCHFPB20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_kind }
		}
	}
	desc = {
		text = EVTDESCHFPC20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_piety }
		}
	}
	desc = {
		text = EVTDESCHFPD20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_proud }
		}
	}
	desc = {
		text = EVTDESCHFPE20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_ambitious }
		}
	}
	desc = {
		text = EVTDESCHFPF20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_prestige }
		}
	}
	desc = {
		text = EVTDESCHFPG20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_peasants }
		}
	}
	desc = {
		text = EVTDESCHFPH20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_vassals }
		}
	}
	desc = {
		text = EVTDESCHFPI20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_gluttonous }
		}
	}
	desc = {
		text = EVTDESCHFPL20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_drunkard }
		}
	}
	desc = {
		text = EVTDESCHFPM20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_chaste }
		}
	}
	desc = {
		text = EVTDESCHFPN20054
		trigger = {
			FROM = { has_character_flag = flag_mother_festival_lustful }
		}
	}
	picture = GFX_evt_homage_hf
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { 
		name = EVTOPTAHFP20054_A
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_gregarious } }
			FROM = { clr_character_flag = flag_mother_festival_gregarious }
			tiered_piety_reward_effect = yes
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_kind } }
			FROM = { clr_character_flag = flag_mother_festival_kind }
			tiered_piety_reward_effect = yes
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_piety } }
			FROM = { clr_character_flag = flag_mother_festival_piety }
			tiered_piety_reward_effect = yes
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_proud } }
			FROM = { clr_character_flag = flag_mother_festival_proud }
			tiered_prestige_reward_effect = yes
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_ambitious } }
			FROM = { clr_character_flag = flag_mother_festival_ambitious }
			tiered_prestige_reward_effect = yes
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_prestige } }
			FROM = { clr_character_flag = flag_mother_festival_prestige }
			tiered_prestige_reward_effect = yes
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_peasants } }
			FROM = { clr_character_flag = flag_mother_festival_peasants }
			if = { 
				limit = { higher_tier_than = BARON }
				capital_scope = {
				show_scope_change = no
					add_province_modifier = {
						name = fertility_festival_province
						duration = 730
					}
				} 
			}
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_vassals } }
			FROM = { clr_character_flag = flag_mother_festival_vassals }
			if = { 
				limit = { higher_tier_than = BARON }
				custom_tooltip = { text = tooltip_HFPA20054 }
				hidden_tooltip = {
					any_courtier_or_vassal = {
						limit = {
							religion = ROOT
							age = 16
							OR = { 
								is_theocracy = yes
								trait = zealous
								trait = theologian 
							}
						}
						character_event = { id = HFP.20051 }
						opinion = {
							modifier = opinion_mother_goddess
							years = 5
							who = FROM
						}
					}
				}
			}		
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_gluttonous } }
			FROM = { clr_character_flag = flag_mother_festival_gluttonous }
			tiered_prestige_reward_effect = yes
			
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_drunkard } }
			FROM = { clr_character_flag = flag_mother_festival_drunkard }
			tiered_prestige_reward_effect = yes
			
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_chaste } }
			FROM = { clr_character_flag = flag_mother_festival_chaste }
			tiered_piety_reward_effect = yes
			
		}
		if = { 
			limit = { FROM = { has_character_flag = flag_mother_festival_lustful } }
			FROM = { clr_character_flag = flag_mother_festival_lustful }
			tiered_piety_reward_effect = yes
		}
		ai_chance = { factor = 100 }
	}
}

#Child was blessed by goddess. Becomes beautiful a few years later.
character_event = {
	id = HFP.20055
	desc = {
		text = EVTDESCHFPA20055
		trigger = {
			is_female = yes
		}
	}
	desc = {
		text = EVTDESCHFPB20055
		trigger = {
			is_female = no
		}
	}
	picture = GFX_evt_guardian
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = { 
		FROM = {
			is_alive = yes
			NOR = { 
				trait = incapable
				trait = maimed
				trait = disfigured
				trait = one_eyed
				trait = syphilitic
				trait = leper
				trait = mangled
			}
		}
	}
	
	option = {
		name = EVTOPTAHFP20055
		FROM = {
			piety = 30
			add_trait = fair
			give_nickname = nick_the_heavenly
		}
		ai_chance = { factor = 100 }
	}
}

####################################

#Father: mother dies before birth, child is born weakly and pale.
character_event = {
	id = HFP.20056
	desc = {
		text = EVTDESCHFPA20056
		trigger = {
			NOT = { has_character_flag = flag_loved_dead_mother }
		}
	}
	desc = {
		text = EVTDESCHFPB20056
		trigger = {
			has_character_flag = flag_loved_dead_mother
		}
	}
	picture = GFX_evt_death

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20056
		ai_chance = { 
			factor = 50 
			modifier =  {
				factor = 1.5
				trait = patient
			}
			modifier =  {
				factor = 0.1
				has_character_flag = flag_loved_dead_mother
			}
		}
		ai_chance = { factor = 50 }
	}
	option = { 
		name = EVTOPTBHFP20056
		trigger = { NOT = { trait = kind } }
		opinion = {
			modifier = opinion_killed_wife
			years = 50
			who = event_target:hollow_baby
		}

		ai_chance = { factor = 50 }
	}
	after = { clr_character_flag = flag_loved_dead_mother }
}

#Hollow child gains specific trait.
character_event = {
	id = HFP.20057
	desc = EVTDESCHFPA20057
	picture = GFX_evt_child_reading
	hide_from = yes

	has_character_flag = flag_hollow_child_primed

	min_age = 7
	max_age = 10

	trigger = { 
		trait = is_malnourished 
		NOR = { 
			has_nickname = nick_the_pale_prince
			has_nickname = nick_the_hollow
			has_character_flag = flag_hollow_child
		}
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20057
		if = { 
			limit = { OR = { trait = brooding trait = envious } }
			change_intrigue = 2 
		}
		if = { 
			limit = { 
				NOT = { trait = brooding } 
				has_dlc = "Conclave"
				}
			add_trait = brooding 
		}
		if = { 
			limit = { 
				NOT = { trait = brooding } 
				NOT = { has_dlc = "Conclave" }
				}
			add_trait = envious 
		}
		ai_chance = { factor = 80 }
	}
	option = { 
		name = EVTOPTBHFP20057
		if = { 
			limit = { OR = { trait = timid trait = shy } }
			change_intrigue = 2 
		}
		if = { 
			limit = { 
				NOT = { trait = timid } 
				has_dlc = "Conclave"
			}
			add_trait = timid 
		}
		if = { 
			limit = { 
				NOT = { trait = timid } 
				NOT = { has_dlc = "Conclave" }
			}
			add_trait = shy 
		}
		ai_chance = { factor = 20 }
	}
	after = { 
		ROOT = { 
			clr_character_flag = flag_hollow_child_primed
			set_character_flag = flag_hollow_child
			if = { 
				limit = { has_minor_title = title_prince } 
				give_nickname = nick_the_pale_prince
			}
			if = { 
				limit = { NOT = { has_minor_title = title_prince } } 
				give_nickname = nick_the_hollow
			}
		}
	}
}

#On_adolescence. Hollow child gains adulthood trait and modifier.
character_event = {
	id = HFP.20058
	desc = EVTDESCHFPA20058
	picture = GFX_evt_child_reading

	has_character_flag = flag_hollow_child
	trigger = { trait = is_malnourished }
	
	capable_only = yes

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20058
		if = { 
			limit = { trait = brave }
			change_martial = 2 
		}
		if = { 
			limit = { NOT = { trait = brave } }
			add_trait = brave 
		}
		add_character_modifier = { 
			modifier = hollow_child_brave
			duration = -1
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20059 days = 5 } 
		} 
		ai_chance = { factor = 30 }
	}
	option = { 
		name = EVTOPTBHFP20058
		if = { 
			limit = { trait = erudite }
			change_learning = 2 
		}
		if = { 
			limit = { NOT = { trait = erudite } }
			add_trait = erudite 
		}
		add_character_modifier = { 
			modifier = hollow_child_erudite
			duration = -1
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20059 days = 5 } 
		} 
		ai_chance = { factor = 30 }
	}
	option = { 
		name = EVTOPTCHFP20058
		if = { 
			limit = { trait = cruel }
			change_intrigue = 2 
		}
		if = { 
			limit = { NOT = { trait = cruel } }
			add_trait = cruel 
		}
		add_character_modifier = { 
			modifier = hollow_child_cruel
			duration = -1
		}
		hidden_tooltip = { 
			character_event = { id = HFP.20059 days = 5 } 
		} 
		ai_chance = { factor = 30 }
	}
	after = { clr_character_flag = flag_hollow_child }
}

#Hollow child modifier notification.
character_event = {
	id = HFP.20059
	desc = {
		text = EVTDESCHFPA20059
		picture = GFX_evt_child_bully
		trigger = {
			has_character_modifier = hollow_child_brave
		}
	}
	desc = {
		text = EVTDESCHFPB20059
		picture = GFX_evt_child_reading
		trigger = {
			has_character_modifier = hollow_child_erudite
		}
	}
	desc = {
		text = EVTDESCHFPC20059
		picture = GFX_evt_child_bully
		trigger = {
			has_character_modifier = hollow_child_cruel
		}
	}
	picture = GFX_evt_child_reading

	is_triggered_only = yes

	trigger = {
		has_character_flag = flag_hollow_child
	}

	option = { 
		name = EVTOPTAHFP20059
		hidden_tooltip = { 
			father = { character_event = { id = HFP.20060 days = 5 } }
			if = { 
				limit = { educator = { NOT = { is_father = ROOT } } }
				educator = { character_event = { id = HFP.20060 days = 5 } }
			}
		} 
		ai_chance = { factor = 100 }
	}
}

#Educator/Father notified of strange behavior.
character_event = {
	id = HFP.20060
	desc = {
		text = EVTDESCHFPA20060
		picture = GFX_evt_child_bully
		trigger = {
			FROM = { has_character_modifier = hollow_child_brave }
		}
	}
	desc = {
		text = EVTDESCHFPB20060
		picture = GFX_evt_child_reading
		trigger = {
			FROM = { has_character_modifier = hollow_child_erudite }
		}
	}
	desc = {
		text = EVTDESCHFPC20060
		picture = GFX_evt_child_bully
		trigger = {
			FROM = { has_character_modifier = hollow_child_cruel }
		}
	}
	picture = GFX_evt_child_reading

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20060
	}
}

#Spouse: Mother aborted child to avoid hard pregnancy.
character_event = {
	id = HFP.20061
	desc = {
		text = EVTDESCHFPA20061
		trigger = {
			FROM = { 
				OR = { 
					has_character_modifier = adulteress 
					has_character_modifier = incestuous_adulteress 
				} 
			}
		}
	}
	desc = {
		text = EVTDESCHFPB20061
		trigger = {
			FROM = { 
				NOR = { 
					has_character_modifier = adulteress 
					has_character_modifier = incestuous_adulteress 
				} 
			}
		}
	}
	picture = GFX_evt_quarrel

	is_triggered_only = yes

	option = { #Not my problem.
		name = EVTOPTAHFP20061
		trigger = { 
			FROM = {
				OR = { 
					has_character_modifier = adulteress 
					has_character_modifier = incestuous_adulteress 
				} 
			} 
		}
		ai_chance = { factor = 100 }
	}
	option = { #Denounce her.
		name = EVTOPTBHFP20061
		trigger = {
			NOT = { trait = kind }
			FROM = {
				NOR = { 
					has_character_modifier = adulteress 
					has_character_modifier = incestuous_adulteress 
				} 
			} 
		}
		opinion = { 
			who = ROOT
			modifier = opinion_executed_child
			years = 10
		} 
		
		FROM = { 
			tooltip = {
				add_character_modifier = {
					modifier = cowardly_infanticide
					years = 100
				} 
				tiered_prestige_negative_effect = yes
			} 
			hidden_tooltip = { character_event = { id = HFP.20062 } } 
		}
		ai_chance = { 
			factor = 80 
			modifier = { 
				factor = 1.25
				trait = proud
			}
			modifier = { 
				factor = 1.5
				religion_group = christian
				trait = zealous
			}
			modifier = { 
				factor = 1.5
				trait = envious
			}
			modifier = { 
				factor = 1.25
				trait = paranoid
			}
		}
	}
	option = { #Forgive her.
		name = EVTOPTCHFP20061
		trigger = {
			NOT = { trait = cruel }
			FROM = {
				NOR = { 
					has_character_modifier = adulteress 
					has_character_modifier = incestuous_adulteress 
				} 
			} 
		}
		FROM = {
			show_scope_change = no 
			opinion = { 
				who = ROOT
				modifier = opinion_forgiven
				years = 10
			} 
		}
		tiered_piety_reward_effect = yes
		hidden_tooltip = { FROM = { character_event = { id = HFP.20063 } } } 
		ai_chance = { 
			factor = 30 
			modifier = { 
				factor = 1.25
				trait = humble
			}
			modifier = { 
				factor = 1.5
				trait = kind
			}
			modifier = { 
				factor = 1.5
				trait = trusting
			}
		}
	}
	option = { #Do not care.
		name = EVTOPTDHFP20061
		trigger = {
			FROM = {
				NOR = { 
					has_character_modifier = adulteress 
					has_character_modifier = incestuous_adulteress 
				} 
			} 
		}
		ai_chance = { 
			factor = 0
		}
	}
}

#Mother's crime exposed.
character_event = {
	id = HFP.20062
	desc = EVTDESCHFPA20062
	picture = GFX_evt_quarrel

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20062
		add_character_modifier = {
			modifier = cowardly_infanticide
			years = 100
		}
	}
}
#Mother was forgiven.
character_event = {
	id = HFP.20063
	desc = EVTDESCHFPA20063
	picture = GFX_evt_lovers

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20063
		tooltip = { 
			opinion = { 
				who = FROM
				modifier = opinion_forgiven
				years = 10
			}
			tiered_prestige_negative_effect = yes
		}
	}
}

#Mother becomes depressed/insane after abortion.
character_event = {
	id = HFP.20064
	desc = EVTDESCHFPA20064
	picture = GFX_evt_bad_news

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20064
		if = { 
			limit = { 
				trait = depressed	
				trait = lunatic
			}
			health = -1.0
		}
		if = { 
			limit = { 
				trait = depressed	
				NOT = { trait = lunatic }
			}
			add_trait = lunatic
		}
		if = { 
			limit = { 
				NOT = { trait = depressed }
			}
			add_trait = depressed
		}
	}
}

#Mother inadvertedly reveals her crime during night terror.
character_event = {
	id = HFP.20065
	desc = EVTDESCHFPA20065
	picture = GFX_evt_bad_news

	is_triggered_only = yes

	trigger = { NOT = { has_character_modifier = cowardly_infanticide } } #Not if husband discovered and denounced the crime in the meantime already.

	option = { 
		name = EVTOPTAHFP20065
		add_character_modifier = {
			modifier = cowardly_infanticide
			years = 100
		} 
	}
}

#Mother bleeds, loses fertility.
character_event = {
	id = HFP.20066
	desc = EVTDESCHFPA20066
	picture = GFX_evt_bad_news

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20066
		fertility = -0.25
	}
}

#Notify lover that his lover is pregnant.
character_event = {
	id = HFP.20067
	desc = {
		trigger = {
			FROM = {
				OR = {
					is_married = no
					is_married = ROOT
				}
			}
		}
		text = EVTDESCHFPA20067
	}
	desc = {
		trigger = {
			FROM = {
				is_married = yes
				NOT = { is_married = ROOT }
			}
		}
		text = EVTDESCHFPB20067
	}
	picture = GFX_evt_pregnancy

	trigger = {
		FROM = {
			NOT = { is_married = ROOT } #Otherwise double notification.
		}
	}
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20067
		trigger = {
			FROM = {
				OR = {
					is_married = no
					is_married = ROOT
				}
			}
		}
	}
	option = { 
		name = EVTOPTBHFP20067
		trigger = {
			FROM = {
				is_married = yes
				NOT = { is_married = ROOT }
			}
		}
	}
}

#Cleanup on_birth event to remove illegitimate trait gained when a wife gives birth after the death of her husband.
character_event = {
	id = HFP.20068
	hide_window = yes

	is_triggered_only = yes

	trigger = { 
		NOR = { 
			mother_even_if_dead = { has_character_modifier = adulteress }
			mother_even_if_dead = { has_character_modifier = incestuous_adulteress }
			father_even_if_dead = { is_alive = yes }
			father_even_if_dead = { trait = eunuch }
		}
	}
	immediate = { 
		remove_trait = bastard
		remove_trait = legit_bastard
	}
}

#Wife notified of kindred spirit I.
character_event = {
	id = HFP.20069
	desc = EVTDESCHFPA20069
	picture = GFX_evt_fancy_feast

	trigger = {
		FROM = {
			is_married = ROOT
		}
	}
	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20069
		tooltip = {
			opinion = { who = FROM modifier = opinion_kindred_spirit years = 10 } 
		}
	}
}

#Wife notified of kindred spirit II.
character_event = {
	id = HFP.20070
	desc = EVTDESCHFPA20070
	picture = GFX_evt_homage_hf

	trigger = {
		FROM = {
			is_married = ROOT
		}
	}

	is_triggered_only = yes

	option = { 
		name = EVTOPTAHFP20070
		tooltip = {
			opinion = { who = FROM modifier = opinion_kindred_spirit years = 10 } 
		}
	}
}