########################################
# Major Flavor Events                  #
########################################

namespace = flavor_spa
normal_or_historical_nations = yes

# The Iberian Wedding
country_event = {
	id = flavor_spa.3716
	title = "flavor_spa.EVTNAME3716"
	desc = "flavor_spa.EVTDESC3716"
	picture = DIPLOMACY_eventPicture

	major = yes
	
	fire_only_once = yes
	
	
	trigger = {
		AND = {
			tag = CAS
			NOT = { exists = SPA }
		}
		is_year = 1450
		NOT = { is_year = 1530 }
		is_subject = no
		ARA = {
			exists = yes
			ai = yes
			was_player = no
			is_subject = no
			is_neighbor_of = ROOT
		}
		NOT = { war_with = ARA }
		OR = {
			AND = {
				is_female = yes
				ARA = { is_female = no }
			}
			AND = {
				is_female = no
				ARA = { is_female = yes }
			}
			ARA = {
				has_regency = yes
			}
		}
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.1
			ARA = { has_regency = no }
		}
	}
	
	
	option = {		# Let us bind their Dynasty to ours
		name = "flavor_spa.EVTOPTA3716"
		ai_chance = { factor = 90 }
		create_union = ARA
		add_opinion = {
			who = ARA
			modifier = spa_iberian_wedding
		}
		ARA = {
			add_opinion = {
				who = ROOT
				modifier = spa_iberian_wedding
			}
		}
		random_owned_province = {
			limit = {
				is_capital = no
			}
			spawn_rebels = {
				type = noble_rebels
				size = 3
			}
		}
		every_known_country = {
			limit = {
				marriage_with = ARA
			}
			add_opinion = {
				who = ROOT
				modifier = spa_iberian_wedding_negative
			}
		}
	}
	option = {		# No let us marry a local talent instead
		name = "flavor_spa.EVTOPTB3716"
		ai_chance = { factor = 10 }
		add_stability = 1
		ARA = {
			add_opinion = {
				who = ROOT
				modifier = spa_declined_iberian_wedding
			}
		}
	}
}

# Torquemada and the Conversion of the Moors
country_event = {
	id = flavor_spa.3150
	title = "flavor_spa.EVTNAME3150"
	desc = "flavor_spa.EVTDESC3150"
	picture = ADVISOR_eventPicture
	
	fire_only_once = yes

	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		NOT = { exists = GRA }
		religion = catholic
		is_at_war = no
		any_owned_province = {
			region = iberian_peninsula
			religion_group = muslim
		}
	}

	mean_time_to_happen = {
		months = 12
	}
	
	immediate = {
		hidden_effect = {
			set_country_flag = spa_holy_inquisition
		}
	}

	option = {		# Let us make a clean sweep for the Glory of God
		name = "flavor_spa.EVTOPTA3150"
		define_advisor = {
			type = inquisitor
			name = "Tomás de Torquemada"
			location = 215 # Castilla La Vieja 
			skill = 1
		}
		
		every_owned_province = {
			limit = {
				region = iberian_peninsula
				religion_group = muslim
			}
			change_religion = catholic
			add_province_modifier = {
				name = forced_conversion
				duration = 3650
			}
		}	
		random_country = {
			limit = {
				religion_group = muslim
				any_owned_province = {
					sea_zone = {
						any_neighbor_province = {
							owned_by = ROOT
						}
					}
				}
			}
			country_event = {  id = flavor_spa.3151 days = 10 tooltip = "flavor_spa.EVTTOOLTIP3150" }
		}
		set_country_flag = torquemada_expelled
		add_reform_desire = 0.02

	}
	option = {		# Toleration is key to the nation's prosperity
		name = "flavor_spa.EVTOPTC3150"
		ai_chance = { factor = 0 }
		add_reform_desire = -0.01
		add_stability = 1
		add_ruler_modifier = {
			name = religious_tolerance
		}
	}
}

# Expulsion of the Moors
country_event = {
	id = flavor_spa.3151
	title = "flavor_spa.EVTNAME3151"
	desc = "flavor_spa.EVTDESC3151"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes

	option = {		# They are a welcome addition
		name = "flavor_spa.EVTOPTA3151"
		ai_chance = { factor = 90 }
		random_owned_province = {
			add_base_tax = 1
		}
	}

}

# Christopher Columbus
country_event = {
	id = flavor_spa.1
	title = "flavor_spa.EVTNAME1"
	desc = "flavor_spa.EVTDESC1"
	picture = SHIP_SAILING_eventPicture

	is_triggered_only = yes
	
	trigger = {
		adm_tech = 49
		NOT = { has_global_flag = columbus_happened }
		OR = {
			NOT = {
				north_america = {
					has_discovered = ROOT
				}
			}
			NOT = {
				south_america = {
					has_discovered = ROOT
				}
			}
			NOT = {
				any_known_country = {
					north_america = {
						has_discovered = PREV
					}
				}
			}
			NOT = {
				any_known_country = {
					south_america = {
						has_discovered = PREV
					}
				}
			}
		}
	}

	option = {		# Reject his proposal
		name = "flavor_spa.EVTOPTA1"
		ai_chance = { factor = 10 }
	}
	option = {		# Hire Columbus
		name = "flavor_spa.EVTOPTB1"
		ai_chance = { factor = 90 }
		add_years_of_income = -0.25
		define_explorer = {
			name = "Cristóbal Colón"
			fire = 2
			shock = 2
			manuever = 6
			siege = 0
		}
	}
}

