# Carnal sins
country_event = {
	id = 9450
	title = "EVTNAME9450"
	desc = "EVTDESC9450"
	picture = RELIGION_eventPicture
	
	trigger = {
		papacy_active = yes
		has_heir = no
		has_regency = no
		is_female = no
		is_lesser_in_union = no
		religion = catholic
		government = monarchy
		dip = 2
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 400
		
		modifier = {
			factor = 0.5
			dip = 4
		}
	}
	
	option = {
		name = "EVTOPTA9450"
		define_heir = {
			dynasty = ROOT
			claim = 30
		}
		add_papal_influence = -5
		add_reform_desire = 0.01
	}
	option = {
		name = "EVTOPTB9450"
		add_papal_influence = 2
	}
}

# A beloved heir dies
country_event = {
	id = 9451
	title = "EVTNAME9451"
	desc = "EVTDESC9451"
	picture = DEATH_OF_HEIR_eventPicture
	
	trigger = {
		has_heir = yes
		heir_claim = 90
		is_female = no
		NOT = {
			is_lesser_in_union = yes
		}
		has_regency = no
		government = monarchy
		NOT = { government = elective_monarchy }
		any_owned_province = {
			num_free_building_slots = 1
		}
	}
	
	mean_time_to_happen = {
		months = 3600
	}
	
	option = {
		name = "EVTOPTA9451"
		kill_heir = yes
		random_owned_province = {
			limit = {
				NOT = {
					has_building = temple
					num_free_building_slots = 1
				}
			}
			add_building = temple
		}
	}
	
	option = {
		name = "EVTOPTB9451"
		kill_heir = yes
		define_heir = {
			dynasty = ROOT
			claim = 30
		}
	}
}

# Palace Coup
country_event = {
	id = 9452
	title = "EVTNAME9452"
	desc = "EVTDESC9452"
	picture = ASSASSINATION_eventPicture
	
	trigger = {
		has_heir = yes
		heir_age = 15
		heir_claim = 90
		NOT = {
			is_lesser_in_union = yes
			stability = -2
		}
		has_regency = no
		government = monarchy
		NOT = { government = elective_monarchy }
	}
	
	mean_time_to_happen = {
		months = 200
		modifier = {
			factor = 0.5
			is_at_war = yes
		}
	}
	
	option = {
		name = "EVTOPTA9452"
		kill_ruler = yes
		add_country_modifier = {
			name = "illegitimate_ruler"
			duration = 1825
		}
	}
	
	option = {
		name = "EVTOPTB9452"
		kill_heir = yes
	}
}

# The Weeping Song
country_event = {
	id = 9453
	title = "EVTNAME9453"
	desc = "EVTDESC9453"
	picture = COURT_eventPicture
	
	trigger = {
		has_heir = yes
		has_wartaxes = yes
		treasury = 40
		war_exhaustion = 4
		has_regency = no
		government = monarchy
		heir_age = 4
		NOT = { government = elective_monarchy }
	}
	
	mean_time_to_happen = {
		months = 25
	}
	
	option = {
		name = "EVTOPTA9453"
		add_treasury = -40
		add_war_exhaustion = -2
	}
	
	option = {
		name = "EVTOPTB9453"
		add_manpower = 1
	}
}

# Springtime
country_event = {
	id = 9454
	title = "EVTNAME9454"
	desc = "EVTDESC9454"
	picture = COURT_eventPicture
	
	trigger = {
		government = monarchy
		is_month = 3
		NOT = { is_month = 6 }
		has_heir = no
		is_female = no
		is_lesser_in_union = no
		has_regency = no
		any_known_country = {
			religion = ROOT
			government = monarchy
			is_lesser_in_union = no
			alliance_with = ROOT
			ai = yes
		}
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 400
	}
	
	option = {
		name = "EVTOPTA9454"
		define_heir = {
			dynasty = ROOT
			claim = 30
		}
	}
	option = {
		name = "EVTOPTB9454"
		trigger = {
			any_known_country = {
				religion = ROOT
				government = monarchy
				is_lesser_in_union = no
				alliance_with = ROOT
				NOT = { marriage_with = ROOT }
				ai = yes
			}
		}
		random_known_country = {
			limit = {
				religion = ROOT
				government = monarchy
				is_lesser_in_union = no
				alliance_with = ROOT
				NOT = { marriage_with = ROOT }
				ai = yes
			}
			create_marriage = ROOT
		}
	}
}

