# 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_friendly = 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 = {
		OR = {
			has_dlc = "Sons of Abraham"
			has_dlc = "Mystics"
		}
		OR = {
			ai = no
		}
		any_child = {
			NOT = { age = 3 }
			is_ill = no
			NOT = { trait = inbred }
			mother = {
				always = yes
			}
		}
		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
		}
		modifier = {
			factor = 0.25
			society_member_of = the_satanists
		}
	}
	
	immediate = {
		random_child = {
			limit = {
				NOT = { age = 3 }
				is_ill = no
				NOT = { trait = inbred }
			}
			character_event = { id = SoA.3001 }
		}
	}
}

# Event triggers for the child
# Can also be fired from event 335
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
		}
		remove_trait = sickly
		FROM = { narrative_event = { id = SoA.3002 } }
		character_event = { id = SoA.3019 days = 90 random = 90 } # Demon child tombola
	}
}

# 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 = { 
			text = EVTOPTA_SOA_3002 # Pray and fast, father
			trigger = {
				NOT = { society_member_of = the_satanists }
			}
		}
		name = { 
			text = EVTOPTA_SOA_3002_SATANIST # Rejoice, father
			trigger = {
				society_member_of = the_satanists
			}
		}
		
		ai_chance = {
			factor = 100
		}
		
		if = {
			limit = { society_member_of = the_satanists }
			add_society_currency_major_effect = yes
		}
		
		trigger = {
			is_female = no
		}
		random_list = {
			50 = {
			}
			50 = {
				FROM = {
					add_character_modifier = {
						name = suspected_demon_spawn
						duration = -1
					}
				}
			}
		}
	}
	
	option = {
		name = { 
			text = EVTOPTB_SOA_3002 # Pray and fast, mother
			trigger = {
				NOT = { society_member_of = the_satanists }
			}
		}
		name = { 
			text = EVTOPTB_SOA_3002_SATANIST # Rejoice, mother
			trigger = {
				society_member_of = the_satanists
			}
		}
		
		trigger = {
			is_female = yes
		}
		
		ai_chance = {
			factor = 100
		}
		
		if = {
			limit = { society_member_of = the_satanists }
			add_society_currency_massive_effect = 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 = {
			NOT = { society_member_of = the_satanists }
			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
				NOT = { society_member_of = the_satanists }
			}
			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 = 0
				society_member_of = the_satanists
			}
			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 = 0
				society_member_of = the_satanists
			}
			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
		}
		
	   	transfer_crown_on_abdication_effect = yes
		abdicate = yes
		
		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
		}
	}
}

#############################
# Demon child tombola!
# Choose some new antics...
#############################
character_event = {
	id = SoA.3019
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		character_event = { id = SoA.3019 days = 400 random = 400 } # More fun next time!
		
		# Spawn the Witch Nanny
		if = {
			limit = {
				NOT = { has_character_flag = demon_child_non_pagan_got_nanny }
				prisoner = no
				is_incapable = no
			}
			character_event = { id = SoA.3070 }
			break = yes
		}
		
		# Try to murder a sibling (ahead in the line of succession) in bed?
		if = {
			limit = {
				age = 3
				NOT = { age = 16 }
				prisoner = no
				is_incapable = no
				is_ruler = no
				any_sibling = {
					NOT = { trait = bastard }
					NOT = { trait = incapable }
					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.3030 }
			break = yes
		}
		
		# Get some help during a war
		if = {
			limit = {
				is_ruler = yes
				war = yes
#				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
			}
			character_event = { id = SoA.3065 }
			break = yes
		}
	
		# Trigger the Sunset Invasion?
		if = {
			limit = {
				prisoner = no
				is_incapable = no
				OR = {
					is_ruler = no
					primary_title = {
						lower_tier_than = duke
					}
				}
				war = no
				has_dlc = "Sunset Invasion"
				NOR = {
					has_global_flag = aztec_explorers
					has_global_flag = aztec_arrival
					has_game_rule = {
						name = aztec_invasion
						value = off
					}
				}
				OR = {
					AND = {
						has_game_rule = {
							name = aztec_invasion
							value = historical
						}
						year = 1250
					}
					AND = {
						has_game_rule = {
							name = aztec_invasion
							value = random
						}
						total_years_played = 50
					}
					AND = {
						has_game_rule = {
							name = aztec_invasion
							value = delayed_random
						}
						year = 1000
						total_years_played = 50
					}
				}
				mother = {
					OR = {
						is_alive = no
						is_playable = no
					}
				}
				father = {
					OR = {
						is_alive = no
						is_playable = no
					}
				}
				random = 50
			}
			character_event = { id = SoA.3080 }
			break = yes
		}
	}
	
}

