liv_diplomacy_mission_slot = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			tag = LVA
			tag = LIV
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_improve_diplomatic_abilities = {
		icon = mission_diplomatic_relation
		position = 1
		required_missions = {  }
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = { has_estate = estate_church }
				has_estate_privilege = estate_church_religious_diplomats
			}
			prestige = 15
			monthly_dip = 8
		}
		effect = {
			define_advisor = {
				type = statesman
				skill = 1
				cost_multiplier = 0.25
			}
			add_country_modifier = {
				name = liv_diplomatic_focus
				duration = 1825
			}
		}
	}
	
	liv_find_strong_allies = {
		icon = mission_alliances
		position = 2
		required_missions = { liv_improve_diplomatic_abilities }
		provinces_to_highlight = {
			is_capital = yes
			has_discovered = ROOT
			NOT = { owned_by = ROOT }
			owner = { 
				is_free_or_tributary_trigger = yes
				total_own_and_non_tributary_subject_development = 125
				OR = {
					NOT = { alliance_with = ROOT }
					has_opinion = {
						who = ROOT
						value = 150
					}
				}
			}
		}
		trigger = {
			OR = {
				calc_true_if = {
					all_ally = {
						custom_trigger_tooltip = {
							tooltip = liv_find_strong_allies_tt
							total_own_and_non_tributary_subject_development = 125
							has_opinion = {
								who = ROOT
								value = 150
							}
						}
					}
					amount = 2
				}
				total_own_and_non_tributary_subject_development = 150
			}
		}
		effect = {
			add_dip_power = 75
			add_country_modifier = {
				name = liv_diplomatic_knights
				duration = 9125
			}
		}
	}
}

liv_teutonic_mission_slot = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			tag = LVA
			tag = LIV
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_handle_teutonic_order = {
		icon = mission_teutonic_knights
		position = 1
		required_missions = {  }
		provinces_to_highlight = {
			owned_by = TEU
		}
		trigger = {
			OR = {
				NOT = { exists = TEU }
				TEU = {
					OR = {
						exists = no
						custom_trigger_tooltip = {
							tooltip = liv_handle_teutonic_order_at
							AND = {
								has_opinion = {
									who = ROOT
									value = 150
								}
								OR = {
									alliance_with = ROOT
									is_subject_of = ROOT
								}
							}
						}
						custom_trigger_tooltip = {
							tooltip = liv_handle_teutonic_order_bt
							AND = {
								OR = {
									is_rival = ROOT
									is_enemy = ROOT
								}
								ROOT = {
									OR = {
										has_casus_belli = {
											type = cb_conquest
											target = PREV
										}
										has_casus_belli = {
											type = cb_core
											target = PREV
										}
									}
								}
							}
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = { exists = TEU }
				if = {
					limit = {
						TEU = {
							AND = {
								has_opinion = {
									who = ROOT
									value = 150
								}
								OR = {
									alliance_with = ROOT
									is_subject_of = ROOT
								}
							}
						}
					}
					TEU = {
						add_trust = {
							who = ROOT
							value = 15
							mutual = yes
						}
						ROOT = {
							add_favors = {
								who = PREV
								amount = 20
							}
						}
					}
					add_mil_power = 50
				}
				else_if = {
					limit = {
						TEU = {
							AND = {
								OR = {
									is_rival = ROOT
									is_enemy = ROOT
								}								
								ROOT = {
									OR = {
										has_casus_belli = {
											type = cb_conquest
											target = PREV
										}
										has_casus_belli = {
											type = cb_core
											target = PREV
										}
									}
								}
							}
						}
					}
					add_casus_belli = {
						type = cb_vassalize_mission
						target = TEU
						months = 360
					}
					add_country_modifier = {
						name = liv_honorable_wars
						duration = 7300
					}
				}
				else = {
					custom_tooltip = liv_handle_teutonic_order_tt
				}
			}
			else = {
				add_mil_power = 100
			}
		}
		ai_weight = {
			factor = 1
		}
	}
}

liv_riga_and_secularization_mission_slot = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			tag = LVA
			tag = LIV
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_handle_internal_struggle = {
		icon = mission_sell_indulgences
		position = 1
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				province_id = 36
				province_id = 35
				province_id = 39
				province_id = 1834
				province_id = 37
				province_id = 4241
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		}
		trigger = {
			owns_core_province = 36
			owns_core_province = 35
			owns_core_province = 39
			owns_core_province = 1834
			owns_core_province = 37
			owns_core_province = 4241
			NOT = { has_estate_privilege = estate_church_lands_of_riga }
			NOT = { has_estate_privilege = estate_church_bishopric_of_dorpat }
			NOT = { has_estate_privilege = estate_church_bishopric_of_osel_wiek }
			NOT = { has_estate_privilege = estate_church_bishopric_of_courland }
			NOT = { has_estate_privilege = estate_church_bishopric_of_reval }
		}
		effect = {
			add_stability_or_adm_power = yes
			if = {
				limit = {
					has_estate = estate_church
				}
				change_estate_land_share = {
					estate = estate_church
					share = -10
				}
			}
			else = {
				add_adm_power = 200
			}
		}
	}
	
	liv_strengthen_ruling_authority = {
		icon = mission_italian_condottiere
		position = 2
		required_missions = {
			liv_handle_teutonic_order
			liv_handle_riga
		}
		provinces_to_highlight = {
		}
		trigger = {
			stability = 2
			if = {
				limit = {
					uses_devotion = yes
				}
				devotion = 95
			}
			accepted_culture = estonian
			accepted_culture = latvian
		}
		effect = {
			enable_branching_mission_review = {
				key = LIV
				ai_event_id = flavor_liv.1
			}
			custom_tooltip = teu_defeat_the_poles_tt
			samogitia_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT }
					NOT = { is_core = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lithuania_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT }
					NOT = { is_core = ROOT }
				}
				add_permanent_claim = ROOT
			}
			if = {
				limit = { 
					TEU = { 
						is_subject_of = ROOT 
						NOT = { historical_friend_with = ROOT } 
					}
				} 
				add_historical_friend = TEU 
				TEU = { add_historical_friend = ROOT }
				hidden_effect = {
					PRU = { add_historical_friend = LVA }
					LVA = { add_historical_friend = PRU }
				}
			}
			else = {
				custom_tooltip = liv_strengthen_ruling_authority_ct
			}
		}
	}
	
	liv_lva_competent_rule = {
		icon = mission_noble_council
		position = 3
		required_missions = { liv_strengthen_ruling_authority }
		provinces_to_highlight = {
			is_capital_of = ROOT
			NOT = { has_courthouse_building_trigger = yes }
		}
		trigger = {
			has_adm_advisor = yes
			has_dip_advisor = yes
			has_mil_advisor = yes
			capital_scope = {
				has_courthouse_building_trigger = yes
			}
			if = {
				limit = { has_estate = estate_church }
				estate_loyalty = {
					estate = estate_church
					loyalty = 60
				}
			}
			if = {
				limit = { has_estate = estate_nobles }
				estate_loyalty = {
					estate = estate_nobles
					loyalty = 60
				}
			}
			if = {
				limit = { has_estate = estate_burghers }
				estate_loyalty = {
					estate = estate_burghers
					loyalty = 60
				}
			}
		}
		effect = {
			add_adm_power = 50
			add_dip_power = 50
			add_mil_power = 50
			set_country_flag = liv_completed_diet_mission
			capital_scope = {
				add_base_tax = 1
				add_base_production = 1
				add_base_manpower = 1
				add_province_triggered_modifier = livonian_diet_capital
			}
		}
	}
}

liv_internal_division_mission_slot = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			tag = LVA
			tag = LIV
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_handle_riga = {
		icon = mission_hanseatic_city
		position = 1
		required_missions = {  }
		provinces_to_highlight = {
			province_id = 38
		}
		trigger = {
			OR = {
				owns_core_province = 38
				RIG = {
					alliance_with = ROOT
					has_opinion = {
						who = ROOT
						value = 190
					}
				}
			}
		}
		effect = {
			trigger_switch = {
				on_trigger = religion
				catholic = {
					add_papal_influence = 50
					if = {
						limit = {
							alliance_with = RIG
						}
						add_opinion = {
							who = PAP
							modifier = liv_protector_of_riga_opinion
						}
					}
				}
				protestant = {
					add_church_power = 100
					add_prestige = 20
				}
				reformed = {
					add_fervor = 50
					add_army_tradition = 15
				}
				hussite = {
					add_church_power = 50
					add_devotion = 10
				}
				anglican = {
					add_church_power = 100
					add_stability = 1
				}
				orthodox = {
					add_patriarch_authority = 0.1
					add_dip_power = 50
				}
			}
			add_country_modifier = {
				name = liv_protector_of_riga
				duration = 9125
			}
		}
		ai_weight = {
			factor = 1
		}
	}
}

liv_fortify_mission_slot = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			tag = LVA
			tag = LIV
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_expand_army = {
		icon = mission_livonian_knights
		position = 1
		required_missions = {  }
		provinces_to_highlight = {
		}
		trigger = {
			army_size_percentage = 1
			is_monarch_leader = yes
			is_heir_leader = yes
		}
		effect = {
			add_army_tradition = 15
			add_country_modifier = {
				name = liv_prepared_army
				duration = 9125
			}
		}
	}
	
	liv_fortify_land = {
		icon = mission_livonian_castle
		position = 2
		required_missions = { liv_expand_army }
		provinces_to_highlight = {
			OR = {
				area = curonia_area
				area = livonia_area
				area = estonia_ingria_area
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { province_has_current_tech_fort_trigger = yes }
			}
		}
		trigger = {
			num_of_owned_provinces_with = {
				OR = {
					area = curonia_area
					area = livonia_area
					area = estonia_ingria_area
				}
				province_has_current_tech_fort_trigger = yes
				value = 4
			}
		}
		effect = {
			custom_tooltip = liv_fortify_land_tt
			hidden_effect = {
				random_owned_province = {
					limit = {
						province_has_current_tech_fort_trigger = yes
						OR = {
							area = curonia_area
							area = livonia_area
							area = estonia_ingria_area
						}
						NOT = { has_province_modifier = teu_pru_fortified_border }
					}
					add_province_modifier = {
						name = teu_pru_fortified_border
						duration = -1
					}
				}
				random_owned_province = {
					limit = {
						province_has_current_tech_fort_trigger = yes
						OR = {
							area = curonia_area
							area = livonia_area
							area = estonia_ingria_area
						}
						NOT = { has_province_modifier = teu_pru_fortified_border }
					}
					add_province_modifier = {
						name = teu_pru_fortified_border
						duration = -1
					}
				}
				random_owned_province = {
					limit = {
						province_has_current_tech_fort_trigger = yes
						OR = {
							area = curonia_area
							area = livonia_area
							area = estonia_ingria_area
						}
						NOT = { has_province_modifier = teu_pru_fortified_border }
					}
					add_province_modifier = {
						name = teu_pru_fortified_border
						duration = -1
					}
				}
				random_owned_province = {
					limit = {
						province_has_current_tech_fort_trigger = yes
						OR = {
							area = curonia_area
							area = livonia_area
							area = estonia_ingria_area
						}
						NOT = { has_province_modifier = teu_pru_fortified_border }
					}
					add_province_modifier = {
						name = teu_pru_fortified_border
						duration = -1
					}
				}
			}
			define_advisor = {
				type = fortification_expert
				skill = 2
				discount = yes
			}
		}
	}
}

