# ASK_FOR_MONEY_INTERACTION_ACCEPT_EVENT =
diploresponse_event = {
	id = SoA.3100
	desc = "EVTDESC_SOA_3100"

	is_triggered_only = yes
	major = no
	is_friendly = yes
	ai = no

	trigger = {
		always = yes
	}

	option = {
		name = "OK"
	}
}

# ASK_FOR_MONEY_INTERACTION_DECLINE_EVENT =
diploresponse_event = {
	id = SoA.3101
	desc = "EVTDESC_SOA_3101"

	is_triggered_only = yes
	major = no
	is_hostile = yes
	ai = no

	trigger = {
		always = yes
	}

	option = {
		name = "OK"
	}
}

# NOMINATE_BISHOP_TO_POPE_INTERACTION_ACCEPT_EVENT =
diploresponse_event = {
	id = SoA.3102
	desc = "EVTDESC_SOA_3102"

	is_triggered_only = yes
	major = no
	is_friendly = yes
	ai = no

	trigger = {
		always = yes
	}

	option = {
		name = "OK"
	}
}

# NOMINATE_BISHOP_TO_POPE_INTERACTION_DECLINE_EVENT =
diploresponse_event = {
	id = SoA.3103
	desc = "EVTDESC_SOA_3103"

	is_triggered_only = yes
	major = no
	is_hostile = yes
	ai = no

	trigger = {
		always = yes
	}

	option = {
		name = "OK"
	}
}

# ASK_FOR_CLAIM_INTERACTION_ACCEPT_EVENT
diploresponse_event = {
	id = SoA.3104
	desc = "EVTDESC_SOA_3104"

	is_triggered_only = yes
	major = no
	is_hostile = yes
	ai = no

	trigger = {
		always = yes
	}

	option = {
		name = "OK"
	}
}

# ASK_FOR_MONEY_INTERACTION_DECLINE_EVENT
diploresponse_event = {
	id = SoA.3105
	desc = "EVTDESC_SOA_3105"

	is_triggered_only = yes
	major = no
	is_hostile = yes
	ai = no

	trigger = {
		always = yes
	}

	option = {
		name = "OK"
	}
}

###########################################
# Demon Child Narrative Event Chain
###########################################
# by Henrik Fhraeus
###########################################

# Apart from these events, other events have been modified to make sure the Demon character is very likely to start adventures and is hard to kill

# Event triggers for a player
character_event = {
	id = SoA.3000
	
	hide_window = yes
	
	only_playable = yes
	
	trigger = {
		has_dlc = "Sons of Abraham"
		OR = {
			ai = no
			has_game_rule = {
				name = supernatural_events
				value = unrestricted
			}
		}
		NOT = {
			has_game_rule = {
				name = supernatural_events
				value = off
			}
		}
		OR = {
			religion_group = christian
			religion_group = muslim
			religion_group = zoroastrian_group
			religion_group = jewish_group
		}
		any_child = {
			NOT = { age = 3 }
			is_ill = no
			NOT = { trait = inbred }
		}
		NOT = { has_global_flag = demon_child_born }
	}
	
	mean_time_to_happen = {
		years = 500
		modifier = {
			factor = 0.5
			trait = possessed
		}
		modifier = {
			factor = 0.75
			trait = lunatic
		}
		modifier = {
			factor = 0.75
			trait = cruel
		}
		modifier = {
			factor = 0.75
			trait = impaler
		}
	}
	
	immediate = {
		random_child = {
			limit = {
				NOT = { age = 3 }
				is_ill = no
				NOT = { trait = inbred }
			}
			character_event = { id = SoA.3001 }
		}
	}
}

# Event triggers for the child
character_event = {
	id = SoA.3001
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = demon_child_non_pagan
		set_global_flag = demon_child_born
		add_character_modifier = {
			name = demon_child_non_pagan
			hidden = yes
			days = -1
		}
		FROM = { narrative_event = { id = SoA.3002 } }
	}
}

# First narrative event
narrative_event = {
	id = SoA.3002
	title = EVTTITLE_SOA_3002
	desc = EVTDESC_SOA_3002
	picture = GFX_evt_birth
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3002 # Do nothing, father
		trigger = {
			is_female = no
		}
		random_list = {
			50 = {
			}
			50 = {
				FROM = {
					add_character_modifier = {
						name = suspected_demon_spawn
						duration = -1
					}
				}
			}
		}
	}
	option = {
		name = EVTOPTB_SOA_3002 # Do nothing, mother
		trigger = {
			is_female = yes
		}
		random_list = {
			50 = {
			}
			50 = {
				FROM = {
					add_character_modifier = {
						name = suspected_demon_spawn
						duration = -1
					}
				}
			}
		}
		random_list = {
			50 = {
			}
			50 = {
				add_character_modifier = {
					name = suspected_witch
					duration = -1
				}
			}
		}
	}
	
	option = {
		name = EVTOPTC_SOA_3002 # Consult the Court Chaplain
		trigger = {
			job_spiritual = {
				religion = ROOT
			}
		}
		job_spiritual = {
			character_event = { id = SoA.3003 days = 2 tooltip = EVTTOOLTIP_SOA_3003 }
		}
	}
}

