gc_por_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
	}
	potential = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
		is_random_new_world = no
	}
	has_country_shield = yes
	
	
	gc_por_portugal_discovers_south_america = {
		icon = mission_establish_high_seas_navy
		required_missions = { gc_por_discover_african_coast }
		position = 2
		completed_by = 1501.1.1
		
		provinces_to_highlight = {
			colonial_region = colonial_brazil
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			has_discovered = ROOT
		}
		
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = miss_discover_brazil
				colonial_brazil = {
					has_discovered = ROOT
				}
			}
			custom_trigger_tooltip = {
				tooltip = miss_colonize_brazil
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 1
					colonial_region = colonial_brazil
					is_city = yes
				}
			}
		}
	
		effect = {
			add_country_modifier = {
				name = "por_brazil_colonial"
				duration = 5475
			}
			if = { 
				limit = { has_dlc = "Domination" }
				change_innovativeness = 2
			}
			else = { add_adm_power = 50 }
		}
	}
	gc_por_establishes_foothold_brazil = {
		icon = mission_iberian_conquistador
		required_missions = { gc_por_portugal_discovers_south_america }
		completed_by = 1540.1.1
		
		provinces_to_highlight = {
			colonial_region = colonial_brazil
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			has_discovered = ROOT
		}
		
		trigger = { 
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 10
				colonial_region = colonial_brazil
				is_city = yes
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "por_brazil_tariffs"
				duration = 7300
			}
		}
	}
	gc_por_bandeirantes = {
		icon = mission_brazilian_bandeirantes
		required_missions = { gc_por_establishes_foothold_brazil }
		
		provinces_to_highlight = {
			OR = {
				area = minas_gerais_area
				area = rio_de_janeiro_area
				area = sao_paolo_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			if = {
				limit = {
					has_dlc = "Dharma"
				}
				763 = {
					province_has_center_of_trade_of_level = 2
				}
			}
			else = {
				763 = {
					OR = {
						has_building = marketplace
						has_building = trade_depot
						has_building = stock_exchange
					}
				}
			}
			minas_gerais_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			rio_de_janeiro_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			sao_paolo_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			if = {
				limit = {
					765 = {
						NOT = {
							trade_goods = gold
						}
					}
				}
				765 = {
					change_trade_goods = gold
				}
			}
			765 = {
				add_province_modifier = {
					name = "por_minas_gerais"
					duration = -1
				}
			}
			set_country_flag = por_bandeirantes_flag
			custom_tooltip = por_bandeirantes_tooltip
		}
	}
	gc_por_jesuits = {
		icon = mission_establish_jesuit_missions
		required_missions = { gc_por_bandeirantes }
		position = 5
		provinces_to_highlight = {
			colonial_region = colonial_brazil
		}
		
		trigger = {
			if = {
				limit = {
					has_dlc = "Golden Century"
					religion = catholic
				}
				custom_trigger_tooltip = {
					tooltip = port_jesuits_tooltip
					num_of_states_owned_or_owned_by_non_sovereign_subjects_with = {
						holy_order = jesuit_order
						colonial_region = colonial_brazil
						value = 7
					}
				}
			}
			else = {
				custom_trigger_tooltip = {
					tooltip = port_jesuits_alternative_tooltip
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						religion = ROOT
						colonial_region = colonial_brazil
						value = 35
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					religion = catholic
				}
				add_country_modifier = {
					name = "por_padroado"
					duration = -1
				}
			}
			else = {
				add_dip_power = 100
			}
		}
	}
	
	gc_por_ceylon = {
		icon = mission_portuguese_ceylon
		required_missions = { gc_por_malabar }
		position = 7
		provinces_to_highlight = {
			OR = {
				area = lanka_area
				area = south_lanka_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			lanka_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			south_lanka_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			add_mercantilism = 3
			
			if = { 
				limit = { has_dlc = "Domination" }
				add_country_modifier = {
					name = por_presence_in_india_modifier
					duration = 5475
				}
			}
		}
	}
	gc_por_burma = {
		icon = mission_portuguese_burma
		required_missions = { gc_por_surat }
		position = 8
		provinces_to_highlight = {
			OR = {
				area = arakan_area
				area = lower_burma_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			arakan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			lower_burma_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			1343 = {
				add_trade_modifier = {
					who = root
					duration = 7300
					power = 50
					key = burmese_trade
				}
			}
			if = { 
				limit = { has_dlc = "Domination" }
				586 = { 
					add_province_modifier = {
						name = por_center_of_portuguese_trade_modifier
						duration = -1 
					}
					add_base_production = 2 
				}
			}
		}
	}
	
	gc_por_conquer_tangiers = {
		icon = mission_unite_home_region
		required_missions = { gc_por_build_the_navy }
		completed_by = 1472.1.1
		position = 10
		provinces_to_highlight = {
			province_id = 334
			NOT = { owned_by = ROOT }
		}
		
		trigger = {
			owns = 334
		}
		
		effect = {
			add_adm_power = 150
			if = { 
				limit = { has_dlc = "Domination" }
				define_advisor = {
					type = inquisitor 
					skill = 3 
					cost_multiplier = 0.25
				}
			}
			else = { add_prestige = 5 }
			western_morocco_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			southern_morocco_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_claim = ROOT }
				}
				add_claim = ROOT
			}
		}
	}
	
	gc_conquer_the_north_african_coast = {
		icon = mission_arabian_fort
		required_missions = { gc_por_conquer_tangiers }
		completed_by = 1488.1.1
		position = 11
		provinces_to_highlight = {
			area = western_morocco_area
			NOT = { owned_by = ROOT }
		}
		
		trigger = {
			western_morocco_area = {
				type = all
				owned_by = ROOT
			}
		}
		
		effect = {
			western_morocco_area = {
				limit = { 
					owned_by = ROOT
				}
				add_province_modifier = {
					name = "buffer_zone_commerce"
					duration = 5475
				}
			}
			northern_morocco_area = {
				limit = { 
					owned_by = ROOT
				}
				add_province_modifier = {
					name = "buffer_zone_commerce"
					duration = 5475
				}
			}
			southern_morocco_area = {
				limit = { 
					owned_by = ROOT
				}
				add_province_modifier = {
					name = "buffer_zone_commerce"
					duration = 5475
				}
			}
		}
	}
}

