#########################################################
#		Gift to the state								#
#########################################################
country_event = {
	id = 5008
	title = "EVTNAME5008"
	desc = "EVTDESC5008"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	
	trigger = {
		stability = 0 #otherwise it ain't good governance
	}

	option = {
		name = "EVTOPTA5008"		# Put into the treasury
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0
				NOT = { num_of_cities = 5 }
			}
			modifier = {
				factor = 4
				prestige = 50
				OR = { 
					num_of_loans = 2 
					NOT = { years_of_income = 0.5 }
				}
			}
		}
		add_years_of_income = 0.2
	}
	option = {
		name = "EVTOPTB5008"		# Gain prestige
		ai_chance = {
			factor = 45
			modifier = {
				factor = 5
				NOT = { prestige = 0 }
				years_of_income = 0.5
			}
		}
		add_prestige = 10
	}
	option = {
		name = "personality_options.5008.c" #I'm sure I know some more people who can contribute
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = well_connected }
		}
		ai_chance = {
			factor = 1000
		}
		add_years_of_income = 0.2
		add_prestige = 10
	}
	option = {
		name = "personality_options.5008.dd" #We could probably make even more out of this.
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		ai_chance = {
			factor = 1000
		}
		add_years_of_income = 0.35
	}
	option = {
		name = "personality_options.5008.e" #Donate it to the poor
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = righteous }
				ruler_has_personality_ancestor = { key = kind_hearted }
			}
		}
		ai_chance = {
			factor = 1000
			modifier = { 
				factor = 0
				prestige = 80 
			}
		}
		add_prestige = 15
	}
}



#########################################################
#		Temporary insanity of Monarch	  				#
#########################################################
country_event = {
	id = 5014
	title = "EVTNAME5014"
	desc = "EVTDESC5014"
	picture = COURT_eventPicture
	
	is_triggered_only = yes

	trigger = {
		government = monarchy
		NOT = { adm = 2 }
		NOT = { luck = yes }
		has_regency = no
	}

	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA5014"		# Request military guidance.
		ai_chance = { 
			factor = 55 
			modifier = {
				factor = 2
				national_focus = MIL
			}
		}
		add_prestige = -10
		add_years_of_income = -0.1
		add_army_tradition = 5
		add_navy_tradition = 5
	}
	option = {
		name = "EVTOPTB5014"		# Request administrative guidance.
		ai_chance = { 
			factor = 45 
			modifier = {
				factor = 2
				OR = { 
					NOT = { adm = 4 }
					national_focus = ADM 
				}
			}
		}
		add_prestige = -10
		add_years_of_income = -0.1
		add_adm_power = 25
	}
	option = {
		name = "personality_options.5014.c"		# Luckily we're surrounded by people we can trust.
		highlight = yes
		trigger = {
			ruler_has_personality = well_advised_personality
		}
		ai_chance = { factor = 1000 }
		add_adm_power = 25
	}
}


#########################################################
#		Excellent minister		  						#
#########################################################
country_event = {
	id = 5015
	title = "EVTNAME5015"
	desc = "EVTDESC5015"
	picture = ADVISOR_eventPicture
	
	is_triggered_only = yes

	trigger = {
		government = monarchy
		prestige = 2
		has_regency = no
		OR = {
			employed_advisor = {
				category = ADM
			}
			employed_advisor = {
				category = DIP
			}
			employed_advisor = {
				category = MIL
			}
		}
	}

	immediate = {
		hidden_effect = {
			random_list = {
				1 = {
					trigger = {
						employed_advisor = {
							category = ADM
						}
					}
					modifier = {
						factor = 3
						advisor = statesman
					}
					set_country_flag = advisor_events_adm
				}
				1 = {
					trigger = {
						employed_advisor = {
							category = DIP
						}
					}
					set_country_flag = advisor_events_dip
				}
				1 = {
					trigger = {
						employed_advisor = {
							category = MIL
						}
					}
					set_country_flag = advisor_events_mil
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5015"		# Reap the administrative benefits
		ai_chance = { 
			factor = 55 
			modifier = {
				factor = 2
				NOT = { prestige = 0 }
			}
			modifier = {
				factor = 2 
				has_any_active_incomplete_idea_group_of_category = { adm_ideas = yes }
			}
			modifier = {
				factor = 0 
				ruler_has_personality = well_advised_personality
			}
		}
		if = {
			limit = { 
				OR = {
					has_completed_all_reforms_trigger = yes
					primitives = yes
				}
			}
			add_stability_or_adm_power = yes
		}
		else = {
			add_reform_progress_small_effect = yes
		}
		add_prestige = 25
		add_adm_power = 40
	}
	option = {
		name = "EVTOPTB5015"		# Reap the military benefits
		ai_chance = { 
			factor = 45 
			modifier = {
				factor = 1.5
				prestige = 25
			}
			modifier = {
				factor = 4 
				has_any_active_incomplete_idea_group_of_category = { mil_ideas = yes }
			}
			modifier = {
				factor = 0 
				ruler_has_personality = well_advised_personality
			}
		}
		add_army_tradition = 10
		add_navy_tradition = 10
		add_mil_power = 100
	}
	option = {
		name = "personality_options.5015.c" # Let us extend his responsibilities
		highlight = yes
		trigger = {
			ruler_has_personality = well_advised_personality
		}
		ai_chance = { factor = 100 }
		add_adm_power = 100
		add_mil_power = 100
		add_prestige = 25
		add_army_tradition = 10
	}
	after = {
		hidden_effect = {
			trigger_switch = {
				on_trigger = has_country_flag
				advisor_events_adm = { clr_country_flag = advisor_events_adm }
				advisor_events_dip = { clr_country_flag = advisor_events_dip }
				advisor_events_mil = { clr_country_flag = advisor_events_mil }
			}
		}
	}
}

#########################################################
#		Scandal at the Court		  					#
#########################################################
country_event = {
	id = 5017
	title = "EVTNAME5017"
	desc = {
		desc = "EVTDESC5017"
		trigger = {
			has_country_flag = court_scandal_1
		}
	}
	desc = {
		desc = "event.5017.2"
		trigger = {
			has_country_flag = court_scandal_2
		}
	}
	desc = {
		desc = "event.5017.3"
		trigger = {
			has_country_flag = court_scandal_3
		}
	}
	desc = {
		desc = "event.5017.4"
		trigger = {
			has_country_flag = court_scandal_4
		}
	}
	desc = {
		desc = "event.5017.5"
		trigger = {
			has_country_flag = court_scandal_5
		}
	}
	desc = {
		desc = "event.5017.6"
		trigger = {
			has_country_flag = court_scandal_6
		}
	}
	picture = {
		trigger = { has_dlc = "Rights of Man" }
		picture = COURT_INTRIGUE_eventPicture
	}
	picture = {
		trigger = { NOT = { has_dlc = "Rights of Man" } }
		picture = COURT_eventPicture
	}
	
	is_triggered_only = yes

	trigger = {
		num_of_royal_marriages = 2
		has_regency = no
	}

	immediate = {
		hidden_effect = {
			random_list = {
				1 = {
					trigger = {
						ruler_age = 35
						has_heir = yes
					}
					set_country_flag = court_scandal_1
				}
				1 = {
					trigger = {
						is_female = no
					}
					set_country_flag = court_scandal_2
				}
				1 = {
					trigger = {
						is_female = yes
					}
					set_country_flag = court_scandal_3
				}
				1 = {
					trigger = {
						NOT = { religion_group = muslim }
						has_consort = yes
					}
					set_country_flag = court_scandal_4
				}
				1 = {
					trigger = {
						NOT = { religion_group = muslim }
						NOT = { has_dlc = "Rights of Man" }
					}
					set_country_flag = court_scandal_5
				}
				1 = {
					set_country_flag = court_scandal_6
				}
			}
		}
	}
	after = {
		clr_country_flag = court_scandal_1
		clr_country_flag = court_scandal_2
		clr_country_flag = court_scandal_3
		clr_country_flag = court_scandal_4
		clr_country_flag = court_scandal_5
		clr_country_flag = court_scandal_6
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "event.5017.A2"		# Take the blame and move on.
		trigger = {
			OR = {
				has_country_flag = court_scandal_1
				has_country_flag = court_scandal_4
				has_country_flag = court_scandal_5
			}
		}
		ai_chance = {
			factor = 45
			modifier = {
				factor = 1.5
				stability = 1
			}
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTA5017"		# Take the blame and move on.
		trigger = {
			NOT = {
				OR = {
					has_country_flag = court_scandal_1
					has_country_flag = court_scandal_4
					has_country_flag = court_scandal_5
				}
			}
		}
		ai_chance = {
			factor = 45
			modifier = {
				factor = 1.5
				stability = 1
			}
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "event.5017.B2"		# Bribe an advisor to take the blame.
		trigger = {
			OR = {
				has_country_flag = court_scandal_1
				has_country_flag = court_scandal_4
				has_country_flag = court_scandal_5
			}
		}
		ai_chance = {
			factor = 55
			modifier = {
				factor = 1.5
				NOT = { stability = 1 }
				years_of_income = 0.4
			}
		}
		add_corruption = 0.5
		reduce_meritocracy_effect = yes
		add_years_of_income = -0.2
	}
	option = {
		name = "EVTOPTB5017"		# Bribe an advisor to take the blame.
		trigger = {
			NOT = {
				OR = {
					has_country_flag = court_scandal_1
					has_country_flag = court_scandal_4
					has_country_flag = court_scandal_5
				}
			}
		}
		ai_chance = {
			factor = 55
			modifier = {
				factor = 1.5
				NOT = { stability = 1 }
				years_of_income = 0.4
			}
		}
		add_corruption = 0.5
		reduce_meritocracy_effect = yes
		add_years_of_income = -0.2
	}
	option = {
		name = "personality_options.5017.c" #Don't Panic!
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = calm }
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.5017.dd" #Attempt to lessen the impact
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = silver_tongue }
		}
		add_dip_power = -25
	}
	option = {
		name = "personality_options.5017.e" #It was their fault all along.
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality = babbling_buffoon_personality
		}
		add_prestige = -5
	}
}

#########################################################
#		Wave of obscurantism						  	#
#########################################################
country_event = {
	id = 5018
	title = "EVTNAME5018"
	desc = "EVTDESC5018"
	picture = COURT_eventPicture
	
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_modifier = obscurantism }
		NOT = { has_institution = enlightenment }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5018"		# Knowledge is power
		ai_chance = { 
			factor = 45 
			modifier = {
				factor = 2
				stability = 2 
			}
			modifier = {
				factor = 2
				NOT = { prestige = 0 }
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = free_thinker }
					ruler_has_personality_ancestor = { key = scholar }
					ruler_has_personality = greedy_personality
					ruler_has_personality_ancestor = { key = secretive }
				}
			}
		}
		add_country_modifier = {
			name = "obscurantism"
			duration = 1825
		}
	}
	option = {
		name = "EVTOPTB5018"		# Ignorance is bliss
		ai_chance = { 
			factor = 55 
			modifier = {
				factor = 2 
				NOT = { stability = -1 }
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = free_thinker }
					ruler_has_personality_ancestor = { key = scholar }
					ruler_has_personality = greedy_personality
					ruler_has_personality_ancestor = { key = secretive }
				}
			}
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.5018.c"		# We must divert state resources to counteract this dark trend
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = free_thinker }
				ruler_has_personality_ancestor = { key = scholar }
			}
		}
		ai_chance = { 
			factor = 55 
		}
		add_adm_power = -5
	}
	option = {
		name = "personality_options.5018.dd"	#Let us take advantage of their ignorance.
		highlight = yes
		trigger = {
			ruler_has_personality = greedy_personality
		}
		ai_chance = { 
			factor = 55 
			modifier = {
				factor = 0 
				num_of_loans = 10 
			}
		}
		add_years_of_income = 0.05
	}
	option = {
		name = "personality_options.5018.f"	#
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = secretive }
		}
		ai_chance = { 
			factor = 55 
		}
		add_prestige = 5
	}
}

#########################################################
#		Exceptional year								#
#########################################################
country_event = {
	id = 5019
	title = "EVTNAME5019"
	desc = "EVTDESC5019"
	picture = TRADEGOODS_eventPicture
	
	is_triggered_only = yes

	trigger = {
		is_year = 1450
		NOT = { is_year = 1550 }
		NOT = { has_country_modifier = exceptional_year }
		OR = {
			advisor = treasurer
			advisor = trader
			advisor = statesman
			advisor = natural_scientist
			ruler_has_personality_ancestor = { key = midas_touched }
			ruler_has_personality_ancestor = { key = industrious }
			ruler_has_personality_ancestor = { key = entrepreneur }
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5019"		# Collect the benefits over time
		ai_chance = {
			factor = 45
			modifier = {
				factor = 2
				NOT = { num_of_cities = 8 }
			}
		}
		add_country_modifier = {
			name = "exceptional_year"
			duration = 365
		}
	}
	option = {
		name = "EVTOPTB5019"		# Take advantage of the benefits at once
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0
				NOT = { num_of_cities = 8 }
			}
		}
		add_years_of_income = 0.1
	}
	option = {
		name = "personality_options.5019.c" #Invest the money in new projects
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = entrepreneur }
				ruler_has_personality_ancestor = { key = industrious }
				ruler_has_personality_ancestor = { key = midas_touched }
			}
		}
		ai_chance = {
			factor = 100
		}
		if = { #If you have more than one of these you get more than one reward
			limit = {
				ruler_has_personality_ancestor = { key = entrepreneur }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_production = 2
			}
		}
		if = {
			limit = {
				ruler_has_personality_ancestor = { key = industrious }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_production = 2
			}
		}
		if = {
			limit = {
				ruler_has_personality_ancestor = { key = midas_touched }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_tax = 2
			}
		}
	}
}

# Exceptional Year
country_event = {
	id = 5020
	title = "EVTNAME5019"
	desc = "EVTDESC5019"
	picture = ECONOMY_eventPicture
	
	is_triggered_only = yes

	trigger = {
		is_year = 1550
		NOT = { is_year = 1650 }
		NOT = { has_country_modifier = exceptional_year }
		OR = {
			advisor = treasurer
			advisor = trader
			advisor = statesman
			advisor = natural_scientist
			ruler_has_personality_ancestor = { key = midas_touched }
			ruler_has_personality_ancestor = { key = industrious }
			ruler_has_personality_ancestor = { key = entrepreneur }
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5019"		# Collect the benefits over time
		ai_chance = {
			factor = 45
			modifier = {
				factor = 2
				NOT = { num_of_cities = 8 }
			}
		}
		add_country_modifier = {
			name = "exceptional_year"
			duration = 365
		}
	}
	option = {
		name = "personality_options.5019.dd"		# Divert even more funds to the central treasury
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		ai_chance = {
			factor = 100
		}
		add_years_of_income = 0.15
	}
	option = {
		name = "personality_options.5019.c" #Invest the money in new projects
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = entrepreneur }
				ruler_has_personality_ancestor = { key = industrious }
				ruler_has_personality_ancestor = { key = midas_touched }
			}
		}
		ai_chance = {
			factor = 100
		}
		if = { #If you have more than one of these you get more than one reward
			limit = {
				ruler_has_personality_ancestor = { key = entrepreneur }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_production = 2
			}
		}
		if = {
			limit = {
				ruler_has_personality_ancestor = { key = industrious }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_production = 2
			}
		}
		if = {
			limit = {
				ruler_has_personality_ancestor = { key = midas_touched }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_tax = 2
			}
		}
	}
}

# Exceptional Year
country_event = {
	id = 5021
	title = "EVTNAME5019"
	desc = "EVTDESC5019"
	picture = ECONOMY_eventPicture
	
	is_triggered_only = yes

	trigger = {
		is_year = 1650
		NOT = { has_country_modifier = exceptional_year }
		OR = {
			advisor = treasurer
			advisor = trader
			advisor = statesman
			advisor = natural_scientist
			ruler_has_personality_ancestor = { key = midas_touched }
			ruler_has_personality_ancestor = { key = industrious }
			ruler_has_personality_ancestor = { key = entrepreneur }
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5019"		# Collect the benefits over time
		ai_chance = {
			factor = 45
			modifier = {
				factor = 2
				NOT = { num_of_cities = 8 }
			}
		}
		add_country_modifier = {
			name = "exceptional_year"
			duration = 365
		}
	}
	option = {
		name = "EVTOPTB5019"		# Take advantage of the benefits at once
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0
				NOT = { num_of_cities = 8 }
			}
		}
		add_years_of_income = 0.05
	}
	option = {
		name = "personality_options.5019.dd"		# Divert even more funds to the central treasury
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		ai_chance = {
			factor = 100
		}
		add_years_of_income = 0.10
	}
	option = {
		name = "personality_options.5019.c" #Invest the money in new projects
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = entrepreneur }
				ruler_has_personality_ancestor = { key = industrious }
				ruler_has_personality_ancestor = { key = midas_touched }
			}
		}
		ai_chance = {
			factor = 100
		}
		if = { #If you have more than one of these you get more than one reward
			limit = {
				ruler_has_personality_ancestor = { key = entrepreneur }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_production = 2
			}
		}
		if = {
			limit = {
				ruler_has_personality_ancestor = { key = industrious }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_production = 2
			}
		}
		if = {
			limit = {
				ruler_has_personality_ancestor = { key = midas_touched }
			}
			random_owned_province = {
				limit = {
					is_in_capital_area = yes
				}
				add_base_tax = 2
			}
		}
	}
}

#########################################################
#		Rush of colonists								#
#########################################################
country_event = {
	id = 5022
	title = "EVTNAME5022"
	desc = "EVTDESC5022"
	picture = COLONIZATION_eventPicture
	
	is_triggered_only = yes

	trigger = {
		colony = 1
		num_of_ports = 1
		NOT =  { has_country_modifier = monetary_benefits }
		NOT =  { has_country_modifier = colonial_enthusiasm }
		has_any_exploration_idea = yes
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5022"		# Gain extra colonists
		ai_chance = { factor = 65 }	
		add_country_modifier = {
			name = "colonial_enthusiasm"
			duration = 1825
		}
	}
	option = {
		name = "EVTOPTB5022"		# Receive monetary benefits
		ai_chance = { 
			factor = 35 
			modifier = {
				factor = 2 
				num_of_loans = 2
			}
		}
		add_country_modifier = {
			name = "monetary_benefits"
			duration = 1825
		}
	}
	option = {
		name = "personality_options.5022.c"		# Gain more extra colonists
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = expansionist }
			NOT = { has_country_modifier = colonial_enthusiasm }
		}
		ai_chance = { factor = 1000 }
		add_country_modifier = {
			name = "colonial_enthusiasm"
			duration = 3650
		}
	}
}

#########################################################
#		Rush of merchants								#
#########################################################
country_event = {
	id = 5023
	title = "EVTNAME5023"
	desc = "EVTDESC5023"
	picture = MERCHANTS_TALKING_eventPicture
	
	is_triggered_only = yes

	trigger = {
		advisor = trader
		NOT = {
			has_country_modifier = rush_of_merchants
		}
		NOT = {
			has_country_modifier = monetary_benefits
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5023" # Gain extra merchants
		ai_chance = { 
			factor = 50
			modifier = {
				factor = 2 
				trade_income_percentage = 0.45
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = navigator }
					ruler_has_personality_ancestor = { key = charismatic_negotiator }
				}
			}
		}	
		
		add_country_modifier = {
			name = rush_of_merchants
			duration = 1825
		}
	}
	option = {
		name = "EVTOPTB5023" # Receive monetary benefits
		ai_chance = { 
			factor = 50
			modifier = {
				factor = 2 
				tax_income_percentage = 0.45
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = navigator }
					ruler_has_personality_ancestor = { key = charismatic_negotiator }
				}
			}
		}
		add_country_modifier = {
			name = "monetary_benefits"
			duration = 1825
		}
	}
	option = {
		name = "personality_options.5023.c" # Let us see if we can negotiate good terms for them
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = charismatic_negotiator }
		}
		add_country_modifier = {
			name = "monetary_benefits"
			duration = 3650
		}
	}
	option = {
		name = "personality_options.5023.dd" # We can support them by investing in better ships
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = navigator }
		}
		add_country_modifier = {
			name = rush_of_merchants
			duration = 3650
		}
	}
}

#########################################################
#		Diplomatic event		  						#
#########################################################

# Diplomatic move
country_event = {
	id = 5024
	title = "EVTNAME5024"
	desc = "EVTDESC5024"
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes

	trigger = {
		dip = 4
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5024" # Appoint new diplomats
		ai_chance = { factor = 95 }
		add_dip_power = 30
	}	
	option = {
		name = "EVTOPTB5024" # Improve relations with neighboring states
		ai_chance = { factor = 5 }
		trigger = {
			any_known_country = {
				is_neighbor_of = ROOT
			}
		}
		add_dip_power = 10
		random_country = {
			limit = { is_neighbor_of = ROOT }
			add_opinion = { who = ROOT modifier = opinion_improved_relations }
		}
	}
	option = {
		name = "personality_options.5024.c" # Nothing is really beyond my control!
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = charismatic_negotiator }
		}
		ai_chance = { factor = 1000 }
		add_dip_power = 50
	}
	option = {
		name = "personality_options.5024.dd" # We are a diplomatic superpower!
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = charismatic_negotiator }
			any_known_country = {
				is_neighbor_of = ROOT
			}
		}
		ai_chance = { factor = 1000 }
		add_dip_power = 25
		every_country = {
			limit = { is_neighbor_of = ROOT }
			add_opinion = { who = ROOT modifier = opinion_good_relations }
		}
	}
}

# Excellent Diplomacy
country_event = {
	id = 5025
	title = "EVTNAME5025"
	desc = "EVTDESC5025"
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes

	trigger = {
		diplomat = 2
		OR = {
			is_at_war = no
			war_score = 25
		}
		NOT = { num_of_rebel_controlled_provinces = 1 }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5025"		# Bask in the Glory
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2 
				NOT = { prestige = 0 } 
			}
			modifier = {
				factor = 2
				has_any_active_incomplete_idea_group_of_category = { dip_ideas = no }
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = charismatic_negotiator }
					ruler_has_personality_ancestor = { key = silver_tongue }
				}
				NOT = { has_country_modifier = excellent_diplomacy_modifier }
			}
		}
		add_prestige = 10
	}
	option = {
		name = "EVTOPTB5025"		# Improve our Reputation
		ai_chance = {
			factor = 75
			modifier = {
				factor = 2 
				prestige = 15
			}
			modifier = {
				factor = 4
				has_any_active_incomplete_idea_group_of_category = { dip_ideas = yes }
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = charismatic_negotiator }
					ruler_has_personality_ancestor = { key = silver_tongue }
				}
				NOT = { has_country_modifier = excellent_diplomacy_modifier }
			}
		}
		add_dip_power = 25
	}
	option = {
		name = "personality_options.5025.c"		# 
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = charismatic_negotiator }
				ruler_has_personality_ancestor = { key = silver_tongue }
			}
			NOT = { has_country_modifier = excellent_diplomacy_modifier }
		}
		ai_chance = {
			factor = 100
		}
		add_country_modifier = {
			name = "excellent_diplomacy_modifier"
			duration = 3650
		}
	}
}


#########################################################
#		Reformation of the Army 					  	#
#########################################################

country_event = {
	id = 5027
	title = "EVTNAME5027"
	desc = "EVTDESC5027"
	picture = REFORM_eventPicture
	
	is_triggered_only = yes

	trigger = {
		army_reformer = 2
	}

	mean_time_to_happen = {
		days = 1
	}


	option = {
		name = "EVTOPTA5027"		# Invest in army technology
		ai_chance = { 
			factor = 10
			modifier = {
				factor = 4
				has_any_active_incomplete_idea_group_of_category = { mil_ideas = yes }
			}
			modifier = {
				factor = 2 
				army_tradition = 85 
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = martial_educator }
					ruler_has_personality_ancestor = { key = tactical_genius }
					ruler_has_personality_ancestor = { key = inspiring_leader }
				}
			}
		}
		add_mil_power = 50
	}
	option = {
		name = "EVTOPTB5027"		# Improve our existing military
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				NOT = { army_tradition = 60 }
			}
			modifier = {
				factor = 0
				army_tradition = 90
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = martial_educator }
					ruler_has_personality_ancestor = { key = tactical_genius }
					ruler_has_personality_ancestor = { key = inspiring_leader }
				}
			}
		}
		add_army_tradition = 20
	}
	option = {
		name = "personality_options.5027.c"		# Let's go with a more ambitious program for our officers.
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = martial_educator }
		}
		add_army_tradition = 35
	}
	option = {
		name = "personality_options.5027.dd"		# Technology is the future
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = tactical_genius }
				ruler_has_personality_ancestor = { key = inspiring_leader }
			}
		}
		add_mil_power = 75
	}
}

#########################################################
#		Reformation of the Navy 					  	#
#########################################################

country_event = {
	id = 5032
	title = "EVTNAME5032"
	desc = "EVTDESC5032"
	picture = REFORM_eventPicture
	
	is_triggered_only = yes

	trigger = {
		naval_reformer = 2
		num_of_ports = 1
		primitives = no
		navy_size = 1
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5032"		# Invest in naval technology
		ai_chance = { 
			factor = 10
			modifier = {
				factor = 5
				has_any_active_incomplete_idea_group_of_category = { dip_ideas = yes }
			}
			modifier = {
				factor = 2 
				navy_tradition = 85 
			}
			modifier = {
				factor = 0 
				OR = {
					ruler_has_personality_ancestor = { key = navigator }
					ruler_has_personality_ancestor = { key = expansionist }
				}
			}
		}
		add_dip_power = 50
	}
	option = {
		name = "EVTOPTB5032"		# Improve our existing navy
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2 
				NOT = { navy_tradition = 80 }
			}
			modifier = {
				factor = 1.5
				navy_size_percentage = 0.75 
			}	
			modifier = {
				factor = 0
				NOT = { num_of_ports = 5 }
			}
		}
		add_navy_tradition = 20
		add_yearly_sailors = 1
	}
	option = {
		name = "personality_options.5027.c"		# Let's go with a more ambitious program for our officers.
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = navigator }
		}
		add_navy_tradition = 30
		add_yearly_sailors = 1.5
	}
	option = {
		name = "personality_options.5027.dd"		# Technology is the future
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = expansionist }
		}
		add_dip_power = 75
	}
}


#########################################################
#		Good government policies					  	#
#########################################################

