namespace = FEE_Portugal_Events

#Luis de Camoes
country_event = {
	id = FEE_Portugal_Events.1
	title = FEE_Portugal_Events.1.T
	desc = FEE_Portugal_Events.1.D
	picture = ADVISOR_eventPicture

	fire_only_once = yes

	trigger = {
		tag = POR
		is_year = 1530
		NOT = { is_year = 1580 }
	}

	mean_time_to_happen = {
		months = 240
	}
	option = {
		name = FEE_Portugal_Events.1.OPT1

		add_prestige_or_monarch_power = { amount = 15 }
		add_stability_or_adm_power = yes
		add_navy_tradition = 5
	}
}

#Sebastianism for free Portugal
country_event = {
	id = FEE_Portugal_Events.2
	title = FEE_Portugal_Events.2.T
	desc = FEE_Portugal_Events.2.D
	picture = SHIP_SAILING_eventPicture

	fire_only_once = yes

	trigger = {
		tag = POR
		is_subject = no
		is_year = 1580
		NOT = { is_year = 1680 }
		OR = {
			AND = {
				has_heir = no
				NOT = {
					dynasty = "de Avis"
				}
			}
			has_regency = yes
			ruler_is_foreigner = yes
		}
	}

	option = {
		#His name is Sebastian, and that's good enough for me.
		name = FEE_Portugal_Events.2.OPT1

		define_ruler = {
			name = "Sebastian"
			dynasty = "de Avis"
			mil = 2
			dip = 3
			adm = 3
			age = 28
			claim = 30
		}
	}

	option = {
		#Send away this impostor!
		name = FEE_Portugal_Events.2.OPT2

		add_legitimacy_equivalent = { amount = 5 republican_tradition = 3 }
		add_country_modifier = {
			name = fee_por_sebastianism
			duration = 1825
		}
	}
}

