poland_sca_slot_1 = { 
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = PLC 
			tag = POL 
		}
	}
	has_country_shield = yes
	
	pol_leverage_magnates = {
		icon = mission_noble_council
		required_missions = { } 
		position = 1 
		trigger = {
			if = { 
				limit = { has_estate = estate_nobles } 
				OR = { 
					AND = { 
						estate_loyalty = { 
							estate = estate_nobles 
							loyalty = 65 
						}
						num_of_estate_privileges = {
							estate = estate_nobles 
							value = 5
						}
						custom_trigger_tooltip = {
							tooltip = accepted_nieszawa_privileges
							has_estate_privilege = estate_nobles_nieszawa_privileges
						}
						
					}
					AND = { 
						custom_trigger_tooltip = {
							tooltip = declined_nieszawa_privileges
							NOT = { has_estate_privilege = estate_nobles_nieszawa_privileges } 
							has_country_flag = pol_had_nieszawa_privileges_country_flag
						}
						NOT = { 
							num_of_estate_privileges = {
								estate = estate_nobles 
								value = 4
							}
						}
						crown_land_share = 50
					}
				}
			}
			else = {
				custom_trigger_tooltip = {
					tooltip = declined_nieszawa_privileges
					NOT = { has_estate_privilege = estate_nobles_nieszawa_privileges } 
					has_country_flag = pol_had_nieszawa_privileges_country_flag
				}
				NOT = { 
					num_of_estate_privileges = {
						estate = estate_nobles 
						value = 2
					}
				}
				crown_land_share = 50
			}
			if = { 
				limit = { 
					NOT = { 
						current_age = age_of_reformation 
						current_age = age_of_discovery 
					}
				}
				absolutism = 75 
				crown_land_share = 80 
			}
		}
		effect = {
			custom_tooltip = pol_if_noble_cooperation_tt
			tooltip = {
				add_country_modifier = { 
					name = pol_crimson_privileges_modifier
					duration = -1 
					desc = until_we_centralize_tt
				}
				if = { 
					limit = { has_parliament = yes } 
					halves_parliament_bribe_costs = yes
				}
				else = { add_dip_power = 50 }
			}
			custom_tooltip = pol_alternatively_rebellion_tt
			tooltip = {
				country_event = { id = flavor_pol.23 } 
			}
			hidden_effect = {
				if = { 
					limit = { has_estate_privilege = estate_nobles_nieszawa_privileges }
					add_country_modifier = { 
						name = pol_crimson_privileges_modifier
						duration = -1 
						desc = until_we_centralize_tt
					}
					halves_parliament_bribe_costs = yes		
				}
				else = {
					set_country_flag = pol_killed_rebel_flag 
					country_event = { id = flavor_pol.23 } 
				}
				clr_country_flag = pol_had_nieszawa_privileges_country_flag
			}			
		}
	}
	
	pol_great_sejm = { 
		icon = catholic_volunteers
		required_missions = { pol_leverage_magnates } 
		position = 2 
		trigger = { 
			if = { 
				limit = { has_parliament = yes } 
				current_size_of_parliament = 10 
				num_of_issues_passed = { 
					amount = 6
				}
				stability = 2 
				monthly_adm = 10 
			}
			else = {
				stability = 2 
				monthly_adm = 10 
				crown_land_share = 50 
			}
		}
		effect = {
			unlock_new_issues = yes
			if =  {
				limit = { 
					has_dlc = "Rights of Man"
					NOT = { num_of_ruler_traits = { amount = 3 } }
				}
				add_ruler_personality = reformist_personality 
			}
			else = { change_government_reform_progress = 100 } 
		}
	}
}

poland_sca_slot_1_b = { 
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC }
	}
	has_country_shield = yes
	
	pol_branching_mission_aa = {
		icon = mission_locked_mission
		required_missions = { pol_great_sejm } 
		position = 4 
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			reform_level = 3 
			OR = {
				monthly_adm = 13
				monthly_dip = 13
				adm = 5 
				dip = 5 
			}
			if = { 
				limit = { has_government_attribute = is_elective } 
				OR = { 
					custom_trigger_tooltip = {
						tooltip = pol_had_pacta_conventa_event_tt 
						has_estate_privilege = estate_nobles_pacta_conventa
					}
					custom_trigger_tooltip = {
						tooltip = pol_chose_to_undo_nobles_tt
						has_country_flag = pol_killed_rebel_flag 
					}
					NOT = { 
						estate_influence = {
							estate = estate_nobles 
							influence = 25 
						}
					}
				}
			}
			OR = {
				crown_land_share = 55 
				army_size = 35 # modified
				num_of_estate_privileges = {	
					estate = estate_nobles 
					value = 6 
				}
			}
		}
		effect = {
			custom_tooltip = pol_if_pacta_conventa_tt 
			tooltip = { 
				change_estate_land_share = {
					estate = all
					share = -5
				}
			}
			custom_tooltip = pol_if_undo_nobles_tt
			tooltip = {
				add_country_modifier = {
					name = pol_new_henrikian_articles_modifier
					duration = -1 
				}
			}
			custom_tooltip = pol_alternatively_tt 
			tooltip = {
				add_power_projection = {
					type = mission_rewards_power_projection
					amount = 25
				}
				add_adm_power = 100 
			}
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}		
	
	pol_branching_mission_gl = { 
		icon = mission_locked_mission
		position = 5 
		required_missions = { pol_branching_mission_aa }
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			OR = { 
				custom_trigger_tooltip = {
					tooltip = pol_has_had_struggle_for_royal_power_disater_tt
					OR = {
						has_country_flag = pol_royal_power_non_monarchy_won_flag
						has_country_flag = pol_royal_power_monarchy_won_flag
					}
				}
				NOT = { has_estate_privilege = estate_nobles_golden_liberty } 
			}
			OR = { 
				absolutism = 60 
				republican_tradition = 85 
				devotion = 95 
			}
			stability = 3 
		}
		effect = {
			custom_tooltip = pol_if_bent_nobles_and_monarchy_tt
			tooltip = { add_government_reform = polish_autocratic_monarchy } 
			custom_tooltip = pol_if_bent_nobles_and_republic_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_cardinal_laws_modifier
					duration = -1 
				}
			}
			clr_country_flag = pol_royal_power_monarchy_won_flag
			clr_country_flag = pol_royal_power_non_monarchy_won_flag
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
	
	pol_branching_mission_ga = {
		icon = mission_locked_mission
		required_missions = { pol_branching_mission_gl }
		position = 7
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			has_final_tier_reforms_trigger = yes
			has_institution = enlightenment
			OR = {
				absolutism = 100
				republican_tradition = 90 
			}
		}
		effect = {
			country_event = { id = flavor_pol.24 }
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_1_plc_1 = { 
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC 
	}
	has_country_shield = yes
	
	plc_articles_agreement = {
		icon = subiaco_press
		required_missions = { pol_great_sejm } 
		position = 4 
		trigger = {
			reform_level = 3 
			OR = {
				monthly_adm = 13
				monthly_dip = 13
				adm = 5 
				dip = 5 
			}
			if = { 
				limit = { has_government_attribute = is_elective } 
				OR = { 
					custom_trigger_tooltip = {
						tooltip = pol_had_pacta_conventa_event_tt 
						has_estate_privilege = estate_nobles_pacta_conventa
					}
					custom_trigger_tooltip = {
						tooltip = pol_chose_to_undo_nobles_tt
						has_country_flag = pol_killed_rebel_flag 
					}
					NOT = { 
						estate_influence = {
							estate = estate_nobles 
							influence = 25 
						}
					}
				}
			}
			OR = {
				crown_land_share = 55 
				army_size = 35 # modified
				num_of_estate_privileges = {	
					estate = estate_nobles 
					value = 6 
				}
			}
		}
		effect = {
			custom_tooltip = pol_if_pacta_conventa_tt 
			tooltip = { 
				change_estate_land_share = {
					estate = all
					share = -5
				}
			}
			custom_tooltip = pol_if_undo_nobles_tt
			tooltip = {
				add_country_modifier = {
					name = pol_new_henrikian_articles_modifier
					duration = -1 
				}
			}
			custom_tooltip = pol_alternatively_tt 
			tooltip = {
				add_power_projection = {
					type = mission_rewards_power_projection
					amount = 25
				}
				add_adm_power = 100 
			}
			hidden_effect = {
				if = { 
					limit = { has_estate_privilege = estate_nobles_pacta_conventa }
					change_estate_land_share = {
						estate = all
						share = -5
					}
					set_country_flag = pol_enable_pacta_conventa_decision_flag 
				}
				if = { 
					limit = { has_country_flag = pol_killed_rebel_flag }
					add_country_modifier = {
						name = pol_new_henrikian_articles_modifier
						duration = -1 
					}
				}
				else = {
					add_power_projection = {
						type = mission_rewards_power_projection
						amount = 25
					}
					add_adm_power = 100 
				}
			}
		}
	}
	
	plc_golden_liberty = {
		icon = mission_plc_golden_liberty
		position = 5 
		required_missions = { plc_articles_agreement }
		trigger = {
			OR = { 
				custom_trigger_tooltip = {
					tooltip = pol_has_had_struggle_for_royal_power_disater_tt
					OR = {
						has_country_flag = pol_royal_power_non_monarchy_won_flag
						has_country_flag = pol_royal_power_monarchy_won_flag
					}
				}
				NOT = { has_estate_privilege = estate_nobles_golden_liberty }
			}
			OR = { 
				absolutism = 60 
				republican_tradition = 85 
				devotion = 95 
			}
			stability = 3 
		}
		effect = {
			custom_tooltip = pol_if_bent_nobles_and_monarchy_tt
			tooltip = { add_government_reform = polish_autocratic_monarchy } 
			custom_tooltip = pol_if_bent_nobles_and_republic_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_cardinal_laws_modifier
					duration = -1 
				}
			}
			hidden_effect = {
				if = {
					limit = { government = monarchy }
					add_government_reform = polish_autocratic_monarchy
				}
				else = {
					add_country_modifier = { 
						name = pol_cardinal_laws_modifier
						duration = -1 
					}
				}
			}
			clr_country_flag = pol_royal_power_monarchy_won_flag
			clr_country_flag = pol_royal_power_non_monarchy_won_flag
		}
	}
	
	plc_governance_act = {
		icon = mission_plc_governance_act
		required_missions = { plc_golden_liberty }
		position = 7
		trigger = {
			has_final_tier_reforms_trigger = yes
			has_institution = enlightenment
			OR = {
				absolutism = 100
				republican_tradition = 90 
			}
		}
		effect = {
			country_event = { id = flavor_pol.24 }
		}
	}
}

poland_sca_slot_1_c = { 
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = PLC 
			tag = POL 
		}
	}
	has_country_shield = yes
	
	pol_moldavia = {
		icon = mission_pol_moldavia 
		required_missions = {  }
		position = 9
		provinces_to_highlight = { 
			area = moldavia_area 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			moldavia_area = {
				type = all 
				OR = { 
					country_or_non_sovereign_subject_holds = ROOT 
					AND = { 
						MOL = { is_subject_of = HUN }
						HUN = { is_subject_of = ROOT }
					}
				}
			}
		}
		effect = { 
			wallachia_area = { 
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			custom_tooltip = pol_if_mol_is_subject_tt
			tooltip = { 
				country_event = { id = flavor_pol.29 } 
			}
			custom_tooltip = pol_alternatively_tt 
			tooltip = { 
				moldavia_area = { add_base_tax = 1 }
				if = { 
					limit = { has_estate = estate_cossacks } 
					add_estate_loyalty = { 
						estate = estate_cossacks 
						loyalty = 15 
					}
				}
				else_if = { 
					limit = { has_estate = estate_nobles } 
					add_estate_loyalty = { 
						estate = estate_nobles 
						loyalty = 10 
					}
				}
				else = { add_prestige = 10 } 
			}
			hidden_effect = { 
				if = { 
					limit = { 
						MOL = { is_subject_of = ROOT } 
					}
					country_event = { id = flavor_pol.29 }
				}
				else = { 
					moldavia_area = { add_base_tax = 1 }
				}
				if = { 
					limit = { has_estate = estate_cossacks } 
					add_estate_loyalty = { 
						estate = estate_cossacks 
						loyalty = 15 
					}
				}
				else_if = { 
					limit = { has_estate = estate_nobles } 
					add_estate_loyalty = { 
						estate = estate_nobles 
						loyalty = 10 
					}
				}
				else = { add_prestige = 10 }
			}
		}
	}
}

poland_sca_slot_1_d = { 
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL
		NOT = { tag = PLC }
	}
	has_country_shield = yes

	pol_branching_mission_constantinople = {
		icon = mission_locked_mission 
		required_missions = { pol_moldavia pol_wallachia }
		position = 10
		provinces_to_highlight = { 
			region = balkan_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = balkan_region 
				value = 10 
			}		
		}
		effect = { 
			set_country_flag = enable_unite_balkans_cb_flag
			custom_tooltip = enable_unite_balkans_cb_tt
			add_country_modifier = {
				name = pol_uniting_the_fractures_modifier
				duration = 5475 
			}
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_1_plc_2 = { 
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC 
	}
	has_country_shield = yes
	
	plc_cross_wild_field = {
		icon = mission_plc_cross_wild_field  
		required_missions = { pol_moldavia pol_wallachia }
		position = 10
		provinces_to_highlight = { 
			region = balkan_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = { 
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = balkan_region 
				value = 10 
			}		
		}
		effect = { 
			set_country_flag = enable_unite_balkans_cb_flag
			custom_tooltip = enable_unite_balkans_cb_tt
			add_country_modifier = {
				name = pol_uniting_the_fractures_modifier
				duration = 5475 
			}
		}
	}
}	