# Soirée
country_event = {
	id = 9455
	title = "EVTNAME9455"
	desc = "EVTDESC9455"
	picture = COURT_eventPicture
	
	trigger = {
		has_heir = no
		is_lesser_in_union = no
		government = monarchy
		has_regency = no
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 800
	}
	
	option = {
		name = "EVTOPTA9455"
		trigger = {
			is_female = no
		}
		define_heir = {
			dynasty = ROOT
			claim = 30
		}
		add_prestige = -10
	}
	option = {
		name = "EVTOPTB9455"
		trigger = {
			is_female = yes
		}
		define_heir = {
			dynasty = ROOT
			claim = 30
		}
		add_prestige = -10
	}
	option = {
		name = "EVTOPTC9455"
		random_list = {
			10 = { create_advisor = theologian }
			10 = { create_advisor = artist }
			10 = { create_advisor = philosopher }
		}
		add_prestige = -5
	}
}

# Heir Falls ill
country_event = {
	id = 9456
	title = "EVTNAME9456"
	desc = "EVTDESC9456"
	picture = PLAGUE_eventPicture
	
	trigger = {
		has_heir = yes
		government = monarchy
		is_lesser_in_union = no
		NOT = { government = elective_monarchy }
	}
	
	mean_time_to_happen = {
		months = 2400
	}
	option = {
		name = "EVTOPTA9456"
		add_years_of_income = -0.2
		random_list = {
			50 = { kill_heir = yes}
			50 = { add_legitimacy = 5}
		}
	}
	
	option = {
		name = "EVTOPTB9456"
		random_list = {
			75 = { kill_heir = yes}
			25 = { add_legitimacy = 30}
		}
	}
}

# Child in the Reeds
country_event = {
	id = 9457
	title = "EVTNAME9457"
	desc = "EVTDESC9457"
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		NOT = {
			has_heir = yes
			is_lesser_in_union = yes
		}
		government = monarchy
		religion_group = christian
		has_regency = no
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 1500
		modifier = {
			factor = 0.7
			is_defender_of_faith = yes
		}
	}
	
	option = {
		name = "EVTOPTA9457"
		define_heir = {
			claim = 20
			dynasty = ROOT
			adm = 1
			dip = 1
			mil = 1
		}
		add_prestige = -5
		add_country_modifier = {
			name = adopted_heir
			duration = 1825
		}
	}
	option = {
		name = "EVTOPTB9457"
		add_treasury = 5
	}
}

# Tournament
country_event = {
	id = 9458
	title = "EVTNAME9458"
	desc = "EVTDESC9458"
	picture = TOURNAMENT_eventPicture
	
	trigger = {
		has_heir = yes
		heir_age = 15
		NOT = {
			is_year = 1450
			is_lesser_in_union = yes
		}
		NOT = {
			has_country_flag = last_jousting_tournament_held
		}
		army_tradition =  20
		technology_group = western
	}
	
	mean_time_to_happen = {
		months = 2400
		modifier = {
			factor = 0.9
			army_tradition = 40
		}
	}
	
	option = {
		name = "EVTOPTA9458"
		random_list = {
			50 = { add_years_of_income = 0.05 }
			45 = { add_legitimacy = 20}
			5 = { kill_heir = yes}
		}
	}
	
	option = {
		name = "EVTOPTB9458"
		add_adm_power = 20
	}
	
	option = {
		name = "EVTOPTC9458"
		add_prestige = 5
	}
}