gc_por_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
	}
	potential = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	gc_por_discover_african_coast = {
		icon = mission_establish_high_seas_navy
		required_missions = { }
		completed_by = 1445.1.1
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = miss_discover_west_africa
				west_africa_coast_area = {
					has_discovered = ROOT
				}
			}
			num_of_colonists = 1
		}
		
		effect = {
			if = {
				limit = { 
					has_dlc = "Domination" 
					has_dlc = "Rule Britannia" 
				}
				change_innovativeness = 3 
			}
			else = { add_prestige = 10 }
			add_country_modifier = {
				name = "the_unknown_frontier"
				duration = 5475
			}
		}
	}
	gc_por_colonise_west_africa = {
		icon = mission_colonial
		required_missions = { gc_por_discover_african_coast }
		completed_by = 1445.1.1
		
		provinces_to_highlight = {
			region = guinea_region
			OR = {
				is_city = no
				NOT = { owned_by = ROOT }
			}
			has_discovered = ROOT
		}
		
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = miss_colonize_west_africa
				guinea_region = {
					owned_by = ROOT
					is_city = yes
				}
			}
		}
	
		effect = {
			create_explorer = {
				tradition = 60
			}
			add_dip_power = 100
		}
	}
	gc_por_colonise_central_africa = {
		icon = mission_african_soldier
		required_missions = { gc_por_colonise_west_africa }
		completed_by = 1584.1.1
		
		provinces_to_highlight = {
			region = kongo_region
			NOT = { owned_by = ROOT }
			has_discovered = ROOT
		}
		
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = miss_discover_kongo
				kongo_region = {
					has_discovered = ROOT
				}
			}
			custom_trigger_tooltip = {	
				tooltip = miss_colonize_kongo
				kongo_region = {
					owned_by = ROOT
					is_city = yes
				}
			}
		}
	
		effect = {
			hidden_effect = {
				4097 = {
					discover_country = ROOT
				}
			}
			4097 = {
				add_trade_modifier = {
					who = root
					duration = 5475
					power = 20
					key = ivory_coast_ambition
				}
			}
			if = { 
				limit = { religion = catholic }
				add_papal_influence = 25 
			}
			else = { add_prestige_or_monarch_power = { amount = 15 } }
		}
	}
}