poland_sca_slot_2_a = { 
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
			has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = {
			tag = POL 
			tag = PLC 
		}
	}
	has_country_shield = yes
	
	pol_throne_bohemia = {
		icon = mission_pol_throne_bohemia
		required_missions = { pol_varna_aftermath }
		position = 2 
		provinces_to_highlight = { 
			OR = {
				area = silesia_area
				area = moravia_area 
				area = bohemia_area
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				owner = { 
					NOT = { alliance_with = ROOT }
				}
				owner = { 
					overlord = {
						NOT = { alliance_with = ROOT }
					}
				}
			}
		}
		trigger = { 
			OR = { 
				AND = {
					silesia_area = {
						OR = {
							country_or_non_sovereign_subject_holds = ROOT 
							custom_trigger_tooltip = {
								tooltip = owned_by_ally_or_ally_subject_tt
								owner = {
									OR = {
										alliance_with = ROOT
										overlord = { alliance_with = ROOT }
									}
								}
							}
						}
						type = all 
					}
					moravia_area = {
						OR = {
							country_or_non_sovereign_subject_holds = ROOT 
							custom_trigger_tooltip = {
								tooltip = owned_by_ally_or_ally_subject_tt
								owner = {
									OR = {
										alliance_with = ROOT
										overlord = { alliance_with = ROOT }
									}
								}
							}
						}
						type = all 
					}
					bohemia_area = {
						OR = {
							country_or_non_sovereign_subject_holds = ROOT 
							custom_trigger_tooltip = {
								tooltip = owned_by_ally_or_ally_subject_tt
								owner = {
									OR = {
										alliance_with = ROOT
										overlord = { alliance_with = ROOT }
									}
								}
							}
						}
						type = all 
					}
				}
				BOH = { is_subject_of = ROOT } 
				BOH = { 
					alliance_with = ROOT 
					has_opinion = {
						who = ROOT 
						value = 190 
					}
					if = {
						limit = { has_dlc = "Leviathan" }
						trust = {
							who = ROOT
							value = 100
						}
					}
					is_at_war = no 
					NOT = { total_development = ROOT } 
					NOT = { army_size = ROOT } 
				}
			}
		}
		effect = { 
			custom_tooltip = pol_if_completed_via_diplomatic_relations_tt
			tooltip = {
				BOH = { 
					country_event = { id = flavor_pol.25 }
				}
			}
			custom_tooltip = pol_alternatively_every_required_province_tt
			tooltip = {
				change_ruler_stat = {
					type = mil
					amount = 2
				}
				if = {
					limit = {
						BOH = { alliance_with = ROOT }
					}
					BOH = { 
						country_event = { id = flavor_pol.25 }
					}
				}
			}
			hidden_effect = {
				if = {
					limit = {
						BOH = { alliance_with = ROOT }
					}
					BOH = { 
						country_event = { id = flavor_pol.25 }
					}
				}
				else = { 
					silesia_area = { add_nationalism = -5 } 
					moravia_area = { add_nationalism = -5 }
					erzgebirge_area = { add_nationalism = -5 }
					bohemia_area = { add_nationalism = -5 }
					lusatia_area = { add_nationalism = -5 }
					change_ruler_stat = {
						type = mil
						amount = 2
					}
					if = { 
						limit = { 
							BOH = { is_subject_of = ROOT } 
						}
						BOH = { add_liberty_desire = -20 } 
					}
				}
			}
		}
	}		
	
	pol_balance_princely_lands = {
		icon = mission_pol_balance_princely_lands 
		required_missions = { pol_throne_bohemia pol_great_sejm pol_protect_hungary }
		position = 3
		provinces_to_highlight = { 
			OR = { 
				area = silesia_area 
				area = moravia_area
				area = bohemia_area
				area = alfold_area
				area = slovakia_area
				area = transdanubia_area
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				owner = { 
					NOT = { alliance_with = ROOT }
				}
				owner = { 
					overlord = {
						NOT = { alliance_with = ROOT }
					}
				}
			}
		}
		trigger = { 
			silesia_area = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT 
					custom_trigger_tooltip = {
						tooltip = owned_by_ally_or_ally_subject_tt
						owner = {
							OR = {
								overlord = { alliance_with = ROOT }
								alliance_with = ROOT
							}
						}
					}
				}
				type = all 
			}
			moravia_area = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT 
					custom_trigger_tooltip = {
						tooltip = owned_by_ally_or_ally_subject_tt
						owner = {
							OR = {
								overlord = { alliance_with = ROOT }
								alliance_with = ROOT
							}
						}
					}
				}
				type = all 
			}
			bohemia_area = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT 
					custom_trigger_tooltip = {
						tooltip = owned_by_ally_or_ally_subject_tt
						owner = {
							OR = {
								overlord = { alliance_with = ROOT }
								alliance_with = ROOT
							}
						}
					}
				}
				type = all 
			}
			silesia_area = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT 
					custom_trigger_tooltip = {
						tooltip = owned_by_ally_or_ally_subject_tt
						owner = {
							OR = {
								overlord = { alliance_with = ROOT }
								alliance_with = ROOT
							}
						}
					}
				}
				type = all 
			}
			alfold_area = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT 
					custom_trigger_tooltip = {
						tooltip = owned_by_ally_or_ally_subject_tt
						owner = {
							OR = {
								overlord = { alliance_with = ROOT }
								alliance_with = ROOT
							}
						}
					}
				}
				type = all 
			}
			slovakia_area = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT 
					custom_trigger_tooltip = {
						tooltip = owned_by_ally_or_ally_subject_tt
						owner = {
							OR = {
								overlord = { alliance_with = ROOT }
								alliance_with = ROOT
							}
						}
					}
				}
				type = all 
			}
			transdanubia_area = {
				OR = {
					country_or_non_sovereign_subject_holds = ROOT 
					custom_trigger_tooltip = {
						tooltip = owned_by_ally_or_ally_subject_tt
						owner = {
							OR = {
								overlord = { alliance_with = ROOT }
								alliance_with = ROOT
							}
						}
					}
				}
				type = all 
			}
			stability = 2
			grown_by_development = 350
			crown_land_share = 50
			legitimacy_equivalent = 90
		}
		effect = { 
			266 = {
				if = {
					limit = { 
						owner = { 
							OR = { 
								alliance_with = ROOT 
								is_subject_of = ROOT 
								tag = ROOT 
							}
						}
					}
					add_base_tax = 2
					add_base_production = 2 
					add_base_manpower = 2 
					add_building = town_hall
				}
			}
			153 = { 
				if = {
					limit = { 
						owner = { 
							OR = { 
								alliance_with = ROOT 
								is_subject_of = ROOT 
								tag = ROOT 
							}
						}
					}
					add_base_tax = 2
					add_base_production = 2 
					add_base_manpower = 2 
					add_building = town_hall
				}
			}
			if = { 
				limit = { has_reform = representation_of_the_crown_reform }
				add_ruler_modifier = {
					name = pol_stable_internal_affairs_modifier
					duration = -1 
				}
			}
			else = {
				custom_tooltip = pol_if_vassal_contracts_tt
				tooltip = {
					add_ruler_modifier = {
						name = pol_stable_internal_affairs_modifier
						duration = -1 
					}
				}
			}
			change_ruler_stat = {
				type = dip
				amount = 2
			}
		}
	}
}
 
poland_sca_slot_2_b = { 
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC } 
	}
	has_country_shield = yes
	
	pol_branching_mission_cf = { 
		icon = mission_locked_mission 
		required_missions = { pol_balance_princely_lands pol_breadbasket_europe } 
		position = 5 
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			if = { 
				limit = { has_dlc = "Rule Britannia" } 
				OR = { 
					monthly_adm = 15 
					innovativeness = 75
				} 
			}
			else = { prestige = 90 } 
			if = {
				limit = { has_dlc = "Rights of Man" } 
				OR = { 
					full_idea_group = innovativeness_ideas 
					ruler_has_personality = free_thinker_personality 
					ruler_has_personality = scholar_personality 
					ruler_total_stats = {
						amount = 14 
					}
				}
			}
			else = { 
				OR = { 
					full_idea_group = innovativeness_ideas 
					ruler_total_stats = {
						amount = 14 
					}
				}
			}
			if = {	
				limit = { has_dlc = "Mandate of Heaven" }
				OR = { 
					in_golden_age = yes 
					has_had_golden_age = yes 
					monthly_income = 300 
				}
			}
			else = { monthly_income = 250 } 
		}
		effect = {
			add_country_modifier = {
				name = pol_cultural_flowering_polish_domain_modifier
				duration = 9125 
			}
			if = { 
				limit = { 
					NOT = { innovativeness = 97 } 
					has_dlc = "Rule Britannia" 
				}
				change_innovativeness = 3 
			}
			else = { 
				add_adm_power = 50 
				add_dip_power = 50 
				add_mil_power = 50 
			}
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_2_plc_1 = { 
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC
	}
	has_country_shield = yes
	
	plc_cultural_flowering = { 
		icon = mission_plc_cultural_flowering 
		required_missions = { pol_balance_princely_lands pol_breadbasket_europe } 
		position = 5 
		trigger = { 
			if = { 
				limit = { has_dlc = "Rule Britannia" } 
				OR = { 
					monthly_adm = 15 
					innovativeness = 75
				}
			}
			else = { prestige = 90 } 
			if = {
				limit = { has_dlc = "Rights of Man" } 
				OR = { 
					full_idea_group = innovativeness_ideas 
					ruler_has_personality = free_thinker_personality 
					ruler_has_personality = scholar_personality 
					ruler_total_stats = {
						amount = 14 
					}
				}
			}
			else = { 
				OR = { 
					full_idea_group = innovativeness_ideas 
					ruler_total_stats = {
						amount = 14 
					}
				}
			}
			if = {	
				limit = { has_dlc = "Mandate of Heaven" }
				OR = { 
					in_golden_age = yes 
					has_had_golden_age = yes 
					monthly_income = 300 
				}
			}
			else = { monthly_income = 250 } 
		}
		effect = {
			add_country_modifier = {
				name = pol_cultural_flowering_polish_domain_modifier
				duration = 9125 
			}
			if = { 
				limit = { 
					NOT = { innovativeness = 97 } 
					has_dlc = "Rule Britannia" 
				}
				change_innovativeness = 3 
			}
			else = { 
				add_adm_power = 50 
				add_dip_power = 50 
				add_mil_power = 50 
			}
		}
	}
}

poland_sca_slot_2_c = { 
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = POL 
			tag = PLC 
		}
	}
	has_country_shield = yes
	
	pol_revival_krakow = {
		icon = mission_pol_revival_krakow 
		position = 6 
		required_missions = { } 
		trigger = { 
			if = { 
				limit = { has_dlc = "Leviathan" } 
				262 = { 
					OR = { 
						num_of_times_improved = 10 
						has_great_project = {
							type = krakow_cloth_hall
							tier = 2 
						}
						has_great_project = {
							type = krakow_cloth_hall
							tier = 3 
						}
					}
				}
			}
			else = { 
				262 = { num_of_times_improved = 10 } 
			}
			if = { 
				limit = { has_dlc = "Mandate of Heaven" }
				262 = { 
					prosperity = 80 
					OR = { 
						base_production = 10 
						has_manufactory_trigger = yes 
					}
				}
			}
			else = { 
				OR = {
					trading_part = {
						trade_goods = cloth
						value = 0.1
					}
					262 = { has_manufactory_trigger = yes } 					
				}
			}
			262 = { num_of_buildings_in_province = 4 } 
			has_institution = renaissance 
		}
		effect = { 	
			262 = {
				add_center_of_trade_level = 1 
				add_base_production = 2 
				add_building = trade_depot
			}
		}
	}
}
	
poland_sca_slot_2_d = { 
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC } 
	}
	has_country_shield = yes
	
	pol_branching_mission_sp = {
		icon = mission_locked_mission 
		required_missions = { pol_revival_krakow }
		position = 7 
		provinces_to_highlight = { 
			OR = { 
				province_id = 1841 
				province_id = 270 
			}
		} 
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			if = {
				limit = { has_dlc = "Leviathan" }
				1841 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					has_great_project = { 
						type = malbork_castle
						tier = 3 
					}
				}
				270 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					has_great_project = {
						type = trakai_castle 
						tier = 3 
					}
				}
			}
			else = {
				1841 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					base_manpower = 15 
				}
				270 = {
					country_or_non_sovereign_subject_holds = ROOT 
					base_manpower = 15 
				}
			}
			crown_land_share = 90 
		}
		effect = {
			add_power_projection = {
				type = mission_rewards_power_projection
				amount = 50
			}
			if = { 
				limit = { has_dlc = "Mandate of Heaven" } 
				add_country_modifier = { 
					name = pol_splendor_polish_crown_modifier
					duration = 7300 
				}
			}
			else = { add_dip_power = 100 add_prestige = 25 } 
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_2_plc_2 = { 
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC 
	}
	has_country_shield = yes
	
	plc_seats_power = {
		icon = mission_plc_seats_power 
		required_missions = { pol_revival_krakow }
		position = 7 
		provinces_to_highlight = { 
			OR = {
				province_id = 1841 
				province_id = 270 
			}
		}
		trigger = { 
			if = {
				limit = { has_dlc = "Leviathan" }
				1841 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					has_great_project = { 
						type = malbork_castle
						tier = 3 
					}
				}
				270 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					has_great_project = {
						type = trakai_castle 
						tier = 3 
					}
				}
			}
			else = {
				1841 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					base_manpower = 15 
				}
				270 = {
					country_or_non_sovereign_subject_holds = ROOT 
					base_manpower = 15 
				}
			}
			crown_land_share = 90 
		}
		effect = {
			add_power_projection = {
				type = mission_rewards_power_projection
				amount = 50
			}
			if = { 
				limit = { has_dlc = "Mandate of Heaven" } 
				add_country_modifier = { 
					name = pol_splendor_polish_crown_modifier
					duration = 7300 
				}
			}
			else = { add_dip_power = 100 add_prestige = 25 } 
		}
	}
}
	