# Court Chaplain Consulted triggers for the child
character_event = {
	id = SoA.3003
	desc = EVTDESC_SOA_3003
	picture = GFX_evt_birth
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3003 # Tell not to worry
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				trait = zealous
			}
			modifier = {
				factor = 2
				FROM = {
					is_female = yes
					trait = kind 
				}
			}
			modifier = {
				factor = 2
				FROM = {
					is_female = yes
					trait = chaste
				}
			}
			modifier = {
				factor = 2
				FROM = {
					is_female = yes
					trait = zealous
				}
			}
			modifier = {
				factor = 2
				opinion = {
					who = FROM
					value = 50
				}
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = SoA.3004 days = 2 }
			}
		}
	}
	
	option = {
		name = EVTOPTB_SOA_3003 # Accuse of witchcraft
		trigger = {
			FROM = { is_female = yes }
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				trait = cynical
			}
			modifier = {
				factor = 2
				trait = cruel
			}
			modifier = {
				factor = 2
				trait = arbitrary
			}
			modifier = {
				factor = 2
				FROM = { trait = possessed }
			}
			modifier = {
				factor = 2
				FROM = { trait = lunatic }
			}
			modifier = {
				factor = 2
				FROM = { trait = cruel }
			}
			modifier = {
				factor = 4
				FROM = { trait = impaler }
			}
			modifier = {
				factor = 2
				FROM = { trait = mystic }
			}
			modifier = {
				factor = 2
				FROM = { trait = lustful }
			}
			modifier = {
				factor = 2
				NOT = {
					opinion = {
						who = FROM
						value = 0
					}
				}
			}
			modifier = {
				factor = 2
				NOT = {
					opinion = {
						who = FROM
						value = -50
					}
				}
			}
		}
		
		tooltip = {
			FROM = {
				character_event = { id = SoA.3005 days = 2 tooltip = EVTTOOLTIP_SOA_3005 }
			}
		}
		
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = SoA.3005 days = 2 }
			}
		}
	}
	
	option = {
		name = EVTOPTB_SOA_3003 # Accuse mother of witchcraft
		trigger = {
			FROM = { 
				is_female = no 
			}
			FROMFROM = {
				mother_even_if_dead = {
					is_alive = yes
				}
			}
		}
		
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				trait = cynical
			}
			modifier = {
				factor = 2
				trait = arbitrary
			}
			modifier = {
				factor = 2
				FROMFROM = { mother = { trait = possessed } }
			}
			modifier = {
				factor = 2
				FROMFROM = { mother = { trait = lunatic } }
			}
			modifier = {
				factor = 2
				FROMFROM = { mother = { trait = cruel } }
			}
			modifier = {
				factor = 4
				FROMFROM = { mother = { trait = impaler } }
			}
			modifier = {
				factor = 2
				FROMFROM = { mother = { trait = mystic } }
			}
			modifier = {
				factor = 2
				FROMFROM = { mother = { trait = lustful } }
			}
			modifier = {
				factor = 5
				FROMFROM = { mother = { NOT = { religion = ROOT } } }
			}
			modifier = {
				factor = 2
				NOT = {
					opinion = {
						who = FROM
						value = 0
					}
				}
			}
			modifier = {
				factor = 2
				FROMFROM = {
					mother = {
						NOT = {
							reverse_opinion = {
								who = FROM
								value = 0
							}
						}
					}
				}
			}
			modifier = {
				factor = 2
				FROMFROM = {
					mother = {
						NOT = {
							reverse_opinion = {
								who = FROM
								value = -50
							}
						}
					}
				}
			}
		}
		
		tooltip = {
			FROM = {
				character_event = { id = SoA.3006 days = 2 tooltip = EVTTOOLTIP_SOA_3006 }
			}
		}
		
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = SoA.3006 days = 2 }
			}
		}
	}
}

# Do not worry - bounce the event to get the name of the child
character_event = {
	id = SoA.3004
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = { character_event = { id = SoA.3007 } }
	}
}

# Accuse of witchcraft - bounce the event to get the name of the child
character_event = {
	id = SoA.3005
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = { character_event = { id = SoA.3008 } }
	}
}

# Accuse the mother of witchcraft - bounce the event to get the name of the child
character_event = {
	id = SoA.3006
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = { character_event = { id = SoA.3009 } }
	}
}