country_event = {
	id = 5040
	title = "EVTNAME5040"
	desc = "EVTDESC5040"
	picture = REFORM_eventPicture
	
	is_triggered_only = yes

	trigger = {
		adm = 5
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA5040"		# Use the money to bring stability to our nation
		ai_chance = {
			factor = 40
			modifier = {
				factor = 2
				NOT = { stability = 0 }
			}
		}
		add_stability_or_adm_power = yes
	}
	option = {
		name = "EVTOPTB5040"		# Invest the money in our government
		ai_chance = { 
			factor = 30 
			modifier = { 
				factor = 4 
				OR = { 
					has_any_active_incomplete_idea_group_of_category = { adm_ideas = yes } 
					has_any_active_incomplete_idea_group_of_category = { dip_ideas = yes } 
					has_any_active_incomplete_idea_group_of_category = { mil_ideas = yes } 
				}
				stability = 1 
			}
		}
		if = {
			limit = { 
				OR = {
					has_completed_all_reforms_trigger = yes
					primitives = yes
				}
			}
			add_adm_power = 25
			add_dip_power = 25
			add_mil_power = 25
		}
		else = {
			add_reform_progress_small_effect = yes
		}
	}
	option = {
		name = "EVTOPTC5040"		# Let's fill our treasury while we have their support
		ai_chance = {
			factor = 30
			modifier = {
				factor = 2
				num_of_cities = 30
			}
			modifier = { 
				factor = 2 
				num_of_loans = 2 
			}	
		}
		add_years_of_income = 0.20
	}
	option = {
		name = "personality_options.5040.a"		# Root out the corruption in our government
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = incorruptible }
			corruption = 1
		}
		ai_chance = {
			factor = 20
			modifier = {
				factor = 10
				corruption = 2 
			}
		}
		add_corruption = -1
	}
	option = {
		name = "personality_options.5040.b"		# Improve the Officer Curriculum
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = martial_educator }
		}
		add_army_tradition = 10
		
	}
	option = {
		name = "personality_options.5040.c"		# Allow monarch to hold a grand feast
		highlight = yes
		trigger = {
			ruler_has_personality = drunkard_personality
			any_neighbor_country = {
				NOT = { war_with = ROOT }
			}
		}
		random_neighbor_country = {
			limit = { NOT = { war_with = ROOT } }
			add_opinion = {
				who = ROOT
				modifier = indulgent_feast
			}
			random_neighbor_country = {
				limit = {
					NOT = { war_with = ROOT }
					NOT = { tag = ROOT }
				}
				add_opinion = {
					who = ROOT
					modifier = indulgent_feast
				}
			}
		}
	}
	option = {
		name = "personality_options.5040.d"		# Allow Monarch to find more ways to diver funds
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 3
				num_of_cities = 30
			}
			modifier = { 
				factor = 4 
				num_of_loans = 2 
				num_of_cities = 15
			}	
		}
		add_years_of_income = 0.25
	}
	option = {
		name = "personality_options.5040.e"		# This is perfect for a little project of mine...
		highlight = yes
		trigger = { ruler_has_personality = obsessive_perfectionist_personality }
		ai_chance = {
			factor = 30
			modifier = {
				factor = 3
				NOT = { prestige = -25 }
			}
		}
		add_prestige = 10
	}
}


#########################################################
#		Poor government policies	 				 	#
#########################################################

country_event = {
	id = 5045
	title = "EVTNAME5045"
	desc = "EVTDESC5045"
	picture = REFORM_eventPicture

	is_triggered_only = yes

	trigger = {
		NOT = { adm = 5 }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5045"		# We have chosen the right path
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0.5
				NOT = { stability = 0 }
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB5045"		# Attempt to improve the situation
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.3 }
			}
		}
		if = {
			limit = { 
				OR = {
					government = native
					has_completed_all_reforms_trigger = yes
				}
			}
			add_years_of_income = -0.25
		}
		else = {
			reduce_reform_progress_small_effect = yes
		}
	}
	option = {
		name = "personality_options.5045.a"		# The fault lies with others
		highlight = yes
		trigger = { ruler_has_personality = naive_personality }
		ai_chance = {
			factor = 100 
			modifier = {
				factor = 0
				NOT = { prestige = -90 }
			}
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.5045.b"		# Overhaul the governmental policies.
		highlight = yes
		trigger = { ruler_has_personality = reformist_personality }
		ai_chance = {
			factor = 100 
			modifier = {
				factor = 0
				has_any_active_incomplete_idea_group_of_category = { adm_ideas = yes } 
				years_of_income = 1
			}
		}
		add_adm_power = -15
	}
}

#########################################################
#		Unhappiness among the clergy	 			 	#
#########################################################
country_event = {
	id = 5050
	title = "EVTNAME5050"
	desc = "EVTDESC5050"
	picture = DEBATE_REPUBLICAN_eventPicture
	
	is_triggered_only = yes

	trigger = {
		has_estate = estate_church
		OR = {
			religion = catholic
			religion = orthodox
			religion_group = muslim
		}
		NOT = { tag = PAP }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5050"		# Ignore their Demands.
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				prestige = 90
			}
			modifier = {
				factor = 0
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		reduce_estate_church_loyalty_effect = yes
		if = {
			limit = {
				religion_group = muslim
			}
			add_piety = -0.1
		}
		if = {
			limit = {
				religion = catholic
			}
			add_papal_influence = -10
		}
		if = {
			limit = {
				religion = orthodox
			}
			add_patriarch_authority = -0.1
		}
		add_prestige = 10
	}
	option = {
		name = "EVTOPTB5050"		# Agree to their Demands.
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.5
				NOT = { prestige = 0 }
			}
		}
		add_estate_church_loyalty_effect = yes
		if = {
			limit = {
				religion_group = muslim
			}
			add_piety = 0.2
		}
		if = {
			limit = {
				religion = catholic
			}
			add_papal_influence = 10
		}
		if = {
			limit = {
				religion = orthodox
			}
			add_patriarch_authority = 0.05
		}
		add_prestige = -15
	}
	option = {
		name = "personality_options.5050.a"		# Attempt to lessen the impact
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = zealot } }
		add_estate_church_loyalty_effect = yes
		if = {
			limit = {
				religion_group = muslim
			}
			add_piety = 0.1
		}
		if = {
			limit = {
				religion = catholic
			}
			add_papal_influence = 5
		}
		if = {
			limit = {
				religion = orthodox
			}
			add_patriarch_authority = 0.025
		}
	}
	option = {
		name = "personality_options.5050.b"		# Attempt to lessen the impact
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = pious } }
		add_devotion = -5
	}
}

#########################################################
#		Unhappiness among the artisans				  	#
#########################################################
country_event = {
	id = 5051
	title = "EVTNAME5051"
	desc = {
		trigger = {
			NOT = { has_estate = estate_burghers }
			NOT = { has_estate = estate_vaisyas }
		}
		desc = "EVTDESC5051"
	}
	desc = {
		trigger = {
			OR = {
				has_estate = estate_burghers
				has_estate = estate_vaisyas
			}
		}
		desc = event.5051.desc
	}
	picture = ANGRY_MOB_eventPicture
	goto = uppity_artisans_province

	is_triggered_only = yes

	trigger = {
		if = {
			limit = { has_estate = estate_burghers }
			NOT = {
				estate_loyalty = {
					estate = estate_burghers
					loyalty = 30
				}
			}
		}
		else_if = {
			limit = { has_estate = estate_vaisyas }
			NOT = {
				estate_loyalty = {
					estate = estate_vaisyas
					loyalty = 30
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_core = ROOT
					is_state = yes
					is_in_capital_area = yes
				}
				save_event_target_as = uppity_artisans_province
			}
		}
	}

	option = {
		name = "EVTOPTA5051"		# Execute the troublemakers.
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0
				NOT = { stability = 1 }
			}
			modifier = {
				factor = 0
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
			modifier = {
				factor = 0
				has_estate = estate_vaisyas
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		reduce_estate_burghers_loyalty_effect = yes
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB5051"		# Abolish a tax.
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.5
				NOT = { num_of_cities = 15 }
			}
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.5 }
			}
			modifier = { 
				factor = 0 
				num_of_loans = 5 
			}
		}
		add_years_of_income = -0.50
		add_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5051.a"		# Crush Them!
		highlight = yes
		trigger = { ruler_has_personality = cruel_personality }
		add_years_of_income = 0.1
		event_target:uppity_artisans_province = {
			spawn_small_scaled_rebels = {
				type = anti_tax_rebels
				no_defined_leader = yes
			}
		}
	}
	option = {
		name = "personality_options.5051.b"		# 
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = entrepreneur } }
		add_prestige = -10
		reduce_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5051.c"		# They just aren't good enough
		highlight = yes
		trigger = { ruler_has_personality = obsessive_perfectionist_personality }
		add_prestige = -5
		reduce_estate_burghers_loyalty_effect = yes
	}
}

#########################################################
#		Unhappiness among the peasantry	  				#
#########################################################
country_event = {
	id = 5052
	title = "EVTNAME5052"
	desc = "EVTDESC5052"
	picture = ANGRY_MOB_eventPicture

	is_triggered_only = yes

	trigger = {
		any_owned_province = {
			is_core = ROOT
			is_state = yes
			is_in_capital_area = yes
			is_capital = no
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_core = ROOT
					is_state = yes
					is_in_capital_area = yes
					is_capital = no
				}
				save_event_target_as = uppity_peasants_province
			}
		}
	}

	option = {
		name = "EVTOPTA5052"		# We rule as we see fit.
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		add_prestige = 10
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB5052"		# Prevent the discontent from spreading.
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.3 }
			}
		}
		add_years_of_income = -0.25
	}
	option = {
		name = "personality_options.5051.a"		# Crush Them!
		goto = uppity_peasants_province
		highlight = yes
		trigger = { ruler_has_personality = cruel_personality }
		event_target:uppity_peasants_province = {
			spawn_small_scaled_rebels = {
				type = anti_tax_rebels
				no_defined_leader = yes
			}
		}
	}
	option = {
		name = "personality_options.5051.d"		# Establish new reforms for the peasants
		highlight = yes
		trigger = { ruler_has_personality = reformist_personality }
		add_adm_power = -25
	}
}

#########################################################
#		Unhappiness among the merchants	  				#
#########################################################
country_event = {
	id = 5053
	title = "EVTNAME5053"
	desc = event.5053.desc
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes

	trigger = {
		NOT = { mercantilism = 30 }
		if = {
			limit = { has_estate = estate_burghers }
			NOT = {
				estate_loyalty = {
					estate = estate_burghers
					loyalty = 30
				}
			}
		}
		else_if = {
			limit = { has_estate = estate_vaisyas }
			NOT = {
				estate_loyalty = {
					estate = estate_vaisyas
					loyalty = 30
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5053"		# Reduce trade investment.
		ai_chance = {
			factor = 0 				#Sorry, but Mercantilism preservation is never worth it for a player, likewise for the AI.
		}							#AI must preserve its mana just like an experienced player would.
		add_dip_power = -50
		reduce_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5053"		# Get rid of the troublemakers.
		ai_chance = { factor = 100 }
		add_mercantilism = -1
	}
	option = {
		name = "personality_options.5053.a"		# Reduce trade investment.
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = entrepreneur } }
		add_dip_power = -25
		reduce_estate_burghers_loyalty_effect = yes
	}
}

#########################################################
#		Political Crisis							  	#
#########################################################
country_event = {
	id = 5054
	title = "EVTNAME5054"
	desc = "EVTDESC5054"
	picture = LIBERUM_VETO_eventPicture
	
	is_triggered_only = yes

	trigger = {
		or = {
			government = monarchy
			government = republic
			government = dictatorship
		}
		is_lesser_in_union = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5054"		# Given time, a solution will present itself.
		ai_chance = {
			factor = 1 				#No, saving 25 Legitimacy is rarely worth it. 
			modifier = { 			#Unless AI is a republic, to preserve its Rep. Trad 
				factor = 100		#Which is infinitely more valuable than legitimacy 
				government = republic 
				NOT = { republican_tradition = 80 }
				stability = 2 
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB5054"		# Reputation isn't everything.
		ai_chance = {
			factor = 45 
			modifier = {
				factor = 0.5
				government = republic
				NOT = { republican_tradition = 80 }
			}
			modifier = {
				factor = 0
				government = monarchy
				NOT = { legitimacy_or_horde_unity = 70 }
				NOT = { manpower_percentage = 0.25 } #To prevent AI from spiraling into disasters.
				NOT = { stability = -1 }
			}
		}
		add_republican_tradition = -10
		add_horde_unity = -25
		add_legitimacy = -25
		reduce_mandate_large_effect = yes
	}
	option = {
		name = "personality_options.5054.a"		# 
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = righteous } }
		ai_chance = {
			factor = 100
			modifier = { 
				factor = 0
				has_reform = steppe_horde
				NOT = { horde_unity = 50 }
			}
			modifier = { 
				factor = 0
				is_emperor_of_china = yes 
				NOT = { imperial_mandate = 45 }
			}
		}
		add_legitimacy = -10
		add_republican_tradition = -3
		add_horde_unity = -10
		reduce_mandate_effect = yes
	}
	option = {
		name = "personality_options.5054.b"		# 
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = just } }
		ai_chance = { 
			factor = 1000
		}
		add_prestige_or_monarch_power = { amount = 5 }
	}
}

#########################################################
#			Corruption								 	#
#########################################################
country_event = {
	id = 5055
	title = "EVTNAME5055"
	desc = "EVTDESC5055"
	picture = ELECTION_REPUBLICAN_eventPicture

	is_triggered_only = yes
	
	trigger = {}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5055"		# Try to eradicate the problems.
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB5055"		# Ignore them.
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.5
				corruption = 5
			}
			modifier = { 	
				factor = 10 
				NOT = { stability = 1 } 
			}
		}
		if = {
			limit = { 
				has_completed_all_reforms_trigger = yes
			}
			add_corruption = 2
		}
		else = {
			add_corruption = 1
			reduce_reform_progress_small_effect = yes
		}
	}
	option = {
		name = "personality_options.5055.a"		# Deal with any visible signs of this
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		add_prestige = 5
	}
	option = {
		name = "personality_options.5055.b"		# Replace certain high-ranking officials
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = incorruptible } }
		add_adm_power = -25
	}
}


#########################################################
#		Diplomatic insult		 					 	#
#########################################################
country_event = {
	id = 5056
	title = "EVTNAME5056"
	desc = "EVTDESC5056"
	picture = DIPLOMACY_eventPicture

	is_triggered_only = yes

	trigger = {
		OR = {
			has_regency = no
			has_consort_regency = yes
		}
		any_neighbor_country = {
			is_at_war = no
			is_lesser_in_union = no
			same_continent = root
		}
	}

	immediate = {
		hidden_effect = {
			random_neighbor_country = {
				limit = {
					is_at_war = no
					is_lesser_in_union = no
					same_continent = root
				}
				save_event_target_as = insulted_party
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5056" # We won't forget this.
		ai_chance = { factor = 0 } 			#There is absolutely no reason to pick this, the AI does not use it.
		event_target:insulted_party = {		#And opinions can help manage AE and overall assist the AI 
			reverse_add_casus_belli = {	
				target = ROOT
				type = cb_insult
				months = 12
			}
		}
	}
	option = {
		name = "EVTOPTB5056" # Try to ease the tension.
		ai_chance = { factor = 1 }
		every_neighbor_country = {
			limit = { is_at_war = no }
			add_opinion = { who = ROOT modifier = opinion_eased_tension }
		}
	}
	option = {
		name = "personality_options.5056.a" # Try to ease the tension.
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = silver_tongue } }
		ai_chance = {
			factor = 100 
		}
		add_estate_burghers_loyalty_effect = yes
		add_prestige = 5
		every_neighbor_country = {
			limit = { is_at_war = no }
			add_opinion = { who = ROOT modifier = opinion_more_eased_tension }
		}
	}
}

#########################################################
#			Nobles									  	#
#########################################################
country_event = {
	id = 5058
	title = "EVTNAME5058"
	desc = "EVTDESC5058"
	picture = COURT_eventPicture

	is_triggered_only = yes

	trigger = {
		has_estate = estate_nobles
		OR = {
			NOT = {
				estate_influence = {
					estate = estate_nobles
					influence = 20
				}
			}
			NOT = {
				estate_loyalty = {
					estate = estate_nobles
					loyalty = 30
				}
			}
		}
		NOT = { has_country_modifier = disorder }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5058"		# Accept their rightful claims.
		ai_chance = {
			factor = 55
			modifier = {
				factor = 1.5
				prestige = 20
			}
		}
		add_prestige = -10
	}
	option = {
		name = "EVTOPTB5058"		# Ignore their demands.
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.5
				unrest = 5
			}
			modifier = {
				factor = 0
				has_estate = estate_nobles
				estate_influence = {
					estate = estate_nobles
					influence = 95
				}
				NOT = { 
					estate_loyalty = {
						estate = estate_nobles 
						loyalty = 45 
					}
				}
			}
		}
		reduce_estate_nobles_loyalty_effect = yes
		add_country_modifier = {
			name = "disorder"
			duration = 3650
		}
	}
	option = {
		name = "personality_options.5058.a"		# Crush Them!
		highlight = yes
		trigger = { ruler_has_personality = cruel_personality }
		ai_chance = { 
			factor = 100 
			modifier = { 
				factor = 0 
				OR = { 
					num_of_loans = 10 
					war_exhaustion = 10 
					NOT = { manpower_percentage = 0.1 }
				}
			}
		}
		add_prestige = 10
		random_owned_province = {
			limit = {
				is_core = ROOT
				is_state = yes
				is_in_capital_area = yes
				highest_supply_limit_in_area = yes
			}
			spawn_rebels = {
				type = noble_rebels
				size = 1
			}
		}
	}
	option = {
		name = "personality_options.5058.b"		# They never had those rights to begin with.
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = lawgiver } }
		ai_chance = { factor = 100 } 
		add_prestige = -5
		add_legitimacy = 5
	}
}

#########################################################
#		Trading Company Disaster					 	#
#########################################################
country_event = {
	id = 5059
	title = "EVTNAME5059"
	desc = "EVTDESC5059"
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes

	trigger = {
		is_year = 1700
		OR = {
			religion_group = christian
			num_of_trade_companies = 1
			any_subject_country = {
				is_colonial_nation_of = root
			}
		}
		NOT = { has_country_modifier = trade_disaster }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5059"		# Cut down on our expenses
		ai_chance = {
			factor = 0 	#Most nations stand to lose way more than 10% Yearly income with this choice
		}				#So AI should never pick it, just like a player would not.
		reduce_estate_burghers_loyalty_effect = yes
		add_country_modifier = {
			name = "trade_disaster"
			duration = 365
		}
	}
	option = {
		name = "EVTOPTB5059"			# This isn't anything we can't handle.
		ai_chance = { factor = 1 } 		# Nations should not struggle financially after the 1700s
		add_estate_burghers_loyalty_effect = yes
		add_years_of_income = -0.1
	}
	option = {
		name = "personality_options.5059.a"		# You win some, you lose some
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = entrepreneur } }
		ai_chance = { factor = 100 } 
		add_estate_burghers_loyalty_effect = yes
		add_years_of_income = -0.05
	}
}

#########################################################
#			Meteor sighted							  	#
#########################################################
country_event = {
	id = 5060
	title = "EVTNAME5060"
	desc = "EVTDESC5060"
	picture = COMET_SIGHTED_eventPicture
	
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = no_more_comet_sighted_event }
	}

	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "personality_options.5060.a"		# Fascinating!
		ai_chance = {
			factor = 1
		}
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = scholar }
		}
		add_adm_power = 20
	}
	
	option = {
		name = "EVTOPTA5060"		# It's an omen
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB5060"		# The end is nigh!
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTC5060"		# The economy, fools!
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTE5060"		# I wish I lived in more enlightened times.
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTF5060"		# Sacrifice a human heart to appease the comet!
		trigger = {
			religion_group = pagan
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTG5060"		# If only we had comet sense!
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTH5060"		# Oh comet, devil's kith and kin...
		trigger = {
			NOT = { religion_group = pagan }
		}		
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}		
	option = {
		name = "EVTOPTI5060"		# What a great start into the new year.
		trigger = {
			NOT = { is_year = 1445 }
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}	
	option = {
		name = "EVTOPTJ5060"		# That's now Victoria's problem, not mine.
		trigger = {
			is_year = 1810
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}	
	option = {
		name = "EVTOPTK5060"		# That's it. I'm dead.
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}		
	option = {
		name = "EVTOPTL5060"		# Curse you, Comet Sense!
		trigger = {
			NOT = { stability = -1 }
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}		
}

#########################################################
#		Saint performs miracle						  	#
#########################################################
country_event = {
	id = 5061
	title = "EVTNAME5061"
	desc = "EVTDESC5061"
	picture = POPE_PREACHING_eventPicture

	is_triggered_only = yes

	trigger = {
		NOT = { is_year = 1700 }
		religion = catholic
		NOT = { stability = 2 }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5061"		# We have truly been blessed
		ai_chance = {
			factor = 55
		}
		add_stability_or_adm_power = yes
		add_reform_desire = 0.002
	}
	option = {
		name = "EVTOPTB5061"		# Their actions have shown us the true path
		ai_chance = { factor = 45 }
		trigger = { NOT = { tag = PAP } }
		add_papal_influence = 20
	}
	option = {
		name = "personality_options.5061.a"		# Exploit the Pilgrims
		highlight = yes
		trigger = { ruler_has_personality = sinner_personality }
		reduce_estate_church_loyalty_effect = yes
		add_years_of_income = 0.5
		add_reform_desire = 0.002
	}
}

#########################################################
#		Nobles ally with foreign power				  	#
#########################################################
country_event = {
	id = 5064
	title = "EVTNAME5064"
	desc = "EVTDESC5064"
	picture = DIPLOMACY_eventPicture

	is_triggered_only = yes

	trigger = {
		capital_scope = { continent = europe }
		NOT = { dip = 4 }
		has_estate = estate_nobles
		any_neighbor_country = {
			NOT = { is_subject_of = root }
			NOT = { alliance_with = root }
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_neighbor_country = {
				limit = {
					NOT = { is_subject_of = root }
					NOT = { alliance_with = root }
				}
				save_event_target_as = neighbour_country
			}
		}
	}

	option = {
		name = "EVTOPTA5064"		# They will pay for their treachery
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		reduce_estate_nobles_loyalty_effect = yes
		event_target:neighbour_country = {
			reverse_add_casus_belli = {	
				target = ROOT
				type = cb_insult
				months = 12
			}
		}
		add_adm_power = -33
	}
	option = {
		name = "EVTOPTB5064"		# We'll deal with them later
		ai_chance = {
			factor = 45
			modifier = {
				factor = 1.5
				prestige = 35
			}
		}
		add_prestige = -15
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5064.a"		# Attempt to intimidate them into submission
		highlight = yes
		trigger = { ruler_has_personality = malevolent_personality }
		add_prestige = -5
		add_estate_nobles_loyalty_effect = yes
	}
}

#########################################################
#			Assassination							  	#
#########################################################
country_event = {
	id = 5065
	title = "EVTNAME5065"
	desc = "EVTDESC5065"
	picture = ASSASSINATION_eventPicture

	is_triggered_only = yes

	trigger = {
		government = monarchy
		NOT = { dip = 3 }
		is_free_or_tributary_trigger = yes
		OR = {
			has_estate = estate_nobles
			has_estate = estate_rajput
			has_estate = estate_maratha
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			set_saved_name = {
				type = leader
				key = assassinated_dude
			}
		}
	}
	after = {
		clear_saved_name = assassinated_dude
	}

	option = {
		name = "EVTOPTA5065"		# Let them solve it among themselves.
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { legitimacy_or_horde_unity = 70 }
			}
		}
		add_legitimacy = -15
		add_horde_unity = -15
		reduce_mandate_effect = yes
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5065"		# Take control of the situation
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_adm_power = -50
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5065.a"		# Take control of the situation
		highlight = yes
		trigger = { ruler_has_personality = cruel_personality }
		add_legitimacy = 5
		add_horde_unity = 5
		add_mandate_effect = yes
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5065.b"		# Settle the conflict
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = just } }
		add_adm_power = -25
		add_estate_nobles_loyalty_effect = yes
	}
}