#Livonian Path (also available to normal Livonia and Kurland)

liv_lva_colonialism_mission_slot = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			AND = {
				has_country_flag = liv_livonian_path
				tag = LIV
			}
			tag = LVA
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_lva_colonial_ambitions = {
		icon = mission_colonial
		position = 3
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			OR = {
				has_institution = new_world_i
				has_idea = quest_for_the_new_world
			}
		}
		effect = {
			create_explorer = {
				tradition = 70
			}
			add_country_modifier = {
				name = liv_lva_colonial_ambition
				duration = 9125
			}
			futa_jallon_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			manding_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			kong_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
}

liv_lva_colonize_north_america_mission_slot = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			AND = {
				has_country_flag = liv_livonian_path
				tag = LIV
			}
			tag = LVA
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		is_random_new_world = no
	}
	has_country_shield = yes

	liv_lva_discover_new_world = {
		icon = mission_explore_the_world
		position = 4
		required_missions = { liv_lva_colonial_ambitions }
		provinces_to_highlight = {
			OR = {
				continent = north_america
				continent = south_america
			}
			NOT = { has_discovered = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			OR = {
				north_america = { has_discovered = ROOT }
				south_america = { has_discovered = ROOT }
			}
		}
		effect = {
			add_country_modifier = {
				name = "the_unknown_frontier"
				duration = 5475
			}
			add_dip_power = 50
		}
	}
	
	liv_lva_colonize_north_america = {
		icon = mission_rb_the_thirteen_colonies
		position = 5
		required_missions = { liv_lva_discover_new_world }
		provinces_to_highlight = {
			continent = north_america
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			has_discovered = ROOT
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				continent = north_america
				value = 5
			}
		}
		effect = {
			create_conquistador = {
				tradition = 50
			}
			custom_tooltip = swe_colonize_delaware_tt
			hidden_effect = {
				colonial_the_carribean = {
					limit = {
						OR = {
							has_river_estuary_trigger = yes
							province_has_center_of_trade_of_level = 1
						}
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						NOT = { owner = { is_subject_of = ROOT } }
						has_port = yes
					}
					add_permanent_claim = ROOT
				}
			}
			1500 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 25
					key = liv_lva_colonize_north_america_tt
				}
			}
		}
	}
	
	liv_lva_livonian_caribbeans = {
		icon = mission_caribbean_cn
		position = 6
		required_missions = { liv_lva_colonize_north_america }
		provinces_to_highlight = {
			colonial_region = colonial_the_carribean
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			has_discovered = ROOT
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			owns_or_non_sovereign_subject_of = 502
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				colonial_region = colonial_the_carribean
				value = 5
			}
		}
		effect = {
			add_navy_tradition = 10
			502 = {
				center_of_trade = 1
			}
			1516 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 25
					key = liv_lva_livonian_caribbeans_tt
				}
			}
		}
	}
	
	liv_lva_dominate_colonial_trade = {
		icon = mission_naval_dominance
		position = 7
		required_missions = { liv_lva_livonian_caribbeans }
		provinces_to_highlight = {
			is_american_trade_node_province = yes
			NOT = { is_strongest_trade_power = ROOT }
			NOT = {
				trade_share = {
					country = ROOT
					share = 25
				}
			}
			has_discovered = ROOT
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			calc_true_if = {
				custom_trigger_tooltip = {
					tooltip = liv_lva_dominate_colonial_trade_tt
					1490 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					1486 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					2526 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					1500 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					1507 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					2499 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					1551 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					1516 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					4637 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					835 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					2935 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					809 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					800 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					1531 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					1536 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
					2868 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
				}
				amount = 4
			}
		}
		effect = {
			add_years_of_income = 2
			add_country_modifier = {
				name = liv_lva_american_trade_dominance
				duration = -1
			}
		}
	}
}

liv_lva_colonize_new_world_mission_slot = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			AND = {
				has_country_flag = liv_livonian_path
				tag = LIV
			}
			tag = LVA
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		is_random_new_world = yes
	}
	has_country_shield = yes

	liv_lva_a_random_world = {
		icon = mission_explore_the_world
		position = 4
		required_missions = { liv_lva_colonial_ambitions }
		provinces_to_highlight = {
			continent = new_world
			NOT = { has_discovered = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			new_world = { has_discovered = ROOT }
		}
		effect = {
			add_country_modifier = {
				name = "the_unknown_frontier"
				duration = 5475
			}
			add_dip_power = 50
		}
	}
	
	liv_lva_settle_the_new_world = {
		icon = mission_settlers_north_america
		position = 6
		required_missions = { liv_lva_a_random_world }
		provinces_to_highlight = {
			continent = new_world
			has_discovered = ROOT
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				continent = new_world
				value = 5
			}
		}
		effect = {
			create_conquistador = {
				tradition = 50
			}
			add_country_modifier = {
				name = liv_lva_random_new_world_colonialism
				duration = 9125
			}
		}
	}
	
	liv_lva_dominate_new_world_trade = {
		icon = mission_dominate_home_trade_node
		position = 7
		required_missions = { liv_lva_settle_the_new_world }
		provinces_to_highlight = {
			continent = new_world
			has_discovered = ROOT
			owner = {
				OR = {
					is_rival = ROOT
					is_enemy = ROOT
					overlord = {
						OR = {
							is_rival = ROOT
							is_enemy = ROOT
						}
					}
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			NOT = { current_age = age_of_discovery }
			custom_trigger_tooltip = {
				tooltip = nor_dominate_new_world_tt
				NOT = {
					new_world = {
						owner = {
							OR = {
								is_rival = ROOT
								is_enemy = ROOT
								overlord = {
									OR = {
										is_rival = ROOT
										is_enemy = ROOT
									}
								}
							}
						}
					}
				}
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				continent = new_world
				is_city = yes
				value = 20
			}
		}
		effect = {
			add_power_projection = {
				type = mission_rewards_power_projection
				amount = 100
			}
			add_prestige = 100
		}
	}
}

liv_lva_old_world_scramble_mission_slot = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			AND = {
				has_country_flag = liv_livonian_path
				tag = LIV
			}
			tag = LVA
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_lva_colonize_west_africa = {
		icon = mission_west_african_ports
		position = 4
		required_missions = { liv_lva_colonial_ambitions }
		provinces_to_highlight = {
			has_discovered = ROOT
			OR = {
				province_id = 2239
				province_id = 1114
				province_id = 2252
				province_id = 1121
				province_id = 1120
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			OR = {
				owns_core_province = 2239
				owns_core_province = 1114
			}
			calc_true_if = {
				owns_core_province = 2252
				owns_core_province = 1121
				owns_core_province = 1120
				amount = 2
			}
		}
		effect = {
			custom_tooltip = liv_lva_colonize_west_africa_tt
			hidden_effect = {
				every_owned_province = {
					limit = {
						trade_goods = gold
						region = niger_region
					}
					add_province_modifier = {
						name = liv_lva_west_african_gold_production
						duration = -1
					}
				}
			}
			cape_of_good_hope_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	liv_lva_reach_the_cape = {
		icon = mission_early_game_buildings
		position = 5
		required_missions = { liv_lva_colonize_west_africa }
		provinces_to_highlight = {
			province_id = 1177
			has_discovered = ROOT
			OR = {
				NOT = { is_core = ROOT }
				NOT = { owned_by = ROOT }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			owns_core_province = 1177
			1460 = {
				OR = {
					is_strongest_trade_power = ROOT
					trade_share = {
						country = ROOT
						share = 20
					}
				}
			}
		}
		effect = {
			1177 = {
				add_building = stock_exchange
			}
			add_mercantilism = 5
			custom_tooltip = liv_lva_reach_the_cape_tt
			hidden_effect = {
				kanara_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						OR = { has_river_estuary_trigger = yes province_has_center_of_trade_of_level = 1 }
					}
					add_permanent_claim = ROOT
				}
				malabar_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						OR = { has_river_estuary_trigger = yes province_has_center_of_trade_of_level = 1 }
					}
					add_permanent_claim = ROOT
				}
				madura_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						OR = { has_river_estuary_trigger = yes province_has_center_of_trade_of_level = 1 }
					}
					add_permanent_claim = ROOT
				}
				tanjore_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						OR = { has_river_estuary_trigger = yes province_has_center_of_trade_of_level = 1 }
					}
					add_permanent_claim = ROOT
				}
				south_carnatic_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						OR = { has_river_estuary_trigger = yes province_has_center_of_trade_of_level = 1 }
					}
					add_permanent_claim = ROOT
				}
				andhra_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						OR = { has_river_estuary_trigger = yes province_has_center_of_trade_of_level = 1 }
					}
					add_permanent_claim = ROOT
				}
				lanka_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						OR = { has_river_estuary_trigger = yes province_has_center_of_trade_of_level = 1 }
					}
					add_permanent_claim = ROOT
				}
				south_lanka_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
						OR = { has_river_estuary_trigger = yes province_has_center_of_trade_of_level = 1 }
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	
	liv_lva_trade_in_india = {
		icon = mission_south_indian_trade
		position = 6
		required_missions = { liv_lva_reach_the_cape }
		provinces_to_highlight = {
			OR = {
				area = kanara_area
				area = malabar_area
				area = madura_area
				area = tanjore_area
				area = south_carnatic_area
				area = andhra_area
				area = lanka_area
				area = south_lanka_area
			}
			has_discovered = ROOT
			OR = {
				has_river_estuary_trigger = yes
				province_has_center_of_trade_of_level = 1
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				custom_trigger_tooltip = {
					tooltip = liv_lva_trade_in_india_tt
					OR = {
						area = kanara_area
						area = malabar_area
						area = madura_area
						area = tanjore_area
						area = south_carnatic_area
						area = andhra_area
						area = lanka_area
						area = south_lanka_area
					}
				}
				OR = {
					has_river_estuary_trigger = yes
					province_has_center_of_trade_of_level = 1
				}
				value = 4
			}
		}
		effect = {
			add_country_modifier = {
				name = liv_lva_indian_trade
				duration = -1
			}
		}
	}
}