# I should not worry about the child
character_event = {
	id = SoA.3007
	desc = EVTDESC_SOA_3007
	picture = GFX_evt_family
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	show_from_from = yes
	
	option = {
		name = EVTOPTA_SOA_3007 # What a relief!
		piety = 100
	}
}

# I am accused of witchcraft!
character_event = {
	id = SoA.3008
	desc = EVTDESC_SOA_3008
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	show_from_from = yes
	
	option = {
		name = EVTOPTA_SOA_3008 # Deny these ridiculous charges!
		add_character_modifier = {
			name = suspected_witch
			duration = -1
		}
		FROM = {
			add_character_modifier = {
				name = suspected_demon_spawn
				duration = -1
			}
		}
		piety = -500
		hidden_tooltip = {
			FROMFROM = { character_event = { id = SoA.3010 days = 2 } }
		}
	}
	option = {
		name = EVTOPTB_SOA_3008 # Tell of lurid dreams
		FROMFROM = { character_event = { id = SoA.3011 days = 2 tooltip = EVTTOOLTIP_SOA_3011 } }
	}
	option = {
		name = EVTOPTC_SOA_3008 # Get rid of the court chaplain
		tooltip_info = intrigue
		trigger = {
			intrigue = 10
		}
		
		wealth = -50
		
		FROMFROM = {
			death = {
				death_reason = death_murder
				killer = ROOT
			}
		}
	}
}

# The mother is accused of witchcraft!
character_event = {
	id = SoA.3009
	desc = EVTDESC_SOA_3009
	picture = GFX_evt_quarrel
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	show_from_from = yes
	
	option = {
		name = EVTOPTA_SOA_3009 # Deny these ridiculous charges!
		FROM = {
			add_character_modifier = {
				name = suspected_demon_spawn
				duration = -1
			}
			mother = {
				add_character_modifier = {
					name = suspected_witch
					duration = -1
				}
			}
		}
		piety = -200
		hidden_tooltip = {
			FROMFROM = { character_event = { id = SoA.3015 days = 2 } }
		}
	}
	
	option = {
		name = EVTOPTB_SOA_3009 # Seize the mother declare the child illegitimate!
		FROM = {
			hidden_tooltip = {
				if = {
					limit = {
						is_father_real_father = yes
					}
					set_character_flag = real_father_check_set
				}
				set_father = 0
				if = {
					limit = {
						has_character_flag = real_father_check_set
					}
					set_real_father = ROOT
					clr_character_flag = real_father_check_set
				}
			}
			add_trait = bastard
			
			dynasty = mother
			
			mother = {
				remove_spouse = yes
				if = {
					limit = {
						employer = {
							character = ROOT
						}
					}
					imprison = ROOT
					reverse_opinion = {
						who = ROOT
						modifier = opinion_witch
					}
				}
				if = {
					limit = { is_lover = ROOT }
					remove_lover = ROOT
				}
			}
		}
	}
	
	option = {
		name = EVTOPTC_SOA_3008 # Get rid of the court chaplain
		tooltip_info = intrigue
		trigger = {
			intrigue = 10
		}
		
		wealth = -50
		
		FROMFROM = {
			death = {
				death_reason = death_murder
				killer = ROOT
			}
		}
	}
}

# Ruler assures Court Chaplain of innocence
character_event = {
	id = SoA.3010
	desc = EVTDESC_SOA_3010
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3010 # I must keep an eye on mother and child...
	}
}

# Ruler confesses to the Court Chaplain
character_event = {
	id = SoA.3011
	desc = EVTDESC_SOA_3011
	picture = GFX_evt_quarrel
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3011 # Demand her abdication and declare the child illegitimate
		
		ai_chance = {
			factor = 70
			modifier = {
				factor = 0.5
				FROM = { diplomacy = 7 }
			}
			modifier = {
				factor = 0.5
				FROM = { diplomacy = 9 }
			}
			modifier = {
				factor = 0.5
				FROM = { diplomacy = 12 }
			}
			modifier = {
				factor = 2.0
				FROM = { NOT = { diplomacy = 4 } }
			}
		}
		
		opinion = {
			who = FROM
			modifier = opinion_witch
		}
		tooltip = {
			FROM = { character_event = { id = SoA.3012 days = 2 tooltip = EVTTOOLTIP_SOA_3012 } }
		}
		hidden_tooltip = {
			FROMFROM = { character_event = { id = SoA.3012 days = 2 } } # Bounce via the child
		}
	}
	option = { 
		name = EVTOPTB_SOA_3011 # These are just normal dreams and nightmares
		
		ai_chance = {
			factor = 30
		}
		
		FROM = { character_event = { id = SoA.3013 days = 2 tooltip = EVTTOOLTIP_SOA_3013 } }
	}
}

# Accused! - bounce
character_event = {
	id = SoA.3012
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = { character_event = { id = SoA.3014 } }
	}
}