#########################################################
#	Cessation of Church Functions to Nobility			#
#########################################################
country_event = {
	id = 5066
	title = "EVTNAME5066"
	desc = "EVTDESC5066"
	picture = POPE_PREACHING_eventPicture

	is_triggered_only = yes

	trigger = {
		religion = catholic
		NOT = { has_country_modifier = church_functions }
		NOT = { tag = PAP }
		has_estate = estate_nobles
		has_estate = estate_church
		estate_territory = {
			estate = estate_church
			territory = 10
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5066"		# Accept
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.25
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		add_years_of_income = 0.50
		add_country_modifier = {
			name = "church_functions"
			duration = 7300
		}
		reduce_estate_church_loyalty_effect = yes
		add_estate_nobles_loyalty_effect = yes
		
		if = {
			limit = {
				has_estate = estate_nobles
				has_estate = estate_church
			}
			change_estate_land_share = {
				estate = estate_church
				share = -5
			}
			change_estate_land_share = {
				estate = estate_nobles
				share = 5
			}
		}
	}
	option = {
		name = "EVTOPTB5066"		# Decline
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.25
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_stability_or_adm_power = yes
		add_estate_church_loyalty_effect = yes
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5066.a"		# The only problem here is that our prices are too low.
		highlight = yes
		trigger = { ruler_has_personality = sinner_personality }
		add_years_of_income = 0.65
		reduce_estate_church_loyalty_effect = yes
		add_estate_nobles_loyalty_effect = yes
	}
}


#########################################################
#		Sale of offices									#
#########################################################
country_event = {
	id = 5068
	title = "EVTNAME5068"
	desc = "EVTDESC5068"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes

	trigger = {
		OR = {
			num_of_loans = 25
			is_bankrupt = yes
		}
		NOT = { has_country_modifier = reduced_taxes_off }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5068"		# Accept
		ai_chance = {
			factor = 65
			modifier = {
				factor = 1.5
				NOT = {
					years_of_income = 0.2
				}
			}
		}
		add_years_of_income = 1
		add_country_modifier = {
			name = "reduced_taxes_off"	
			duration = 7300
		}
	}
	option = {
		name = "EVTOPTB5068"		# Decline
		ai_chance = {
			factor = 35
			modifier = {
				factor = 2
				NOT = { stability = 1 }
			}
		}
		add_stability_or_adm_power = yes
		add_prestige = 10
	}
	option = {
		name = "personality_options.5068.a"		# We must be better at hiding our tracks
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		add_years_of_income = 1
	}
}

#########################################################
#		Monopoly company formed							#
#########################################################
country_event = {
	id = 5070
	title = "EVTNAME5070"
	desc = "EVTDESC5070"
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes

	trigger = {
		NOT = {mercantilism = 50 }
		NOT = { has_country_modifier = trade_income_increase }
		OR = {
			government = monarchy
			government = republic
			government = theocracy
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5070"		# Make a long-term investment
		ai_chance = { factor = 55 }
		add_country_modifier = {
			name = "trade_income_increase"
			duration = 3650
		}		
		add_dip_power = 50
	}
	option = {
		name = "EVTOPTB5070"		# Demand payment in full
		ai_chance = { factor = 45 }
		add_years_of_income = 1
	}
	option = {
		name = "personality_options.5068.a"		# We must be better at hiding our tracks
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		add_years_of_income = 1.5
	}
}

#########################################################
#	Nobles demand increased pensions					#
#########################################################
country_event = {
	id = 5071
	title = "EVTNAME5071"
	desc = "EVTDESC5071"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes

	trigger = {
		OR = {
			government = monarchy
			has_reform = noble_elite_reform
		}
		NOT = {
			has_country_modifier = tax_income_loss
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5071"		# Accept their demands.
		ai_chance = { factor = 55 }
		add_country_modifier = {
			name = "tax_income_loss"
			duration = 7300
		}
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5071"		# Refuse their demands.
		ai_chance = {
			factor = 45
			modifier = {
				factor = 1.5
				NOT = { stability = 1 }
			}
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5071.a"		# Negotiate a better deal
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = charismatic_negotiator } }
		add_country_modifier = {
			name = "tax_income_loss"
			duration = 5475
		}
		add_estate_nobles_loyalty_effect = yes
	}
}

#########################################################
#		Grant export licences							#
#########################################################
country_event = {
	id = 5072
	title = "EVTNAME5072"
	desc = "EVTDESC5072"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes

	trigger = {
		is_lesser_in_union = no
		NOT = { has_country_modifier = tax_income_boost }
		NOT = { government = tribal }
		OR = {
			has_estate = estate_nobles
			has_estate = estate_rajput
			has_estate = estate_maratha
		}
		any_neighbor_country = {
			NOT = { is_rival = ROOT }
			NOT = { trade_embargo_by = ROOT }
			NOT = { war_with = ROOT }
			NOT = {
				has_opinion_modifier = {
					who = root
					modifier = opinion_granted_privileges
				}
			}
			NOT = {
				has_opinion_modifier = {
					who = root
					modifier = opinion_not_grant_privileges
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_neighbor_country = {
				limit = {
					NOT = { is_rival = ROOT }
					NOT = { trade_embargo_by = ROOT }
					NOT = { war_with = ROOT }
					NOT = {
						has_opinion_modifier = {
							who = root
							modifier = opinion_granted_privileges
						}
					}
					NOT = {
						has_opinion_modifier = {
							who = root
							modifier = opinion_not_grant_privileges
						}
					}
				}
				save_event_target_as = neighbour_country
			}
		}
	}

	option = {
		name = "EVTOPTA5072" # Grant privileges
		ai_chance = {
			factor = 55
			modifier = {
				factor = 1.5
				legitimacy_or_horde_unity = 90
			}
			modifier = {
				factor = 0.5
				has_reform = steppe_horde
				NOT = { legitimacy_or_horde_unity = 50 }
			}
			modifier = {
				factor = 0.5
				government = republic
				NOT = { republican_tradition = 60 }
			}
			modifier = {
				factor = 0.25
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		event_target:neighbour_country = {
			add_opinion = { who = ROOT modifier = opinion_granted_privileges }
		}
		add_legitimacy = -10
		add_horde_unity = -10
		add_republican_tradition = -5
		add_devotion = -5
		reduce_mandate_effect = yes
		add_country_modifier = {
			name = "tax_income_boost"
			duration = 7300
		}
		add_estate_nobles_loyalty_effect = yes
		reduce_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5072" # Privileges have to be earned
		ai_chance = {
			factor = 45
			modifier = {
				factor = 1.5
				government = monarchy
				NOT = { legitimacy_or_horde_unity = 60 }
			}
			modifier = {
				factor = 0.25
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		reduce_estate_nobles_loyalty_effect = yes
		add_estate_burghers_loyalty_effect = yes
		add_legitimacy = 10
		add_devotion = 5
		add_horde_unity = 5
		add_republican_tradition = 5
		add_mandate_effect = yes
		event_target:neighbour_country = {
			add_opinion = { who = ROOT modifier = opinion_not_grant_privileges }
		}					
	}
}

#########################################################
#		Establish Cantonments							#
#########################################################
country_event = {
	id = 5074
	title = "EVTNAME5074"
	desc = "EVTDESC5074"
	picture = LAND_MILITARY_eventPicture
	goto = cantonments_province
	is_triggered_only = yes

	trigger = {
		is_year = 1600
		any_owned_province = {
			is_city = yes
			culture_group = ROOT
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_city = yes
					culture_group = root
				}
				save_event_target_as = cantonments_province
			}
		}
	}

	option = {
		name = "EVTOPTA5074"		# Draft citizens
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.1
				NOT = { treasury = 200 }
			}
		}
		event_target:cantonments_province = {
			add_base_manpower = 1
		}
	}
	option = {
		name = "EVTOPTB5074"		# Mass draft with financial incentive
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				NOT = { treasury = 100 }
			}
		}
		add_treasury = -60
		event_target:cantonments_province = {
			add_base_manpower = 2
		}
	}
}

#########################################################
#		Nobles demand old rights						#
#########################################################
country_event = {
	id = 5075
	title = "EVTNAME5075"
	desc = "EVTDESC5075"
	picture = COURT_eventPicture

	is_triggered_only = yes

	trigger = {
		government = monarchy
		num_of_cities = 2
		NOT = { has_country_modifier = old_rights_granted_to_nobility }
		OR = {
			has_estate = estate_nobles
			has_estate = estate_rajput
			has_estate = estate_maratha
		}
		if = {
			limit = {
				has_estate = estate_nobles
			}
			NOT = {
				num_of_estate_privileges = {
					estate = estate_nobles
					value = 5
				}
			}
		}
		if = {
			limit = {
				has_estate = estate_rajput
			}
			NOT = {
				num_of_estate_privileges = {
					estate = estate_rajput
					value = 5
				}
			}
		}
		if = {
			limit = {
				has_estate = estate_maratha
			}
			NOT = {
				num_of_estate_privileges = {
					estate = estate_maratha
					value = 5
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5075"		# Accept demands.
		ai_chance = {
			factor = 50
		}
		if = {
			limit = { 
				has_completed_all_reforms_trigger = yes
			}
			add_country_modifier = {
				name = "old_rights_granted_to_nobility"
				duration = 3650
			}
		}
		else = {
			reduce_reform_progress_small_effect = yes
		}
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5075"		# Reject demands.
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}
	}
	option = {
		name = "personality_options.5075.a"		# create a new set of rights
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = lawgiver } }
		add_adm_power = -25
	}
}

#########################################################
#		Cities demand old rights						#
#########################################################
country_event = {
	id = 5076
	title = "EVTNAME5076"
	desc = "EVTDESC5076"
	picture = COURT_eventPicture

	is_triggered_only = yes

	trigger = {
		OR = {
			government = monarchy
			government = republic
			government = theocracy
		}
		is_lesser_in_union = no
		any_owned_province = {
			development = 10
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5076"		# Deny old rights
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
			modifier = {
				factor = 0
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		reduce_estate_burghers_loyalty_effect = yes
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB5076"		# Accept
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.5
				government = monarchy
				NOT = { legitimacy_or_horde_unity = 70 }
			}
			modifier = {
				factor = 0.5
				government = republic
				NOT = { republican_tradition = 70 }
			}
			modifier = {
				factor = 0.5
				government = theocracy
				NOT = { prestige = 25 }
			}
		}
		add_estate_burghers_loyalty_effect = yes
		if = {
			limit = { 
				has_completed_all_reforms_trigger = yes
			}
			add_legitimacy = -20
			add_horde_unity = -20
			add_republican_tradition = -10
			add_devotion = -10
		}
		else = {
			reduce_reform_progress_small_effect = yes
		}
		reduce_mandate_effect = yes
	}
	option = {
		name = "personality_options.5075.a"		# create a new set of rights
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = lawgiver } }
		add_adm_power = -25
	}
}

#########################################################
#		Non-enforcement of ordinances					#
#########################################################
country_event = {
	id = 5077
	title = "EVTNAME5077"
	desc = "EVTDESC5077"
	picture = REFORM_eventPicture
	goto = troublesome_province
	
	is_triggered_only = yes
	
	trigger = {
		num_of_cities = 2
		any_owned_province = {
			is_capital = no
			is_city = yes
			is_state_core = root
			is_in_capital_area = no
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_capital = no
					is_city = yes
					is_state_core = root
					is_in_capital_area = no
				}
				save_event_target_as = troublesome_province
			}
		}
	}

	option = {
		name = "EVTOPTA5077"		# Let them handle it
		ai_chance = { factor = 25 }
		event_target:troublesome_province = {
			if = {
				limit = {
					NOT = {
						ROOT = { num_of_cities = 20 }
					}
				}
				add_local_autonomy = 15
			}
			else = {
				area = {
					limit = {
						owned_by = root
						is_capital = no
						is_city = yes
					}
					add_local_autonomy = 15
				}
				add_local_autonomy = 15
			}
		}
	}
	option = {
		name = "EVTOPTB5077"		# Increase attempts
		ai_chance = { factor = 100 }
		add_adm_power = -50
	}
	option = {
		name = "personality_options.5077.a"		# 
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = lawgiver } }
		add_adm_power = -25
	}
}


#########################################################
#		Bourgeoisie request privileges					#
#########################################################
country_event = {
	id = 5082
	title = "EVTNAME5082"
	desc = "EVTDESC5082"
	picture = DEBATE_REPUBLICAN_eventPicture

	is_triggered_only = yes

	trigger = {
		has_estate = estate_burghers
		NOT = {
			num_of_estate_privileges = {
				estate = estate_burghers
				value = 3
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5082"		# Grant them privileges
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.25
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_adm_power = -50
		add_estate_burghers_loyalty_effect = yes
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5082"		# Deny them privileges
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.25
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		add_dip_power = -50
		reduce_estate_burghers_loyalty_effect = yes
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5082.a"
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = charismatic_negotiator }
				ruler_has_personality_ancestor = { key = silver_tongue }
			}
		}
		add_adm_power = -20
		add_dip_power = -20
		add_estate_burghers_loyalty_effect = yes
		add_estate_nobles_loyalty_effect = yes
	}
}

#########################################################
#		Italian engineer available						#
#########################################################
country_event = {
	id = 5083
	title = "EVTNAME5083"
	desc = "EVTDESC5083"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes

	trigger = {
		capital_scope = { continent = europe }
		NOT = { is_year = 1650 }
		any_known_country = {
			culture_group = latin
		}
	}
	
	immediate = {
		hidden_effect = {
			random_known_country = {
				limit = { culture_group = latin }
				save_event_target_as = italian_engineer_country
				root = {
					set_saved_name = {
						key = italian_engineer
						type = advisor
						scope = prev
					}
				}
			}
		}
	}
	after = {
		clear_saved_name = italian_engineer
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5083"		# Hire the engineer
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.2 }
			}
		}
		add_mil_power = 40
		define_advisor = {
			type = fortification_expert
			name = italian_engineer
			culture = event_target:italian_engineer_country
			religion = event_target:italian_engineer_country
			skill = 2
			discount = yes
		}
		add_years_of_income = -0.25
	}
	option = {
		name = "EVTOPTB5083"		# Decline the offer
		ai_chance = { factor = 45 }
		add_prestige = -5
	}
	option = {
		name = "personality_options.5083.a"		# Renegotiate his price
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = fierce_negotiator }
		}
		add_mil_power = 40
		define_advisor = {
			type = fortification_expert
			name = italian_engineer
			culture = event_target:italian_engineer_country
			religion = event_target:italian_engineer_country
			skill = 2
			discount = yes
		}
		add_years_of_income = -0.15
	}
}

#########################################################
#	Foreign drill instructor available					#
#########################################################
country_event = {
	id = 5084
	title = "EVTNAME5084"
	desc = "EVTDESC5084"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes

	trigger = {
		capital_scope = { continent = europe }
		mil_tech = 5 #firearms generally adopted
		any_neighbor_country = {
			same_continent = root
			mil_tech = 5
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				army_professionalism = root
				all_neighbor_country = {
					OR = {
						NOT = { same_continent = root }
						NOT = { army_professionalism = prev }
					}
				}
			}
			else = {
				army_tradition = root
				all_neighbor_country = {
					OR = {
						NOT = { same_continent = root }
						NOT = { army_tradition  = prev }
					}
				}
			}
		}
	}

	immediate = {
		hidden_effect = {
			random_known_country = {
				limit = {
					same_continent = root
					if = {
						limit = {
							has_dlc = "Cradle of Civilization"
						}
						army_professionalism = root
						all_neighbor_country = {
							OR = {
								NOT = { same_continent = root }
								NOT = { army_professionalism = prev }
							}
						}
					}
					else = {
						army_tradition = root
						all_neighbor_country = {
							OR = {
								NOT = { same_continent = root }
								NOT = { army_professionalism = prev }
							}
						}
					}
					mil_tech = 5
				}
				save_event_target_as = drill_instructor_country
				root = {
					set_saved_name = {
						key = dutch_drillmaster
						type = advisor
						scope = prev
					}
				}
			}
		}
	}
	after = {
		clear_saved_name = dutch_drillmaster
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5084"		# Hire him
		ai_chance = {
			factor = 55
		}
		PA_random_army_exp_between_2_and_5_effect = yes    #PA: replaced flat gain with random dynamic gain. -- 200e200w
		add_years_of_income = -0.25
		define_advisor = {
			type = army_reformer
			name = dutch_drillmaster
			culture = event_target:drill_instructor_country
			religion = event_target:drill_instructor_country
			skill = 2
			discount = yes
		}
	}
	option = {
		name = "EVTOPTB5084"		# Decline the offer
		ai_chance = { factor = 45 }
		add_prestige = -5
	}
	option = {
		name = "personality_options.5083.a"		# Renegotiate his price
		ai_chance = { factor = 100 }
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = fierce_negotiator }
		}
		PA_random_army_exp_between_2_and_5_effect = yes    #PA: replaced flat gain with random dynamic gain. -- 200e200w
		add_years_of_income = -0.15
		define_advisor = {
			type = army_reformer
			name = dutch_drillmaster
			culture = event_target:drill_instructor_country
			religion = event_target:drill_instructor_country
			skill = 2
			discount = yes
		}
	}
}

#########################################################
#		Build a great palace							#
#########################################################
country_event = {
	id = 5085
	title = "EVTNAME5085"
	desc = "EVTDESC5085"
	picture = FORT_eventPicture
	
	is_triggered_only = yes

	trigger = {
		government = monarchy
		is_lesser_in_union = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5085" # Build the Palace
		ai_chance = {
			factor = 40
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.3 }
			}
			modifier = {
				factor = 1.5
				NOT = { legitimacy_or_horde_unity = 60 }
			}
		}
		add_prestige = 10
		add_legitimacy = 20
		add_horde_unity = 20
		add_mandate_effect = yes
		add_years_of_income = -0.25
	}
	option = {
		name = "EVTOPTB5085" # Don't build it
		ai_chance = {
			factor = 60
			modifier = {
				factor = 0.5
				prestige = 90
			}
			modifier = {
				factor = 0.5
				NOT = { legitimacy = 40 }
			}
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.5085.a"		#It's not ambitious enough
		highlight = yes
		trigger = {
			ruler_has_personality = obsessive_perfectionist_personality
		}
		add_prestige = 15
		add_legitimacy = 25
		add_horde_unity = 25
		add_mandate_large_effect = yes
		add_years_of_income = -0.35
	}
	option = {
		name = "personality_options.5085.b"		#Let ruler try out new construction techniques
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = architectural_visionary }
		}
		add_prestige = 10
		add_legitimacy = 20
		add_horde_unity = 20
		add_mandate_large_effect = yes
		add_years_of_income = -0.15
	}
}

#########################################################
#		Uncooperative philosopher						#
#########################################################
country_event = {
	id = 5086
	title = "EVTNAME5086"
	desc = "EVTDESC5086"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes

	trigger = {
		advisor = philosopher
		religion = catholic
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5086"		# Imprison
		ai_chance = {
			factor = 60
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
		add_estate_church_loyalty_effect = yes
		remove_advisor_by_category = ADM
	}
	option = {
		name = "EVTOPTB5086"		# Allow him to remain free
		ai_chance = {
			factor = 40
			modifier = {
				factor = 0.5
				NOT = { prestige = 50 }
			}
			modifier = {
				factor = 0
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		add_prestige = -10
		reduce_estate_church_loyalty_effect = yes
		if = {
			limit = {
				exists = PAP
			}
			PAP = {
				add_opinion = {
					who = root
					modifier = opinion_heretical_philosopher
				}
			}
		}
	}
	option = {
		name = "personality_options.5086.a"		# 
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = free_thinker } }
		add_adm_power = 25
		add_prestige = -10
		reduce_estate_church_loyalty_effect = yes
		if = {
			limit = {
				exists = PAP
			}
			PAP = {
				add_opinion = {
					who = root
					modifier = opinion_heretical_philosopher
				}
			}
		}
	}
}

#########################################################
#		Merchants harrased								#
#########################################################
country_event = {
	id = 5088
	title = "EVTNAME5088"
	desc = "EVTDESC5088"
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes

	trigger = {
		num_of_merchants = 2
		overextension_percentage = 0.25
		any_country = {
			is_neighbor_of = ROOT
			NOT = { has_opinion = { who = ROOT value = 50 } }
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_country = {
				limit = {
					is_neighbor_of = ROOT
					NOT = { has_opinion = { who = ROOT value = 50 } }
				}
				save_event_target_as = harassing_merchants_nation
			}
		}
	}

	option = {
		name = "EVTOPTA5088" # Escalate complaint.
		ai_chance = {
			factor = 55
		}
		event_target:harassing_merchants_nation = {
			reverse_add_casus_belli = {	
				target = ROOT
				type = cb_insult
				months = 12
			}
		}
		add_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5088" # Seek a diplomatic solution.
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		event_target:harassing_merchants_nation = {
			add_opinion = { who = ROOT modifier = opinion_diplomatic_solution }
		}
		reduce_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5088.a"		# 
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = charismatic_negotiator } }
		every_country = {
			limit = {
				is_neighbor_of = ROOT
				NOT = { has_opinion = { who = ROOT value = 50 } }
			}
			add_opinion = { who = ROOT modifier = opinion_diplomatic_solution }
		}
		reduce_estate_burghers_loyalty_effect = yes
	}
}

#########################################################
#		Petition for redress							#
#########################################################
country_event = {
	id = 5089
	title = "EVTNAME5089"
	desc = "EVTDESC5089"
	picture = COURT_eventPicture
	goto = uppity_peasants_province

	is_triggered_only = yes

	trigger = {
		religion_group = christian
		has_estate = estate_nobles
		any_owned_province = {
			NOT = { is_colony = yes }
			NOT = { is_overseas = yes }
			is_capital = no
			is_state_core = root
		}
	}
	mean_time_to_happen = {
		days = 1
	}
	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					NOT = { is_colony = yes }
					NOT = { is_overseas = yes }
					is_capital = no
					is_state_core = root
				}
				save_event_target_as = uppity_peasants_province
			}
		}
	}

	option = {
		name = "EVTOPTA5089"		# Accept petition
		ai_chance = {
			factor = 70
			modifier = {
				factor = 0.5
				NOT = { prestige = 30 }
			}
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_prestige = -10
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5089"		# Deny petition
		ai_chance = {
			factor = 30
			modifier = {
				factor = 1.5
				is_at_war = no
			}
		}
		event_target:uppity_peasants_province = {
			anti_tax_rebels = 1
		}
		add_estate_nobles_loyalty_effect = yes
	}
}

#########################################################
#		Grant nobles aid								#
#########################################################
country_event = {
	id = 5090
	title = "EVTNAME5090"
	desc = "EVTDESC5090"
	picture = COURT_eventPicture

	is_triggered_only = yes

	trigger = {
		government = monarchy
		has_regency = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5090"		# Grant aid
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.7 }
			}
		}
		add_years_of_income = -0.5
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5090"		# Deny aid
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_adm_power = -50
		reduce_estate_nobles_loyalty_effect = yes
	}
}

#########################################################
#	Support for dissidents abroad						#
#########################################################
country_event = {
	id = 5091
	title = "EVTNAME5091"
	desc = "EVTDESC5091"
	picture = ANGRY_MOB_eventPicture

	is_triggered_only = yes

	trigger = {
		NOT = { adm = 3 }
		any_neighbor_country = {
			is_neighbor_of = ROOT
			NOT = { alliance_with = root }
			is_free_or_tributary_trigger = yes
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_neighbor_country = {
				limit = {
					is_neighbor_of = ROOT
					NOT = { alliance_with = root }
					is_free_or_tributary_trigger = yes
				}
				save_event_target_as = dissidents_in_here
			}
		}
	}

	option = {
		name = "EVTOPTA5091"		# Support
		ai_chance = { factor = 55 }
		add_years_of_income = -0.1
		event_target:dissidents_in_here = {
			add_opinion = { who = ROOT modifier = opinion_supports_dissidents }
		}
	}
	option = {
		name = "EVTOPTB5091"		# Decline
		ai_chance = { factor = 45 }
		add_prestige = -10
	}
}

#########################################################
#	Foreign trade competition rises						#
#########################################################
country_event = {
	id = 5092
	title = "EVTNAME5092"
	desc = "EVTDESC5092"
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes

	trigger = {
		num_of_merchants = 3
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5092"		# Impose new tariff
		ai_chance = { factor = 70 }
		add_mercantilism = 3
		add_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5092"		# Deny new tariff
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		reduce_estate_burghers_loyalty_effect = yes
		add_dip_power = 33
	}
	option = {
		name = "personality_options.5092.a"		# 
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = entrepreneur } }
		add_mercantilism = 4
		add_estate_burghers_loyalty_effect = yes
	}
}

#########################################################
#		Advisor events									#
#########################################################

# Parliament demands removal of advisor
country_event = {
	id = 5093
	title = "EVTNAME5093"
	desc = "EVTDESC5093"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes

	trigger = {
		has_parliament = yes
		advisor = statesman
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5093"		# Fire him!
		ai_chance = { factor = 40 }
		reduce_meritocracy_effect = yes
		remove_advisor = statesman
	}
	option = {
		name = "EVTOPTB5093"		# We have faith in him
		ai_chance = { factor = 60 }
		add_prestige = -10
	}
}


# Heretic advisor
country_event = {
	id = 5094
	title = "EVTNAME5094"
	desc = "EVTDESC5094"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes

	trigger = {
		government = theocracy
		has_estate = estate_church
		employed_advisor = {
			religion = heretic
		}
	}

	immediate = {
		hidden_effect = {
			hidden_effect = {
				random_list = {
					1 = {
						trigger = {
							employed_advisor = {
								category = ADM
								religion = heretic
							}
						}
						modifier = {
							factor = 3
							advisor = statesman
						}
						set_country_flag = advisor_events_adm
					}
					1 = {
						trigger = {
							employed_advisor = {
								category = DIP
								religion = heretic
							}
						}
						set_country_flag = advisor_events_dip
					}
					1 = {
						trigger = {
							employed_advisor = {
								category = MIL
								religion = heretic
							}
						}
						set_country_flag = advisor_events_mil
					}
				}
			}
		}
	}

	after = {
		hidden_effect = {
			trigger_switch = {
				on_trigger = has_country_flag
				advisor_events_adm = { clr_country_flag = advisor_events_adm }
				advisor_events_dip = { clr_country_flag = advisor_events_dip }
				advisor_events_mil = { clr_country_flag = advisor_events_mil }
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5094"		# Fire him!
		ai_chance = { factor = 40 }
		reduce_meritocracy_effect = yes
		trigger_switch = {
			on_trigger = has_country_flag
			advisor_events_adm = { remove_advisor_by_category = ADM }
			advisor_events_dip = { remove_advisor_by_category = DIP }
			advisor_events_mil = { remove_advisor_by_category = MIL }
		}
		add_estate_church_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5094"		# We have faith in him
		ai_chance = {
			factor = 60
			modifier = {
				factor = 0
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		add_prestige = -10
		reduce_estate_church_loyalty_effect = yes
	}
}


# Statesman gains power
country_event = {
	id = 5095
	title = "EVTNAME5095"
	desc = "EVTDESC5095"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes

	trigger = {
		statesman = 2
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5095"		# Fire him!
		ai_chance = { factor = 40 }
		reduce_meritocracy_effect = yes
		remove_advisor = statesman
	}
	option = {
		name = "EVTOPTB5095"		# He is doing a great job
		ai_chance = { factor = 60 }
		add_prestige = -10
	}
}


#########################################################
#		Influenced elections							#
#########################################################
country_event = {
	id = 5096
	title = "EVTNAME5096"
	desc = "EVTDESC5096"
	picture = ELECTION_REPUBLICAN_eventPicture

	is_triggered_only = yes

	trigger = {
		is_elector = yes
		is_emperor = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5096" # How thoughtful
		ai_chance = { factor = 70 }
		add_years_of_income = 0.2
		add_corruption = 0.5
		random_country = {
			limit = { is_elector = yes }
			add_opinion = { who = ROOT modifier = opinion_accepted_bribe }
		}
	}
	option = {
		name = "EVTOPTB5096" # Bribes are beyond me
		ai_chance = { factor = 30 }
		add_prestige = 10
		random_country = {
			limit = { is_elector = yes }
			add_opinion = { who = ROOT modifier = opinion_declined_bribe }
		}
	}
}

#########################################################
#		Peasants getting uppity							#
#########################################################
country_event = {
	id = 5097
	title = "EVTNAME5097"
	desc = "EVTDESC5097"
	picture = ANGRY_MOB_eventPicture

	is_triggered_only = yes

	trigger = {
		government = monarchy
		is_lesser_in_union = no
		is_revolutionary = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5097"		# Enforce serfdom
		ai_chance = {
			factor = 80
		}
		add_estate_nobles_loyalty_effect = yes
		add_adm_power = -35
	}
	option = {
		name = "EVTOPTB5097"		# These things happen
		ai_chance = {
			factor = 20
			modifier = {
				factor = 0.25
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		reduce_estate_nobles_loyalty_effect = yes
		add_legitimacy = -10
		add_horde_unity = -10
	}
	option = {
		name = "personality_options.5097.a"		# Attempt to mediate
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = charismatic_negotiator } }
		add_dip_power = -15
	}
}

#########################################################
#		Corruption in the church						#
#########################################################
country_event = {
	id = 5098
	title = "EVTNAME5098"
	desc = "EVTDESC5098"
	picture = RELIGION_eventPicture

	is_triggered_only = yes

	trigger = {
		NOT = { stability = -1 }
		government = theocracy
		has_estate = estate_church
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5098"		# Cleanse the temple
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		add_devotion = 10
		add_stability_or_adm_power = yes
		reduce_estate_church_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB5098"		# Fine the sinners
		ai_chance = { factor = 45 }
		add_devotion = -10
		add_years_of_income = 0.75
		add_corruption = 0.5
		add_estate_church_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5098.a"		# 
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		add_devotion = -15
		add_years_of_income = 1
		add_corruption = 1
		add_estate_church_loyalty_effect = yes
	}
	option = {
		name = "personality_options.5098.b"		# 
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = incorruptible } }
		add_devotion = 15
		add_stability_or_adm_power = yes
		add_corruption = -2
	}
}

#########################################################
#		Merchant fractures								#
#########################################################
country_event = {
	id = 5099
	title = "EVTNAME5099"
	desc = "EVTDESC5099"
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes

	trigger = {
		num_of_merchants = 3
		is_year = 1560
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5099"		# Support mercantilist faction
		ai_chance = { factor = 15 }
		add_mercantilism = 3
	}
	option = {
		name = "EVTOPTB5099"		# This isn't a matter for the crown
		ai_chance = { factor = 70 }
		trigger = {
			government = monarchy
			is_lesser_in_union = no
		}
		add_prestige = 10
		add_legitimacy = 10
		add_horde_unity = 10
	}
	option = {
		name = "EVTOPTC5099"		# Propose free trade
		ai_chance = { factor = 0 }
		add_mercantilism = -3
		add_years_of_income = 0.10
	}
}


#########################################################
#		Military traditions scorned						#
#########################################################

# Naval traditions scorned
country_event = {
	id = 6000
	title = "EVTNAME6000"
	desc = "EVTDESC6000"
	picture = NAVAL_MILITARY_eventPicture

	is_triggered_only = yes

	trigger = {
		navy_tradition = 10
		NOT = { navy_tradition = 35 }
		army_tradition = 40
		NOT = { navy_size_percentage = 1.25 }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6000"		# This is well, land is where its at
		ai_chance = { factor = 60 }
		add_navy_tradition = -20
		add_army_tradition = 10
	}
	option = {
		name = "EVTOPTB6000"		# We must stop this deterioration
		ai_chance = { factor = 40 }
		add_navy_tradition = -5
	}
	option = {
		name = "personality_options.6000.a"		# We must stop this deterioration
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = navigator } }
		add_navy_tradition = 5
	}
}

# Land traditions scorned
country_event = {
	id = 6001
	title = "EVTNAME6001"
	desc = "EVTDESC6001"
	picture = MILITARY_CAMP_eventPicture

	is_triggered_only = yes

	trigger = {
		num_of_ports = 1
		army_tradition = 10
		NOT = { army_tradition = 35 }
		navy_tradition = 40
		primitives = no
		navy_size = 1
		NOT = { army_size_percentage = 1 }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6001"		# The fleet is our wooden wall!
		ai_chance = { factor = 60 }
		add_army_tradition = -20
		add_navy_tradition = 10
	}
	option = {
		name = "EVTOPTB6001"		# We must stop this deterioration
		ai_chance = { factor = 40 }
		add_army_tradition = -5
	}
	option = {
		name = "personality_options.6001.a"		# We must stop this deterioration
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = strict } }
		add_army_tradition = 5
	}
}