# 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 = slow
		remove_trait = imbecile
		remove_trait = weak
		remove_trait = feeble
		remove_trait = dull
		remove_trait = shy
		remove_trait = trusting
		add_trait = lustful
		add_trait = deceitful
		add_trait = ambitious
		add_trait = cruel
		add_trait = genius
		add_trait = possessed
		add_trait = strong
		change_diplomacy = 5
		change_martial = 5
		change_stewardship = 5
		change_intrigue = 10
		change_learning = 5
		
		if = {
			limit = {
				OR = {
					trait = naive_appeaser
					trait = underhanded_rogue
					trait = charismatic_negotiator
				}
			}
			clear_education_trait = yes
			add_trait = grey_eminence
		}
		
		if = {
			limit = {
				OR = {
					trait = amateurish_plotter
					trait = flamboyant_schemer
					trait = intricate_webweaver
				}
			}
			clear_education_trait = yes
			add_trait = elusive_shadow
		}
		
		if = {
			limit = {
				OR = {
					trait = indulgent_wastrel
					trait = thrifty_clerk
					trait = fortune_builder
				}
			}
			clear_education_trait = yes
			add_trait = midas_touched
		}
		
		if = {
			limit = {
				OR = {
					trait = misguided_warrior
					trait = tough_soldier
					trait = skilled_tactician
				}
			}
			clear_education_trait = yes
			add_trait = brilliant_strategist
		}
		
		if = {
			limit = {
				OR = {
					trait = detached_priest
					trait = martial_cleric
					trait = scholarly_theologian
				}
			}
			clear_education_trait = yes
			add_trait = mastermind_theologian
		}
		
		if = {
			limit = { has_dlc = "Mystics" }
			if = {
				limit = {
					has_character_flag = demonspawn_will_join_satanists
				}
				ROOT = {
					join_society = the_satanists
					clr_character_flag = demonspawn_will_join_satanists
				}
			}
			if = {
				limit = {
					has_character_flag = demonspawn_will_join_cold_ones
				}
				ROOT = {
					join_society = the_cold_ones
					clr_character_flag = demonspawn_will_join_cold_ones
				}
			}
			if = {
				limit = {
					has_character_flag = demonspawn_will_join_plaguebringers
				}
				ROOT = {
					join_society = the_plaguebringers
					clr_character_flag = demonspawn_will_join_plaguebringers
				}
			}
			if = {
				limit = {
					has_character_flag = demonspawn_will_join_cult_of_kali
				}
				ROOT = {
					join_society = the_cult_of_kali
					clr_character_flag = demonspawn_will_join_cult_of_kali
				}
			}
			if = {
				limit = {
					has_character_flag = demonspawn_will_join_trollcrafters
				}
				ROOT = {
					join_society = the_trollcrafters
					clr_character_flag = demonspawn_will_join_trollcrafters
				}
			}
			if = {
				limit = {
					has_character_flag = demonspawn_will_join_bacchants
				}
				ROOT = {
					join_society = the_bacchants
					clr_character_flag = demonspawn_will_join_bacchants
				}
			}
			if = {
				limit = {
					has_character_flag = demonspawn_will_join_vodouns
				}
				ROOT = {
					join_society = the_vodouns
					clr_character_flag = demonspawn_will_join_vodouns
				}
			}
			add_society_currency_massive_effect = yes
			set_society_grandmaster = yes
			
			society = {
				any_society_member = {
					limit = { NOT = { character = ROOT } }
					narrative_event = { id = SoA.3090 days = 3 }
				}
			}
		}
		
		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 = EVTOPTZ_SOA_3020
		trigger = { 
			always = yes
   		}
		 add_character_modifier = { modifier = demon_horns duration = -1 }
		ai_chance = { factor = 80 }
	}
	option = { 
		name = EVTOPTA_SOA_3020
		ai_chance = { factor = 20 }
	}
}

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 = {
			text = EVTOPTA_SOA_3021
			trigger = {
				NOT = { society_member_of = the_satanists }
			}
		}
		name = {
			text = EVTOPTA_SOA_3021_SATANIST
			trigger = {
				society_member_of = the_satanists
			}
		}
	}
}

# Demon Child tries to murder sibling in bed
character_event = {
	id = SoA.3030
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		random_sibling = {
			limit = {
				NOT = { trait = bastard }
				NOT = { trait = incapable }
				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 = {
					if = {
						limit = { NOT = { has_character_modifier = protection_spell } }
						character_event = { id = SoA.3032 } # Success
					}
					if = {
						limit = { has_character_modifier = protection_spell }
					FROM = { character_event = { id = SoA.3033 } } # Failure
					}
				}
			}
			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 = incapable
		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
		trigger = {
			NOT = { society_member_of = the_satanists }
		}
	}
	option = { 
		name = EVTOPTA_SOA_3039_SATANIST
		trigger = {
			society_member_of = the_satanists
		}
	}
}