# Discovery of the New World!
country_event = {
	id = flavor_spa.1005
	title = "flavor_spa.EVTNAME1005"
	desc = "flavor_spa.EVTDESC1005"
	picture = COLONIZATION_eventPicture
	
	
	fire_only_once = yes
	
	trigger = {
		NOT = { has_global_flag = new_world_discovered }
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		OR = {
			north_america = {
				has_discovered = ROOT
			}
			south_america = {
				has_discovered = ROOT
			}
		}
	}

	mean_time_to_happen = {
		months = 1
	}
	
	immediate = {
		set_global_flag = new_world_discovered
	}

	option = {		# Now so have we!
		name = "flavor_spa.EVTOPTA1005"
		add_prestige = 50
	}
}

# Ignacio de Loyola
country_event = {
	id = flavor_spa.1011
	title = "flavor_spa.EVTNAME1011"
	desc = "flavor_spa.EVTDESC1011"
	picture = ADVISOR_eventPicture


	fire_only_once = yes

	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		religion = catholic
		is_year = 1521
		NOT = { is_year = 1556 }
	}

	mean_time_to_happen = {
		months = 100
	}
	

	option = {		# An Excellent Minister!
		name = "EXCELLENTMINISTER"
		add_adm_power = 50
		add_papal_influence = 25
		define_advisor = {
			type = theologian 
			name = "Ignacio de Loyola"
			skill = 1
		}
	}
}

# The Quest for the New World
country_event = {
	id = flavor_spa.3152
	title = "flavor_spa.EVTNAME3152"
	desc = "flavor_spa.EVTDESC3152"
	picture = EXPLORERS_eventPicture

	fire_only_once = yes	

	trigger = {
		adm_tech = 49
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		religion = catholic
		OR = {
			north_america = {
				has_discovered = ROOT
			}
			south_america = {
				has_discovered = ROOT
			}
		}

	}

	mean_time_to_happen = {
		months = 64
	}


	option = {		# A New Reconquista! We need Conquistadors
		name = "flavor_spa.EVTOPTA3152"
		ai_chance = { factor = 45 }
		define_conquistador = {
			fire = 2
			shock = 2
			manuever = 5
		}
		add_mil_power = 50
	}
	option = {		# A New Reconquista! We need Explorers
		name = "flavor_spa.EVTOPTB3152"
		ai_chance = { factor = 45 }
		define_explorer = {
			fire = 2
			shock = 2
			manuever = 5
		}
		add_mil_power = 50
	}

}

# Crusade against Oran
country_event = {
	id = flavor_spa.1000
	title = "flavor_spa.EVTNAME1000"
	desc = "flavor_spa.EVTDESC1000"
	picture = BATTLE_eventPicture

	fire_only_once = yes	
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		NOT = {
			iberian_peninsula = {
				religion_group = muslim
			}
			is_claim = 337
			is_core = 337
		}
		337 = {
			owner = {
				religion_group = muslim
				NOT = { alliance_with = ROOT }
				NOT = { is_subject_of = ROOT }
			}
		}
	}

	mean_time_to_happen = {
		months = 100
	}
	

	option = {		# Expansion in North Africa seems prosperous
		name = "flavor_spa.EVTOPTA1000"
		337 = {
			add_claim = ROOT
		}
	}
}

# Laws of Burgos
country_event = {
	id = flavor_spa.1001
	title = "flavor_spa.EVTNAME1001"
	desc = "flavor_spa.EVTDESC1001"
	picture = REFORM_eventPicture
	
	fire_only_once = yes	
	
	trigger = {
		tag = SPA

		is_year = 1500
		NOT = { is_year = 1600 }
		num_of_colonial_subjects = 3
		
	}

	mean_time_to_happen = {
		months = 100
	}
	

	option = { # Enforce these laws!
		name = "flavor_spa.EVTOPTA1001"
		ai_chance = { factor = 75 }
		
		every_subject_country = {
			limit = {
				is_colonial_nation_of = ROOT
			}
			add_country_modifier = {
				name = laws_of_the_burgos
				duration = -1
			}
		}
		
	}
	option = { # We rule by the right of Conqueror!
		name = "flavor_spa.EVTOPTB1001"
		ai_chance = { factor = 25 }
		add_prestige = 25
	}
}


# Casa de Contratación
country_event = {
	id = flavor_spa.1003
	title = "flavor_spa.EVTNAME1003"
	desc = "flavor_spa.EVTDESC1003"
	picture = COLONIZATION_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		num_of_colonists = 2
	}

	mean_time_to_happen = {
		months = 120
	}


	option = {		# We should establish it
		name = "flavor_spa.EVTOPTA1003"
		ai_chance = { factor = 90 }
		add_country_modifier = {
			name = casa_de_contratacion
			duration = -1
		}
	}
}

# The Sun Never Sets
country_event = {
	id = flavor_spa.1004
	title = "flavor_spa.EVTNAME1004"
	desc = "flavor_spa.EVTDESC1004"
	picture = COURT_eventPicture
	
	
	fire_only_once = yes
	trigger = {

		tag = SPA

		europe = {
			country_or_vassal_holds = ROOT
		}		
		north_america = {
			country_or_vassal_holds = ROOT
		}		
		south_america = {
			country_or_vassal_holds = ROOT
		}
		africa = {
			country_or_vassal_holds = ROOT
		}
		asia = {
			country_or_vassal_holds = ROOT
		}
	}

	mean_time_to_happen = {
		months = 64
	}
	

	option = {		# We truly rule the world!
		name = "flavor_spa.EVTOPTA1004"
		add_prestige = 25
		add_legitimacy = 25
		add_papal_influence = 100
	}
}