#Spiceless!
country_event = {
	id = FEE_Portugal_Events.3
	title = FEE_Portugal_Events.3.T
	desc = FEE_Portugal_Events.3.D
	picture = SHIP_SAILING_eventPicture

	fire_only_once = yes

	trigger = {
		tag = POR
		NOT = { exists = BYZ }
		151 = {
			owner = {
				NOT = { religion_group = christian }
			}
		}
	}

	major = yes
	major_trigger = {
		capital_scope = {
			superregion = europe_superregion
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Portugal_Events.3.OPT1

		create_explorer = {
			tradition = 60
		}
		add_country_modifier = {
			name = fee_por_spice_sail
			duration = 10950
		}
		if = {
			limit = {
				capital_scope = {
					has_port = yes
				}
			}
			capital_scope = {
				add_unit_construction = {
					type = light_ship
					amount = 3
					speed = 0.5
					cost = 0
				}
			}
		}
		else = {
			random_owned_province = {
				limit = {
					has_port = yes
				}
				add_unit_construction = {
					type = light_ship
					amount = 3
					speed = 0.5
					cost = 0
				}
			}
		}
	}
}

#The School of Sagres
country_event = {
	id = FEE_Portugal_Events.4
	title = FEE_Portugal_Events.4.T
	desc = FEE_Portugal_Events.4.D
	picture = UNIVERSITY_eventPicture

	fire_only_once = yes

	trigger = {
		tag = POR
		current_age = age_of_discovery
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Portugal_Events.4.OPT1
		add_years_of_income = -0.5

		custom_tooltip = fee_por_henrique_duration_tt
		add_country_modifier = {
			name = fee_por_henrique_naval_reforms
			duration = -1
		}
		define_advisor = {
			type = navigator
			name = "Henry the Navigator"
			skill = 3
			culture = portugese
			religion = catholic
			cost_multiplier = 0.25
		}
	}

	option = {
		name = FEE_Portugal_Events.4.OPT2

		add_legitimacy_equivalent = { amount = 10 republican_tradition = 5 }
	}
}

# A rising star
country_event = {
	id = FEE_Portugal_Events.5
	title = FEE_Portugal_Events.5.T
	desc = FEE_Portugal_Events.5.D
	picture = UNIVERSITY_eventPicture

	fire_only_once = yes

	trigger = {
		tag = POR
		exploration_ideas = 1
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Portugal_Events.5.OPT1

		add_years_of_income = -0.25
		add_country_modifier = {
			name = fee_por_francisco_de_almeida
			duration = -1
		}
		custom_tooltip = fee_por_francisco_custom_tooltip_1
	}

	option = {
		name = FEE_Portugal_Events.5.OPT2

		define_general = {
			name = "Francisco de Almeida"
			shock = 5
			fire = 5
			manuever = 4
			siege = 2
			trait = master_of_arms_personality
		}
		custom_tooltip = fee_por_francisco_custom_tooltip_2
	}

	option = {
		name = FEE_Portugal_Events.5.OPT3

		add_prestige_or_monarch_power = { amount = 10 }
		change_religious_influence_equivalent_fee = { add = 10 }
	}
}

#The Shores of Africa
country_event = {
	id = FEE_Portugal_Events.6
	title = FEE_Portugal_Events.6.T
	desc = FEE_Portugal_Events.6.D
	picture = BIG_ARABIAN_CITY_eventPicture

	fire_only_once = yes

	trigger = {
		tag = POR
		has_country_modifier = fee_por_francisco_de_almeida
		334 = {
			owned_by = ROOT
			has_province_modifier = slaves_raided
		}
		4563 = {
			NOT = {
				owner = {
					ai = no
				}
			}
			owner = {
				capital_scope = {
					region = maghreb_region
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 150
	}

	option = {
		name = FEE_Portugal_Events.6.OPT1
		ai_chance = {
			factor = 50
		}

		add_mil_power = -100
		4563 = {
			owner = {
				add_country_modifier = {
					name = fee_por_portuguese_weaponry
					duration = 5475
				}
				add_opinion = {
					who = ROOT
					modifier = fee_por_portuguese_weaponry
				}
				reverse_add_opinion = {
					who = ROOT
					modifier = fee_por_portuguese_weaponry
				}
			}
		}
		random_list = {
			50 = {
				country_event = {
					id = FEE_Portugal_Events.7
					days = 15
				}
			}
			50 = {
				country_event = {
					id = FEE_Portugal_Events.8
					days = 15
				}
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.6.OPT2
		ai_chance = {
			factor = 50
		}

		add_prestige_or_monarch_power = { amount = 10 }
		4563 = {
			owner = {
				add_opinion = {
					who = ROOT
					modifier = fee_por_failed_diplomacy
				}
				reverse_add_opinion = {
					who = ROOT
					modifier = fee_por_failed_diplomacy
				}
			}
		}
	}
}

#Emir Lends his Aid
country_event = {
	id = FEE_Portugal_Events.7
	title = FEE_Portugal_Events.7.T
	desc = FEE_Portugal_Events.7.D
	picture = GOOD_WITH_MONARCH_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Portugal_Events.7.OPT1

		add_dip_power = 100
	}
}

#Emir's Betrayal
country_event = {
	id = FEE_Portugal_Events.8
	title = FEE_Portugal_Events.8.T
	desc = FEE_Portugal_Events.8.D
	picture = DIPLOMACY_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Portugal_Events.8.OPT1
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				OR = {
					NOT = { stability = 1 }
					NOT = { manpower_percentage = 0.5 }
					war_exhaustion = 1
				}
			}
		}

		4563 = {
			owner = {
				ROOT = {
					declare_war_with_cb = {
						casus_belli = cb_vassalize_mission
						who = PREV
					}
				}
			}
		}
		add_country_modifier = {
			name = fee_por_avenge_betrayal
			duration = -1
			desc = FEE_UNTIL_WARS_ENDS_TT
		}
	}

	option = {
		name = FEE_Portugal_Events.8.OPT2
		ai_chance = {
			factor = 50
		}

		add_prestige = -15
	}
}

#To Africa!
country_event = {
	id = FEE_Portugal_Events.9
	title = FEE_Portugal_Events.9.T
	desc = FEE_Portugal_Events.9.D
	picture = EXPLORERS_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		has_country_modifier = fee_por_francisco_de_almeida
		any_province = {
			superregion = india_superregion
			has_discovered = ROOT
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	immediate = {
		hidden_effect = { set_country_flag = por_to_africa }
	}

	option = {
		name = FEE_Portugal_Events.9.OPT1
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0
				NOT = { treasury = 250 }
			}
		}

		add_treasury = -250
		create_explorer = {
			tradition = 60
		}
		1196 = { add_permanent_claim = ROOT }
		1201 = { add_permanent_claim = ROOT }
		1186 = { add_permanent_claim = ROOT }
		if = {
			limit = {
				capital_scope = {
					has_port = yes
				}
			}
			capital_scope = {
				add_unit_construction = {
					type = heavy_ship
					cost = 0
					speed = 0.25
					amount = 3
				}
				if = {
					limit = {
						any_neighbor_province = {
							has_port = yes
							owned_by = ROOT
						}
					}
					random_neighbor_province = {
						limit = {
							has_port = yes
							owned_by = ROOT
						}
						add_unit_construction = {
							type = light_ship
							cost = 0
							speed = 0.25
							amount = 7
						}
					}
				}
			}
		}
		else = {
			random_owned_province = {
				limit = { has_port = yes }
				add_unit_construction = {
					type = heavy_ship
					cost = 0
					speed = 0.25
					amount = 3
				}
			}
			random_owned_province = {
				limit = { has_port = yes }
				add_unit_construction = {
					type = light_ship
					cost = 0
					speed = 0.25
					amount = 7
				}
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.9.OPT2
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0
				NOT = { treasury = 125 }
			}
		}

		1196 = { add_permanent_claim = ROOT }
		1201 = { add_permanent_claim = ROOT }
		1186 = { add_permanent_claim = ROOT }
		if = {
			limit = {
				capital_scope = {
					has_port = yes
				}
			}
			capital_scope = {
				add_unit_construction = {
					type = heavy_ship
					cost = 0
					speed = 0.25
					amount = 3
				}
			}
		}
		else = {
			random_owned_province = {
				limit = { has_port = yes }
				add_unit_construction = {
					type = heavy_ship
					cost = 0
					speed = 0.25
					amount = 3
				}
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.9.OPT3
		ai_chance = {
			factor = 33
		}

		add_prestige_or_monarch_power = { amount = 5 }
	}
}

#Looking to India
country_event = {
	id = FEE_Portugal_Events.10
	title = FEE_Portugal_Events.10.T
	desc = FEE_Portugal_Events.10.D
	picture = COLONIZATION_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		has_country_flag = por_to_africa
		has_country_modifier = fee_por_francisco_de_almeida
		any_owned_province = {
			OR = {
				area = quelimane_area
				area = central_swahili_coast_area
			}
		}
		4413 = {
			owner = {
				ai = yes
				num_of_owned_provinces_with = {
					value = 2
					is_core = ROOT
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 24
	}

	option = {
		name = FEE_Portugal_Events.10.OPT1
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				NOT = { years_of_income = 1 }
			}
		}

		add_years_of_income = -1
		4413 = {
			owner = {
				add_opinion = {
					who = ROOT
					modifier = fee_por_diplomacy
				}
				reverse_add_opinion = {
					who = ROOT
					modifier = fee_por_diplomacy
				}
			}
			add_core = ROOT
			cede_province = ROOT

			add_base_production = 3
			add_or_upgrade_fort_building = yes
		}
	}

	option = {
		name = FEE_Portugal_Events.10.OPT2
		ai_chance = {
			factor = 50
		}

		add_mil_power = -100
		4413 = {
			add_core = ROOT
			owner = {
				add_opinion = {
					who = ROOT
					modifier = fee_por_persuasion
				}
				reverse_add_opinion = {
					who = ROOT
					modifier = fee_por_persuasion
				}
			}
		}
	}
}

#The Zamorin
country_event = {
	id = FEE_Portugal_Events.11
	title = FEE_Portugal_Events.11.T
	desc = FEE_Portugal_Events.11.D
	picture = DIPLOMACY_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		has_country_modifier = fee_por_francisco_de_almeida
		owns = 4413
		NOT = { owns = 534 }
		534 = {
			owner = {
				ai = yes
			}
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Portugal_Events.11.OPT1
		ai_chance = {
			factor = 33
		}

		add_mil_power = -50
		534 = {
			owner = {
				reverse_add_casus_belli = {
					type = cb_trade_conflict
					target = ROOT
				}
			}
		}
		4413 = {
			heavy_ship = ROOT
			heavy_ship = ROOT
			heavy_ship = ROOT
		}
	}

	option = {
		name = FEE_Portugal_Events.11.OPT2
		ai_chance = {
			factor = 33
		}

		add_dip_power = -50
		534 = {
			owner = {
				random_rival_country = {
					add_opinion = {
						who = ROOT
						modifier = fee_por_alliance
					}
					reverse_add_opinion = {
						who = ROOT
						modifier = fee_por_alliance
					}
				}
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.11.OPT3
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0
				NOT = { years_of_income = 0.25 }
			}
		}

		add_years_of_income = -0.25
		1340 = { #Coromandel
			add_trade_modifier = {
				who = ROOT
				duration = 9125
				power = -20
				key = fee_por_bows_local_rulers
			}
		}
		534 = {
			owner = {
				add_opinion = {
					who = ROOT
					modifier = fee_por_bows_local_rulers
				}
				reverse_add_opinion = {
					who = ROOT
					modifier = fee_por_bows_local_rulers
				}
			}
		}
	}
}

#Almeida's Son Killed!
country_event = {
	id = FEE_Portugal_Events.12
	title = FEE_Portugal_Events.12.T
	desc = FEE_Portugal_Events.12.D
	picture = DEATH_OF_HEIR_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		has_country_modifier = fee_por_francisco_de_almeida
		any_owned_province = {
			superregion = india_superregion
		}
	}

	mean_time_to_happen = {
		months = 60
	}

	option = {
		name = FEE_Portugal_Events.12.OPT1
		ai_chance = {
			factor = 33
		}

		custom_tooltip = fee_por_killed_1
		define_admiral = {
			shock = 5
			fire = 5
			manuever = 5
			siege = 0
			name = "Alfonso de Albuquerque"
		}
		remove_country_modifier = fee_por_francisco_de_almeida
		country_event = {
			id = FEE_Portugal_Events.13
		}
	}

	option = {
		name = FEE_Portugal_Events.12.OPT2
		ai_chance = {
			factor = 33
		}

		custom_tooltip = fee_por_killed_2
		remove_country_modifier = fee_por_francisco_de_almeida
		add_country_modifier = {
			name = fee_por_vendettas_sanctioned
			duration = 9125
		}
	}

	option = {
		name = FEE_Portugal_Events.12.OPT3
		ai_chance = {
			factor = 33
		}

		custom_tooltip = fee_por_killed_3
		add_country_modifier = {
			name = fee_por_pursuing_enemies
			duration = 9125
		}
		random_country = {
			limit = {
				4346 = { is_strongest_trade_power = ROOT }
			}
			reverse_add_casus_belli = {
				type = cb_insult
				target = ROOT
			}
		}
	}
}
#Almeida Defies the King
country_event = {
	id = FEE_Portugal_Events.13
	title = FEE_Portugal_Events.13.T
	desc = FEE_Portugal_Events.13.D
	picture = BAD_WITH_MONARCH_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Portugal_Events.13.OPT1
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				OR = {
					NOT = { stability = 0 }
				}
			}
			modifier = {
				factor = 2
				OR = {
					stability = 1
					manpower = 3
				}
			}
		}

		add_stability = -1
		add_manpower = -3
	}

	option = {
		name = FEE_Portugal_Events.13.OPT2
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				OR = {
					NOT = { prestige = 20 }
					NOT = { legitimacy_equivalent = 50 }
				}
			}
			modifier = {
				factor = 2
				OR = {
					prestige = 40
					legitimacy_equivalent = 50
				}
			}
		}

		add_legitimacy_equivalent = { amount = -20 republican_tradition = -10 }
		add_prestige = -20
	}
}