#########################################################
#		Opposing military schools						#
#########################################################
#country_event = {
#	id = 6002
#	title = "EVTNAME6002"
#	desc = "EVTDESC6002"
#	picture = MILITARY_CAMP_eventPicture
#
#	is_triggered_only = yes
#
#	trigger = {
#		NOT = { has_country_modifier = offensive_modifier }
#		NOT = { has_country_modifier = defensive_modifier }
#	}
#
#	mean_time_to_happen = {
#		days = 1
#	}
#
#	option = {
#		name = "EVTOPTA6002"		# Attack is always the best option
#		ai_chance = { factor = 55 }
#		add_adm_power = -50
#		add_country_modifier = {
#			name = offensive_modifier
#			duration = 3650
#		}
#	}
#	option = {
#		name = "EVTOPTB6002"		# Let them come to us
#		ai_chance = { factor = 45 }
#		add_adm_power = -50
#		add_country_modifier = {
#			name = defensive_modifier
#			duration = 3650
#		}
#	}
#	option = {
#		name = "personality_options.6001.a"		# Attempt to combine the best aspects of both schools.
#		highlight = yes
#		trigger = { ruler_has_personality_ancestor = { key = martial_educator } }
#		add_adm_power = -25
#		add_country_modifier = {
#			name = defensive_modifier
#			duration = 1825
#		}
#		add_country_modifier = {
#			name = offensive_modifier
#			duration = 1825
#		}
#	}
#}
#
#########################################################
#	Representative national institutions				#
#########################################################
country_event = {
	id = 6003
	title = "EVTNAME6003"
	desc = "EVTDESC6003"
	picture = UNIVERSITY_eventPicture

	is_triggered_only = yes

	trigger = {
		government = monarchy
		has_institution = printing_press
		has_parliament = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6003"		# L'etat c'est moi!
		ai_chance = { factor = 30 }
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB6003"		# Give them what they want
		ai_chance = { factor = 70 }
		add_adm_power = -35
		add_dip_power = -35
		add_mil_power = -35
	}
	option = {
		name = "personality_options.6003.a"		# Establish minor represantive institutions.
		trigger = {
			ruler_has_personality_ancestor = {
				key = reformist
			}
		}
		highlight = yes
		ai_chance = { factor = 100 }
		change_government_reform_progress = 15
	}
}

#########################################################
#		Vatican infiltration							#
#########################################################
country_event = {
	id = 6004
	title = "EVTNAME6004"
	desc = "EVTDESC6004"
	picture = POPE_PREACHING_eventPicture

	is_triggered_only = yes

	trigger = {
		religion = catholic
		NOT = { has_reform = papacy_reform }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6004"		# Instruct him to go forward
		ai_chance = { factor = 30 }
		add_papal_influence = 5
	}
	option = {
		name = "EVTOPTB6004"		# Let the matter drop
		ai_chance = { factor = 70 }
		add_prestige = 5
	}
	option = {
		name = "personality_options.6004.a"		# Our [Root.Monarch.GetTitle] will know how to get the most for our money.
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = intricate_web_weaver } }
		add_papal_influence = 10
	}
}


#########################################################
#	City-state wants independence back					#
#########################################################

# Genoa
country_event = {
	id = 6005
	title = "EVTNAME6005"
	desc = "EVTDESC6005"
	picture = ANGRY_MOB_eventPicture
	goto = 101

	is_triggered_only = yes

	trigger = {
		always = no
		NOT = { exists = GEN }
		owns = 101
		is_year = 1700
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6005"		# Nah...
		ai_chance = { factor = 60 }
		101 = {
			nationalist_rebels = 1
		}
	}
	option = {
		name = "EVTOPTB6005"		# We'll consider it
		ai_chance = { factor = 40 }
		GEN = {
			add_core = 101
		}
		remove_core = 101
	}
}

# Venice
country_event = {
	id = 6006
	title = "EVTNAME6006"
	desc = "EVTDESC6006"
	picture = ANGRY_MOB_eventPicture
	goto = 112

	is_triggered_only = yes

	trigger = {
		always = no
		NOT = { exists = VEN }
		is_year = 1700
		owns = 112
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6006"		# Nah...
		ai_chance = { factor = 70 }
		112 = {
			nationalist_rebels = 1
		}
	}
	option = {
		name = "EVTOPTB6006"		# We'll consider it
		ai_chance = { factor = 30 }
		VEN = {
			add_core = 112
		}
		remove_core = 112
	}
}


#########################################################
#		Exceptional Court Painter						#
#########################################################

country_event = {
	id = 6012
	title = "EVTNAME6012"
	desc = "EVTDESC6012"
	picture = PAINTER_ARTIST_eventPicture

	is_triggered_only = yes

	trigger = {
		NOT = { overextension_percentage = 0.01 }
		capital_scope = { continent = europe }
		is_at_war = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6012"		# Hire him
		ai_chance = {
			factor = 65
			modifier = {
				factor = 0
				stability = 3
			}
		}
		add_years_of_income = -0.25
		add_prestige = 10
		add_stability_or_adm_power = yes
	}
	option = {
		name = "EVTOPTB6012"		# Decline his services
		ai_chance = { factor = 35 }
		add_prestige = -5
	}
	option = {
		name = "personality_options.5083.a"		# Hire him
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = fierce_negotiator } }
		add_years_of_income = -0.15
		add_prestige = 10
		add_stability_or_adm_power = yes
	}
}

#########################################################
#			Grand Ball									#
#########################################################
country_event = {
	id = 6013
	title = "EVTNAME6013"
	desc = "EVTDESC6013"
	picture = COURT_eventPicture

	is_triggered_only = yes

	trigger = {
		religion_group = christian
		is_at_war = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6013"		# Arrange a ball
		ai_chance = { factor = 60 }
		add_prestige = 10
		add_years_of_income = -0.10
	}
	option = {
		name = "EVTOPTB6013"		# Don't arrange a ball
		ai_chance = { factor = 40 }
		add_prestige = -5
	}
	option = {
		name = "personality_options.6013.a"		# Arrange a ball
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = well_connected } }
		add_prestige = 15
		add_years_of_income = -0.10
	}
}

#########################################################
#			Festivities									#
#########################################################
country_event = {
	id = 6015
	title = "EVTNAME6015"
	desc = "EVTDESC6015"
	picture = COURT_eventPicture

	is_triggered_only = yes

	trigger = {
		is_at_war = no
		has_any_disaster = no
		adm = 3
		has_regency = no
		NOT = { overextension_percentage = 0.01 }
		NOT = { num_of_rebel_armies = 1 }
		NOT = { num_of_rebel_controlled_provinces = 1 }
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					controlled_by = owner
					is_city = yes
				}
				save_event_target_as = random_province
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6015"		# Arrange festivities
		trigger = { NOT = { stability = 3 } }
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				stability = 2
			}
		}
		add_stability_or_adm_power = yes
	}
	option = {
		name = "EVTOPTB6015"		# Such nonsense, wasting money like that!
		ai_chance = { factor = 70 }
		goto = random_province
		event_target:random_province = {
			add_base_tax = 1
		}
	}
	option = {
		name = "personality_options.6015.a"		# Arrange an Opulent Feast
		highlight = yes
		trigger = { ruler_has_personality = drunkard_personality }
		add_stability_or_adm_power = yes
		random_neighbor_country = {
			limit = {
				NOT = { war_with = ROOT }
			}
			add_opinion = {
				who = ROOT
				modifier = indulgent_feast
			}
		}
		random_neighbor_country = {
			limit = {
				NOT = { war_with = ROOT }
			}
			add_opinion = {
				who = ROOT
				modifier = indulgent_feast
			}
		}
	}
}

# Complaints about Bailiff
country_event = {
	id = 710
	title = "EVTNAME710"
	desc = "EVTDESC710"
	picture = DEBATE_REPUBLICAN_eventPicture
	goto = bailiff_province

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		NOT = { government = tribal }
		NOT = { government = native }
		any_owned_province = {
			is_state = yes
			is_core = ROOT
			is_in_capital_area = yes
			is_capital = no
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_state = yes
					is_core = ROOT
					is_in_capital_area = yes
					is_capital = no
				}
				save_event_target_as = bailiff_province
			}
		}
	}

	option = {
		name = "EVTOPTA710"
		trigger = {
			is_emperor_of_china = no
			is_lesser_in_union = no
			NOT = { government = republic }
		}
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0
				NOT = { legitimacy_equivalent = 20 }
			}
			modifier = {
				factor = 0.5
				NOT = { legitimacy_equivalent = 60 }
			}
			modifier = {
				factor = 1.5
				legitimacy_equivalent = 100
			}
		}
		add_legitimacy = -10
		add_devotion = -10
	}
	option = {
		name = "EVTOPTC710"
		trigger = {
			OR = { 
				government = republic
				is_emperor_of_china = yes
				is_lesser_in_union = yes
			}
		}
		ai_chance = {
			factor = 100
		}
		add_meritocracy_effect = yes
		if = {
			limit = {
				government = republic
			}
			add_republican_tradition = 5
			add_corruption = -2
			add_years_of_income = -0.3
		}
		if = {
			limit = {
				is_lesser_in_union = yes
			}
			add_liberty_desire = 10
		}
	}
	option = {
		name = "EVTOPTB710"
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
			modifier = {
				factor = 1.5
				stability = 2
			}
		}		
		add_stability = -1
	}
	option = {
		name = "personality_options.710.a"
		highlight = yes
		trigger = { ruler_has_personality = cruel_personality }
		event_target:bailiff_province = {
			spawn_small_scaled_rebels = {
				type = anti_tax_rebels
				no_defined_leader = yes
			}
		}
	}
}

# Priests are preaching Heresy!
country_event = {
	id = 711
	title = "EVTNAME711"
	desc = "EVTDESC711"
	picture = POPE_PREACHING_eventPicture

	is_triggered_only = yes
	goto = heresy_province
	
	trigger = {
		stability = 0
		religion = catholic
		is_at_war = no
		num_of_cities = 2
		any_owned_province = {
			religion = catholic
			is_state_core = root
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					religion = catholic
					is_state_core = root
				}
				save_event_target_as = heresy_province
			}
		}
	}

	option = {
		name = "EVTOPTA711"
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		reduce_estate_church_loyalty_effect = yes
		add_prestige = -5
		event_target:heresy_province = {
			if = {
				limit = {
					NOT = {
						ROOT = { num_of_cities = 20 }
					}
				}
				add_province_modifier = {
					name = "heresy"
					duration = 1825
				}
			}
			else = {
				area = {
					limit = {
						owned_by = root
						is_city = yes
						religion = catholic
					}
					add_province_modifier = {
						name = "heresy"
						duration = 1825
					}
				}
			}
		}
	}
	option = {
		name = "EVTOPTB711"
		ai_chance = {
			factor = 65
		}
		add_dip_power = -30
		add_estate_church_loyalty_effect = yes
	}
	option = {
		name = "personality_options.711.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = tolerant } }
		add_prestige = 5
		reduce_estate_church_loyalty_effect = yes
		event_target:heresy_province = {
			if = {
				limit = {
					NOT = {
						ROOT = { num_of_cities = 20 }
					}
				}
				add_province_modifier = {
					name = "heresy"
					duration = 1825
				}
			}
			else = {
				area = {
					limit = {
						owned_by = root
						is_city = yes
						religion = catholic
					}
					add_province_modifier = {
						name = "heresy"
						duration = 1825
					}
				}
			}
		}
	}
}

# Dramatic Currency Revaluation
country_event = {
	id = 712
	title = "EVTNAME712"
	desc = "EVTDESC712"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		inflation = 5
	}

	mean_time_to_happen = {
		days = 1	
	}

	option = {
		name = "EVTOPTA712"
		ai_chance = {
			factor = 25
			modifier = {
				factor = 0.5
				war_exhaustion = 4
			}
		}
		add_stability = -1
	}
	option = {
		name = "EVTOPTB712"
		ai_chance = {
			factor = 75
			modifier = {
				factor = 0.5
				inflation = 10
			}
		}
		add_inflation = 3
	}
	option = {
		name = "personality_options.712.a"
		trigger = {
			ruler_has_personality_ancestor = {
				key = reformist
			}
		}
		highlight = yes
		ai_chance = {
			factor = 100
		}
		add_inflation = -3
		adm_power_cost = 50
	}
}

# Decadence
country_event = {
	id = 713
	title = "EVTNAME713"
	desc = "EVTDESC713"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 1
		is_at_war = no
		is_bankrupt = no
		has_truce = no
		NOT = {
			AND = {
				num_of_loans = 10
				war_exhaustion = 0.1
				had_recent_war = 10
				num_of_rebel_armies = 1
				num_of_rebel_controlled_provinces = 1
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA713"
		add_stability = -1
		if = {
			limit = { has_government_mechanic = ottoman_decadence_mechanic }
			add_government_power = {
				mechanic_type = ottoman_decadence_mechanic
				power_type = ottoman_decadence
				value = 2
			}
		}
	}
}

# Military Divided!
country_event = {
	id = 714
	title = "EVTNAME714"
	desc = "EVTDESC714"
	picture = LAND_MILITARY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		NOT = { has_country_modifier = defensive_modifier }
		NOT = { has_country_modifier = offensive_modifier }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA714"
		add_country_modifier = {
			name = defensive_modifier
			duration = 3650
		}
	}
	option = {
		name = "EVTOPTB714"
		add_country_modifier = {
			name = offensive_modifier
			duration = 3650
		}
	}
	option = {
		name = "personality_options.714.a"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = martial_educator }
		}
		add_country_modifier = {
			name = offensive_modifier
			duration = 1825
		}
		add_country_modifier = {
			name = defensive_modifier
			duration = 1825
		}
	}
	option = {
		name = "personality_options.714.b"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = bold_fighter }
		}
		add_country_modifier = {
			name = offensive_modifier
			duration = 5475
		}
	}
	option = {
		name = "personality_options.714.c"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = tactical_genius }
		}
		add_country_modifier = {
			name = defensive_modifier
			duration = 5475
		}
	}
}

# $MONARCH$ embarrasses the court
country_event = {
	id = 715
	title = "EVTNAME715"
	desc = "EVTDESC715"
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		stability = 0
		government = monarchy
		has_regency = no
		is_lesser_in_union = no
		NOT = { DIP = 4 }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA715"
		add_stability = -1
	}
	option = {
		name = "personality_options.715.a"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = charismatic_negotiator }
		}
		add_prestige = -10
	}
}

# Nobles Demand Recompensation
country_event = {
	id = 716
	title = "EVTNAME716"
	desc = "EVTDESC716"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 1
		is_at_war = no
		is_bankrupt = no
		has_estate = estate_nobles
		NOT = { revolt_percentage = 0.1 }
		NOT = { num_of_loans = 10 }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA716"
		ai_chance = {
			factor = 35
			modifier = {
				factor = 1.5
				stability = 3
			}
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_stability = -1
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB716"
		ai_chance = {
			factor = 75
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 1 }
			}
		}
		add_years_of_income = -0.75
		add_estate_nobles_loyalty_effect = yes
	}
}

# Monetary Reforms
country_event = {
	id = 717
	title = "EVTNAME717"
	desc = "EVTDESC717"
	picture = REFORM_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		stability = 0
		inflation = 5
		NOT = { advisor = master_of_mint }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA717"
		ai_chance = {
			factor = 25
		}
		add_stability = -1
		add_inflation = -2
		add_mandate_effect = yes
	}
	option = {
		name = "EVTOPTB717"
		ai_chance = {
			factor = 75
			modifier = {
				factor = 0.5
				inflation = 15
			}
		}
		add_inflation = 3
		reduce_mandate_effect = yes
	}
	option = {
		name = "personality_options.717.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = midas_touched } }
		add_inflation = -1
		add_mandate_effect = yes
	}
}

# The Fortunes of War
country_event = {
	id = 718
	title = "EVTNAME718"
	desc = "EVTDESC718"
	picture = REFORM_eventPicture

	is_triggered_only = yes
	
	trigger = {
		war_exhaustion = 5
		is_at_war = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA718"
		ai_chance = {
			factor = 9
		}
		add_war_exhaustion = -3
		add_inflation = 1
	}
	option = {
		name = "EVTOPTB718"
		ai_chance = {
			factor = 1
		}
		add_war_exhaustion = -1
	}
	option = {
		name = "personality_options.718.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = kind_hearted } }
		ai_chance = {
			factor = 100
		}
		add_war_exhaustion = -2
	}
}

# Strong Military Leadership
country_event = {
	id = 719
	title = "EVTNAME719"
	desc = "EVTDESC719"
	picture = MILITARY_CAMP_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		army_tradition = 50
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA719"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				stability = 2
			}
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_stability = -1
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB719"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				army_tradition = 90
			}
		}
		add_army_tradition = -20
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "personality_options.719.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = martial_educator } }
		ai_chance = {
			factor = 100
		}
		add_army_tradition = -10
	}
}

# The Naval Tradition
country_event = {
	id = 720
	title = "EVTNAME720"
	desc = "EVTDESC720"
	picture = NAVAL_MILITARY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		navy_tradition = 50
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA720"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				stability = 2
			}
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_stability = -1
		reduce_estate_nobles_loyalty_effect = yes
		add_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB720"
		ai_chance = {
			factor = 50
		}
		add_estate_nobles_loyalty_effect = yes
		add_navy_tradition = -20
	}
	option = {
		name = "personality_options.720.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = navigator } }
		ai_chance = {
			factor = 50
		}
		add_dip_power = -25
	}	
}

# Sickness of $MONARCHTITLE$
country_event = {
	id = 722
	title = "EVTNAME722"
	desc = "EVTDESC722"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		has_regency = no
		government = monarchy
		NOT = {	has_ruler_modifier = power_to_nobles	}
		NOT = {	has_ruler_modifier = power_to_provinces	}
		OR = {
			has_estate = estate_nobles
			has_estate = estate_rajput
			has_estate = estate_maratha
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA722"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_ruler_modifier = {
			name = "power_to_nobles"
			duration = 3650
		}
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB722"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		add_ruler_modifier = {
			name = "power_to_provinces"
			duration = 3650
		}
		add_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "personality_options.722.a"
		highlight = yes
		trigger = {
			ruler_has_personality = well_advised_personality
		}
		ai_chance = {
			factor = 100
		}
		add_ruler_modifier = {
			name = "power_to_advisors"
			duration = 3650
		}
	}
}

# Regional Nobles challenge $COUNTRY$
country_event = {
	id = 723
	title = "EVTNAME723"
	desc = "EVTDESC723"
	picture = ANGRY_MOB_eventPicture
	goto = unruly_nobles_province

	is_triggered_only = yes
	
	trigger = {
		num_of_cities = 30
		any_owned_province = {
			has_owner_culture = no
			NOT = { local_autonomy = 0.5 }
			is_city = yes
			is_core = root
		}
		OR = {
			has_estate = estate_nobles
			has_estate = estate_rajput
			has_estate = estate_maratha
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					has_owner_culture = no
					NOT = { local_autonomy = 0.5 }
					is_city = yes
					is_core = root
				}
				save_event_target_as = unruly_nobles_province
			}
		}
	}

	option = {
		name = "EVTOPTA723"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				unrest = 5
			}
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		event_target:unruly_nobles_province = {
			noble_rebels = 2
		}
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB723"
		ai_chance = {
			factor = 33
		}
		add_estate_nobles_loyalty_effect = yes
		event_target:unruly_nobles_province = {
			add_province_modifier = {
				name = "powerful_noble"
				duration = 7300
			}
			add_local_autonomy = 20
		}		
	}	
	option = {
		name = "EVTOPTC723"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
}

# Clergy condemns philosopher as heretic!
country_event = {
	id = 724
	title = "EVTNAME724"
	desc = "EVTDESC724"
	picture = POPE_PREACHING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		NOT = { has_country_modifier = narrowminded_modifier }
		NOT = { has_country_modifier = innovative_modifier }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA724"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				NOT = { religious_unity = 0.8 }
			}
		}
		add_stability = -1
		add_country_modifier = {
			name = narrowminded_modifier
			duration = 3650
		}
		add_estate_church_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB724"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				religious_unity = 1
			}
			modifier = {
				factor = 0
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		add_stability = -1
		add_country_modifier = {
			name = innovative_modifier
			duration = 3650
		}
		reduce_estate_church_loyalty_effect = yes
	}
	option = {
		name = "personality_options.724.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = tolerant } }
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				religious_unity = 1
			}
		}
		
		add_country_modifier = {
			name = innovative_modifier
			duration = 3650
		}
	}
}

# Growth of Cities attracts Serfs
country_event = {
	id = 725
	title = "EVTNAME725"
	desc = "EVTDESC725"
	picture = CITY_DEVELOPMENT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		num_of_cities = 5
		NOT = { has_country_modifier = serfdom_modifier }
		any_owned_province = {
			NOT = { base_tax = 5 }
			base_tax = 2
			is_capital = no
			is_in_capital_area = yes
		}
		NOT = { is_year = 1650 }
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					NOT = { base_tax = 5 }
					base_tax = 2
					is_capital = no
					is_in_capital_area = yes
				}
				save_event_target_as = rural_province
			}
		}
	}

	option = {
		name = "EVTOPTA725"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		goto = rural_province
		event_target:rural_province = {
			add_base_tax = -1
			add_local_autonomy = 25
		}
		capital_scope = {
			add_base_tax = 1
		}
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB725"
		ai_chance = {
			factor = 50
		}
		add_estate_nobles_loyalty_effect = yes
		add_country_modifier = {
			name = serfdom_modifier
			duration = 7300
		}
	}
	option = {
		name = "personality_options.725.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = calm } }
		ai_chance = {
			factor = 100
		}
		goto = rural_province
		event_target:rural_province = {
			add_local_autonomy = 25
		}
		capital_scope = {
			add_base_tax = 1
		}
	}
}

# $MONARCHTITLE$'s reputation tarnished!
country_event = {
	id = 726
	title = "EVTNAME726"
	desc = "EVTDESC726"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		NOT = { dip = 5 }
		has_regency = no
		is_lesser_in_union = no
		stability = -1
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA726"
		ai_chance = {
			factor = 50
		}
		add_dip_power = -100
	}
	option = {
		name = "EVTOPTB726"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "personality_options.726.a" #Ruthles? Me?
		highlight = yes
		trigger = { ruler_has_personality = naive_personality }
		ai_chance = {
			factor = 100
		}
		add_prestige = -5
	}
	option = {
		name = "personality_options.726.b"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = charismatic_negotiator } }
		ai_chance = {
			factor = 100
		}
		add_dip_power = -25
	}
}

# Fight the Good Fight!
country_event = {
	id = 727
	title = "EVTNAME727"
	desc = "EVTDESC727"
	picture = BATTLE_eventPicture

	is_triggered_only = yes
	
	trigger = {
		any_enemy_country = {
			OR = {
				is_in_war = {
					attackers = root
					defender_leader = this
				}
				is_in_war = {
					attacker_leader = this
					defenders = root
				}
			}
		}
		war_exhaustion = 5
	}

	immediate = {
		hidden_effect = {
			random_enemy_country = {
				limit = {
					OR = {
						is_in_war = {
							attackers = root
							defender_leader = this
						}
						is_in_war = {
							attacker_leader = this
							defenders = root
						}
					}
				}
				save_event_target_as = enemy_country
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA727"
		add_war_exhaustion = -1
	}
}

# Claims on Our Rivals!
country_event = {
	id = 728
	title = "EVTNAME728"
	desc = "EVTDESC728"
	picture = DIPLOMACY_eventPicture
	goto = claims_province

	is_triggered_only = yes
	
	trigger = {
		dip = 3
		is_free_or_tributary_trigger = yes
		any_rival_country = {
			is_neighbor_of = ROOT
			any_owned_province = {
				NOT = { is_claim = ROOT }
				NOT = { is_core = ROOT }
				any_neighbor_province = {
					owned_by = ROOT
				}
			}
		}
	}

	mean_time_to_happen =  {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_rival_country = {
				limit = {
					any_owned_province = {
						NOT = { is_claim = ROOT }
						NOT = { is_core = ROOT }
						OR = {
							is_capital = no
							owner = {
								NOT = { num_of_cities = 2 }
							}
						}
						any_neighbor_province = {
							owned_by = ROOT
						}
					}			
				}
				random_owned_province = {
					limit = {
						NOT = { is_claim = ROOT }
						NOT = { is_core = ROOT }
						any_neighbor_province = {
							owned_by = ROOT
						}
					}
					save_event_target_as = claims_province
				}
			}
		}
	}

	option = {
		name = "EVTOPTA728"
		event_target:claims_province = {
			add_claim = ROOT
		}
		add_prestige = 10	
	}
}

# Improve the Capital
country_event = {
	id = 729
	title = "EVTNAME729"
	desc = "EVTDESC729"
	picture = CITY_DEVELOPMENT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		is_at_war = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA729"
		ai_chance = {
			factor = 50
		}
		capital_scope = { add_base_tax = 1 }
		add_yearly_manpower = -0.5
	}
	option = {
		name = "EVTOPTB729"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.2 }
			}
		}
		capital_scope = { add_base_tax = 1 }
		add_years_of_income = -0.25
	}
	option = {
		name = "personality_options.729.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = architectural_visionary } }
		ai_chance = {
			factor = 100
		}
		capital_scope = { add_base_tax = 1 }
		add_years_of_income = -0.15
	}
	option = {
		name = "personality_options.729.b"
		highlight = yes
		trigger = { ruler_has_personality = obsessive_perfectionist_personality }
		ai_chance = {
			factor = 100
		}
		capital_scope = { add_base_tax = 2 }
		add_years_of_income = -0.35
	}
}

# Land Technology Research Useless
country_event = {
	id = 730
	title = "EVTNAME730"
	desc = "EVTDESC730"
	picture = DEBATE_REPUBLICAN_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA730"
		ai_chance = {
			factor = 40
		}
		add_mil_power = -50
	}
	option = {
		name = "EVTOPTB730"
		ai_chance = {
			factor = 60
			modifier = {
				factor = 0.5
				NOT = { prestige = 0 }
			}
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.730.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_prestige = -5
		reduce_meritocracy_effect = yes
		kill_advisor = random
	}
}

# Naval Research Wrong!
country_event = {
	id = 731
	title = "EVTNAME731"
	desc = "EVTDESC731"
	picture = SHIP_SAILING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		num_of_ports = 1
		primitives = no
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA731"
		ai_chance = {
			factor = 40
		}
		add_dip_power = -50
	}
	option = {
		name = "EVTOPTB731"
		ai_chance = {
			factor = 60
			modifier = {
				factor = 0.5
				NOT = { prestige = 0 }
			}
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.730.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_prestige = -5
		reduce_meritocracy_effect = yes
		kill_advisor = random
	}
}

# New Trade Research is Heretical
country_event = {
	id = 732
	title = "EVTNAME732"
	desc = "EVTDESC732"
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA732"
		ai_chance = {
			factor = 60
		}
		add_dip_power = -50
	}
	option = {
		name = "EVTOPTB732"
		ai_chance = {
			factor = 40
			modifier = {
				factor = 0.5
				NOT = { prestige = 0 }
			}
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.730.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_prestige = -5
		reduce_meritocracy_effect = yes
		kill_advisor = random
	}
}

# Production Research Flawed
country_event = {
	id = 733
	title = "EVTNAME733"
	desc = "EVTDESC733"
	picture = DEBATE_REPUBLICAN_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA733"
		ai_chance = {
			factor = 40
		}
		add_adm_power = -50
	}
	option = {
		name = "EVTOPTB733"
		ai_chance = {
			factor = 60
			modifier = {
				factor = 0.5
				NOT = { prestige = 0 }
			}
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.730.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_prestige = -5
		reduce_meritocracy_effect = yes
		kill_advisor = random
	}
}

# There should be a Stable Government
country_event = {
	id = 734
	title = "EVTNAME734"
	desc = "EVTDESC734"
	picture = LIBERUM_VETO_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA734" #Accept Demands
		ai_chance = {
			factor = 40
		}
		add_adm_power = -50
	}
	option = {
		name = "EVTOPTB734" #Ignore them
		ai_chance = {
			factor = 60
			modifier = {
				factor = 0.5
				NOT = { prestige = 0 }
			}
		}
		add_prestige = -10
	}
	option = {
		name = "personality_options.734.a" #Convince them in the need for our policies
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = lawgiver }
				ruler_has_personality_ancestor = { key = charismatic_negotiator }
				ruler_has_personality_ancestor = { key = silver_tongue }
			}
		}
		add_dip_power = -5
	}
	option = {
		name = "personality_options.734.b" #Buy them off
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality = embezzler_personality
				ruler_has_personality_ancestor = { key = fierce_negotiator }
			}
		}
		add_years_of_income = -0.1
	}
	option = {
		name = "personality_options.734.c" #Blackmail
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = intricate_web_weaver }
		}
		add_prestige = -5
	}
}