gc_por_2_b = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
	}
	potential = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
		is_random_new_world = no
	}
	has_country_shield = yes
	gc_por_triangle_trade = {
		icon = mission_the_triangle_trade
		required_missions = { gc_por_colonise_central_africa gc_por_establishes_foothold_brazil }
		position = 4
		
		provinces_to_highlight = {
			OR = {
				province_id = 1466
				province_id = 1531
				province_id = 1293
			}
			NOT = {
				is_strongest_trade_power = ROOT
			}
		}
		
		trigger = {
			1466 = {
				is_strongest_trade_power = ROOT
			}
			1531 = {
				is_strongest_trade_power = ROOT
			}
			1293 = {
				is_strongest_trade_power = ROOT
			}
		}
		effect = {
			add_mercantilism = 2
			custom_tooltip = por_triangle_trade_mission_tooltip
			hidden_effect = {
				every_owned_province = {
					limit = {
						continent = africa
						trade_goods = slaves
					}
					add_province_modifier = {
						name = "por_triangle_trade_modifier"
						duration = 7300
					}
				}
			}
			change_price = {
				trade_goods = slaves 
				key = triangle_trade_key
				value = 0.5
				duration = 9125
			}
		}
	}
	
	gc_por_malabar = {
		icon = mission_portuguese_malabar
		required_missions = { gc_portugal_discovers_india }
		position = 6
		provinces_to_highlight = {
			area = malabar_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			malabar_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			lanka_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			south_lanka_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			529 = {
				if = {
					limit = {
						NOT = {
							is_permanent_claim = ROOT
							is_core = ROOT
						}
					}
					add_permanent_claim = ROOT
				}
			}
			4430 = {
				if = {
					limit = {
						NOT = {
							is_permanent_claim = ROOT
							is_core = ROOT
						}
					}
					add_permanent_claim = ROOT
				}
			}
			517 = {
				if = {
					limit = {
						NOT = {
							is_permanent_claim = ROOT
							is_core = ROOT
						}
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	
	gc_por_surat = {
		icon = mission_control_surat
		required_missions = { gc_por_malabar }
		position = 7
		provinces_to_highlight = {
			OR = {
				province_id = 529
				province_id = 4430
				province_id = 517
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			529 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			4430 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			517 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Dharma"
				}
				add_country_modifier = {
					name = "portuguese_surat_modifier"
					duration = 7300
				}
			}
			else = {
				add_mercantilism = 2
			}
			arakan_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lower_burma_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
}

gc_por_2_c = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
	}
	potential = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
		is_random_new_world = no
	}
	has_country_shield = yes
	
	gc_por_build_the_navy = {
		icon = mission_sea_battles
		required_missions = {}
		completed_by = 1470.1.1
		position = 9
		trigger = {
			if = {
				limit = { ai = no }
				navy_size_percentage = 0.95
				army_size_percentage = 0.85
			}
			else = { navy_size_percentage = 0.85 army_size_percentage = 0.75 }
		}
		effect = {
			add_dip_power = 50
			add_navy_tradition = 15
			northern_morocco_area = {
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			leon_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			extremadura_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT }
					NOT = { is_core = ROOT	}
				}
				add_permanent_claim = ROOT
			}
			lower_andalucia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	gc_por_flagship = {
		icon = mission_launch_a_flagship
		required_missions = { gc_por_build_the_navy }
		position = 10
		provinces_to_highlight = {
			province_id = 227
			NOT = { owned_by = ROOT }
		}
		trigger = {
			if = {
				limit = { has_dlc = "Golden Century" }
				has_flagship = yes
			}
			else = {
				num_of_heavy_ship = 8
			}
			227 = { owned_by = ROOT }
		}
		effect = {
			add_navy_tradition = 20
			227 = {
				if = {
					limit = { has_building = grand_shipyard }
					add_base_production = 2 
				}
				else_if = {
					limit = { has_building = shipyard }
					remove_building = shipyard 
					add_building = grand_shipyard 
				}
				else = { add_building = shipyard }
			}
		}
	}
}

gc_por_3_b = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
	}
	potential = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
		is_random_new_world = no
	}
	has_country_shield = yes
	gc_por_caribbean = {
		icon = mission_colonize_the_caribbean
		required_missions = { gc_por_discover_african_coast }
		position = 2
		
		provinces_to_highlight = {
			colonial_region = colonial_the_carribean
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			has_discovered = ROOT
		}
		
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 5
				colonial_region = colonial_the_carribean
				is_city = yes
			}
		}
		
		effect = {
			custom_tooltip = portuguese_carib_tooltip
			hidden_effect = {
				every_subject_country = {
					limit = {
						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
						}
						capital_scope = {
							colonial_region = colonial_the_carribean
						}
					}
					add_country_modifier = {
						name = "portuguese_carib_modifier"
						duration = 7300
					}
				}
			}
		}
	}
}