# 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
		trigger = {
			NOT = { society_member_of = the_satanists }
		}
	}
	option = { 
		name = EVTOPTA_SOA_3039_SATANIST
		trigger = {
			society_member_of = the_satanists
		}
	}
}

# 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
		trigger = {
			NOT = { society_member_of = the_satanists }
		}
	}
	option = { 
		name = EVTOPTA_SOA_3039_SATANIST
		trigger = {
			society_member_of = the_satanists
		}
	}
}

# Demon Child recovers from maiming
character_event = {
	id = SoA.3050
	desc = EVTDESC_SOA_3050
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	
	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
		}
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.05
			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
	is_triggered_only = yes
	
	trigger = {
		trait = blinded
#		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.05
			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
	is_triggered_only = yes
	
	trigger = {
		trait = eunuch
#		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.05
			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
	is_triggered_only = yes
		
	trigger = {
		NOT = { has_character_modifier = old_age }
		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
		}
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.05
			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
	is_sick = yes
	
	trigger = {
#		trait = possessed
		has_dlc = "Sons of Abraham"
		has_epidemic = yes
		
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	mean_time_to_happen = {
		months = 1
		modifier = {
			factor = 12
			NOT = { has_character_flag = demon_child_non_pagan }
		}
	}
	
	option = {
		name = EVTOPTA_SOA_3054
		
		if = {
			limit = {
				trait = has_bubonic_plague
			}
			remove_trait = has_bubonic_plague
			set_character_flag = achievement_i_got_better
		}
		
		cure_illness = yes
		
		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
	is_triggered_only = yes
	
	prisoner = yes
	
	trigger = {
#		trait = possessed
		has_dlc = "Sons of Abraham"
		OR = {
			has_character_modifier = voice_of_satan
			has_character_flag = demon_child_non_pagan
		}
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.05
			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
	
	is_triggered_only = yes
	
	immediate = {
		location = {
			ROOT = {
				create_character = {
					dynasty = none
					female = yes
					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
					}
					add_character_modifier = {
						name = known_witch
						duration = -1
					}
					
					if = {
						limit = { has_dlc = "Mystics" }
						religion = ROOT
						join_society = the_satanists
					}
					
					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
					female = yes
					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
					}
					add_character_modifier = {
						name = known_witch
						duration = -1
					}
					
					if = {
						limit = { has_dlc = "Mystics" }
						religion = ROOT
						join_society = the_satanists
					}
					
					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
					female = yes
					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
					}
					add_character_modifier = {
						name = known_witch
						duration = -1
					}
					
					if = {
						limit = { has_dlc = "Mystics" }
						religion = ROOT
						join_society = the_satanists
					}
					
					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
	
	is_triggered_only = yes
	
	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
			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 = { has_dlc = "Mystics" }
					join_society = the_satanists
				}
				
				
				
				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
			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 = { has_dlc = "Mystics" }
					join_society = the_satanists
				}
				
				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 = 15
	has_character_flag = witch_nanny
	has_dlc = "Sons of Abraham"
	is_married = no
	
	trigger = {
		is_ruler = no
		is_consort = no
		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
	min_age = 6
	max_age = 15
	has_character_flag = demon_child_non_pagan_got_nanny
	
	trigger = {
		has_dlc = "Sons of Abraham"
		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 = {
			text = EVTOPTA_SOA_3077
			trigger = {
				NOT = { society_member_of = the_satanists }
			}
		}
		name = {
			text = EVTOPTA_SOA_3078
			trigger = {
				society_member_of = the_satanists
			}
		}
	}
}

# 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
	}
}

# The Demon Child travels to the New World and returns as the Aztec Emperor (somewhat altered descriptions in the Sunset Invasion)
character_event = {
	id = SoA.3080

	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		set_global_flag = demon_child_to_aztecs
		
		if = {
			limit = { society_member_of = the_satanists }
			society = {
				any_society_member = {
					limit = {
						NOT = { character = ROOT }
						NOT = { is_close_relative = ROOT }
						NOT = { dynasty = ROOT }
					}
					character_event = { id = SoA.3082 days = 3 }
				}
			}
		}
		
		any_close_relative = {
			limit = {
				NOT = { character = ROOT }
			}
			character_event = { id = SoA.3083 days = 3 }
		}
		
		any_dynasty_member = {
			limit = {
				is_offmap_ruler = no
				NOT = { character = ROOT }
				NOT = { is_close_relative = ROOT }
			}
			character_event = { id = SoA.3083 days = 3 }
		}
		
		if = {
			limit = { is_ruler = yes }
			abdicate = yes
		}
		
		activate_title = { title = e_mexikha status = yes }
		
		culture = nahuatl
		religion = aztec
		
		e_mexikha = {
			grant_title = ROOT
		}
		
		set_government_type = feudal_government
		
		e_mexikha = {
			add_law = succ_primogeniture
			add_law = agnatic_succession
			if = {
				limit = {
					has_dlc = "Zeus"
				}
				add_law = revoke_title_law_2
			}
			if = {
				limit = {
					NOT = { has_dlc = "Zeus" }
				}
				add_law = crown_authority_1
			}
		}
		
		random_list = {
			100 = {
				1 = { province_event = { id = SoA.3081 days = 200 } } # Vestisland
			}
			100 = {
				9 = { province_event = { id = SoA.3081 days = 200 } } # Connacht
			}
			100 = {
				35 = { province_event = { id = SoA.3081 days = 200 } } # Inse Gall
			}
			100 = {
				31 = { province_event = { id = SoA.3081 days = 200 } } # Cornwall
			}
			100 = {
				104 = { province_event = { id = SoA.3081 days = 200 } } # Cornouaille
			}
			100 = {
				149 = { province_event = { id = SoA.3081 days = 200 } } # Bordeaux
			}
			100 = {
				156 = { province_event = { id = SoA.3081 days = 200 } } # Coruna
			}
			100 = {
				162 = { province_event = { id = SoA.3081 days = 200 } } # Silves
			}
			100 = {
				841 = { province_event = { id = SoA.3081 days = 200 } } # Tangier
			}
			100 = {
				845 = { province_event = { id = SoA.3081 days = 200 } } # Anti-Atlas
			}
		}
	}
}

# First Landing - Herolds of the Demon-led Aztecs
province_event = {
	id = SoA.3081
	desc = EVTDESC_SOA_3081
	
	picture = GFX_evt_aztec_explorers
	border = GFX_event_normal_frame_war

	is_triggered_only = yes
	
	trigger = {
		FROM = { is_alive = yes }
	}
	
	immediate = {
		log = "AZTEC INVASION IMMEDIATE SoA.3081"
		set_global_flag = aztec_explorers
		set_province_flag = aztec_explorers
		
		narrative_event = { id = SSI.2 days = 7 }
	}
	
	option = {
		name = EVTOPTA_SSI_001
	}
}

# Satanists are notified about the departure of the Demon Child
narrative_event = {
	id = SoA.3082
	title = EVTTITLE_SOA_3082
	desc = EVTDESC_SOA_3082
	picture = GFX_evt_throne_room_mesoamerican
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_alive = yes }
	}
	
	option = {
		name = {
			text = EVTOPTA_SOA_3082_MUSLIM
			trigger = {
				religion_group = muslim
			}
		}
		name = {
			text = EVTOPTA_SOA_3082
			trigger = {
				NOT = { religion_group = muslim }
			}
		}
	}
}