# Hunting accident
country_event = {
	id = 9459
	title = "EVTNAME9459"
	desc = "EVTDESC9459"
	picture = DEATH_OF_HEIR_eventPicture
	
	trigger = {
		has_heir = yes
		heir_age = 15
		is_lesser_in_union = no
		NOT = { government = elective_monarchy }
	}
	mean_time_to_happen = {
		months = 2700
	}
	option = {
		name = "EVTOPTA9459"
		kill_heir = yes
		add_stability = -1
	}
	option = {
		name = "EVTOPTB9459"
		kill_heir = yes
		add_prestige = -10
	}
}


# Heir goes out at night
country_event = {
	id = 9460
	title = "EVTNAME9460"
	desc = "EVTDESC9460"
	picture = COURT_eventPicture
	
	trigger = {
		capital_scope = { continent = europe }
		religion_group = christian
		has_heir = yes
		heir_age = 15
		is_lesser_in_union = no
		NOT = { government = elective_monarchy }
	}
	
	mean_time_to_happen = {
		months = 2000
		
	}
	option = {
		name = "EVTOPTA9460"
		add_prestige = -20
	}
	
	option = {
		name = "EVTOPTB9460"
		add_heir_claim = -10
	}
}

# Scheming Bureaucracy
country_event = {
	id = 9462
	title = "EVTNAME9462"
	desc = "EVTDESC9462"
	picture = DEBATE_REPUBLICAN_eventPicture
	
	trigger = {
		government = monarchy
		is_subject = no
		adm_tech = 65
		adm_power = 200
		has_factions = no
	}
	
	mean_time_to_happen = {
		months = 5000
	}
	
	option = {
		name = "EVTOPTA9462"
		ai_chance = { factor = 95 }
		add_adm_power = -100
		add_stability = -1
	}
	option = {
		name = "EVTOPTB9462"
		ai_chance = { factor = 5 }
		kill_ruler = yes
		add_stability = -6
		change_government = bureaucratic_despotism
	}
}

# The Family
country_event = {
	id = 9463
	title = "EVTNAME9463"
	desc = "EVTDESC9463"
	picture = GOOD_WITH_MONARCH_eventPicture
	
	trigger = {
		stability = 3
		treasury = 100
		government = monarchy
		has_regency = no
		any_known_country = {
			dynasty = ROOT
			government = monarchy
			NOT = { stability = -2 }
			NOT = { senior_union_with = ROOT }
			NOT = { junior_union_with = ROOT }
		}
	}
	
	mean_time_to_happen = {
		months = 18
	}
	
	option = {
		name = "EVTOPTA9463"
		random_country = {
			limit = {
				dynasty = ROOT
				government = monarchy
				NOT = { stability = -2 }
				NOT = { senior_union_with = ROOT }
				NOT = { junior_union_with = ROOT }
			}
			country_event = { id = 9476 }
			add_opinion = { who = ROOT modifier = opinion_dynastic_helper }
		}
		add_treasury = -100
		add_prestige = 10
	}
	option = {
		name = "EVTOPTB9463"
		random_country = {
			limit = { 
				dynasty = ROOT
				government = monarchy
				NOT = { stability = -2 }
				NOT = { senior_union_with = ROOT }
				NOT = { junior_union_with = ROOT }
			}
			country_event  = { id = 9477 }
			add_opinion = { who = ROOT modifier = opinion_ignore_dynasty }
		}
	}
}

# Regent usurps throne
country_event = {
	id = 9468
	title = "EVTNAME9468"
	desc = "EVTDESC9468"
	picture = DEATH_OF_HEIR_eventPicture
	
	trigger = {
		stability = 3
		NOT = {
			overextension_percentage = 0.05
			is_lesser_in_union = yes
		}
		government = monarchy
		has_regency = yes
		legitimacy = 100
		has_heir = yes
	}
	
	mean_time_to_happen = {
		months = 700
	}
	
	option = {
		name = "EVTOPTA9468"
		kill_heir = yes
		define_ruler = {
			adm = 0
			dip = 0
			mil = 0
		}
		add_stability = -3
		add_legitimacy = -90
		add_country_modifier = {
			name = "plutocracy_modifier"
			duration = 7300
		}
		add_country_modifier = {
			name = "centralization_modifier"
			duration = 3650
		}
	}
	option = {
		name = "EVTOPTB9468"
		add_stability = -1
	}
}