poland_sca_slot_2_e = { 
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = {
			tag = POL 
			tag = PLC 
		}
	}
	has_country_shield = yes	
	
	pol_wallachia = {
		icon = mission_pol_wallachia 
		required_missions = {  }
		position = 9
		provinces_to_highlight = { 
			area = wallachia_area 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			wallachia_area = { 
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			4531 = { 
				has_fort_building_trigger = yes 
				num_of_times_improved = 3 
			}
			if = { 
				limit = { has_dlc = "Mandate of Heaven" } 
				4531 = { 
					NOT = { devastation = 1 } 
				}
			}
		}
		effect = { 
			4531 = { 
				if = {
					limit = { has_building = fort_17th }
					remove_building = fort_17th
					add_building = fort_18th
				}
				else_if = {
					limit = { has_building = fort_16th }
					remove_building = fort_16th
					add_building = fort_17th
				}
				else_if = {
					limit = { has_building = fort_15th }
					remove_building = fort_15th
					add_building = fort_16th
				}
				add_province_modifier = { 
					name = pol_fortified_border_modifier
					duration = 7300 
				}
			}
			bulgaria_area = { 
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			silistria_area = { 
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			thrace_area = { 
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
		}
	}
}

poland_sca_slot_3_a = { 
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = {
			tag = POL 
			tag = PLC 
		}
	}
	has_country_shield = yes
	
	pol_varna_aftermath = {
		icon = mission_pol_varna_aftermath 
		required_missions = { } 
		position = 1 
		trigger = {
			OR = {
				custom_trigger_tooltip = { 
					tooltip = pol_had_kasimir_election_event_tt
					OR = { 
						has_country_flag = pol_chose_pu_flag
						has_country_flag = pol_denied_pu_flag
					}
				}
				tag = PLC 
				current_age = age_of_reformation
			}
			num_of_allies = 2 
			army_size_percentage = 0.9 
			BOH = { 
				OR = { 
					alliance_with = ROOT 
					is_rival = ROOT 
					is_subject_of = ROOT 
					has_opinion_modifier = {
						who = ROOT
						modifier = insulted
					}
					has_opinion_modifier = {
						who = ROOT
						modifier = scornfully_insulted
					}
					exists = no 
				}
			}
			HUN = { 
				OR = { 
					alliance_with = ROOT 
					is_rival = ROOT 
					is_subject_of = ROOT 
					has_opinion_modifier = {
						who = ROOT
						modifier = insulted
					}
					has_opinion_modifier = {
						who = ROOT
						modifier = scornfully_insulted
					}
					exists = no 
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_country_flag = pol_denied_pu_flag }
					NOT = { has_country_flag = pol_chose_pu_flag }
				}
				custom_tooltip = pol_before_event_goes_tt
			}
			if = {
				limit = { has_country_flag = pol_denied_pu_flag }
				tooltip = {
					if = {
						limit = { 
							has_country_flag = pol_denied_pu_flag
							HUN = { 
								NOT = { 
									OR = {
										alliance_with = ROOT 
										is_subject_of = ROOT
									}
								}
							}
						}
						slovakia_area = { 
							limit = { 
								NOT = { is_core = ROOT } 
								NOT = { is_permanent_claim = ROOT } 
							}
							add_permanent_claim = ROOT 
						}
						alfold_area = { 
							limit = { 
								NOT = { is_core = ROOT } 
								NOT = { is_permanent_claim = ROOT } 
							}
							add_permanent_claim = ROOT 
						}
						transdanubia_area = { 
							limit = { 
								NOT = { is_core = ROOT } 
								NOT = { is_permanent_claim = ROOT } 
							}
							add_permanent_claim = ROOT 
						}
						if = {
							limit = {
								BOH = { 
									NOT = { 
										OR = {
											alliance_with = ROOT 
											is_subject_of = ROOT
										}
									}
									valid_for_personal_unions_trigger = yes 
								}
							}
							add_casus_belli = {
								type = cb_restore_personal_union
								months = 300
								target = BOH
							}
						}
						else = {
							moravia_area = { 
								limit = { 
									NOT = { is_core = ROOT } 
									NOT = { is_permanent_claim = ROOT }  
								}
								add_permanent_claim = ROOT 
							}
							bohemia_area = { 
								limit = { 
									NOT = { is_core = ROOT } 
									NOT = { is_permanent_claim = ROOT } 
								}
								add_permanent_claim = ROOT 
							}
							silesia_area = { 
								limit = { 
									NOT = { is_core = ROOT } 
									NOT = { is_permanent_claim = ROOT } 
								}
								add_permanent_claim = ROOT 
							}
						}
					}
				}
			}
			if = {
				limit = { has_country_flag = pol_chose_pu_flag }
				tooltip = {
					if = {
						limit = { 
							has_country_flag = pol_chose_pu_flag
							BOH = { 
								NOT = { 
									OR = {
										alliance_with = ROOT 
										is_subject_of = ROOT
									}
								}
							}
						}
						moravia_area = { 
							limit = { 
								NOT = { is_core = ROOT } 
								NOT = { is_permanent_claim = ROOT }  
							}
							add_permanent_claim = ROOT 
						}
						bohemia_area = { 
							limit = { 
								NOT = { is_core = ROOT } 
								NOT = { is_permanent_claim = ROOT } 
							}
							add_permanent_claim = ROOT 
						}
						silesia_area = { 
							limit = { 
								NOT = { is_core = ROOT } 
								NOT = { is_permanent_claim = ROOT } 
							}
							add_permanent_claim = ROOT 
						}
						if = {
							limit = {
								HUN = { 
									NOT = { 
										OR = {
											alliance_with = ROOT 
											is_subject_of = ROOT
										}
									}
									valid_for_personal_unions_trigger = yes 
								}
							}
							add_casus_belli = {
								type = cb_restore_personal_union
								months = 300
								target = HUN
							}
						}
						else = {
							slovakia_area = { 
								limit = { 
									NOT = { is_core = ROOT } 
									NOT = { is_permanent_claim = ROOT } 
								}
								add_permanent_claim = ROOT 
							}
							alfold_area = { 
								limit = { 
									NOT = { is_core = ROOT } 
									NOT = { is_permanent_claim = ROOT } 
								}
								add_permanent_claim = ROOT 
							}
							transdanubia_area = { 
								limit = { 
									NOT = { is_core = ROOT } 
									NOT = { is_permanent_claim = ROOT } 
								}
								add_permanent_claim = ROOT 
							}
						}
					}
				}
			}
			#
			if = {
				limit = {
					HUN = {
						OR = { 
							alliance_with = ROOT
							is_subject_of = ROOT 
						}
					}
				}
				custom_tooltip = hun_friendship_yes_tt
			}
			else = {
				custom_tooltip = hun_friendship_no_tt
			}
			tooltip = { 
				add_favors = {
					who = HUN 
					amount = 10 
				}
				HUN = { add_historical_friend = ROOT }
				add_historical_friend = HUN 
			}
			if = {
				limit = {
					BOH = {
						OR = { 
							alliance_with = ROOT
							is_subject_of = ROOT 
						}
					}
				}
				custom_tooltip = boh_friendship_yes_tt
			}
			else = {
				custom_tooltip = boh_friendship_no_tt
			}
			tooltip = { 
				add_favors = { 
					who = BOH 
					amount = 10 
				}
				BOH = { add_historical_friend = ROOT }
				add_historical_friend = BOH 
			}
			custom_tooltip = pol_impact_future_missions_tt 
			hidden_effect = { 
				swap_non_generic_missions = yes 
				if = { 
					limit = { 
						BOH = {
							OR = {
								is_subject_of = ROOT
								alliance_with = ROOT
							}
						}
					}
					add_favors = { 
						who = BOH 
						amount = 10 
					}
					BOH = { add_historical_friend = ROOT }
					add_historical_friend = BOH 
				}
				else_if = {
					limit = {
						valid_for_personal_unions_trigger = yes 
						BOH = { 
							valid_for_personal_unions_trigger = yes 
						}
						has_country_flag = pol_denied_pu_flag
					}
					add_casus_belli = {
						type = cb_restore_personal_union
						months = 300
						target = BOH
					}
				}
				else = {
					moravia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT }  
						}
						add_permanent_claim = ROOT 
					}
					bohemia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					silesia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
				}
				if = { 
					limit = { alliance_with = HUN } 
					add_favors = { 
						who = HUN 
						amount = 10 
					}
					HUN = { add_historical_friend = ROOT }
					add_historical_friend = HUN 
				}
				else_if = {
					limit = {
						valid_for_personal_unions_trigger = yes 
						HUN = { 
							valid_for_personal_unions_trigger = yes 
						}
						has_country_flag = pol_chose_pu_flag 
					}
					add_casus_belli = {
						type = cb_restore_personal_union
						months = 300
						target = HUN
					} 
				}
				else = {
					slovakia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					alfold_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					transdanubia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}					
				}
				if = {
					limit = {
						has_country_flag = pol_chose_pu_flag 
						NOT = {
							OR = {
								BOH = { is_subject_of = ROOT }
								alliance_with = BOH
							}
						}
					}
					moravia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT }  
						}
						add_permanent_claim = ROOT 
					}
					bohemia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					silesia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
				}
				if = {
					limit = {
						has_country_flag = pol_denied_pu_flag 
						NOT = {
							OR = {
								HUN = { is_subject_of = ROOT }
								alliance_with = HUN
							}
						}
					}
					slovakia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					alfold_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					transdanubia_area = { 
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { is_permanent_claim = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
				}
			}
		}
	}		
	
	pol_protect_hungary = {
		icon = mission_pol_protect_hungary 
		required_missions = { pol_varna_aftermath }
		position = 2 
		provinces_to_highlight = { 
			OR = {
				area = slovakia_area
				area = transdanubia_area
				area = southern_transylvania_area
				area = transylvania_area
				area = alfold_area
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				owner = { 
					NOT = { alliance_with = ROOT }
				}
				owner = { 
					overlord = {
						NOT = { alliance_with = ROOT }
					}
				}
			}
		}
		trigger = { 
			OR = { 
				AND = {
					slovakia_area = {
						OR = {
							country_or_non_sovereign_subject_holds = ROOT 
							custom_trigger_tooltip = {
								tooltip = owned_by_ally_or_ally_subject_tt
								owner = {
									OR = {
										alliance_with = ROOT
										overlord = { alliance_with = ROOT }
									}
								}
							}
						}
						type = all 
					}
					transdanubia_area = {
						OR = {
							country_or_non_sovereign_subject_holds = ROOT 
							custom_trigger_tooltip = {
								tooltip = owned_by_ally_or_ally_subject_tt
								owner = {
									OR = {
										alliance_with = ROOT
										overlord = { alliance_with = ROOT }
									}
								}
							}
						}
						type = all 
					}
					southern_transylvania_area = {
						OR = {
							country_or_non_sovereign_subject_holds = ROOT 
							custom_trigger_tooltip = {
								tooltip = owned_by_ally_or_ally_subject_tt
								owner = {
									OR = {
										alliance_with = ROOT
										overlord = { alliance_with = ROOT }
									}
								}
							}
						}
						type = all 
					}
					transylvania_area = {
						OR = {
							country_or_non_sovereign_subject_holds = ROOT 
							custom_trigger_tooltip = {
								tooltip = owned_by_ally_or_ally_subject_tt
								owner = {
									OR = {
										alliance_with = ROOT
										overlord = { alliance_with = ROOT }
									}
								}
							}
						}
						type = all 
					}
					alfold_area = {
						OR = {
							country_or_non_sovereign_subject_holds = ROOT 
							custom_trigger_tooltip = {
								tooltip = owned_by_ally_or_ally_subject_tt
								owner = {
									OR = {
										alliance_with = ROOT
										overlord = { alliance_with = ROOT }
									}
								}
							}
						}
						type = all 
					}
				}
				HUN = { is_subject_of = ROOT } 
				HUN = { 
					alliance_with = ROOT 
					has_opinion = {
						who = ROOT 
						value = 190 
					}
					if = {
						limit = { has_dlc = "Leviathan" }
						trust = { 	
							who = ROOT 
							value = 100 
						}
					}
					is_at_war = no 
					NOT = { total_development = ROOT } 
					NOT = { army_size = ROOT } 
				}
			}
		}
		effect = { 
			custom_tooltip = pol_if_completed_via_diplomatic_relations_tt
			tooltip = {
				country_event = { id = flavor_pol.26 }
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				if = { 
					limit = { 
						has_dlc = "Leviathan" 
						4128 = { 
							NOT = { 
								has_great_project = {
									type = bran_castle
									tier = 3 
								}
							}
							country_or_non_sovereign_subject_holds = ROOT 
						}
					} 
					4128 = { 
						add_great_project_tier = {
							type = bran_castle 
							tier = 1 
						}
					}	
				}
				else_if = {
					limit = { 
						OR = { 
							NOT = { has_dlc = "Leviathan" }
							4128 = { NOT = { country_or_non_sovereign_subject_holds = ROOT } }
							4128 = { 
								has_great_project = {
									type = bran_castle 
									tier = 3 
								}
							}
						}
					}
					add_prestige = 20 
				}
				if = { 
					limit = { 
						HUN = { is_subject_of = ROOT } 
					}
					HUN = { add_liberty_desire = -20 } 
				}
				custom_tooltip = pol_every_mil_building_1_base_development_mil_tt
			}
			hidden_effect = {
				if = {
					limit = {
						HUN = { alliance_with = ROOT }
					}
					HUN = { 
						country_event = { id = flavor_pol.26 }
					}
				}
				else_if = {
					limit = { 
						has_dlc = "Leviathan" 
						4128 = { 
							NOT = { 
								has_great_project = {
									type = bran_castle
									tier = 3 
								}
							}
							country_or_non_sovereign_subject_holds = ROOT 
						}
					} 
					4128 = { 
						add_great_project_tier = {
							type = bran_castle
							tier = 1
						}
					}	
				}
				else_if = {
					limit = { 
						OR = { 
							NOT = { has_dlc = "Leviathan" }
							4128 = { NOT = { country_or_non_sovereign_subject_holds = ROOT } }
							4128 = { 
								has_great_project = {
									type = bran_castle 
									tier = 3 
								}
							}
						}
					}
					add_prestige = 20 
				}
				every_owned_province = { 
					limit = {
						OR = { 
							has_manpower_building_trigger = yes 
							has_forcelimit_building_trigger = yes 
							has_fort_building_trigger = yes 
						}
					} 
					add_base_manpower = 1 
				}
				if = { 
					limit = { 
						HUN = { is_subject_of = ROOT } 
					}
					HUN = { add_liberty_desire = -20 } 
				}
			}
		}
	}
	
	pol_support_mercantile_class = {
		icon = the_shape_of_trades_to_come
		required_missions = { } 
		position = 3
		provinces_to_highlight = { province_id = 262 } 
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				has_trade_building_trigger = yes 
				value = 5 
			}
			OR = { 
				mercantilism = 25 
				estate_loyalty = { 
					estate = estate_burghers 
					loyalty = 60 
				}
			}
			OR = {
				num_of_centers_of_trade = 6
				262 = {
					trade_share = {
						country = ROOT
						share = 50
					}
				}
			}
		}
		effect = { 
			custom_tooltip = pol_if_mercantilism_reward_tt
			custom_tooltip = pol_alternatively_tt
			tooltip = { set_estate_privilege = estate_burghers_polish_merchant_seal }
			hidden_effect = { 
				if = { 
					limit = { 
						has_dlc = "Rights of Man"
						mercantilism = 25 
						NOT = { num_of_ruler_traits = { amount = 3 } }
					} 
					add_ruler_personality = entrepreneur_personality
					set_country_flag = enable_special_trader_flag
				}
				else_if = { 
					limit = { mercantilism = 25 } 
					change_ruler_stat = {
						type = dip
						amount = 1
					}
					set_country_flag = enable_special_trader_flag
				}
				else = { 
					set_estate_privilege = estate_burghers_polish_merchant_seal 
				}
			}
		}
	}
	
	pol_breadbasket_europe = {
		icon = mission_pol_breadbasket_europe
		required_missions = { pol_support_mercantile_class pol_deal_mazovia }
		position = 4
		provinces_to_highlight = { 
			country_or_non_sovereign_subject_holds = ROOT  
			trade_goods = grain 
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				trade_goods = grain 
				has_production_building_trigger = yes 
				value = 14
			}
			if = { 
				limit = { has_dlc = "Mandate of Heaven" }
				OR = {	
					trading_part = {
						trade_goods = grain
						value = 0.15
					}
					has_age_ability = ab_polish_legitimacy
				}
			}
			else = { 
				trading_part = {
					trade_goods = grain
					value = 0.15
				}
			}
		}
		effect = { 
			custom_tooltip = pol_every_grain_province_tt
			tooltip = {
				add_province_modifier = {
					name = pol_breadbasket_europe_modifier
					duration = 7300 
				}
			}
			change_price = {
				trade_goods = grain
				key = polish_grain
				value = 0.2
				duration = 5475
			}
			hidden_effect = { 
				every_owned_province = {
					limit = {
						trade_goods = grain 
						has_production_building_trigger = yes 
					}
					add_province_modifier = {
						name = pol_breadbasket_europe_modifier
						duration = 7300 
					}
				}
			}	
		}
	}			
	
	pol_develop_countryside = { 
		icon = mission_pol_develop_countryside 
		required_missions = { pol_breadbasket_europe }
		position = 5
		provinces_to_highlight = {
			region = poland_region 
			country_or_non_sovereign_subject_holds = ROOT 
			OR = { 
				NOT = { num_of_times_improved = 3 } 
				unrest = 1 
			}
		}
		trigger = {
			stability = 3 
			poland_region = {
				type = all 
				NOT = { unrest = 1 } 
				num_of_times_improved = 3 
				NOT = { local_autonomy_above_min = 5 }
			}
		}
		effect = {
			poland_region = {
				add_province_modifier = { 
					name = pol_growing_prosperity_modifier
					duration = 9125 
				}
			}
		}
	}
} 
	