# The Trade Center of Sevilla
country_event = {
	id = flavor_spa.3153
	title = "flavor_spa.EVTNAME3153"
	desc = "flavor_spa.EVTDESC3153"
	picture = MERCHANTS_TALKING_eventPicture

	fire_only_once = yes

	trigger = {
		tag = SPA

		owns = 224	# Andalucia
		num_of_colonial_subjects = 3
	}

	mean_time_to_happen = {
		months = 120
	}
	

	option = {		# We now have control of our Oversea Trade
		name = "flavor_spa.EVTOPTA3153"
		224 = {
			add_province_modifier = {
				name = port_to_the_new_world
				duration = -1
			}
		}
	}
}

# The Fuggers
country_event = {
	id = flavor_spa.3154
	title = "flavor_spa.EVTNAME3154"
	desc = "flavor_spa.EVTDESC3154"
	picture = COURT_eventPicture
	
	fire_only_once = yes

	trigger = {
		tag = SPA
		is_year = 1500
		NOT = { is_year = 1600 }
	}

	mean_time_to_happen = {
		months = 240
	}
	

	option = {		# Let the Fuggers run our Finances
		name = "flavor_spa.EVTOPTA3154"
		add_ruler_modifier = {
			name = the_fuggers
		}
	}
	option = {		# Turn the Fuggers offer down
		name = "flavor_spa.EVTOPTB3154"
		add_legitimacy = 5
	}
}

# The Communeros
country_event = {
	id = flavor_spa.3155
	title = "flavor_spa.EVTNAME3155"
	desc = "flavor_spa.EVTDESC3155"
	picture = ANGRY_MOB_eventPicture


	fire_only_once = yes

	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		is_year = 1500
		NOT = { is_year = 1600 }
	}

	mean_time_to_happen = {
		months = 300
	}
	

	option = {		# Crush the Rebellion
		name = "flavor_spa.EVTOPTA3155"
		every_owned_province = {
			limit = {
				region = iberian_peninsula
			}
			add_unrest = 10
		}
	}
	option = {		# Give concessions to the Peasantry
		name = "flavor_spa.EVTOPTB3155"
		add_ruler_modifier = {
			name = concessions_to_the_peasantry
		}
	}
}


# State Bankruptcy
country_event = {
	id = flavor_spa.3158	
	title = "flavor_spa.EVTNAME3158"
	desc = "flavor_spa.EVTDESC3158"
	picture = BANKRUPTCY_eventPicture


	fire_only_once = yes


	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		is_bankrupt = yes
		NOT = { is_year = 1590 }
	}

	mean_time_to_happen = {
		months = 12
	}
	

	option = {		# Do we ever learn from history?
		name = "flavor_spa.EVTOPTA3158"
		add_legitimacy = -5
	}
}

# The Expulsion of the Moriscos
country_event = {
	id = flavor_spa.3160	
	title = "flavor_spa.EVTNAME3160"
	desc = "flavor_spa.EVTDESC3160"
	picture = ANGRY_MOB_eventPicture
	
	
	fire_only_once = yes

	trigger = {
		tag = SPA
		religion = catholic
		NOT = { primary_culture = andalucian }
		NOT = { exists = GRA }
		is_year = 1600
		
		any_owned_province = {
			culture = andalucian	
		}

		
	}

	mean_time_to_happen = {
		months = 140
	}
	


	option = {		# Force them to become Good Catholic Spaniards
		name = "flavor_spa.EVTOPTA3160"
		ai_chance = { factor = 90 }
		add_papal_influence = 25

		every_owned_province = {
			limit = {
				culture = andalucian	
			}
			add_unrest = 5
		}
		random_country = {
			limit = {
				religion_group = muslim
				any_owned_province = {
					sea_zone = {
						any_neighbor_province = {
							owned_by = ROOT
						}
					}
				}
			}
			country_event = {  id = flavor_spa.3161 days = 10 tooltip = "flavor_spa.EVTTOOLTIP3160" }
		}
	}
	option = {		# Let them be as they are needed for the economy
		name = "flavor_spa.EVTOPTB3160"
		add_papal_influence = -25
	}
}

# Expulsion of the Moriscos
country_event = {
	id = flavor_spa.3161
	title = "flavor_spa.EVTNAME3161"
	desc = "flavor_spa.EVTDESC3161"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes

	option = {		# They are a welcome addition
		name = "flavor_spa.EVTOPTA3161"
		ai_chance = { factor = 90 }
		random_owned_province = {
			add_base_tax = 1
		}
	}

}

# Baltasar de Zuniga
country_event = {
	id = flavor_spa.3710
	title = "flavor_spa.EVTNAME3710"
	desc = "flavor_spa.EVTDESC3710"
	picture = ADVISOR_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		is_year = 1591
		NOT = { is_year = 1622 }
	}

	mean_time_to_happen = {
		months = 100
	}



	option = {			# An Excellent Minister!
		name = "EXCELLENTMINISTER"
		add_adm_power = 40
		add_dip_power = 40
		add_mil_power = 40
		define_advisor = {
			type = statesman
			name = "Baltasar de Zuniga"
			skill = 3
		}
	}
}

# Olivares
country_event = {
	id = flavor_spa.3711
	title = "flavor_spa.EVTNAME3711"
	desc = "flavor_spa.EVTDESC3711"
	picture = ADVISOR_eventPicture
	
	
	fire_only_once = yes
	
	trigger = {
		tag = SPA
		is_year = 1617
		NOT = { is_year = 1645 }
	}

	mean_time_to_happen = {
		months = 64
	}

	immediate = {
		set_country_flag = SPA_had_event_3711
	}

	option = {			# An Excellent Minister!
		name = "EXCELLENTMINISTER"
		add_adm_power = 100
		add_dip_power = 100
		add_mil_power = 100
		define_advisor = {
			type = statesman
			name = "Conde-Duque Olivares"
			skill = 3
		}
	}
}