#Securing our African Interests
country_event = {
	id = FEE_Portugal_Events.14
	title = FEE_Portugal_Events.14.T
	desc = FEE_Portugal_Events.14.D
	picture = BURGHER_ESTATE_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		has_estate = estate_burghers
		num_of_owned_provinces_with = {
			value = 2
			any_trade_node_member_province = {
				province_id = 1466 #Ivory Coast
			}
		}
	}

	mean_time_to_happen = {
		months = 120
	}

	option = {
		name = FEE_Portugal_Events.14.OPT1

		add_mil_power = -100
		add_estate_burghers_loyalty_effect = yes
		custom_tooltip = securing_african_interest_TT
		hidden_effect = {
			1466 = {
				every_trade_node_member_province = {
					limit = { owned_by = ROOT }
					add_or_upgrade_fort_building = yes
				}
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.14.OPT2

		add_estate_loyalty = {
			estate = estate_burghers
			loyalty = -15
		}
	}
}

#Sephardic Jews Arrive in Portugal
country_event = {
	id = FEE_Portugal_Events.15
	title = FEE_Portugal_Events.15.T
	desc = FEE_Portugal_Events.15.D
	picture = RELIGIOUS_MIGRANTS_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		NOT = { exists = GRA }
		exists = CAS
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Portugal_Events.15.OPT1
		ai_chance = {
			factor = 33
		}

		add_stability = -1
		add_country_modifier = {
			name = fee_por_jewish_liberties_granted
			duration = -1
		}
		add_ruler_modifier = {
			name = fee_por_prospering_jewish_communities
			duration = -1
		}
		capital_scope = {
			add_base_tax = 3
		}
		random_owned_province = {
			limit = { region = iberia_region }
			change_religion = jewish
		}
		CAS = {
			add_opinion = {
				who = ROOT
				modifier = fee_por_jewish_welcome
			}
			reverse_add_opinion = {
				who = ROOT
				modifier = fee_por_jewish_welcome
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.15.OPT2
		ai_chance = {
			factor = 33
		}

		add_stability = -1
		add_yearly_manpower = 1
		add_country_modifier = {
			name = fee_por_jewish_liberties_granted
			duration = -1
		}
		add_ruler_modifier = {
			name = fee_por_jewish_weaponsmiths
			duration = -1
		}
		random_owned_province = {
			limit = {
				region = iberia_region
				NOT = { is_capital_of = ROOT }
			}
			change_religion = jewish
		}
		CAS = {
			add_opinion = {
				who = ROOT
				modifier = fee_por_jewish_welcome
			}
			reverse_add_opinion = {
				who = ROOT
				modifier = fee_por_jewish_welcome
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.15.OPT3
		ai_chance = {
			factor = 33
		}

		add_stability_or_adm_power = yes
		if = {
			limit = {
				religion = catholic
			}
			change_religious_influence_equivalent_fee = { add = 20 }
		}
		CAS = {
			add_opinion = {
				who = ROOT
				modifier = fee_por_jewish_rejected
			}
			reverse_add_opinion = {
				who = ROOT
				modifier = fee_por_jewish_rejected
			}
		}
	}
}

#Expulsion of the Jews?
country_event = {
	id = FEE_Portugal_Events.16
	title = FEE_Portugal_Events.16.T
	desc = FEE_Portugal_Events.16.D
	picture = RELIGIOUS_MIGRANTS_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		has_country_modifier = fee_por_jewish_liberties_granted
	}

	mean_time_to_happen = {
		months = 120
	}

	option = {
		name = FEE_Portugal_Events.16.OPT1
		ai_chance = {
			factor = 33
		}

		add_years_of_income = 1
		add_stability = -1
		remove_country_modifier = fee_por_jewish_liberties_granted
		add_country_modifier = {
			name = fee_por_jewish_expulsion
			duration = 9125
		}
	}

	option = {
		name = FEE_Portugal_Events.16.OPT2
		ai_chance = {
			factor = 33
		}

		remove_country_modifier = fee_por_jewish_liberties_granted
		add_country_modifier = {
			name = fee_por_jewish_conversion_attempts
			duration = 9125
		}
	}

	option = {
		name = FEE_Portugal_Events.16.OPT3
		ai_chance = {
			factor = 33
		}

		add_stability = -1
		random_owned_province = {
			limit = { region = iberia_region }
			spawn_rebels = {
				size = 2
				type = catholic_rebels
			}
		}
		random_owned_province = {
			limit = { region = iberia_region }
			spawn_rebels = {
				size = 2
				type = catholic_rebels
			}
		}
		random_owned_province = {
			limit = { region = iberia_region }
			spawn_rebels = {
				size = 2
				type = catholic_rebels
			}
		}
	}
}

#Securing Malacca Trade
country_event = {
	id = FEE_Portugal_Events.17
	title = FEE_Portugal_Events.17.T
	desc = FEE_Portugal_Events.17.D
	picture = TRADE_GOODS_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		owns_core_province = 596
	}

	mean_time_to_happen = {
		months = 60
	}

	option = {
		name = FEE_Portugal_Events.17.OPT1
		ai_chance = {
			factor = 50
		}

		add_years_of_income = -0.5
		add_dip_power = -100
		596 = {
			add_base_production = 3
			if = {
				limit = {
					province_has_center_of_trade_of_level = 3
				}
				add_province_modifier = {
					name = fee_por_malacca_restored
					duration = -1
				}
			}
			else = {
				create_or_add_center_of_trade_level_fee = { level = 1 }
			}
		}
		add_estate_burghers_loyalty_effect = yes
	}

	option = {
		name = FEE_Portugal_Events.17.OPT2
		ai_chance = {
			factor = 50
		}

		add_years_of_income = 0.1
		add_estate_loyalty = {
			estate = estate_burghers
			loyalty = -10
		}
	}
}

#Portuguese Arrivals in Japan
country_event = {
	id = FEE_Portugal_Events.18
	title = FEE_Portugal_Events.18.T
	desc = FEE_Portugal_Events.18.D
	picture = TRADEGOODS_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		1012 = {
			has_discovered = ROOT
			owner = {
				capital_scope = {
					region = japan_region
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 24
	}

	option = {
		name = FEE_Portugal_Events.18.OPT1
		ai_chance = {
			factor = 50
		}

		add_years_of_income = 0.1
		add_mil_power = -50
		1376 = {
			add_trade_modifier = {
				who = ROOT
				duration = 18250
				power = 20
				key = fee_por_japan_weapons_trafficking
			}
		}
		1012 = {
			owner = {
				add_mil_power = 100
				add_country_modifier = {
					name = fee_por_portuguese_weaponry_japan
					duration = 18250
				}
				add_opinion = {
					who = ROOT
					modifier = fee_por_japan_weapons_trafficking
				}
				reverse_add_opinion = {
					who = ROOT
					modifier = fee_por_japan_weapons_trafficking
				}
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.18.OPT2
		ai_chance = {
			factor = 50
		}

		add_prestige_or_monarch_power = { amount = 10 }
	}
}

#Ferdinand Magellan
country_event = {
	id = FEE_Portugal_Events.19
	title = FEE_Portugal_Events.19.T
	desc = FEE_Portugal_Events.19.D
	picture = ADVISOR_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		is_year = 1550
		exists = SPA
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Portugal_Events.19.OPT1
		ai_chance = {
			factor = 33
		}

		define_explorer = {
			fire = 3
			shock = 3
			manuever = 6
			siege = 1
			name = "Ferdinand Magellan"
		}
		add_country_modifier = {
			name = fee_por_magellan_expedition
			duration = 5475
		}
		add_opinion = {
			who = SPA
			modifier = fee_por_magellan_portuguese
		}
		reverse_add_opinion = {
			who = SPA
			modifier = fee_por_magellan_portuguese
		}
	}

	option = {
		name = FEE_Portugal_Events.19.OPT2
		ai_chance = {
			factor = 33
		}

		define_advisor = {
			type = navigator
			name = "Ferdinand Magellan"
			skill = 3
			cost_multiplier = 0.25
		}
	}

	option = {
		name = FEE_Portugal_Events.19.OPT3
		ai_chance = {
			factor = 33
		}

		add_opinion = {
			who = SPA
			modifier = fee_por_magellan_spanish
		}
		reverse_add_opinion = {
			who = SPA
			modifier = fee_por_magellan_spanish
		}
	}
}

#Societas Jesu in Asia
country_event = {
	id = FEE_Portugal_Events.20
	title = FEE_Portugal_Events.20.T
	desc = FEE_Portugal_Events.20.D
	picture = RELIGIOUS_TURMOIL_eventPicture

	fire_only_once = yes
	trigger = {
		tag = POR
		any_owned_province = {
			superregion = india_superregion
		}
		1361 = {
			any_trade_node_member_province = {
				owned_by = ROOT
			}
		}
		current_age = age_of_reformation
		religion = catholic
	}

	option = {
		name = FEE_Portugal_Events.20.OPT1
		ai_chance = {
			factor = 33
		}

		add_years_of_income = -0.1
		change_religious_influence_equivalent_fee = { add = 10 }
		add_country_modifier = {
			name = fee_por_asian_inquisition
			duration = -1
		}
		define_advisor = {
			type = inquisitor
			skill = 3
			cost_multiplier = 0.50
			name = "Francis Xavier"
		}
		random_owned_province = {
			limit = {
				superregion = india_superregion
			}
			change_religion = ROOT
		}
		1361 = {
			random_trade_node_member_province = {
				limit = { owned_by = ROOT }
				change_religion = ROOT
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.20.OPT2
		ai_chance = {
			factor = 33
		}

		change_religious_influence_equivalent_fee = { add = 5 }
		add_country_modifier = {
			name = fee_por_portuguese_jesuits
			duration = -1
		}
		random_owned_province = {
			limit = {
				superregion = india_superregion
			}
			change_religion = ROOT
		}
		1361 = {
			random_trade_node_member_province = {
				limit = { owned_by = ROOT }
				change_religion = ROOT
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.20.OPT3
		ai_chance = {
			factor = 33
		}

		add_stability_or_adm_power_per_stab = { amount = 1 }
		change_religious_influence_equivalent_fee = { remove = 10 }
		add_country_modifier = {
			name = fee_por_rejected_jesuits
			duration = -1
		}
	}
}

# Discovery of Ceylon
country_event = {
	id = FEE_Portugal_Events.21
	title = FEE_Portugal_Events.21.T
	desc = FEE_Portugal_Events.21.D
	picture = EXPLORERS_eventPicture

	fire_only_once = yes

	trigger = {
		tag = POR
		OR = {
			current_age = age_of_discovery
			current_age = age_of_reformation
		}
		is_subject = no
		has_discovered = 572
		NOT = { owns_or_subject_of = 572 }
		572 = {
			owner = {
				primary_culture = sinhala
			}
		}
	}

	mean_time_to_happen = {
		months = 6
	}

	immediate = {
		hidden_effect = {
			save_event_target_as = proposal_initiator
			572 = {
				owner = {
					save_event_target_as = current_owner
				}
			}
		}
	}

	option = {
		name = FEE_Portugal_Events.21.OPT1

		event_target:current_owner = {
			country_event = { id = FEE_Portugal_Events.22 days = 365 }
		}
	}
}

# Portuguese Proposal
country_event = {
	id = FEE_Portugal_Events.22
	title = FEE_Portugal_Events.22.T
	desc = FEE_Portugal_Events.22.D
	picture = DIPLOMACY_eventPicture

	major = yes
	major_trigger = {
		tag = event_target:proposal_initiator
	}

	is_triggered_only = yes

	trigger = {
		owns = 572
		event_target:proposal_initiator = {
			exists = yes
		}
	}

	option = {
		name = FEE_Portugal_Events.22.OPT1

		trigger = {
			is_subject = no
			event_target:proposal_initiator = {
				is_subject = no
			}
		}

		ai_chance = {
			factor = 0.8
		}

		add_years_of_income = -1
		custom_tooltip = FEE_Portugal_Events.22.TT
		hidden_effect = {
			event_target:proposal_initiator = {
				set_country_flag = forced_tributary_state
				create_subject = {
					subject = ROOT
					subject_type = tributary_state
				}
				clr_country_flag = forced_tributary_state
			}
		}
		every_owned_province = {
			limit = {
				OR = {
					area = lanka_area
					area = south_lanka_area
				}
				has_port = yes
			}
			add_province_modifier = {
				name = fee_por_portuguese_protection
				duration = -1
			}
		}
		hidden_effect = {
			country_event = { id = FEE_Portugal_Events.23 days = 3650 }
		}
	}

	option = {
		name = FEE_Portugal_Events.22.OPT2

		ai_chance = {
			factor = 0.2
			modifier = {
				factor = 4
				ruler_total_stats = { amount = 12 }
			}
		}

		add_prestige_or_monarch_power = { amount = 25 }
		reverse_add_opinion = {
			who = event_target:proposal_initiator
			modifier = fee_por_portuguese_proposal_refused
		}
		hidden_effect = {
			event_target:proposal_initiator = {
				country_event = { id = FEE_Portugal_Events.24 }
			}
		}
	}
}

# Colombo Fort
country_event = {
	id = FEE_Portugal_Events.23
	title = FEE_Portugal_Events.23.T
	desc = FEE_Portugal_Events.23.D
	picture = FORT_eventPicture

	is_triggered_only = yes

	trigger = {
		owns = 572
	}

	option = {
		name = FEE_Portugal_Events.23.OPT1

		572 = {
			add_base_manpower = 1
			if = {
				limit = {
					NOT = { has_fort_building_trigger = yes }
				}
				add_building = fort_15th
			}
			add_permanent_province_modifier = {
				name = fee_por_colombo_fort
				duration = -1
			}
		}
		hidden_effect = {
			event_target:proposal_initiator = {
				country_event = { id = FEE_Portugal_Events.25 }
			}
		}
	}
}

# Ceylon's Refusal
country_event = {
	id = FEE_Portugal_Events.24
	title = FEE_Portugal_Events.24.T
	desc = FEE_Portugal_Events.24.D
	picture = BAD_WITH_MONARCH_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Portugal_Events.24.OPT1

		ai_chance = {
			factor = 0.5
			modifier = {
				factor = 2
				army_size = event_target:current_owner
			}
			modifier = {
				factor = 3
				event_target:current_owner = { is_subject = no }
			}
		}

		add_casus_belli = {
			target = event_target:current_owner
			type = cb_vassalize_mission
			months = 360
		}
	}

	option = {
		name = FEE_Portugal_Events.24.OPT2

		ai_chance = {
			factor = 0.5
			modifier = {
				factor = 5
				event_target:current_owner = { is_subject = yes }
			}
		}

		add_prestige = -10
	}
}

# Colombo Trade Port
country_event = {
	id = FEE_Portugal_Events.25
	title = FEE_Portugal_Events.25.T
	desc = FEE_Portugal_Events.25.D
	picture = TRADEGOODS_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Portugal_Events.25.OPT1

		572 = {
			add_trade_modifier = {
				who = ROOT
				key = fee_por_kotte_trade_modifier
				duration = -1
				power = 10
			}
		}
	}
}