# Born under a star
country_event = {
	id = 9469
	title = "EVTNAME9469"
	desc = "EVTDESC9469"
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		government = monarchy
		technology_group = western
		is_lesser_in_union = no
		has_heir = no
		has_regency = no
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 2000
	}
	
	option = {
		name = "EVTOPTA9469"
		define_heir = {
			dynasty = ROOT
			name = "Alexander"
			claim = 100
			mil = 6
		}
	}
	option = {
		name = "EVTOPTB9469"
		define_heir = {
			dynasty = ROOT
			name = "Caesar"
			claim = 100
			adm = 6
		}
	}
	option = {
		name = "EVTOPTC9469"
		define_heir = {
			dynasty = ROOT
			name = "Johan"
			claim = 100
			dip = 6
		}
	}	
}

# Heir is of our Dynasty
country_event = {
	id = 9470
	title = "EVTNAME9470"
	desc = "EVTDESC9470"
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		government = monarchy
		has_regency = no
		is_lesser_in_union = no
		num_of_royal_marriages = 4
		any_country = {
			government = monarchy
			marriage_with = ROOT
			has_heir = no
			is_lesser_in_union = no
		}
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 1500
		modifier = {
			factor = 0.9
			num_of_royal_marriages = 6
		}
	}
	
	option = {
		name = "EVTOPTA9470"
		trigger = {
			NOT = { dynasty = "von Habsburg" }
		}
		random_country = {
			limit = {
				government = monarchy
				marriage_with = ROOT
				has_heir = no
				is_lesser_in_union = no
			}
			define_heir = {
				dynasty = ROOT
			}
		}
	}
	option = {
		name = "EVTOPTB9470"
		trigger = {
			dynasty = "von Habsburg"
		}
		random_country = {
			limit = {
				government = monarchy
				marriage_with = ROOT
				has_heir = no
				is_lesser_in_union = no
			}
			define_heir = {
				dynasty = ROOT
			}
		}
	}
}

# The Family Opt 1
country_event = {
	id = 9476
	title = "EVTNAME9476"
	desc = "EVTDESC9476"
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA9476"
		add_treasury = 100
		random_list = {
			10 = {
				add_stability = 1
			}
			10 = {
				add_stability = 2
			}
			
			10 = { 
				add_stability = 3
			}
		}
	}
}

# The Family Opt 2
country_event = {
	id = 9477
	title = "EVTNAME9477"
	desc = "EVTDESC9477"
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA9476"
		random_list = {
			10 = {
				add_stability = 1
			}
			10 = {
				kill_ruler = yes
			}
			10 = {
				add_stability = -2
			}
		}
	}
}

# Fear and Loathing 1/3
province_event = {
	id = 9481
	title = "EVTNAME9481"
	desc = "EVTDESC9481"
	picture = ASSASSINATION_eventPicture
	
	trigger = {
		papacy_active = yes
		is_capital = yes
		owner = {
			has_regency = no
			has_heir = yes
			religion_group = christian
			NOT = { government = elective_monarchy }
			is_lesser_in_union = no
			NOT = { has_country_flag = murdering_bastard }
			NOT = { has_country_flag = contained_insanity }
			NOT = { heir_age = 3 }
		}
	}
	
	mean_time_to_happen = {
		months = 4000
	}
	
	option = {
		name = "EVTOPTA9481"
		owner = {
			kill_heir = yes
			set_country_flag = murdering_bastard
		}
	}
	
	option = {
		name = "EVTOPTB9481"
		owner = {
			add_papal_influence = 5
			set_country_flag = contained_insanity
		}
	}
}

# Fear and Loathing 2/3
country_event = {
	id = 9482
	title = "EVTNAME9482"
	desc = "EVTDESC9482"
	picture = DEATH_OF_HEIR_eventPicture
	
	trigger = {
		has_country_flag = murdering_bastard
		NOT = { has_country_flag = contained_insanity }
		has_regency = no
		is_lesser_in_union = no
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA9482"
		kill_ruler = yes
		clr_country_flag = murdering_bastard
	}
	
	option = {
		name = "EVTOPTB9482"
		add_prestige = -5
		add_treasury = -100
		set_country_flag = contained_insanity
	}
}