# My dreams are normal
character_event = {
	id = SoA.3013
	desc = EVTDESC_SOA_3013
	picture = GFX_evt_child_play
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	show_from_from = yes
	
	option = {
		name = EVTOPTA_SOA_3007
		piety = 100
	}
}

# Accused publicly!
character_event = {
	id = SoA.3014
	desc = EVTDESC_SOA_3014
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	show_from_from = yes
	
	immediate = {
		FROM = {
			add_character_modifier = {
				name = suspected_demon_spawn
				duration = -1
			}
		}
	}
	
	option = {
		name = EVTOPTA_SOA_3014 # Abdicate
		
		add_character_modifier = {
			name = suspected_witch
			duration = -1
		}
		
		FROM = {
			hidden_tooltip = {
				if = {
					limit = {
						is_father_real_father = yes
					}
					father_even_if_dead = {
						character_event = { id = SoA.3016 days = 1 }
					}
				}
				set_father = 0
			}
			add_trait = bastard
		}
		current_heir = {
			ROOT = { transfer_scaled_wealth = { to = PREV value = all } }
		}
		abdicate = yes

		if = {
			limit = {
				religion_group = christian
			}				
			add_trait = nun
		}
	}
	
	option = {
		name = EVTOPTB_SOA_3014 # Never!
		
		FROMFROM = {
			remove_title = job_spiritual 
			imprison = ROOT
		}
		
		add_character_modifier = {
			name = known_witch
			duration = -1
		}
		
		random_list = {
			50 = {
			}
			25 = {
				add_trait = depressed
			}
			25 = {
				add_trait = stressed
			}
		}
	}
}

# Male ruler assures Court Chaplain of the mother's innocence
character_event = {
	id = SoA.3015
	desc = EVTDESC_SOA_3015
	picture = GFX_evt_birth
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3015
	}
}

# Set real father correctly
character_event = {
	id = SoA.3016
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			set_real_father = ROOT
		}
	}
}

# The Demon child's true nature asserts itself
# Fired from on_adulthood
character_event = {
	id = SoA.3020
	desc = EVTDESC_SOA_3020
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		has_character_flag = demon_child_non_pagan
	}
	
	immediate = {
		remove_trait = chaste
		remove_trait = kind
		remove_trait = honest
		remove_trait = content
		remove_trait = charitable
		remove_trait = just
		remove_trait = humble
		remove_trait = quick
		remove_trait = shrewd
		remove_trait = slow
		remove_trait = dull
		remove_trait = imbecile
		remove_trait = weak
		remove_trait = feeble
		remove_trait = shy
		remove_trait = trusting
		add_trait = lustful
		add_trait = envious
		add_trait = deceitful
		add_trait = ambitious
		add_trait = cruel
		add_trait = genius
		add_trait = possessed
		add_trait = impaler
		change_diplomacy = 5
		change_martial = 5
		change_stewardship = 5
		change_intrigue = 10
		change_learning = 5
		
		add_character_modifier = {
			name = voice_of_satan
			duration = -1
		}
		
		father = {
			narrative_event = { id = SoA.3021 }
		}
		
		mother = {
			narrative_event = { id = SoA.3021 }
		}
		
		random_sibling = {
			limit = {
				ai = no
				NOT = { is_father = ROOT }
				NOT = { is_mother = ROOT }
			}
			narrative_event = { id = SoA.3021 }
		}
	}
	
	option = { 
		name = EVTOPTA_SOA_3020
	}
}

narrative_event = {
	id = SoA.3021
	title = EVTTITLE_SOA_3021
	desc = EVTDESC_SOA_3021
	picture = GFX_evt_lunatic
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3021
	}
}