# A Generation of Cowards
country_event = {
	id = 735
	title = "EVTNAME735"
	desc = "EVTDESC735"
	picture = LAND_MILITARY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		is_at_war = no
		NOT = { war_exhaustion = 1 }
		NOT = { num_of_rebel_controlled_provinces = 1 }
		NOT = { has_country_modifier = bad_discipline }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA735"
		add_yearly_manpower = -1.5
		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = "EVTOPTB735"
		add_country_modifier = {
			name = "bad_discipline"
			duration = 3650
		}
		ai_chance = {
			factor = 2
		}
	}
	option = {
		name = "personality_options.735.a" #A life in the army will harden them quickly again!
		ai_chance = {
			factor = 100
		}
		highlight = yes
		trigger = { 
			OR = {
				ruler_has_personality_ancestor = { key = bold_fighter }
				ruler_has_personality_ancestor = { key = martial_educator }
				ruler_has_personality_ancestor = { key = strict }
			}
		}
		add_mil_power = -5
	}
}

# Death of a Merchant
country_event = {
	id = 736
	title = "EVTNAME736"
	desc = {
		trigger = {
			NOT = {
				any_owned_province = {
					is_core = root
					OR = {
						trade_goods = gems
						trade_goods = incense
						trade_goods = spices
						trade_goods = silk
						trade_goods = cloth
						trade_goods = ivory
						trade_goods = tropical_wood
						trade_goods = gold
						trade_goods = glass					
						trade_goods = paper					
						trade_goods = chinaware	
						trade_goods = slaves
						trade_goods = tobacco
						trade_goods = wine
						trade_goods = salt
						trade_goods = cotton
						trade_goods = tea
						trade_goods = dyes
						trade_goods = cocoa
						trade_goods = sugar
						trade_goods = coffee
					}
				}
			}
		}
		desc = "EVTDESC736"
	}
	desc = {
		trigger = {
			any_owned_province = {
				is_core = root
				OR = {
					trade_goods = gems
					trade_goods = incense
					trade_goods = spices
					trade_goods = silk
					trade_goods = cloth
					trade_goods = ivory
					trade_goods = tropical_wood
					trade_goods = gold
					trade_goods = glass					
					trade_goods = paper					
					trade_goods = chinaware
					trade_goods = slaves
					trade_goods = tobacco
					trade_goods = wine
					trade_goods = salt
					trade_goods = cotton
					trade_goods = tea
					trade_goods = dyes
					trade_goods = cocoa
					trade_goods = sugar
					trade_goods = coffee
				}
			}
		}
		desc = event.736.desc
	}
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		always = yes
	}

	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		check_if_non_state_advisor_effect = { #Hidden scripted effect, is used by scripted effect and must always be cleared in after = { } using erase_advisor_flags_effect.
			chance_of_primary = 75 #Not percentages!
			chance_of_tertiary = 10
			chance_of_secondary = 25
		}
		hidden_effect = {
			random_list = {
				33 = { set_country_flag = theologian_flag }
				33 = { set_country_flag = artist_flag }
				33 = { set_country_flag = philosopher_flag }
			}
			set_saved_name = {
				key = trader_name
				type = advisor
			}
			random_owned_province = {
				limit = {
					is_core = root
					OR = {
						trade_goods = gems
						trade_goods = incense
						trade_goods = spices
						trade_goods = silk
						trade_goods = cloth
						trade_goods = ivory
						trade_goods = tropical_wood
						trade_goods = gold
						trade_goods = glass					
						trade_goods = paper					
						trade_goods = chinaware
						trade_goods = slaves
						trade_goods = tobacco
						trade_goods = wine
						trade_goods = salt
						trade_goods = cotton
						trade_goods = tea
						trade_goods = dyes
						trade_goods = cocoa
						trade_goods = sugar
						trade_goods = coffee
					}
				}
				save_event_target_as = trade_province
			}
		}
	}

	option = {
		name = "EVTOPTA736"
		ai_chance = {
			factor = 50
		}
		add_years_of_income = 0.25
	}
	option = {
		name = "EVTOPTB736"
		ai_chance = {
			factor = 50
		}
		add_meritocracy_effect = yes
		trigger_switch = {
			on_trigger = has_country_flag
			theologian_flag = {
				generate_advisor_of_type_and_semi_random_religion_effect = {
					advisor_type=theologian
					advisor_type_if_not_state=natural_scientist
					scaled_skill=yes
					discount=yes
				}
			}
			artist_flag = {
				generate_advisor_of_type_and_semi_random_religion_effect = {
					advisor_type=artist
					advisor_type_if_not_state=artist
					scaled_skill=yes
					discount=yes
				}
			}
			philosopher_flag = {
				generate_advisor_of_type_and_semi_random_religion_effect = {
					advisor_type=philosopher
					advisor_type_if_not_state=philosopher
					scaled_skill=yes
					discount=yes
				}
			}
		}
		add_prestige = 15
	}
	option = {
		name = "personality_options.736.a" #I know just who should recieve our patronage.
		ai_chance = {
			factor = 100
		}
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = zealot }
				ruler_has_personality_ancestor = { key = tolerant }
			}
			hidden_trigger = {
				NOT = {
					has_country_flag = theologian_flag
				}
				monthly_income = 16
			}
		}
		add_prestige = 15
		add_meritocracy_effect = yes
		generate_advisor_of_type_and_semi_random_religion_effect = {
			advisor_type=theologian
			advisor_type_if_not_state=natural_scientist
			scaled_skill = yes
			discount=yes
		}
	}
	option = {
		name = "personality_options.736.b" #I know just who should recieve our patronage.
		ai_chance = {
			factor = 100
		}
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = free_thinker }
				ruler_has_personality = well_advised_personality
			}
			hidden_trigger = {
				NOT = {
					has_country_flag = philosopher_flag
				}
				monthly_income = 16
			}
		}
		add_prestige = 15
		add_meritocracy_effect = yes
		generate_advisor_of_type_and_semi_random_religion_effect = {
			advisor_type=philosopher
			advisor_type_if_not_state=philosopher
			scaled_skill = yes
			discount=yes
		}
	}
	after = {
		clear_saved_name = trader_name
		erase_advisor_flags_effect = yes
		trigger_switch = {
			on_trigger = has_country_flag
			theologian_flag = { clr_country_flag = theologian_flag }
			artist_flag = { clr_country_flag = artist_flag }
			philosopher_flag = { clr_country_flag = philosopher_flag }
		}
	}
}

# Local fortification expert discovered
country_event = {
	id = 737
	title = "EVTNAME737"
	desc = "EVTDESC737"
	picture = FORT_eventPicture
	goto = local_fortification_expert_province

	is_triggered_only = yes
	
	trigger = {
		num_of_cities = 2
		any_owned_province = {
			is_overseas = no
			is_capital = no
			fort_level = 1
			NOT = { has_province_modifier = "local_fortress" }
		}
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_overseas = no
					is_capital = no
					fort_level = 1
					NOT = { has_province_modifier = "local_fortress" }
				}
				save_event_target_as = local_fortification_expert_province
				root = {
					set_saved_name = {
						key = local_fortification_expert
						type = advisor
						scope = prev
					}
				}
			}
		}
	}

	after = {
		clear_saved_name = local_fortification_expert
	}
	
	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA737"
		ai_chance = {
			factor = 35
			modifier = {
				factor = 0.5
				advisor = fortification_expert
			}
		}
		add_meritocracy_effect = yes
		define_advisor = {
			type = fortification_expert
			name = local_fortification_expert
			skill = 2
			culture = event_target:local_fortification_expert_province
			religion = event_target:local_fortification_expert_province
			discount = yes
		}
	}
	option = {
		name = "EVTOPTB737"
		ai_chance = {
			factor = 65
		}
		event_target:local_fortification_expert_province = {
			add_province_modifier = {
				name = "local_fortress"
				duration = -1
			}
		}
	}
	option = {
		name = "personality_options.737.b"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = well_connected } }
		ai_chance = {
			factor = 100
		}
		add_meritocracy_effect = yes
		define_advisor = {
			type = fortification_expert
			name = local_fortification_expert
			culture = event_target:local_fortification_expert_province
			religion = event_target:local_fortification_expert_province
			discount = yes
			skill = 3
		}
	}
}

# Naive Relative
country_event = {
	id = 738
	title = "EVTNAME738"
	desc = "EVTDESC738"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		has_regency = no
		government = monarchy
		NOT = { has_country_modifier = compromised_spy_defence }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA738"
		add_prestige = -10
	}
	option = {
		name = "EVTOPTB738"
		add_country_modifier = {
			name = "compromised_spy_defence"
			duration = 7300
		}
	}
	option = {
		name = "personality_options.738.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = secretive } }
		add_prestige = -5
	}
}

# Saint Proclaimed
country_event = {
	id = 739
	title = "EVTNAME739"
	desc = "EVTDESC739"
	picture = POPE_PREACHING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		NOT = {
			stability = 3
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA739"
		add_stability_or_adm_power = yes
	}
}

# Smugglers running rampant
country_event = {
	id = 740
	title = "EVTNAME740"
	desc = "EVTDESC740"
	picture = SHIP_SAILING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 0
		NOT = { has_country_modifier = smugglers_dominating }
		NOT = { has_country_modifier = cooperation_with_merchant_class }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA740"
		ai_chance = {
			factor = 35
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.5 }
			}
		}
		add_years_of_income = -0.35
	}
	option = {
		name = "EVTOPTB740"
		ai_chance = {
			factor = 65
		}
		add_country_modifier = {
			name = "smugglers_dominating"
			duration = 3650
		}
	}
	option = {
		name = "personality_options.740.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = entrepreneur } }
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.5 }
			}
		}
		add_years_of_income = -0.2
	}
	option = {
		name = "personality_options.740.b"
		highlight = yes
		trigger = {
			ruler_has_personality = embezzler_personality
		}
		ai_chance = {
			factor = 100
		}
		add_country_modifier = {
			name = "smugglers_dominating"
			duration = 1825
		}
	}
}

# Printing Press gives Benefits
country_event = {
	id = 741
	title = "EVTNAME741"
	desc = "EVTDESC741"
	picture = INVENTION_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_institution = printing_press
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA741"
		add_mil_power = 20
		add_dip_power = 20
		add_adm_power = 20
	}
	option = {
		name = "personality_options.741.a"
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality_ancestor = { key = scholar }
				ruler_has_personality_ancestor = { key = free_thinker }
			}
		}
		ai_chance = {
			factor = 100
		}
		add_mil_power = 30
		add_dip_power = 30
		add_adm_power = 30
	}
}

# Extraordinary Recruiting Policies
country_event = {
	id = 742
	title = "EVTNAME742"
	desc = "EVTDESC742"
	picture = MILITARY_CAMP_eventPicture

	is_triggered_only = yes
	
	trigger = {
		mil = 4
		is_monarch_leader = yes
		NOT = { manpower_percentage = 0.6 }
		is_at_war = yes
		NOT = { war_exhaustion = 10 }
		stability = -1
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA742"
		ai_chance = {
			factor = 8
			modifier = {
				factor = 0.1
				war_exhaustion = 5
			}
		}
		add_yearly_manpower = 1.5
		add_war_exhaustion = 1
	}
	option = {
		name = "EVTOPTB742"
		ai_chance = {
			factor = 2
		}
		add_yearly_manpower = 0.5
	}
	option = {
		name = "personality_options.742.a"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = strict }
		}
		ai_chance = {
			factor = 100
		}
		add_army_tradition = 10
	}
	option = {
		name = "personality_options.742.b"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = inspiring_leader }
		}
		ai_chance = {
			factor = 100
		}
		add_yearly_manpower = 1.2
	}
}

# Legitimacy gain or Prestige gain
country_event = {
	id = 850
	title = "EVTNAME850"
	desc = "EVTDESC850"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		capital_scope = { continent = europe }
		government = monarchy
		has_regency = no
		has_government_attribute = heir
		is_lesser_in_union = no
		NOT = { legitimacy = 90 }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA850"
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				legitimacy = 90
			}
			modifier = {
				factor = 1.5
				NOT = { legitimacy = 70 }
			}
		}
		add_legitimacy = 5
	}	
	option = {
		name = "EVTOPTB850"
		ai_chance = {
			factor = 45
			modifier = {
				factor = 1.5
				NOT = { prestige = 0 }
			}
			modifier = {
				factor = 0.5
				NOT = { prestige = 91 }
			}
		}
		add_prestige = 10
	}
	option = {
		name = "personality_options.850.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = well_connected } }
		ai_chance = {
			factor = 100
		}
		add_prestige = 10
		add_legitimacy = 5
	}
}

# Legitimacy loss or Prestige loss
country_event = {
	id = 851
	title = "EVTNAME851"
	desc = "EVTDESC851"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		government = monarchy
		NOT = { has_reform = celestial_empire }
		legitimacy_or_horde_unity = 20
		has_regency = no
		is_lesser_in_union = no
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA851"
		ai_chance = {
			factor = 45
			modifier = {
				factor = 0.5
				NOT = { legitimacy_or_horde_unity = 80 }
			}
		}
		add_legitimacy = -5
		add_horde_unity = -5
	}
	option = {
		name = "EVTOPTB851"
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { prestige = 0 }
			}
		}
		add_prestige = -5
	}
	option = {
		name = "personality_options.851.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = righteous } }
		custom_tooltip = personality_options.851.a.tt
		ai_chance = {
			factor = 100
		}
	}
}

# Treasury vs Prestige gain for Republic
country_event = {
	id = 852
	title = "EVTNAME852"
	desc = "EVTDESC852"
	picture = DEBATE_REPUBLICAN_eventPicture

	is_triggered_only = yes
	
	trigger = {
		government = republic
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA852"
		ai_chance = {
			factor = 65
			modifier = {
				factor = 1.5
				NOT = { years_of_income = 0.1 }
			}
		}
		add_years_of_income = 0.10
	}
	option = {
		name = "EVTOPTB852"
		ai_chance = {
			factor = 35
			modifier = {
				factor = 1.5
				NOT = { prestige = 0 }
			}
		}
		add_prestige = 10
	}
	option = {
		name = "personality_options.852.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = midas_touched } }
		ai_chance = {
			factor = 100
		}
		add_years_of_income = 0.15
	}
	option = {
		name = "personality_options.852.b"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = righteous } }
		ai_chance = {
			factor = 100
		}
		add_republican_tradition = 5
	}
}

# Inflation loss if ADM 8
country_event = {
	id = 853
	title = "EVTNAME853"
	desc = "EVTDESC853"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		adm = 5
		inflation = 3
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA853"
		add_inflation = -1
	}	
	option = {
		name = "personality_options.853.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = midas_touched } }
		add_inflation = -2
	}	
}

# Prestige (formerly cultural tradition) gain
country_event = {
	id = 854
	title = "EVTNAME854"
	desc = "EVTDESC854"
	picture = IMPORTANT_STATUE_eventPicture

	is_triggered_only = yes
	
	trigger = {
		stability = 1
		prestige = 50
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		check_if_non_state_advisor_effect = { #Hidden, must be followed by erase_advisor_flags_effect
			chance_of_primary = 75 #Not percentages!
			chance_of_tertiary = 10
			chance_of_secondary = 25
		}
	}
	
	option = {
		name = "EVTOPTA854"
		add_meritocracy_effect = yes
		generate_advisor_of_type_and_semi_random_religion_effect = {
			advisor_type=artist
			advisor_type_if_not_state=artist
			skill = 2
			discount=yes
		}
	}
	option = {
		name = "personality_options.854.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = well_connected } }
		add_prestige = 10
		add_meritocracy_effect = yes
		generate_advisor_of_type_and_semi_random_religion_effect = {
			advisor_type=artist
			advisor_type_if_not_state=artist
			skill = 3
			discount=yes
		}
	}
	after = {
		erase_advisor_flags_effect = yes
	}
}

# Tech cost increase
country_event = {
	id = 855
	title = "EVTNAME855"
	desc = "EVTDESC855"
	picture = IMPORTANT_STATUE_eventPicture

	is_triggered_only = yes
	
	trigger = {
		is_at_war = yes
		NOT = {
			has_country_modifier = warriors_do_not_read_books
		}
		NOT = { has_country_flag = warriors_can_read_books }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA855"
		if = { 
			limit = { 
				NOT = { has_country_flag = warriors_can_read_some_books_flag }
			}
			add_country_modifier = {
				name = "warriors_do_not_read_books"
				duration = 1825
			}
		}
		else = {
			add_country_modifier = {
				name = "warriors_do_not_read_books"
				duration = 912
			}
		}
	}
	option = {
		name = "personality_options.855.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = strict } }
		add_prestige = -5
	}
}

# Dip rep loss
country_event = {
	id = 857
	title = "EVTNAME857"
	desc = "EVTDESC857"
	picture = DIPLOMACY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		is_at_war = no
		dip = 4
		overextension_percentage = 0.25
		has_regency = no
		NOT = { has_country_modifier = competent_diplomacy }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA857"
		add_country_modifier = {
			name = "competent_diplomacy"
			duration = 1825
		}	
	}
	option = {
		name = "personality_options.857.a"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = silver_tongue }
		}
		add_country_modifier = {
			name = "competent_diplomacy"
			duration = 3650
		}
	}
}

# Dip rep gain
country_event = {
	id = 858
	title = "EVTNAME858"
	desc = "EVTDESC858"
	picture = DIPLOMACY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		OR = {
			NOT = { dip = 4 }
			ruler_has_personality = babbling_buffoon_personality
			ruler_has_personality = naive_personality
		}
		overextension_percentage = 0.25
		has_regency = no
		NOT = { has_country_modifier = incompetent_diplomacy }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA858"
		add_country_modifier = {
			name = "incompetent_diplomacy"
			duration = 1825
		}
	}	
}

# War Exhaustion gain or Army/Navy Tradition loss
country_event = {
	id = 859
	title = "EVTNAME859"
	desc = "EVTDESC859"
	picture = ANGRY_MOB_eventPicture

	is_triggered_only = yes
	
	trigger = {
		is_at_war = yes
		war_exhaustion = 2
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA859"
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0.5
				war_exhaustion = 5
			}
		}
		add_war_exhaustion = 2
	}
	option = {
		name = "EVTOPTB859"
		ai_chance = {
			factor = 5
		}
		add_army_tradition = -5
		add_navy_tradition = -5
	}
	option = {
		name = "personality_options.859.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = strict } }
		ai_chance = {
			factor = 100
		}
		add_war_exhaustion = 1
	}
}

# War Exhaustion loss or Army/Navy Tradition gain
country_event = {
	id = 860
	title = "EVTNAME860"
	desc = "EVTDESC860"
	picture = MILITARY_CAMP_eventPicture

	is_triggered_only = yes
	
	trigger = {
		is_at_war = yes
		war_exhaustion = 5
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA860"
		ai_chance = {
			factor = 65
			modifier = {
				factor = 1.5
				war_exhaustion = 10
			}
		}
		add_war_exhaustion = -2
	}
	option = {
		name = "EVTOPTB860"
		ai_chance = {
			factor = 35
		}
		add_army_tradition = 5
		add_navy_tradition = 5
	}
	option = {
		name = "personality_options.860.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = inspiring_leader } }
		ai_chance = {
			factor = 100
		}
		add_war_exhaustion = -1
		add_army_tradition = 5
		add_navy_tradition = 5
	}
}

# Gain spy power or prestige
country_event = {
	id = 861
	title = "EVTNAME861"
	desc = "EVTDESC861"
	picture = SPY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		NOT = { has_country_modifier = shady_people }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA861"
		add_country_modifier = {
			name = shady_people
			duration = 1825
		}
	}
	option = {
		name = "EVTOPTB861"
		add_prestige = 5
	}
	option = {
		name = "personality_options.861.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = intricate_web_weaver } }
		ai_chance = {
			factor = 100
		}
		add_country_modifier = {
			name = shady_people
			duration = 3650
		}
	}
}

# Colonists boost or Conquistador
country_event = {
	id = 862
	title = "EVTNAME862"
	desc = "EVTDESC862"
	picture = COLONIZATION_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_idea = quest_for_the_new_world
		capital_scope = { continent = europe }
		any_owned_province = {
			is_colony = yes
			OR = {
				continent = north_america
				continent = south_america
				continent = new_world
			}
		}
		NOT = { has_country_modifier = colonial_enthusiasm }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA862"
		add_country_modifier = {
			name = "colonial_enthusiasm"
			duration = 1825
		}
	}
	option = {
		name = "EVTOPTB862"
		create_conquistador = {
			tradition = 25
		}
	}
	option = {
		name = "personality_options.862.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = expansionist } }
		ai_chance = {
			factor = 100
		}
		create_conquistador = {
			tradition = 25
		}
		add_country_modifier = {
			name = "colonial_enthusiasm"
			duration = 1825
		}
	}
}

# Loss of merchants 
country_event = {
	id = 863
	title = "EVTNAME863"
	desc = "EVTDESC863"
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		num_of_merchants = 2
		capital_scope = { continent = europe }
		any_active_trade_node = {
			continent = asia
			has_merchant = PREV
			NOT = { 
				has_trade_modifier = {
					who = ROOT
					name = merchant_recalled
				}
			}			
		}
		any_active_trade_node = {
			continent = europe
			has_merchant = PREV
			NOT = { 
				has_trade_modifier = {
					who = ROOT
					name = merchant_recalled
				}
			}			
		}
	}

	immediate = {
		hidden_effect = {
			random_active_trade_node = {
				limit = {
					continent = asia
					has_merchant = PREV
					NOT = { 
						has_trade_modifier = {
							who = ROOT
							name = merchant_recalled
						}
					}
				}
				save_event_target_as = asia_node
			}
			random_active_trade_node = {
				limit = {
					continent = europe
					has_merchant = PREV
					NOT = { 
						has_trade_modifier = {
							who = ROOT
							name = merchant_recalled
						}
					}
				}
				save_event_target_as = europe_node
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA863"
		goto = asia_node
		ai_chance = {
			factor = 33
		}
		trigger = {
			any_active_trade_node = {
				continent = asia
				has_merchant = PREV
				NOT = { 
					has_trade_modifier = {
						who = ROOT
						name = merchant_recalled
					}
				}								
			}
		}
		random_active_trade_node = {
			limit = {
				continent = asia
				has_merchant = PREV
				NOT = { 
					has_trade_modifier = {
						who = ROOT
						name = merchant_recalled
					}
				}				
			}
			add_trade_modifier = {
				who = root
				duration = 3650
				power = -10
				key = merchant_recalled
			}	
		}
	}
	option = {
		name = "EVTOPTB863"
		goto = europe_node
		ai_chance = {
			factor = 33
		}
		trigger = {
			any_active_trade_node = {
				continent = europe
				has_merchant = PREV
				NOT = { 
					has_trade_modifier = {
						who = ROOT
						name = merchant_recalled
					}
				}				
			}
		}		
		random_active_trade_node = {
			limit = {
				continent = europe
				has_merchant = PREV
				NOT = { 
					has_trade_modifier = {
						who = ROOT
						name = merchant_recalled
					}
				}			
			}
			add_trade_modifier = {
				who = root
				duration = 3650
				power = -10
				key = merchant_recalled
			}	
		}
	}
	option = {
		name = "EVTOPTC863"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 1.5
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		add_dip_power = -20
		add_estate_burghers_loyalty_effect = yes
	}
}

# Relation boost with a random neighbour country
country_event = {
	id = 864
	title = "EVTNAME864"
	desc = "EVTDESC864"
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		any_neighbor_country = {
			religion = ROOT
			NOT = { war_with = ROOT }
			NOT = { truce_with = ROOT }
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_neighbor_country = {
				limit = {
					religion = ROOT
					NOT = { war_with = ROOT }
					NOT = { truce_with = ROOT }
				}
				save_event_target_as = neighbour_country
			}
		}
	}
	
	option = {
		name = "EVTOPTA864"
		event_target:neighbour_country = {
			add_opinion = { who = ROOT modifier = opinion_improved_relations }
		}		
	}
	
	option = {
		name = "personality_options.864.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = charismatic_negotiator } }
		event_target:neighbour_country = {
			add_opinion = { who = ROOT modifier = opinion_improved_relations }
		}
		random_neighbor_country = {
			limit = {
				NOT = { war_with = ROOT }
			}
			add_opinion = { who = ROOT modifier = opinion_improved_relations }
		}
		random_known_country = {
			limit = {
				NOT = { war_with = ROOT }
			}
			add_opinion = { who = ROOT modifier = opinion_improved_relations }
		}
	}
}

# Gain papal influence OR prestige
country_event = {
	id = 865
	title = "EVTNAME865"
	desc = "EVTDESC865"
	picture = POPE_PREACHING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		NOT = { tag = PAP }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA865"
		add_papal_influence = 10
	}
	option = {
		name = "EVTOPTB865"
		add_prestige = 5
	}
	option = {
		name = "personality_options.865.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = pious } }
		ai_chance = {
			factor = 100
		}
		add_papal_influence = 15
	}
}

# Add land tech (big for inflation)
country_event = {
	id = 866
	title = "EVTNAME866"
	desc = "EVTDESC866"
	picture = LAND_MILITARY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		mil_tech = 6
		NOT = { mil_tech = 15 }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA866"
		ai_chance = {
			factor = 7
			modifier = {
				factor = 0.5
				inflation = 15
			}
		}
		add_inflation = 0.5
		add_mil_power = 50
	}
	option = {
		name = "EVTOPTB866"
		ai_chance = {
			factor = 3
		}
		add_mil_power = 10
	}
	option = {
		name = "personality_options.866.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_inflation = 0.75
		add_mil_power = 75
	}
}

# Add naval tech (big for inflation)
country_event = {
	id = 867
	title = "EVTNAME867"
	desc = "EVTDESC867"
	picture = NAVAL_MILITARY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		num_of_ports = 1
		primitives = no
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA867"
		ai_chance = {
			factor = 7
			modifier = {
				factor = 0.5
				inflation = 15
			}
		}
		add_inflation = 0.5
		add_dip_power = 50
	}
	option = {
		name = "EVTOPTB867"
		ai_chance = {
			factor = 3
		}
		add_dip_power = 10
	}
	option = {
		name = "personality_options.867.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_inflation = 0.75
		add_dip_power = 75
	}
}

# Add trade tech (big for inflation)
country_event = {
	id = 868
	title = "EVTNAME868"
	desc = "EVTDESC868"
	picture = MERCHANTS_TALKING_eventPicture

	is_triggered_only = yes
	
	trigger = {
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA868"
		ai_chance = {
			factor = 7
			modifier = {
				factor = 0.5
				inflation = 15
			}
		}
		add_inflation = 0.5
		add_dip_power = 50
	}
	option = {
		name = "EVTOPTB868"
		ai_chance = {
			factor = 3
		}
		add_dip_power = 10
	}
	option = {
		name = "personality_options.867.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_inflation = 0.75
		add_dip_power = 75
	}
}

# Add gov tech (big for inflation)
country_event = {
	id = 869
	title = "EVTNAME869"
	desc = "EVTDESC869"
	picture = LIBERUM_VETO_eventPicture

	is_triggered_only = yes
	
	trigger = {
		NOT = { adm = 950 }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA869"
		ai_chance = {
			factor = 7
			modifier = {
				factor = 0.5
				inflation = 15
			}
		}
		add_inflation = 0.5
		add_adm_power = 50
	}
	option = {
		name = "EVTOPTB869"
		ai_chance = {
			factor = 3
		}
		add_adm_power = 10
	}
	option = {
		name = "personality_options.867.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_inflation = 0.75
		add_adm_power = 75
	}
}