# Fear and Loathing 3/3
country_event = {
	id = 9483
	title = "EVTNAME9483"
	desc = "EVTDESC9483"
	picture = DEATH_OF_HEIR_eventPicture

	trigger = {
		has_country_flag = contained_insanity
		has_regency = no
		is_lesser_in_union = no
	}
	
	mean_time_to_happen = {
		months = 300
	}
	
	option = {
		name = "EVTOPTA9483"
		add_stability = -3
		add_prestige = -20
		clr_country_flag = contained_insanity
	}
	
	option = {
		name = "EVTOPTB9483"
		kill_ruler = yes
		add_country_modifier = {
			name = "relief_from"
			duration = 3650
		}
		clr_country_flag = contained_insanity
	}
}

# Fear and Loathing removal on ruler death, ontriggered
country_event = {
	id = 9492
	title = "EVTNAME9492"
	desc = "EVTDESC9492"
	picture = DEATH_OF_HEIR_eventPicture
	
	trigger = {
		OR = {
			has_country_flag = contained_insanity
			has_country_flag = murdering_bastard
		}
	}
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA9492"
		add_country_modifier = {
			name = "relief_from"
			duration = 3650
		}
		clr_country_flag = contained_insanity
		clr_country_flag = murdering_bastard
	}
}

# Wedding bells
country_event = {
	id = 9484
	title = "EVTNAME9484"
	desc = "EVTDESC9484"
	picture = GOOD_WITH_MONARCH_eventPicture
	
	trigger = {
		prestige = 30
		government = monarchy
		is_lesser_in_union = no
		is_at_war = no
		NOT = {
			has_regency = yes
			has_heir = yes
			is_female = yes
			num_of_royal_marriages = 1
			overextension_percentage = 0.01
		}
		any_known_country = {
			religion = ROOT
			government = monarchy
			is_lesser_in_union = no
			alliance_with = ROOT
			ai = yes
		}
	}
	
	mean_time_to_happen = {
		months = 500
	}
	
	option = {
		name = "EVTOPTA9484"   #Time to settle down
		random_country = {
			limit = {
				religion = ROOT
				government = monarchy
				is_lesser_in_union = no
				alliance_with = ROOT
				ai = yes
			}
			create_marriage = ROOT
		}
	}
	
	option = {
		name = "EVTOPTB9484"  #No
		add_prestige = 5
		add_country_modifier = {
			name = "sought_after_bachelor"
			duration = -1
		}
	}
}

# A modest proposal
country_event = {
	id = 9485
	title = "EVTNAME9485"
	desc = "EVTDESC9485"
	picture = DIPLOMACY_eventPicture
	
	trigger = {
		any_known_country = {
			has_country_modifier = sought_after_bachelor
			is_lesser_in_union = no
			government = monarchy
			religion_group = ROOT
		}
		government = monarchy
		is_lesser_in_union = no
	}
	
	mean_time_to_happen = {
		months = 400
	}
	
	option = {
		name = "EVTOPTA9485"
		random_country = {
			limit = {
				has_country_modifier = sought_after_bachelor
				religion_group = ROOT
			}
			random_list = {
				20 = { country_event = { id = 9486 } }
				80 = { country_event = { id = 9487 } }
			}
		}
		add_treasury = -15
		add_dip_power = -10
	}
	
	option = {
		name = "EVTOPTB9485"
		add_treasury = 10
		add_adm_power = 10
	}
}

# Wedding bells
country_event = {
	id = 9486
	title = "EVTNAME9486"
	desc = "EVTDESC9486"
	picture = GOOD_WITH_MONARCH_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA9486"
		create_marriage = FROM
		add_opinion = { who = FROM modifier = opinion_marriage_offer }
		remove_country_modifier = sought_after_bachelor
	}
	
	option = {
		name = "EVTOPTB9486"
		reverse_add_opinion = { who = FROM modifier = opinion_witchcraft }
		random_list = {
			10 = { kill_ruler = yes }
			10 = { add_prestige = -5 }
		}
	}
}