# Demon Child tries to murder sibling in bed
character_event = {
	id = SoA.3030
	
	hide_window = yes
	
	min_age = 3
	max_age = 15
	only_capable = yes
	has_character_flag = demon_child_non_pagan
	
	trigger = {
		is_ruler = no
		has_dlc = "Sons of Abraham"
		any_sibling = {
			OR = {
				is_older_than = ROOT
				AND = {
					trait = born_in_the_purple
					ROOT = { NOT = { trait = born_in_the_purple } }
				}
				ROOT = {
					trait = bastard
				}
				AND = {
					is_female = no
					ROOT = {
						is_female = yes
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		years = 3
	}
	
	immediate = {
		random_sibling = {
			limit = {
				OR = {
					is_female = no
					ROOT = { is_female = yes }
				}
				OR = {
					is_older_than = ROOT
					AND = {
						trait = born_in_the_purple
						ROOT = { NOT = { trait = born_in_the_purple } }
					}
					ROOT = {
						trait = bastard
					}
					AND = {
						is_female = no
						ROOT = {
							is_female = yes
						}
					}
				}
			}
			character_event = { id = SoA.3031 }
		}
	}
}

# Demon Child tries to murder sibling in bed
character_event = {
	id = SoA.3031
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		random_list = {
			50 = {
				FROM = { character_event = { id = SoA.3032 } } # Success
			}
			25 = {
				FROM = { character_event = { id = SoA.3033 } } # Failure
			}
			25 = {
				FROM = { character_event = { id = SoA.3034 } } # Brain Damage
			}
		}
	}
}

# Demon Child tries to murder sibling in bed - Success
character_event = {
	id = SoA.3032
	desc = EVTDESC_SOA_3032
	picture = GFX_evt_shadow
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3032
		FROM = { character_event = { id = SoA.3035 tooltip = EVTTOOLTIP_SOA_3035 } }
	}
}

# Demon Child tries to murder sibling in bed - Failure
character_event = {
	id = SoA.3033
	desc = EVTDESC_SOA_3032
	picture = GFX_evt_shadow
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3032
		FROM = { character_event = { id = SoA.3036 tooltip = EVTTOOLTIP_SOA_3035 } }
	}
}

# Demon Child tries to murder sibling in bed - Brain Damage
character_event = {
	id = SoA.3034
	desc = EVTDESC_SOA_3032
	picture = GFX_evt_shadow
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3032
		FROM = { character_event = { id = SoA.3037 tooltip = EVTTOOLTIP_SOA_3035 } }
	}
}

# Demon Child murders sibling in bed
character_event = {
	id = SoA.3035
	desc = EVTDESC_SOA_3035
	picture = GFX_evt_shadow
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3035
		death = {
			death_reason = death_murder_unknown
			killer = FROM
		}
		hidden_tooltip = {
			mother = { narrative_event = { id = SoA.3039 } }
			father = { narrative_event = { id = SoA.3039 } }
			any_liege = {
				limit = {
					ai = no
					NOT = { is_father = ROOT }
					NOT = { is_mother = ROOT }
				}
				narrative_event = { id = SoA.3039 }
			}
		}
	}
}

# Demon Child fails to murder sibling in bed
character_event = {
	id = SoA.3036
	desc = EVTDESC_SOA_3036
	picture = GFX_evt_shadow
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3036
		hidden_tooltip = {
			mother = { narrative_event = { id = SoA.3040 } }
			father = { narrative_event = { id = SoA.3040 } }
			any_liege = {
				limit = {
					ai = no
					NOT = { is_father = ROOT }
					NOT = { is_mother = ROOT }
				}
				narrative_event = { id = SoA.3040 }
			}
		}
	}
}

# Demon Child fails to murder sibling in bed, but causes brain damage
character_event = {
	id = SoA.3037
	desc = EVTDESC_SOA_3037
	picture = GFX_evt_shadow
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3037
		add_trait = infirm
		hidden_tooltip = {
			mother = { narrative_event = { id = SoA.3041 } }
			father = { narrative_event = { id = SoA.3041 } }
			any_liege = {
				limit = {
					ai = no
					NOT = { is_father = ROOT }
					NOT = { is_mother = ROOT }
				}
				narrative_event = { id = SoA.3041 }
			}
		}
	}
}

# Notification, murder succeeded
narrative_event = {
	id = SoA.3039
	title = EVTTITLE_SOA_3039
	desc = EVTDESC_SOA_3039
	picture = GFX_evt_death
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3039
	}
}

# Notification, murder failed
narrative_event = {
	id = SoA.3040
	title = EVTTITLE_SOA_3040
	desc = EVTDESC_SOA_3040
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3040
	}
}

# Notification, murder failed, but brain damaged
narrative_event = {
	id = SoA.3041
	title = EVTTITLE_SOA_3041
	desc = EVTDESC_SOA_3041
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_SOA_3041
	}
}

# Demon Child recovers from maiming
character_event = {
	id = SoA.3050
	desc = EVTDESC_SOA_3050
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion
	
	trigger = {
		is_maimed_trigger = yes
		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 10
			NOT = { has_character_flag = demon_child_non_pagan }
		}
	}
	
	option = {
		name = EVTOPTA_SOA_3050
		if = {
			limit = { trait = maimed }
			remove_trait = maimed
		}
		if = {
			limit = { trait = one_eyed }
			remove_trait = one_eyed
		}
		if = {
			limit = { trait = one_handed }
			remove_trait = one_handed
		}
		if = {
			limit = { trait = one_legged }
			remove_trait = one_legged
		}
		if = {
			limit = { trait = disfigured }
			remove_trait = disfigured
		}
		if = {
			limit = { trait = mangled }
			remove_trait = mangled
		}
		if = {
			limit = { has_character_modifier = phantom_pain }
			remove_character_modifier = phantom_pain
		}
	}
}