gc_por_3 = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
	}
	potential = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	gc_por_discovers_east_africa = {
		icon = mission_have_two_subjects
		required_missions = { gc_por_discovers_cape_good_hope }
		completed_by = 1530.1.1
		position = 3
		provinces_to_highlight = {
			OR = {
				province_id = 1186
				province_id = 1192
				area = mozambique_area
			}
			NOT = { owned_by = ROOT }
			has_discovered = ROOT
		}
		
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = miss_discover_east_africa
				east_africa_region = {
					has_discovered = ROOT
				}
			}
			1186 = {
				owned_by = ROOT
			}
			1192 = {
				owned_by = ROOT
			}
			mozambique_area = {
				type = all
				owned_by = ROOT
			}
		}
	
		effect = {
			add_prestige_or_monarch_power = { amount = 15 }
			add_years_of_income = 1 
			zimbabwe_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			butua_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	gc_por_african_gold = {
		icon = mission_african_gold
		required_missions = { gc_por_discovers_east_africa }
		position = 4
		
		provinces_to_highlight = {
			OR = {
				area = zimbabwe_area
				area = butua_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			zimbabwe_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			butua_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			1188 = {
				if = {
					limit = { trade_goods = gold }
					add_base_production = 2
					add_province_modifier = {
						name = "por_african_gold_modifier"
						duration = 7300
					}
				}
			}
			1185 = {
				if = {
					limit = { trade_goods = gold }
					add_base_production = 2
					add_province_modifier = {
						name = "por_african_gold_modifier"
						duration = 7300
					}
				}
			}
			1184 = {
				if = {
					limit = { trade_goods = gold }
					add_base_production = 2
					add_province_modifier = {
						name = "por_african_gold_modifier"
						duration = 7300
					}
				}
			}
			1186 = {
				if = {
					limit = { trade_goods = gold }
					add_base_production = 2
					add_province_modifier = {
						name = "por_african_gold_modifier"
						duration = 7300
					}
				}
			}
		}
	}	
	
	gc_por_indian_investment = {
		icon = mission_indian_trade_company
		required_missions = { gc_por_surat }
		position = 8
		trigger = {
			if = {
				limit = {
					has_dlc = "Dharma"
				}
				calc_true_if = {
					desc = por_indian_investment_tooltip
					india_superregion = {
						type = all
						has_trade_company_investment_in_area = {
							investor = ROOT
							count_one_per_area = yes
						}
					}
					amount = 5
				}
			}
			else = {
				504 = {
					is_strongest_trade_power = ROOT
				}
				1340 = {
					is_strongest_trade_power = ROOT
				}
				1343 = {
					is_strongest_trade_power = ROOT
				}
			}
		}
		effect = {
			set_country_flag = por_india_mission_flag
			country_event = { id = flavor_por.4 }
		}
	}
	
	dom_portugal_reform_navy = {
		icon = mission_aragonese_navy
		required_missions = { gc_por_flagship }
		position = 11
		trigger = {
			num_of_owned_provinces_with = {
				has_shipyard_building_trigger = yes 
				value = 6 
			}
			OR = { 
				navy_tradition = 75 
				navy_size = 40 # modified
			}
		}
		effect = {
			if = {
				limit = { has_dlc = "Domination" }
				add_country_modifier = {
					name = por_reform_navy_1_modifier
					duration = -1 
				}
			}
			else = { 
				define_advisor = {
					type = naval_reformer
					skill = 3
					cost_multiplier = 0.25
				}
				add_navy_tradition = 25 
			}
		}
	}
}

gc_por_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
	}
	potential = {
		OR = {
			has_dlc = "Domination" 
			has_dlc = "Golden Century"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	gc_por_discovers_cape_good_hope = {
		icon = mission_sea_battles
		required_missions = { gc_por_discover_african_coast }
		completed_by = 1499.1.1
		position = 2
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = miss_discover_south_africa
				south_africa_region = {
					has_discovered = ROOT
				}
			}
			light_ship_fraction = 0.25
			navy_size_percentage = 1
		}
	
		effect = {
			add_prestige = 10
			add_yearly_sailors = 3
			cape_of_good_hope_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			mozambique_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			1186 = {
				add_permanent_claim = ROOT
			}
			1192 = {
				add_permanent_claim = ROOT
			}
			1201 = {
				add_permanent_claim = ROOT
			}
		}
	}
	
	gc_por_conquers_zanzibar = {
		icon = mission_cannons_firing
		required_missions = { gc_por_discovers_cape_good_hope }
		position = 3
		
		provinces_to_highlight = {
			province_id = 1201
			NOT = { owned_by = ROOT }
			has_discovered = ROOT
		}
		
		trigger = { 
			1201 = {
				owned_by = ROOT
			}
		}
	
		effect = {
			1201 = {
				add_base_production = 3
				add_base_manpower = 3
				add_province_modifier = {
					name = "por_makeshift_defenses"
					duration = -1
				}
			}
		}
	}
	
	gc_por_discovers_horn_africa = {
		icon = mission_establish_high_seas_navy
		required_missions = { gc_por_conquers_zanzibar }
		completed_by = 1535.1.1
		position = 4
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = miss_discover_horn_africa
				OR = {
					mogadishu_area = { has_discovered = ROOT }
					majarteen_area = { has_discovered = ROOT }
					somaliland_area = { has_discovered = ROOT }
				}
			}
		}
	
		effect = {
			1201 = {
				add_trade_modifier = {
					who = root
					duration = 5475
					power = 20
					key = horn_africa_ambition
				}
			}
			2999 = {
				add_permanent_claim = ROOT
			}
			if = {
				limit = { has_dlc = "Domination" }
				add_navy_tradition = 15 
			}
			majarteen_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_claim = ROOT
			}
		}
	}

	gc_portugal_discovers_india = {
		icon = mission_trade_company_region_abroad
		required_missions = { gc_por_discovers_horn_africa }
		completed_by = 1536.1.1
		position = 5
		trigger = {
			custom_trigger_tooltip = {
				tooltip = portugal_discovers_india.tooltip
				coromandel_region = {
					has_discovered = ROOT
				}
				2030 = {
					has_discovered = POR
				}
			}
		}
		
		effect = {
			define_explorer = {
				name = "Afonso de Albuquerque"
				fire = 5
				shock = 5
				manuever = 5
				siege = 0
			}
			country_event = {
				id = flavor_por.11
			}
			malabar_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			596 = { add_permanent_claim = ROOT } 
			if = { 
				limit = { has_dlc = "Rule Britannia" }
				change_innovativeness = 2
			}
		}
	}
	
	gc_por_malacca = {
		icon = mission_portuguese_malacca
		required_missions = { gc_portugal_discovers_india }
		position = 6
		provinces_to_highlight = {
			province_id = 596
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			owns_core_province = 596
		}
		effect = {
			if = {
				limit = {
					tag = POR
					religion = catholic
				}
				country_event = { id = more_flavor_por.5 }
			}
			596 = {
				add_province_modifier = {
					name = "portuguese_malacca"
					duration = -1
				}
			}
		}
	}
	
	gc_por_trade_with_china = {
		icon = mission_trade_with_cathay
		required_missions = { gc_por_malacca }
		position = 7
		provinces_to_highlight = {
			province_id = 1371
		}
		
		trigger = {
			1371 = {
				trade_share = {
					country = ROOT
					share = 15
				}
			}
			668 = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					owner = {
						is_subject = no
						has_opinion = {
							who = ROOT
							value = 50
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = macau_event_tooltip
			hidden_effect = {
				if = {
					limit = {
						668 = {
							NOT = { country_or_non_sovereign_subject_holds = ROOT }
							owner = {
								is_subject = no
							}
						}
					}
					
					hidden_effect = {
						668 = {
							owner = {
								country_event = { id = more_flavor_por.1 }
							}
						}
					}
				}
				else = {
					add_mercantilism = 3
				}
			}
		}
	}
	
	gc_por_japanese_trade = {
		icon = mission_trade_with_japan
		required_missions = { gc_por_trade_with_china }
		
		provinces_to_highlight = {
			OR = {
				province_id = 1376
				AND = {
					province_id = 4182
					NOT = { owned_by = ROOT }
					owner = { NOT = { vassal_of = ROOT } }
				}
			}
		}

		trigger = {
			1376 = {
				trade_share = {
					country = ROOT
					share = 15
				}
			}
			4182 = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					owner = {
						is_subject = no
						has_opinion = {
							who = ROOT
							value = 50
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = por_japan_mission_tooltip
			hidden_effect = {
				if = {
					limit = {
						4182 = {
							NOT = { country_or_non_sovereign_subject_holds = ROOT }
							owner = {
								is_subject = no
							}
						}
					}
					4182 = {
						owner = {
							country_event = { id = more_flavor_por.3 }
						}
					}
				}
				else = {
					add_mercantilism = 3
				}
			}
		}
	}
	
	gc_por_english_alliance = {
		icon = mission_anglo_portuguese_alliance
		required_missions = {  }
		position = 9
		trigger = {
			if = {
				limit = {
					NOT = {
						exists = GBR
					}
				}
				OR = {
					AND = {
						alliance_with = ENG
						reverse_has_opinion = {
							who = ENG
							value = 100
						}
					}
					is_rival = ENG
					NOT = { exists = ENG }
				}
			}
			else = {
				OR = {
					AND = {
						alliance_with = GBR
						reverse_has_opinion = {
							who = GBR
							value = 100
						}
					}
					is_rival = GBR
				}
			}
		}
		effect = {
			if = {
				limit = {
					alliance_with = ENG
				}
				ENG = {
					add_opinion = {
						who = root
						modifier = anglo_portuguese_alliance
					}
				}
				hidden_effect = {
					root = {
						add_opinion = {
							who = ENG
							modifier = anglo_portuguese_alliance
						}
					}
				}
			}
			galicia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			asturias_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			add_country_modifier = {
				name = por_struggle_for_iberia_modifier 
				duration = 7300
			}
		}
	}

	gc_por_intervene_in_castile = {
		icon = mission_intervene_in_castile
		required_missions = { gc_por_build_the_navy gc_por_english_alliance }
		position = 10
		provinces_to_highlight = {
			OR = {
				area = leon_area
				area = extremadura_area
				area = lower_andalucia_area
				area = galicia_area
				area = asturias_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			leon_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			extremadura_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			lower_andalucia_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			galicia_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			asturias_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			iberia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	gc_por_lusitanian_empire = {
		icon = mission_lusitanian_empire
		required_missions = { gc_por_intervene_in_castile dom_portugal_reform_navy gc_por_universities }
		position = 12
		provinces_to_highlight = {
			region = iberia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			iberia_region = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			if = {
				limit = {
					NOT = {
						government_rank = 3
					}
				}
				set_government_rank = 3
			}
			add_prestige_or_monarch_power = { amount = 50 }
			add_power_projection = { 
				type = 25_permanent_power_projection
				amount = 25 
			}
			custom_tooltip = chi_permanent_pp
		}
	}
	
	# gc_portugal_discovers_the_far_east = {
		# icon = mission_establish_high_seas_navy
		# required_missions = { gc_por_discovers_indonesia }
		# completed_by = 1542.1.1
		# position = 7
		
		# trigger = { 
			# custom_trigger_tooltip = {
				# tooltip = miss_discover_south_china_sea_japan
				# japan_region = { has_discovered = ROOT }
				# south_china_region = { has_discovered = ROOT }
			# }
		# }
	
		# effect = {
			# add_dip_power = 50
			# add_prestige = 30
			# capital_scope = {
				# add_province_modifier = {
					# name = "por_erudite_explorers"
					# duration = -1
				# }
			# }
			# 668 = {
				# add_claim = root
			# }
		# }
	# }
}

gc_por_5_dom = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Golden Century"
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Golden Century"
		has_dlc = "Domination"
		tag = POR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	dom_portugal_exploration_ideas = {
		icon = imperial_navy
		required_missions = { }
		position = 1
		
		trigger = { 
			OR = { 
				full_idea_group = exploration_ideas
				full_idea_group = expansion_ideas
			}
		}
	
		effect = {
			if = {
				limit = { has_dlc = "Rights of Man" }
				custom_tooltip = por_more_likely_to_get_expansionist_tt
				set_country_flag = por_more_likely_to_get_expansionist_flag 
				change_ruler_stat = {
					type = dip
					amount = 1
				}
			}
			else = {
				change_ruler_stat = {
					type = dip
					amount = 2
				}
				add_prestige_or_monarch_power = { amount = 10 }
			}
		}
	}
	
	dom_portugal_circumnavigation = {
		icon = mission_explore_the_world
		required_missions = { dom_portugal_exploration_ideas gc_por_discovers_cape_good_hope }
		position = 3
		
		trigger = { 
			OR = {
				custom_trigger_tooltip = {
					tooltip = achievement_magellans_voyage_tooltip
					has_country_flag = circumnavigation_first
				}
				custom_trigger_tooltip = {
					tooltip = second_circumnavigation_tt
					has_country_flag = circumnavigation_done
				}
			}
		}
	
		effect = {
			if = {
				limit = { has_country_flag = circumnavigation_first }
				add_country_modifier = {
					name = por_first_circumnavigation_modifier
					duration = -1 
				}
			}
			else = {
				add_country_modifier = {
					name = por_first_circumnavigation_modifier
					duration = 9125
				}
			}
		}
	}
}


gc_por_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Golden Century"
			has_dlc = "Domination"
		}
	}
	potential = {
		OR = {
			has_dlc = "Golden Century"
			has_dlc = "Domination"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	gc_por_conquers_hormuz = {
		icon = mission_persian_soldiers
		required_missions = { gc_por_conquers_zanzibar }
		position = 4
		completed_by = 1508.1.1
		provinces_to_highlight = {
			province_id = 2999
			NOT = { owned_by = ROOT }
			has_discovered = ROOT
		}
		
		trigger = { 
			2999 = {
				owned_by = ROOT
			}
		}
	
		effect = {
			2999 = {
				add_base_production = 3
				add_base_manpower = 3
				add_province_modifier = {
					name = "por_makeshift_defenses"
					duration = -1
				}
			}
			mascat_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	gc_por_oman = {
		icon = mission_portuguese_oman
		required_missions = { gc_por_conquers_hormuz }
		position = 5
		provinces_to_highlight = {
			OR = {
				AND = {
					area = mascat_area
					NOT = { country_or_non_sovereign_subject_holds = ROOT }
				}
				AND = {
					province_id = 400
					NOT = { owned_by = ROOT }
				}
			}
		}
		
		trigger = {
			mascat_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			400 = { owned_by = ROOT }
		}
		effect = {
			if = {
				limit = {
					2999 = {
						owned_by = ROOT
					}
				}
				2999 = {
					add_province_modifier = {
						name = "persian_gulf_trade_por"
						duration = -1
					}
				}
			}
			400 = {
				add_province_modifier = {
					name = "persian_gulf_trade_por"
					duration = -1
				}
			}
		}
	}
}

gc_por_5_bb = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Golden Century"
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Golden Century"
		has_dlc = "Domination"
		tag = POR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	dom_por_clash_ottomans = {
		icon = mission_the_bospborus
		required_missions = { gc_por_oman gc_portugal_discovers_india }
		position = 6
		provinces_to_highlight = {
			is_capital = yes 
			owner = { tag = TUR }
		}
		trigger = {
			OR = {
				navy_size = TUR 
				total_development = TUR 
				TUR = { exists = no }
			}
			OR = {
				army_tradition = 70
				army_professionalism = 0.35
			}
		}
		effect = {
			add_country_modifier = {
				name = por_elite_marines_modifier
				duration = -1 
			}
			add_army_tradition = 15
		}
	}
}

gc_por_5_continued = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		OR = {
			has_dlc = "Golden Century"
			has_dlc = "Domination"
		}
	}
	potential = {
		OR = {
			has_dlc = "Golden Century"
			has_dlc = "Domination"
		}
		tag = POR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	gc_por_discovers_indonesia = {
		icon = mission_junk_boat
		required_missions = { gc_por_malacca }
		completed_by = 1536.1.1
		position = 7
		provinces_to_highlight = {
			region = malaya_region
			NOT = { owned_by = ROOT }
			has_discovered = ROOT
		}
		
		trigger = {
			custom_trigger_tooltip = {
			tooltip = miss_discover_malaya
				malaya_region = {
					has_discovered = ROOT
				}
			}
			custom_trigger_tooltip = {
				tooltip = miss_colonize_malaya
				malaya_region = {
					owned_by = ROOT
					is_city = yes
				}
			}
		}
	
		effect = {
			add_country_modifier = {
				name = "por_spice_trade"
				duration = 9125
			}
		}
	}
	
	gc_por_indonesia_dominance = {
		icon = indonesian_trade
		required_missions = { gc_por_discovers_indonesia }
		position = 8
		provinces_to_highlight = {
			province_id = 1361
			has_discovered = ROOT
		}
		
		trigger = { 
			1361 = {
				is_strongest_trade_power = POR
			}
		}
	
		effect = {
			add_country_modifier = {
				name = "por_johor_dominance"
				duration = -1
			}
		}
	}
	
	gc_por_wine_monopolies = {
		icon = mission_wine_monopolies
		required_missions = {  }
		position = 9
		
		provinces_to_highlight = {
			trade_goods = wine
			NOT = { owned_by = ROOT }
			NOT = {
				OR = {
					has_building = workshop
					has_building = counting_house
				}
			}
			has_discovered = ROOT
		}
		
		trigger = {
			OR = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 10
					trade_goods = wine
					OR = {
						has_building = workshop
						has_building = counting_house
					}
				}
				trading_bonus = {
					trade_goods = wine
					value = yes
				}
				production_leader = {
					trade_goods = wine
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "por_wine_monopolies"
				duration = 7300
			}
			
			if = { 
				limit = { has_dlc = "Domination" }
				custom_tooltip = por_every_wine_prov_tt
				tooltip = { add_base_production = 1 } 
				hidden_effect = {
					every_owned_province = {
						limit = { trade_goods = wine } 
						add_base_production = 1 
					}
				}
			}
		}
	}
	gc_por_trading_houses = {
		icon = mission_great_trading_houses
		required_missions = { gc_por_wine_monopolies }
		position = 10
		provinces_to_highlight = {
			province_id = 1293
		}
		
		trigger = {
			OR = {
				num_of_merchants = 6
				1293 = {
					is_strongest_trade_power = ROOT
				}
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 10
				has_trade_building_trigger = yes 
			}
		}
		effect = {
			add_country_modifier = {
				name = "por_houses_of_trade"
				duration = 7300
			}
		}
	}
	gc_por_universities = {
		icon = mission_arts_and_letters
		required_missions = { gc_por_trading_houses }
		position = 11
		provinces_to_highlight = {
			province_id = 227
			NOT = { 
				has_building = university 
				owned_by = ROOT
			}			
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				has_building = university 
				value = 8 
			}
			227 = {
				has_building = university
				owned_by = ROOt
			}
		}
		effect = {
			add_country_modifier = {
				name = "por_arts_and_letters"
				duration = 7300
			}
		}
	}
}