# Add prod tech (big for inflation)
country_event = {
	id = 870
	title = "EVTNAME870"
	desc = "EVTDESC870"
	picture = CITY_DEVELOPMENT_eventPicture

	is_triggered_only = yes
	
	trigger = {	
		NOT = { dip = 950 }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA870"
		ai_chance = {
			factor = 7
			modifier = {
				factor = 0.5
				inflation = 15
			}
		}
		add_inflation = 0.5
		add_adm_power = 50
	}
	option = {
		name = "EVTOPTB870"
		ai_chance = {
			factor = 3
		}
		add_adm_power = 10
	}
	option = {
		name = "personality_options.867.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = scholar } }
		ai_chance = {
			factor = 100
		}
		add_inflation = 0.75
		add_adm_power = 75
	}
}

#Sale of Titles
country_event = {
	id = 871
	title = "EVTNAME871"
	desc = "EVTDESC871"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_estate = estate_nobles
		crown_land_share = 5
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA871"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				NOT = { years_of_income = 0.3 }
			}
			modifier = {
				factor = 0.5
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
			modifier = {
				factor = 0.25
				NOT = {
					crown_land_share = 20
				}
			}
			modifier = {
				factor = 0
				NOT = {
					crown_land_share = 10
				}
			}
		}
		add_years_of_income = 0.5
		if = {
			limit = {
				has_estate = estate_burghers
			}
			change_estate_land_share = {
				estate = estate_burghers
				share = 5
			}
		}
		else = {
			change_estate_land_share = {
				estate = all
				share = 5
			}
		}
		reduce_estate_nobles_loyalty_effect = yes
		add_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB871"
		ai_chance = {
			factor = 5
			modifier = {
				factor = 1.5
				NOT = { stability = 1 }
			}
			modifier = {
				factor = 0.5
				stability = 3
			}
			modifier = {
				factor = 0.5
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		add_stability_or_adm_power = yes
		add_estate_nobles_loyalty_effect = yes
		reduce_estate_burghers_loyalty_effect = yes
	}
}

# A traveling minstrel
country_event = {
	id = 872
	title = "EVTNAME872"
	desc = "EVTDESC872"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes
	
	trigger = {
		always = yes
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		check_if_non_state_advisor_effect = { #Hidden, must be followed by erase_advisor_flags_effect
			chance_of_primary = 75 #Not percentages!
			chance_of_tertiary = 5
			chance_of_secondary = 25
		}
	}
	
	option = {
		name = "EVTOPTA872"
		add_stability_or_adm_power = yes
	}
	option = {
		name = "EVTOPTB872"
		add_prestige = 10
		add_meritocracy_effect = yes
		generate_advisor_of_type_and_semi_random_religion_effect = {
			advisor_type=artist
			advisor_type_if_not_state=artist
			skill = 2
			discount=no
		}
	}
	option = {
		name = "personality_options.872.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = well_connected } }
		add_prestige = 10
		add_meritocracy_effect = yes
		generate_advisor_of_type_and_semi_random_religion_effect = {
			advisor_type=artist
			advisor_type_if_not_state=artist
			skill = 3
			discount=yes
		}
	}
	after = { erase_advisor_flags_effect = yes }
}

# A bountiful harvest
country_event = {
	id = 873
	title = "EVTNAME873"
	desc = "EVTDESC873"
	picture = FEAST_eventPicture

	is_triggered_only = yes
	
	trigger = {
		is_month = 7
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA873"
		add_years_of_income = 0.25
	}
}

# Tensions between nobles and clergy
country_event = {
	id = 874
	title = "EVTNAME874"
	desc = "EVTDESC874"
	picture = RELIGION_eventPicture
	goto = rebel_province
	
	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		government = monarchy
		exists = PAP
		capital_scope = {
			continent = europe
		}
		has_estate = estate_nobles
		has_estate = estate_church
		any_owned_province = {
			continent = europe
			culture_group = root
			is_state_core = root
			is_capital = no
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					continent = europe
					culture_group = root
					is_state_core = root
					is_capital = no
				}
				save_event_target_as = rebel_province
			}
		}
	}
	
	option = {
		name = "EVTOPTA874"
		ai_chance = { 
			factor = 20
			modifier = {
				factor = 2
				NOT = { num_of_cities = 5 }
			}				
			modifier = {
				factor = 2
				NOT = { num_of_cities = 10 }
			}
			modifier = {
				factor = 2
				NOT = { num_of_cities = 15 }
			}				
			modifier = {
				factor = 2
				NOT = { num_of_cities = 20 }
			}
			modifier = {
				factor = 0.25
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		reverse_add_opinion = { who = PAP modifier = opinion_upset_pope }
		reduce_estate_church_loyalty_effect = yes
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB874"
		ai_chance = {
			factor = 80
			modifier = {
				factor = 0.25
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		event_target:rebel_province = {
			spawn_large_scaled_rebels = {
				type = noble_rebels
				no_defined_leader = yes
			}
		}
		reduce_estate_nobles_loyalty_effect = yes
		add_estate_church_loyalty_effect = yes
	}
}

# The Maid of $PROVINCE
country_event = {
	id = 875
	title = "EVTNAME875"
	desc = "EVTDESC875"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		NOT = {
			has_country_flag = maid_of_province
		}
		is_at_war = yes
		war_exhaustion = 5
		government = monarchy
		NOT = { has_reform = celestial_empire }
		is_lesser_in_union = no
		NOT = { legitimacy_or_horde_unity = 80 }
		any_owned_province = {
			NOT = { controlled_by = owner }
		}
		NOT = { has_country_modifier = narrowminded_modifier }
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		hidden_effect = {
			set_country_flag = maid_of_province
		}
	}
	
	option = {
		name = "EVTOPTA875"
		ai_chance = { factor = 100 }
		if = {
			limit = { is_lesser_in_union = no }
			add_legitimacy = -5
			add_horde_unity = -5
		}
		add_prestige = -5
		create_general = { tradition = 50 female = yes }
	}
	option = {
		name = "EVTOPTB875"
		ai_chance = { factor = 0 }
		trigger = { is_lesser_in_union = no }
		add_legitimacy = 10
		add_horde_unity = 10
	}
	option = {
		name = "EVTOPTC875"
		ai_chance = { factor = 0 }
		add_country_modifier = {
			name = narrowminded_modifier
			duration = 3650
		}
		add_stability_or_adm_power = yes
	}
}

# Bible printed!
country_event = {
	id = 876
	title = "EVTNAME876"
	desc = "EVTDESC876"
	picture = POPE_PREACHING_eventPicture
	goto = printing_bible_province

	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		is_institution_enabled = printing_press
		NOT = { has_global_flag = bible_printed }
		advisor = theologian
		any_owned_province = {
			OR = {
				religion = catholic
				religion = reformed
				religion = protestant
				religion = anglican
				religion = hussite
			}
			continent = europe
			printing_press = 1
			NOT = { printing_press = 50 }
		}
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					OR = {
						religion = catholic
						religion = reformed
						religion = protestant
						religion = anglican
						religion = hussite
					}
					continent = europe
					printing_press = 1
					NOT = { printing_press = 50 }
				}
				save_event_target_as = printing_bible_province
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA876"
		set_global_flag = bible_printed
		add_prestige = 25
		event_target:printing_bible_province = {
			add_institution_embracement = {
				value = 50
				which = printing_press
			}
		}
	}
}

# Sweating Sickness
country_event = {
	id = 877
	title = "EVTNAME877"
	desc = "EVTDESC877"
	picture = PLAGUE_eventPicture

	is_triggered_only = yes

	goto = capital
	
	trigger = {
		is_year = 1480
		capital_scope = {
			continent = europe
		}
		NOT = { adm_tech = 20 }
		NOT = { has_country_flag = has_competent_doctors }
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			capital_scope = { save_event_target_as = capital }
		}
	}
	
	option = {
		name = "EVTOPTA877"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTB877"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.6 }
			}
		}
		add_years_of_income = -0.50
	}	
	option = {
		name = "EVTOPTC877"
		ai_chance = {
			factor = 33
		}
		add_dip_power = -100
	}	
}

# Disagreeing Advisor
country_event = {
	id = 878
	title = "EVTNAME878"
	desc = "EVTDESC878"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_advisor = yes
		has_regency = no
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		hidden_effect = {
			random_list = {
				1 = {
					trigger = {
						employed_advisor = {
							category = ADM
						}
					}
					set_country_flag = advisor_events_adm
				}
				1 = {
					trigger = {
						employed_advisor = {
							category = DIP
						}
					}
					set_country_flag = advisor_events_dip
				}
				1 = {
					trigger = {
						employed_advisor = {
							category = MIL
						}
					}
					set_country_flag = advisor_events_mil
				}
			}
		}
	}
	after = {
		hidden_effect = {
			trigger_switch = {
				on_trigger = has_country_flag
				advisor_events_adm = { clr_country_flag = advisor_events_adm }
				advisor_events_dip = { clr_country_flag = advisor_events_dip }
				advisor_events_mil = { clr_country_flag = advisor_events_mil }
			}
		}
	}

	option = {
		name = "EVTOPTA878"
		add_prestige = -10
		trigger_switch = {
			on_trigger = has_country_flag
			advisor_events_adm = { add_adm_power = 25 }
			advisor_events_dip = { add_dip_power = 25 }
			advisor_events_mil = { add_mil_power = 25 }
		}
	}
	option = {
		name = "EVTOPTB878"
		reduce_meritocracy_effect = yes
		trigger_switch = {
			on_trigger = has_country_flag
			advisor_events_adm = { kill_advisor_by_category_effect = { ADM = yes } }
			advisor_events_dip = { kill_advisor_by_category_effect = { DIP = yes } }
			advisor_events_mil = { kill_advisor_by_category_effect = { MIL = yes } }
		}
	}
}

# Privateers bring profits
country_event = {
	id = 879
	title = "EVTNAME879"
	desc = "EVTDESC879"
	picture = NAVAL_MILITARY_eventPicture
	goto = gold_port

	is_triggered_only = yes
	
	trigger = {
		has_country_modifier = hire_privateers
		num_of_ports = 3
		any_rival_country = {
			any_owned_province = {
				is_in_capital_area = yes
				has_port = yes
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 1
				trade_goods = gold
				OR = {
					is_overseas = yes
					owner = {
						is_colonial_nation = yes
					}
				}
			}
		}
		NOT = {
			gold = 1
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_rival_country = {
				limit = {
					any_owned_province = {
						is_in_capital_area = yes
						has_port = yes
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 1
						trade_goods = gold
						OR = {
							is_overseas = yes
							owner = {
								is_colonial_nation = yes
							}
						}
					}
				}
				save_event_target_as = gold_country
				if = {
					limit = {
						capital_scope = {
							has_port = yes
						}
					}
					save_event_target_as = gold_port
				}
				else = {
					random_owned_province = {
						limit = {
							is_in_capital_area = yes
							has_port = yes
							NOT = {
								any_province = {
									owned_by = prev
									higher_development_than = prev
									is_in_capital_area = yes
									has_port = yes
								}
							}
						}
						save_event_target_as = gold_port
					}
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA879"
		add_years_of_income = 0.10
		event_target:gold_country = {
			add_opinion = { who = ROOT modifier = opinion_gold_privateers }
		}
	}
}

# Privateers captured
country_event = {
	id = 880
	title = "EVTNAME880"
	desc = "EVTDESC880"
	picture = ADVISOR_eventPicture

	is_triggered_only = yes
	
	trigger = {
		num_of_ports = 5
		num_of_heavy_ship = 1
		colony = 1
		any_rival_country = {
			has_country_modifier = hire_privateers
		}
	}
	
	immediate = {
		hidden_effect = {
			random_rival_country = {
				limit = { has_country_modifier = hire_privateers }
				save_event_target_as = rival_country
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA880"
		ai_chance = {
			factor = 5
		}
		create_admiral = {
			tradition = 50
		}
	}
	option = {
		name = "EVTOPTB880"
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0.5
				num_of_cities = 20
			}
		}
		add_meritocracy_effect = yes
		define_advisor = { 
			type = naval_reformer
			skill = 2
		}
	}
}

# Merchant Expedition
country_event = {
	id = 881
	title = "EVTNAME881"
	desc = "EVTDESC881"
	picture = EXPLORERS_eventPicture
	goto = explorer_port

	is_triggered_only = yes
	
	trigger = {
		has_idea = quest_for_the_new_world
		num_of_ports = 1
		num_of_merchants = 2
		any_active_trade_node = {
			is_sea = yes
		}
		capital_scope = { continent = europe }
		carribeans_region = {
			NOT = { has_discovered = ROOT }
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = { has_port = yes }
				save_event_target_as = explorer_port
			}
		}
	}
	
	option = {
		name = "EVTOPTA881"
		event_target:explorer_port = {
			heavy_ship = ROOT
		}
		create_explorer = {
			tradition = 20
		}
	}
	option = {
		name = "personality_options.881.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = navigator } }
		event_target:explorer_port = {
			heavy_ship = ROOT
		}
		create_explorer = {
			tradition = 50
		}
	}
}

#Renaissance Prince
country_event = {
	id = 883
	title = "EVTNAME883"
	desc = "EVTDESC883"
	picture = COURT_eventPicture
	goto = renaissance_province

	is_triggered_only = yes
	
	trigger = {
		religion_group = christian
		capital_scope = {
			continent = europe
		}
		is_institution_enabled = renaissance
		NOT = { has_institution = renaissance }
		any_owned_province = {
			renaissance = 1
			NOT = { renaissance = 100 }
			continent = europe
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					renaissance = 1
					NOT = { renaissance = 100 }
					continent = europe
				}
				save_event_target_as = renaissance_province
			}
		}
	}

	option = {
		name = "EVTOPTA883"
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.2 }
			}
		}
		add_years_of_income = -0.10
		add_prestige = 10
		event_target:renaissance_province = {
			add_institution_embracement = {
				which = renaissance
				value = 25
			}
		}
	}
	option = {
		name = "EVTOPTB883"
		ai_chance = {
			factor = 5
		}
		add_prestige = -5
	}
	option = {
		name = "personality_options.883.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = free_thinker } }
		ai_chance = {
			factor = 100
		}
		add_years_of_income = -0.10
		add_prestige = 10
		event_target:renaissance_province = {
			add_institution_embracement = {
				which = renaissance
				value = 50
			}
		}
	}
}

# Expanding influence
country_event = {
	id = 882
	title = "EVTNAME882"
	desc = "EVTDESC882"
	picture = SHIP_SAILING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		OR = {
			has_country_modifier = dutch_india_trade_co 
			has_country_flag = trade_company 
		}
		OR = {
			bengal_region = {
				owned_by = ROOT
			}
			coromandel_region = {
				owned_by = ROOT
			}
			west_india_region = {
				owned_by = ROOT
			}
		}
		OR = {
			bengal_region = {
				NOT = {
					is_core = ROOT
					owned_by = ROOT
					owner = {
						has_country_modifier = dutch_india_trade_co 
						has_country_flag = trade_company 
					} 
				}
				any_neighbor_province = {
					owned_by = ROOT
					is_core = ROOT
				}
			}
			coromandel_region = {
				NOT = {
					is_core = ROOT
					owned_by = ROOT
					owner = {
						has_country_modifier = dutch_india_trade_co 
						has_country_flag = trade_company 
					} 
				}
				any_neighbor_province = {
					owned_by = ROOT
					is_core = ROOT
				}
			}
			west_india_region = {
				NOT = {
					is_core = ROOT
					owned_by = ROOT
					owner = {
						has_country_modifier = dutch_india_trade_co 
						has_country_flag = trade_company 
					} 
				}
				any_neighbor_province = {
					owned_by = ROOT
					is_core = ROOT
				}
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA882"
		add_dip_power = -20
	}
	option = {
		name = "EVTOPTB882"
		random_province = {
			limit = {
				OR = {
					region = bengal_region
					region = west_india_region
					region = coromandel_region
				}
				NOT ={
					is_core = ROOT
					owned_by = ROOT
					owner = {
						has_country_modifier = dutch_india_trade_co 
						has_country_flag = trade_company 
					} 
				}
				any_neighbor_province = {
					owned_by = ROOT
					is_core = ROOT
				}
			}
			add_claim = ROOT
		}
	}
}

# Local Noble's Power Grows
country_event = {
	id = 884
	title = "EVTNAME884"
	desc = "EVTDESC884"
	picture = DEBATE_REPUBLICAN_eventPicture
	goto = local_noble_province

	is_triggered_only = yes
	
	trigger = {
		has_estate = estate_nobles
		capital_scope = { continent = europe }
		NOT = { adm = 3 }
		num_of_cities = 2
		any_owned_province = {
			is_capital = no
			continent = europe 
			culture_group = root
			NOT = { has_province_modifier = powerful_noble }
			NOT = { local_autonomy = 0.5 }
			OR = {
				development = 10
				owner = {
					NOT = { num_of_cities = 9 }
				}
			}
		}
		government = monarchy
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_capital = no
					continent = europe
					culture_group = root
					NOT = { has_province_modifier = powerful_noble }
					NOT = { local_autonomy = 0.5 }
					OR = {
						development = 10
						owner = {
							NOT = { num_of_cities = 9 }
						}
					}
				}
				save_event_target_as = local_noble_province
				root = {
					set_saved_name = {
						key = local_noble_name
						type = advisor
						scope = prev
					}
				}
			}
		}
	}
	after = {
		clear_saved_name = local_noble_name
	}
	
	option = {
		name = "EVTOPTA884"
		ai_chance = {
			factor = 33
		}
		add_prestige = -10
		event_target:local_noble_province = {
			add_province_modifier = {
				name = "powerful_noble"
				duration = 240
			}
			add_local_autonomy = 20

		}
		add_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "EVTOPTB884"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
			modifier = {
				factor = 0.25 #Should prefer A
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_prestige = 5
		if = {
			limit = { NOT = { stability = -2 } }
			add_adm_power = -100
		}		
		if = {
			limit = { stability = -2 }
			add_stability = -1
		}
	}
	option = {
		name = "EVTOPTC884"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0 #Never if below 30
				has_estate = estate_nobles
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		add_prestige = 5
		event_target:local_noble_province = {
			spawn_large_scaled_rebels = {
				type = pretender_rebels
				saved_name = local_noble_name
			}
		}
		reduce_estate_nobles_loyalty_effect = yes
	}
	option = {
		name = "personality_options.884.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = lawgiver } }
		ai_chance = {
			factor = 100
		}
		add_prestige = 5
		add_adm_power = -50
	}
	option = {
		name = "personality_options.884.b"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = charismatic_negotiator } }
		ai_chance = {
			factor = 100
		}
		add_prestige = 5
		add_dip_power = -50
	}
	option = {
		name = "personality_options.884.c"
		highlight = yes
		trigger = {
			OR = {
				ruler_has_personality = cruel_personality
				ruler_has_personality = malevolent_personality
			}
		}
		ai_chance = {
			factor = 100
		}
		add_prestige = 5
		add_mil_power = -50
	}
}

# Colonial Discovery!
country_event = {
	id = 885
	title = "EVTNAME885"
	desc = "EVTDESC885"
	picture = COLONIZATION_eventPicture

	is_triggered_only = yes
	
	trigger = {
		capital_scope = {
			continent = europe
		}
		num_of_colonies = 1
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA885"
		add_dip_power = 15
	}
	option = {
		name = "EVTOPTB885"
		add_adm_power = 15
	}
	option = {
		name = "personality_options.885.a"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = entrepreneur }
		}
		add_years_of_income = 0.2
	}
}

# Country Destabilized
country_event = {
	id = 806
	title = "EVTNAME806"
	desc = "EVTDESC806"
	picture = DEBATE_REPUBLICAN_eventPicture
	
	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}
	
	trigger = {
		war_exhaustion = 10
		stability = -2
	}

	option = {
		name = "EVTOPTB806A"
		add_stability = -1
	}
	option = {
		name = "personality_options.806.a" #
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = careful } } 
		ai_chance = {
			factor = 100
		}
		random_owned_province = {
			limit = {
				is_capital = no
				NOT = { local_autonomy = 90 } 
				is_city = yes
			}
			area = {
				limit = {
					owned_by = ROOT
					is_capital = no
				}
				add_local_autonomy = 25
			}
		}
	}
}

# Naval thought suffering
country_event = {
	id = 836
	title = "EVTNAME836"
	desc = "EVTDESC836"
	picture = NAVAL_MILITARY_eventPicture

	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}
	
	trigger = {
		num_of_ports = 1
		primitives = no
		NOT = { has_idea_group = maritime_ideas }
		OR = { 
			has_idea_group = offensive_ideas
			has_idea_group = defensive_ideas
		}
	}
	
	option = {
		name = "EVTOPTB836A"
		add_dip_power = -50
	}
	option = {
		name = "personality_options.836.a"
		highlight = yes
		trigger = {
			ruler_has_personality_ancestor = { key = navigator }
		}
		add_dip_power = -25
	}
}

# Naval Officers are retiring
country_event = {
	id = 837
	title = "EVTNAME837"
	desc = "EVTDESC837"
	picture = NAVAL_MILITARY_eventPicture
	
	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}

	trigger = {
		num_of_ports = 1
		primitives = no
		NOT = { has_idea_group = maritime_ideas }
		OR = { 
			has_idea_group = offensive_ideas
			has_idea_group = defensive_ideas
		}
	}	
	
	option = {
		name = "EVTOPTB837A"
		add_navy_tradition = -10
	}
	option = {
		name = "personality_options.837.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = navigator } }
		add_navy_tradition = -5
	}
}

# An example to us all
country_event = {
	id = 838
	title = "EVTNAME838"
	desc = "EVTDESC838"
	picture = LAND_MILITARY_eventPicture
	
	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}
	
	trigger = {
		NOT = { has_idea_group = maritime_ideas }
		OR = { 
			has_idea_group = offensive_ideas
			has_idea_group = defensive_ideas
		}
	}	
	
	immediate = {
		check_if_non_state_advisor_effect = { #Hidden scripted effect, is used by scripted effect and must always be cleared in after = { } using erase_advisor_flags_effect.
			chance_of_primary = 95 #Not percentages!
			chance_of_tertiary = 3
			chance_of_secondary = 10
		}
	}
	
	option = {
		name = "EVTOPTB838A"
		generate_advisor_of_type_and_semi_random_religion_effect = {
			advisor_type=grand_captain
			advisor_type_if_not_state=grand_captain
			skill=1
			discount=yes
		}
		add_meritocracy_effect = yes
	}
	
	after = {
		erase_advisor_flags_effect = yes
	}
}

### Scripted by Sara Wendel-�rtqvist ###

namespace = random_event

# Support for revolution overseas - No longer supported; the event takes a lot of performance for little gain.
#country_event = {
#	id = random_event.1
#	title = "random_event.EVTNAME1"
#	desc = "random_event.EVTDESC1"
#	picture = LAND_MILITARY_eventPicture
#	
#	is_triggered_only = yes
#	
#	trigger = {
#		is_at_war = no
#		treasury = 100
#		any_rival_country = {
#			any_known_country = {
#				OR = {
#					is_in_war = {
#						attacker_leader = this
#						defender_leader = prev
#						casus_belli = cb_colonial_independence_war
#					}
#					AND = {
#						is_former_colonial_nation = yes
#						is_in_war = {
#							defender_leader = this
#							attacker_leader = prev
#						}
#					}
#				}
#			}
#		}
#		any_enemy_country = {
#			any_known_country = {
#				OR = {
#					is_in_war = {
#						attacker_leader = this
#						defender_leader = prev
#						casus_belli = cb_colonial_independence_war
#					}
#					AND = {
#						is_former_colonial_nation = yes
#						is_in_war = {
#							defender_leader = this
#							attacker_leader = prev
#						}
#					}
#				}
#			}
#		}
#	}
#
#	immediate = {
#		hidden_effect = {
#			random_country = {
#				limit = {
#					OR = {
#						is_rival = root
#						root = { is_rival = prev }
#					}
#					any_known_country = {
#						OR = {
#							is_in_war = {
#								attacker_leader = this
#								defender_leader = prev
#								casus_belli = cb_colonial_independence_war
#							}
#							AND = {
#								is_former_colonial_nation = yes
#								is_in_war = {
#									defender_leader = this
#									attacker_leader = prev
#								}
#							}
#						}
#					}
#				}
#				save_event_target_as = enemy_country
#				random_known_country = {
#					limit = {
#						OR = {
#							is_in_war = {
#								attacker_leader = this
#								defender_leader = prev
#								casus_belli = cb_colonial_independence_war
#							}
#							AND = {
#								is_former_colonial_nation = yes
#								is_in_war = {
#									defender_leader = this
#									attacker_leader = prev
#								}
#							}
#						}
#					}
#					save_event_target_as = former_colony
#				}
#			}
#		}
#	}
#	
#	mean_time_to_happen = {
#		days = 1
#	}
#	
#	option = {
#		name = "random_event.EVTOPTA1"
#		add_treasury = -100
#		event_target:former_colony = {
#			add_treasury = 100
#			add_opinion = {
#				who = ROOT
#				modifier = opinion_sent_help
#				years = 20
#			}
#		}
#		event_target:enemy_country = {
#			add_opinion = {
#				who = ROOT
#				modifier = opinion_interfered_in_war
#				years = 20
#			}
#		}
#	}
#	option = {
#		name = "random_event.EVTOPTB1"
#		add_prestige = -10
#		event_target:former_colony = {
#			add_opinion = {
#				who = ROOT
#				modifier = opinion_refused_send_help
#				years = 20
#			}
#		}
#		event_target:enemy_country = {
#			add_opinion = {
#				who = ROOT
#				modifier = opinion_pleased
#				years = 20
#			}
#		}
#	}
#}