# Demon Child recovers from blinding
character_event = {
	id = SoA.3051
	desc = EVTDESC_SOA_3051
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion
	
	trigger = {
		trait = blinded
		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 10
			NOT = { has_character_flag = demon_child_non_pagan }
		}
	}
	
	option = {
		name = EVTOPTA_SOA_3051
		remove_trait = blinded
	}
}

# Demon Child recovers from castration
character_event = {
	id = SoA.3052
	desc = EVTDESC_SOA_3052
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion
	
	trigger = {
		trait = eunuch
		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 10
			NOT = { has_character_flag = demon_child_non_pagan }
		}
	}
	
	option = {
		name = EVTOPTA_SOA_3052
		remove_trait = eunuch
	}
}

# Demon Child recovers from brain damage
character_event = {
	id = SoA.3053
	desc = EVTDESC_SOA_3053
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion
	
	max_age = 75
	
	trigger = {
		OR = {
			trait = incapable
			trait = infirm
		}
		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 10
			NOT = { has_character_flag = demon_child_non_pagan }
		}
	}
	
	option = {
		name = EVTOPTA_SOA_3053
		if = {
			limit = {
				trait = incapable
			}
			remove_trait = incapable
		}
		if = {
			limit = {
				trait = infirm
			}
			remove_trait = infirm
		}
	}
}

# Demon Child recovers from epidemic
character_event = {
	id = SoA.3054
	desc = EVTDESC_SOA_3054
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion
	
	trigger = {
		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			trait = syphilitic
			trait = leper
			trait = has_tuberculosis
			trait = has_typhoid_fever
			trait = has_typhus
			trait = has_bubonic_plague
			trait = has_measles
			trait = has_small_pox
			trait = has_aztec_disease
		}
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	mean_time_to_happen = {
		months = 2
		modifier = {
			factor = 10
			NOT = { has_character_flag = demon_child_non_pagan }
		}
	}
	
	option = {
		name = EVTOPTA_SOA_3054
		if = {
			limit = {
				trait = syphilitic
			}
			remove_trait = syphilitic
		}
		if = {
			limit = {
				trait = leper
			}
			remove_trait = leper
		}
		if = {
			limit = {
				trait = has_tuberculosis
			}
			remove_trait = has_tuberculosis
		}
		if = {
			limit = {
				trait = has_typhoid_fever
			}
			remove_trait = has_typhoid_fever
		}
		if = {
			limit = {
				trait = has_typhus
			}
			remove_trait = has_typhus
		}
		if = {
			limit = {
				trait = has_bubonic_plague
			}
			remove_trait = has_bubonic_plague
			set_character_flag = achievement_i_got_better
		}
		if = {
			limit = {
				trait = has_measles
			}
			remove_trait = has_measles
		}
		if = {
			limit = {
				trait = has_small_pox
			}
			remove_trait = has_small_pox
		}
		if = {
			limit = {
				trait = has_aztec_disease
			}
			remove_trait = has_aztec_disease
		}
		clear_disease_level_effect = yes
	}
}

# Demon Child escapes from prison
character_event = {
	id = SoA.3060
	desc = EVTDESC_SOA_3060
	picture = GFX_evt_courier
	border = GFX_event_normal_frame_religion
	
	prisoner = yes
	
	trigger = {
		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 10
			NOT = { has_character_flag = demon_child_non_pagan }
		}
	}
	
	option = {
		name = EVTOPTA_SOA_3060
		hidden_tooltip = {
			host = {
				character_event = { id = SoA.3061 }
			}
		}
		imprison = no
	}
}

# Demon Child escapes from prison
character_event = {
	id = SoA.3061
	desc = EVTDESC_SOA_3061
	picture = GFX_evt_courier
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3061
	}
}