poland_sca_slot_3_b = { 
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC } 
	}
	has_country_shield = yes
	
	
	pol_branching_mission_iep = { 
		icon = mission_locked_mission 
		required_missions = { pol_develop_countryside pol_revival_krakow }
		position = 7
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					province_has_center_of_trade_of_level = 3 
					has_manufactory_trigger = yes 
				}
				value = 40 
			}
			OR = { 
				has_global_modifier_value = {
					which = global_trade_goods_size_modifier 
					value = 0.40
				}
				num_of_trading_bonuses = 7 
				AND = { 
					full_idea_group = economic_ideas 
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						has_manufactory_trigger = yes 
						development = 35 
						value = 6 
					}
				}
			}
		}
		effect = {
			custom_tooltip = pol_upgrade_wool_to_cloth_tt
			custom_tooltip = pol_1_merc_per_trading_bonus_tt
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
	
	pol_branching_mission_dem = {
		icon = mission_locked_mission 
		required_missions = { pol_branching_mission_iep pol_branching_mission_ga pol_branching_mission_sp pol_branching_mission_eoe }
		position = 8
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			custom_trigger_tooltip = {
				tooltip = pol_highest_eu_income_tt
				any_country = { 
					capital_scope = { continent = europe } 
					NOT = { monthly_income = ROOT } 
				}
			}
			if = { 
				limit = { has_dlc = "Emperor" } 
				is_hegemon = yes 
			}
			else = { 
				OR = { 
					num_of_provinces_in_states = 120 
					total_development = 2000
				}
			}
			if = { 
				limit = { has_dlc = "Mandate of Heaven" }
				OR = { 
					has_had_golden_age = yes 
					in_golden_age = yes 
				}
			}
		}
		effect = {
			if = { 
				limit = { has_dlc = "Mandate of Heaven" }
				custom_tooltip = pol_if_used_ge_rest_else_30_years_extension_tt 
				if = {
					limit = { has_had_golden_age = yes } 
					reset_golden_age = yes 
				}
				else_if = {
					limit = { in_golden_age = yes } 
					extend_golden_age = 600
				}
			}
			else = {
				add_country_modifier = {
					name = pol_golden_era_modifier
					duration = 10950 
				}
			}
			custom_tooltip = pol_every_province_with_40_dev_tt
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
	
	pol_branching_mission_btr = {
		icon = mission_locked_mission
		required_missions = {  }
		position = 9
		provinces_to_highlight = {
			owner = {
				capital_scope = {
					region = russia_region
				}
				total_development = 100
				OR = {
					culture_group = east_slavic
					culture_group = slavic
				}
				is_subject = no
			}
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			total_development = 600
			OR = { 
				custom_trigger_tooltip = {
					tooltip = break_the_rus_mission_tooltip
					NOT = {
						any_country = {
							capital_scope = {
								region = russia_region
							}
							total_development = 100
							OR = {
								culture_group = east_slavic
								culture_group = slavic
							}
							is_subject = no
						}
					}
				}
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					region = russia_region
					value = 15 
				}
			}
		}
		effect = {
			custom_tooltip = pol_hold_moscow_and_novgorod_and_neva_tt
			tooltip = { 
				if = { 
					limit = { has_dlc = "Third Rome" } 
					custom_tooltip = pol_10_streltsy_in_capital
				}
				else = { add_yearly_manpower = 2 } 
				russia_region = {
					limit = { 
						NOT = { owned_by = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				add_country_modifier = { 
					name = broke_the_rus
					duration = 9125 
				}
				add_yearly_manpower = 2
				karelia_area = {
					limit = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
				novgorod_area = { 
					limit = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
				moscow_area = {
					limit = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT
				}
			}
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
	
	pol_branching_mission_tpp = {
		icon = mission_locked_mission
		required_missions = { pol_branching_mission_btr pol_branching_mission_constantinople }
		position = 11
		provinces_to_highlight = { 
			area = thrace_area 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			thrace_area = { 
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			OR = { 
				is_defender_of_faith = yes 
				custom_trigger_tooltip = {
					tooltip = pol_disseminated_tolerance_tt
					has_country_modifier = pol_guarantee_religious_rights_modifier
				}
			}
			BYZ = { 
				OR = {
					exists = no 
					is_subject_of = ROOT 
				}		
			}
		}
		effect = { 
			country_event = { id = flavor_pol.30 } 
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
	
	pol_branching_mission_pph = {
		icon = mission_locked_mission
		required_missions = { pol_branching_mission_tpp pol_branching_mission_ptp }
		position = 13
		provinces_to_highlight = { 
			continent = europe 
			is_capital = yes 
			owner = { 
				OR = { 
					monthly_income = ROOT 
					navy_size = ROOT 
					army_size = ROOT 
				}
				is_subject = no 
				NOT = { tag = ROOT }
			}
		}
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			if = { 
				limit = { has_dlc = "Emperor" } 
				is_hegemon = yes 
			}
			else = {
				OR = { 
					num_of_heavy_ship = 250 
					army_size = 300 # modified
					monthly_income = 1000 
				}
			}
			total_development = 2000 
			mission_completed = plc_lifetime_of_war 
		}
		effect = { 
			custom_tooltip = pol_economic_hegemony_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_efficienct_development_modifier
					duration = 9125 
				}
			}
			custom_tooltip = pol_naval_hegemony_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_global_maritime_empire_modifier
					duration = -1 
				}
			}
			custom_tooltip = pol_alternatively_mil_hegemony_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_poland_rise_modifier
					duration = -1 
				}
			}
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_3_plc_1 = { 
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC 
	}
	has_country_shield = yes
	
	
	plc_invest_eastern_poland = { 
		icon = reclaim_the_ducal_lands
		required_missions = { pol_develop_countryside pol_revival_krakow }
		position = 7
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					province_has_center_of_trade_of_level = 3 
					has_manufactory_trigger = yes 
				}
				value = 40 
			}
			OR = { 
				has_global_modifier_value = {
					which = global_trade_goods_size_modifier 
					value = 0.40
				}
				num_of_trading_bonuses = 7 
				AND = { 
					full_idea_group = economic_ideas 
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						has_manufactory_trigger = yes 
						development = 35 
						value = 6 
					}
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					NOT = { has_institution = industrialization }
					NOT = { num_of_ruler_traits = { amount = 3 } }
					has_dlc = "Rights of Man"
				}
				add_ruler_personality = industrious_personality 
			}
			else = { 
				change_ruler_stat = {
					type = adm
					amount = 1
				}
			}
			custom_tooltip = pol_upgrade_wool_to_cloth_tt
			custom_tooltip = pol_1_merc_per_trading_bonus_tt
			hidden_effect = {
				
				every_owned_province = { 
					limit = { trade_goods = wool } 
					change_trade_goods = cloth 
				}
				if = { 
					limit = { num_of_trading_bonuses = 10 } 
					add_mercantilism = 10 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 9 } 
					add_mercantilism = 9 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 8 } 
					add_mercantilism = 8 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 7 } 
					add_mercantilism = 7 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 6 } 
					add_mercantilism = 6 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 5 } 
					add_mercantilism = 5 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 4 } 
					add_mercantilism = 4 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 3 } 
					add_mercantilism = 3 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 2 } 
					add_mercantilism = 2 
				}
				else_if = { 
					limit = { num_of_trading_bonuses = 1 } 
					add_mercantilism = 1 
				}
			}
		}
	}
	
	plc_dominate_european_markets = {
		icon = mission_plc_dominate_european_markets 
		required_missions = { plc_invest_eastern_poland plc_governance_act plc_seats_power plc_edict_education }
		position = 8
		trigger = {
			custom_trigger_tooltip = {
				tooltip = pol_highest_eu_income_tt
				NOT = {
					any_country = { 
						capital_scope = { continent = europe } 
						monthly_income = ROOT
					}
				}
			}
			if = { 
				limit = { has_dlc = "Emperor" } 
				is_hegemon = yes  
			}
			else = { 
				OR = { 
					num_of_provinces_in_states = 120 
					total_development = 2000
				}
			}
			if = { 
				limit = { has_dlc = "Mandate of Heaven" }
				OR = { 
					has_had_golden_age = yes 
					in_golden_age = yes 
				}
			}
		}
		
		effect = {
			if = { 
				limit = { has_dlc = "Mandate of Heaven" }
				custom_tooltip = pol_if_used_ge_rest_else_30_years_extension_tt 
				if = {
					limit = { has_had_golden_age = yes } 
					reset_golden_age = yes 
				}
				else_if = {
					limit = { in_golden_age = yes } 
					extend_golden_age = 600
				}
			}
			else = {
				add_country_modifier = {
					name = pol_golden_era_modifier
					duration = 10950 
				}
			}
			custom_tooltip = pol_every_province_with_40_dev_tt
			hidden_effect = { 
				every_owned_province = {
					limit = { development = 40 } 
					add_province_modifier = { 
						name = pol_enable_2nd_manufactory_modifier
						duration = -1 
						hidden = yes 
					}
				}
			}
		}
	}
	
	plc_break_the_rus = {
		icon = mission_plc_break_the_rus
		required_missions = {  }
		position = 9
		provinces_to_highlight = {
			owner = {
				capital_scope = {
					region = russia_region
				}
				total_development = 100
				OR = {
					culture_group = east_slavic
					culture_group = slavic
				}
				is_subject = no
			}
		}
		trigger = {
			total_development = 600
			OR = { 
				custom_trigger_tooltip = {
					tooltip = break_the_rus_mission_tooltip
					NOT = {
						any_country = {
							capital_scope = {
								region = russia_region
							}
							total_development = 100
							OR = {
								culture_group = east_slavic
								culture_group = slavic
							}
							is_subject = no
						}
					}
				}
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					region = russia_region
					value = 15 
				}
			}
		}
		effect = {
			custom_tooltip = pol_hold_moscow_and_novgorod_and_neva_tt
			tooltip = { 
				if = { 
					limit = { has_dlc = "Third Rome" } 
					custom_tooltip = pol_10_streltsy_in_capital
					hidden_effect = { 
						capital_scope = { 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
							streltsy_infantry = ROOT 
						}
					}
				}
				else = { add_yearly_manpower = 2 } 
				russia_region = {
					limit = { 
						NOT = { owned_by = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				add_country_modifier = { 
					name = broke_the_rus
					duration = 9125 
				}
				add_yearly_manpower = 2
				karelia_area = {
					limit = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
				novgorod_area = { 
					limit = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
				moscow_area = {
					limit = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT
				}
			}
			hidden_effect = {
				if = { 
					limit = { 
						has_dlc = "Third Rome" 
						295 = { owned_by = ROOT } 
						33 = { owned_by = ROOT }
						310 = { owned_by = ROOT } 
					}
					capital_scope = { 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
						streltsy_infantry = ROOT 
					}
					russia_region = {
						limit = { 
							NOT = { owned_by = ROOT } 
							NOT = { is_core = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
				}
				else = { 
					add_yearly_manpower = 2 
					add_country_modifier = { 
						name = broke_the_rus
						duration = 9125 
					}
					karelia_area = {
						limit = { 
							NOT = { country_or_non_sovereign_subject_holds = ROOT } 
							NOT = { is_core = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					novgorod_area = { 
						limit = { 
							NOT = { country_or_non_sovereign_subject_holds = ROOT } 
							NOT = { is_core = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					moscow_area = {
						limit = { 
							NOT = { country_or_non_sovereign_subject_holds = ROOT } 
							NOT = { is_core = ROOT } 
						}
						add_permanent_claim = ROOT
					}
				} 
			}
		}
	}
	
	plc_purple_phoenix = {
		icon = mission_plc_purple_phoenix
		required_missions = { plc_break_the_rus plc_cross_wild_field }
		position = 11
		provinces_to_highlight = { 
			area = thrace_area 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			thrace_area = { 
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			OR = { 
				is_defender_of_faith = yes 
				custom_trigger_tooltip = {
					tooltip = pol_disseminated_tolerance_tt
					has_country_modifier = pol_guarantee_religious_rights_modifier
				}
			}
			BYZ = { 
				OR = {
					exists = no 
					is_subject_of = ROOT 
				}		
			}
		}
		effect = { 
			country_event = { id = flavor_pol.30 } 
		}
	}
	
	plc_proclaim_polish_hegemony = {
		icon = mission_plc_proclaim_polish_hegemony
		required_missions = { plc_purple_phoenix plc_prevent_deluge }
		position = 13
		provinces_to_highlight = { 
			continent = europe 
			is_capital = yes 
			owner = { 
				OR = { 
					monthly_income = ROOT 
					navy_size = ROOT 
					army_size = ROOT 
				}
				is_subject = no 
				NOT = { tag = ROOT }
			}
		}
		trigger = { 
			if = { 
				limit = { has_dlc = "Emperor" }
				is_hegemon = yes 
			}
			else = {
				OR = { 
					navy_size = 250 # modified
					army_size = 300 # modified
					monthly_income = 1000 
				}
			}
			total_development = 2000 
			mission_completed = plc_lifetime_of_war 
		}
		effect = { 
			custom_tooltip = pol_economic_hegemony_tt
			tooltip = {
				add_country_modifier = { 
					name = pol_efficienct_development_modifier
					duration = 9125 
				}
			}
			custom_tooltip = pol_naval_hegemony_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_global_maritime_empire_modifier
					duration = -1 
				}
			}
			custom_tooltip = pol_alternatively_mil_hegemony_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_poland_rise_modifier
					duration = -1 
				}
			}
			hidden_effect = {
				if = { 
					limit = { has_dlc = "Emperor" }
					if = { 
						limit = { is_hegemon_of_type = economic_hegemon }
						add_country_modifier = { 
							name = pol_efficienct_development_modifier
							duration = 9125 
						}
						set_country_flag = enable_upgrading_centers_of_trade_dev
						set_country_flag = enable_supplemental_development_flag
					}
					else_if = {
						limit = { is_hegemon_of_type = naval_hegemon }
						add_country_modifier = { 
							name = pol_global_maritime_empire_modifier
							duration = -1 
						}
					}
					else = {
						add_country_modifier = { 
							name = pol_poland_rise_modifier
							duration = -1 
						}
					}
				}
				else_if = {
					limit = { monthly_income = 1000 }
					add_country_modifier = { 
						name = pol_efficienct_development_modifier
						duration = 9125 
					}
					set_country_flag = enable_upgrading_centers_of_trade_dev
					set_country_flag = enable_supplemental_development_flag
				}
				else_if = {
					limit = { navy_size = 250 } # modified
					add_country_modifier = { 
						name = pol_global_maritime_empire_modifier
						duration = -1 
					}
				}
				else = { 
					add_country_modifier = { 
						name = pol_poland_rise_modifier
						duration = -1 
					}
				}
			}
		}
	}
}
	
poland_sca_slot_4_a = { 
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC } 
	}
	has_country_shield = yes

	pol_branching_mission_low = {
		icon = mission_locked_mission 
		position = 2 
		required_missions = { pol_varna_aftermath } 
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			if = {
				limit = { has_dlc = "Cradle of Civilization" }
				army_professionalism = 1 
			}
			else = { army_tradition = 95 } 
			army_size = 50 # modified
			if = { 
				limit = { 
					has_estate = estate_cossacks 
					has_dlc = "Lions of the North"
				} 
				OR = { 
					num_of_hussars = 8 
					AND = { 
						estate_loyalty = { 
							estate = estate_cossacks 
							loyalty = 60 
						}
						num_of_estate_privileges = {
							estate = estate_cossacks
							value = 5 
						}
					}
					has_global_modifier_value = {
						which = infantry_power 
						value = 0.35 
					}
					has_global_modifier_value = {
						which = discipline  
						value = 0.25
					}
				}
			}
			else_if = { 
				limit = { 
					has_estate = estate_cossacks
				} 
				OR = { 
					num_of_cavalry = 22 # modified
					AND = { 
						estate_loyalty = { 
							estate = estate_cossacks 
							loyalty = 60 
						}
						num_of_estate_privileges = {
							estate = estate_cossacks
							value = 5 
						}
					}
					has_global_modifier_value = {
						which = infantry_power 
						value = 0.35 
					}
					has_global_modifier_value = {
						which = discipline  
						value = 0.25
					}
				}
			}
			else_if = { 
				limit = { has_dlc = "Lions of the North" }
				OR = { 
					num_of_hussars = 8 
					has_global_modifier_value = {
						which = infantry_power 
						value = 0.35 
					}
					has_global_modifier_value = {
						which = discipline  
						value = 0.25
					}
				}
			}
			else = {
				OR = { 
					num_of_cavalry = 22 # modified
					has_global_modifier_value = {
						which = infantry_power 
						value = 0.35 
					}
					has_global_modifier_value = {
						which = discipline  
						value = 0.25
					}
				}
			}
		}
		effect = { 
			country_event = { id = flavor_pol.27 } 
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_4_plc_1 = { 
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC
	}
	has_country_shield = yes

	plc_lifetime_of_war = {
		icon = mission_plc_lifetime_of_war 
		position = 2 
		required_missions = { pol_varna_aftermath } 
		trigger = {
			if = {
				limit = { has_dlc = "Cradle of Civilization" }
				army_professionalism = 1 
			}
			else = { army_tradition = 95 } 
			army_size = 50 # modified
			if = { 
				limit = { 
					has_estate = estate_cossacks 
					has_dlc = "Lions of the North"
				} 
				OR = { 
					num_of_hussars = 8 
					AND = { 
						estate_loyalty = { 
							estate = estate_cossacks 
							loyalty = 60 
						}
						num_of_estate_privileges = {
							estate = estate_cossacks
							value = 5 
						}
					}
					has_global_modifier_value = {
						which = infantry_power 
						value = 0.35 
					}
					has_global_modifier_value = {
						which = discipline  
						value = 0.25
					}
				}
			}
			else_if = { 
				limit = { 
					has_estate = estate_cossacks
				} 
				OR = { 
					num_of_cavalry = 22 # modified
					AND = { 
						estate_loyalty = { 
							estate = estate_cossacks 
							loyalty = 60 
						}
						num_of_estate_privileges = {
							estate = estate_cossacks
							value = 5 
						}
					}
					has_global_modifier_value = {
						which = infantry_power 
						value = 0.35 
					}
					has_global_modifier_value = {
						which = discipline  
						value = 0.25
					}
				}
			}
			else_if = { 
				limit = { has_dlc = "Lions of the North" }
				OR = { 
					num_of_hussars = 8 
					has_global_modifier_value = {
						which = infantry_power 
						value = 0.35 
					}
					has_global_modifier_value = {
						which = discipline  
						value = 0.25
					}
				}
			}
			else = {
				OR = { 
					num_of_cavalry = 22 # modified
					has_global_modifier_value = {
						which = infantry_power 
						value = 0.35 
					}
					has_global_modifier_value = {
						which = discipline  
						value = 0.25
					}
				}
			}
		}
		effect = { 
			country_event = { id = flavor_pol.27 }
		}
	}
}

poland_sca_slot_4_b = { 
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = POL 
			tag = PLC 
		}
	}
	has_country_shield = yes
	
	pol_deal_mazovia = {
		icon = mission_pol_deal_mazovia 
		required_missions = { } 
		position = 3 
		provinces_to_highlight = { 
			OR = { 
				province_id = 1940
				area = mazovia_area 
			}
		}
		trigger = {
			mazovia_area = { 
				type = all 
				owned_by = ROOT 
			}
			1940 = { owned_by = ROOT }
			257 = { 
				is_capital_of = ROOT 
				num_of_times_improved = 6
			}
		}
		effect = {
			257 = {
				add_base_tax = 1 
				add_base_production = 1 
				add_base_manpower = 1 
				add_province_modifier = {
					name = pol_polish_seat_of_power_modifier
					duration = 5475 
				}
			}
		}
	}	
	
	pol_negotiate_nunciature = {
		icon = mission_pol_negotiate_nunciature 
		required_missions = { pol_deal_mazovia }
		position = 4 
		trigger = {
			OR = { 
				PAP = {	
					has_opinion = { 
						who = ROOT 
						value = 165
					}
					alliance_with = ROOT 
				}
				is_papal_controller = yes 
				NOT = { religion = catholic } 
			}
			OR = { 
				PAP = { 
					if = {
						limit = { has_dlc = "Leviathan" }
						trust = { 	
							who = ROOT 
							value = 70
						}
					}
					else = {
						has_opinion_modifier = {
							who = ROOT 
							modifier = sent_gift
						}
					}
				}
				religious_unity = 0.9 
			}
		}
		effect = {
			custom_tooltip = pol_catholic_reward_twice_if_religious_ideas_tt
			tooltip = { 
				add_country_modifier = {
					name = pol_official_papal_nunciature_modifier
					duration = 5475 
				}
			}
			custom_tooltip = pol_catholic_reward_twice_if_religious_ideas_2_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_official_papal_nunciature_2_modifier
					duration = 7300 
				}
				if = { 
					limit = { 
						capital_scope = { 
							NOT = { has_cardinal = no } 
						}
					}
					capital_scope = { add_cardinal = yes }
				}
			}
			custom_tooltip = pol_alternatively_tt 
			tooltip = { 
				add_ruler_modifier = {
					name = pol_facing_the_catholics_modifier
					duration = -1 
				}
			}
			hidden_effect = { 
				if = {
					limit = { 
						is_papal_controller = yes 
						NOT = { prestige = 95 } 
					}
					add_prestige = 10 
				}
				if = { 
					limit = { 
						full_idea_group = religious_ideas 
						religion = catholic 
					} 
					add_country_modifier = { 
						name = pol_official_papal_nunciature_2_modifier
						duration = 7300 
					}
				}
				else_if = {
					limit = { religion = catholic }
					add_country_modifier = {
						name = pol_official_papal_nunciature_modifier
						duration = 5475 
					}
				}
				if = { 
					limit = {
						religion = catholic 
						full_idea_group = religious_ideas
						capital_scope = { 
							NOT = { has_cardinal = no } 
						}
					}
					capital_scope = { add_cardinal = yes }
				}
				if = { 
					limit = { 
						NOT = { religion = catholic } 
					}
					add_ruler_modifier = {
						name = pol_facing_the_catholics_modifier
						duration = -1 
					}
				}
			}
		}
	}
	
	pol_expand_krakow_university = {
		icon = eastern_catholicization 
		required_missions = { pol_negotiate_nunciature pol_polish_renaissance } 
		position = 6
		provinces_to_highlight = { province_id = 262 } 
		trigger = {
			262 = { 
				OR = { 
					development = 40 
					has_building = university 
				}
			}
		}
		effect = {
			country_event = { id = flavor_pol.28 } 
		}
	}
}
	
poland_sca_slot_4_c = { 
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC } 
	}
	has_country_shield = yes	
	
	pol_branching_mission_eoe = {
		icon = mission_locked_mission 
		required_missions = { pol_expand_krakow_university }
		position = 7 
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			if = { 
				limit = { has_dlc = "Rule Britannia" }
				OR = { 
					innovativeness = 95
					AND = { 
						prestige = 95 
						monthly_adm = 15  
						has_final_tier_reforms_trigger = yes 
					}
				}
			}
			else = { prestige = 95 } 
			num_of_owned_provinces_with = {
				has_building = university 
				value = 30 
			}
		}
		effect = {
			add_country_modifier = {
				name = pol_reformed_education_system_modifier
				duration = 7300
			}
			custom_tooltip = pol_5_ref_prog_per_university
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_4_plc_2 = { 
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC 
	}
	has_country_shield = yes	
	
	plc_edict_education = {
		icon = mission_plc_edict_education 
		required_missions = { pol_expand_krakow_university }
		position = 7 
		trigger = {
			if = { 
				limit = { has_dlc = "Rule Britannia" } 
				OR = { 
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						has_building = university
						value = 35
					}
					innovativeness = 95
				} 
			}
			else = { 
				prestige = 85
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					has_building = university
					value = 35
				} 
			}
		}
		effect = {
			add_country_modifier = {
				name = pol_reformed_education_system_modifier
				duration = 7300
			}
			custom_tooltip = pol_5_ref_prog_per_university
			hidden_effect = {
				every_owned_province = {
					limit = { has_building = university } 
					owner = { change_government_reform_progress = 5 } 
				}
			}
		}
	}
}

poland_sca_slot_4_d = { 
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = POL 
			tag = PLC 
		}
	}
	has_country_shield = yes
	
	pol_raise_noble_host = {
		icon = mission_pol_raise_noble_host 
		required_missions = { } 
		position = 9 
		trigger = { 
			army_size_percentage = 0.9
			if = { 
				limit = { has_dlc = "Res Publica" }
				OR = { 
					num_of_estate_privileges = {
						estate = estate_nobles 
						value = 5 
					}
					national_focus = MIL
					manpower_percentage = 0.5 
				}
			}
			else = {
				OR = { 
					num_of_estate_privileges = {
						estate = estate_nobles 
						value = 5 
					}
					manpower_percentage = 0.5 
				}
			}	
		}
		effect = { 
			east_prussia_area = {
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT }
				}
				add_permanent_claim = ROOT 
			}
			west_prussia_area = {
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT }
				}
				add_permanent_claim = ROOT 
			}
			if = { 
				limit = { has_estate = estate_nobles }
				add_estate_loyalty = {
					estate = estate_nobles 
					loyalty = 15 
				}
			}
			else = { add_stability_or_adm_power = yes }
			if = { 
				limit = { has_parliament = yes } 
				add_years_of_manpower_scaled_to_seats = 1
			}
			else = { add_mil_power = 50 }
		} 
	}
	
	pol_embellish_gdansk = {
		icon = mission_danzig_or_war 
		required_missions = { pol_raise_noble_host pol_prussia_confederation } 
		position = 10 
		trigger = { 
			43 = { country_or_non_sovereign_subject_holds = ROOT }
			if = { 
				limit = { has_dlc = "Dharma" }
				43 = { 
					OR = {
						development = 35 
						province_has_center_of_trade_of_level = 3 
					}
					has_trade_building_trigger = yes 
				}
			}
			else = { 
				43 = { 
					development = 40 
					has_trade_building_trigger = yes 
				}
			}
			43 = { has_production_building_trigger = yes }
		}
		effect = {
			country_event = { id = flavor_pol.31 }
		} 
	} 
}