# Culture ties weakened
# Mangled by Daniel Tolman for 1.28
country_event = {
	id = random_event.2
	title = "random_event.EVTNAME2"
	desc = { # American
		trigger = {
			culture_group = british
			any_owned_province = {
				continent = north_america
				OR = {
					culture = scottish
					culture = english
					culture = welsh
				}
			}
		}
		desc = "random_event.EVTDESC2"
	}
	desc = { # Brazilian
		trigger = {
			OR = {
				primary_culture = portugese
				primary_culture = brazilian
			}
			any_owned_province = {
				continent = south_america
				culture = portugese
			}
		}
		desc = "random_event.EVTDESC2B"
	}
	desc = { # Mexican
		trigger = {
			culture_group = iberian
			NOT = { primary_culture = portugese }
			NOT = { primary_culture = brazilian }
			any_owned_province = {
				continent = north_america
				OR = {
					culture = leonese
					culture = castillian
					culture = aragonese
					culture = catalan
					culture = galician
					culture = andalucian
					culture = basque
				}
			}
		}
		desc = "random_event.EVTDESC2C"
	}
	desc = { # Platinean
		trigger = {
			culture_group = iberian
			NOT = { primary_culture = portugese }
			NOT = { primary_culture = brazilian }
			any_owned_province = {
				continent = south_america
				OR = {
					culture = leonese
					culture = castillian
					culture = aragonese
					culture = catalan
					culture = galician
					culture = andalucian
					culture = basque
				}
			}
		}
		desc = "random_event.EVTDESC2D"
	}
	desc = { # Quebecois
		trigger = {
			culture_group = french
			NOT = { primary_culture = quebecois }
			NOT = { primary_culture = louisianans }
			any_owned_province = {
				OR = {
					colonial_region = colonial_alaska
					colonial_region = colonial_canada
					region = northeast_america_region
				}
				OR = {
					culture = cosmopolitan_french
					culture = occitain
					culture = normand
					culture = gascon
					culture = burgundian
					culture = anglois
				}
			}
		}
		desc = "random_event.EVTDESC2E"
	}
	desc = { # Louisianans
		trigger = {
			culture_group = french
			NOT = { primary_culture = quebecois }
			NOT = { primary_culture = louisianans }
			any_owned_province = {
				NOT = { colonial_region = colonial_alaska }
				NOT = { colonial_region = colonial_canada }
				NOT = { region = northeast_america_region }
				continent = north_america
				OR = {
					culture = cosmopolitan_french
					culture = occitain
					culture = normand
					culture = gascon
					culture = burgundian
					culture = anglois
				}
			}
		}
		desc = "random_event.EVTDESC2F"
	}
	picture = COLONIZATION_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		capital_scope = {
			OR = {
				continent = north_america
				continent = south_america
			}
		}
		NOT = { has_country_flag = rejected_new_colonial_culture }
		OR = {
			# Eligible for American culture
			AND = {
				culture_group = british
				any_owned_province = {
					continent = north_america
					OR = {
						culture = scottish
						culture = english
						culture = welsh
					}
				}
			}
			# Eligible for Brazilian culture
			AND = {
				OR = {
					primary_culture = portugese
					primary_culture = brazilian
				}
				any_owned_province = {
					continent = south_america
					culture = portugese
				}
			}
			# Eligible for Mexican culture
			AND = {
				culture_group = iberian
				NOT = { primary_culture = portugese }
				any_owned_province = {
					continent = north_america
					OR = {
						culture = leonese
						culture = castillian
						culture = aragonese
						culture = catalan
						culture = galician
						culture = andalucian
						culture = basque
					}
				}
			}
			# Eligible for Platinean culture
			AND = {
				culture_group = iberian
				NOT = { primary_culture = portugese }
				any_owned_province = {
					continent = south_america
					OR = {
						culture = leonese
						culture = castillian
						culture = aragonese
						culture = catalan
						culture = galician
						culture = andalucian
						culture = basque
					}
				}
			}
			# Eligible for Quebecois culture
			AND = {
				culture_group = french
				NOT = { primary_culture = quebecois }
				NOT = { primary_culture = louisianans }
				any_owned_province = {
					OR = {
						colonial_region = colonial_alaska
						colonial_region = colonial_canada
						region = northeast_america_region
					}
					OR = {
						culture = cosmopolitan_french
						culture = occitain
						culture = normand
						culture = gascon
						culture = burgundian
						culture = anglois
					}
				}
			}
			# Eligible for Louisianans culture
			AND = {
				culture_group = french
				NOT = { primary_culture = quebecois }
				NOT = { primary_culture = louisianans }
				any_owned_province = {
					NOT = { colonial_region = colonial_alaska }
					NOT = { colonial_region = colonial_canada }
					NOT = { region = northeast_america_region }
					continent = north_america
					OR = {
						culture = cosmopolitan_french
						culture = occitain
						culture = normand
						culture = gascon
						culture = burgundian
						culture = anglois
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	immediate = {
		hidden_effect = {
			if = {
				limit = {
					culture_group = british
					any_owned_province = {
						continent = north_america
						OR = {
							culture = scottish
							culture = english
							culture = welsh
						}
					}
				}
				random_owned_province = {
					limit = {
						continent = north_america
						OR = {
							culture = scottish
							culture = english
							culture = welsh
						}
					}
					save_event_target_as = american_province
				}
			}
			if = {
				limit = {
					OR = {
						primary_culture = portugese
						primary_culture = brazilian
					}
					any_owned_province = {
						continent = south_america
						culture = portugese
					}
				}
				random_owned_province = {
					limit = {
						continent = south_america
						culture = portugese
					}
					save_global_event_target_as = brazilian_province
				}
			}
			if = {
				limit = {
					culture_group = iberian
					NOT = { primary_culture = portugese }
					any_owned_province = {
						continent = north_america
						OR = {
							culture = leonese
							culture = castillian
							culture = aragonese
							culture = catalan
							culture = galician
							culture = andalucian
							culture = basque
						}
					}
				}
				random_owned_province = {
					limit = {
						continent = north_america
						OR = {
							culture = leonese
							culture = castillian
							culture = aragonese
							culture = catalan
							culture = galician
							culture = andalucian
							culture = basque
						}
					}
					save_event_target_as = mexican_province
				}
			}
			if = {
				limit = {
					culture_group = iberian
					NOT = { primary_culture = portugese }
					any_owned_province = {
						continent = south_america
						OR = {
							culture = leonese
							culture = castillian
							culture = aragonese
							culture = catalan
							culture = galician
							culture = andalucian
							culture = basque
						}
					}
				}
				random_owned_province = {
					limit = {
						continent = south_america
						OR = {
							culture = leonese
							culture = castillian
							culture = aragonese
							culture = catalan
							culture = galician
							culture = andalucian
							culture = basque
						}
					}
					save_event_target_as = platinean_province
				}
			}
			if = {
				limit = {
					culture_group = french
					NOT = { primary_culture = quebecois }
					NOT = { primary_culture = louisianans }
					any_owned_province = {
						OR = {
							colonial_region = colonial_alaska
							colonial_region = colonial_canada
							region = northeast_america_region
						}
						OR = {
							culture = cosmopolitan_french
							culture = occitain
							culture = normand
							culture = gascon
							culture = burgundian
							culture = anglois
						}
					}
				}
				random_owned_province = {
					limit = {
						OR = {
							colonial_region = colonial_alaska
							colonial_region = colonial_canada
							region = northeast_america_region
						}
						OR = {
							culture = cosmopolitan_french
							culture = occitain
							culture = normand
							culture = gascon
							culture = burgundian
							culture = anglois
						}
					}
					save_event_target_as = quebecois_province
				}
			}
			if = {
				limit = {
					culture_group = french
					NOT = { primary_culture = quebecois }
					NOT = { primary_culture = louisianans }
					any_owned_province = {
						NOT = { colonial_region = colonial_alaska }
						NOT = { colonial_region = colonial_canada }
						NOT = { region = northeast_america_region }
						continent = north_america
						OR = {
							culture = cosmopolitan_french
							culture = occitain
							culture = normand
							culture = gascon
							culture = burgundian
							culture = anglois
						}
					}
				}
				random_owned_province = {
					limit = {
						NOT = { colonial_region = colonial_alaska }
						NOT = { colonial_region = colonial_canada }
						NOT = { region = northeast_america_region }
						continent = north_america
						OR = {
							culture = cosmopolitan_french
							culture = occitain
							culture = normand
							culture = gascon
							culture = burgundian
							culture = anglois
						}
					}
					save_event_target_as = louisianans_province
				}
			}
		}
	}
	option = { # Become American
		trigger = {
			culture_group = british
		}
		name = "random_event.EVTOPTA2"
		if = {
			limit = {
				NOT = {
					primary_culture = american
				}
			}
			change_primary_culture = american
		}
		event_target:american_province = {
			area = {
				limit = {
					owned_by = ROOT
					OR = {
						culture = scottish
						culture = english
						culture = welsh
					}
				}
				change_culture = american
			}
		}
		set_country_flag = embraced_new_colonial_culture
	}
	option = { # Reject Freedom
		trigger = {
			culture_group = british
			ai = no
			NOT = { has_country_flag = embraced_new_colonial_culture }
		}
		name = "random_event.EVTOPTB2"
		event_target:american_province = {
			change_culture = american
		}
		set_country_flag = rejected_new_colonial_culture
	}
	option = { # Become Brazilian
		trigger = {
			OR = {
				primary_culture = portugese
				primary_culture = brazilian
			}
		}
		name = "random_event.EVTOPTC2"
		if = {
			limit = {
				NOT = {
					primary_culture = brazilian
				}
			}
			change_primary_culture = brazilian
		}
		event_target:brazilian_province = {
			area = {
				limit = {
					owned_by = ROOT
					culture = portugese
				}
				change_culture = brazilian
			}
		}
		set_country_flag = embraced_new_colonial_culture
	}
	option = { # Resist cultural change
		trigger = {
			primary_culture = portugese
			ai = no
			NOT = { has_country_flag = embraced_new_colonial_culture }
		}
		name = "random_event.EVTOPTB2"
		event_target:brazilian_province = {
			change_culture = brazilian
		}
		set_country_flag = rejected_new_colonial_culture
	}
	option = { # Become Mexican
		trigger = {
			any_owned_province = {
				continent = north_america
				OR = {
					culture = leonese
					culture = castillian
					culture = aragonese
					culture = catalan
					culture = galician
					culture = andalucian
					culture = basque
				}
			}
			culture_group = iberian
			NOT = { primary_culture = portugese }
			NOT = { primary_culture = brazilian }
		}
		name = "random_event.EVTOPTE2"
		if = {
			limit = {
				NOT = {
					primary_culture = mexican
				}
			}
			change_primary_culture = mexican
		}
		event_target:mexican_province = {
			area = {
				limit = {
					owned_by = ROOT
					OR = {
						culture = leonese
						culture = castillian
						culture = aragonese
						culture = catalan
						culture = galician
						culture = andalucian
						culture = basque
					}
				}
				change_culture = mexican
			}
		}
		set_country_flag = embraced_new_colonial_culture
	}
	option = { # Resist cultural change
		trigger = {
			any_owned_province = {
				continent = north_america
				OR = {
					culture = leonese
					culture = castillian
					culture = aragonese
					culture = catalan
					culture = galician
					culture = andalucian
					culture = basque
				}
			}
			culture_group = iberian
			NOT = { primary_culture = portugese }
			NOT = { primary_culture = brazilian }
			ai = no
			NOT = { has_country_flag = embraced_new_colonial_culture }
			NOT = { primary_culture = mexican }
		}
		name = "random_event.EVTOPTB2"
		event_target:mexican_province = {
			change_culture = mexican
		}
		set_country_flag = rejected_new_colonial_culture
	}
	option = { # Become Platinean
		trigger = {
			any_owned_province = {
				continent = south_america
				OR = {
					culture = leonese
					culture = castillian
					culture = aragonese
					culture = catalan
					culture = galician
					culture = andalucian
					culture = basque
				}
			}
			culture_group = iberian
			NOT = { primary_culture = portugese }
			NOT = { primary_culture = brazilian }
		}
		name = "random_event.EVTOPTF2"
		if = {
			limit = {
				NOT = {
					primary_culture = platinean
				}
			}
			change_primary_culture = platinean
		}
		event_target:platinean_province = {
			area = {
				limit = {
					owned_by = ROOT
					OR = {
						culture = leonese
						culture = castillian
						culture = aragonese
						culture = catalan
						culture = galician
						culture = andalucian
						culture = basque
					}
				}
				change_culture = platinean
			}
		}
		set_country_flag = embraced_new_colonial_culture
	}
	option = { # Resist cultural change
		trigger = {
			any_owned_province = {
				continent = south_america
				OR = {
					culture = leonese
					culture = castillian
					culture = aragonese
					culture = catalan
					culture = galician
					culture = andalucian
					culture = basque
				}
			}
			culture_group = iberian
			NOT = { primary_culture = portugese }
			NOT = { primary_culture = brazilian }
			ai = no
			NOT = { has_country_flag = embraced_new_colonial_culture }
			NOT = { primary_culture = platinean }
		}
		name = "random_event.EVTOPTB2"
		event_target:platinean_province = {
			change_culture = platinean
		}
		set_country_flag = rejected_new_colonial_culture
	}
	option = { # Become Quebecois
		trigger = {
			culture_group = french
			any_owned_province = {
				OR = {
					colonial_region = colonial_alaska
					colonial_region = colonial_canada
					region = northeast_america_region
				}
				OR = {
					culture = cosmopolitan_french
					culture = occitain
					culture = normand
					culture = gascon
					culture = burgundian
					culture = anglois
				}
			}
		}
		name = "random_event.EVTOPTG2"
		if = {
			limit = {
				NOT = {
					primary_culture = quebecois
				}
			}
			change_primary_culture = quebecois
		}
		event_target:quebecois_province = {
			area = {
				limit = {
					owned_by = ROOT
					OR = {
						culture = cosmopolitan_french
						culture = occitain
						culture = normand
						culture = gascon
						culture = burgundian
						culture = anglois
					}
				}
				change_culture = quebecois
			}
		}
		set_country_flag = embraced_new_colonial_culture
	}
	option = { # Resist cultural change
		trigger = {
			culture_group = french
			any_owned_province = {
				OR = {
					colonial_region = colonial_alaska
					colonial_region = colonial_canada
					region = northeast_america_region
				}
				OR = {
					culture = cosmopolitan_french
					culture = occitain
					culture = normand
					culture = gascon
					culture = burgundian
					culture = anglois
				}
			}
			ai = no
			NOT = { has_country_flag = embraced_new_colonial_culture }
			NOT = { primary_culture = quebecois }
		}
		name = "random_event.EVTOPTB2"
		event_target:quebecois_province = {
			change_culture = quebecois
		}
		set_country_flag = rejected_new_colonial_culture
	}
	option = { # Become Louisianans
		trigger = {
			culture_group = french
			any_owned_province = {
				NOT = { colonial_region = colonial_alaska }
				NOT = { colonial_region = colonial_canada }
				NOT = { region = northeast_america_region }
				continent = north_america
				OR = {
					culture = cosmopolitan_french
					culture = occitain
					culture = normand
					culture = gascon
					culture = burgundian
					culture = anglois
				}
			}
		}
		name = "random_event.EVTOPTH2"
		if = {
			limit = {
				NOT = {
					primary_culture = louisianans
				}
			}
			change_primary_culture = louisianans
		}
		event_target:louisianans_province = {
			area = {
				limit = {
					owned_by = ROOT
					OR = {
						culture = leonese
						culture = castillian
						culture = aragonese
						culture = catalan
						culture = galician
						culture = andalucian
						culture = basque
					}
				}
				change_culture = louisianans
			}
		}
		set_country_flag = embraced_new_colonial_culture
	}
	option = { # Resist cultural change
		trigger = {
			culture_group = french
			any_owned_province = {
				NOT = { colonial_region = colonial_alaska }
				NOT = { colonial_region = colonial_canada }
				NOT = { region = northeast_america_region }
				continent = north_america
				OR = {
					culture = cosmopolitan_french
					culture = occitain
					culture = normand
					culture = gascon
					culture = burgundian
					culture = anglois
				}
			}
			ai = no
			NOT = { has_country_flag = embraced_new_colonial_culture }
			NOT = { primary_culture = louisianans }
		}
		name = "random_event.EVTOPTB2"
		event_target:louisianans_province = {
			change_culture = louisianans
		}
		set_country_flag = rejected_new_colonial_culture
	}
}

# Traitor in Parliament
country_event = {
	id = random_event.3
	title = "random_event.EVTNAME3"
	desc = "random_event.EVTDESC3"
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		has_parliament = yes
		is_at_war = yes
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA3"
		trigger = { 
			stability = -2 
		}
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0.5
				NOT = { stability = 1 }
			}
		}
		add_stability = -1
	}
	option = {
		name = "random_event.EVTOPTB3"
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0.5
				war_exhaustion = 8
			}
		}
		add_war_exhaustion = 2
	}
	option = {
		name = "personality_options.random.3.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = secretive } }
		ai_chance = {
			factor = 100
		}
		add_dip_power = -25
	}
}

# A new religion spreads?
country_event = {
	id = random_event.4
	title = "random_event.EVTNAME4"
	desc = "random_event.EVTDESC4"
	picture = ELECTION_REPUBLICAN_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		has_institution = enlightenment
		has_advisor = yes
		government = monarchy
		NOT = {
			any_owned_province = {
				has_province_modifier = football_modifier
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA4"
		if = {
			limit = {
				religion = catholic
			}
			add_papal_influence = 10
		}
		if = {
			limit = {
				NOT = { religion = catholic }
				is_lesser_in_union = no
			}
			add_legitimacy = 10
		}
		if = {
			limit = {
				NOT = { religion = catholic }
				is_lesser_in_union = no
			}
			add_horde_unity = 10
		}
		every_owned_province = {
			limit = {
				culture = english
			}
			add_province_modifier = {
				name = football_modifier
				duration = 18250
			}			
		}
	}
	option = {
		name = "random_event.EVTOPTB4"
		remove_advisor = random
		reduce_meritocracy_effect = yes
	}
}

# Our ancestors are watching
country_event = {
	id = random_event.5
	title = "random_event.EVTNAME5"
	desc = "random_event.EVTDESC5"
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		government = monarchy
		is_lesser_in_union = no
		NOT = { legitimacy_or_horde_unity = 40 }
		NOT = {
			any_owned_province = {
				has_province_modifier = watching_ancestors
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA5"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.3 }
			}
		}
		add_years_of_income = -0.20
		add_prestige = 20
		add_legitimacy = 20
		add_horde_unity = 20
		add_mandate_effect = yes
	}
	option = {
		name = "random_event.EVTOPTB5"
		trigger = { NOT = { has_reform = celestial_empire } }
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.2 }
			}
		}
		add_years_of_income = -0.10
		add_prestige = 5
		add_legitimacy = 5
		add_horde_unity = 5
	}
	option = {
		name = "random_event.EVTOPTC5"
		ai_chance = {
			factor = 33
		}
		every_owned_province = {
			limit = {
				is_core = ROOT
			}
			add_province_modifier = {
				name = watching_ancestors
				duration = 18250
			}			
		}
	}
}

# A new champion of the joust
country_event = {
	id = random_event.6
	title = "random_event.EVTNAME6"
	desc = "random_event.EVTDESC6"
	picture = THEATRE_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		NOT = {
			is_year = 1500
		}
		OR = {
			government = monarchy
			has_reform = revolutionary_empire_reform
		}
		is_lesser_in_union = no
		religion_group = christian
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA6"
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0.5
				NOT = { legitimacy = 70 }
			}
		}
		create_general = { tradition = 100 }
		add_prestige = -25
		add_legitimacy = -25
	}
	option = {
		name = "random_event.EVTOPTB6"
		ai_chance = {
			factor = 5
			modifier = {
				factor = 1.5
				NOT = { legitimacy = 70 }
			}
		}
		add_legitimacy = 25
	}
}

# A new flagship!
country_event = {
	id = random_event.7
	title = "random_event.EVTNAME7"
	desc = "random_event.EVTDESC7"
	picture = SHIP_SAILING_eventPicture
	goto = flagship_province
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_dlc = "Golden Century" }
		naval_forcelimit = 90
		num_of_ports = 1
		any_owned_province = {
			has_port = yes
			is_core = ROOT
			controlled_by = ROOT
		}
		primitives = no
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		random_owned_province = {
			limit = {
				has_port = yes
				is_core = ROOT
				controlled_by = ROOT
			}
			save_event_target_as = flagship_province
		}
	}

	option = {
		name = "random_event.EVTOPTA7"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { treasury = 100 }
			}
		}
		add_treasury = -50
		add_prestige = 5
		event_target:flagship_province = {
			heavy_ship = ROOT
		}
	}
	option = {
		name = "random_event.EVTOPTB7"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { treasury = 50 }
			}
		}
		add_treasury = -20
		add_prestige = 2
		event_target:flagship_province = {
			light_ship = ROOT
		}
	}
	option = {
		name = "random_event.EVTOPTC7"
		ai_chance = {
			factor = 33
		}
		add_treasury = -10
		add_prestige = 1
		event_target:flagship_province = {
			galley = ROOT
		}
	}
}

# Heresy!
country_event = {
	id = random_event.8
	title = "random_event.EVTNAME8"
	desc = "random_event.EVTDESC8"
	picture = POPE_PREACHING_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		religion = catholic
		NOT = { tag = PAP }
		OR = {
			advisor = natural_scientist
			advisor = philosopher
			advisor = artist
			advisor = theologian
		}
		employed_advisor = {
			category = ADM
			religion = catholic
		}
		any_owned_province = {
			has_owner_religion = yes
		}
	}
	
	immediate = {
		hidden_effect = {
			if = {
				limit = {
					any_owned_province = {
						has_owner_religion = yes
						has_tax_building_trigger = yes
					}
				}
				random_owned_province = {
					limit = {
						has_owner_religion = yes
						has_tax_building_trigger = yes
					}
					save_event_target_as = origin_of_bishop
				}
			}
			else = {
				random_owned_province = {
					limit = {
						has_owner_religion = yes
					}
					save_event_target_as = origin_of_bishop
				}
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA8"
		ai_chance = {
			factor = 50
		}
		if = {
			limit = { has_saved_event_target = origin_of_bishop }
			define_advisor = {
				type = inquisitor
				skill = 1
				culture = event_target:origin_of_bishop
			}
		}
		else = {
			define_advisor = {
				type = inquisitor
				skill = 1
			}
		}
		add_papal_influence = 10
		add_estate_church_loyalty_effect = yes
		reduce_meritocracy_effect = yes
		if = {
			limit = {
				advisor = natural_scientist
			}
			kill_advisor = natural_scientist
		}
		if = {
			limit = {
				advisor = philosopher
			}
			kill_advisor = philosopher
		}
		if = {
			limit = {
				advisor = artist
			}
			kill_advisor = artist
		}
		if = {
			limit = {
				advisor = theologian
			}
			kill_advisor = theologian
		}
	}
	option = {
		name = "random_event.EVTOPTB8"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		add_adm_power = 50
		reduce_estate_church_loyalty_effect = yes
		add_papal_influence = -20
	}
	option = {
		name = "personality_options.random.8.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = pious } }
		ai_chance = {
			factor = 100
		}
		add_adm_power = 50
		add_papal_influence = -5
	}
}

# We have a man inside!
country_event = {
	id = random_event.9
	title = "random_event.EVTNAME9"
	desc = "random_event.EVTDESC9"
	picture = LAND_MILITARY_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		has_regency = no
		is_at_war = yes
		any_war_enemy_country = {
			war_with = ROOT
			employed_advisor = {
				type = fortification_expert
				culture = root
			}
		}
		NOT = {
			has_ruler_modifier = inside_man
		}
	}

	immediate = {
		hidden_effect = {
			random_country = {
				limit = {
					employed_advisor = {
						type = fortification_expert
						culture = root
					}
					war_with = ROOT
				}
				save_event_target_as = enemy_country
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTB9"
		add_ruler_modifier = {
			name = inside_man
		}
	}
}

# A greedy corsair
country_event = {
	id = random_event.10
	title = "random_event.EVTNAME10"
	desc = "random_event.EVTDESC10"
	picture = NAVAL_MILITARY_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		naval_forcelimit = 50
		num_of_ports = 1
		OR = {
			advisor = navigator
			advisor = naval_reformer
		}
		primitives = no
		num_ships_privateering = 1
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA10"
		reduce_meritocracy_effect = yes
		if = {
			limit = {
				advisor = navigator
			}
			kill_advisor = navigator
		}
		if = {
			limit = {
				advisor = naval_reformer
			}
			kill_advisor = naval_reformer
		}
		add_dip_power = 75
	}
	option = {
		name = "random_event.EVTOPTB10"
		add_years_of_income = 0.2
		add_mercantilism = -2
	}
}

# Foreign Military Expert
country_event = {
	id = random_event.11
	title = "random_event.EVTNAME11"
	desc = "random_event.EVTDESC11"
	picture = BATTLE_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		is_at_war = yes
		NOT = { army_tradition = 20 } 
		any_neighbor_country = {
			same_continent = root
			army_tradition = 50
			NOT = { war_with = root }
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_neighbor_country = {
				limit = {
					same_continent = root
					army_tradition = 50
					NOT = { war_with = root }
				}
				save_event_target_as = advisor_origin_country
				root = {
					set_saved_name = {
						key = foreign_military_expert
						type = advisor
						scope = prev
					}
				}
			}
		}
	}
	after = {
		clear_saved_name = foreign_military_expert
	}
	
	option = {
		name = "random_event.EVTOPTA11"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.5 }
			}
		}
		add_years_of_income = -0.15
		add_army_tradition = 10
		
		if = {
			limit = {
				NOT = { monthly_income = 15 }
			}
			define_advisor = {
				name = foreign_military_expert
				type = army_reformer
				religion = event_target:advisor_origin_country
				culture = event_target:advisor_origin_country
				skill = 1
				discount = yes
			}
		}
		else_if = {
			limit = {
				NOT = { monthly_income = 25 }
			}
			define_advisor = {
				name = foreign_military_expert
				type = army_reformer
				religion = event_target:advisor_origin_country
				culture = event_target:advisor_origin_country
				skill = 2
				discount = yes
			}
		}
		else = {
			define_advisor = {
				name = foreign_military_expert
				type = army_reformer
				religion = event_target:advisor_origin_country
				culture = event_target:advisor_origin_country
				skill = 3
				discount = yes
			}
		}
	}
	option = {
		name = "random_event.EVTOPTB11"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.25 }
			}
		}
		add_years_of_income = -0.15

		create_general = {
			name = foreign_military_expert
			tradition = 70
		}
	}
	option = {
		name = "random_event.EVTOPTC11"
		if = {
			limit = { years_of_income = 0.15 }
			add_legitimacy = 10
		}
		else = {
			add_legitimacy = 5
		}
		ai_chance = {
			factor = 33
		}
	}
}

# The White Elephant
country_event = {
	id = random_event.12
	title = "random_event.EVTNAME12"
	desc = "random_event.EVTDESC12"
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			culture_group = southeastasian_group
			culture_group = burman
			culture_group = eastern_aryan
			culture_group = hindusthani
			culture_group = western_aryan
			culture_group = dravidian
			culture_group = central_indic
		}
		NOT = { primary_culture = tibetan }
		NOT = { primary_culture = tibetan_new }
		NOT = {
			stability = 3
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA12"
		add_stability_or_adm_power = yes
	}
}