# Demon Child receives troop reinforcements
character_event = {
	id = SoA.3065
	desc = EVTDESC_SOA_3065
	picture = GFX_evt_burning_house
	border = GFX_event_normal_frame_religion
	
	only_rulers = yes
	has_character_flag = demon_child_non_pagan
	war = yes
	has_dlc = "Sons of Abraham"
	
	trigger = {
		trait = possessed
		OR = {
			is_primary_war_defender = yes
			is_primary_war_attacker = yes
		}
		NOT = { has_character_flag = demon_child_non_pagan_cultists }
		is_at_sea = no
	}
	
	mean_time_to_happen = {
		months = 24
	}
	
	immediate = {
		location = {
			ROOT = {
				create_character = {
					dynasty = none
					religion = hellenic_pagan
					culture = greek
					female = yes
					name = Circe
					age = 25
					dna=bdlhexmbcai
					attributes = {
						intrigue = 12
						martial = 7
						diplomacy = 10
						stewardship = 4
						learning = 10
					}
					trait = ambitious
					trait = cruel
					trait = envious
					trait = cynical
					trait = deceitful
					trait = fair
					trait = mystic
					trait = brilliant_strategist
					trait = flanker
				}
				new_character = {
					spawn_unit = {
						province = PREVPREV
						home = PREVPREV
						owner = ROOT
						troops = {
							archers = { 150 150 }
							knights = { 100 100 }
							heavy_infantry = { 250 250 }
						}
						attrition = 0.0
						cannot_inherit = yes
					}
					add_character_modifier = {
						name = known_witch
						duration = -1
					}
					opinion = {
						who = ROOT
						modifier = opinion_the_chosen_one
					}
					set_character_flag = special_marshal
					set_character_flag = special_treasurer
					set_character_flag = special_chancellor
					set_character_flag = special_spiritual
					set_character_flag = special_spymaster
				}
				create_character = {
					dynasty = none
					religion = jewish_pagan
					culture = levantine_arabic
					female = yes
					name = Jezebel
					age = 24
					dna=dhmfgmabaaz
					attributes = {
						intrigue = 9
						martial = 7
						diplomacy = 12
						stewardship = 3
						learning = 8
					}
					trait = ambitious
					trait = cruel
					trait = envious
					trait = lustful
					trait = deceitful
					trait = fair
					trait = hedonist
					trait = grey_eminence
					trait = inspiring_leader
				}
				new_character = {
					spawn_unit = {
						province = PREVPREV
						home = PREVPREV
						owner = ROOT
						troops = {
							archers = { 150 150 }
							knights = { 100 100 }
							heavy_infantry = { 250 250 }
						}
						attrition = 0.0
						cannot_inherit = yes
					}
					add_character_modifier = {
						name = known_witch
						duration = -1
					}
					opinion = {
						who = ROOT
						modifier = opinion_the_chosen_one
					}
					set_character_flag = special_marshal
					set_character_flag = special_treasurer
					set_character_flag = special_chancellor
					set_character_flag = special_spiritual
					set_character_flag = special_spymaster
				}
				create_character = {
					dynasty = none
					religion = celtic_pagan
					culture = welsh
					female = yes
					name = Morgana
					age = 27
					dna=aefccojcgbd
					attributes = {
						intrigue = 15
						martial = 7
						diplomacy = 10
						stewardship = 8
						learning = 12
					}
					trait = ambitious
					trait = cruel
					trait = lustful
					trait = envious
					trait = genius
					trait = deceitful
					trait = fair
					trait = mystic
					trait = elusive_shadow
					trait = defensive_leader
				}
				new_character = {
					spawn_unit = {
						province = PREVPREV
						home = PREVPREV
						owner = ROOT
						troops = {
							archers = { 150 150 }
							knights = { 100 100 }
							heavy_infantry = { 250 250 }
						}
						attrition = 0.0
						cannot_inherit = yes
					}
					add_character_modifier = {
						name = known_witch
						duration = -1
					}
					opinion = {
						who = ROOT
						modifier = opinion_the_chosen_one
					}
					set_character_flag = special_marshal
					set_character_flag = special_treasurer
					set_character_flag = special_chancellor
					set_character_flag = special_spiritual
					set_character_flag = special_spymaster
				}
			}
		}
		set_character_flag = demon_child_non_pagan_cultists
	}
	
	option = {
		name = EVTOPTA_SOA_3065
	}
}

# A witch nanny arrives at court
character_event = {
	id = SoA.3070
	
	hide_window = yes
	
	max_age = 15
	prisoner = no
	has_character_flag = demon_child_non_pagan
	
	trigger = {
		has_dlc = "Sons of Abraham"
		NOT = { religion_group = pagan_group }
		NOT = { has_character_flag = demon_child_non_pagan_got_nanny }
	}
	
	mean_time_to_happen = {
		months = 3
	}
	
	immediate = {
		set_character_flag = demon_child_non_pagan_got_nanny
		
		if = {
			limit = {
				is_ruler = no
			}
			host = {
				character_event = { id = SoA.3071 }
			}
		}
		if = {
			limit = {
				is_ruler = yes
			}
			character_event = { id = SoA.3072 }
		}
	}
}

# A witch nanny arrives at court
character_event = {
	id = SoA.3071
	desc = EVTDESC_SOA_3071
	picture = GFX_evt_princess_byzantine
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3071
		
		create_character = {
			dynasty = none
			religion = ROOT
			culture = frankish
			female = yes
			age = 20
			dna=dkkdfdgibbe
			attributes = {
				intrigue = 10
				martial = 4
				diplomacy = 5
				stewardship = 6
				learning = 10
			}
			trait = cruel
			trait = envious
			trait = quick
			trait = diligent
			trait = patient
			trait = scholar
			trait = mastermind_theologian
		}
		
		hidden_tooltip = {
			new_character = {
				set_character_flag = special_treasurer
				set_character_flag = special_chancellor
				set_character_flag = special_spymaster
				
				set_character_flag = witch_nanny
				
				add_character_modifier = {
					name = suspected_witch
					duration = -1
				}
				
				if = {
					limit = {
						religion_group = christian
					}
					add_trait = nun
				}
				
				FROM = {
					reverse_opinion = {
						who = PREV
						modifier = opinion_the_chosen_one
					}
				}
			}
		}
	}
}