poland_sca_slot_4_e = { 
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC } 
	}
	has_country_shield = yes
	
	pol_branching_mission_db = {
		icon = mission_locked_mission 
		required_missions = { pol_embellish_gdansk } 
		position = 11 
		provinces_to_highlight = { 
			OR = { 
				province_id = 43 
				province_id = 41 
				province_id = 40 
				province_id = 38
			}
			has_trade_building_trigger = no 
		}
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			1926 = { 
				trade_share = {
					country = ROOT
					share = 65
				} 
			}
			43 = { has_trade_building_trigger = yes } 
			41 = { has_trade_building_trigger = yes }
			40 = { has_trade_building_trigger = yes }
			38 = { has_trade_building_trigger = yes }
			if = { 
				limit = { 
					1 = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT } 
						owner = { 
							OR = { 
								tag = DAN 
								tag = SWE 
								tag = NOR 
								tag = SCA 
							}
						}
					}
				}
				1 = { 	
					owner = {
						OR = { 
							trade_embargo_by = ROOT 
							alliance_with = ROOT
							AND = { 
								is_subject_of = ROOT 
								NOT = { liberty_desire = 25 } 
							}
						}
					}
				}
			}
		}
		effect = { 
			custom_tooltip = pol_if_completed_via_embrago
			tooltip = { 
				1 = { 
					owner = { 
						reverse_add_casus_belli = { 
							type = cb_restore_personal_union
							months = 300
							target = POL 
						}
					}
				}
				scandinavia_region = {
					limit = { 
						NOT = { is_core = ROOT } 
						NOT = { owned_by = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
				add_country_modifier = {
					name = pol_winter_preparations_modifier
					duration = 3650 
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				scandinavia_region = {
					limit = { 
						NOT = { is_core = ROOT } 
						NOT = { owned_by = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
				add_country_modifier = {
					name = pol_winter_preparations_modifier
					duration = 3650 
				}
			}
			custom_tooltip = pol_via_alliance_or_subjugation_tt
			tooltip = {
				add_country_modifier = {
					name = pol_polish_swedish_act_of_baltic_coprosperity_modifier
					duration = 7300 
				}
			}
			custom_tooltip = pol_unlock_when_plc_tt	
		} 
	} 
	
	pol_branching_mission_ptp = {
		icon = mission_locked_mission 
		required_missions = { pol_branching_mission_db } 
		position = 12
		provinces_to_highlight = { 
			region = scandinavia_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			if = { 
				limit = { 
					1 = { 
						owner = {
							NOT = { is_rival = ROOT } 
						}
						NOT = { country_or_non_sovereign_subject_holds = ROOT }
					}
				}
				OR = {
					num_of_owned_provinces_with = {
						region = scandinavia_region 
						value = 20 
					}
					1 = { 
						owner = {
							OR = {
								alliance_with = ROOT 
								is_subject_of = ROOT 
							}
						}
						owner = { 
							trust = {
								who = ROOT 
								value = 100 
							}
							has_opinion = {
								who = ROOT 
								value = 190 
							}
						}
					}
				}
			}
			else = {
				num_of_owned_provinces_with = {
					region = scandinavia_region 
					value = 20 
				}
			}
		}
		effect = {
			custom_tooltip = pol_via_alliance_or_subjugation_2_tt
			tooltip = { 
				1 = {
					owner = { 
						custom_tooltip = pol_production_of_metal_25_tt
					}
				}
				add_country_modifier = { 
					name = pol_swedish_metal_imports_modifier
					duration = 7300
				}
				1 = {
					owner = { add_historical_friend = ROOT }
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				add_ruler_modifier = {
					name = pol_victory_polish_crown_modifier
					duration = -1 
				}
			}
			custom_tooltip = pol_unlock_when_plc_tt				
		} 
	}
}

poland_sca_slot_4_plc_3 = { 
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC
	}
	has_country_shield = yes
	
	plc_dominate_baltic = {
		icon = mission_conquer_baltic_region 
		required_missions = { pol_embellish_gdansk } 
		position = 11 
		provinces_to_highlight = { 
			OR = { 
				province_id = 43 
				province_id = 41 
				province_id = 40 
				province_id = 38
			}
			has_trade_building_trigger = no 
		}
		trigger = { 
			1926 = { 
				trade_share = {
					country = ROOT
					share = 65
				} 
			}
			43 = { has_trade_building_trigger = yes } 
			41 = { has_trade_building_trigger = yes }
			40 = { has_trade_building_trigger = yes }
			38 = { has_trade_building_trigger = yes }
			1 = { 	
				owner = {
					OR = { 
						tag = ROOT 
						trade_embargo_by = ROOT 
						alliance_with = ROOT
						AND = { 
							is_subject_of = ROOT 
							NOT = { liberty_desire = 25 } 
						}
					}
				}
			}
		}
		effect = { 
			custom_tooltip = pol_if_completed_via_embrago
			tooltip = { 
				1 = { 
					owner = { 
						reverse_add_casus_belli = { 
							type = cb_restore_personal_union
							months = 300
							target = PLC
						}
					}
				}
				scandinavia_region = {
					limit = { 
						NOT = { is_core = ROOT } 
						NOT = { owned_by = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
				add_country_modifier = {
					name = pol_winter_preparations_modifier
					duration = 3650 
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				scandinavia_region = {
					limit = { 
						NOT = { is_core = ROOT } 
						NOT = { owned_by = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
				add_country_modifier = {
					name = pol_winter_preparations_modifier
					duration = 3650 
				}
			}
			custom_tooltip = pol_via_alliance_or_subjugation_tt
			tooltip = {
				add_country_modifier = {
					name = pol_polish_swedish_act_of_baltic_coprosperity_modifier
					duration = 7300 
				}
			}
			hidden_effect = { 
				if = { 
					limit = { 
						1 = { 
							owner = { 
								NOT = { alliance_with = ROOT }
								NOT = { is_subject_of = ROOT }
								valid_for_personal_unions_trigger = yes 
								trade_embargo_by = ROOT
							}
						}
					}
					1 = { 
						owner = { 
							reverse_add_casus_belli = { 
								type = cb_restore_personal_union
								months = 300
								target = ROOT
							}
						}
					}
					add_country_modifier = {
						name = pol_winter_preparations_modifier
						duration = 3650 
					}
					scandinavia_region = {
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { owned_by = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
				}
				else_if = {
					limit = { 
						1 = { 
							OR = { 
								owned_by = ROOT 
								owner = {
									NOT = { alliance_with = ROOT }  
									valid_for_personal_unions_trigger = no 
									NOT = { is_subject_of = ROOT }
								} 
							}
						}
					}
					add_country_modifier = {
						name = pol_winter_preparations_modifier
						duration = 3650 
					}
					scandinavia_region = {
						limit = { 
							NOT = { is_core = ROOT } 
							NOT = { owned_by = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
				}
				else_if = {
					limit = {
						1 = {
							owner = { 
								OR = { 
									AND = { 
										is_subject_of = ROOT 
										NOT = { liberty_desire = 25 }
									}
									alliance_with = ROOT 
								}
							}
						}
					}
					add_country_modifier = {
						name = pol_polish_swedish_act_of_baltic_coprosperity_modifier
						duration = 7300 
					}
					1 = {
						owner = {
							add_country_modifier = {
								name = pol_polish_swedish_act_of_baltic_coprosperity_modifier
								duration = 7300 
							}
						}
					}
				}	
			}
		} 
	} 
	
	plc_prevent_deluge = {
		icon = mission_plc_prevent_deluge 
		required_missions = { plc_dominate_baltic } 
		position = 12
		provinces_to_highlight = { 
			region = scandinavia_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			OR = {
				num_of_owned_provinces_with = {
					region = scandinavia_region 
					value = 20 
				}
				1 = { 
					owner = {
						OR = {
							alliance_with = ROOT 
							is_subject_of = ROOT 
						}
						OR = {
							trust = {
								who = ROOT 
								value = 100 
							}
							has_opinion = {
								who = ROOT 
								value = 190 
							}
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = pol_via_alliance_or_subjugation_2_tt
			tooltip = { 
				1 = {
					owner = { 
						custom_tooltip = pol_production_of_metal_25_tt
					}
				}
				add_country_modifier = { 
					name = pol_swedish_metal_imports_modifier
					duration = 7300
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				add_ruler_modifier = {
					name = pol_victory_polish_crown_modifier
					duration = -1 
				}
			}
			hidden_effect = {
				if = {
					limit = { 
						1 = { 
							owner = {
								OR = {
									alliance_with = ROOT 
									is_subject_of = ROOT 
								}
								OR = { 
									trust = {
										who = ROOT 
										value = 100 
									}
									has_opinion = {
										who = ROOT 
										value = 190 
									}
								}
							}
						}
					}
					1 = {
						owner = {
							add_historical_friend = ROOT 
							every_owned_province = {
								limit = { 
									OR = {
										trade_goods = iron 
										trade_goods = gold 
										trade_goods = copper 
									}
								}
								add_province_modifier = {
									name = pol_increased_production_of_metals_modifier
									duration = 7300
									hidden = yes 
								}
							}
						}
					}
					add_country_modifier = { 
						name = pol_swedish_metal_imports_modifier
						duration = 7300
					}
				}
				else = {
					add_ruler_modifier = {
						name = pol_victory_polish_crown_modifier
						duration = -1 
					}
				}
			}					
		} 
	}
}

poland_sca_slot_5_branching_lit_hre = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = POL 
			tag = PLC 
		}
		NOT = { has_country_flag = pol_chose_pu_flag }
		NOT = { has_country_flag = pol_denied_pu_flag }
	}
	has_country_shield = yes
	
	pol_branching_mission_dv_de = {
		icon = mission_unknown_mission 
		required_missions = { pol_varna_aftermath } 
		position = 2 
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			west_dniepr_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 1 
			}
			east_dniepr_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 1 
			}
			podolia_volhynia_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT
				num_of_times_improved = 1 
			}
			282 = { 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 2 
			}
			283 = { 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 2 
			}
			2406 = { 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 2 
			}
			if = {
				limit = { has_dlc = "Leviathan" }
				280 = { 
					OR = {
						AND = {
							num_of_times_improved = 5 
							has_tax_building_trigger = yes 
						}
						custom_trigger_tooltip = {
							tooltip = pol_lavra_2_or_3_tt
							OR = {
								has_great_project = {
									type = kiev_pechersk_lavra
									tier = 2 
								}
								has_great_project = {
									type = kiev_pechersk_lavra
									tier = 3
								}
							}
						}
					}
				}
			}
			else = {
				280 = {
					num_of_times_improved = 5 
					has_tax_building_trigger = yes 
				}
			}
			emperor = {
				alliance_with = ROOT 
				has_opinion = {
					who = ROOT 
					value = 160 
				}
				OR = {
					marriage_with = ROOT 
					trust = {
						who = ROOT 
						value = 75 
					}
				}
				owes_favors = { who = ROOT value = 20 } 
			}
		}
		effect = { 
			if = {
				limit = {
					west_dniepr_area = {
						type = all 
						owned_by = LIT 
					}
					east_dniepr_area = {
						type = all
						owned_by = LIT 
					}
					podolia_volhynia_area = {
						type = all 
						country_or_non_sovereign_subject_holds = ROOT 
					}
					LIT = { is_subject_of = ROOT }
				}
				country_event = { id = flavor_pol.32 } 
			}
			else = {
				west_dniepr_area = {
					add_province_modifier = {
						name = pol_prosperity_in_ukraine_modifier
						duration = 7300 
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						add_prosperity = 15 
					}
				}
				east_dniepr_area = {
					add_province_modifier = {
						name = pol_prosperity_in_ukraine_modifier
						duration = 7300 
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						add_prosperity = 15 
					}
				}
				podolia_volhynia_area = {
					add_province_modifier = {
						name = pol_prosperity_in_ukraine_modifier
						duration = 7300 
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						add_prosperity = 15 
					}
				}
			}
			emperor = {
				country_event = { id = flavor_pol.33 } 
			}
			custom_tooltip = pol_claim_lithuanian_lands
			hidden_effect = { 
				LIT = { 
					every_owned_province = { 
						limit = { owned_by = LIT } 
						add_permanent_claim = POL 
					}
				}
			}
		}				
	}
	
	pol_branching_mission_te_ps = {
		icon = mission_unknown_mission  
		required_missions = { pol_branching_mission_dv_de } 
		position = 3
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			development_in_provinces = {
				area = lithuania_area
				value = 50 
			}
			development_in_provinces = {
				area = smolensk_area 
				value = 50 
			}
			lithuania_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			smolensk_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			if = {
				limit = {
					LIT = { is_subject_of = ROOT }
				}
				LIT = {
					is_in_deficit = no 
					NOT = { num_of_loans = 1 }
				}
			}
			272 = { 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_buildings_in_province = 4 
			}
			is_elector = yes 
			has_global_modifier_value = {
				which = diplomatic_reputation 
				value = 6 
			}
			legitimacy_equivalent = 95 
			OR = {
				is_emperor = yes 
				emperor = {
					NOT = { army_size = ROOT }
					NOT = { total_development = ROOT }
				}
			}
		}
		effect = { 
			add_country_modifier = {
				name = pol_efficient_taxation_lit_lands_modifier
				duration = 5475
			}
			if = {
				limit = { has_estate = estate_nobles }
				add_estate_loyalty = {
					estate = estate_nobles 
					loyalty = 10 
				}
			}
			if = {
				limit = { has_estate = estate_church }
				add_estate_loyalty = {
					estate = estate_church 
					loyalty = 10 
				}
			}
			if = {
				limit = { has_estate = estate_burghers }
				add_estate_loyalty = {
					estate = estate_burghers 
					loyalty = 10 
				}
			}
			if = {
				limit = { has_estate = estate_cossacks }
				add_estate_loyalty = {
					estate = estate_cossacks 
					loyalty = 10 
				}
			}
			LIT = {
				if = {
					limit = {
						exists = yes 
						is_subject_of = ROOT 
					}
					change_estate_land_share = {
						estate = all 
						share = -10 
					}
				}
			}
			if = {
				limit = { is_emperor = yes } 
				add_country_modifier = {
					name = pol_polish_empire_modifier
					duration = -1 
				}
			}
			else = {
				add_country_modifier = {
					name = pol_bid_emperorship_modifier
					duration = 5475 
				}
			}
			every_elector = {
				add_opinion = {
					who = ROOT 
					modifier = pol_polish_influence_modifier
				}
			}
		}
	}
	
	pol_branching_mission_ic_pne = {
		icon = mission_unknown_mission  
		required_missions = { pol_branching_mission_te_ps } 
		position = 4 
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			tag = PLC 
			total_development = 1500
			if = {
				limit = { has_dlc = "Common Sense" } 
				government_rank = 3 
				has_final_tier_reforms_trigger = yes
			}
			else = { 
				has_final_tier_reforms_trigger = yes 
				adm_tech = 20 
			}
			is_emperor = yes 
			OR = { 
				total_development = 1500 
				custom_trigger_tooltip = {
					tooltip = pol_4_400_dev_tt
					calc_true_if = {
						all_subject_country = {
							total_development = 400 
						}
						amount = 4 
					}
				}
			}
			hre_reform_passed = erbkaisertum
		}
		effect = { 
			add_country_modifier = {
				name = pol_commonwealth_supreme_modifier
				duration = 9125 
			}
			add_country_modifier = {
				name = pol_imperial_polish_decrees_modifier
				duration = 9125 
			}
			change_ruler_stat = {
				type = dip
				amount = 2
			}
		}
	}
}

poland_sca_slot_5_branching_lit_east = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = POL 
			tag = PLC 
		}
		has_country_flag = pol_chose_pu_flag
		NOT = { has_country_flag = pol_denied_pu_flag }
	}
	has_country_shield = yes
	
	pol_develop_ukraine = {
		icon = mission_develop_kiev 
		required_missions = { pol_varna_aftermath } 
		provinces_to_highlight = { 
			OR = { 
				AND = { 
					OR = { 
						area = west_dniepr_area
						area = east_dniepr_area
						area = podolia_volhynia_area
					}
					NOT = { 
						num_of_times_improved = 1
					}
				}
				AND = {
					OR = {
						province_id = 282
						province_id = 283
						province_id = 2406
					}
					NOT = { 
						num_of_times_improved = 2 
					}
				}
			}
		}	
		position = 2 
		trigger = { 
			not_in_mission_preview_mode = { key = POL }
			west_dniepr_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 1 
			}
			east_dniepr_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 1 
			}
			podolia_volhynia_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT
				num_of_times_improved = 1 
			}
			282 = { 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 2 
			}
			283 = { 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 2 
			}
			2406 = { 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_times_improved = 2 
			}
			if = {
				limit = { has_dlc = "Leviathan" }
				280 = { 
					OR = {
						AND = {
							num_of_times_improved = 5 
							has_tax_building_trigger = yes 
						}
						custom_trigger_tooltip = {
							tooltip = pol_lavra_2_or_3_tt
							OR = {
								has_great_project = {
									type = kiev_pechersk_lavra
									tier = 2 
								}
								has_great_project = {
									type = kiev_pechersk_lavra
									tier = 3
								}
							}
						}
					}
				}
			}
			else = {
				280 = {
					num_of_times_improved = 5 
					has_tax_building_trigger = yes 
				}
			}
		}
		effect = { 
			if = {
				limit = {
					west_dniepr_area = {
						type = all 
						owned_by = LIT 
					}
					east_dniepr_area = {
						type = all
						owned_by = LIT 
					}
					podolia_volhynia_area = {
						type = all 
						country_or_non_sovereign_subject_holds = ROOT 
					}
					LIT = { is_subject_of = ROOT }
				}
				country_event = { id = flavor_pol.32 } 
			}
			else = {
				west_dniepr_area = {
					add_province_modifier = {
						name = pol_prosperity_in_ukraine_modifier
						duration = 7300 
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						add_prosperity = 15 
					}
				}
				east_dniepr_area = {
					add_province_modifier = {
						name = pol_prosperity_in_ukraine_modifier
						duration = 7300 
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						add_prosperity = 15 
					}
				}
				podolia_volhynia_area = {
					add_province_modifier = {
						name = pol_prosperity_in_ukraine_modifier
						duration = 7300 
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						add_prosperity = 15 
					}
				}
			}
		}				
	}
	
	pol_tend_east = {
		icon = mission_pol_tend_east 
		required_missions = { pol_develop_ukraine } 
		position = 3
		provinces_to_highlight = { 
			OR = {
				area = smolensk_area 
				area = lithuania_area 
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				NOT = { development = 10 }
			}
		}
		trigger = { 
			not_in_mission_preview_mode = { key = POL }
			lithuania_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT
				development = 10 
			}
			smolensk_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
				development = 10
			}
			if = {
				limit = {
					LIT = { is_subject_of = ROOT }
				}
				LIT = {
					is_in_deficit = no 
					NOT = { num_of_loans = 1 }
				}
			}
			272 = { 
				country_or_non_sovereign_subject_holds = ROOT 
				num_of_buildings_in_province = 4 
			}
		}
		effect = { 
			add_country_modifier = {
				name = pol_efficient_taxation_lit_lands_modifier
				duration = 5475
			}
			if = {
				limit = { has_estate = estate_nobles }
				add_estate_loyalty = {
					estate = estate_nobles 
					loyalty = 10 
				}
			}
			if = {
				limit = { has_estate = estate_church }
				add_estate_loyalty = {
					estate = estate_church 
					loyalty = 10 
				}
			}
			if = {
				limit = { has_estate = estate_burghers }
				add_estate_loyalty = {
					estate = estate_burghers 
					loyalty = 10 
				}
			}
			if = {
				limit = { has_estate = estate_cossacks }
				add_estate_loyalty = {
					estate = estate_cossacks 
					loyalty = 10 
				}
			}
			LIT = {
				if = {
					limit = {
						exists = yes 
						is_subject_of = ROOT 
					}
					change_estate_land_share = {
						estate = all 
						share = -10 
					}
				}
			}
		}
	}
	
	pol_imperial_commonwealth = {
		icon = mission_pol_imperial_commonwealth 
		required_missions = { pol_tend_east } 
		position = 4 
		trigger = {
			not_in_mission_preview_mode = { key = POL }
			tag = PLC 
			total_development = 1500
			if = {
				limit = { has_dlc = "Common Sense" } 
				government_rank = 3 
				has_final_tier_reforms_trigger = yes
			}
			else = { 
				has_final_tier_reforms_trigger = yes 
				adm_tech = 20 
			}
		}
		effect = { 
			add_country_modifier = {
				name = pol_commonwealth_supreme_modifier
				duration = 9125 
			}
		}
	}
}

poland_sca_slot_5_branching_hre_west = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = POL 
			tag = PLC 
		}
		has_country_flag = pol_denied_pu_flag 
		NOT = { has_country_flag = pol_chose_pu_flag }
	}
	has_country_shield = yes
	
	pol_delegate_emperor = {
		icon = mission_pol_delegate_emperor 
		required_missions = { pol_varna_aftermath } 
		position = 2 
		trigger = {
			not_in_mission_preview_mode = { key = POL }
			if = {
				limit = { is_emperor = yes } 
				is_emperor = yes 
				imperial_influence = 45
			}
			else_if = {
				limit = { hre_size = 1 }
				emperor = {
					OR = {
						alliance_with = ROOT 
						has_opinion = {
							who = ROOT 
							value = 160 
						}
					}
					OR = {
						marriage_with = ROOT 
						trust = {
							who = ROOT 
							value = 60 
						}
						owes_favors = { who = ROOT value = 15 }
					}
				}
			}
			else = {
				OR = {
					government_rank = 3 
					total_development = 1000
				}
				prestige = 70
			}
		}
		effect = {
			if = {
				limit = { 
					is_emperor = no 
					hre_size = 1 
				}
				emperor = {
					country_event = { id = flavor_pol.33 } 
				}
			}
			else_if = { 
				limit = { hre_size = 1 }
				add_imperial_influence = 10 add_prestige = 25 
			}
			else = { 
				north_german_region = {
					limit = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT }
						NOT = { is_core = ROOT }
					}
					add_permanent_claim = ROOT 
				}
				south_german_region = {
					limit = { 
						NOT = { country_or_non_sovereign_subject_holds = ROOT }
						NOT = { is_core = ROOT }
					}
					add_permanent_claim = ROOT 
				}
			} 
			custom_tooltip = pol_claim_lithuanian_lands
			hidden_effect = { 
				LIT = { 
					every_owned_province = { 
						limit = { owned_by = LIT } 
						add_permanent_claim = POL 
					}
				}
			}
		}				
	}
	
	pol_place_sun = {
		icon = mission_pol_place_sun 
		required_missions = { pol_delegate_emperor } 
		position = 3
		trigger = {
			not_in_mission_preview_mode = { key = POL }
			OR = {
				is_elector = yes 
				is_emperor = yes 
				AND = {
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						region = north_german_region 
						value = 25
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						region = south_german_region 
						value = 25
					}
				}
			}
			OR = {
				custom_trigger_tooltip = {
					tooltip = 6_dip_rep_tt
					has_global_modifier_value = {
						which = diplomatic_reputation 
						value = 6 
					}
				}
				power_projection = 70
			}
			legitimacy_equivalent = 95 
			OR = {
				is_emperor = yes 
				emperor = {
					NOT = { army_size = ROOT }
					NOT = { total_development = ROOT }
				}
				NOT = { hre_size = 1 }
			}
		}
		effect = { 
			if = {
				limit = { is_emperor = yes } 
				add_country_modifier = {
					name = pol_polish_empire_modifier
					duration = -1 
				}
				every_elector = {
					add_opinion = {
						who = ROOT 
						modifier = pol_polish_influence_modifier
					}
				}
			}
			else_if = {
				limit = { hre_size = 1 }
				add_country_modifier = {
					name = pol_bid_emperorship_modifier
					duration = 5475 
				}
				every_elector = {
					add_opinion = {
						who = ROOT 
						modifier = pol_polish_influence_modifier
					}
				}
			}
			else = {
				change_ruler_stat = {
					type = dip
					amount = 2
				}
				change_ruler_stat = {
					type = mil
					amount = 1
				}
			}
		}
	}
	
	pol_proclaim_new_empire = {
		icon = king_of_poland 
		required_missions = { pol_place_sun } 
		position = 4 
		trigger = {
			not_in_mission_preview_mode = { key = POL }
			if = {
				limit = { hre_size = 1 }
				is_emperor = yes 
			}
			else = { stability = 3 }
			OR = { 
				total_development = 1500 
				custom_trigger_tooltip = {
					tooltip = pol_4_400_dev_tt
					calc_true_if = {
						all_subject_country = {
							total_development = 400 
						}
						amount = 4 
					}
				}
			}
			if = { 
				limit = { 
					has_dlc = "Emperor" 
					hre_size = 1 
				}
				hre_reform_passed = emperor_erbkaisertum
			}
			else_if = { 
				limit = { hre_size = 1 }
				hre_reform_passed = erbkaisertum 
			}
		}
		effect = {
			if = {
				limit = { hre_size = 1 }
				add_country_modifier = {
					name = pol_imperial_polish_decrees_modifier
					duration = 9125 
				}
			}
			else = {

			}
			change_ruler_stat = {
				type = adm
				amount = 2
			}
		}
	}
}
	
