fin_missions_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = FIN
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	fin_forcelimit = {	
		icon = end_the_habsburgs
		required_missions = { } 
		position = 1 
		trigger = { 
			army_size_percentage = 1 
			OR = { 
				has_mil_advisor = yes 
				num_of_cavalry = 1 
			}
			OR = { 
				liberty_desire = 100 
				is_subject = no 
				hidden_trigger = {
					has_country_flag = rus_can_complete_missions_as_subject
				}
			}
		}
		effect = { 
			add_country_modifier = {
				name = fin_savage_tactics_modifier
				duration = 5475 
			}
			if = { 
				limit = { 
					calc_true_if = {
						all_province = { is_core = SWE }
						amount = 10 
					}
				}
				custom_tooltip = fin_claim_swedish_provinces_tt
				hidden_effect = {
					every_province = {
						limit = {
							is_core = SWE 
							NOT = { owned_by = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
				}
			}
			else = {
				scandinavia_region = {
					limit = {
						NOT = { owned_by = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
			}
			karelia_area = { 
				limit = {
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			unlock_merc_company = {
				merc_company = merc_hakkapeliita_cavalry
				free_merc = yes
			}
		}
	}
	
	fin_independence = {
		icon = mission_conquer_finland
		required_missions = { fin_forcelimit }
		position = 2
		provinces_to_highlight = { } 
		trigger = { 
			if = {
				limit = { NOT = { has_country_flag = rus_can_complete_missions_as_subject } }
				is_subject = no 
				stability = 0 
				NOT = { num_of_loans = 1 }
				num_of_allies = 1 
			}
			else = {
				stability = 0 
				NOT = { num_of_loans = 1 }
			}
		}
		effect = { 
			custom_tooltip = fin_ruler_celebrated_as_independence_tt
			hidden_effect = {
				if = { 
					limit = { grown_by_development = 50 }
					change_ruler_stat = {
						type = mil
						amount = 3
					}
				}
				else_if = {
					limit = { grown_by_development = 25 } 
					change_ruler_stat = {
						type = mil
						amount = 2
					}
				}
				else = {
					change_ruler_stat = {
						type = mil
						amount = 1
					}
				}
				if = { 
					limit = { stability = 3 } 
					change_ruler_stat = {
						type = adm
						amount = 3
					}
				}
				else_if = {
					limit = { stability = 2 } 
					change_ruler_stat = {
						type = adm
						amount = 2
					}
				}
				else = {
					change_ruler_stat = {
						type = adm
						amount = 1
					}
				} 
				if = {
					limit = { num_of_allies = 3 } 
					change_ruler_stat = {
						type = dip
						amount = 3
					}
				}
				else_if = {
					limit = { num_of_allies = 2 } 
					change_ruler_stat = {
						type = dip
						amount = 2
					}
				}
				else = {
					change_ruler_stat = {
						type = dip
						amount = 1
					}
				}
			}
			add_ruler_modifier = {
				name = fin_era_of_independence_modifier
				duration = -1 
			}
			custom_tooltip = fin_claim_baltic_trade_node_tt
			hidden_effect = {
				1926 = { 
					every_trade_node_member_province = {
						limit = { 
							NOT = { owned_by = ROOT }
							NOT = { is_core = ROOT } 
							NOT = { province_id = 1926 }
						}
						add_permanent_claim = ROOT 
					}
				}
			}
		}
	}
	
	fin_stockholm = {
		icon = mission_conquer_sweden
		required_missions = { fin_independence }
		position = 3
		provinces_to_highlight = { 
			province_id = 1 
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = { 
			1 = { country_or_non_sovereign_subject_holds = ROOT }
		}
		effect = { 
			1 = { 
				change_province_name = "Tukholma" 
				rename_capital = "Tukholma"
				add_base_tax = 1 
				add_base_production = 1 
				add_base_manpower = 1 
			} 
			if = { 
				limit = { government_rank = 2 } 
				add_power_projection = {
					type = mission_rewards_power_projection
					amount = 25
				}
			}
			else = { set_government_rank = 2 } 
			define_advisor = { 
				type = trader 
				cost_multiplier = 0.5
			}
		}
	}
}


fin_missions_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = FIN
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes

	fin_culture = {
		icon = mission_the_finns
		required_missions = { fin_grow_farms }
		position = 2
		provinces_to_highlight = { } 
		trigger = { 
			OR = { 
				num_of_owned_provinces_with = {
					culture = finnish 
					value = 12
				}
				has_cultural_union = yes 
				hidden_trigger = {
					has_country_flag = rus_can_complete_missions_as_subject
				}
			}
		}
		effect = {
			custom_tooltip = fin_if_cultural_union_tt
			tooltip = { 
				add_country_modifier = { 
					name = fin_celebrated_melting_pot_modifier
					duration = -1 
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = { 
				add_country_modifier = { 
					name = fin_accelerated_assimilation_modifier
					duration = 9125 
				}
			}
			hidden_effect = {
				if = { 
					limit = { has_cultural_union = yes } 
					add_country_modifier = { 
						name = fin_celebrated_melting_pot_modifier
						duration = -1 
					}
				}
				else = {	
					add_country_modifier = { 
						name = fin_accelerated_assimilation_modifier
						duration = 9125 
					}
				}
			}
		}
	}
	
	fin_dalaskrogen = {
		icon = mission_dalaskogen
		required_missions = { fin_independence }
		position = 3
		provinces_to_highlight = { 
			province_id = 8 
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = { 
			8 = { country_or_non_sovereign_subject_holds = ROOT }
		}
		effect = { 
			if = { 
				limit = { 
					has_dlc = "Leviathan" 
					8 = { 
						NOT = { 	
							has_great_project = {
								type = falun_copper_mine 
								tier = 3 
							}
						}
					}
				}
				8 = {
					add_great_project_tier = {
						type = falun_copper_mine
						tier = 1 
					}
				}
			}
			else = { 
				8 = { add_base_production = 3 }
			}
			add_years_of_owned_provinces_production_income = {
				years = 10
				trigger = {
					OR = {
						trade_goods = iron
						trade_goods = copper
					}
				}
				custom_tooltip = fin_iron_copper_prod_tt
			}
			if = { 
				limit = { 
					has_dlc = "Rights of Man" 
					NOT = { num_of_ruler_traits = { amount = 3 } }
				}				
				add_ruler_personality = industrious_personality
			}
			else = { 
				change_ruler_stat = {
					type = dip
					amount = 1
				}
			}
		}
	}
	
	fin_baltic_empire = {
		icon = mission_baltic_empire
		required_missions = { fin_stockholm fin_dalaskrogen fin_neva }
		position = 4
		provinces_to_highlight = {
			any_trade_node_member_province = {
				province_id = 1926
			} 
			is_sea = no 
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = own_all_baltic_provinces_tt
				1926 = { 
					NOT = {
						any_trade_node_member_province = {
							is_sea = no 
							NOT = { country_or_non_sovereign_subject_holds = ROOT }
						}
					}
				}
			}
		}
		effect = { 
			if = { 
				limit = { 
					NOT = { government_rank = 3 } 
				}
				set_government_rank = 3 
			}
			else = { add_prestige = 50 }
			custom_tooltip = fin_baltic_empire_tt
			hidden_effect = {
				add_country_modifier = {
					name = fin_finnish_swedish_carolean
					duration = -1
				}
			}
			country_event = {
				id = flavor_fin.1
			}
			if = { 
				limit = { has_had_golden_age = yes }
				reset_golden_age = yes 
			}
			else_if = { 	
				limit = { in_golden_age = yes } 
				extend_golden_age = 240 
			}
			else = { 
				add_adm_power = 100 
				add_dip_power = 100 
				add_mil_power = 100  
			} 
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven"
					has_had_golden_age = no 
					in_golden_age = no 
				}
				custom_tooltip = fin_gain_golden_era_bonuses_tt
			}
		}
	}
}

fin_missions_3 = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = FIN
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	fin_grow_farms = {
		icon = prosperity_for_all
		required_missions = { }
		position = 1
		provinces_to_highlight = { } 
		trigger = { 
			OR = { 
				any_owned_province = {
					trade_goods = fish 
					OR = { 
						num_of_times_improved = 4  
						has_production_building_trigger = yes 
					}
				}
				any_owned_province = {
					trade_goods = grain 
					OR = { 
						num_of_times_improved = 4  
						has_production_building_trigger = yes 
					}
				}
			}
			grown_by_development = 30 
			stability = 0
		}
		effect = { 
			add_country_modifier = {
				name = fin_abundant_food_modifier
				duration = 5475 
			}
			custom_tooltip = fin_every_province_with_workshop_tt
			hidden_effect = {
				every_owned_province = {
					limit = { 
						has_production_building_trigger = yes 
						OR = { 
							trade_goods = grain 
							trade_goods = fish 
						}
					} 
					add_base_production = 1 
				}
			}
		}
	}
	
	fin_handle_the_sami = {
		icon = mission_the_sami
		position = 2
		required_missions = { fin_grow_farms }
		provinces_to_highlight = {
			OR = {
				area = laponia_area
				area = norrland_area
				area = bothnia_area
			}
			OR = {
				NOT = { religion = ROOT }
				NOT = { owned_by = ROOT }
				has_owner_accepted_culture = no
			}
		}
		trigger = {
			if = {
				limit = { NOT = { has_country_flag = rus_can_complete_missions_as_subject } }
				laponia_area = { 
					owned_by = ROOT
					religion = ROOT
					has_owner_accepted_culture = yes
					type = all
				}
				norrland_area = { 
					owned_by = ROOT
					religion = ROOT
					has_owner_accepted_culture = yes
					type = all
				}
				bothnia_area = { 
					owned_by = ROOT
					religion = ROOT
					has_owner_accepted_culture = yes
					type = all
				}
			}
			else = {
				laponia_area = { 
					owned_by = ROOT
					religion = ROOT
					type = all
				}
				norrland_area = { 
					owned_by = ROOT
					religion = ROOT
					type = all
				}
				bothnia_area = { 
					owned_by = ROOT
					religion = ROOT
					type = all
				}
			}
		}
		effect = {
			unlock_estate_privilege = {
				estate_privilege = estate_burghers_forest_expansion
			}
			laponia_area = {
				add_local_autonomy = -100
				add_base_manpower = 2
			}
			norrland_area = {
				add_local_autonomy = -100
				add_base_manpower = 2
			}
			bothnia_area = {
				add_local_autonomy = -100
				add_base_manpower = 2
			}
		}
	}
	
	fin_neva = {
		icon = protect_against_the_turks
		required_missions = { fin_independence }
		position = 3
		provinces_to_highlight = { 
			area = karelia_area 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			if = {
				limit = { has_country_flag = rus_can_complete_missions_as_subject }
				30 = { 
					has_fort_building_trigger = yes 
					base_manpower = 8 
				} 	
			}
			else = {
				karelia_area = {
					type = all 
					country_or_non_sovereign_subject_holds = ROOT 
				}
				30 = { 
					owned_by = ROOT 
					has_fort_building_trigger = yes 
					base_manpower = 8 
				} 	
			}	
		}
		effect = {
			30 = {
				add_base_manpower = 2 
				add_province_modifier = {
					name = fin_viipurin_linna_modifier
					duration = -1 
					desc = fin_remove_modifier_upon_siege_tt
				}
			}
			custom_tooltip = fin_finnish_militarization_tt
			tooltip = { 
				add_country_modifier = {
					name = fin_finnish_militarization_modifier
					duration = 7300
				}
			}
			hidden_effect = {
				if = { 
					limit = { 
						1930 = { 
							has_fort_building_trigger = yes 
							country_or_non_sovereign_subject_holds = ROOT 
						}
					}
					add_country_modifier = {
						name = fin_finnish_militarization_modifier
						duration = 7300
					}
				} 
			}
		}
	}
	
	fin_tar_trade = {
		icon = toulon_dockyards
		required_missions = { fin_neva }
		position = 4
		provinces_to_highlight = { province_id = 33 }
		trigger = { 
			if = {
				limit = { NOT = { has_country_flag = rus_can_complete_missions_as_subject } }
				33 = { 
					trade_share = {
						country = ROOT 
						share = 50
					}
				}
			}
			33 = {
				country_or_non_sovereign_subject_holds = ROOT 
				has_shipyard_building_trigger = yes 
				has_trade_building_trigger = yes 
			}
		}
		effect = { 
			33 = { 
				change_trade_goods = naval_supplies 
				add_manufactory = yes 
				add_province_modifier = {
					name = fin_commercial_tar_modifier
					duration = 9125 
				}
			}
		}
	}
	
	fin_fourth_rome = {
		icon = peace_in_europe
		required_missions = { fin_abo_academy fin_tar_trade fin_baltic_empire }
		position = 5
		provinces_to_highlight = { is_capital_of = ROOT } 
		trigger = { 
			if = {
				limit = { NOT = { has_country_flag = rus_can_complete_missions_as_subject } }
				is_defender_of_faith = yes 
			}
			religious_unity = 1 
			army_size = 35 # modified
			stability = 3 
			capital_scope = { development = 40 } 
		}
		effect = { 
			add_country_modifier = { 
				name = fin_white_death_descends_upon_europe
				duration = -1 
			}
			custom_tooltip = allow_earlier_scandinavia_formation_tt
			hidden_effect = { set_country_flag = can_form_scandinavia_earlier }
		}
	}
}

fin_missions_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = FIN
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	fin_high_income = {
		icon = reform_the_state
		required_missions = { fin_grow_farms }
		position = 2
		provinces_to_highlight = { } 
		trigger = { 
			share_of_starting_income = 5
			if = {
				limit = { NOT = { has_country_flag = rus_can_complete_missions_as_subject } }
				has_adm_advisor_2 = yes 
			}
			is_in_deficit = no 
			NOT = { num_of_loans = 1 }
		}
		effect = { 
			custom_tooltip = fin_every_adm_advisor_grants_5_tax_per_level
			set_country_flag = fin_fine_finances_flag
			if = { 
				limit = { 
					NOT = { num_of_ruler_traits = { amount = 3 } }
					has_dlc = "Rights of Man" 
				}
				add_ruler_personality = well_connected_personality
			}
			else = {				
				change_ruler_stat = {
					type = adm
					amount = 2
				}
			}
		}
	}
	
	fin_abo_academy = {
		icon = powerhouse_of_the_north
		required_missions = { fin_neva fin_found_helsingfors fin_high_income }
		position = 4
		provinces_to_highlight = { province_id = 27 } 
		trigger = { 
			stability = 2
			27 = { 
				owned_by = ROOT 
				OR = { 
					has_building = university 
					num_of_times_improved = 12 
				}
				if = { 
					limit = { has_dlc = "Mandate of Heaven" } 
					NOT = { devastation = 1 }
					prosperity = 50 
				}
			}
		}
		effect = { 
			27 = { 
				if = { 
					limit = { 
						NOT = { has_building = university } 
					}
					add_building = university 
				}
				else = { add_base_production = 2 } 
				add_next_institution_embracement = 25 
			}
			if = {
				limit = { has_dlc = "Rule Britannia" }
				change_innovativeness = 2 
			}
			else = { add_adm_power = 50 } 
			if = { 
				limit = { 
					has_dlc = "Rights of Man" 
					NOT = { num_of_ruler_traits = { amount = 3 } }
				} 
				add_ruler_personality = scholar_personality
			}
			else = {
				change_ruler_stat = {
					type = adm
					amount = 2
				}
			} 
		}
	}
}

fin_missions_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = FIN
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	fin_build_turku = {
		icon = negotiate_for_avignon
		required_missions = { }
		position = 1
		provinces_to_highlight = { province_id = 27 } 
		trigger = { 
			27 = { 
				num_of_buildings_in_province = 3
				num_of_times_improved = 5 
				if = { 
					limit = { has_dlc = "Mandate of Heaven" } 
					NOT = { devastation = 1 }
				}
			}
		}
		effect = { 
			27 = { 
				rename_capital = "Turku"
				change_province_name = "Turku"
				add_base_tax = 2 
				if = { 
					limit = { has_dlc = "Mandate of Heaven" }
					add_prosperity = 100
				}
				else = { add_base_production = 1 } 
			}
			
		}
	}
	
	fin_found_helsingfors = {
		icon = take_the_bishoprics
		required_missions = { fin_build_turku }
		position = 3
		provinces_to_highlight = { province_id = 28 } 
		trigger = { 
			28 = { 
				owned_by = ROOT 
				development = 30
				has_manufactory_trigger = yes 
				num_of_buildings_in_province = 4 
			}
			is_lacking_institutions = no 	
		}
		effect = { 
			28 = { 
				center_of_trade = 2 
				if = { 
					limit = { has_building = dock }
					remove_building = dock 
					add_building = drydock 
				}
				else = { add_building = dock }
				if = { 
					limit = { has_building = shipyard }
					remove_building = shipyard
					add_building = grand_shipyard
				}
				else = { add_building = shipyard }
			} 
			add_mercantilism = 3
		}
	}
}