liv_lva_trade_mission_slot = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			AND = {
				has_country_flag = liv_livonian_path
				tag = LIV
			}
			tag = LVA
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_lva_strengthen_the_state = {
		icon = holy_state
		position = 4
		required_missions = { liv_lva_competent_rule }
		provinces_to_highlight = {
			OR = {
				province_id = 37
				province_id = 36
				province_id = 39
				province_id = 1935
				province_id = 1834
			}
			OR = {
				NOT = { is_core = ROOT }
				NOT = { owned_by = ROOT }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			owns_core_province = 37
			owns_core_province = 36
			owns_core_province = 39
			owns_core_province = 1935
			owns_core_province = 1834
			reform_level = 3
			stability = 2
		}
		effect = {
			if = {
				limit = {
					tag = LIV
				}
				country_event = {
					id = flavor_liv.4
				}
			}
			else = {
				add_prestige_or_monarch_power = {
					amount = 50
				}
			}
		}
	}
	
	liv_lva_expand_the_fleet = {
		icon = mission_establish_high_seas_navy
		position = 5
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			num_of_light_ship = 15
			num_of_admirals = 1
		}
		effect = {
			add_mercantilism = 3
			add_country_modifier = {
				name = liv_lva_merchant_fleet
				duration = 9125
			}
		}
	}
	
	liv_lva_construct_markets = {
		icon = mission_danzig_or_war
		position = 6
		required_missions = { liv_lva_expand_the_fleet }
		provinces_to_highlight = {
			OR = {
				area = curonia_area
				area = livonia_area
				area = estonia_ingria_area
				province_id = 1926
			}
			OR = {
				AND = {
					NOT = { province_id = 1926 }
					OR = {
						NOT = { owned_by = ROOT }
						NOT = { has_trade_building_trigger = yes }
					}
				}
				AND = {
					province_id = 1926
					NOT = { has_merchant = ROOT }
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			mercantilism = 15
			owns_core_province = 37
			num_of_owned_provinces_with = {
				OR = {
					area = curonia_area
					area = livonia_area
					area = estonia_ingria_area
				}
				has_trade_building_trigger = yes
				value = 5
			}
			1926 = {
				has_merchant = ROOT
			}
		}
		effect = {
			45 = {
				add_trade_modifier = {
					who = ROOT
					duration = 18250
					power = 25
					key = liv_lva_construct_markets_tt
				}
			}
			1926 = {
				add_trade_modifier = {
					who = ROOT
					duration = 18250
					power = 25
					key = liv_lva_construct_markets_tt
				}
			}
			1926 = {
				add_trade_node_income = 50
			}
		}
	}
	
	liv_lva_dominate_lubeck_trade = {
		icon = mission_rb_control_the_hansa
		position = 7
		required_missions = { liv_lva_construct_markets }
		provinces_to_highlight = {
			if = {
				limit = { exists = HSA }
				is_capital_of = HSA
			}
			else = {
				province_id = 45
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			trader = 3
			if = {
				limit = {
					exists = HSA
				}
				OR = {
					is_in_war = {
						attacker_leader = ROOT
						defender_leader = HSA
						war_score = 75
					}
					owns_or_non_sovereign_subject_of = 45
				}
			}
			else = {
				45 = {
					OR = {
						is_strongest_trade_power = ROOT
						country_or_non_sovereign_subject_holds = ROOT
						controlled_by = ROOT
					}
				}
			}
			45 = { has_merchant = ROOT }
		}
		effect = {
			add_years_of_trade_income = {
				custom_tooltip = dan_the_german_trade_cities_ct
				years = 4
			}
			if = {
				limit = {
					OR = {
						owns = 2971
						owns = 44
						owns = 45
						owns = 1775
						owns = 47
						owns = 1858
						owns = 4142
						owns = 12
						owns = 4163
						owns = 17
					}
				}
				45 = {
					add_trade_modifier = {
						who = ROOT
						duration = -1
						power = 20
						key = liv_lva_dominate_lubeck_trade_provinces
					}
				}
			}
			else = {
				45 = {
					add_trade_modifier = {
						who = ROOT
						duration = -1
						power = 50
						key = liv_lva_dominate_lubeck_trade_no_provinces
					}
				}
				custom_tooltip = liv_lva_dominate_lubeck_trade_tt
				set_country_flag = liv_lva_dominate_lubeck_trade_flag
			}
		}
	}
}

#Livonian Order specific -> Deal with the Teutonic Order or Unite Baltics
liv_lva_livonian_teutonic_mission_slot = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			tag = LIV
			tag = LVA
			tag = KUR
		}
		OR = {
			tag = LIV
			was_tag = LIV
		}
		has_country_flag = liv_livonian_path
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_lva_prussian_alliance = {
		icon = mission_conquer_prussia
		position = 4
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				is_capital_of = PRU
				AND = {
					OR = {
						area = west_prussia_area
						area = east_prussia_area
					}
					NOT = { owned_by = ROOT }
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			OR = {
				custom_trigger_tooltip = {
					tooltip = liv_lva_prussian_alliance_at
					alliance_with = PRU
					OR = {
						is_in_war = {
							attacker_leader = PRU
							attackers = ROOT
							war_score = 50
						}
						is_in_war = {
							attacker_leader = ROOT
							attackers = PRU
							war_score = 50
						}
						is_in_war = {
							defender_leader = PRU
							defenders = ROOT
							war_score = 50
						}
						is_in_war = {
							defender_leader = ROOT
							defenders = PRU
							war_score = 50
						}
					}
				}
				custom_trigger_tooltip = {
					tooltip = liv_lva_prussian_alliance_bt
					any_subject_country = {
						tag = PRU
						NOT = { liberty_desire = 10 }
					}
				}
				custom_trigger_tooltip = {
					tooltip = liv_lva_prussian_alliance_ct
					east_prussia_area = {
						owned_by = ROOT
						type = all
					}
					west_prussia_area = {
						owned_by = ROOT
						type = all
					}
					accepted_culture = prussian
				}
			}
		}
		effect = {
			if = {
				limit = {
					alliance_with = PRU
					OR = {
						is_in_war = {
							attacker_leader = PRU
							attackers = ROOT
							war_score = 50
						}
						is_in_war = {
							attacker_leader = ROOT
							attackers = PRU
							war_score = 50
						}
						is_in_war = {
							defender_leader = PRU
							defenders = ROOT
							war_score = 50
						}
						is_in_war = {
							defender_leader = ROOT
							defenders = PRU
							war_score = 50
						}
					}
				}
				country_event = {
					id = flavor_liv.5
				}
			}
			else_if = {
				limit = {
					OR = {
						any_subject_country = {
							tag = PRU
							NOT = { liberty_desire = 10 }
						}
						AND = {
							east_prussia_area = {
								owned_by = ROOT
								type = all
							}
							west_prussia_area = {
								owned_by = ROOT
								type = all
							}
							accepted_culture = prussian
						}
					}
				} 
				add_country_modifier = {
					name = liv_lva_prussian_military
					duration = 10950
				}
			}
			else = {
				custom_tooltip = liv_lva_prussian_alliance_dt
			}
			unlock_merc_company = {
				merc_company = merc_prussian_volunteer_army
				free_merc = yes
			}
		}
	}
	
	liv_lva_reform_the_government = {
		icon = adjust_the_general_means
		position = 5
		required_missions = { 
			liv_lva_prussian_alliance
			liv_lva_strengthen_the_state
		}
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			adm_power_cost = 500
			has_any_disaster = no
			is_at_war = no
			NOT = { num_of_rebel_armies = 1 }
			NOT = { num_of_rebel_controlled_provinces = 1 }
		}
		effect = {
			country_event = {
				id = flavor_liv.6
			}
		}
	}
	
	liv_lva_complete_your_government = {
		icon = mission_empire
		position = 6
		required_missions = { liv_lva_reform_the_government }
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			monthly_adm = 10
			monthly_dip = 10
			monthly_mil = 10
			stability = 2
			has_any_disaster = no
			is_at_war = no
			NOT = { num_of_rebel_armies = 1 }
			NOT = { num_of_rebel_controlled_provinces = 1 }
			custom_trigger_tooltip = {
				tooltip = liv_lva_complete_your_government_tt
				check_variable = {
					which = liv_event_counter
					value = 6
				}
			}
		}
		effect = {
			country_event = {
				id = flavor_liv.31
			}
		}
	}
}

#Non Livonian Order specific -> Unite the Baltics
liv_baltic_mission_slot = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			tag = LVA
			tag = KUR
		}
		NOT = { was_tag = LIV }
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_conquer_prussia = {
		icon = mission_conquer_prussia
		position = 4
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				area = west_prussia_area
				area = east_prussia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			west_prussia_area = {
				country_or_non_sovereign_subject_holds = ROOT
				type = all
			}
			east_prussia_area = {
				country_or_non_sovereign_subject_holds = ROOT
				type = all
			}
		}
		effect = {
			add_accepted_culture_or_dip_power = {
				culture = prussian
				value = 100
			}
			lithuania_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			samogitia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	liv_conquer_lithuania = {
		icon = mission_conquer_lithuania
		position = 5
		required_missions = { liv_conquer_prussia }
		provinces_to_highlight = {
			OR = {
				area = lithuania_area
				area = samogitia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			lithuania_area = {
				country_or_non_sovereign_subject_holds = ROOT
				type = all
			}
			samogitia_area = {
				country_or_non_sovereign_subject_holds = ROOT
				type = all
			}
		}
		effect = {
			add_accepted_culture_or_dip_power = {
				culture = lithuanian
				value = 100
			}
			baltic_region = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				add_province_modifier = {
					name = lif_lva_baltic_expansion
					duration = 9125
				}
			}
		}
	}
	
	liv_livonian_baltic_lands = {
		icon = mission_conquer_baltic_region
		position = 6
		required_missions = { liv_conquer_lithuania }
		provinces_to_highlight = {
			region = baltic_region
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				NOT = { num_of_times_improved = 2 }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			baltic_region = {
				country_or_non_sovereign_subject_holds = ROOT
				num_of_times_improved = 2
				type = all
			}
		}
		effect = {
			if = {
				limit = { NOT = { government_rank = 2 } }
				set_government_rank = 2
			}
			add_adm_power = 100
			add_dip_power = 100
			add_mil_power = 100
			add_prestige = 25
		}
	}
}