poland_sca_slot_5_b = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = { 
			tag = POL 
			tag = PLC 
		}
	}
	has_country_shield = yes

	pol_polish_renaissance = {
		icon = mission_pol_polish_renaissance
		required_missions = { } 
		position = 5 
		trigger = {
			has_institution = renaissance 
			is_in_deficit = no 
			NOT = { corruption = 1 } 
			share_of_starting_income = 1.5 
		}
		effect = { 
			country_event = { id = flavor_pol.5100 }
			if = { 
				limit = { has_dlc = "Rule Britannia" }
				add_ruler_modifier = {
					name = pol_incentives_modifier
					duration = -1 
				}
			}
			else = { 
				add_ruler_modifier = {
					name = pol_incentives2_modifier
					duration = -1 
				}
			}
		}
	}
	
	pol_dissemination_new_ideas = {
		icon = continue_the_renaissance 
		required_missions = { pol_polish_renaissance }
		position = 6 
		trigger = {
			is_religion_enabled = protestant
			OR = { 
				custom_trigger_tooltip = {
					tooltip = pol_embraced_counter_reformation 
					has_country_modifier = counter_reformation
				}
				AND = { 
					NOT = { religion = catholic } 
					religious_unity = 0.9 
				}
				full_idea_group = humanist_ideas 
				full_idea_group = religious_ideas 
			}
		}
		effect = {
			custom_tooltip = pol_catholic_religious_or_counter_reformation_tt
			tooltip = {
				add_papal_influence = 50
				add_country_modifier = {
					name = pol_strong_catholic_ties_modifier
					duration = 7300 
				}
			}
			custom_tooltip = pol_non_catholic_religious_ideas_tt 
			tooltip = {
				if = { 
					limit = { has_estate = estate_church } 
					add_estate_loyalty = {
						estate = estate_church 
						loyalty = 20 
					}
				}
				add_country_modifier = { 
					name = pol_shield_against_catholicism_modifier
					duration = -1 
					desc = pol_until_we_not_defender_desc 
				}
			}
			custom_tooltip = pol_humanist_ideas_tt
			tooltip = { 
				add_country_modifier = { 
					name = pol_guarantee_religious_rights_modifier
					duration = -1 
				}
			}
			hidden_effect = {
				if = { 
					limit = { full_idea_group = humanist_ideas }
					add_country_modifier = { 
						name = pol_guarantee_religious_rights_modifier
						duration = -1 
					}
				}
				else_if = { 
					limit = { 
						religion = catholic 
						OR = { 
							has_country_modifier = counter_reformation 
							full_idea_group = religious_ideas
						}
					}
					add_papal_influence = 50
					add_country_modifier = {
						name = pol_strong_catholic_ties_modifier
						duration = 7300 
					}
				}
				else = { 
					add_estate_loyalty = {
						estate = estate_church 
						loyalty = 20 
					}
					set_defender_of_the_faith = {
						who = ROOT 
						religion = ROOT 
					}
					add_country_modifier = { 
						name = pol_shield_against_catholicism_modifier
						duration = -1 
						desc = pol_until_we_not_defender_desc 
					}
				}
			}	
		}
	}
}