# Profits in Mecca!
country_event = {
	id = random_event.13
	title = "random_event.EVTNAME13"
	desc = "random_event.EVTDESC13"
	picture = MERCHANTS_TALKING_eventPicture
	goto = 385
	
	is_triggered_only = yes
	
	trigger = {
		owns = 385 # Mecca
		NOT = {
			has_country_modifier = mecca_timer
		}
		NOT = {
			has_ruler_modifier = pious_ruler
		}
		has_regency = no
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		hidden_effect = {
			add_country_modifier = {
				name = mecca_timer
				duration = 1825
				hidden = yes
			}
		}
	}
	
	option = {
		name = "random_event.EVTOPTA13"
		ai_chance = {
			factor = 33
		}
		add_treasury = 100
		add_mercantilism = 2
	}
	option = {
		name = "random_event.EVTOPTB13"
		ai_chance = {
			factor = 33
			modifier = {
				factor = 2
				has_estate = estate_burghers
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		add_mercantilism = 5
		add_estate_burghers_loyalty_effect = yes
	}
	option = {
		name = "random_event.EVTOPTC13"
		trigger = {
			religion_group = muslim
			has_estate = estate_church
		}
		ai_chance = {
			factor = 33
			modifier = {
				factor = 2
				has_estate = estate_church
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		add_ruler_modifier = {
			name = pious_ruler
		}
		add_estate_church_loyalty_effect = yes
	}
}

# An astonishing performance
country_event = {
	id = random_event.14
	title = "random_event.EVTNAME14"
	desc = "random_event.EVTDESC14"
	picture = THEATRE_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		capital_scope = { continent = europe }
		religion_group = christian
		has_idea_group = innovativeness_ideas
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			set_saved_name = {
				key = female_troubadour
				type = advisor
				female = yes
			}
		}
	}
	after = {
		clear_saved_name = female_troubadour
	}
	
	option = {
		name = "random_event.EVTOPTA14"
		ai_chance = {
			factor = 5
		}
		add_prestige = 5
		add_meritocracy_effect = yes
		define_advisor = {
			name = female_troubadour
			female = yes
			skill = 1
			type = artist
			discount = yes
		}
	}
	option = {
		name = "random_event.EVTOPTB14"
		ai_chance = {
			factor = 5
		}
		add_adm_power = 20
	}
	option = {
		name = "personality_options.random.14.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = free_thinker } }
		add_dip_power = 50
	}
}

# Musket or Bow?
country_event = {
	id = random_event.15
	title = "random_event.EVTNAME15"
	desc = "random_event.EVTDESC15"
	picture = MILITARY_CAMP_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		mil_tech = 8
		NOT = {
			mil_tech = 14
		}
		has_regency = no
		NOT = {
			has_ruler_modifier = archery_muskets
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA15"
		add_ruler_modifier = {
			name = archery_muskets
		}
	}
	option = {
		name = "random_event.EVTOPTB15"
		add_army_tradition = -15
	}
	option = {
		name = "personality_options.random.15.a"
		highlight = yes
		trigger = { ruler_has_personality_ancestor = { key = bold_fighter } }
		add_mil_power = -10
	}
}

# Gaps in the Blockade
country_event = {
	id = random_event.16
	title = "random_event.EVTNAME16"
	desc = "random_event.EVTDESC16"
	picture = SHIP_SAILING_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		is_at_war = yes
		blockade = 75
		NOT = {
			has_country_modifier = gaps_blockade
		}
		NOT = {
			has_country_modifier = merchants_gaps_blockade
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "random_event.EVTOPTA16"
		add_country_modifier = {
			name = gaps_blockade
			duration = 365
		}
	}
	option = {
		name = "random_event.EVTOPTB16"
		add_country_modifier = {
			name = merchants_gaps_blockade
			duration = 365
		}
	}
	#option = {
	#	name = "random_event.EVTOPTC16"
	#	add_prestige = 3
	#}
}

# The Four Kings
country_event = {
	id = random_event.20
	title = "random_event.EVTNAME20"
	desc = "random_event.EVTDESC20"
	picture = COURT_eventPicture
	
	trigger = {
		NOT = { has_country_flag = ENG_had_event_XXX }
		is_year = 1600
		NOT = { is_year = 1800 }
		OR = {
			AND = {
				tag = ENG
				NOT = { exists = GBR }
			}
			tag = GBR
		}
		is_free_or_tributary_trigger = yes
		government = monarchy
		any_known_country = {
			tag = IRO
			ai = yes
			is_free_or_tributary_trigger = yes
			num_of_cities = 4
			NOT = {
				alliance_with = ROOT
				war_with = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	immediate = {
		set_country_flag = ENG_had_event_XXX
	}

	option = {
		name = "random_event.EVTOPTA20" # Give them a chain of steel representing our unbreakable bond
		ai_chance = { factor = 90 }
		add_opinion = { who = IRO modifier = visit_of_the_four_kings }
		IRO = {
			add_opinion = { who = ROOT modifier = visit_of_the_four_kings }
		}
		create_alliance = IRO
	}
	option = {
		name = "random_event.EVTOPTB20" # Give them gifts but make no promises
		ai_chance = { factor = 10 }
		add_treasury = -250
		IRO = {
			add_opinion = { who = ROOT modifier = opinion_grateful }
		}		
	}
	option = {
		name = "random_event.EVTOPTC20" # Give them nothing, these men are savages, not royalty
		ai_chance = { factor = 0 }
		IRO = {
			add_opinion = { who = ROOT modifier = opinion_angry }
		}
	}
}

# Bible Translated
province_event = {
	id = random_event.21
	title = "random_event.EVTNAME21"
	desc = "random_event.EVTDESC21"
	picture = BIG_BOOK_eventPicture
	goto = root
	
	trigger = {
		owner = {
			NOT = { has_country_flag = bible_translated }
			OR = {
				religion = catholic
				religion = protestant
				religion = reformed
				religion = anglican
				religion = hussite
			}
		}
		is_religion_enabled = protestant
		is_reformation_center = no
		religion_group = christian
	}

	mean_time_to_happen = {
		months = 5000 # Random Province Event
		modifier = {
			factor = 0.75
			province_id = 59 # Wittenberg	
		}
	}
	
	immediate = {
		owner = {
			set_country_flag = bible_translated
		}
	}
	
	option = {
		name = "random_event.EVTOPTA21" # Heresy! Burn the priest and his books!
		owner = {
			add_reform_desire = -0.005
			if = {
				limit = {
					exists = PAP
				}
				PAP = {
					add_opinion = { who = ROOT modifier = opinion_grateful }
				}
			}
			every_neighbor_country = {
				limit = {
					religion = catholic
				}
				add_opinion = { who = ROOT modifier = opinion_grateful }
			}
			every_neighbor_country = {
				limit = {
					OR = {
						religion = protestant
						religion = reformed
						religion = anglican
						religion = hussite
					}
				}
				add_opinion = { who = ROOT modifier = opinion_angry }
			}
		}
	}
	option = {
		name = "random_event.EVTOPTB21" # Great news! Spread these bibles far and wide
		if = {
			limit = {
				owner = {
					OR = {
						religion = catholic
						religion = protestant
					}
				}
			}
			change_religion = protestant
		}
		if = {
			limit = {
				owner = {
					religion = reformed
				}
			}
			change_religion = reformed
		}
		if = {
			limit = {
				owner = {
					religion = anglican
				}
			}
			change_religion = anglican
		}
		if = {
			limit = {
				owner = {
					religion = hussite
				}
			}
			change_religion = hussite
		}
		owner = {
			add_reform_desire = 0.015
			if = {
				limit = {
					exists = PAP
				}
				PAP = {
					add_opinion = { who = ROOT modifier = opinion_angry }
				}
			}
			every_neighbor_country = {
				limit = {
					religion = catholic
				}
				add_opinion = { who = ROOT modifier = opinion_irritated }
			}
			every_neighbor_country = {
				limit = {
					OR = {
						religion = protestant
						religion = reformed
						religion = anglican
						religion = hussite
					}
				}
				add_opinion = { who = ROOT modifier = opinion_grateful }
			}
		}
	}
}

# Establish Penal Colony in COLONYNAME
province_event = {
	id = random_event.22
	title = "random_event.EVTNAME22"
	desc = "random_event.EVTDESC22"
	picture = COLONIZATION_eventPicture
	goto = root
	
	trigger = {
		owner = {
			NOT = { has_country_flag = has_penal_colony }
		}
		is_colony = yes
		NOT = { colonysize = 500 }
	}
	
	mean_time_to_happen = {
		months = 2000
		modifier = {
			factor = 0.9
			region = australia_region
		}
	}
	
	immediate = {
		owner = {
			set_country_flag = has_penal_colony
		}
	}

	option = {
		name = "random_event.EVTOPTA22" # Sounds good, set it up
		add_province_modifier = {
			name = "penal_colony"
			duration = 9125
		}
	}
	option = {
		name = "random_event.EVTOPTB22" # We can't trust these people! Keep them in prison over here
		owner = {
			add_adm_power = -10
		}
	}
}

# Influenza!
province_event = {
	id = random_event.23
	title = "random_event.EVTNAME23"
	desc = "random_event.EVTDESC23"
	picture = PLAGUE_eventPicture
	goto = root
	
	trigger = {
		has_port = yes
		is_capital = no
		OR = {
			NOT = { has_province_flag = province_had_influenza }
			had_province_flag = { flag = province_had_influenza days = 10950 }
		}
		owner = {
			primitives = no
			NOT = { has_country_flag = has_competent_doctors }
			any_known_country = {
				NOT = {
					OR = { 
						capital_scope = { continent = north_america }
						capital_scope = { continent = south_america } 
					}
				}
			}
		}	
	}
	
	is_mtth_scaled_to_size = 1
	
	mean_time_to_happen = {
		months = 600
		modifier = {
			factor = 0.9
			has_terrain = marsh
		}
	}
	
	immediate = {
		set_province_flag = province_had_influenza
	}

	option = {
		name = "random_event.EVTOPTA23" # Quarantine the port and let them die!
		ai_chance = {
			factor = 50
		}
		owner = { add_adm_power = -50 }
		add_province_modifier = {
			name = "quarantined_influenza"
			duration = 3650
		}
	}
	option = {
		name = "random_event.EVTOPTB23" # This is not the first flu in our country, I don't care!
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				calc_true_if = {
					all_neighbor_province = {
						owned_by = ROOT
						development = 12
					}
					amount = 3
				}
			}
		}
		add_province_modifier = {
			name = "influenza"
			duration = 3650
		}
		if = {
			limit = {
				any_neighbor_province = {
					NOT = { has_province_modifier = quarantined_influenza }
					NOT = { has_province_modifier = influenza }
					NOT = { has_province_flag = province_had_influenza }
				}
			}
			custom_tooltip = random_events.23.b.tt
		}
	}
}

# Influenza Spreads
province_event = {
	id = random_event.24
	title = "random_event.EVTNAME24"
	desc = "random_event.EVTDESC24"
	picture = PLAGUE_eventPicture
	goto = root
	
	trigger = {
		development = 8
		OR = {
			NOT = { has_province_flag = province_had_influenza }
			had_province_flag = { flag = province_had_influenza days = 10950 }
		}
		owner = {
			primitives = no
		}
		any_neighbor_province = {
			has_province_modifier = influenza
		}
		NOT = { has_province_modifier = quarantined_influenza }
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	immediate = {
		set_province_flag = province_had_influenza
	}
	
	option = {
		name = "random_event.EVTOPTA24" # Quarantine the province!
		ai_chance = {
			factor = 50
		}
		add_province_modifier = {
			name = "quarantined_influenza"
			duration = 3650
		}
		every_neighbor_province = {
			limit = {
				owned_by = ROOT
				NOT = { has_province_modifier = quarantined_influenza }
			}
			add_province_modifier = {
				name = "quarantined_influenza"
				duration = 3650
			}
		}
		owner = {
			if = {
				limit = {
					any_owned_province = { has_province_modifier = influenza }
				}
				every_owned_province = {
					limit = {
						has_province_modifier = influenza
					}
					remove_province_modifier = influenza
					add_province_modifier = {
						name = "quarantined_influenza"
						duration = 3650
					}
				}
			}
		}
	}
	option = {
		name = "random_event.EVTOPTB24" # It will soon go away
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				calc_true_if = {
					all_neighbor_province = {
						owned_by = ROOT
						development = 12
					}
					amount = 3
				}
			}
		}
		add_province_modifier = {
			name = "influenza"
			duration = 3650
		}
		if = {
			limit = {
				any_neighbor_province = {
					NOT = { has_province_modifier = quarantined_influenza }
					NOT = { has_province_modifier = influenza }
					NOT = { has_province_flag = province_had_influenza }
				}
			}
			custom_tooltip = random_events.23.b.tt
		}
	}
}

# Iconoclastic Fury
country_event = {
	id = random_event.25
	title = "random_event.EVTNAME25"
	desc = "random_event.EVTDESC25"
	picture = RELIGIOUS_TURMOIL_eventPicture
	
	trigger = {
		is_year = 1500
		NOT = { is_year = 1600 }
		NOT = { has_country_flag = iconoclastic_fury }
		religion_group = christian
		NOT = {
			OR = {
				religion = coptic
				religion = orthodox
			}
		}
		is_religion_enabled = protestant
		capital_scope = {
			continent = europe
		}
		any_owned_province = {
			continent = europe
			religion = catholic
		}
		any_owned_province = {
			continent = europe
			is_reformation_center = no
			OR = {
				religion = protestant
				religion = reformed
				religion = anglican
				religion = hussite
			}
		}
	}

	mean_time_to_happen = {
		months = 2000
		modifier = {
			factor = 0.9
			OR = {
				primary_culture = dutch
				culture_group = french
			}
		}
	}
	
	immediate = {
		set_country_flag = iconoclastic_fury
		hidden_effect = {
			random_owned_province = {
				limit = {
					continent = europe
					is_reformation_center = no
					OR = {
						religion = protestant
						religion = reformed
						religion = anglican
						religion = hussite
					}
				}
				save_event_target_as = target_province
			}
			random_owned_province = {
				limit = {
					continent = europe
					is_reformation_center = no
					OR = {
						religion = protestant
						religion = reformed
						religion = anglican
						religion = hussite
					}
					OR = {
						owner = { religion = catholic }
						NOT = { religion = root }
					}
				}
				save_event_target_as = target_province
			}
		}
	}
	
	option = {
		name = "random_event.EVTOPTA25" # Send guards to stop these vandals!
		ai_chance = { factor = 30 }
		add_prestige = 10
		PAP = {
			add_opinion = { who = ROOT modifier = "stopped_iconoclastic_fury" }
		}
		add_mil_power = -50
		custom_tooltip = random_event.EVTOPTA25.tt.ttt.tttt.ttttt
		hidden_effect = {
			europe = {
				limit = {
					owned_by = root
					OR = {
						religion = protestant
						religion = reformed
						religion = anglican
						religion = hussite
					}
				}
				add_unrest = 10
			}
		}
	}
	option = {
		name = "random_event.EVTOPTB25" # We can't do anything except weather the storm!
		ai_chance = { factor = 20 }
		add_prestige = -25
		add_country_modifier = {
			name = "iconoclastic_fury"
			duration = 3650
		}
	}
	option = {
		name = "random_event.EVTOPTC25" # Time to take the lead and break Papal stranglehold!
		trigger = { NOT = { tag = PAP } }
		goto = target_province
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				religion = catholic
			}
		}
		add_stability = -1
		PAP = {
			add_opinion = { who = ROOT modifier = "allowed_iconoclastic_fury" }
		}
		event_target:target_province = {
			if = {
				limit = {
					owner = {
						OR = {
							religion = protestant
							religion = catholic
						}
					}
				}
				change_religion = protestant
			}
			if = {
				limit = {
					owner = {
						religion = reformed
					}
				}
				change_religion = reformed
			}
			if = {
				limit = {
					owner = {
						religion = anglican
					}
				}
				change_religion = anglican
			}
			if = {
				limit = {
					owner = {
						religion = hussite
					}
				}
				change_religion = hussite
			}
		}
	}
}

# Debased Currency
country_event = {
	id = random_event.26
	title = "EVTNAME9478"
	desc = "EVTDESC9478"
	picture = ECONOMY_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		gold_income_percentage = 0.1
		inflation = 1
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA9478"
		add_inflation = 1
		add_prestige = -5
	}
}

# The Great Fire of [Root.Capital.GetName]
country_event = {
	id = random_event.27
	title = random_event.27.t
	desc = random_event.27.desc
	picture = COUNTRY_COLLAPSE_eventPicture
	is_triggered_only = yes
	trigger = {
		NOT = { has_country_flag = had_capital_fire }
		capital_scope = {
			development = 25
		}
	}
	goto = capital
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = { set_country_flag = had_capital_fire }
		hidden_effect = {
			capital_scope = {
				save_event_target_as = capital
			}
		}
	}
	
	option = {
		name = random_event.27.a
		capital_scope = {
			add_base_tax = -2
			add_base_production = -4
			add_base_manpower = -4
			hidden_effect = {
				if = { limit = { NOT = { base_tax = 1 } } set_base_tax = 1 }
				if = { limit = { NOT = { base_production = 1 } } set_base_production = 1 }
				if = { limit = { NOT = { base_manpower = 1 } } set_base_manpower = 1 }
			}
			add_devastation = 100
		}
	}
}


######### Product Events #######

# Excellent Year
country_event = {
	id = 6418
	title = "EVTNAME6418"
	desc = "EVTDESC6418"
	picture = TRADEGOODS_eventPicture

	is_triggered_only = yes

	trigger = {
		grain = 1
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6418"
		add_yearly_manpower = 0.25
	}
}


# Excellent Vintage
country_event = {
	id = 6419
	title = "EVTNAME6419"
	desc = "EVTDESC6419"
	picture = TRADEGOODS_eventPicture

	

	trigger = {
		wine = 1
		NOT = { has_country_modifier = excellent_vintage }
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6419"
		add_country_modifier = {
			name = "excellent_vintage"
			duration = 730
		}
		add_piety = -0.10
	}
}

# Poor Vintage
country_event = {
	id = 6420 
	title = "EVTNAME6420"
	desc = "EVTDESC6420"
	picture = TRADEGOODS_eventPicture

	trigger = {
		wine  = 1
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6420"
		add_prestige = -5
		add_piety = 0.10
	}
}


# Quality wool
country_event = {
	id = 6421 
	title = "EVTNAME6421"
	desc = "EVTDESC6421"
	picture = TRADEGOODS_eventPicture

	trigger = {
		wool = 1
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6421"
		add_years_of_income = 0.1
	}
}

# Poor Uniforms
country_event = {
	id = 6422
	title = "EVTNAME6422"
	desc = "EVTDESC6422"
	picture = TRADEGOODS_eventPicture

	trigger = {
		cloth = 1 
		NOT = { has_country_modifier = poor_uniforms }
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6422"
		add_country_modifier = {
			name = "poor_uniforms"
			duration = 730
		}
	}
}


# Hardy Seamen
country_event = {
	id = 6423
	title = "EVTNAME6423"
	desc = "EVTDESC6423"
	picture = TRADEGOODS_eventPicture

	trigger = {
		fish =  1
		num_of_ports = 1
		primitives = no
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}


	option = {
		name = "EVTOPTA6423"
		add_navy_tradition = 10
	}
}

# Natives not assisting
country_event = {
	id = 6424
	title = "EVTNAME6424"
	desc = "EVTDESC6424"
	picture = TRADEGOODS_eventPicture

	trigger = {
		fur =  1
		OR = {
			capital_scope = {
				NOT = { continent = north_america }
				NOT = { continent = south_america }
				NOT = { continent = new_world }
			}
			is_former_colonial_nation = yes
			OR = {
				is_subject_of_type = colony
				is_subject_of_type = crown_colony
				is_subject_of_type = private_enterprise
				is_subject_of_type = self_governing_colony
			}
		}
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	
	option = {
		name = "EVTOPTA6424"
		add_years_of_income = -0.1
	}
}


# Salt Crisis
country_event = {
	id = 6425
	title = "EVTNAME6425"
	desc = "EVTDESC6425"
	picture = TRADE_GOODS_FURS_FISH_AND_SALT_eventPicture

	trigger = {
		salt = 1
		NOT = { has_country_modifier = salt_crisis }
	}


	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA6425"
		add_country_modifier = {
			name = "salt_crisis"
			duration = 730
		}
	}
}

# Excellent supplies
country_event = {
	id = 6426
	title = "EVTNAME6426"
	desc = "EVTDESC6426"
	picture = TRADEGOODS_eventPicture

	trigger = {
		naval_supplies = 1
		num_of_ports = 1
		primitives = no
		NOT = { has_country_modifier = good_supplies }
	}


	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}
	option = {
		name = "EVTOPTA6426"
		add_country_modifier = {
			name = "good_supplies"
			duration = 730
		}
	}
}

# Poor Quality Copper
country_event = {
	id = 6427
	title = "EVTNAME6427"
	desc = "EVTDESC6427"
	picture = TRADE_GOODS_METALS_AND_MINING_EQUIPENT_eventPicture

	trigger = {
		copper = 1
		mil_tech = 7
		NOT = { has_country_modifier = poor_copper }
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6427"
		add_country_modifier = {
			name = "poor_copper"
			duration = 730
		}
	}
}

# GOLD RUSH!
country_event = {
	id = 6428
	title = "EVTNAME6428"
	desc = "EVTDESC6428"
	picture = TRADE_GOODS_METALS_AND_MINING_EQUIPENT_eventPicture

	trigger = {
		gold = 1
		NOT = { religion_group = pagan }
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6428"
		if = {
			limit = {
				has_dlc = "Leviathan"
				any_owned_province = {
					has_great_project = {
						type = golden_kremnica
						tier = 2
					}
				}
				NOT = {
					any_owned_province = {
						has_great_project = {
							type = golden_kremnica
							tier = 3
						}
					}
				}
			}
			add_years_of_income = 1.5
			add_inflation = 1
		}
		else_if = {
			limit = {
				any_owned_province = {
					has_great_project = {
						type = golden_kremnica
						tier = 3
					}
				}
			}
			add_years_of_income = 2
			add_inflation = 1
		}
		else = {
			add_years_of_income = 1.0
			add_inflation = 1
		}
	}
}

# Iron ore quality problems
country_event = {
	id = 6429
	title = "EVTNAME6429"
	desc = "EVTDESC6429"
	picture = TRADE_GOODS_METALS_AND_MINING_EQUIPENT_eventPicture

	trigger = {
		iron = 1
		NOT = { has_country_modifier = poor_iron }
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6429"
		add_country_modifier = {
			name = "poor_iron"
			duration = 730
		}
	}
}



# Quality Ivory
country_event = {
	id = 6431
	title = "EVTNAME6431"
	desc = "EVTDESC6431"
	picture = TRADEGOODS_eventPicture

	trigger = {
		ivory = 1
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6431"
		add_prestige = 20
	}
}

# Tea Party
country_event = {
	id = 6432
	title = "EVTNAME6432"
	desc = "EVTDESC6432"
	picture = TRADE_GOODS_PLANTATION_GOODS_IN_WAREHOUSE_eventPicture
	goto = tea_province

	trigger = {
		any_owned_province = {
			trade_goods = tea 
			is_overseas = yes
			is_city = yes
		}
	}
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					trade_goods = tea 
					is_overseas = yes
					is_city = yes
				}
				save_event_target_as = tea_province
			}
		}
	}
	
	option = {
		name = "EVTOPTA6432"
		event_target:tea_province = {
			add_unrest = 10
		}
		
	}
}

# Storms
country_event = {
	id = 6433
	title = "EVTNAME6433N"
	desc = "EVTDESC6433N"
	picture = TRADEGOODS_eventPicture
	goto = chinaware_province

	trigger = {
		chinaware = 1
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					trade_goods = chinaware
				}
				save_event_target_as = chinaware_province
			}
		}
	}
	
	option = {
		name = "EVTOPTA6433N"
		event_target:chinaware_province = {
			add_province_modifier = {
				name = "storms"
				duration = 730
			}			
		}
	}
}


# Harvest failure
country_event = {
	id = 6434
	title = "EVTNAME6434"
	desc = "EVTDESC6434"
	picture = FARMING_eventPicture
	goto = spice_province

	trigger = {
		spices = 1
		any_owned_province = {
			trade_goods = spices
			NOT = { has_province_modifier = harvest_fails }
		}
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					trade_goods = spices
					NOT = { has_province_modifier = harvest_fails }
				}
				save_event_target_as = spice_province
			}
		}
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6434"
		
		event_target:spice_province = {
			add_province_modifier = {
				name = "harvest_fails"
				duration = 730
			}			
		}		
	}
}


# Benign Neglect
country_event = {
	id = 9472
	title = "EVTNAME9472"
	desc = "EVTDESC9472"
	picture = MERCHANTS_TALKING_eventPicture
	goto = benign_neglect_province
	
	trigger = {
		num_of_cities = 20
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_capital = no
					is_city = yes
				}
				save_event_target_as = benign_neglect_province
			}
		}
	}
	
	option = {
		name = "EVTOPTA9472"
		event_target:benign_neglect_province = {
			add_province_modifier = {
				name = "benign_neglect_trade"
				duration = 1825
			}
		
		}
	}
	option = {
		name = "EVTOPTB9472"
		event_target:benign_neglect_province = {
			add_province_modifier = {
				name = "benign_neglect_tax"
				duration = 1825
			}
		
		}		
	}
	option = {
		name = "EVTOPTC9472"
		event_target:benign_neglect_province = {
			add_province_modifier = {
				name = "benign_neglect_manpower"
				duration = 1825
			}
		
		}			

	}
}



country_event = {
	id = 3097
	title = "EVTNAME3097"
	desc = "EVTDESC3097"
	picture = ANGRY_MOB_eventPicture
	goto = jackals_and_vultures_province
	
	trigger = {
		num_of_rebel_armies = 1
		NOT = { religious_unity = 1.0 }
		any_owned_province = {
			unrest = 1
			controlled_by = root
		}
	}
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}	

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					unrest = 1
					controlled_by = root
				}
				save_event_target_as = jackals_and_vultures_province
			}
		}
	}
	
	option = {
		name = "EVTOPTA3097" # Jackals! Vultures!
		
		event_target:jackals_and_vultures_province = {
			add_unrest = 15
		}
	}
}

# Revolt!
country_event = {
	id = 5005
	title = "EVTNAME5005"
	desc = "EVTDESC5005"
	picture = ANGRY_MOB_eventPicture
	goto = revolt_5005_province

	is_triggered_only = yes
	
	trigger = {
		num_of_cities = 2
		any_owned_province = {
			is_capital = no
			unrest = 1
		}
	}
	
	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_capital = no
					unrest = 1
					is_city = yes
				}
				save_event_target_as = revolt_5005_province
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}	
	
	option = {
		name = "EVTOPTA5005" # Ignore them
		event_target:revolt_5005_province = {
			add_province_modifier = {
				name = ignored_unrest
				duration = 1825
			}
		}

	}
	option = {
		name = "EVTOPTB5005" # Lower taxes
		event_target:revolt_5005_province = {
			add_province_modifier = {
				name = lower_taxes_unrest
				duration = 1825
			}
			add_local_autonomy = 20
		}			
	}
}



country_event = {
	id = 5026
	title = "EVTNAME5026"
	desc = "EVTDESC5026"
	picture = PLAGUE_eventPicture
	goto = plague_province

	trigger = {
		grain = 1
		num_of_cities = 2
		any_owned_province = {
			trade_goods = grain
			is_capital = no
		}
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					trade_goods = grain
					is_capital = no
				}
				save_event_target_as = plague_province
			}
		}
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5026"		# We have to do something!
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { years_of_income = 0.2 }
			}
		}
		add_years_of_income = -0.10
	}
	option = {
		name = "EVTOPTB5026"		# There is nothing we can do.
		ai_chance = {
			factor = 45
		}
		event_target:plague_province = {
			add_local_autonomy = 25
			add_province_modifier = {
				name = "plague"
				duration = 1095
			}
		}				
	}
}

country_event = {
	id = 5037
	title = "EVTNAME5037"
	desc = "EVTDESC5037"
	picture = FARMING_eventPicture
	goto = province_in_question

	trigger = {
		grain = 1
	}
	
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					trade_goods = grain
				}		
				save_event_target_as = province_in_question
			}
		}
	}

	option = {
		name = "EVTOPTB5037"		#  Raise taxes
		ai_chance = { factor = 45 }
		event_target:province_in_question = {
			add_base_tax = 1
		}
	}
	option = {
		name = "EVTOPTC5037"		#  Invest in Infrastructure
		ai_chance = { factor = 45 }
		event_target:province_in_question = {
			add_base_production = 1
		}
	}
	option = {
		name = "EVTOPTA5037"		# Invest in a bigger army
		ai_chance = { factor = 55 }
		event_target:province_in_question = {	
			add_base_manpower = 1
		}
	}
}


country_event = {
	id = 5063
	title = "EVTNAME5063"
	desc = "EVTDESC5063"
	picture = COURT_eventPicture
	goto = province_in_question

	trigger = {
		government = monarchy
		any_owned_province = {
			is_city = yes
			is_capital = no
		}
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_city = yes
					is_capital = no
				}
				save_event_target_as = province_in_question
			}
		}
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA5063"		# Side with one family
		event_target:province_in_question = {
			noble_rebels = 1
		}
	}
	option = {
		name = "EVTOPTB5063"		# Let them fight it out.
		trigger = { num_of_cities = 2 }
		ai_chance = { factor = 25 }
		event_target:province_in_question = {
			add_local_autonomy = 25
		}
	}
	option = {
		name = "EVTOPTC5063"		# Try to settle the issue.
		ai_chance = { factor = 25 }
		add_dip_power = -33
	}
}


country_event = {
	id = 6014
	title = "EVTNAME6014"
	desc = "EVTDESC6014"
	picture = FEAST_eventPicture

	trigger = {
		is_month = 8
	}

	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA6014"		# Put into the treasury
		ai_chance = {
			factor = 55
			modifier = {
				factor = 0.5
				NOT = { num_of_cities = 10 }
			}
			modifier = {
				factor = 1.5
				num_of_cities = 20
			}
		}
		add_years_of_income = 0.50
	}
	option = {
		name = "EVTOPTB6014"		# Invest the money
		add_adm_power = 50
		ai_chance = {
			factor = 45
		}
	}
}