# Relatives are notified about the departure of the Demon Child
narrative_event = {
	id = SoA.3083
	title = EVTTITLE_SOA_3083
	desc = EVTDESC_SOA_3083
	picture = GFX_evt_throne_room_mesoamerican
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_alive = yes }
	}
	
	option = {
		name = {
			text = EVTOPTA_SOA_3082
			trigger = {
				society_member_of = the_satanists
			}
		}
		name = {
			text = EVTOPTA_SOA_3083
			trigger = {
				NOT = { society_member_of = the_satanists }
			}
		}
	}
}

# Satanists are notified of the coming of age of the Demon Child
narrative_event = {
	id = SoA.3090
	title = EVTTITLE_SOA_3090
	desc = EVTDESC_SOA_3090
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_alive = yes }
	}
	
	option = {
		name = {
			text = EVTOPTA_SOA_3082_MUSLIM
			trigger = {
				religion_group = muslim
				NOT = { FROM = { is_child_of = ROOT } }
			}
		}
		name = {
			text = EVTOPTA_SOA_3082
			trigger = {
				NOT = { religion_group = muslim }
				NOT = { FROM = { is_child_of = ROOT } }
			}
		}
		name = {
			text = EVTOPTA_SOA_3090_CHILD
			trigger = {
				FROM = { is_child_of = ROOT }
			}
		}
	}
}

# Satanists are notified of the death of the Demon Child
# Fired from 'on_death'
character_event = {
	id = SoA.3091
	hide_window = yes
	
	is_triggered_only = yes
	
	trigger = {
		has_character_flag = demon_child_non_pagan
	}
	
	immediate = {
		if = {
			limit = { society_member_of = the_satanists }
			society = {
				any_society_member = {
					limit = { NOT = { character = ROOT } }
					narrative_event = { id = SoA.3092 }
				}
			}
		}
	}
}

narrative_event = {
	id = SoA.3092
	title = EVTTITLE_SOA_3092
	desc = EVTDESC_SOA_3092
	picture = GFX_evt_death
	border = GFX_event_narrative_frame_intrigue
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SOA_3092
	}
}