liv_lva_handle_the_threats_mission_slot = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		OR = {
			AND = {
				has_country_flag = liv_livonian_path
				tag = LIV
			}
			tag = LVA
			tag = KUR
		}
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_lva_develop_livonia = {
		icon = mission_eastern_european_city
		position = 3
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				area = estonia_ingria_area
				area = curonia_area
				area = livonia_area
			}
			owned_by = ROOT
			NOT = { development = 10 }
			NOT = { province_id = 38 }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			custom_trigger_tooltip = {
				tooltip = liv_lva_develop_livonia_tt
				estonia_ingria_area = {
					owned_by = ROOT
					development = 10
					type = all
				}
				curonia_area = {
					owned_by = ROOT
					development = 10
					type = all
				}
				livonia_area = {
					OR = {
						province_id = 38
						AND = {
							owned_by = ROOT
							development = 10
						}
					}
					type = all
				}
			}
		}
		effect = {
			add_stability_or_adm_power = yes
			custom_tooltip = liv_lva_develop_livonia_ct
			hidden_effect = {
				every_owned_province = {
					limit = {
						OR = {
							area = estonia_ingria_area
							area = curonia_area
							area = livonia_area
						}
						development = 10
					}
					add_province_modifier = {
						name = liv_lva_expanded_land
						duration = 9125
					}
				}
			}
		}
	}
	
	liv_lva_riga_capital = {
		icon = mission_conquer_riga
		position = 4
		required_missions = { liv_lva_develop_livonia }
		provinces_to_highlight = {
			province_id = 38
			OR = {
				NOT = { is_core = ROOT }
				NOT = { owned_by = ROOT }
				NOT = { is_capital_of = ROOT }
				NOT = { has_tax_building_trigger = yes }
				NOT = { has_production_building_trigger = yes }
				NOT = { has_trade_building_trigger = yes }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			38 = {
				owned_by = ROOT 
				development = 20
				has_tax_building_trigger = yes
				has_production_building_trigger = yes
				has_trade_building_trigger = yes
			}
		}
		effect = {
			if = {
				limit = { is_part_of_hre = yes }
				38 = { set_in_empire = yes }
			}
			set_capital = 38
			38 = {
				set_center_level_3_center_of_trade = yes
				add_province_modifier = {
					name = liv_lva_the_new_capital
					duration = -1
				}
			}
		}
	}
	
	liv_lva_construct_universities = {
		icon = mission_early_modern_university
		position = 5
		required_missions = { liv_lva_riga_capital }
		provinces_to_highlight = {
			owned_by = ROOT
			OR = {
				NOT = { has_building = university } 
				NOT = { development = 20 }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			if = {
				limit = { has_dlc = "Rule Britannia" }
				innovativeness = 30
			}
			OR = {
				has_institution = enlightenment
				has_idea_group = innovativeness_ideas
			}
			num_of_owned_provinces_with = {
				has_building = university
				development = 20
				value = 10
			}
		}
		effect = {
			add_adm_power = 200
			capital_scope = {
				add_province_modifier = {
					name = liv_lva_seat_of_the_livonian_enlightenment
					duration = -1
				}
			}
		}
	}
	
	liv_lva_take_over_neva = {
		icon = mission_develop_nevas_port
		position = 6
		required_missions = {  }
		provinces_to_highlight = {
			province_id = 33
			OR = {
				NOT = { is_core = ROOT }
				NOT = { owned_by = ROOT }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			owns_core_province = 33
		}
		effect = {
			if = {
				limit = {
					33 = { culture = novgorodian }
				}
				add_accepted_culture_or_dip_power = {
					culture = novgorodian
					value = 100
				}
			}
			else_if = {
				limit = { 33 = { culture = novgorodian_new } }
				add_accepted_culture_or_dip_power = {
					culture = novgorodian_new
					value = 100
				}
			}
			else_if = {
				limit = { 33 = { culture = russian } }
				add_accepted_culture_or_dip_power = {
					culture = russian
					value = 100
				}
			}
			else_if = {
				limit = { 33 = { culture = russian_new } }
				add_accepted_culture_or_dip_power = {
					culture = russian_new
					value = 100
				}
			}
			else = {
				add_accepted_culture_or_dip_power = {
					culture = karelian
					value = 100
				}
			}
			karelia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			novgorod_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tver_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			pskov_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	liv_lva_handle_polish_threat = {
		icon = mission_plc_golden_liberty
		position = 7
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				is_capital_of = PLC
				is_capital_of = POL
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			if = {
				limit = { exists = PLC }
				OR = {
					has_won_war_against = {
						who = PLC
						max_years_since = 50
					}
					PLC = {
						alliance_with = ROOT
						if = {
							limit = { has_dlc = "Leviathan" }
							trust = {
								who = ROOT
								value = 75
							}
						}
						else = {
							has_opinion = {
								who = ROOT
								value = 150
							}
						}
					}
				}
			}
			else_if = {
				limit = { exists = POL }
				OR = {
					has_won_war_against = {
						who = POL
						max_years_since = 50
					}
					POL = {
						alliance_with = ROOT
						trust = {
							who = ROOT
							value = 75
						}
					}
				}
			}
			else = {
				NOT = { exists = POL }
				NOT = { exists = PLC }
			}
		}
		effect = {
			if = {
				limit = {
					OR = {
						has_won_war_against = {
							who = PLC
							max_years_since = 50
						}
						has_won_war_against = {
							who = POL
							max_years_since = 50
						}
					}
				}
				add_country_modifier = {
					name = liv_lva_defeated_poland
					duration = 9125
				}
			}
			else_if = {
				limit = {
					OR = {
						PLC = {
							alliance_with = ROOT
							trust = {
								who = ROOT
								value = 75
							}
						}
						POL = {
							alliance_with = ROOT
							trust = {
								who = ROOT
								value = 75
							}
						}
					}
				}
				add_country_modifier = {
					name = liv_lva_allied_poland
					duration = 9125
				}
			}
			else_if = {
				limit = {
					NOT = { exists = POL }
					NOT = { exists = PLC }
				}
				add_country_modifier = {
					name = liv_lva_conquered_poland
					duration = 9125
				}
			}
			else = {
				custom_tooltip = liv_lva_handle_polish_threat_tt
			}
		}
	}
}

#Crusader Path
liv_internal_catholicism_mission_slot = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_country_flag = liv_crusader_path
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_connect_with_the_pope = {
		icon = mission_pol_negotiate_nunciature
		position = 3
		required_missions = {  }
		provinces_to_highlight = {
			is_capital_of = PAP
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			if = {
				limit = {
					exists = PAP
				}
				alliance_with = PAP
				OR = {
					AND = {
						num_of_cardinals = 1
						invested_papal_influence = 30
					}
					AND = {
						calc_true_if = {
							has_country_modifier = papal_sanction_for_church_taxes
							has_country_modifier = papal_blessing
							has_country_modifier = papal_indulgence
							has_country_modifier = usury_forgiven
							has_country_modifier = papal_sanction_for_holy_war
							amount = 2
						}
					}
				}
			}
			else = {
				calc_true_if = {
					has_country_modifier = papal_sanction_for_church_taxes
					has_country_modifier = papal_blessing
					has_country_modifier = papal_indulgence
					has_country_modifier = usury_forgiven
					has_country_modifier = papal_sanction_for_holy_war
					amount = 2
				}
			}
		}
		effect = {
			add_papal_influence = 50
			define_advisor = {
				type = inquisitor
				skill = 1
				religion = ROOT
				discount = yes
			}
		}
	}
	
	liv_ensure_religious_unity = {
		icon = chivalry_is_not_dead
		position = 4
		required_missions = { liv_connect_with_the_pope }
		provinces_to_highlight = {
			owned_by = ROOT
			NOT = { religion = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			grown_by_states = 5
			religious_unity = 1
		}
		effect = {
			add_papal_influence = 50
			add_country_modifier = {
				name = liv_unity_in_faith
				duration = 9125
			}
		}
	}
	
	liv_land_of_churches = {
		icon = mission_land_of_churches
		position = 5
		required_missions = { liv_ensure_religious_unity }
		provinces_to_highlight = {
			owned_by = ROOT
			OR = {
				NOT = { religion = catholic }
				NOT = { has_tax_building_trigger = yes }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			num_of_owned_provinces_with = {
				religion = catholic
				has_tax_building_trigger = yes
				value = 15
			}
		}
		effect = {
			add_country_modifier = {
				name = liv_donations_from_the_churches
				duration = 9125
			}
			add_papal_influence = 50
			add_years_of_owned_provinces_manpower = {
				years = 4
				trigger = {
			not_in_mission_preview_mode = { key = LIV }
					religion = ROOT
					has_tax_building_trigger = yes
				}
				custom_tooltip = liv_land_of_churches_tt
			}
		}
	}
	
	liv_build_cathedrals = {
		icon = mission_european_church
		position = 6
		required_missions = { liv_land_of_churches }
		provinces_to_highlight = {
			owned_by = ROOT
			OR = {
				NOT = { religion = catholic }
				NOT = { has_building = cathedral }
				NOT = { base_tax = 5 }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			num_of_owned_provinces_with = {
				religion = catholic
				base_tax = 5
				has_building = cathedral
				value = 10
			}
		}
		effect = {
			add_stability_or_adm_power = yes
			unlock_estate_privilege = {
				estate_privilege = estate_nobles_religious_conscription
			}
		}
	}
	
	liv_proclaim_defender_of_faith = {
		icon = defender_of_the_faith
		position = 7
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			if = {
				limit = {
					has_dlc = "Emperor"
				}
				is_defender_of_faith_of_tier = 5
			}
			else = {
				is_defender_of_faith = yes
			}
			custom_trigger_tooltip = {
				tooltip = liv_proclaim_defender_of_faith_tt
				had_country_flag = {
					flag = claimed_defender_of_faith_flag
					days = 9125
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = liv_the_livonian_defender
				duration = -1
				desc = liv_the_livonian_defender_tt
			}
			custom_tooltip = liv_proclaim_defender_of_faith_ct
			set_country_flag = liv_the_livonian_defender_flag
		}
	}
}

liv_purge_reformation_mission_slot = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_country_flag = liv_crusader_path
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_ally_the_emperor = {
		icon = join_the_empire
		position = 4
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			is_religion_enabled = protestant
			OR = {
				alliance_with = emperor
				NOT = { hre_size = 1 }
			}
		}
		effect = {
			add_dip_power = 100
			if = {
				limit = {
					hre_size = 1
				}
				add_trust = {
					who = emperor
					value = 15
					mutual = yes
				}
			}
		}
	}
	
	liv_support_the_emperor = {
		icon = the_holy_league
		position = 5
		required_missions = { liv_ally_the_emperor }
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			if = {
				limit = {
					has_dlc = "Art of War"
				}
				OR = {
					NOT = { hre_size = 1 }
					AND = {
						custom_trigger_tooltip = {
							tooltip = obj_religious_league_war_on_winning_side_tooltip
							has_country_flag = religious_league_war_on_winning_side
						}
						hre_religion = catholic
						hre_religion_locked = yes
					}
					custom_trigger_tooltip = {
						tooltip = swe_catholic_30_years_war_ct
						OR = {
							AND = {
								NOT = { has_global_flag = evangelical_union_happened }
								is_year = 1625
							}
							AND = {
								hre_religion_locked = yes
								had_global_flag = {
									flag = evangelical_union_happened
									days = 10950
								}
							}
						}
					}
				}
			}
			else = {
				OR = {
					NOT = { hre_size = 1 }
					NOT = {
						any_known_country = {
							is_part_of_hre = yes
							NOT = { religion = catholic }
						}
					}
				}
			}
		}
		effect = {
			add_papal_influence = 200
			add_war_exhaustion = -2
			change_ruler_stat = {
				type = mil
				amount = 2
			}
			if = {
				limit = {
					has_dlc = "Art of War"
					hre_size = 1
					custom_trigger_tooltip = {
						tooltip = obj_religious_league_war_on_winning_side_tooltip
						has_country_flag = religious_league_war_on_winning_side
					}
				}
				custom_tooltip = swe_catholic_30_years_war_tt
				hidden_effect = {
					every_known_country = {
						limit = {
							is_part_of_hre = yes
							religion = catholic
						}
						add_opinion = {
							who = ROOT
							modifier = swe_protected_the_catholic_faith
						}
					}
				}
			}
			else_if = {
				limit = {
					has_dlc = "Art of War"
					hre_size = 1
					NOT = {
						OR = {
							AND = {
								has_country_flag = religious_league_war_on_winning_side
								hre_religion = catholic
								hre_religion_locked = yes
							}
							AND = {
								NOT = { has_global_flag = evangelical_union_happened }
								is_year = 1625
							}
							AND = {
								hre_religion_locked = yes
								had_global_flag = {
									flag = evangelical_union_happened
									days = 10950
								}
							}
						}
					}
				}
				custom_tooltip = swe_catholic_30_years_war_at
			}
			else = {
				change_ruler_stat = {
					type = dip
					amount = 1
				}
			}
		}
	}
	
	liv_crush_the_reformation = {
		icon = mission_thirty_years_war
		position = 6
		required_missions = { liv_support_the_emperor }
		provinces_to_highlight = {
			OR = {
				AND = {
					continent = europe
					is_reformation_center = yes
				}
				owner = {
					capital_scope = {
						continent = europe
					}
					OR = {
						religion = protestant
						religion = reformed
					}
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			NOT = { current_age = age_of_discovery }
			OR = {
				NOT = { current_age = age_of_reformation }
				custom_trigger_tooltip = {
					tooltip = teu_crusader_destroy_the_heresies_at
					NOT = {
						europe = {
							is_reformation_center = yes
						}
					}
				}
			}
			custom_trigger_tooltip = {
				tooltip = teu_crusader_destroy_the_heresies_bt
				NOT = {
					europe = {
						owner = {
							OR = {
								religion = protestant
								religion = reformed
							}
						}
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = teu_crusader_crushed_the_reformation
				duration = -1
			}
		}
	}
}

liv_orders_mission_slot = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_country_flag = liv_crusader_path
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_unite_the_orders = {
		icon = mission_united_knight_order
		position = 4
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				is_capital_of = TEU
				AND = {
					OR = {
						area = east_prussia_area
						area = west_prussia_area
					}
					NOT = { country_or_non_sovereign_subject_holds = ROOT }
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			OR = {
				TEU = {
					religion = ROOT
					if = {
						limit = { has_dlc = "Leviathan" }
						trust = {
							who = ROOT
							value = 80
						}
					}
					alliance_with = ROOT
				}
				AND = {
					east_prussia_area = {
						country_or_non_sovereign_subject_holds = ROOT
						type = all
					}
					west_prussia_area = {
						country_or_non_sovereign_subject_holds = ROOT
						type = all
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					TEU = {
						religion = ROOT
						if = {
							limit = { has_dlc = "Leviathan" }
							trust = {
								who = ROOT
								value = 80
							}
						}
						alliance_with = ROOT
					}
				}
				country_event = {
					id = flavor_liv.13
				}
			}
			else_if = {
				limit = {
					east_prussia_area = {
						country_or_non_sovereign_subject_holds = ROOT
						type = all
					}
					west_prussia_area = {
						country_or_non_sovereign_subject_holds = ROOT
						type = all
					}
				}
				add_army_professionalism = 5
				add_army_tradition = 20
				east_prussia_area = {
					add_province_modifier = {
						name = liv_united_orders
						duration = -1
					}
				}
				west_prussia_area = {
					add_province_modifier = {
						name = liv_united_orders
						duration = -1
					}
				}
			}
			else = {
				custom_tooltip = liv_unite_the_orders_tt
			}
		}
	}
	
	liv_militarize_the_knights = {
		icon = mission_livonian_intervention
		position = 6
		required_missions = { liv_unite_the_orders }
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			if = {
				limit = { has_dlc = "Cradle of Civilization" }
				army_professionalism = 40
			}
			else = {
				army_tradition = 40
			}
			has_mil_advisor_3 = yes
		}
		effect = {
			country_event = {
				id = flavor_liv.15
			}
		}
	}
	
	liv_militarized_order = {
		icon = mission_modern_knight_army
		position = 7
		required_missions = { 
			liv_militarize_the_knights
			liv_heal_the_schism
		}
		provinces_to_highlight = {}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			land_forcelimit = 60
			num_of_owned_provinces_with = {
				has_manpower_building_trigger = yes
				has_building = soldier_households
				value = 10
			}
			monthly_mil = 12
		}
		effect = {
			country_event = {
				id = flavor_liv.16
			}
		}
	}
}

liv_end_the_orthodoxy_mission_slot = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_country_flag = liv_crusader_path
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_marsh_into_novgorod = {
		icon = mission_protect_white_sea_trade
		position = 4
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				area = novgorod_area
				area = karelia_area
				area = pskov_area
				area = north_karelia
				area = pomor_area
				area = arkhangelsk_area
			}
			OR = {
				NOT = { country_or_subject_holds = ROOT }
				NOT = { religion = catholic }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = novgorod_area
					area = karelia_area
					area = pskov_area
					area = north_karelia
					area = pomor_area
					area = arkhangelsk_area
				}
				value = 5
			}
		}
		effect = {
			country_event = {
				id = flavor_liv.17
			}
			russia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	liv_end_the_third_rome = {
		icon = mission_fall_of_third_rome
		position = 5
		required_missions = { liv_marsh_into_novgorod }
		provinces_to_highlight = {
			region = russia_region
			OR = {
				owner = {
					OR = {
						NOT = { religion = ROOT }
						AND = {
							NOT = { owns_or_non_sovereign_subject_of = PREV }
							NOT = { alliance_with = ROOT }
						}
					}
				}
				NOT = { owner = { religion = catholic } }
				NOT = { religion = ROOT }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			calc_true_if = {
				desc = liv_end_the_third_rome_tt
				all_province = {
					region = russia_region
					owner = {
						OR = {
							tag = ROOT
							is_subject_of = ROOT
							alliance_with = ROOT
						}
						religion = ROOT
					}
					religion = ROOT
				}
				amount = 20
			}
		}
		effect = {
			country_event = {
				id = flavor_liv.18
			}
		}
	}
	
	liv_heal_the_schism = {
		icon = end_the_schism
		position = 6
		required_missions = { liv_end_the_third_rome }
		provinces_to_highlight = {
			region = russia_region
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				NOT = { religion = ROOT }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_heal_the_schism_at
						295 = {
							owner = { religion = catholic }
							religion = ROOT
						}
						33 = {
							owner = { religion = catholic }
							religion = ROOT
						}
						310 = {
							owner = { religion = catholic }
							religion = ROOT
						}
					}
					calc_true_if = {
						desc = liv_heal_the_schism_bt
						all_province = {
							region = russia_region
							religion = catholic
						}
						amount = 40
					}
				}
				custom_trigger_tooltip = {
					tooltip = catholics_healed_schism_tt
					has_global_flag = catholics_healed_schism
				}
			}
		}
		effect = {
			if = {
				limit = { NOT = { has_global_flag = catholics_healed_schism } }
				custom_tooltip = liv_heal_the_schism_tt
				hidden_effect = {
					set_global_flag = catholics_healed_schism
					every_country = {
						limit = { 
							religion = orthodox 
							knows_country = ROOT
						}
						country_event = { id = flavor_liv.7 }
					}
				}
			}
			else = {
				add_papal_influence = 100
			}
			add_country_modifier = {
				name = teu_crusade_end_of_the_schism
				duration = -1
			}
			if = {
				limit = {
					295 = {
						NOT = { religion = catholic }
					}
				}
				295 = { change_religion = catholic }
			}
		}
	}
}