# The Portuguese Crown
country_event = {
	id = flavor_spa.3162	
	title = "flavor_spa.EVTNAME3162"
	desc = "flavor_spa.EVTDESC3162"
	picture = COURT_eventPicture

	fire_only_once = yes

	trigger = {
		tag = SPA
		marriage_with = POR
		is_subject = no
		POR = {
			exists = yes
			ai = yes
			was_player = no
			is_subject = no
			has_regency = yes
			religion = ROOT
			NOT = { is_rival = SPA }
			has_opinion = { who = ROOT value = 150 }
		}
		is_year = 1550
		NOT = { is_year = 1650 }
	}

	mean_time_to_happen = {
		months = 2000
	}
	

	option = {		# One King, Two Kingdoms
		name = "flavor_spa.EVTOPTB3162"
		ai_chance = { factor = 90 }
		create_union = POR
	}
	option = {		# The extra burden is not worth it
		name = "flavor_spa.EVTOPTC3162"
		ai_chance = { factor = 10 }
		add_prestige = 1
	}
}


# State Bankruptcy
country_event = {
	id = flavor_spa.3164	
	title = "flavor_spa.EVTNAME3164"
	desc = "flavor_spa.EVTDESC3164"
	picture = BANKRUPTCY_eventPicture


	fire_only_once = yes
	trigger = {
		tag = SPA
		is_year = 1590
		is_bankrupt = yes
	}

	mean_time_to_happen = {
		months = 12
	}
	
	option = {		# Do we ever learn from history?
		name = "flavor_spa.EVTOPT3164"
		add_prestige = -5
	}
}

# Epidemic Plague
country_event = {
	id = flavor_spa.3165	
	title = "flavor_spa.EVTNAME3165"
	desc = "flavor_spa.EVTDESC3165"
	picture = PLAGUE_eventPicture


	fire_only_once = yes
	trigger = {
		tag = SPA
		num_of_cities = 4
		iberian_peninsula = {
			owned_by = ROOT
		}
		is_year = 1550
		NOT = { is_year = 1700 }		
	
	}

	mean_time_to_happen = {
		months = 120
	}
	

	option = {		# We will recover
		name = "flavor_spa.EVTOPTA3165"
		add_country_modifier = { 
			name = severe_plague 
			duration = 1825
		}		
	}
}

# The Iberian Revolts
country_event = {
	id = flavor_spa.3169
	title = "flavor_spa.EVTNAME3169"
	desc = "flavor_spa.EVTDESC3169"
	picture = ANGRY_MOB_eventPicture
	
	fire_only_once = yes

	trigger = {
		tag = SPA

		num_of_cities = 10
		
		is_year = 1600
		NOT = { is_year = 1700 }


		NOT = { primary_culture = catalan }
		any_owned_province = {
			culture = catalan
		}
	}

	mean_time_to_happen = {
		months = 400
	}
	

	option = {		# Put it down!
		name = "flavor_spa.EVTOPTA3169"
		every_owned_province = {
			limit = {
				culture = catalan
			}
			add_unrest = 20
		}
	}
	option = {		# Appease them!
		name = "flavor_spa.EVTOPTB3169"
		every_owned_province = {
			limit = {
				culture = catalan
			}
			add_local_autonomy = 25
		}
	}
}

# National revolt in Portugal
country_event = {
	id = flavor_spa.3168	
	title = "flavor_spa.EVTNAME3168"
	desc = "flavor_spa.EVTDESC3168"
	picture = DIPLOMACY_eventPicture
	
	fire_only_once = yes

	trigger = {
		tag = SPA

		num_of_cities = 10
		
		is_year = 1600
		NOT = { is_year = 1700 }


		NOT = { primary_culture = portugese }
		any_owned_province = {
			culture = portugese
		}
	}

	mean_time_to_happen = {
		months = 400
	}
	
	option = {		# Put it down!
		name = "flavor_spa.EVTOPTA3168"
		every_owned_province = {
			limit = {
				culture = portugese
			}
			add_unrest = 20
		}
	}
	option = {		# Appease them!
		name = "flavor_spa.EVTOPTB3168"
		every_owned_province = {
			limit = {
				culture = portugese
			}
			add_local_autonomy = 25
		}
	}	
	
}

# The Italian Revolts
country_event = {
	id = flavor_spa.3170
	title = "flavor_spa.EVTNAME3170"
	desc = "flavor_spa.EVTDESC3170"
	picture = ANGRY_MOB_eventPicture
	
	fire_only_once = yes

	trigger = {
		tag = SPA

		num_of_cities = 10
		
		is_year = 1600
		NOT = { is_year = 1700 }


		any_owned_province = {
			region = italian_region
		}
	}

	mean_time_to_happen = {
		months = 400
	}
	

	option = {		# Put it down!
		name = "flavor_spa.EVTOPTA3170"
		every_owned_province = {
			limit = {
				region = italian_region
			}
			add_unrest = 20
		}
	}
	option = {		# Appease them!
		name = "flavor_spa.EVTOPTB3170"
		every_owned_province = {
			limit = {
				region = italian_region
			}
			add_local_autonomy = 25
		}
	}	
	

}