# Wedding bells
country_event = {
	id = 9487
	title = "EVTNAME9487"
	desc = "EVTDESC9487"
	picture = GOOD_WITH_MONARCH_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA9487"
		create_marriage = FROM
		add_opinion = { who = FROM modifier = opinion_united_dynasties }
		remove_country_modifier = sought_after_bachelor
	}
	
	option = {
		name = "EVTOPTB9487"
		reverse_add_opinion = { who = FROM modifier = opinion_refused_marriage }
		random_list = {
			10 = { kill_ruler = yes }
			10 = { add_prestige = -5 }
		}
	}
}

#Last war was a failure
country_event = {
	id = 9488
	title = "EVTNAME9488"
	desc = "EVTDESC9488"
	picture = MILITARY_CAMP_eventPicture
	
	trigger = {
		government = monarchy
		NOT = { government = elective_monarchy }
		has_heir = yes
		heir_age = 20
		any_known_country = {
			truce_with = ROOT
		}
		is_at_war = no
		is_lesser_in_union = no
		war_exhaustion = 12
	}
	
	mean_time_to_happen = {
		months = 300
	}
	
	option = {
		name = "EVTOPTA9488"
		kill_ruler = yes
		add_war_exhaustion = -4
		add_stability = 1
	}
	
	option = {
		name = "EVTOPTB9488"
		kill_heir = yes
		add_war_exhaustion = -2
	}
}

# The Moon
country_event = {
	id = 9489
	title = "EVTNAME9489"
	desc = "EVTDESC9489"
	picture = IMPORTANT_STATUE_eventPicture
	
	trigger = {
		war_exhaustion = 4
		adm = 3
	}
	
	mean_time_to_happen = {
		months = 3000
	}
	
	option = {
		name = "EVTOPTA9489"
		add_prestige = 5
	}
	
	option = {
		name = "EVTOPTB9489"
		add_adm_power = 25
	}
}

# Seeing the real you
country_event = {
	id = 9490
	title = "EVTNAME9490"
	desc = "EVTDESC9490"
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		is_lesser_in_union = no
		government = monarchy
		has_heir = no
		is_female = no
		has_regency = no
		num_of_royal_marriages = 1
		NOT = {
			has_country_modifier = a_woman_scorned
		}
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 1400
	}
	
	option = {
		name = "EVTOPTA9490"
		define_heir = {
			dynasty = ROOT
		}
	}
	
	option = {
		name = "EVTOPTB9490"
		add_years_of_income = 0.5
		add_country_modifier = {
			name = "a_woman_scorned"
			duration = 1825
		}
	}
}

### Suggestions by Ex Mudder, scripted by Sara Wendel-Örtqvist

namespace = dynastic_events

# Lux Stella
country_event = {
	id = dynastic_events.1
	title = dynastic_events.1.t
	desc = dynastic_events.1.d
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		has_heir = no
		ruler_age = 40
		government = monarchy
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 500
		
		modifier = {
			factor = 0.5
			ruler_age = 50
		}
		modifier = {
			factor = 0.5
			ruler_age = 60
		}
		modifier = {
			factor = 0.5
			ruler_age = 70
		}
		modifier = {
			factor = 0.5
			ruler_age = 80
		}
		modifier = {
			factor = 0.5
			ruler_age = 90
		}
	}
	
	option = {
		name = dynastic_events.1.a
		define_heir = {
			name = "Elisabeth"
			dynasty = ROOT
			claim = 50
			female = yes
			adm = 4
			dip = 3
			mil = 3
		}
	}
	
	option = {
		name = dynastic_events.1.b
		define_heir = {
			dynasty = ROOT
			name = "Caterine"
			claim = 50
			adm = 3
			dip = 3
			mil = 4
			female = yes
		}
	}
	option = {
		name = dynastic_events.1.c
		define_heir = {
			dynasty = ROOT
			claim = 50
			adm = 3
			dip = 4
			mil = 3
			female = yes
		}
	}
	option = {
		name = dynastic_events.1.e
		define_heir = {
			dynasty = ROOT
			name = "Sara"
			claim = 50
			adm = 3
			dip = 3
			mil = 4
			female = yes
		}
	}
}