poland_sca_slot_5_c = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC } 
	}
	has_country_shield = yes
	
	pol_branching_mission_pm = {
		icon = mission_locked_mission 
		required_missions = { pol_dissemination_new_ideas }
		position = 8 
		provinces_to_highlight = { province_id = 4538 }
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			4538 = { 
				base_production = 15 
				has_manufactory_trigger = yes 
			}
			has_institution = printing_press 
			num_of_merchants = 4 
		}
		effect = { 
			4538 = { 
				change_trade_goods = paper 
				add_province_modifier = { 
					name = pol_major_printing_center_modifier
					duration = -1 
				}
			}
			generate_scaled_advisor_of_type_and_cost_effect = {
				type = natural_scientist
				cost_multiplier = 0.25 
			}
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_5_plc_2 = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC
	}
	has_country_shield = yes
	
	plc_printing_movement = {
		icon = mission_state_manufactories 
		required_missions = { pol_dissemination_new_ideas }
		position = 8 
		provinces_to_highlight = { province_id = 4538 }
		trigger = {
			4538 = { 
				base_production = 15 
				has_manufactory_trigger = yes 
			}
			has_institution = printing_press 
			num_of_merchants = 4 
		}
		effect = { 
			4538 = { 
				change_trade_goods = paper 
				add_province_modifier = { 
					name = pol_major_printing_center_modifier
					duration = -1 
				}
			}
			generate_scaled_advisor_of_type_and_cost_effect = {
				type = natural_scientist
				cost_multiplier = 0.25 
			}
		}
	}
}