# Giulio Alberoni
country_event = {
	id = flavor_spa.3712
	title = "flavor_spa.EVTNAME3712"
	desc = "flavor_spa.EVTDESC3712"
	picture = ADVISOR_eventPicture
	
	
	fire_only_once = yes
	
	trigger = {
		tag = SPA
		is_year = 1694
		NOT = { is_year = 1752 }
	}

	mean_time_to_happen = {
		months = 150
	}

	
	option = {			# An Excellent Minister!
		name = "EXCELLENTMINISTER"
		add_dip_power = 100
		define_advisor = {
			type = statesman
			name = "Giulio Alberoni"
			skill = 1
		}
	}
}

# José Monino
country_event = {
	id = flavor_spa.3094
	title = "flavor_spa.EVTNAME3094"
	desc = "flavor_spa.EVTDESC3094"
	picture = ADVISOR_eventPicture
	
	
	fire_only_once = yes
	
	trigger = {
		tag = SPA
		is_year = 1758
		NOT = { is_year = 1808 }
	}

	mean_time_to_happen = {
		months = 120
	}
	
	option = {			# An Excellent Minister!
		name = "EXCELLENTMINISTER"
		add_adm_power = 100
		define_advisor = {
			type = statesman
			name = "José Monino"
			skill = 3
		}
	}
}

# The Constitution of 1812
country_event = {
	id = flavor_spa.3095
	title = "flavor_spa.EVTNAME3095"
	desc = "flavor_spa.EVTDESC3095"
	picture = DEBATE_REPUBLICAN_eventPicture
	
	
	fire_only_once = yes
	
	trigger = {
		tag = SPA
		is_year = 1800
		NOT = { government = constitutional_monarchy }
		government = monarchy
	}

	mean_time_to_happen = {
		months = 10
	}

	option = {		# Follow the Cortes
		name = "flavor_spa.EVTOPTA3095"
		ai_chance = { factor = 75 }
		change_government = constitutional_monarchy
	}
	option = {		# Resist these liberals!
		name = "flavor_spa.EVTOPTB3095"
		ai_chance = { factor = 25 }
		add_stability = -1
	}
}



########################################
# Minor Flavor Events                  #
########################################

# Miguel de Cervantes
country_event = {
	id = flavor_spa.1100
	title = "flavor_spa.EVTNAME1100"
	desc = "flavor_spa.EVTDESC1100"
	picture = ADVISOR_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = SPA
		is_year = 1577
		NOT = { is_year = 1616 }
	}

	mean_time_to_happen = {
		months = 100
	}
	
	option = {		# Excellent
		name = "EXCELLENT"
		add_dip_power = 50
		
	}
}

# Tomás Luis de Victoria
country_event = {
	id = flavor_spa.1101
	title = "flavor_spa.EVTNAME1101"
	desc = "flavor_spa.EVTDESC1101"
	picture = THEATRE_eventPicture
	
	fire_only_once = yes
	trigger = {
		tag = SPA
		is_year = 1578
		NOT = { is_year = 1611 }
	}

	mean_time_to_happen = {
		months = 100
	}
	
	immediate = {
		set_country_flag = SPA_had_event_1101
	}

	option = {		# Excellent
		name = "EXCELLENT"
		add_prestige = 25
	}
}

########################################
# The Italian Wars
########################################

# The Italian Wars
country_event = {
	id = flavor_spa.1007
	title = "flavor_spa.EVTNAME1007"
	desc = "flavor_spa.EVTDESC1007"
	picture = LAND_MILITARY_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		tag = SPA
		exists = FRA
		is_year = 1490
		NOT = { is_year = 1590 }
		NOT = { alliance_with = FRA }
		NOT = { is_subject_of = FRA }
		NOT = { war_with = FRA }
		italian_region = {
			is_part_of_hre = yes
		}
		italian_region = {
			owned_by = FRA
		}
	}
	
	


	mean_time_to_happen = {
		months = 100
	}
	
	

	option = {		# Claim all French land in Italy!
		name = "flavor_spa.EVTOPTA1007"
		ai_chance = { factor = 90 }
		FRA = {
			add_opinion = {
				who = ROOT
				modifier = claimed_italy
			}
			every_owned_province = {
				limit = {
					region = italian_region
				}
				add_claim = ROOT
			}
			hidden_effect = {
				country_event = { id = flavor_spa.1008 days = 10 }
			}
		}
	}
	option = {		# Italy lies outside our sphere of interest
		name = "flavor_spa.EVTOPTB1007"
		ai_chance = { factor = 10 }
		add_prestige = -10
	}
}




# The Italian Wars
country_event = {
	id = flavor_spa.1008
	title = "flavor_spa.EVTNAME1008"
	desc = "flavor_spa.EVTDESC1008"
	picture = MILITARY_CAMP_eventPicture
	
	is_triggered_only = yes
	
	option = {		# Then counter-claim all ADJECTIVE provinces!
		name = "flavor_spa.EVTOPTA1008"
		ai_chance = { factor = 90 }
		FROM = {
			every_owned_province = {
				limit = {
					region = italian_region
				}
				add_claim = ROOT
			}
			hidden_effect = {
				country_event = { id = flavor_spa.1009 days = 10 }
			}
		}
	}
	option = {		# We should back down in Italy
		name = "flavor_spa.EVTOPTB1008"
		ai_chance = { factor = 10 }
		add_prestige = -10
	}
}

# The Italian Wars
country_event = {
	id = flavor_spa.1009
	title = "flavor_spa.EVTNAME1009"
	desc = "flavor_spa.EVTDESC1009"
	picture = MILITARY_CAMP_eventPicture
	
	is_triggered_only = yes
	
	option = {		# How dare they?! Italy is ours!
		name = "flavor_spa.EVTOPTA1009"
		add_opinion = {
			who = FROM
			modifier = claimed_italy
		}
	}
}

###################################
# Additional Flavor Events
# Scripted by Henrik Lohmander
###################################