liv_develop_russia_mission_slot = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_country_flag = liv_crusader_path
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	liv_subjugate_lithuania = {
		icon = mission_conquer_lithuania
		position = 3
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				area = lithuania_area
				area = samogitia_area
			}
			owner = {
				OR = {
					AND = {
						NOT = { tag = ROOT }
						NOT = { is_subject_of = ROOT }
						NOT = { alliance_with = ROOT }
					}
					NOT = { religion = catholic }
					tag = LIT
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			lithuania_area = {
				religion = catholic
				owner = {
					religion = catholic
					OR = {
						is_subject_of = ROOT
						AND = {
							alliance_with = ROOT
							NOT = { tag = LIT }
							NOT = { tag = PLC }
						}
						tag = ROOT
					}
				}
				type = all
			}
			samogitia_area = {
				religion = catholic
				owner = {
					religion = catholic
					OR = {
						is_subject_of = ROOT
						AND = {
							alliance_with = ROOT
							NOT = { tag = LIT }
							NOT = { tag = PLC }
						}
						tag = ROOT
					}
				}
				type = all
			}
		}
		effect = {
			ruthenia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	liv_take_over_ruthenia = {
		icon = mission_develop_kiev
		position = 4
		required_missions = { 
			liv_subjugate_lithuania 
		}
		provinces_to_highlight = {
			region = ruthenia_region
			NOT = { religion = catholic }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			ruthenia_region = {
				religion = catholic
				owner = {
					religion = catholic
					OR = {
						is_subject_of = ROOT
						alliance_with = ROOT
						tag = ROOT
					}
				}
				type = all
			}
		}
		effect = {
			add_country_modifier = {
				name = liv_the_great_conversion
				duration = 18250
			}
		}
	}
	
	liv_convert_all_of_russia = {
		icon = mission_saint_basils_cathedral
		position = 5
		required_missions = { 
			liv_take_over_ruthenia
			liv_marsh_into_novgorod
		}
		provinces_to_highlight = {
			region = russia_region
			NOT = { religion = catholic }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			russia_region = {
				religion = catholic
				owner = {
					religion = catholic
					OR = {
						is_subject_of = ROOT
						alliance_with = ROOT
						tag = ROOT
					}
				}
				type = all
			}
		}
		effect = {
			add_devotion = 25
			add_legitimacy = 25
			add_country_modifier = {
				name = liv_glory_of_the_catholic_third_rome
				duration = 9125
			}
		}
	}
	
	liv_the_catholic_bulwark = {
		icon = mission_castle_construction
		position = 6
		required_missions = { liv_convert_all_of_russia }
		provinces_to_highlight = {
			owned_by = ROOT
			NOT = { religion = catholic }
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			religious_unity = 1
			total_development = 750
			is_defender_of_faith = yes
			num_of_cardinals = 3
		}
		effect = {
			add_papal_influence = 100
			add_prestige = 50
			add_splendor = 400
		}
	}
	
	liv_support_other_catholics = {
		icon = catholic_volunteers
		position = 7
		required_missions = { liv_the_catholic_bulwark }
		provinces_to_highlight = {
			is_capital = yes
			owner = { 
				ROOT = { knows_country = PREV }
				religion = catholic
				is_at_war = yes
				NOT = { is_subject_of = ROOT }
				NOT = { ROOT = { is_renting_condottieri_to = PREV } }
				NOT = { alliance_with = ROOT }
				NOT = { subsidised_percent_amount = { value = 0.2 } }
				any_war_enemy_country = {
					NOT = { religion = catholic  }
					OR = {
						is_in_war = {
							defender_leader = THIS
							attacker_leader = PREV
						}
						is_in_war = {
							defender_leader = PREV
							attacker_leader = THIS
						}
					}
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = LIV }
			religion = catholic
			calc_true_if = {
				all_known_country = {
					religion = catholic
					custom_trigger_tooltip = {
						tooltip = liv_support_other_catholics_ct
						is_at_war = yes
						OR = {
							subsidised_percent_amount = { value = 0.2 }
							ROOT = { is_renting_condottieri_to = PREV }
							alliance_with = ROOT
						}
						any_war_enemy_country = {
							NOT = { religion = catholic }
						}
					}
				}
				amount = 3
			}
		}
		effect = {
			add_country_modifier = {
				name = liv_protector_of_the_catholics
				duration = -1
			}
			custom_tooltip = liv_support_other_catholics_tt
		}
	}
}

#Dummy Missions
liv_dummy_mission_slot_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = liv_crusader_path }
		NOT = { has_country_flag = liv_livonian_path }
	}
	has_country_shield = yes
	
	liv_dummy_mission_1 = {
		icon = mission_unknown_mission
		position = 3
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					OR = {
						has_institution = new_world_i
						has_idea = quest_for_the_new_world
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					if = {
						limit = {
							exists = PAP
						}
						alliance_with = PAP
						OR = {
							AND = {
								num_of_cardinals = 1
								invested_papal_influence = 30
							}
							AND = {
								calc_true_if = {
									has_country_modifier = papal_sanction_for_church_taxes
									has_country_modifier = papal_blessing
									has_country_modifier = papal_indulgence
									has_country_modifier = usury_forgiven
									has_country_modifier = papal_sanction_for_holy_war
									amount = 2
								}
							}
						}
					}
					else = {
						calc_true_if = {
							has_country_modifier = papal_sanction_for_church_taxes
							has_country_modifier = papal_blessing
							has_country_modifier = papal_indulgence
							has_country_modifier = usury_forgiven
							has_country_modifier = papal_sanction_for_holy_war
							amount = 2
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			create_explorer = {
				tradition = 70
			}
			add_country_modifier = {
				name = liv_lva_colonial_ambition
				duration = 9125
			}
			futa_jallon_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			manding_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			kong_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_papal_influence = 50
			define_advisor = {
				type = inquisitor
				skill = 1
				religion = ROOT
				discount = yes
			}
		}
	}
	
	liv_dummy_mission_2 = {
		icon = mission_unknown_mission
		position = 4
		required_missions = { liv_dummy_mission_1 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					OR = {
						north_america = { has_discovered = ROOT }
						south_america = { has_discovered = ROOT }
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					grown_by_states = 5
					religious_unity = 1
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_country_modifier = {
				name = "the_unknown_frontier"
				duration = 5475
			}
			add_dip_power = 50
			custom_tooltip = teu_crsuader_path_effects_tt
			add_papal_influence = 50
			add_country_modifier = {
				name = liv_unity_in_faith
				duration = 9125
			}
		}
	}
	
	liv_dummy_mission_3 = {
		icon = mission_unknown_mission
		position = 5
		required_missions = { liv_dummy_mission_2 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						continent = north_america
						value = 5
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					num_of_owned_provinces_with = {
						religion = catholic
						has_tax_building_trigger = yes
						value = 15
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			create_conquistador = {
				tradition = 50
			}
			custom_tooltip = swe_colonize_delaware_tt
			1500 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 25
					key = liv_lva_colonize_north_america_tt
				}
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_country_modifier = {
				name = liv_donations_from_the_churches
				duration = 9125
			}
			add_papal_influence = 50
			add_years_of_owned_provinces_manpower = {
				years = 4
				trigger = {
					religion = ROOT
					has_tax_building_trigger = yes
				}
				custom_tooltip = liv_land_of_churches_tt
			}
		}
	}
	
	liv_dummy_mission_4 = {
		icon = mission_unknown_mission
		position = 6
		required_missions = { liv_dummy_mission_3 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					owns_or_non_sovereign_subject_of = 502
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						colonial_region = colonial_the_carribean
						value = 5
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					num_of_owned_provinces_with = {
						religion = catholic
						base_tax = 5
						has_building = cathedral
						value = 10
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_navy_tradition = 10
			502 = {
				center_of_trade = 1
			}
			1516 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 25
					key = liv_lva_livonian_caribbeans_tt
				}
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_stability_or_adm_power = yes
			unlock_estate_privilege = {
				estate_privilege = estate_nobles_religious_conscription
			}
		}
	}
	
	liv_dummy_mission_5 = {
		icon = mission_unknown_mission
		position = 7
		required_missions = { liv_dummy_mission_4 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					calc_true_if = {
						custom_trigger_tooltip = {
							tooltip = liv_lva_dominate_colonial_trade_tt
							1490 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							1486 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							2526 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							1500 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							1507 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							2499 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							1551 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							1516 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							4637 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							835 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							2935 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							809 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							800 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							1531 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							1536 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
							2868 = { OR = { is_strongest_trade_power = ROOT trade_share = { country = ROOT share = 35 } } }
						}
						amount = 4
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					if = {
						limit = {
							has_dlc = "Emperor"
						}
						is_defender_of_faith_of_tier = 5
					}
					else = {
						is_defender_of_faith = yes
					}
					custom_trigger_tooltip = {
						tooltip = liv_proclaim_defender_of_faith_tt
						had_country_flag = {
							flag = claimed_defender_of_faith_flag
							days = 9125
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_years_of_income = 2
			add_country_modifier = {
				name = liv_lva_american_trade_dominance
				duration = -1
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_country_modifier = {
				name = liv_the_livonian_defender
				duration = -1
				desc = liv_the_livonian_defender_tt
			}
			custom_tooltip = liv_proclaim_defender_of_faith_ct
			set_country_flag = liv_the_livonian_defender_flag
		}
	}
}
liv_dummy_mission_slot_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = liv_crusader_path }
		NOT = { has_country_flag = liv_livonian_path }
	}
	has_country_shield = yes
	
	liv_dummy_mission_6 = {
		icon = mission_unknown_mission
		position = 4
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					OR = {
						owns_core_province = 2239
						owns_core_province = 1114
					}
					calc_true_if = {
						owns_core_province = 2252
						owns_core_province = 1121
						owns_core_province = 1120
						amount = 2
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					is_religion_enabled = protestant
					OR = {
						alliance_with = emperor
						NOT = { hre_size = 1 }
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			custom_tooltip = liv_lva_colonize_west_africa_tt
			cape_of_good_hope_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_dip_power = 100
			if = {
				limit = {
					hre_size = 1
				}
				add_trust = {
					who = emperor
					value = 15
					mutual = yes
				}
			}
		}
	}
	
	liv_dummy_mission_7 = {
		icon = mission_unknown_mission
		position = 5
		required_missions = { liv_dummy_mission_6 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					owns_core_province = 1177
					1460 = {
						OR = {
							is_strongest_trade_power = ROOT
							trade_share = {
								country = ROOT
								share = 20
							}
						}
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					if = {
						limit = {
							has_dlc = "Art of War"
						}
						OR = {
							NOT = { hre_size = 1 }
							AND = {
								custom_trigger_tooltip = {
									tooltip = obj_religious_league_war_on_winning_side_tooltip
									has_country_flag = religious_league_war_on_winning_side
								}
								hre_religion = catholic
								hre_religion_locked = yes
							}
							custom_trigger_tooltip = {
								tooltip = swe_catholic_30_years_war_ct
								OR = {
									AND = {
										NOT = { has_global_flag = evangelical_union_happened }
										is_year = 1625
									}
									AND = {
										hre_religion_locked = yes
										had_global_flag = {
											flag = evangelical_union_happened
											days = 10950
										}
									}
								}
							}
						}
					}
					else = {
						OR = {
							NOT = { hre_size = 1 }
							NOT = {
								any_known_country = {
									is_part_of_hre = yes
									NOT = { religion = catholic }
								}
							}
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			1177 = {
				add_building = stock_exchange
			}
			add_mercantilism = 5
			custom_tooltip = liv_lva_reach_the_cape_tt
			custom_tooltip = teu_crsuader_path_effects_tt
			add_papal_influence = 200
			add_war_exhaustion = -2
			change_ruler_stat = {
				type = mil
				amount = 2
			}
			if = {
				limit = {
					has_dlc = "Art of War"
					hre_size = 1
					custom_trigger_tooltip = {
						tooltip = obj_religious_league_war_on_winning_side_tooltip
						has_country_flag = religious_league_war_on_winning_side
					}
				}
				custom_tooltip = swe_catholic_30_years_war_tt
				hidden_effect = {
					every_known_country = {
						limit = {
							is_part_of_hre = yes
							religion = catholic
						}
						add_opinion = {
							who = ROOT
							modifier = swe_protected_the_catholic_faith
						}
					}
				}
			}
			else_if = {
				limit = {
					has_dlc = "Art of War"
					hre_size = 1
					NOT = {
						OR = {
							AND = {
								has_country_flag = religious_league_war_on_winning_side
								hre_religion = catholic
								hre_religion_locked = yes
							}
							AND = {
								NOT = { has_global_flag = evangelical_union_happened }
								is_year = 1625
							}
							AND = {
								hre_religion_locked = yes
								had_global_flag = {
									flag = evangelical_union_happened
									days = 10950
								}
							}
						}
					}
				}
				custom_tooltip = swe_catholic_30_years_war_at
			}
			else = {
				change_ruler_stat = {
					type = dip
					amount = 1
				}
			}
		}
	}
	
	liv_dummy_mission_8 = {
		icon = mission_unknown_mission
		position = 6
		required_missions = { liv_dummy_mission_7 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						custom_trigger_tooltip = {
							tooltip = liv_lva_trade_in_india_tt
							OR = {
								area = kanara_area
								area = malabar_area
								area = madura_area
								area = tanjore_area
								area = south_carnatic_area
								area = andhra_area
								area = lanka_area
								area = south_lanka_area
							}
						}
						OR = {
							has_river_estuary_trigger = yes
							province_has_center_of_trade_of_level = 1
						}
						value = 4
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					NOT = { current_age = age_of_discovery }
					OR = {
						NOT = { current_age = age_of_reformation }
						custom_trigger_tooltip = {
							tooltip = teu_crusader_destroy_the_heresies_at
							NOT = {
								europe = {
									is_reformation_center = yes
								}
							}
						}
					}
					custom_trigger_tooltip = {
						tooltip = teu_crusader_destroy_the_heresies_bt
						NOT = {
							europe = {
								owner = {
									OR = {
										religion = protestant
										religion = reformed
									}
								}
							}
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_country_modifier = {
				name = liv_lva_indian_trade
				duration = -1
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_country_modifier = {
				name = teu_crusader_crushed_the_reformation
				duration = -1
			}
		}
	}
}
liv_dummy_mission_slot_3 = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = liv_crusader_path }
		NOT = { has_country_flag = liv_livonian_path }
	}
	has_country_shield = yes
	
	liv_dummy_mission_9 = {
		icon = mission_unknown_mission
		position = 4
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					owns_core_province = 37
					owns_core_province = 36
					owns_core_province = 39
					owns_core_province = 1935
					owns_core_province = 1834
					reform_level = 3
					stability = 2
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					OR = {
						TEU = {
							religion = ROOT
							trust = {
								who = ROOT
								value = 80
							}
							alliance_with = ROOT
						}
						AND = {
							east_prussia_area = {
								country_or_non_sovereign_subject_holds = ROOT
								type = all
							}
							west_prussia_area = {
								country_or_non_sovereign_subject_holds = ROOT
								type = all
							}
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			if = {
				limit = {
					tag = LIV
				}
				country_event = {
					id = flavor_liv.4
				}
			}
			else = {
				add_prestige_or_monarch_power = {
					amount = 50
				}
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			if = {
				limit = {
					TEU = {
						religion = ROOT
						trust = {
							who = ROOT
							value = 80
						}
						alliance_with = ROOT
					}
				}
				country_event = {
					id = flavor_liv.13
				}
			}
			else_if = {
				limit = {
					east_prussia_area = {
						country_or_non_sovereign_subject_holds = ROOT
						type = all
					}
					west_prussia_area = {
						country_or_non_sovereign_subject_holds = ROOT
						type = all
					}
				}
				add_army_professionalism = 5
				add_army_tradition = 20
				east_prussia_area = {
					add_province_modifier = {
						name = liv_united_orders
						duration = -1
					}
				}
				west_prussia_area = {
					add_province_modifier = {
						name = liv_united_orders
						duration = -1
					}
				}
			}
			else = {
				custom_tooltip = liv_unite_the_orders_tt
			}
		}
	}
	
	liv_dummy_mission_10 = {
		icon = mission_unknown_mission
		position = 5
		required_missions = { liv_dummy_mission_9 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			custom_trigger_tooltip = {
				tooltip = liv_livonian_path_tt
				always = no
			}
			num_of_light_ship = 15
			num_of_admirals = 1
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_mercantilism = 3
			add_country_modifier = {
				name = liv_lva_merchant_fleet
				duration = 9125
			}
		}
	}
	
	liv_dummy_mission_11 = {
		icon = mission_unknown_mission
		position = 6
		required_missions = { liv_dummy_mission_10 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					mercantilism = 15
					owns_core_province = 37
					num_of_owned_provinces_with = {
						OR = {
							area = curonia_area
							area = livonia_area
							area = estonia_ingria_area
						}
						has_trade_building_trigger = yes
						value = 5
					}
					1926 = {
						has_merchant = ROOT
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					if = {
						limit = { has_dlc = "Cradle of Civilization" }
						army_professionalism = 40
					}
					else = {
						army_tradition = 40
					}
					has_mil_advisor_3 = yes
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			45 = {
				add_trade_modifier = {
					who = ROOT
					duration = 18250
					power = 25
					key = liv_lva_construct_markets_tt
				}
			}
			1926 = {
				add_trade_modifier = {
					who = ROOT
					duration = 18250
					power = 25
					key = liv_lva_construct_markets_tt
				}
			}
			1926 = {
				add_trade_node_income = 50
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			country_event = {
				id = flavor_liv.15
			}
		}
	}
	
	liv_dummy_mission_12 = {
		icon = mission_unknown_mission
		position = 7
		required_missions = { liv_dummy_mission_11 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					trader = 3
					if = {
						limit = {
							exists = HSA
						}
						OR = {
							is_in_war = {
								attacker_leader = ROOT
								defender_leader = HSA
								war_score = 75
							}
							owns_or_non_sovereign_subject_of = 45
						}
					}
					else = {
						45 = {
							OR = {
								is_strongest_trade_power = ROOT
								country_or_non_sovereign_subject_holds = ROOT
								controlled_by = ROOT
							}
						}
					}
					45 = { has_merchant = ROOT }
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					land_forcelimit = 60
					num_of_owned_provinces_with = {
						has_manpower_building_trigger = yes
						has_building = soldier_households
						value = 10
					}
					monthly_mil = 12
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_years_of_trade_income = {
				custom_tooltip = dan_the_german_trade_cities_ct
				years = 4
			}
			if = {
				limit = {
					OR = {
						owns = 2971
						owns = 44
						owns = 45
						owns = 1775
						owns = 47
						owns = 1858
						owns = 4142
						owns = 12
						owns = 4163
						owns = 17
					}
				}
				45 = {
					add_trade_modifier = {
						who = ROOT
						duration = -1
						power = 20
						key = liv_lva_dominate_lubeck_trade_provinces
					}
				}
			}
			else = {
				45 = {
					add_trade_modifier = {
						who = ROOT
						duration = -1
						power = 50
						key = liv_lva_dominate_lubeck_trade_no_provinces
					}
				}
				custom_tooltip = liv_lva_dominate_lubeck_trade_tt
				set_country_flag = liv_lva_dominate_lubeck_trade_flag
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			country_event = {
				id = flavor_liv.16
			}
		}
	}
}
liv_dummy_mission_slot_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = liv_crusader_path }
		NOT = { has_country_flag = liv_livonian_path }
	}
	has_country_shield = yes
	
	liv_dummy_mission_13 = {
		icon = mission_unknown_mission
		position = 4
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					OR = {
						custom_trigger_tooltip = {
							tooltip = liv_lva_prussian_alliance_at
							alliance_with = PRU
							OR = {
								is_in_war = {
									attacker_leader = PRU
									attackers = ROOT
									war_score = 50
								}
								is_in_war = {
									attacker_leader = ROOT
									attackers = PRU
									war_score = 50
								}
								is_in_war = {
									defender_leader = PRU
									defenders = ROOT
									war_score = 50
								}
								is_in_war = {
									defender_leader = ROOT
									defenders = PRU
									war_score = 50
								}
							}
						}
						custom_trigger_tooltip = {
							tooltip = liv_lva_prussian_alliance_bt
							any_subject_country = {
								tag = PRU
								NOT = { liberty_desire = 10 }
							}
						}
						custom_trigger_tooltip = {
							tooltip = liv_lva_prussian_alliance_ct
							east_prussia_area = {
								owned_by = ROOT
								type = all
							}
							west_prussia_area = {
								owned_by = ROOT
								type = all
							}
							accepted_culture = prussian
						}
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						OR = {
							area = novgorod_area
							area = karelia_area
							area = pskov_area
							area = north_karelia
							area = pomor_area
							area = arkhangelsk_area
						}
						value = 5
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			if = {
				limit = {
					alliance_with = PRU
					OR = {
						is_in_war = {
							attacker_leader = PRU
							attackers = ROOT
							war_score = 50
						}
						is_in_war = {
							attacker_leader = ROOT
							attackers = PRU
							war_score = 50
						}
						is_in_war = {
							defender_leader = PRU
							defenders = ROOT
							war_score = 50
						}
						is_in_war = {
							defender_leader = ROOT
							defenders = PRU
							war_score = 50
						}
					}
				}
				country_event = {
					id = flavor_liv.5
				}
			}
			else_if = {
				limit = {
					OR = {
						any_subject_country = {
							tag = PRU
							NOT = { liberty_desire = 10 }
						}
						AND = {
							east_prussia_area = {
								owned_by = ROOT
								type = all
							}
							west_prussia_area = {
								owned_by = ROOT
								type = all
							}
							accepted_culture = prussian
						}
					}
				} 
				add_country_modifier = {
					name = liv_lva_prussian_military
					duration = 10950
				}
			}
			else = {
				custom_tooltip = liv_lva_prussian_alliance_dt
			}
			unlock_merc_company = {
				merc_company = merc_prussian_volunteer_army
				free_merc = yes
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			country_event = {
				id = flavor_liv.17
			}
			russia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	liv_dummy_mission_14 = {
		icon = mission_unknown_mission
		position = 5
		required_missions = { liv_dummy_mission_13 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					adm_power_cost = 500
					has_any_disaster = no
					is_at_war = no
					NOT = { num_of_rebel_armies = 1 }
					NOT = { num_of_rebel_controlled_provinces = 1 }
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					calc_true_if = {
						desc = liv_end_the_third_rome_tt
						all_province = {
							region = russia_region
							owner = {
								OR = {
									tag = ROOT
									is_subject_of = ROOT
									alliance_with = ROOT
								}
								religion = ROOT
							}
							religion = ROOT
						}
						amount = 20
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			country_event = {
				id = flavor_liv.6
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			country_event = {
				id = flavor_liv.18
			}
		}
	}
	
	liv_dummy_mission_15 = {
		icon = mission_unknown_mission
		position = 6
		required_missions = { liv_dummy_mission_14 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					monthly_adm = 10
					monthly_dip = 10
					monthly_mil = 10
					stability = 2
					has_any_disaster = no
					is_at_war = no
					NOT = { num_of_rebel_armies = 1 }
					NOT = { num_of_rebel_controlled_provinces = 1 }
					custom_trigger_tooltip = {
						tooltip = liv_lva_complete_your_government_tt
						check_variable = {
							which = liv_event_counter
							value = 6
						}
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					OR = {
						AND = {
							295 = {
								owner = { religion = catholic }
								religion = ROOT
							}
							33 = {
								owner = { religion = catholic }
								religion = ROOT
							}
							310 = {
								owner = { religion = catholic }
								religion = ROOT
							}
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								region = russia_region
								religion = catholic
								value = 40
							}
						}
						custom_trigger_tooltip = {
							tooltip = catholics_healed_schism_tt
							has_global_flag = catholics_healed_schism
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			country_event = {
				id = flavor_liv.31
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			if = {
				limit = { NOT = { has_global_flag = catholics_healed_schism } }
				custom_tooltip = teu_crusader_end_the_schism_tt
				hidden_effect = {
					set_global_flag = catholics_healed_schism
					every_country = {
						limit = { 
							religion = orthodox 
							knows_country = ROOT
						}
						country_event = { id = flavor_liv.7 }
					}
				}
			}
			else = {
				add_papal_influence = 100
			}
			add_country_modifier = {
				name = teu_crusade_end_of_the_schism
				duration = -1
			}
			if = {
				limit = {
					295 = {
						NOT = { religion = catholic }
					}
				}
				295 = { change_religion = catholic }
			}
		}
	}
}
liv_dummy_mission_slot_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		tag = LIV
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = liv_crusader_path }
		NOT = { has_country_flag = liv_livonian_path }
	}
	has_country_shield = yes
	
	liv_dummy_mission_16 = {
		icon = mission_unknown_mission
		position = 3
		required_missions = {  }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					custom_trigger_tooltip = {
						tooltip = liv_lva_develop_livonia_tt
						estonia_ingria_area = {
							owned_by = ROOT
							development = 10
							type = all
						}
						curonia_area = {
							owned_by = ROOT
							development = 10
							type = all
						}
						livonia_area = {
							OR = {
								province_id = 38
								AND = {
									owned_by = ROOT
									development = 10
								}
							}
							type = all
						}
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					lithuania_area = {
						religion = catholic
						owner = {
							religion = catholic
							OR = {
								is_subject_of = ROOT
								AND = {
									alliance_with = ROOT
									NOT = { tag = LIT }
									NOT = { tag = PLC }
								}
								tag = ROOT
							}
						}
						type = all
					}
					samogitia_area = {
						religion = catholic
						owner = {
							religion = catholic
							OR = {
								is_subject_of = ROOT
								AND = {
									alliance_with = ROOT
									NOT = { tag = LIT }
									NOT = { tag = PLC }
								}
								tag = ROOT
							}
						}
						type = all
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_stability_or_adm_power = yes
			custom_tooltip = liv_lva_develop_livonia_ct
			hidden_effect = {
				every_owned_province = {
					limit = {
						OR = {
							area = estonia_ingria_area
							area = curonia_area
							area = livonia_area
						}
						development = 10
					}
					add_province_modifier = {
						name = liv_lva_expanded_land
						duration = 9125
					}
				}
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			ruthenia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	liv_dummy_mission_17 = {
		icon = mission_unknown_mission
		position = 4
		required_missions = { liv_dummy_mission_16 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					38 = {
						development = 20
						has_tax_building_trigger = yes
						has_production_building_trigger = yes
						has_trade_building_trigger = yes
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					ruthenia_region = {
						religion = catholic
						owner = {
							religion = catholic
							OR = {
								is_subject_of = ROOT
								alliance_with = ROOT
								tag = ROOT
							}
						}
						type = all
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			if = {
				limit = { is_part_of_hre = yes }
				38 = { set_in_empire = yes }
			}
			set_capital = 38
			38 = {
				set_center_level_3_center_of_trade = yes
				add_province_modifier = {
					name = liv_lva_the_new_capital
					duration = -1
				}
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_country_modifier = {
				name = liv_the_great_conversion
				duration = 18250
			}
		}
	}
	
	liv_dummy_mission_18 = {
		icon = mission_unknown_mission
		position = 5
		required_missions = { liv_dummy_mission_17 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					if = {
						limit = { has_dlc = "Rule Britannia" }
						innovativeness = 30
					}
					OR = {
						has_institution = enlightenment
						has_idea_group = innovativeness_ideas
					}
					num_of_owned_provinces_with = {
						has_building = university
						development = 20
						value = 10
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					russia_region = {
						religion = catholic
						owner = {
							religion = catholic
							OR = {
								is_subject_of = ROOT
								alliance_with = ROOT
								tag = ROOT
							}
						}
						type = all
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_adm_power = 200
			capital_scope = {
				add_province_modifier = {
					name = liv_lva_seat_of_the_livonian_enlightenment
					duration = -1
				}
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_devotion = 25
			add_legitimacy = 25
			add_country_modifier = {
				name = liv_glory_of_the_catholic_third_rome
				duration = 9125
			}
		}
	}
	
	liv_dummy_mission_19 = {
		icon = mission_unknown_mission
		position = 6
		required_missions = { liv_dummy_mission_18 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					owns_core_province = 33
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					religious_unity = 1
					total_development = 750
					is_defender_of_faith = yes
					num_of_cardinals = 3
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			add_accepted_culture_or_dip_power = {
				culture = novgorodian
				value = 100
			}
			karelia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			novgorod_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tver_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			pskov_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_papal_influence = 100
			add_prestige = 50
			add_splendor = 400
		}
	}
	
	liv_dummy_mission_20 = {
		icon = mission_unknown_mission
		position = 7
		required_missions = { liv_dummy_mission_19 }
		provinces_to_highlight = {}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = liv_livonian_path_tt
						always = no
					}
					if = {
						limit = { exists = PLC }
						OR = {
							has_won_war_against = {
								who = PLC
								max_years_since = 50
							}
							PLC = {
								alliance_with = ROOT
								trust = {
									who = ROOT
									value = 75
								}
							}
						}
					}
					else_if = {
						limit = { exists = POL }
						OR = {
							has_won_war_against = {
								who = POL
								max_years_since = 50
							}
							POL = {
								alliance_with = ROOT
								trust = {
									who = ROOT
									value = 75
								}
							}
						}
					}
					else = {
						NOT = { exists = POL }
						NOT = { exists = PLC }
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = teu_crusader_path_tt
						always = no
					}
					religion = catholic
					calc_true_if = {
						all_known_country = {
							religion = catholic
							custom_trigger_tooltip = {
								tooltip = liv_support_other_catholics_ct
								always = no
							}
						}
						amount = 3
					}
				}
			}
		}
		effect = {
			custom_tooltip = liv_livonian_path_effects_tt
			if = {
				limit = {
					OR = {
						has_won_war_against = {
							who = PLC
							max_years_since = 50
						}
						has_won_war_against = {
							who = POL
							max_years_since = 50
						}
					}
				}
				add_country_modifier = {
					name = liv_lva_defeated_poland
					duration = 9125
				}
			}
			else_if = {
				limit = {
					OR = {
						PLC = {
							alliance_with = ROOT
							trust = {
								who = ROOT
								value = 75
							}
						}
						POL = {
							alliance_with = ROOT
							trust = {
								who = ROOT
								value = 75
							}
						}
					}
				}
				add_country_modifier = {
					name = liv_lva_allied_poland
					duration = 9125
				}
			}
			else_if = {
				limit = {
					NOT = { exists = POL }
					NOT = { exists = PLC }
				}
				add_country_modifier = {
					name = liv_lva_conquered_poland
					duration = 9125
				}
			}
			else = {
				custom_tooltip = liv_lva_handle_polish_threat_tt
			}
			custom_tooltip = teu_crsuader_path_effects_tt
			add_country_modifier = {
				name = liv_protector_of_the_catholics
				duration = -1
			}
			custom_tooltip = liv_support_other_catholics_tt
		}
	}
}