# Newborn Daughter
country_event = {
	id = dynastic_events.2
	title = dynastic_events.2.t
	desc = dynastic_events.2.d
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		has_heir = no
		ruler_age = 20
		government = monarchy
		NOT = {
			has_country_modifier = dyn_newborn_daughter
		}
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 500
	}
	
	option = {
		name = dynastic_events.2.a
		add_legitimacy = -10
		if = {
			limit = {
				religion = catholic
			}
			add_papal_influence = -10
		}
		if = {
			limit = {
				religion_group = muslim
			}
			add_piety = -0.10
		}
		define_heir = {
			dynasty = ROOT
			female = yes
			claim = 50
		}
	}
	
	option = {
		name = dynastic_events.2.b
		add_country_modifier = {
			name = dyn_newborn_daughter
			duration = 365
		}
	}
}

# Talented and Ambitious Daughter
country_event = {
	id = dynastic_events.3
	title = dynastic_events.3.t
	desc = dynastic_events.3.d
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		has_heir = no
		ruler_age = 40
		government = monarchy
		NOT = { tag = JMN }
	}
	
	mean_time_to_happen = {
		months = 500
		
		modifier = {
			factor = 0.5
			ruler_age = 50
		}
		
		modifier = {
			factor = 0.5
			ruler_age = 60
		}
		modifier = {
			factor = 0.5
			ruler_age = 70
		}
		modifier = {
			factor = 0.5
			ruler_age = 80
		}
		modifier = {
			factor = 0.5
			ruler_age = 90
		}
	}
	
	option = {
		name = dynastic_events.3.a
		add_legitimacy = -10
		if = {
			limit = {
				religion = catholic
			}
			add_papal_influence = -10
		}
		if = {
			limit = {
				religion_group = muslim
			}
			add_piety = -0.10
		}
		define_heir = {
			dynasty = ROOT
			age = 13
			adm = 3
			dip = 3
			mil = 3
			claim = 50
			female = yes
		}
	}
	
	option = {
		name = dynastic_events.3.b
		random_owned_province = {
			limit = {
				is_capital = yes
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
		}
	}
}