#Valladolid Debate
country_event = {
	id = flavor_spa.2
	title = "flavor_spa.2.t"
	desc = "flavor_spa.2.d"
	picture = UNIVERSITY_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		religion = catholic
		is_year = 1540
		NOT = { is_year = 1570 }
		num_of_colonial_subjects = 3 #colonial aristocracy exists
		OR = {
			north_america = {
				country_or_vassal_holds = ROOT
			}		
			south_america = {
				country_or_vassal_holds = ROOT
			}
		}
		owns = 215 #Valladolid
	}
	
	mean_time_to_happen = {
		months = 90
	}
	
	

	option = {		# Allow Sepúlveda's arguments to shape our policies
		name = "flavor_spa.2.a"
		ai_chance = {
			factor = 15
			modifier = {
				factor = 2
				has_idea_group = religious_ideas
			}
		}
		add_country_modifier = {
			name = "valladolid_sepulveda_motherland"
			duration = 3650
		}
		every_subject_country = {
			limit = {
				is_colonial_nation_of = ROOT
			}
			add_country_modifier = {
				name = "valladolid_sepulveda"
				duration = 3650
			}
		}
	}
	option = {		# Inconclusive result
		name = "flavor_spa.2.b"
		ai_chance = { factor = 70 }
		add_prestige = 10 #For holding the debate
	}
	option = {		# Let Las Casas Arguments shape our policies
		name = "flavor_spa.2.c"
		ai_chance = {
			factor = 15
			modifier = {
				factor = 2
				has_idea_group = humanist_ideas
			}
		}
		every_subject_country = {
			limit = {
				is_colonial_nation_of = ROOT
			}
			add_country_modifier = {
				name = "valladolid_las_casas"
				duration = 3650
			}
			add_opinion = {
				who = ROOT
				modifier = "angered_colonial_land_owners"
			}
		}
	}
}

#Alhambra Decree
country_event = {
	id = flavor_spa.3
	title = "flavor_spa.3.t"
	desc = "flavor_spa.3.d"
	picture = REFORM_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		NOT = { exists = GRA }
		religion = catholic
		has_idea = spanish_inquisition
		is_at_war = no
		is_year = 1480
		NOT = {
			is_year = 1540
		}
	}
	
	mean_time_to_happen = {
		months = 180
	}
	

	option = {		# Extradition or Conversion
		name = "flavor_spa.3.a"
		ai_chance = {
			factor = 70
		}
		add_country_modifier = {
			name = "alhambra_decree"
			duration = 3650
		}
		PAP = {
			add_opinion = {
				who = ROOT
				modifier = "alhambra_decree_opinion"
			}
		}
	}
	option = {		# Let them Stay
		name = "flavor_spa.3.b"
		ai_chance = {
			factor = 30
			modifier = {
				factor = 2
				has_idea_group = humanist_ideas
			}
		}
		add_prestige = 10
	}
}

# Unification of Spain / Nueva Planta Decrees
country_event = {
	id = flavor_spa.4
	title = "flavor_spa.4.t"
	desc = "flavor_spa.4.d"
	picture = ELECTION_REPUBLICAN_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		tag = SPA #This one requires you to actually be Spain
		OR = {
			government = constitutional_monarchy
			government = constitutional_republic
		}
		is_at_war = no
		NOT = { has_country_modifier = decentralization_modifier }
		owns_core_province = 1749
		owns_core_province = 206
		owns_core_province = 210
		owns_core_province = 220
		owns_core_province = 213
		owns_core_province = 214
		owns_core_province = 208
		owns_core_province = 217
		NOT = { exists = CAS }
		NOT = { exists = ARA }
		NOT = { exists = NAV }
		NOT = { exists = GAL }
		NOT = { exists = LON }
	}
	
	mean_time_to_happen = {
		months = 1	#Should trigger shortly after becoming a constitutional state.
	}
	

	option = {		# One Cortes for a united Spain
		name = "flavor_spa.4.a"
		ai_chance = {
			factor = 90
		}
		add_adm_power = -50
		add_country_modifier = {
			name = "unification_of_spain"
			duration = -1
		}
	}
	option = {		# Continue to be the ruler of all Spains
		name = "flavor_spa.4.b"
		ai_chance = {
			factor = 10
		}
		add_country_modifier = {
			name = "cortes_defended"
			duration = 3650
		}
		if = {
			limit = {
				has_dlc = "Common Sense"
			}
			every_owned_province = {
				limit = {
					OR = {
						province_id = 1749
						province_id = 206
						province_id = 210
						province_id = 220
						province_id = 213
						province_id = 214
						province_id = 208
						province_id = 217
					}
					has_seat_in_parliament = no
				}
				set_seat_in_parliament = yes #Has to placate all the local Cortes from now on.
			}
		}
		if = {
			limit = {
				NOT = { has_dlc = "Common Sense" }
			}
			every_owned_province = {
				limit = {
					OR = {
						province_id = 1749
						province_id = 206
						province_id = 210
						province_id = 220
						province_id = 213
						province_id = 214
						province_id = 208
						province_id = 217
					}
					is_capital = no
				}
				add_local_autonomy = 50
			}
		}
	}
}

# Grammar of the Castilian Language (localized to whatever culture formed Spain)
country_event = {
	id = flavor_spa.5
	title = "flavor_spa.5.t"
	desc = "flavor_spa.5.d"
	picture = BIG_BOOK_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		tag = SPA
		is_year = 1490
		num_of_cities = 25
	}
	
	mean_time_to_happen = {
		months = 150
	}
	

	option = {		# Promote the use of Castilian Language in government
		name = "flavor_spa.5.a"
		ai_chance = {
			factor = 90
		}
		add_ruler_modifier = {
			name = "castilian_grammar"
		}
	}
	option = {		# We must respect the many cultures of Spain
		name = "flavor_spa.5.b"
		ai_chance = {
			factor = 10
		}
		add_ruler_modifier = {
			name = "promote_regional_languages"
		}
	}
}