poland_sca_slot_5_d = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		OR = {
			tag = PLC 
			tag = POL 
		}
	}
	has_country_shield = yes
	
	pol_prussia_confederation = {
		icon = develop_konigsberg
		required_missions = { } 
		position = 9
		provinces_to_highlight = { 
			OR = { 
				area = east_prussia_area 
				area = west_prussia_area 
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			OR = {
				AND = { 
					west_prussia_area = {
						type = all
						country_or_non_sovereign_subject_holds = ROOT	
					}
					east_prussia_area = {
						type = all 
						country_or_non_sovereign_subject_holds = ROOT 
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = support_confederation_tooltip
						has_country_flag = supported_prussian_confederation_flag
					}
					exists = DNZ
					DNZ = {
						is_at_war = no
						is_subject = no
					}
				}
			}
		}
		effect = { 
			if = {
				limit = {
					has_country_flag = supported_prussian_confederation_flag
					exists = DNZ
					DNZ = {
						is_subject = no
						is_at_war = no
						NOT = { total_development = 100 }
					}
				}
				country_event = { id = flavor_teu.3 }
				custom_tooltip = vassalize_danzig_tooltip
			}
			else_if = {
				limit = {
					any_subject_country = {
						any_owned_province = {
							area = west_prussia_area
						}
					}
				}
				west_prussia_area = {
					limit = {
						NOT = { is_core = ROOT	}
					}
					add_core = ROOT
				}
			}
			43 = {
				add_base_tax = 1 
				add_base_production = 1 
				add_province_modifier = {
					name = pol_developing_port_modifier
					duration = 5475 
				}
			}
			livonia_area = {
				limit = {
					NOT = { is_core = ROOT	}
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT
			}
			curonia_area = {
				limit = {
					NOT = { is_core = ROOT	}
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT
			}
			estonia_ingria_area = {
				limit = {
					NOT = { is_core = ROOT	}
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT
			}
		}
	}
}

poland_sca_slot_5_e = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = POL 
		NOT = { tag = PLC }
	}
	has_country_shield = yes
	
	pol_branching_mission_bl = { 
		icon = mission_locked_mission 
		required_missions = { pol_prussia_confederation } 
		position = 10
		provinces_to_highlight = { 
			OR = {
				area = estonia_ingria_area 
				area = curonia_area
				area = livonia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			estonia_ingria_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			estonia_ingria_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			estonia_ingria_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			38 = {
				if = {
					limit = { has_dlc = "Dharma" }
					OR = {
						province_has_center_of_trade_of_level = 2 
						num_of_times_improved = 5 
					}
				}
				else = { num_of_times_improved = 5 } 
				has_trade_building_trigger = yes 
			}
		}
		effect = { 
			custom_tooltip = pol_daugava_estuary_will_be_expanded_tt
			if = {
				limit = { religion = catholic } 
				add_papal_influence = 10 
			}
			else_if = {
				limit = { religion = protestant }
				add_church_power = 25 
			}
			else_if = {
				limit = { religion = reformed }
				add_fervor = 20
			}
			else_if = {
				limit = { 
					religion = orthodox 
					has_dlc = "Third Rome"
				}
				add_patriarch_authority = 0.05
			}
			vorpommern_area = {
				limit = {
					NOT = { is_core = ROOT	}
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT
			}
			hinter_pommern_area = {
				limit = {
					NOT = { is_core = ROOT	}
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT
			}
			custom_tooltip = pol_unlock_when_plc_tt
		}	
	}
	
	pol_branching_mission_dop = { 
		icon = mission_locked_mission 
		required_missions = { pol_branching_mission_bl } 
		position = 12
		provinces_to_highlight = { 
			OR = {
				area = vorpommern_area 
				area = hinter_pommern_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			vorpommern_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT
			}
			hinter_pommern_area = {	
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
		}
		effect = { 
			custom_tooltip = pol_if_chose_hre_path
			custom_tooltip = generic_more_mercs_available_tt
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				vorpommern_area = {
					change_culture = ROOT 
					add_province_modifier = {
						name = pol_wave_of_migration_modifier 
						duration = 5475 
					}
					add_base_manpower = 1 
				}
				hinter_pommern_area = {
					change_culture = ROOT 
					add_province_modifier = {
						name = pol_wave_of_migration_modifier
						duration = 5475 
					}
					add_base_manpower = 1 
				}
			}
			hidden_effect = {
				if = { 
					limit = { has_country_flag = pol_chose_pu_flag }
					vorpommern_area = {
						change_culture = ROOT 
						add_province_modifier = {
							name = pol_wave_of_migration_modifier
							duration = 5475 
						}
						add_base_manpower = 1 
					}
					hinter_pommern_area = {
						change_culture = ROOT 
						add_province_modifier = {
							name = pol_wave_of_migration_modifier
							duration = 5475 
						}
						add_base_manpower = 1 
					}
				}
				else = {
					hidden_effect = {
						add_country_modifier = {
							name = pol_cheap_ap_mercs_modifier
							duration = 7300 
							hidden = yes
						}
					}
					add_country_modifier = {
						name = "mercenaries_to_the_standard"
						duration = 3650
						hidden = yes
					}
				}
			}
			custom_tooltip = pol_unlock_when_plc_tt
		}
	}
}

poland_sca_slot_5_plc_3 = { 
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Lions of the North"
	}
	potential = {
		has_dlc = "Lions of the North"
		NOT = { map_setup = map_setup_random }
		tag = PLC
	}
	has_country_shield = yes
	
	plc_break_livonia = { 
		icon = mission_the_livonians
		required_missions = { pol_prussia_confederation } 
		position = 10
		provinces_to_highlight = { 
			OR = {
				area = estonia_ingria_area 
				area = curonia_area
				area = livonia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = { 
			estonia_ingria_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			curonia_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			livonia_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			38 = {
				if = {
					limit = { has_dlc = "Dharma" }
					OR = {
						province_has_center_of_trade_of_level = 2 
						num_of_times_improved = 5 
					}
				}
				else = { num_of_times_improved = 5 } 
				has_trade_building_trigger = yes 
			}
		}
		effect = { 
			custom_tooltip = pol_daugava_estuary_will_be_expanded_tt
			hidden_effect = {
				38 = { 
					remove_province_modifier = daugava_estuary_modifier
					add_province_modifier = {
						name = pol_daugava_estuary_modifier
						duration = -1 
					}
				}
			}
			if = {
				limit = { religion = catholic } 
				add_papal_influence = 10 
			}
			else_if = {
				limit = { religion = protestant }
				add_church_power = 25 
			}
			else_if = {
				limit = { religion = reformed }
				add_fervor = 20
			}
			else_if = {
				limit = { 
					religion = orthodox 
					has_dlc = "Third Rome"
				}
				add_patriarch_authority = 0.05
			}
			vorpommern_area = {
				limit = {
					NOT = { is_core = ROOT	}
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT
			}
			hinter_pommern_area = {
				limit = {
					NOT = { is_core = ROOT	}
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT
			}
		}	
	}
	
	plc_duchy_pomerania = { 
		icon = mission_conquer_pomerania		
		required_missions = { plc_break_livonia } 
		position = 12
		provinces_to_highlight = { 
			OR = {
				area = vorpommern_area 
				area = hinter_pommern_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			vorpommern_area = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT
			}
			hinter_pommern_area = {	
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
		}
		effect = { 
			custom_tooltip = pol_if_chose_hre_path
			custom_tooltip = generic_more_mercs_available_tt
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				vorpommern_area = {
					change_culture = ROOT 
					add_province_modifier = {
						name = pol_wave_of_migration_modifier 
						duration = 5475 
					}
					add_base_manpower = 1 
				}
				hinter_pommern_area = {
					change_culture = ROOT 
					add_province_modifier = {
						name = pol_wave_of_migration_modifier
						duration = 5475 
					}
					add_base_manpower = 1 
				}
			}
			hidden_effect = {
				if = { 
					limit = { has_country_flag = pol_chose_pu_flag }
					vorpommern_area = {
						change_culture = ROOT 
						add_province_modifier = {
							name = pol_wave_of_migration_modifier
							duration = 5475 
						}
						add_base_manpower = 1 
					}
					hinter_pommern_area = {
						change_culture = ROOT 
						add_province_modifier = {
							name = pol_wave_of_migration_modifier
							duration = 5475 
						}
						add_base_manpower = 1 
					}
				}
				else = {
					hidden_effect = {
						add_country_modifier = {
							name = pol_cheap_ap_mercs_modifier
							duration = 7300 
							hidden = yes
						}
					}
					add_country_modifier = {
						name = "mercenaries_to_the_standard"
						duration = 3650
						hidden = yes
					}
				}
			}
		}
	}
}