# The Ruler's Daughter
country_event = {
	id = dynastic_events.4
	title = dynastic_events.4.t
	desc = dynastic_events.4.d
	picture = NEW_HEIR_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		has_heir = no
		num_of_cities = 2
		has_regency = yes
		government = monarchy
		religion_group = christian
		capital_scope = {
			continent = europe
		}
		any_known_country = {
			government = monarchy
			religion_group = christian
			has_regency = no
			is_subject = no
			num_of_cities = ROOT
			is_female = no
			NOT = { has_country_flag = dyn_woman_pretender_flag }
			capital_scope = {
				continent = europe
			}
			NOT = {
				war_with = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		hidden_effect = {
			random_known_country = {
				limit = {
					government = monarchy
					has_regency = no
					is_subject = no
					num_of_cities = ROOT
					is_female = no
					religion_group = christian
					capital_scope = {
						continent = europe
					}
					NOT = {
						war_with = ROOT
					}
				}
				set_country_flag = dyn_woman_pretender_flag
			}
		}
	}
	
	option = {
		name = dynastic_events.4.a
		if = {
			limit = {
				religion = catholic
			}
			add_papal_influence = -10
		}
		define_ruler = {
			dynasty = ROOT
			age = 20
			adm = 3
			dip = 3
			mil = 3
			claim = 50
			female = yes
		}
		random_known_country = {
			limit = {
				has_country_flag = dyn_woman_pretender_flag
			}
			add_casus_belli = {
				target = ROOT
				type = cb_restore_personal_union
				months = 12
			}
			add_opinion = {
				who = ROOT
				modifier = opinion_spurned_heir
			}
			clr_country_flag = dyn_woman_pretender_flag
		}
	}
	
	option = {
		name = dynastic_events.4.b
		random_known_country = {
			limit = {
				has_country_flag = dyn_woman_pretender_flag
			}
			clr_country_flag = dyn_woman_pretender_flag
			add_opinion = {
				who = ROOT
				modifier = opinion_choose_heir
			}
			ROOT = {
				define_ruler = {
					dynasty = PREV
					age = 20
				}
			}
		}
		random_owned_province = {
			limit = {
				is_capital = no
			}
			spawn_rebels = {
				type = pretender_rebels
				size = 2
				female = yes
			}
		}
	}
}

# Offer Personal Union
country_event = {
	id = dynastic_events.5
	title = dynastic_events.5.t
	desc = dynastic_events.5.d
	picture = DIPLOMACY_eventPicture
	
	trigger = {
		has_heir = no
		government = monarchy
		is_subject = no
		ruler_age = 16
		NOT = {
			ruler_age = 40
		}
		any_neighbor_country = {
			government = monarchy
			has_heir = no
			ruler_age = 16
			NOT = {
				ruler_age = 40
			}
			NOT = {
				OR = {
					has_opinion_modifier = {
						who = ROOT
						modifier = opinion_spurned_pu
					}
					reverse_has_opinion_modifier = {
						who = ROOT
						modifier = opinion_spurned_pu
					}
				}
			}
			OR = {
				AND = {
					is_female = no
					ROOT = {
						is_female = yes
					}
				}
				AND = {
					is_female = yes
					ROOT = {
						is_female = no
					}
				}
			}
			OR = {
				dynasty = ROOT
				culture_group = ROOT
			}
			has_opinion = { who = ROOT value = 75 }
			reverse_has_opinion = { who = ROOT value = 75 }
			is_subject = no
		}
	}
	
	mean_time_to_happen = {
		months = 500
	}
	
	option = {
		name = dynastic_events.5.a
		random_neighbor_country = {
			limit = {
				government = monarchy
				has_heir = no
				ruler_age = 16
				NOT = {
					ruler_age = 40
				}
				OR = {
					AND = {
						is_female = no
						ROOT = {
							is_female = yes
						}
					}
					AND = {
						is_female = yes
						ROOT = {
							is_female = no
						}
					}
				}
				OR = {
					dynasty = ROOT
					culture_group = ROOT
				}
				has_opinion = { who = ROOT value = 75 }
				reverse_has_opinion = { who = ROOT value = 75 }
				is_subject = no
			}
			country_event = {
				id = dynastic_events.6
				tooltip = dynastic_events.6.t
			}
		}
	}
	
	option = {
		name = dynastic_events.5.b
		add_legitimacy = 10
	}
}

# Personal Union Offered
country_event = {
	id = dynastic_events.6
	title = dynastic_events.6.t
	desc = dynastic_events.6.d
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = dynastic_events.6.a
		add_legitimacy = 20
		FROM = {
			set_country_flag = dyn_pu_accepted_flag
			create_union = ROOT
			country_event = {
				id = dynastic_events.7
				tooltip = dynastic_events.7.t
			}
		}
	}
	
	option = {
		name = dynastic_events.6.b
		FROM = {
			set_country_flag = dyn_pu_refused_flag
			add_opinion = {
				modifier = opinion_spurned_pu
				who = ROOT
			}
			add_casus_belli = {
				target = ROOT
				type = cb_insult
				months = 12
			}
			country_event = {
				id = dynastic_events.7
				tooltip = dynastic_events.7.t
			}
		}
	}
}

# A Political Marriage - Accepted or Not?
country_event = {
	id = dynastic_events.7
	title = dynastic_events.7.t
	desc = dynastic_events.7.d
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = dynastic_events.7.a
		trigger = {
			has_country_flag = dyn_pu_accepted_flag
		}
		add_legitimacy = 20
		tooltip = {
			create_union = FROM
		}
	}
	
	option = {
		name = dynastic_events.7.b
		trigger = {
			has_country_flag = dyn_pu_refused_flag
		}
		tooltip = {
			add_opinion = {
				modifier = opinion_spurned_pu
				who = FROM
			}
			add_casus_belli = {
				target = FROM
				type = cb_insult
				months = 12
			}
		}
	}
}