# A witch nanny arrives at court
character_event = {
	id = SoA.3072
	desc = EVTDESC_SOA_3072
	picture = GFX_evt_princess_byzantine
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3072
		
		create_character = {
			dynasty = none
			religion = ROOT
			culture = frankish
			female = yes
			age = 20
			dna=dkkdfdgibbe
			attributes = {
				intrigue = 10
				martial = 4
				diplomacy = 5
				stewardship = 6
				learning = 10
			}
			trait = cruel
			trait = envious
			trait = quick
			trait = diligent
			trait = patient
			trait = scholar
			trait = mastermind_theologian
		}
		
		hidden_tooltip = {
			new_character = {
				set_character_flag = special_treasurer
				set_character_flag = special_chancellor
				set_character_flag = special_spymaster
				
				set_character_flag = witch_nanny
				
				add_character_modifier = {
					name = suspected_witch
					duration = -1
				}
				
				if = {
					limit = {
						religion_group = christian
					}
					add_trait = nun
				}
				
				FROM = {
					reverse_opinion = {
						who = PREV
						modifier = opinion_the_chosen_one
					}
				}
			}
		}
	}
}

# Witch nanny moves with her charge
character_event = {
	id = SoA.3073
	
	hide_window = yes
	
	only_women = yes
	prisoner = no
	only_capable = yes
	min_age = 16
	has_character_flag = witch_nanny
	has_dlc = "Sons of Abraham"
	is_married = no
	
	trigger = {
		is_ruler = no
		is_consort = no
		NOT = { religion_group = pagan_group }
		NOT = {
			any_courtier = {
				has_character_flag = demon_child_non_pagan
				host = {
					ROOT = {
						host = {
							character = PREVPREV
						}
					}
				}
			}
		}
		top_liege = {
			any_realm_character = {
				prisoner = no
				has_character_flag = demon_child_non_pagan
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		liege = {
			character_event = { id = SoA.3074 }
		}
		top_liege = {
			random_realm_character = {
				limit = {
					prisoner = no
					has_character_flag = demon_child_non_pagan
				}
				host = {
					ROOT = {
						move_character = PREV
					}
				}
			}
		}
	}
}

# A witch nanny moves with her charge
character_event = {
	id = SoA.3074
	desc = EVTDESC_SOA_3074
	picture = GFX_evt_princess_byzantine
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3074
	}
}

# Witch nanny commits suicide for the demon child
character_event = {
	id = SoA.3075
	
	hide_window = yes
	
	prisoner = no
	max_age = 15
	has_character_flag = demon_child_non_pagan_got_nanny
	
	trigger = {
		has_dlc = "Sons of Abraham"
		NOT = { religion_group = pagan_group }
		OR = {
			ai = no
			liege = {
				ai = no
			}
		}
		has_character_flag = demon_child_non_pagan
		any_courtier = {
			is_female = yes
			prisoner = no
			NOT = { trait = incapable }
			has_character_flag = witch_nanny
		}
	}
	
	mean_time_to_happen = {
		years = 13 # Does not always happen
	}
	
	immediate = {
		random_courtier = {
			limit = {
				is_female = yes
				prisoner = no
				NOT = { trait = incapable }
				has_character_flag = witch_nanny
			}
			character_event = { id = SoA.3076 }
		}
	}
}

# Witch nanny commits suicide for the demon child
character_event = {
	id = SoA.3076
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				liege = {
					NOT = { has_character_flag = demon_child_non_pagan }
				}
			}
			liege = {
				narrative_event = { id = SoA.3077 }
			}
		}
		if = {
			limit = {
				liege = {
					has_character_flag = demon_child_non_pagan
				}
			}
			liege = {
				narrative_event = { id = SoA.3078 }
			}
		}
		death = {
			death_reason = death_suicide_fall
		}
	}
}

# Witch nanny commits suicide for the demon child
narrative_event = {
	id = SoA.3077
	title = EVTTITLE_SOA_3077
	desc = EVTDESC_SOA_3077
	picture = GFX_evt_family
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3077
	}
}

# Witch nanny commits suicide for the demon child
narrative_event = {
	id = SoA.3078
	title = EVTTITLE_SOA_3078
	desc = EVTDESC_SOA_3078
	picture = GFX_evt_family
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3078
	}
}