# Sólo Madrid es corte
country_event = {
	id = flavor_spa.6
	title = "flavor_spa.6.t"
	desc = "flavor_spa.6.d"
	picture = CITY_DEVELOPMENT_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		tag = SPA
		owns_core_province = 217 #Madrid
		NOT = { capital = 217 } #Madrid
		num_of_cities = 25
		government = monarchy
		is_year = 1520
		NOT = { is_year = 1580 }
	}
	
	mean_time_to_happen = {
		months = 180
	}
	

	option = {		# Move the Court to Madrid
		name = "flavor_spa.6.a"
		ai_chance = {
			factor = 90
			modifier = {
				factor = 0
				NOT = { primary_culture = castillian }
			}
		}
		set_capital = 217
		217 = {
			add_province_modifier = {
				name = "solo_madrid_es_corte"
				duration = 3650
			}
		}
	}
	option = {		# X remains a fine capital.
		name = "flavor_spa.6.b"
		ai_chance = {
			factor = 10
		}
		if = {
			limit = { NOT = { stability = 3 } }
			add_stability = 1
		}
		if = {
			limit = { stability = 3 }
			add_prestige = 15
		}
	}
}

# War of Las Alpujarras
country_event = {
	id = flavor_spa.7
	title = "flavor_spa.7.t"
	desc = "flavor_spa.7.d"
	picture = BORDER_TENSION_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		religion = catholic
		NOT = { is_year = 1600 } #Resurgent Granada unlikely
		has_country_flag = spa_holy_inquisition
		NOT = { exists = GRA }
		owns = 223 #Granada
		any_owned_province = {
			NOT = { has_province_modifier = forced_conversion }
			region = iberian_peninsula
			culture = andalucian
			is_core = GRA
		}
		OR = {
			has_country_flag = torquemada_expelled
			AND = {
				NOT = { has_country_flag = torquemada_expelled }
				any_owned_province = {
					is_core = GRA
					has_missionary = yes #Persecution despite choosing tolerance
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 60
	}
	
	immediate = {
		set_country_flag = alpujarras_revolt_happened
		hidden_effect = {
			random_owned_province = {
				limit = {
					region = iberian_peninsula
					is_core = GRA
					OR = {
						has_building = fort_15th
						has_building = fort_16th
						has_building = fort_17th
						has_building = fort_18th
						province_id = 223
					}
				}
				set_province_flag = alpujarras_centre_of_revolt
			}
			every_owned_province = {
				limit = {
					region = iberian_peninsula
					is_core = GRA
					NOT = { has_province_flag = alpujarras_centre_of_revolt }
				}
				set_province_flag = alpujarras_revolt
			}
		}
	}
	
	option = {		# Ok.
		name = "flavor_spa.7.a"
		add_stability = -1
		random_owned_province = {
			limit = {
				has_province_flag = alpujarras_centre_of_revolt
			}
			if = {
				limit = { NOT = { religion = sunni } }
				change_religion = sunni #Crypto-Muslims
			}
			spawn_rebels = {
				type = nationalist_rebels
				leader = "Abén Umayyad"
				friend = GRA
				size = 2
				win = yes
			}
			clr_province_flag = alpujarras_centre_of_revolt
		}
		every_owned_province = {
			limit = {
				has_province_flag = alpujarras_revolt
			}
			if = {
				limit = { NOT = { religion = sunni } }
				change_religion = sunni #Crypto-Muslims
			}
			spawn_rebels = {
				type = nationalist_rebels
				friend = GRA
				size = 1
			}
			clr_province_flag = alpujarras_revolt
		}
	}
}

#Fate of the Kingdom of Granada
country_event = {
	id = flavor_spa.8
	title = "flavor_spa.8.t"
	desc = "flavor_spa.8.d"
	picture = MILITARY_CAMP_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		has_country_flag = alpujarras_revolt_happened
		NOT = { has_country_flag = end_of_granada }
		NOT = { exists = GRA }
		owns = 223 #Granada
		NOT = {
			any_owned_province = {
				is_core = GRA
				controlled_by = REB
			}
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {		# Expulsion or conversion!
		name = "flavor_spa.8.a"
		ai_chance = {
			factor = 1
		}
		set_country_flag = end_of_granada
		add_stability = -2
		every_owned_province = {
			limit = {
				is_core = GRA
			}
			change_religion = catholic
			change_culture = castillian
			remove_core = GRA
		}
		#Repeat of effect from earlier persecutions:
		random_country = {
			limit = {
				religion_group = muslim
				any_owned_province = {
					sea_zone = {
						any_neighbor_province = {
							owned_by = ROOT
						}
					}
				}
			}
			country_event = {  id = flavor_spa.3151 days = 10 tooltip = "flavor_spa.EVTTOOLTIP3150" }
		}
	}
	option = {		# We must mend these wounds not cut off the limb itself.
		name = "flavor_spa.8.b"
		if = {
			limit = { NOT = { stability = 3 } }
			add_stability = 1
		}
		if = {
			limit = { stability = 3 }
			every_owned_province = {
				limit = {
					is_core = GRA
				}
				add_unrest = -2
			}
		}
		ai_chance = {
			factor = 0
		}
	}
}

# New Testament Translated into Spanish
country_event = {
	id = flavor_spa.9
	title = "flavor_spa.9.t"
	desc = "flavor_spa.9.d"
	picture = BIG_BOOK_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		is_religion_enabled = protestant
		government = monarchy
		religion = catholic
		is_year = 1530
		NOT = { is_year = 1560 }
		NOT = {
			iberian_peninsula = {
				is_reformation_center = yes
			}
		}
		NOT = {
			num_of_owned_provinces_with = {
				value = 4
				region = iberian_peninsula
				OR = {
					religion = reformed
					religion = protestant
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 90
	}
	
	option = {		# Best to nip this in the bud.
		name = "flavor_spa.9.a"
		ai_chance = {
			factor = 9
			modifier = {
				factor = 0.1
				has_idea_group = humanist_ideas
			}
		}
		add_ruler_modifier = {
			name = "supressing_spanish_protestantism"
		}
	}
	option = {		# Let us not stifle free thought, this is a fine humanist work.
		name = "flavor_spa.9.b"
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				has_country_modifier = counter_reformation
			}
		}
		add_country_modifier = {
			name = "spanish_bible_translation"
			duration = 7200
		}
	}
}

# Ottoman Encroachment in the Mediterrenean
# Deposed Hafsid ruler seeks Spanish Aid
country_event = {
	id = flavor_spa.10
	title = "flavor_spa.10.t"
	desc = "flavor_spa.10.d"
	picture = NAVAL_MILITARY_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		OR = {
			AND = {
				tag = CAS
				NOT = { exists = SPA }
			}
			tag = SPA
		}
		religion = catholic
		OR = {
			NOT = { exists = TUN }
			TUN = { vassal_of = ROOT }
		}
		TUR = {
			NOT = { alliance_with = ROOT }
			NOT = { war_with = ROOT }
			num_of_cities = 40
			NOT = { religion_group = christian }
			owns = 341 #Tunis
		}
	}
	
	mean_time_to_happen = {
		months = 24
	}
	
	option = {		# We must act to contain this threat!
		name = "flavor_spa.10.a"
		ai_chance = {
			factor = 1
		}
		TUR = {
			add_opinion = {
				who = ROOT
				modifier = supporting_tunisian_claimant
			}
		}
		341 = {
			add_claim = ROOT
		}
	}
	option = {		# Our interests lie elsewhere.
		name = "flavor_spa.10.b"
		add_prestige = -5
		TUR = {
			add_opinion = {
				who = ROOT
				modifier = turned_down_tunisian_claimant
			}
		}
		ai_chance = {
			factor = 0
		}
	}
}

# Reforming the Colonial Administration (Bourbon Reforms)
country_event = {
	id = flavor_spa.11
	title = "flavor_spa.11.t"
	desc = "flavor_spa.11.d"
	picture = GOOD_WITH_MONARCH_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		tag = SPA
		is_year = 1700
		OR = {
			government = constitutional_monarchy
			government = enlightened_despotism
		}
		num_of_colonial_subjects = 3
	}
	
	mean_time_to_happen = {
		months = 150
	}
	
	option = {		# Reform our colonial administration.
		name = "flavor_spa.11.a"
		ai_chance = {
			factor = 1
		}
		add_adm_power = -75
		add_country_modifier = {
			name = "spa_new_colonial_reforms"
			duration = -1
		}
		every_subject_country = {
			limit = {
				is_colonial_nation_of = ROOT
			}
			add_country_modifier = {
				name = "spa_new_colonial_reforms_subject"
				duration = 7200
			}
			add_opinion = {
				who = ROOT
				modifier = "spa_colonial_reforms"
			}
		}
	}
	option = {		# Let us not rock the boat.
		name = "flavor_spa.11.b"
		ai_chance = {
			factor = 0
		}
		every_subject_country = {
			limit = {
				is_colonial_nation_of = ROOT
			}
			add_liberty_desire = -5
			add_opinion = {
				who = ROOT
				modifier = "colonial_privileges_kept"
			}
		}
	}
}

# Supression of the Society of Jesus
country_event = {
	id = flavor_spa.12
	title = "flavor_spa.12.t"
	desc = "flavor_spa.12.d"
	picture = POPE_PREACHING_eventPicture
	
	fire_only_once = yes
	
	
	trigger = {
		tag = SPA 
		religion = catholic
		num_of_colonial_subjects = 3
		is_year = 1750
		OR = {
			government = constitutional_monarchy
			government = enlightened_despotism
		}
		has_country_modifier = the_societas_jesu
	}
	
	mean_time_to_happen = {
		months = 150
	}
	
	option = {		#Expel all Jesuits and auction of their property - Sacrifice tech and missionary strength of colonial vassals for a one time money boost post 1750.
		name = "flavor_spa.12.a"
		ai_chance = {
			factor = 1
		}
		add_years_of_income = 0.25 #Auctioning of Reductions and other property
		add_prestige = -10
		remove_country_modifier = the_societas_jesu
		every_subject_country = {
			limit = {
				is_colonial_nation_of = ROOT
				religion = catholic
			}
			every_owned_province = {
				limit = { has_province_modifier = jesuit_mission }
				remove_province_modifier = jesuit_mission
			}
			add_years_of_income = 0.25 #Auctioning of Reductions and other property
			add_country_modifier = {
				name = "jesuits_expelled" #Long term effects of expulsion
				duration = -1
			}
			add_liberty_desire = -5 #Jesuits support colonial autonomy.
		}
	}
	option = {		# Their contributions to our Society has been too great to measure.
		name = "flavor_spa.12.b"
		add_prestige = 25
		ai_chance = {
			factor = 0
		}
	}
}