﻿unite_the_western_slavs_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_family_tree.dds"
	}
	decision_group_type = sclavinia_group
	ai_check_interval = 1

	is_shown = {
		culture = { has_cultural_pillar = heritage_west_slavic }
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:unite_the_western_slavs_decision
			}
			has_global_variable = unite_the_slavs_decision_effects_sclavinia
		}
		OR = { 
			has_global_variable = empire_unlock_sclavinia
			has_global_variable = orthodox_unlock_sclavinia
			has_global_variable = roman_catholic_unlock_sclavinia
			NOT = { has_culture = culture:polish }
		}
	}

	is_valid = { 
		culture = { has_cultural_pillar = heritage_west_slavic }
		trigger_if = { 
			limit = { 
				game_start_date < 1000.1.1 
				title:e_hre = { holder = { exists = yes } }
				has_global_variable = roman_catholic_unlock_sclavinia
			}
			OR = { 
				title:e_hre = { holder = { completely_controls_region = custom_west_slavia } }
				completely_controls_region = custom_west_slavia 
			} 
		}
		trigger_if = { 
			limit = { 
				game_start_date < 1000.1.1 
				NAND = { 
					title:e_hre = { holder = { exists = yes } }
					has_global_variable = roman_catholic_unlock_sclavinia 
				}
			}
			completely_controls_region = custom_west_slavia
			custom_tooltip = { 
				text = custom_pagan_borderlands_sclavinia_tooltip
				any_county_in_region = { 
					count > 24
					region = custom_pagan_borderlands_sclavinia  # 40
					holder.top_liege = ROOT
				}
			}
			any_county_in_region = { 
				count > 24
				region = custom_pagan_borderlands_sclavinia  # 40
				custom_tooltip = { holder.top_liege = ROOT }
			}     
			custom_tooltip = { 
				text = custom_pagan_borderlands_rulers_sclavinia_tooltip
				any_ruler = {
					filter = { 
						OR = { 
							has_culture = culture:polabian
							has_culture = culture:czech
						}
						is_landed = yes
						NOT = { this = ROOT } 
						capital_province = { geographical_region = custom_pagan_borderlands_sclavinia }
					}
					count = all
					NOT = { is_independent_ruler = yes }
				}
			}
		}
		trigger_if = { 
			limit = { 
				game_start_date > 1000.1.1 
				title:e_hre = { holder = { exists = yes } }
				has_global_variable = roman_catholic_unlock_sclavinia
			}
			OR = { 
				title:e_hre = { holder = { completely_controls_region = custom_west_slavia_1066 } }
				completely_controls_region = custom_west_slavia_1066 
			} 
		}
		trigger_if = { 
			limit = { 
				game_start_date > 1000.1.1 
				NAND = { 
					title:e_hre = { holder = { exists = yes } }
					has_global_variable = roman_catholic_unlock_sclavinia 
				}
			}
			completely_controls_region = custom_west_slavia_1066  
		}
		trigger_if = { 
			limit = { has_global_variable = orthodox_unlock_sclavinia }
			custom_tooltip = { 
				text = orthodox_unlock_sclavinia_trigger_tooltip
				any_neighboring_and_across_water_top_liege_realm_owner = {
					has_title = title:e_byzantium
				}
			}
		}
		trigger_if = { 
			limit = { 
				has_global_variable = roman_catholic_unlock_sclavinia 
				NOT = { has_title = title:e_hre }
				title:e_hre = { holder = { exists = yes } }
				is_independent_ruler = yes		
			}
			custom_tooltip = { 
				text = roman_catholic_unlock_sclavinia_trigger_tooltip
				any_neighboring_and_across_water_top_liege_realm_owner = {
					has_title = title:e_hre
				}
			}
		}
	}
	
	is_valid_showing_failures_only = {
		is_landed = yes
	}

	effect = {
		gain_heroic_legend_seed_tooltip_effect = yes
		save_scope_as = western_slav_uniter
		if = {
			limit = {
				OR = { 
					has_global_variable = empire_unlock_sclavinia
					AND = { 
						has_global_variable = roman_catholic_unlock_sclavinia
						NOT = { title:e_hre = { holder = { exists = yes } } } 
					}
					NOT = { has_culture = culture:polish }
				}
			}
			show_as_tooltip = { unite_the_western_slavs_decision_effects = yes }  
		}
		if = {
			limit = { 
				has_global_variable = orthodox_unlock_sclavinia
				has_culture = culture:polish
			}
			show_as_tooltip = { orthodox_unite_the_western_slavs_decision_effects = yes }  
		}
		if = {
			limit = { 
				has_global_variable = roman_catholic_unlock_sclavinia
				title:e_hre = { holder = { exists = yes } }
				has_culture = culture:polish
			}
			show_as_tooltip = { roman_catholic_unite_the_western_slavs_decision_effects = yes }  
		}

		#Events
		trigger_event = sclavinia.0006
		every_player = {
			limit = {
				NOT = { this = scope:western_slav_uniter }
				is_within_diplo_range = { CHARACTER = scope:western_slav_uniter }
			}
			trigger_event = east_europe.0002
		}

		#Can only be done once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:unite_the_western_slavs_decision
		}
		set_global_variable = {
			name = unite_the_western_slavs_decision
			value = scope:western_slav_uniter
		}
		set_global_variable = {
			name = unite_the_western_slavs_decision_title
			value = scope:western_slav_uniter.primary_title
		}
	}
	

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
unite_the_slavs_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/mpo_decision_confederation.dds"
	}
	decision_group_type = sclavinia_group
	ai_check_interval = 1

	is_shown = {
		OR = {
			culture = { has_cultural_pillar = heritage_west_slavic }
			culture = { has_cultural_pillar = heritage_east_slavic }
			culture = { has_cultural_pillar = heritage_south_slavic }
			}
		NOR = {
			has_culture = culture:vlach # Not technically Slavic despite being in the South Slavic group.
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:unite_the_slavs_decision
			}
		}
		OR = { 
			has_global_variable = empire_unlock_sclavinia
			NOT = { has_culture = culture:polish }
			has_global_variable = byzantium_conquered_sclavinia_slavic_ere
		}
	}

	is_valid = {
		OR = {
			culture = { has_cultural_pillar = heritage_west_slavic }
			culture = { has_cultural_pillar = heritage_east_slavic }
			culture = { has_cultural_pillar = heritage_south_slavic }
		}
		completely_controls_region = custom_slavia
	}

	is_valid_showing_failures_only = {
		is_landed = yes
	}
	
	effect = {
		save_scope_as = slav_uniter

		if = { 
			limit = { 
				has_global_variable = byzantium_conquered_sclavinia_slavic_ere 
				has_culture = culture:polish
			}
			show_as_tooltip = { unite_the_slavs_decision_effects_slavic_ere = yes } #Actually applied in east_europe.0010 - prestige, laws, title, innovation effects
		}
		else = { 
			show_as_tooltip = { unite_the_slavs_decision_effects = yes } #Actually applied in east_europe.0010 - prestige, laws, title, innovation effects
		}

		#Events
		trigger_event = sclavinia.0012
		every_player = {
			limit = {
				NOT = { this = scope:slav_uniter }
				is_within_diplo_range = { CHARACTER = scope:slav_uniter }
			}
			trigger_event = east_europe.0011
		}

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:unite_the_slavs_decision
		}
		set_global_variable = {
			name = unite_the_slavs_decision
			value = scope:slav_uniter
		}
	}


	cost = { gold = { value = 600 } }

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
divide_voivodeships_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_spend_money.dds"
	}
	decision_group_type = sclavinia_group
	ai_check_interval = 1

	is_shown = {
		has_culture = culture:polish
		has_title = title:k_poland
		NOT = { has_global_variable = divide_voivodeships_decision_end_sclavinia }
	}

	is_valid = {
		trigger_if = { 
			limit = { game_start_date < 1000.1.1 }
			completely_controls_region = k_poland867
		}
		trigger_if = { 
			limit = { game_start_date > 1000.1.1 }
			completely_controls_region = k_poland1066
		} 
		trigger_if = { 
			limit = { is_ai = no }
			prestige_level >= 4
		}
	}
	cost = {
		gold = {
			if = {
				limit = { is_ai = no }
				add = 500
			}
		}
	}
	effect = {
		set_global_variable = {
			name = divide_voivodeships_decision_end_sclavinia
			value = yes
		}
		#title:k_poland = { change_development_level = 3 }
		title:k_poland = { custom_tooltip = de_jure_liege_voivodeships_sclavinia }
		custom_tooltip = is_destroyed_voivodeships_sclavinia
		custom_tooltip = you_get_voivodeships_sclavinia
		capital_province.county = { change_development_level = 5 }
		show_as_tooltip = { 
			capital_province.county = { 
				add_county_modifier = { 
					modifier = powiat_modifier_sclavinia
					months = 182
				}
			}
		}
		custom_tooltip = { 
			text = powiat_modifier_sclavinia_tooltip
			every_realm_county = { 
				limit = { 
					target_is_de_jure_liege_or_above = title:k_poland
				}
				add_county_modifier = { 
					modifier = powiat_modifier_sclavinia
					months = 182
				}
			}
		}
		hidden_effect = {
			title:c_leczycka = { set_de_jure_liege_title = title:d_leczyckie }
			title:d_leczyckie = { set_de_jure_liege_title = title:k_poland }
			title:c_sieradzka = { set_de_jure_liege_title = title:d_sieradzkie }
			title:c_wielunska = { set_de_jure_liege_title = title:d_sieradzkie }
			title:d_sieradzkie = { set_de_jure_liege_title = title:k_poland }
			title:c_kujawy = { set_de_jure_liege_title = title:d_brzeskokujawskie }
			title:c_dobrzynska = { set_de_jure_liege_title = title:d_brzeskokujawskie }
			title:d_brzeskokujawskie = { set_de_jure_liege_title = title:k_poland }
			title:c_czerska = { set_de_jure_liege_title = title:d_mazowieckie }
			title:c_zakroczymska = { set_de_jure_liege_title = title:d_mazowieckie }
			title:c_lomzynska = { set_de_jure_liege_title = title:d_mazowieckie }
			title:d_mazowieckie = { set_de_jure_liege_title = title:k_poland }
			title:c_plocka = { set_de_jure_liege_title = title:d_plockie }
			title:d_plockie = { set_de_jure_liege_title = title:k_poland }
			title:c_gostyninska = { set_de_jure_liege_title = title:d_rawskie }
			title:d_rawskie = { set_de_jure_liege_title = title:k_poland }
			title:c_kaliska = { set_de_jure_liege_title = title:d_kaliskie }
			title:c_gnieznienska = { set_de_jure_liege_title = title:d_kaliskie }
			title:c_krajna = { set_de_jure_liege_title = title:d_kaliskie }
			title:d_kaliskie = { set_de_jure_liege_title = title:k_poland }
			title:c_poznanska = { set_de_jure_liege_title = title:d_poznanskie }
			title:c_wschowska = { set_de_jure_liege_title = title:d_poznanskie }
			title:d_poznanskie = { set_de_jure_liege_title = title:k_poland }
			title:c_sandomierska = { set_de_jure_liege_title = title:d_sandomierskie }
			title:c_tarnowska = { set_de_jure_liege_title = title:d_sandomierskie }
			title:c_radomska = { set_de_jure_liege_title = title:d_sandomierskie }
			title:d_sandomierskie = { set_de_jure_liege_title = title:k_poland }
			title:c_krakowska = { set_de_jure_liege_title = title:d_krakowskie }
			title:c_sacz = { set_de_jure_liege_title = title:d_krakowskie }
			title:d_krakowskie = { set_de_jure_liege_title = title:k_poland }
			title:c_lubelska = { set_de_jure_liege_title = title:d_lubelskie }
			title:c_stezycka = { set_de_jure_liege_title = title:d_lubelskie }
			title:d_lubelskie = { set_de_jure_liege_title = title:k_poland }
			title:c_peremyshl = { set_de_jure_liege_title = title:d_ruskie }
			title:c_cherven = { set_de_jure_liege_title = title:d_ruskie }
			title:d_ruskie = { set_de_jure_liege_title = title:k_poland }
			title:c_belz = { set_de_jure_liege_title = title:d_belskie }
			title:d_belskie = { set_de_jure_liege_title = title:k_poland }
			title:d_wroclawskie = { set_de_jure_liege_title = title:k_poland }
			title:c_legnica = { set_de_jure_liege_title = title:d_glogowskie }
			title:c_schweibus = { set_de_jure_liege_title = title:d_glogowskie }
			title:d_glogowskie = { set_de_jure_liege_title = title:k_poland }
			title:c_ratibor = { set_de_jure_liege_title = title:d_raciborskie }
			title:c_cieszyn = { set_de_jure_liege_title = title:d_raciborskie }
			title:d_raciborskie = { set_de_jure_liege_title = title:k_poland }
			title:d_opolskie = { set_de_jure_liege_title = title:k_poland }
			title:c_przemkow = { set_de_jure_liege_title = title:d_swidnickie }
			title:d_swidnickie = { set_de_jure_liege_title = title:k_poland }
			title:c_grunberg = { set_de_jure_liege_title = title:d_krosnienskie }
			title:c_sprottau = { set_de_jure_liege_title = title:d_swidnickie }
			title:d_krosnienskie = { set_de_jure_liege_title = title:k_poland }
			destroy_title = title:d_kuyavia
			destroy_title = title:d_mazovia
			destroy_title = title:d_wielkopolska
			destroy_title = title:d_lesser_poland
			destroy_title = title:d_cherven_cities
			destroy_title = title:d_lower_silesia
			destroy_title = title:d_upper_silesia
			title:d_kuyavia = { set_de_jure_liege_title = title:k_trashcan }
			title:d_mazovia = { set_de_jure_liege_title = title:k_trashcan }
			title:d_wielkopolska = { set_de_jure_liege_title = title:k_trashcan }
			title:d_lesser_poland = { set_de_jure_liege_title = title:k_trashcan }
			title:d_cherven_cities = { set_de_jure_liege_title = title:k_trashcan }
			title:d_lower_silesia = { set_de_jure_liege_title = title:k_trashcan }
			title:d_upper_silesia = { set_de_jure_liege_title = title:k_trashcan }
			if = { 
				limit = { game_start_date < 1000.1.1 }
				title:c_torun = { set_de_jure_liege_title = title:d_chelminskie }
				title:d_chelminskie = { set_de_jure_liege_title = title:k_poland }
				destroy_title = title:d_dziadoszanie    
				title:d_dziadoszanie = { set_de_jure_liege_title = title:k_trashcan }
			}
			else = { 
				title:c_lubusz = { set_de_jure_liege_title = title:d_krosnienskie}
			}
			if = {
				limit = { dynasty = { this = dynasty:9129 } }
				title:c_brzeg = { set_de_jure_liege_title = title:d_brzeskie }
				title:c_nysa = { set_de_jure_liege_title = title:d_brzeskie }
				title:d_brzeskie = { set_de_jure_liege_title = title:k_poland }
				title:c_breslau = { set_de_jure_liege_title = title:d_wroclawskie }
				title:c_miliez = { set_de_jure_liege_title = title:d_wroclawskie }
				title:c_opole = { set_de_jure_liege_title = title:d_opolskie }
				title:c_bethen = { set_de_jure_liege_title = title:d_opolskie }				
				set_global_variable = {
					name = brzeskie_exists_sclavinia
					value = yes
				}
			}
			else = { 
				title:c_breslau = { set_de_jure_liege_title = title:d_wroclawskie }
				title:c_brzeg = { set_de_jure_liege_title = title:d_wroclawskie }
				title:c_miliez = { set_de_jure_liege_title = title:d_wroclawskie }
				title:c_opole = { set_de_jure_liege_title = title:d_opolskie }
				title:c_bethen = { set_de_jure_liege_title = title:d_opolskie }
				title:c_nysa = { set_de_jure_liege_title = title:d_opolskie }
			}
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			if = {
				limit = { dynasty = { this = dynasty:9129 } }
				title:d_brzeskie = {
					change_title_holder = {
						holder = ROOT
						change = scope:change_title
					}
				}
			}
			title:d_leczyckie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_sieradzkie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_brzeskokujawskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_mazowieckie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_plockie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_rawskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_kaliskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_poznanskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_sandomierskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_krakowskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_lubelskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_ruskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_belskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			if = { 
				limit = { game_start_date < 1000.1.1 }
				title:d_chelminskie = {
					change_title_holder = {
						holder = ROOT
						change = scope:change_title
					}
				}
			}
			title:d_wroclawskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_glogowskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_raciborskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_opolskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_swidnickie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			title:d_krosnienskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			trigger_event = sclavinia.0004
		}
	}
	

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
divide_voivodeships_wielkopolska_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp2_decision_struggle_hostility.dds"
	}
	decision_group_type = sclavinia_group
	ai_check_interval = 1

	is_shown = {
		has_culture = culture:polish
		has_title = title:k_poland
		has_global_variable = divide_voivodeships_decision_sclavinia
		NOT = { has_global_variable = divide_voivodeships_wielkopolska_decision_sclavinia }
		has_global_variable = empire_unlock_sclavinia
	}

	is_valid = {
		OR = {
			trigger_if = { 
				limit = { game_start_date < 1000.1.1 }
				completely_controls_region = polska_early_sclavinia
				completely_controls_region = prowincja_wielkopolska_early_sclavinia
				
			}
			trigger_if = { 
				limit = { game_start_date > 1000.1.1 }
				completely_controls_region = polska_sclavinia
				completely_controls_region = prowincja_wielkopolska_sclavinia
				
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_poznanskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_poznanskie
					completely_controls = title:c_pila
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_pomorskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_pomorskie
					completely_controls = title:c_danzig
					completely_controls = title:c_berent
					completely_controls = title:c_miastko
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_chelminskie_sclavinia game_start_date > 1000.1.1 }
				}
				AND = {
					completely_controls_region = d_chelminskie
					completely_controls = title:c_malbork
					completely_controls = title:c_wormditt
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_chelminskie_sclavinia game_start_date < 1000.1.1 }
				}
				AND = {
					completely_controls_region = d_chelminskie
					completely_controls = title:c_torun
					completely_controls = title:c_malbork
					completely_controls = title:c_wormditt
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_pruskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_pruskie
					completely_controls = title:c_natangia
					completely_controls = title:c_bartenstein
					completely_controls = title:c_angerburg
					completely_controls = title:c_allenstein
					completely_controls = title:c_osterode
					gold >= 100
				}
			}
		}
	}
	effect = {
		custom_tooltip = divide_voivodeships_again_decision_tooltip
		if = {
			limit = { 
				completely_controls = title:c_pila
				NOT = { has_global_variable = divide_voivodeships_decision_poznanskie_sclavinia }
			}
			title:c_pila = { set_de_jure_liege_title = title:d_poznanskie }
			set_global_variable = {
				name = divide_voivodeships_decision_poznanskie_sclavinia
				value = yes
			}
		}
		if = {
			limit = { 
				completely_controls = title:c_danzig
				completely_controls = title:c_berent
				completely_controls = title:c_miastko
				NOT = { has_global_variable = divide_voivodeships_decision_pomorskie_sclavinia }
			}
			title:c_danzig = { set_de_jure_liege_title = title:d_pomorskie }
			title:c_berent = { set_de_jure_liege_title = title:d_pomorskie }
			title:c_miastko = { set_de_jure_liege_title = title:d_pomorskie }
			title:d_pomorskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_pomorskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_pomorskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_malbork
				completely_controls = title:c_wormditt
				NOT = { has_global_variable = divide_voivodeships_decision_chelminskie_sclavinia }
				game_start_date < 1000.1.1
			}
			title:c_malbork = { set_de_jure_liege_title = title:d_chelminskie }
			title:c_wormditt = { set_de_jure_liege_title = title:d_chelminskie }
			title:d_chelminskie = { set_title_name = chelminsko_malborskie_sclavinia }
			set_global_variable = {
				name = divide_voivodeships_decision_chelminskie_sclavinia
				value = yes
			}
		}
		if = {
			limit = { 
				completely_controls = title:c_torun
				completely_controls = title:c_malbork
				completely_controls = title:c_wormditt
				NOT = { has_global_variable = divide_voivodeships_decision_chelminskie_sclavinia }
				game_start_date > 1000.1.1
			}
			title:c_torun = { set_de_jure_liege_title = title:d_chelminskie }
			title:c_malbork = { set_de_jure_liege_title = title:d_chelminskie }
			title:c_wormditt = { set_de_jure_liege_title = title:d_chelminskie }
			title:d_chelminskie = { set_de_jure_liege_title = title:k_poland set_title_name = chelminsko_malborskie_sclavinia }
			set_global_variable = {
				name = divide_voivodeships_decision_chelminskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_chelminskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = {
				completely_controls = title:c_natangia
				completely_controls = title:c_bartenstein
				completely_controls = title:c_angerburg
				completely_controls = title:c_allenstein
				completely_controls = title:c_osterode
				NOT = { has_global_variable = divide_voivodeships_decision_pruskie_sclavinia }
			}
			title:c_natangia = { set_de_jure_liege_title = title:d_pruskie }
			title:c_bartenstein = { set_de_jure_liege_title = title:d_pruskie }
			title:c_angerburg = { set_de_jure_liege_title = title:d_pruskie }
			title:c_allenstein = { set_de_jure_liege_title = title:d_pruskie }
			title:c_osterode = { set_de_jure_liege_title = title:d_pruskie }
			title:d_pruskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_pruskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_pruskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				has_global_variable = divide_voivodeships_decision_poznanskie_sclavinia
				has_global_variable = divide_voivodeships_decision_pomorskie_sclavinia
				has_global_variable = divide_voivodeships_decision_chelminskie_sclavinia
				has_global_variable = divide_voivodeships_decision_pruskie_sclavinia
			}
			set_global_variable = {
				name = divide_voivodeships_wielkopolska_decision_sclavinia
				value = yes
			}
		}
		hidden_effect = {  
			if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_again_decision_pomorze_sclavinia }
					has_global_variable = divide_voivodeships_decision_pomorskie_sclavinia
				}
				title:c_cammin = { set_de_jure_liege_title = title:d_pomerelia }
				title:d_pomerelia = { set_capital_county = title:c_slupsk }
				set_global_variable = {
					name = divide_voivodeships_again_decision_pomorze_sclavinia
					value = yes
				}
			}
		}
		if = {
			limit = { 
				has_global_variable = divide_voivodeships_wielkopolska_decision_sclavinia
				has_global_variable = divide_voivodeships_malopolska_decision_sclavinia
				has_global_variable = divide_voivodeships_litewska_decision_sclavinia
				has_global_variable = divide_voivodeships_inflancka_decision_sclavinia
			}
			trigger_event = sclavinia.0005
		}
	}
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
divide_voivodeships_malopolska_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_varangian_guard.dds"
	}
	decision_group_type = sclavinia_group
	ai_check_interval = 1

	is_shown = {
		has_culture = culture:polish
		has_title = title:k_poland
		has_global_variable = divide_voivodeships_decision_sclavinia
		NOT = { has_global_variable = divide_voivodeships_malopolska_decision_sclavinia }
		has_global_variable = empire_unlock_sclavinia
	}

	is_valid = {
		OR = {
			trigger_if = { 
				limit = { game_start_date < 1000.1.1 }
				completely_controls_region = polska_early_sclavinia
				
			}
			trigger_if = { 
				limit = { game_start_date > 1000.1.1 }
				completely_controls_region = polska_sclavinia
				
			}
			completely_controls_region = prowincja_malopolska_sclavinia
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_spiskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_krakowskie
					completely_controls = title:c_krakowska
					completely_controls = title:c_sacz
					completely_controls = title:c_spis
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_ruskie_sclavinia }
				}
				AND = {
					completely_controls_region = d_ruskie
					completely_controls = title:c_halych
					completely_controls = title:c_lviv
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_wolynskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_wolynskie
					completely_controls = title:c_volodymyr
					completely_controls = title:c_zaslavl
					completely_controls = title:c_peresopnytsia
					completely_controls = title:c_zvyahel
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_podolskie_sclavinia }
				}
				AND = {
					completely_controls_region = d_podolskie
					completely_controls = title:c_terebovl
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_braclawskie_sclavinia }
				}
				AND = {
					completely_controls_region = d_braclawskie
					completely_controls = title:c_ushytsia
					completely_controls = title:c_uman
					completely_controls = title:c_ladyzyn
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_kijowskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_kijowskie
					completely_controls = title:c_kiev
					completely_controls = title:c_chornobyl
					completely_controls = title:c_zhytomyr
					completely_controls = title:c_korsun
					completely_controls = title:c_voin
					completely_controls = title:c_pereyaslavl
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_zaporoskie_sclavinia }
				}
				AND = {
					completely_controls_region = d_zaporoskie
					completely_controls = title:c_dnipro
					completely_controls = title:c_cherkassy
					completely_controls = title:c_kherson
					completely_controls = title:c_hradyzk
					completely_controls = title:c_odessa
					completely_controls = title:c_lower_dniepr
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_czernihowskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_czernihowskie
					completely_controls = title:c_chernigov
					completely_controls = title:c_novgorod_seversky
					completely_controls = title:c_putyvl
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_kurskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_kurskie
					completely_controls = title:c_kursk
					completely_controls = title:c_sevsk
					completely_controls = title:c_romen
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_bachmuckie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_bachmuckie
					completely_controls = title:c_samar
					completely_controls = title:c_bakhmut
					completely_controls = title:c_lozova
					gold >= 100
				}
			}
		}
	}
	effect = {
		custom_tooltip = divide_voivodeships_again_decision_tooltip
		if = {
			limit = { 
				completely_controls = title:c_spis
				NOT = { has_global_variable = divide_voivodeships_decision_spiskie_sclavinia }
			}
			title:c_spis = { set_de_jure_liege_title = title:d_krakowskie }
			set_global_variable = {
				name = divide_voivodeships_decision_spiskie_sclavinia
				value = yes
			}
		}
		if = {
			limit = { 
				completely_controls = title:c_halych
				completely_controls = title:c_lviv
				NOT = { has_global_variable = divide_voivodeships_decision_ruskie_sclavinia }
			}
			title:c_halych = { set_de_jure_liege_title = title:d_ruskie }
			title:c_lviv = { set_de_jure_liege_title = title:d_ruskie }
			set_global_variable = {
				name = divide_voivodeships_decision_ruskie_sclavinia
				value = yes
			}
		}
		if = {
			limit = { 
				completely_controls = title:c_volodymyr
				completely_controls = title:c_zaslavl
				completely_controls = title:c_peresopnytsia
				completely_controls = title:c_zvyahel
				NOT = { has_global_variable = divide_voivodeships_decision_wolynskie_sclavinia }
			}
			title:c_volodymyr = { set_de_jure_liege_title = title:d_wolynskie }
			title:c_zaslavl = { set_de_jure_liege_title = title:d_wolynskie }
			title:c_peresopnytsia = { set_de_jure_liege_title = title:d_wolynskie }
			title:c_zvyahel = { set_de_jure_liege_title = title:d_wolynskie }
			title:d_wolynskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_wolynskie_sclavinia
				value = yes
			}
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_wolynskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_terebovl
				NOT = { has_global_variable = divide_voivodeships_decision_podolskie_sclavinia }
			}
			title:c_terebovl = { set_de_jure_liege_title = title:d_podolskie }
			title:d_podolskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_podolskie_sclavinia
				value = yes
			}
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_podolskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_ushytsia
				completely_controls = title:c_uman
				completely_controls = title:c_ladyzyn
				NOT = { has_global_variable = divide_voivodeships_decision_braclawskie_sclavinia }
			}
			title:c_ushytsia = { set_de_jure_liege_title = title:d_braclawskie }
			title:c_uman = { set_de_jure_liege_title = title:d_braclawskie }
			title:c_ladyzyn = { set_de_jure_liege_title = title:d_braclawskie }
			title:d_braclawskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_braclawskie_sclavinia
				value = yes
			}
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_braclawskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_kiev
				completely_controls = title:c_chornobyl
				completely_controls = title:c_zhytomyr
				completely_controls = title:c_korsun
				completely_controls = title:c_voin
				completely_controls = title:c_pereyaslavl
				NOT = { has_global_variable = divide_voivodeships_decision_kijowskie_sclavinia }
			}
			title:c_kiev = { set_de_jure_liege_title = title:d_kijowskie }
			title:c_chornobyl = { set_de_jure_liege_title = title:d_kijowskie }
			title:c_zhytomyr = { set_de_jure_liege_title = title:d_kijowskie }
			title:c_korsun = { set_de_jure_liege_title = title:d_kijowskie }
			title:c_voin = { set_de_jure_liege_title = title:d_kijowskie }
			title:c_pereyaslavl = { set_de_jure_liege_title = title:d_kijowskie }
			title:d_kijowskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_kijowskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_kijowskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_dnipro
				completely_controls = title:c_cherkassy
				completely_controls = title:c_kherson
				completely_controls = title:c_hradyzk
				completely_controls = title:c_odessa
				completely_controls = title:c_lower_dniepr
				NOT = { has_global_variable = divide_voivodeships_decision_zaporoskie_sclavinia }
			}
			title:c_dnipro = { set_de_jure_liege_title = title:d_zaporoskie }
			title:c_cherkassy = { set_de_jure_liege_title = title:d_zaporoskie }
			title:c_kherson = { set_de_jure_liege_title = title:d_zaporoskie }
			title:c_hradyzk = { set_de_jure_liege_title = title:d_zaporoskie }
			title:c_odessa = { set_de_jure_liege_title = title:d_zaporoskie }
			title:c_lower_dniepr = { set_de_jure_liege_title = title:d_zaporoskie }
			title:d_zaporoskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_zaporoskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_zaporoskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_chernigov
				completely_controls = title:c_novgorod_seversky
				completely_controls = title:c_putyvl
				NOT = { has_global_variable = divide_voivodeships_decision_czernihowskie_sclavinia }
			}
			title:c_chernigov = { set_de_jure_liege_title = title:d_czernihowskie }
			title:c_novgorod_seversky = { set_de_jure_liege_title = title:d_czernihowskie }
			title:c_putyvl = { set_de_jure_liege_title = title:d_czernihowskie }
			title:d_czernihowskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_czernihowskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_czernihowskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_kursk
				completely_controls = title:c_sevsk
				completely_controls = title:c_romen
				NOT = { has_global_variable = divide_voivodeships_decision_kurskie_sclavinia }
			}
			title:c_kursk = { set_de_jure_liege_title = title:d_kurskie }
			title:c_sevsk = { set_de_jure_liege_title = title:d_kurskie }
			title:c_romen = { set_de_jure_liege_title = title:d_kurskie }
			title:d_kurskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_kurskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_kurskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_samar
				completely_controls = title:c_bakhmut
				completely_controls = title:c_lozova
				NOT = { has_global_variable = divide_voivodeships_decision_bachmuckie_sclavinia }
			}
			title:c_samar = { set_de_jure_liege_title = title:d_bachmuckie }
			title:c_bakhmut = { set_de_jure_liege_title = title:d_bachmuckie }
			title:c_lozova = { set_de_jure_liege_title = title:d_bachmuckie }
			title:d_bachmuckie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_bachmuckie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_bachmuckie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				has_global_variable = divide_voivodeships_decision_spiskie_sclavinia
				has_global_variable = divide_voivodeships_decision_ruskie_sclavinia
				has_global_variable = divide_voivodeships_decision_wolynskie_sclavinia
				has_global_variable = divide_voivodeships_decision_podolskie_sclavinia
				has_global_variable = divide_voivodeships_decision_braclawskie_sclavinia
				has_global_variable = divide_voivodeships_decision_kijowskie_sclavinia
				has_global_variable = divide_voivodeships_decision_zaporoskie_sclavinia
				has_global_variable = divide_voivodeships_decision_czernihowskie_sclavinia
				has_global_variable = divide_voivodeships_decision_kurskie_sclavinia
				has_global_variable = divide_voivodeships_decision_bachmuckie_sclavinia
			}
			#destroy_title = title:d_halych
			set_global_variable = {
				name = divide_voivodeships_malopolska_decision_sclavinia
				value = yes
			}
		}
		hidden_effect = {  
			if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_nowa_sol_sclavinia }
					has_global_variable = divide_voivodeships_decision_orlowskie_sclavinia
					has_global_variable = divide_voivodeships_decision_kurskie_sclavinia
				}
				title:d_novosil = { set_de_jure_liege_title = title:k_opolye }
				set_global_variable = {
					name = divide_voivodeships_nowa_sol_sclavinia
					value = yes
				}
			}
		}
		if = {
			limit = { 
				has_global_variable = divide_voivodeships_wielkopolska_decision_sclavinia
				has_global_variable = divide_voivodeships_malopolska_decision_sclavinia
				has_global_variable = divide_voivodeships_litewska_decision_sclavinia
				has_global_variable = divide_voivodeships_inflancka_decision_sclavinia
			}
			trigger_event = sclavinia.0005
		}
	}
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
divide_voivodeships_litewska_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_cerimonial_decision.dds"
	}
	decision_group_type = sclavinia_group
	ai_check_interval = 1

	is_shown = {
		has_culture = culture:polish
		has_title = title:k_poland
		has_global_variable = divide_voivodeships_decision_sclavinia
		NOT = { has_global_variable = divide_voivodeships_litewska_decision_sclavinia }
		has_global_variable = empire_unlock_sclavinia
	}

	is_valid = {
		OR = {
			trigger_if = { 
				limit = { game_start_date < 1000.1.1 }
				completely_controls_region = polska_early_sclavinia
				
			}
			trigger_if = { 
				limit = { game_start_date > 1000.1.1 }
				completely_controls_region = polska_sclavinia
				
			}
			completely_controls_region = prowincja_litewska_sclavinia
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_brzeskolitewskie_sclavinia }
				}
				AND = {
					completely_controls_region = d_brzeskolitewskie
					completely_controls = title:c_berestye
					completely_controls = title:c_dorohychyn
					completely_controls = title:c_pinsk
					completely_controls = title:c_dubrovytsia
					completely_controls = title:c_turov
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_nowogrodzkie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_nowogrodzkie
					completely_controls = title:c_novogrudok
					completely_controls = title:c_volkovysk
					completely_controls = title:c_kletsk
					completely_controls = title:c_slutsk
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_minskie_sclavinia }
				}
				AND = {
					completely_controls_region = d_minskie
					completely_controls = title:c_minsk
					completely_controls = title:c_babruysk
					completely_controls = title:c_korosten
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_smolenskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_smolenskie
					completely_controls = title:c_smolensk
					completely_controls = title:c_roslavl
					completely_controls = title:c_starodub
					completely_controls = title:c_mozhaysk
					completely_controls = title:c_toropets
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_orlowskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_orlowskie
					completely_controls = title:c_karachev
					completely_controls = title:c_kozelsk
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_witebskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_witebskie
					completely_controls = title:c_vitebsk
					completely_controls = title:c_orsha
					completely_controls = title:c_gnezdovo
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_polockie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_polockie
					completely_controls = title:c_polotsk
					completely_controls = title:c_lukoml
					completely_controls = title:c_sebezh
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_trockie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_trockie
					completely_controls = title:c_trakai
					completely_controls = title:c_siauliai
					completely_controls = title:c_raseiniai
					completely_controls = title:c_yatvyagi
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_wilenskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_wilenskie
					completely_controls = title:c_kernave
					completely_controls = title:c_braslau
					completely_controls = title:c_grodno
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_zmudzkie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_zmudzkie
					completely_controls = title:c_palanga
					completely_controls = title:c_memel
					completely_controls = title:c_scalovia
					completely_controls = title:c_konigsberg
					gold >= 100
				}
			}
		}
	}
	effect = {
		custom_tooltip = divide_voivodeships_again_decision_tooltip
		if = {
			limit = { 
				completely_controls = title:c_berestye
				completely_controls = title:c_dorohychyn
				completely_controls = title:c_pinsk
				completely_controls = title:c_dubrovytsia
				completely_controls = title:c_turov
				NOT = { has_global_variable = divide_voivodeships_decision_brzeskolitewskie_sclavinia }
			}
			title:c_berestye = { set_de_jure_liege_title = title:d_brzeskolitewskie }
			title:c_dorohychyn = { set_de_jure_liege_title = title:d_brzeskolitewskie }
			title:c_pinsk = { set_de_jure_liege_title = title:d_brzeskolitewskie }
			title:c_dubrovytsia = { set_de_jure_liege_title = title:d_brzeskolitewskie }
			title:c_turov = { set_de_jure_liege_title = title:d_brzeskolitewskie }
			title:d_brzeskolitewskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_brzeskolitewskie_sclavinia
				value = yes
			}
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_brzeskolitewskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_novogrudok
				completely_controls = title:c_volkovysk
				completely_controls = title:c_kletsk
				completely_controls = title:c_slutsk
				NOT = { has_global_variable = divide_voivodeships_decision_nowogrodzkie_sclavinia }
			}
			title:c_novogrudok = { set_de_jure_liege_title = title:d_nowogrodzkie }
			title:c_volkovysk = { set_de_jure_liege_title = title:d_nowogrodzkie }
			title:c_kletsk = { set_de_jure_liege_title = title:d_nowogrodzkie }
			title:c_slutsk = { set_de_jure_liege_title = title:d_nowogrodzkie }
			title:d_nowogrodzkie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_nowogrodzkie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_nowogrodzkie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_minsk
				completely_controls = title:c_babruysk
				completely_controls = title:c_korosten
				NOT = { has_global_variable = divide_voivodeships_decision_minskie_sclavinia }
			}
			title:c_minsk = { set_de_jure_liege_title = title:d_minskie }
			title:c_babruysk = { set_de_jure_liege_title = title:d_minskie }
			title:c_korosten = { set_de_jure_liege_title = title:d_minskie }
			title:d_minskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_minskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_minskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_smolensk
				completely_controls = title:c_roslavl
				completely_controls = title:c_starodub
				completely_controls = title:c_mozhaysk
				completely_controls = title:c_toropets
				NOT = { has_global_variable = divide_voivodeships_decision_smolenskie_sclavinia }
			}
			title:c_smolensk = { set_de_jure_liege_title = title:d_smolenskie }
			title:c_roslavl = { set_de_jure_liege_title = title:d_smolenskie }
			title:c_starodub = { set_de_jure_liege_title = title:d_smolenskie }
			title:c_mozhaysk = { set_de_jure_liege_title = title:d_smolenskie }
			title:c_toropets = { set_de_jure_liege_title = title:d_smolenskie }
			title:d_smolenskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_smolenskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_smolenskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_karachev
				completely_controls = title:c_kozelsk
				NOT = { has_global_variable = divide_voivodeships_decision_orlowskie_sclavinia }
			}
			title:c_karachev = { set_de_jure_liege_title = title:d_orlowskie }
			title:c_kozelsk = { set_de_jure_liege_title = title:d_orlowskie }
			title:d_orlowskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_orlowskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_orlowskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_vitebsk
				completely_controls = title:c_orsha
				completely_controls = title:c_gnezdovo
				NOT = { has_global_variable = divide_voivodeships_decision_witebskie_sclavinia }
			}
			title:c_vitebsk = { set_de_jure_liege_title = title:d_witebskie }
			title:c_orsha = { set_de_jure_liege_title = title:d_witebskie }
			title:c_gnezdovo = { set_de_jure_liege_title = title:d_witebskie }
			title:d_witebskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_witebskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_witebskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_polotsk
				completely_controls = title:c_lukoml
				completely_controls = title:c_sebezh
				NOT = { has_global_variable = divide_voivodeships_decision_polockie_sclavinia }
			}
			title:c_polotsk = { set_de_jure_liege_title = title:d_polockie }
			title:c_lukoml = { set_de_jure_liege_title = title:d_polockie }
			title:c_sebezh = { set_de_jure_liege_title = title:d_polockie }
			title:d_polockie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_polockie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_polockie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_trakai
				completely_controls = title:c_siauliai
				completely_controls = title:c_raseiniai
				completely_controls = title:c_yatvyagi
				NOT = { has_global_variable = divide_voivodeships_decision_trockie_sclavinia }
			}
			title:c_trakai = { set_de_jure_liege_title = title:d_trockie }
			title:c_siauliai = { set_de_jure_liege_title = title:d_trockie }
			title:c_raseiniai = { set_de_jure_liege_title = title:d_trockie }
			title:c_yatvyagi = { set_de_jure_liege_title = title:d_trockie }
			title:d_trockie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_trockie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_trockie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_kernave
				completely_controls = title:c_braslau
				completely_controls = title:c_grodno
				NOT = { has_global_variable = divide_voivodeships_decision_wilenskie_sclavinia }
			}
			title:c_kernave = { set_de_jure_liege_title = title:d_wilenskie }
			title:c_braslau = { set_de_jure_liege_title = title:d_wilenskie }
			title:c_grodno = { set_de_jure_liege_title = title:d_wilenskie }
			title:d_wilenskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_wilenskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_wilenskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_palanga
				completely_controls = title:c_memel
				completely_controls = title:c_scalovia
				completely_controls = title:c_konigsberg
				NOT = { has_global_variable = divide_voivodeships_decision_zmudzkie_sclavinia }
			}
			title:c_palanga = { set_de_jure_liege_title = title:d_zmudzkie }
			title:c_memel = { set_de_jure_liege_title = title:d_zmudzkie }
			title:c_scalovia = { set_de_jure_liege_title = title:d_zmudzkie }
			title:c_konigsberg = { set_de_jure_liege_title = title:d_zmudzkie }
			title:d_zmudzkie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_zmudzkie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_zmudzkie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				has_global_variable = divide_voivodeships_decision_brzeskolitewskie_sclavinia
				has_global_variable = divide_voivodeships_decision_nowogrodzkie_sclavinia
				has_global_variable = divide_voivodeships_decision_minskie_sclavinia
				has_global_variable = divide_voivodeships_decision_smolenskie_sclavinia
				has_global_variable = divide_voivodeships_decision_orlowskie_sclavinia
				has_global_variable = divide_voivodeships_decision_witebskie_sclavinia
				has_global_variable = divide_voivodeships_decision_polockie_sclavinia
				has_global_variable = divide_voivodeships_decision_trockie_sclavinia
				has_global_variable = divide_voivodeships_decision_wilenskie_sclavinia
				has_global_variable = divide_voivodeships_decision_zmudzkie_sclavinia
			}
			#destroy_title = title:d_halych
			set_global_variable = {
				name = divide_voivodeships_litewska_decision_sclavinia
				value = yes
			}
		}
		hidden_effect = {  
			if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_nowa_sol_sclavinia }
					has_global_variable = divide_voivodeships_decision_orlowskie_sclavinia
					has_global_variable = divide_voivodeships_decision_kurskie_sclavinia
				}
				title:d_novosil = { set_de_jure_liege_title = title:k_opolye }
				set_global_variable = {
					name = divide_voivodeships_nowa_sol_sclavinia
					value = yes
				}
			}
		}
		if = {
			limit = { 
				has_global_variable = divide_voivodeships_wielkopolska_decision_sclavinia
				has_global_variable = divide_voivodeships_malopolska_decision_sclavinia
				has_global_variable = divide_voivodeships_litewska_decision_sclavinia
				has_global_variable = divide_voivodeships_inflancka_decision_sclavinia
			}
			trigger_event = sclavinia.0005
		}
	}
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
divide_voivodeships_inflancka_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp2_decision_struggle_opening.dds"
	}
	decision_group_type = sclavinia_group
	ai_check_interval = 1

	is_shown = {
		has_culture = culture:polish
		has_title = title:k_poland
		has_global_variable = divide_voivodeships_decision_sclavinia
		NOT = { has_global_variable = divide_voivodeships_inflancka_decision_sclavinia }
		has_global_variable = empire_unlock_sclavinia
	}

	is_valid = {
		OR = {
			trigger_if = { 
				limit = { game_start_date < 1000.1.1 }
				completely_controls_region = polska_early_sclavinia
				
			}
			trigger_if = { 
				limit = { game_start_date > 1000.1.1 }
				completely_controls_region = polska_sclavinia
				
			}
			completely_controls_region = prowincja_inflancka_sclavinia
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_kurlandzkie_sclavinia }
				}
				AND = {
					completely_controls_region = d_kurlandzkie
					completely_controls = title:c_zemigalians
					completely_controls = title:c_vanemane
					completely_controls = title:c_grobin
					completely_controls = title:c_selpils
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_wendenskie_sclavinia }
				}
				AND = {
					completely_controls_region = d_wendenskie
					completely_controls = title:c_talava
					completely_controls = title:c_kokenois
					completely_controls = title:c_jersika
					completely_controls = title:c_aluksne
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_parnawskie_sclavinia }
				}
				AND = { 
					completely_controls_region = d_parnawskie
					completely_controls = title:c_livs
					completely_controls = title:c_vidzeme
					gold >= 100
				}
			}
			trigger_if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_decision_dorpackie_sclavinia }
				}
				AND = {
					completely_controls_region = d_dorpackie
					completely_controls = title:c_dorpat
					gold >= 100
				}
			}
		}
	}
	effect = {
		custom_tooltip = divide_voivodeships_again_decision_tooltip
		if = {
			limit = { 
				completely_controls = title:c_zemigalians
				completely_controls = title:c_vanemane
				completely_controls = title:c_grobin
				completely_controls = title:c_selpils
				NOT = { has_global_variable = divide_voivodeships_decision_kurlandzkie_sclavinia }
			}
			title:c_zemigalians = { set_de_jure_liege_title = title:d_kurlandzkie }
			title:c_vanemane = { set_de_jure_liege_title = title:d_kurlandzkie }
			title:c_grobin = { set_de_jure_liege_title = title:d_kurlandzkie }
			title:c_selpils = { set_de_jure_liege_title = title:d_kurlandzkie }
			title:d_kurlandzkie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_kurlandzkie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_kurlandzkie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_talava
				completely_controls = title:c_kokenois
				completely_controls = title:c_jersika
				completely_controls = title:c_aluksne
				NOT = { has_global_variable = divide_voivodeships_decision_wendenskie_sclavinia }
			}
			title:c_talava = { set_de_jure_liege_title = title:d_wendenskie }
			title:c_kokenois = { set_de_jure_liege_title = title:d_wendenskie }
			title:c_jersika = { set_de_jure_liege_title = title:d_wendenskie }
			title:c_aluksne = { set_de_jure_liege_title = title:d_wendenskie }
			title:d_wendenskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_wendenskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_wendenskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_livs
				completely_controls = title:c_vidzeme
				NOT = { has_global_variable = divide_voivodeships_decision_parnawskie_sclavinia }
			}
			title:c_livs = { set_de_jure_liege_title = title:d_parnawskie }
			title:c_vidzeme = { set_de_jure_liege_title = title:d_parnawskie }
			title:d_parnawskie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_parnawskie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_parnawskie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = { 
				completely_controls = title:c_dorpat
				NOT = { has_global_variable = divide_voivodeships_decision_dorpackie_sclavinia }
			}
			title:c_dorpat = { set_de_jure_liege_title = title:d_dorpackie }
			title:d_dorpackie = { set_de_jure_liege_title = title:k_poland }
			set_global_variable = {
				name = divide_voivodeships_decision_dorpackie_sclavinia
				value = yes
			}
			
			create_title_and_vassal_change = {
				type = created
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:d_dorpackie = {
				change_title_holder = {
					holder = ROOT
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
			remove_short_term_gold = 100
			add_prestige = 100
			add_legitimacy = 10
		}
		if = {
			limit = {
				has_global_variable = divide_voivodeships_decision_kurlandzkie_sclavinia
				has_global_variable = divide_voivodeships_decision_wendenskie_sclavinia
				has_global_variable = divide_voivodeships_decision_parnawskie_sclavinia
				has_global_variable = divide_voivodeships_decision_dorpackie_sclavinia
			}
			#destroy_title = title:d_halych
			set_global_variable = {
				name = divide_voivodeships_inflancka_decision_sclavinia
				value = yes
			}
		}
		hidden_effect = {  
			if = {
				limit = { 
					NOT = { has_global_variable = divide_voivodeships_again_decision_estonia_sclavinia }
					has_global_variable = divide_voivodeships_decision_dorpackie_sclavinia
					has_global_variable = divide_voivodeships_decision_parnawskie_sclavinia
				}
				title:k_esthonia = { set_de_jure_liege_title = title:e_scandinavia }
				set_global_variable = {
					name = divide_voivodeships_again_decision_estonia_sclavinia
					value = yes
				}
			}
		}
		if = {
			limit = { 
				has_global_variable = divide_voivodeships_wielkopolska_decision_sclavinia
				has_global_variable = divide_voivodeships_malopolska_decision_sclavinia
				has_global_variable = divide_voivodeships_litewska_decision_sclavinia
				has_global_variable = divide_voivodeships_inflancka_decision_sclavinia
			}
			trigger_event = sclavinia.0005
		}
	}
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
orthodox_poland_rerechristianisation_ending = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_culture.dds"
	}
	decision_group_type = sclavinia_group
	 
	ai_check_interval = 1

	is_shown = {
		has_title = title:k_poland
		has_faith = faith:orthodox
		has_global_variable = orthodox_poland_sclavinia
		NOT = { has_global_variable = orthodox_poland_rerechristianisation_sclavinia }
	}

	is_valid = {
		custom_tooltip = { 
			text = orthodox_poland_rerechristianisation_ending_requirement_tooltip
			any_ruler = {
				filter = { 
					OR = { 
						culture = { has_cultural_pillar = heritage_west_slavic }
						culture = { has_cultural_pillar = heritage_south_slavic }
					}
					OR = { 
						has_faith = faith:catholic
						has_faith = faith:bosnian_church
						has_faith = faith:orthodox
					}
					is_independent_ruler = yes
					is_landed = yes
					NOT = { has_culture = culture:polish } 
					NOT = { has_culture = culture:bulgarian } 
				}
				count = all
				has_faith = faith:orthodox
			}
		}
		any_ruler = {
			filter = {
				OR = { 
					culture = { has_cultural_pillar = heritage_west_slavic }
					culture = { has_cultural_pillar = heritage_south_slavic }
				}
				OR = { 
					has_faith = faith:catholic
					has_faith = faith:bosnian_church
					has_faith = faith:orthodox
				}
				is_independent_ruler = yes
				is_landed = yes
				NOT = { has_culture = culture:polish } 
				NOT = { has_culture = culture:bulgarian } 
			}
			count = all
			has_faith = faith:orthodox
		}
	}
	effect = {
		trigger_event = sclavinia.0008
		if = {
			limit = { 
				any_ruler = {
					count > 0
					filter = { 
						OR = { 
							culture = { has_cultural_pillar = heritage_west_slavic }
							culture = { has_cultural_pillar = heritage_south_slavic }
						}
						OR = { 
							has_faith = faith:catholic
							has_faith = faith:bosnian_church
						}
						is_independent_ruler = yes
						is_landed = yes
						NOT = { has_culture = culture:polish } 
						NOT = { has_culture = culture:bulgarian } 
					}
				}
			}
			custom_tooltip = orthodox_poland_rerechristianisation_ending_tooltip_list
		}
		else = { 
			add_legitimacy = 100     
			faith:catholic = {
				change_fervor = {
					value = -10
					desc = fervor_sclavinia_orthodox_mend_slavonic
				}
			}
			faith:orthodox = {
				change_fervor = {
					value = 15
					desc = fervor_sclavinia_orthodox_mend_slavonic
				}
			}
			custom_tooltip = orthodox_poland_legacy_sclavinia
		}
		every_ruler = {
			limit = { 
				OR = { 
					culture = { has_cultural_pillar = heritage_west_slavic }
					culture = { has_cultural_pillar = heritage_south_slavic }
				}
				OR = { 
					has_faith = faith:catholic
					has_faith = faith:bosnian_church
				}
				is_independent_ruler = yes
				is_landed = yes
				NOT = { has_culture = culture:polish } 
				NOT = { has_culture = culture:bulgarian } 
			}
			set_character_faith = faith:orthodox
		}
		set_global_variable = {
			name = orthodox_poland_rerechristianisation_sclavinia
			value = yes
		}
	}
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
roman_catholic_poland_asking_pope_for_archdiocese = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_cerimonial_decision.dds"
	}
	decision_group_type = sclavinia_group
	 
	ai_check_interval = 1

	is_shown = {
		has_title = title:k_poland
		has_faith = faith:catholic
		has_global_variable = roman_catholic_poland_sclavinia
		NOT = { has_global_variable = roman_catholic_poland_asking_pope_for_archdiocese_sclavinia }
	}

	is_valid = {
		prestige >= 500 
		gold >= 400 
		legitimacy_level >= 4
		OR = { 
			title:k_papal_state.holder = { 
				opinion = {
					target = root
					value >= 75
				}
			}
			AND = { 
				piety_level >= 3	 
				title:k_papal_state.holder = { 
					opinion = {
						target = root
						value >= 50
					}
				}
			}
		}
		OR = {
			prestige_level >= 3
			AND = { 
				prestige_level >= 2 
				num_virtuous_traits >= 1
			}
		}
	}
	effect = {
		trigger_event = sclavinia.0015
		custom_tooltip = roman_catholic_poland_asking_pope_for_archdiocese_sclavinia 
		show_as_tooltip = {
			add_legitimacy = 50
		}
		set_global_variable = {
			name = roman_catholic_poland_asking_pope_for_archdiocese_sclavinia
			value = yes
		}
	}
	ai_potential = {
		always = yes
	}	
	cost = {
		gold = 400
		prestige = 500
	}
	ai_will_do = {
		base = 100
	}
}
roman_catholic_poland_prussia = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp2_decision_struggle_opening.dds"
	}
	decision_group_type = sclavinia_group
	 
	ai_check_interval = 1

	is_shown = {
		has_title = title:k_poland
		has_faith = faith:catholic
		has_global_variable = roman_catholic_poland_sclavinia
		NOT = { has_global_variable = roman_catholic_poland_prussia_sclavinia }
	}

	
	is_valid = { 
		piety >= 250
		gold >= 75
		legitimacy_level >= 3
		OR = {
			piety_level >= 3
			AND = { 
				piety_level >= 2 
				num_virtuous_traits >= 1
			}
		}
		custom_tooltip = { 
			text = roman_catholic_poland_prussia_trigger_tooltip
			OR = {
				any_character_to_title_neighboring_kingdom = {
					this = title:k_prussia 
				}
				completely_controls = title:k_prussia
			}
		}
	}
	
	effect = {
		trigger_event = sclavinia.0014        
		custom_tooltip = roman_catholic_poland_prussia_sclavinia  
		show_as_tooltip = {
			add_legitimacy = 50
		}
		set_global_variable = {
			name = roman_catholic_poland_prussia_sclavinia
			value = yes
		}
	}
	ai_potential = {
		always = yes
	}
	cost = {
		gold = 75
		piety = 250
	}
	ai_will_do = {
		base = 100
	}
}
roman_catholic_poland_swear_felty_to_hre = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds"
	}
	decision_group_type = sclavinia_group
	 
	ai_check_interval = 1	

	is_shown = {
		has_culture = culture:polish
		has_title = title:k_poland
		NOT = { has_title = title:e_hre }
		has_global_variable = roman_catholic_unlock_sclavinia
		title:e_hre = { holder = { exists = yes } }
		is_independent_ruler = yes		
	}
	
	is_valid = { 
		title:e_hre.holder = { is_at_war = no }
		is_at_war = no
		trigger_if = { 
			limit = { has_global_variable = roman_catholic_unlock_sclavinia }
			custom_tooltip = { 
				text = roman_catholic_unlock_sclavinia_trigger_tooltip
				any_neighboring_and_across_water_top_liege_realm_owner = {
					has_title = title:e_hre
				}
			}
		}
	}
	
	effect = {
		if = {
			limit = { has_title = title:e_sclavinia }
			save_scope_as = western_slav_uniter     
			set_global_variable = {
				name = have_diadem_already_sclavinia
				value = yes
			}
			roman_catholic_unite_the_western_slavs_decision_effects = yes
		}
		else = { 
			every_vassal = { 
				every_held_title = { 
					limit = { tier = tier_kingdom }
					ROOT = { destroy_title = prev }
				}
			}
			every_held_title = { 
				limit = { tier = tier_empire }
				ROOT = { destroy_title = prev }
			}
			create_title_and_vassal_change = {
				type = swear_fealty
				save_scope_as = change
			}
			change_liege = { 
				liege = title:e_hre.holder
				change = scope:change
			}
			ROOT = { 
				add_opinion = {
					modifier = became_vassal
					target = title:e_hre.holder
					opinion = 10
				}
			} 
			resolve_title_and_vassal_change = scope:change
		}
	}
	ai_potential = {
		always = yes
	}
	cost = {
	
	}
	ai_will_do = {
		base = 100
	}
}
roman_catholic_poland_1066 = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group
	 
	ai_check_interval = 1

	is_shown = {
		game_start_date > 1000.1.1 	
		NOT = { has_global_variable = roman_catholic_poland_1066_flag }					 
		has_culture = culture:polish
		has_title = title:k_poland
	}
	
	is_valid = { 
	}
	
	effect = {
		custom_tooltip = roman_catholic_poland_1066_event_tooltip
		trigger_event = sclavinia.0016        
		set_global_variable = {
			name = roman_catholic_poland_1066_flag
			value = yes
		}
	}
	ai_potential = {
		always = yes
	}
	cost = {
	
	}
	ai_will_do = {
		base = 100
	}
}
restore_holy_roman_empire_sclavinia_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_legitimacy.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1

	is_shown = {
		has_global_variable = roman_catholic_unlock_sclavinia
		has_title = title:e_sclavinia
		
		is_landed_or_landless_administrative = yes
		exists = dynasty # Everyone should have a dynasty, but in case they don't...
		NOT = { has_global_variable = flag_restored_roman_empire } # Not if Rome already exists (prevent Rome from restoring HRE)
		NOR = {	#Title existence cnditions.
			exists = title:e_hre.holder	#Well, that'd be redundant.
			#highest_held_title_tier = tier_empire	#Existing emperors likewise should not be giving up their empire.
		}
		NOR = { #It doesn't make sense for these competing empires.
			has_title = title:e_byzantium
			has_title = title:h_roman_empire
			mpo_has_gok_mongol_empire_trigger = yes
		}
		AND = {	#Faith conditions.
			NOT = { this = faith.religious_head }	#Nice try, Mr. Pope.
			faith = {
				religion_tag = christianity_religion
				has_doctrine_parameter = spiritual_head_of_faith	#Gotta be invested with the authority by someone other than yourself.
			}
			NAND = {	#No need for a competing empire if your faith controls the ERE.
				exists = title:e_byzantium.holder
				faith = title:e_byzantium.holder.faith
			}
		}
		exists = faith.religious_head
	}

	is_valid = {
		has_government = feudal_government
		#Standard requirements.
		is_independent_ruler = yes
		trigger_if = {
			limit = {
				is_ai = no
			}
			prestige_level >= high_prestige_level
		}
		#Title ownership conditions.
		OR = { 
			has_title = title:e_sclavinia
			has_title = title:k_poland
			any_vassal = { has_title = title:k_poland }
		}
		OR = { #Gotta be King of a core Carolingian Kingdom.
			has_title = title:k_east_francia
			has_title = title:k_bavaria
			has_title = title:k_france
			has_title = title:k_italy
			has_title = title:k_lotharingia
			any_vassal = {
				OR = {
					has_title = title:k_east_francia
					has_title = title:k_bavaria
					has_title = title:k_france
					has_title = title:k_italy
					has_title = title:k_lotharingia
				}
			}
		}
		trigger_if = {
			limit = {
				is_ai = no
			}
			custom_description = {	#And have some additional royal dignity for good measure.
				text = decision_refound_hre_own_three_kingdoms.tt
				any_held_title = {
					tier = tier_kingdom
					count >= 3
				}
			}
		}
		sub_realm_size >= 120	#Plus your various kingdoms should be ruling something.
		#HoF preference conditions.
		trigger_if = {
			limit = {
				is_ai = no
			}
			OR = {
				faith.religious_head = {	#And they have to actually like you enough to want to invest you.
					opinion = {
						target = root
						value >= high_positive_opinion
					}
				}
				root = { has_strong_usable_hook = faith.religious_head }	#Or you have a strong hook on them that you can actually use.
				root = { has_weak_hook = faith.religious_head }	#Or a regular hook, to be fair, provided you meet the other criteria.
			}
		}
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
		faith.religious_head = { is_available_adult = yes }
		NOR = {
			has_trait = excommunicated
			is_at_war_with = faith.religious_head
		}
	}

	effect = {
		show_as_tooltip = {
			restore_holy_roman_empire_decision_sclavinia_scripted_effect = yes
		}
		gain_heroic_legend_seed_tooltip_effect = yes
		save_scope_as = founder
		faith.religious_head = { save_scope_as = founder_hof }
		if = {
			limit = {
				faith.religious_head = { is_playable_character = yes }
			}
			faith.religious_head.capital_province = { save_scope_as = ceremony_locale }
		}
		else = {
			capital_province = { save_scope_as = ceremony_locale }
		}
		trigger_event = sclavinia.0017
		#Notify other players.
		every_player = {
			limit = {
				NOT = { this = root }
				is_within_diplo_range = { CHARACTER = root }
			}
			trigger_event = middle_europe_decisions.0016
		}
		if = {
			limit = {
				is_ai = no
				NOT = { exists = global_var:restore_holy_roman_empire_decision  }
			}
			set_global_variable = {
				name = restore_holy_roman_empire_decision
				value = root
			}
		}
	}

	cost = {
		gold = {
			if = {
				limit = {
					is_ai = no
				}
				add = 500
			}
		}
		piety = 200
	}

	ai_potential = {
		is_independent_ruler = yes
		highest_held_title_tier >= tier_kingdom
	}

	ai_will_do = {
		base = 100

		modifier = { # We don't want a solo-France to form the HRE
			factor = 0
			NOR = {
				has_title = title:k_east_francia
				has_title = title:k_bavaria
				has_title = title:k_italy
				has_title = title:k_lotharingia
				any_vassal = {
					OR = {
						has_title = title:k_east_francia
						has_title = title:k_bavaria
						has_title = title:k_italy
						has_title = title:k_lotharingia
					}
				}
			}
		}
	}
}
reform_holy_roman_empire_sclavinia_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_golden_age.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		has_global_variable = sclavinia_poland_vassalized_hre
		NOT = { has_global_variable = hre_reformed_election_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			is_vassal_of = title:e_hre.holder
		}
	}
	is_valid = {
		prestige_level >= 3
		OR = {	#And they have to actually like you enough to want to invest you.
			title:e_hre.holder = { 
				opinion = {
					target = root
					value >= 60
				}
			}
			has_title = title:e_hre
		}
		trigger_if = {
			limit = { NOT = { has_title = title:e_hre } }
			custom_tooltip = { 
				text = reform_holy_roman_empire_sclavinia_decision_requirement_tooltip
				title:e_hre = { 
					any_elector = {
						count = all
						filter = { 
							NOT = { this = ROOT }
						}
						OR = {
							opinion = { target = ROOT value >= 90 }  
							opinion = { target = title:e_hre.holder value >= 90 }
							is_allied_to = root 
							is_allied_to = title:e_hre.holder
						}
					}
				}	
			}
			title:e_hre = { 
				any_elector = {  
					count = all
					filter = { 
						NOT = { this = ROOT }
					}
					OR = {
						opinion = { target = ROOT value >= 90 }  
						opinion = { target = title:e_hre.holder value >= 90 }
						is_allied_to = root 
						is_allied_to = title:e_hre.holder
					}
				}
			}
			faith.religious_head = {	#And they have to actually like you enough to want to invest you.
				OR = {
					opinion = {
						target = root
						value >= 100
					}
					opinion = {
						target = title:e_hre.holder
						value >= 100
					}
					is_close_or_extended_family_of = title:e_hre.holder
				}
			} 
		}
		trigger_else = { 
			custom_tooltip = { 
				text = reform_holy_roman_empire_sclavinia_decision_requirement_tooltip
				title:e_hre = { 
					any_elector = {
						count = all
						filter = { 
							NOT = { this = ROOT }
						}
						OR = {
							opinion = { target = ROOT value >= 90 }  
							is_allied_to = root 
						}
					}
				}	
			}
			title:e_hre = { 
				any_elector = {  
					count = all
					filter = { 
						NOT = { this = ROOT }
					}
					OR = {
						opinion = { target = ROOT value >= 90 }  
						is_allied_to = root 
					}
				}
			}  
			faith.religious_head = {	#And they have to actually like you enough to want to invest you.
				OR = {
					opinion = {
						target = root
						value >= 100
					}
					is_close_or_extended_family_of = root
				}
			}
		}
		custom_tooltip = { 
			text = no_heresies_sclavinia_tooltip 
			title:e_hre.holder = { 
				any_sub_realm_county = {
					percent >= 0.98
					faith = faith:catholic
				}     
			}
		}
		title:e_hre.holder = { 
			any_sub_realm_county = {
				percent >= 0.98
				faith = faith:catholic
			}     
		}
		custom_tooltip = { 
			text = no_heresies2_sclavinia_tooltip 
			title:e_hre.holder = { 
				any_sub_realm_county = {
					count = all
					NOT = { 
						faith = faith:cathar
						faith = faith:waldensian
						faith = faith:lollard
					}
				}     
			}
		}
		title:e_hre.holder = { 
			any_sub_realm_county = {
				count = all
				NOT = { 
					faith = faith:cathar
					faith = faith:waldensian
					faith = faith:lollard
				}
			}     
		}
		custom_tooltip = { 
			text = no_heresies_rulers_sclavinia_tooltip 
			title:e_hre.holder = { 
				any_vassal_or_below = {
					percent >= 0.98
					has_faith = faith:catholic
				}     
			}
		}
		title:e_hre.holder = { 
			any_vassal_or_below = {
				percent >= 0.98
				has_faith = faith:catholic
			}     
		}
		custom_tooltip = { 
			text = no_heresies2_rulers_sclavinia_tooltip 
			title:e_hre.holder = { 
				any_vassal_or_below = {
					count = all
					NOT = { 
						faith = faith:cathar
						faith = faith:waldensian
						faith = faith:lollard
					}
				}     
			}
		}
		title:e_hre.holder = { 
			any_vassal_or_below = {
				count = all
				NOT = { 
					has_faith = faith:cathar
					has_faith = faith:waldensian
					has_faith = faith:lollard
				}
			}     
		}
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
		faith.religious_head = { is_available_adult = yes }
		NOR = {
			has_trait = excommunicated
			is_at_war_with = faith.religious_head
		}
	}

	effect = {
		trigger_event = sclavinia.0018
		if = {
			limit = { 
				title:e_hre = { 
					any_elector = {  
						count > 0
						filter = { 
							NOT = { this = ROOT }
							NOR = {
								opinion = { target = ROOT value >= 90 }  
								opinion = { target = title:e_hre.holder value >= 90 }
								is_allied_to = root 
								is_allied_to = title:e_hre.holder
							}
						}
					}
				}
			}
			custom_tooltip = reform_holy_roman_empire_sclavinia_decision_tooltip_list
		}
		else = { 
			add_legitimacy = 100
			show_as_tooltip = {
				reform_holy_roman_empire_sclavinia_decision_scripted_effect = yes
			}
		}
		title:e_hre = {
			every_elector = {
				limit = { 
					NOT = { this = ROOT } 
					NOR = {
						opinion = { target = ROOT value >= 90 }  
						opinion = { target = title:e_hre.holder value >= 90 }
						is_allied_to = root 
						is_allied_to = title:e_hre.holder
					}
				}
				force_vote_as = { target = root }
			}
		}
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_gallia_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp2_decision_struggle_hostility.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		has_global_variable = hre_reformed_election_sclavinia
		NOT = { has_global_variable = kingdom_of_gallia_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			is_vassal_of = title:e_hre.holder
		}
	}
	is_valid = {
		trigger_if = { 
			limit = { has_title = title:e_hre }
			prestige_level >= 3
		}
		trigger_else = { 
			OR = { 
				prestige_level >= 3
				title:e_hre.holder = { prestige_level >= 3 }
			}
		}
		title:e_hre.holder = {
			OR = {
				completely_controls_region = k_gallia_hre1066
				has_title = title:k_france
				any_vassal = { has_title = title:k_france }	
			}
		}		
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_gallia_established_sclavinia
		title:e_hre.holder = { 
			hidden_effect = {
				title:k_france = { set_de_jure_liege_title = title:e_hre }
				if = {
					limit = {
						title:k_france = { # If core West Francia is part of the HRE
							target_is_de_jure_liege_or_above = title:e_hre
						}
					}
					title:k_burgundy = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_france
						}
						set_de_jure_liege_title = title:e_france
					}
					title:k_aquitaine = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_france
						} 
						set_de_jure_liege_title = title:e_france
					}
					title:k_brittany = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_france
						}
						set_de_jure_liege_title = title:e_france
					} 
					title:d_brabant = { set_de_jure_liege_title = title:k_france }
					title:d_luxembourg = { set_de_jure_liege_title = title:k_france }
					title:d_bar = { set_de_jure_liege_title = title:k_france } 
					title:k_france = { 
						set_coa = e_france
						set_color_from_title = title:e_france
						set_title_name = gallia_sclavinia
						set_de_jure_liege_title = title:e_hre
					}   
					if = { 
						limit = { title:k_burgundy = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_burgundy
					}
					if = { 
						limit = { title:k_aquitaine = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_aquitaine
					}
					if = { 
						limit = { title:k_brittany = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_brittany
					}
					set_global_variable = {
						name = kingdom_of_gallia_established_sclavinia
						value = yes
					} 
					set_global_variable = {
						name = west_francia_renamed
						value = yes
					} 
				}      
				if = {	#Merge Francia into the HRE under certain conditions
					limit = {
						has_title = title:k_france
					}
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_frankish } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change_title
							add_claim_on_loss = no
						}
						title:k_france = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:change_title
							}
						}
						resolve_title_and_vassal_change = scope:change_title
					}
					else = { 
						ordered_vassal_or_below = { 
							limit = { 		 
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_france }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_frankish } 
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							title:k_france = {
								change_title_holder = {
									holder = prev
									change = scope:change_title
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}
					}
				}     
				if = {	#Merge Francia into the HRE under certain conditions
					limit = {
						any_vassal = { has_title = title:k_france 
						NOT = { culture = { has_cultural_pillar = heritage_frankish } } }
					}
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_frankish } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change_title
							add_claim_on_loss = no
						}
						title:k_france = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:change_title
							}
						}
						resolve_title_and_vassal_change = scope:change_title
					}
					else = { 
						ordered_vassal_or_below = { 
							limit = { 		 
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_france }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_frankish } 
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							title:k_france = {
								change_title_holder = {
									holder = prev
									change = scope:change_title
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}
					}
				}    
				if = {	#Merge Francia into the HRE under certain conditions
					limit = {
						NOT = { exists = title:k_france.holder }
						title:k_france = { target_is_de_jure_liege_or_above = title:e_hre }
					}  
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_frankish } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = title_change
							add_claim_on_loss = no
						}
						title:k_france = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:title_change
							}
						}
						resolve_title_and_vassal_change = scope:title_change
					}
					else = {
						ordered_vassal_or_below = { 
							limit = { 		 
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_france }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_frankish }     
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = created
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							title:k_france = {
								change_title_holder = {
									holder = prev
									change = scope:title_change
								}
							}
							resolve_title_and_vassal_change = scope:title_change
						}
					}
				}
				if = { 
					limit = { has_global_variable = kingdom_of_gallia_established_sclavinia }
					every_vassal_or_below = {
						limit = { NOT = { culture = { has_cultural_pillar = heritage_frankish } } } 
						every_held_title = { 
							limit = { 
								target_is_de_jure_liege_or_above = title:k_france
								OR = { 
									tier = tier_duchy
									tier = tier_county
								}
							}	
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							change_title_holder = {
								holder = title:k_france.holder
								change = scope:title_change
							}  
							resolve_title_and_vassal_change = scope:title_change
						}
					}
					every_held_title = { 
						limit = { 
							target_is_de_jure_liege_or_above = title:k_france
							OR = { 
								tier = tier_duchy
								tier = tier_county
							}
						}	
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = title_change
							add_claim_on_loss = no
						}
						change_title_holder = {
							holder = title:k_france.holder
							change = scope:title_change
						}  
						resolve_title_and_vassal_change = scope:title_change
					}
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_frankish }
							NOT = { liege = { culture = { has_cultural_pillar = heritage_frankish } } }	
							any_held_title = { target_is_de_jure_liege_or_above = title:k_france } 
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change
							add_claim_on_loss = no
						}
						change_liege = { 
							liege = title:k_france.holder
							change = scope:change
						}         
						resolve_title_and_vassal_change = scope:change
					} 
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_frankish }
							highest_held_title_tier < tier_kingdom
							liege = { highest_held_title_tier = tier_kingdom } 
							NOT = { primary_title = { target_is_de_facto_liege_or_above = title:k_france } }
							capital_province.county = { target_is_de_jure_liege_or_above = title:k_france }							
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change
							add_claim_on_loss = no
						}
						change_liege = { 
							liege = title:k_france.holder
							change = scope:change
						}         
						resolve_title_and_vassal_change = scope:change
					}  
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_frankish }
							highest_held_title_tier = tier_kingdom
							NOT = { has_title = title:k_france }
						}
						every_held_title = { 
							limit = { 
								target_is_de_jure_liege_or_above = title:k_france
								OR = { 
									tier = tier_duchy
									tier = tier_county
								}
							}	
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							change_title_holder = {
								holder = title:k_france.holder
								change = scope:title_change
							}  
							resolve_title_and_vassal_change = scope:title_change
						}
					} 
				}
			}
		}
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_germania_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp2_decision_struggle_opening.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		has_global_variable = hre_reformed_election_sclavinia
		NOT = { has_global_variable = kingdom_of_germania_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			is_vassal_of = title:e_hre.holder
		}
	}
	is_valid = {
		trigger_if = { 
			limit = { has_title = title:e_hre }
			prestige_level >= 3
		}
		trigger_if = { 
			limit = { NOT = { has_title = title:e_hre } }
			OR = { 
				prestige_level >= 3
				title:e_hre.holder = { prestige_level >= 3 }
			}
		}
		title:e_hre.holder = {
			OR = {
				completely_controls_region = k_germania_hre
				has_title = title:k_east_francia
				any_vassal = { has_title = title:k_east_francia }	
			}
		}		
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_germania_established_sclavinia
		title:e_hre.holder = { 
			hidden_effect = {
				title:k_east_francia = { set_de_jure_liege_title = title:e_hre }
				if = {
					limit = {
						title:k_east_francia = { target_is_de_jure_liege_or_above = title:e_hre }
					}
					title:k_bavaria = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_east_francia
						}
						set_de_jure_liege_title = title:e_germany
					}
					title:k_lotharingia = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_east_francia
						}
						set_de_jure_liege_title = title:e_germany
					}
					title:k_frisia = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_east_francia
						}  
						set_de_jure_liege_title = title:e_germany
					} 
					title:k_saxony = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_east_francia
						}  
						set_de_jure_liege_title = title:e_germany
					} 
					title:d_transjurania = { set_de_jure_liege_title = title:k_east_francia }
					title:k_east_francia = { 
						set_coa = e_germany
						set_color_from_title = title:e_germany
						set_title_name = e_germany
						set_de_jure_liege_title = title:e_hre
					}  
					if = { 
						limit = { title:k_bavaria = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_bavaria
					}
					if = { 
						limit = { title:k_lotharingia = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_lotharingia
					}
					if = { 
						limit = { title:k_frisia = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_frisia
					} 
					if = { 
						limit = { title:k_saxony = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_saxony
					} 
					set_global_variable = {
						name = kingdom_of_germania_established_sclavinia
						value = yes
					} 
					set_global_variable = {
						name = east_francia_renamed
						value = yes
					} 
				}  
				if = {	#If Germania is nae a thing, merge it into the HRE.
					limit = {
						has_title = title:k_east_francia
					}
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_central_germanic } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change_title
							add_claim_on_loss = no
						}
						title:k_east_francia = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:change_title
							}
						}
						resolve_title_and_vassal_change = scope:change_title
					}
					else = {
						ordered_vassal_or_below = { 
							limit = {
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_east_francia }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_central_germanic }
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							title:k_east_francia = {
								change_title_holder = {
									holder = prev
									change = scope:change_title
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}
					}
				} 
				if = {	#If Germania is nae a thing, merge it into the HRE.
					limit = {
						any_vassal = { has_title = title:k_east_francia 
						NOT = { culture = { has_cultural_pillar = heritage_central_germanic } } }
					}
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_central_germanic } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change_title
							add_claim_on_loss = no
						}
						title:k_east_francia = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:change_title
							}
						}
						resolve_title_and_vassal_change = scope:change_title
					}
					else = {
						ordered_vassal_or_below = { 
							limit = {
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_east_francia }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_central_germanic }      
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							title:k_east_francia = {
								change_title_holder = {
									holder = prev
									change = scope:change_title
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}
					}
				}    
				if = {	#If Germania is nae a thing, merge it into the HRE.
					limit = {
						NOT = { exists = title:k_east_francia.holder }
						title:k_east_francia = { target_is_de_jure_liege_or_above = title:e_hre }
					}
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_central_germanic } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = title_change
							add_claim_on_loss = no
						}
						title:k_east_francia = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:title_change
							}
						}
						resolve_title_and_vassal_change = scope:title_change
					}
					else = {
						ordered_vassal_or_below = { 
							limit = {
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_east_francia }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_central_germanic }        
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = created
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							title:k_east_francia = {
								change_title_holder = {
									holder = prev
									change = scope:title_change
								}
							}
							resolve_title_and_vassal_change = scope:title_change
						}
					}
				}    
				if = { 
					limit = { has_global_variable = kingdom_of_germania_established_sclavinia }
					every_vassal_or_below = {
						limit = { NOT = { culture = { has_cultural_pillar = heritage_central_germanic } } } 
						every_held_title = { 
							limit = { 
								target_is_de_jure_liege_or_above = title:k_east_francia
								OR = { 
									tier = tier_duchy
									tier = tier_county
								}
							}	
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							change_title_holder = {
								holder = title:k_east_francia.holder
								change = scope:title_change
							}  
							resolve_title_and_vassal_change = scope:title_change
						}
					}
					every_held_title = { 
						limit = { 
							target_is_de_jure_liege_or_above = title:k_east_francia
							OR = { 
								tier = tier_duchy
								tier = tier_county
							}
						}	
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = title_change
							add_claim_on_loss = no
						}
						change_title_holder = {
							holder = title:k_east_francia.holder
							change = scope:title_change
						}  
						resolve_title_and_vassal_change = scope:title_change
					}
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_central_germanic }
							NOT = { liege = { culture = { has_cultural_pillar = heritage_central_germanic } } }			
							any_held_title = { target_is_de_jure_liege_or_above = title:k_east_francia } 			
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change
							add_claim_on_loss = no
						}
						change_liege = { 
							liege = title:k_east_francia.holder
							change = scope:change
						}         
						resolve_title_and_vassal_change = scope:change
					}     
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_central_germanic }
							highest_held_title_tier < tier_kingdom
							liege = { highest_held_title_tier = tier_kingdom } 
							NOT = { primary_title = { target_is_de_facto_liege_or_above = title:k_east_francia } }
							capital_province.county = { target_is_de_jure_liege_or_above = title:k_east_francia }							
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change
							add_claim_on_loss = no
						}
						change_liege = { 
							liege = title:k_east_francia.holder
							change = scope:change
						}         
						resolve_title_and_vassal_change = scope:change
					}  
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_central_germanic }
							highest_held_title_tier = tier_kingdom
							NOT = { has_title = title:k_east_francia }
						}
						every_held_title = { 
							limit = { 
								target_is_de_jure_liege_or_above = title:k_east_francia
								OR = { 
									tier = tier_duchy
									tier = tier_county
								}
							}	
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							change_title_holder = {
								holder = title:k_east_francia.holder
								change = scope:title_change
							}  
							resolve_title_and_vassal_change = scope:title_change
						}
					}
				} 
				create_title_and_vassal_change = {
					type = granted
					save_scope_as = change
					add_claim_on_loss = no
				}
				every_vassal_or_below = { 
					limit = {
						culture = { has_cultural_pillar = heritage_west_slavic }
						NOT = { liege = { culture = { has_cultural_pillar = heritage_west_slavic } } }
					}
					change_liege = { 
						liege = ROOT
						change = scope:change
					}
				}   
				resolve_title_and_vassal_change = scope:change
				create_title_and_vassal_change = {
					type = granted
					save_scope_as = title_change
					add_claim_on_loss = no
				}
				every_vassal_or_below = {
					limit = { NOT = { culture = { has_cultural_pillar = heritage_west_slavic } } } 
					every_held_title = { 
						limit = { 
							target_is_de_jure_liege_or_above = title:k_poland
							OR = { 
								tier = tier_duchy
								tier = tier_county
							}
						}
						change_title_holder = {
							holder = ROOT
							change = scope:title_change
						}
					}
				}
				resolve_title_and_vassal_change = scope:title_change				
			}
		}
	}

	cost = {
	
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdoms_ending_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_cerimonial_decision.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		has_global_variable = kingdom_of_gallia_established_sclavinia 
		has_global_variable = kingdom_of_germania_established_sclavinia 
		NOT = { has_global_variable = war_with_pope_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			is_vassal_of = title:e_hre.holder
		}
	}
	is_valid = {
		custom_tooltip = { 
			text = k_gallia_hre1066_trigger_tooltip
			any_county_in_region = { 
				count > 88
				region = k_gallia_hre1066  # 111
				target_is_de_facto_liege_or_above = title:e_hre 
			}
		}
		any_county_in_region = { 
			count > 88
			region = k_gallia_hre1066  # 111
			target_is_de_facto_liege_or_above = title:e_hre 
		}        
		custom_tooltip = { 
			text = k_germania_hre_trigger_tooltip
			any_county_in_region = { 
				count > 96
				region = k_germania_hre  # 121
				target_is_de_facto_liege_or_above = title:e_hre 
			}
		}
		any_county_in_region = { 
			count > 96
			region = k_germania_hre  # 121
			target_is_de_facto_liege_or_above = title:e_hre 
		} 
		custom_tooltip = { 
			text = k_sclavinia_hre1066_trigger_tooltip
			any_county_in_region = { 
				count > 92
				region = k_sclavinia_hre1066  # 115
				target_is_de_facto_liege_or_above = title:e_hre 
			}
		}
		any_county_in_region = { 
			count > 92
			region = k_sclavinia_hre1066  # 115
			target_is_de_facto_liege_or_above = title:e_hre 
		} 
		custom_tooltip = { 
			text = no_heresies_sclavinia_tooltip 
			title:e_hre.holder = { 
				any_sub_realm_county = {
					percent >= 0.98
					faith = faith:catholic
				}     
			}
		}
		title:e_hre.holder = { 
			any_sub_realm_county = {
				percent >= 0.98
				faith = faith:catholic
			}     
		}
		custom_tooltip = { 
			text = no_heresies2_sclavinia_tooltip 
			title:e_hre.holder = { 
				any_sub_realm_county = {
					count = all
					NOT = { 
						faith = faith:cathar
						faith = faith:waldensian
						faith = faith:lollard
					}
				}     
			}
		}
		title:e_hre.holder = { 
			any_sub_realm_county = {
				count = all
				NOT = { 
					faith = faith:cathar
					faith = faith:waldensian
					faith = faith:lollard
				}
			}     
		}
		custom_tooltip = { 
			text = no_heresies_rulers_sclavinia_tooltip 
			title:e_hre.holder = { 
				any_vassal_or_below = {
					percent >= 0.98
					has_faith = faith:catholic
				}     
			}
		}
		title:e_hre.holder = { 
			any_vassal_or_below = {
				percent >= 0.98
				has_faith = faith:catholic
			}     
		}
		custom_tooltip = { 
			text = no_heresies2_rulers_sclavinia_tooltip 
			title:e_hre.holder = { 
				any_vassal_or_below = {
					count = all
					NOT = { 
						faith = faith:cathar
						faith = faith:waldensian
						faith = faith:lollard
					}
				}     
			}
		}
		title:e_hre.holder = { 
			any_vassal_or_below = {
				count = all
				NOT = { 
					has_faith = faith:cathar
					has_faith = faith:waldensian
					has_faith = faith:lollard
				}
			}     
		}
		trigger_if = { 
			limit = { has_title = title:e_hre }
			prestige_level >= 3
			OR = {
				piety_level >= 3
				AND = { 
					piety_level >= 2 
					num_virtuous_traits >= 1
				}
			}
		}
		trigger_if = { 
			limit = { NOT = { has_title = title:e_hre } }
			OR = { 
				AND = { 
					prestige_level >= 3
					OR = {
						piety_level >= 3
						AND = { 
							piety_level >= 2 
							num_virtuous_traits >= 1
						}
					}
				}
				title:e_hre.holder = { 
					AND = { 
						prestige_level >= 3 
						OR = {
							piety_level >= 3
							AND = { 
								piety_level >= 2 
								num_virtuous_traits >= 1
							}
						}
					}
				}
			}
		} 
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {    					
		set_global_variable = {
			name = war_with_pope_sclavinia
			value = yes
		}
		trigger_event = sclavinia.0019
		title:e_hre = { 
			custom_tooltip = { 
				text = set_title_name_e_hre_sclavinia
				set_title_name = e_hre
			} 
			custom_tooltip = { 
				text = set_coa_e_hre_sclavinia
				if = { 
					limit = { 
						NOT = { has_global_variable = sclavinia_poland_vassalized_hre }
					}
					set_coa = e_hre_sclavinia_holy
				}
				else = { 
					set_coa = e_hre
				}
			}
		}
		if = { 
			limit = { 
				NOT = { has_title = title:e_hre }
			}						
			set_global_variable = {
				name = destabilized_election_sclavinia
				value = yes
			}
			title:e_hre = { 
				add_title_law = destabilized_princely_elective_succession_law
			}
		} 
		custom_tooltip = establish_kingdom_of_italia_sclavinia_tooltip
	}

	cost = {
	
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_italia_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		has_global_variable = war_with_pope_sclavinia
		NOT = { has_global_variable = kingdom_of_italia_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			is_vassal_of = title:e_hre.holder
		}
	}
	is_valid = {
		trigger_if = { 
			limit = { has_title = title:e_hre }
			prestige_level >= 3
		}
		trigger_if = { 
			limit = { NOT = { has_title = title:e_hre } }
			OR = { 
				prestige_level >= 3
				title:e_hre.holder = { prestige_level >= 3 }
			}
		}
		title:e_hre.holder = { 
			completely_controls = title:c_roma
			OR = {
				has_title = title:k_italy
				any_vassal = { has_title = title:k_italy }	
			}
		}
		OR = {	  
			AND = { 
				custom_tooltip = { 
					text = k_italia_hre_trigger_tooltip
					any_county_in_region = { 
						count > 56
						region = k_italia_hre  # 70
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
				any_county_in_region = { 
					count > 56
					region = k_italia_hre  # 70
					target_is_de_facto_liege_or_above = title:e_hre 
				}
			}				
			AND = {
				custom_tooltip = { 
					text = k_italia_hre_trigger_tooltip_70
					any_county_in_region = { 
						count > 45
						region = k_italia_hre  # 70
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
				any_county_in_region = { 
					count > 45
					region = k_italia_hre  # 70
					target_is_de_facto_liege_or_above = title:e_hre 
				}  
				OR = {
					faith.religious_head = { is_close_or_extended_family_of = title:e_hre.holder }
					root = { has_strong_usable_hook = faith.religious_head }	#Or you have a strong hook on them that you can actually use.
					trigger_if = { 
						limit = { NOT = { has_title = title:e_hre }	}
						title:e_hre.holder = { has_strong_usable_hook = faith.religious_head }	#Or you have a strong hook on them that you can actually use.
					}
				}
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_italia_established_sclavinia    
		custom_tooltip = war_with_pope_sclavinia
		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = war_with_pope_sclavinia_success
					create_title_and_vassal_change = {
						type = swear_fealty
						save_scope_as = change
						add_claim_on_loss = no
					}
					title:k_papal_state.holder = {
						change_liege = {
							liege = title:e_hre.holder
							change = scope:change
						}
					}
					resolve_title_and_vassal_change = scope:change
					custom_tooltip = papacy_transfer_italia
				}
				100 = {
					show_chance = no
					desc = war_with_pope_sclavinia_fail1
					custom_tooltip = war_with_pope_sclavinia_fail2
				}
			}
		}
		title:e_hre.holder = { 
			hidden_effect = {
				title:k_italy = { set_de_jure_liege_title = title:e_hre } 
				if = {
					limit = {
						title:k_italy = { target_is_de_jure_liege_or_above = title:e_hre }
					}
					title:k_genoa = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_italy
						}
						set_de_jure_liege_title = title:e_italy
					}
					title:k_pisa = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_italy
						}
						set_de_jure_liege_title = title:e_italy
					}
					title:k_naples = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_italy
						}  
						set_de_jure_liege_title = title:e_italy
					}
					title:k_sardinia = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_italy
						}  
						set_de_jure_liege_title = title:e_italy
					}
					title:k_romagna = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_italy
						}  
						set_de_jure_liege_title = title:e_italy
					}
					title:k_sicily = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_italy
						}  
						set_de_jure_liege_title = title:e_italy
					}
					title:k_venice = {
						every_in_de_jure_hierarchy = {
							limit = { tier = tier_duchy }
							set_de_jure_liege_title = title:k_italy
						}  
						set_de_jure_liege_title = title:e_italy
					}
					title:k_italy = { 
						set_coa = e_italy
						set_color_from_title = title:e_italy
						set_title_name = e_italy
						set_de_jure_liege_title = title:e_hre
					}
					if = { 
						limit = { title:k_genoa = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_genoa
					}
					if = { 
						limit = { title:k_pisa = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_pisa
					}
					if = { 
						limit = { title:k_naples = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_naples
					}
					if = { 
						limit = { title:k_sardinia = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_sardinia
					}
					if = { 
						limit = { title:k_romagna = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_romagna
					}  
					if = { 
						limit = { title:k_sicily = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_sicily
					}  
					if = { 
						limit = { title:k_venice = { target_is_de_facto_liege_or_above = title:e_hre  } }
						destroy_title = title:k_venice
					}  
					set_global_variable = {
						name = kingdom_of_italia_established_sclavinia
						value = yes
					} 
				}  
				if = {	#If Germania is nae a thing, merge it into the HRE.
					limit = {
						has_title = title:k_italy
					}
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_latin } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change_title
							add_claim_on_loss = no
						}
						title:k_italy = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:change_title
							}
						}
						resolve_title_and_vassal_change = scope:change_title
					}
					else = {
						ordered_vassal_or_below = { 
							limit = {
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_italy }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_latin }                
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							title:k_italy = {
								change_title_holder = {
									holder = prev
									change = scope:change_title
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}
					}
				} 
				if = {	#If Germania is nae a thing, merge it into the HRE.
					limit = {
						any_vassal = { has_title = title:k_italy 
						NOT = { culture = { has_cultural_pillar = heritage_latin } } }
					}
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_latin } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change_title
							add_claim_on_loss = no
						}
						title:k_italy = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:change_title
							}
						}
						resolve_title_and_vassal_change = scope:change_title
					}
					else = {
						ordered_vassal_or_below = { 
							limit = {
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_italy }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_latin }      
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							title:k_italy = {
								change_title_holder = {
									holder = prev
									change = scope:change_title
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}
					}
				}    
				if = {	#If Germania is nae a thing, merge it into the HRE.
					limit = {
						NOT = { exists = title:k_italy.holder }
						title:k_italy = { target_is_de_jure_liege_or_above = title:e_hre }
					}
					if = { 
						limit = { 
							title:e_hre.holder = { culture = { has_cultural_pillar = heritage_latin } }
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = title_change
							add_claim_on_loss = no
						}
						title:k_italy = {
							change_title_holder = {
								holder = title:e_hre.holder
								change = scope:title_change
							}
						}
						resolve_title_and_vassal_change = scope:title_change
					}
					else = {
						ordered_vassal_or_below = { 
							limit = {
								capital_province.county = { target_is_de_jure_liege_or_above = title:k_italy }
								has_government = feudal_government
								culture = { has_cultural_pillar = heritage_latin }      
								has_faith = faith:catholic
							}
							order_by = sub_realm_size
							create_title_and_vassal_change = {
								type = created
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							title:k_italy = {
								change_title_holder = {
									holder = prev
									change = scope:title_change
								}
							}
							resolve_title_and_vassal_change = scope:title_change
						}
					}
				}    
				if = { 
					limit = { has_global_variable = kingdom_of_italia_established_sclavinia }
					every_vassal_or_below = {
						limit = { NOT = { culture = { has_cultural_pillar = heritage_latin } } } 
						every_held_title = { 
							limit = { 
								target_is_de_jure_liege_or_above = title:k_italy
								OR = { 
									tier = tier_duchy
									tier = tier_county
								}
							}	
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							change_title_holder = {
								holder = title:k_italy.holder
								change = scope:title_change
							}  
							resolve_title_and_vassal_change = scope:title_change
						}
					}
					every_held_title = { 
						limit = { 
							target_is_de_jure_liege_or_above = title:k_italy
							OR = { 
								tier = tier_duchy
								tier = tier_county
							}
						}	
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = title_change
							add_claim_on_loss = no
						}
						change_title_holder = {
							holder = title:k_italy.holder
							change = scope:title_change
						}  
						resolve_title_and_vassal_change = scope:title_change
					}
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_latin }
							NOT = { liege = { culture = { has_cultural_pillar = heritage_latin } } }	
							any_held_title = { target_is_de_jure_liege_or_above = title:k_italy } 					
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change
							add_claim_on_loss = no
						}
						change_liege = { 
							liege = title:k_italy.holder
							change = scope:change
						}         
						resolve_title_and_vassal_change = scope:change
					}  
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_latin }
							highest_held_title_tier < tier_kingdom
							liege = { highest_held_title_tier = tier_kingdom } 
							NOT = { primary_title = { target_is_de_facto_liege_or_above = title:k_italy } }
							capital_province.county = { target_is_de_jure_liege_or_above = title:k_italy }							
						}
						create_title_and_vassal_change = {
							type = granted
							save_scope_as = change
							add_claim_on_loss = no
						}
						change_liege = { 
							liege = title:k_italy.holder
							change = scope:change
						}         
						resolve_title_and_vassal_change = scope:change
					}  
					every_vassal_or_below = {
						limit = { 
							culture = { has_cultural_pillar = heritage_latin }
							highest_held_title_tier = tier_kingdom
							NOT = { has_title = title:k_italy }
						}
						every_held_title = { 
							limit = { 
								target_is_de_jure_liege_or_above = title:k_italy
								OR = { 
									tier = tier_duchy
									tier = tier_county
								}
							}	
							create_title_and_vassal_change = {
								type = granted
								save_scope_as = title_change
								add_claim_on_loss = no
							}
							change_title_holder = {
								holder = title:k_italy.holder
								change = scope:title_change
							}  
							resolve_title_and_vassal_change = scope:title_change
						}
					}
				}
				create_title_and_vassal_change = {
					type = granted
					save_scope_as = change
					add_claim_on_loss = no
				}
				every_vassal_or_below = { 
					limit = {
						culture = { has_cultural_pillar = heritage_central_germanic }
						NOT = { liege = { culture = { has_cultural_pillar = heritage_central_germanic } } }
					}
					change_liege = { 
						liege = title:k_east_francia.holder
						change = scope:change
					}
				}
				every_vassal_or_below = { 
					limit = {
						culture = { has_cultural_pillar = heritage_frankish }
						NOT = { liege = { culture = { has_cultural_pillar = heritage_frankish } } }
					}
					change_liege = { 
						liege = title:k_france.holder
						change = scope:change
					}
				}
				every_vassal_or_below = { 
					limit = {
						culture = { has_cultural_pillar = heritage_west_slavic }
						NOT = { liege = { culture = { has_cultural_pillar = heritage_west_slavic } } }
					}
					change_liege = { 
						liege = ROOT
						change = scope:change
					}
				}   
				resolve_title_and_vassal_change = scope:change
				create_title_and_vassal_change = {
					type = granted
					save_scope_as = title_change
					add_claim_on_loss = no
				}
				every_vassal_or_below = {
					limit = { NOT = { culture = { has_cultural_pillar = heritage_central_germanic } } } 
					every_held_title = { 
						limit = { 
							target_is_de_jure_liege_or_above = title:k_east_francia
							OR = { 
								tier = tier_duchy
								tier = tier_county
							}
						}
						change_title_holder = {
							holder = title:k_east_francia.holder
							change = scope:title_change
						}
					}
				}
				every_vassal_or_below = {
					limit = { NOT = { culture = { has_cultural_pillar = heritage_frankish } } } 
					every_held_title = { 
						limit = { 
							target_is_de_jure_liege_or_above = title:k_france
							OR = { 
								tier = tier_duchy
								tier = tier_county
							}
						}
						change_title_holder = {
							holder = title:k_france.holder
							change = scope:title_change
						}
					}
				}
				every_vassal_or_below = {
					limit = { NOT = { culture = { has_cultural_pillar = heritage_west_slavic } } } 
					every_held_title = { 
						limit = { 
							target_is_de_jure_liege_or_above = title:k_poland
							OR = { 
								tier = tier_duchy
								tier = tier_county
							}
						}
						change_title_holder = {
							holder = ROOT
							change = scope:title_change
						}
					}
				}
				resolve_title_and_vassal_change = scope:title_change				
			}
		}
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_rebuked_roman_claim_to_sicily
			}
		}
		if = { 
			limit = {
				faith.religious_head = { is_close_or_extended_family_of = title:e_hre.holder }
			}
			set_global_variable = {
				name = pope_is_already_family_sclavinia
				value = yes
			} 
		}
		if = { 
			limit = {
				OR = { 
					any_county_in_region = { 
						count > 63
						region = k_italia_hre  # 70
						target_is_de_facto_liege_or_above = title:e_hre 
					}  
					faith.religious_head = { is_close_or_extended_family_of = title:e_hre.holder }
					root = { has_strong_usable_hook = faith.religious_head }	#Or you have a strong hook on them that you can actually use.
					title:e_hre.holder = { has_strong_usable_hook = faith.religious_head }	#Or you have a strong hook on them that you can actually use.
				}
				has_title = title:k_poland
			}
			trigger_event = sclavinia.0021  
		}
		else = { 
			trigger_event = sclavinia.0020
		}
	}

	cost = {
	
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
dismantle_byz_pretender_decision_sclavinia = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_hold_triumph.dds"
	}
	desc = dismantle_byz_pretender_decision_desc
	selection_tooltip = dismantle_byz_pretender_decision_tooltip
	decision_group_type = sclavinia_group

	ai_check_interval = 1

	is_shown = {
		exists = title:e_byzantium.holder #Must exists in the first place...
		NOT = {
			root = title:e_byzantium.holder #That'd be awkward...
		}
		culture = { has_cultural_pillar = heritage_west_slavic }
		is_ruler = yes
		is_playable_character = yes
		OR = {
			has_title = title:h_roman_empire
			has_title = title:e_hre
		}
		NOR = { #Once an Emperor throws the challenge, he has only one chance to dismantle the Empire.
			has_character_flag = flag_emperor_challenging_byz #Applied below.
			has_character_flag = flag_emperor_challenged_byz #Applied in war.
		}
	}

	is_valid = {
		prestige_level >= max_prestige_level
		#All the Italian Peninsula
		completely_controls_region = world_europe_south_italy
		#And Epirus/Hellas (Greek foothold).
		completely_controls = title:d_dyrrachion
		completely_controls = title:d_cephalonia
		completely_controls = title:d_epirus
		completely_controls = title:d_athens
		completely_controls = title:d_achaia
	}
	
	is_valid_showing_failures_only = {
		is_landed = yes
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes
		is_at_war = no
	}

	cost = {
		prestige = 2000
	}

	effect = {
		custom_tooltip = dismantle_byz_pretender_decision_effect_tooltip
		trigger_event = roman_restoration.0170
	}
	
	ai_potential = {
		has_trait = ambitious
	}

	ai_will_do = {
		base = 100
	}
}
restore_roman_empire_sclavinia_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	desc = restore_roman_empire_sclavinia_decision_desc
	selection_tooltip = restore_roman_empire_sclavinia_decision_tooltip
	decision_group_type = sclavinia_group

	ai_check_interval = 1

	is_shown = {
		is_ruler = yes
		is_playable_character = yes
		has_title = title:e_hre
		OR = {
			NOT = { has_title = title:e_byzantium } # Prioritize Byzaboos
			primary_title = title:e_hre
		}
		NOT = { primary_title = title:e_italy }
		NOT = {  #Can only do it once.
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_restored_roman_empire
			}
		}
		OR = {
			government_has_flag = government_is_feudal
			government_has_flag = government_is_republic
			government_has_flag = government_is_clan
			government_has_flag = government_is_administrative
		}
		has_global_variable = pope_hre_war_ended_sclavinia 
		has_culture = culture:polish
	}

	is_valid = {
		prestige_level >= max_prestige_level
		completely_controls = title:d_latium
		completely_controls = title:d_venice
		completely_controls = title:d_romagna
		completely_controls = title:d_sicily
		completely_controls = title:d_genoa
		completely_controls = title:d_capua
		completely_controls = title:d_apulia
		completely_controls = title:d_thrace
		completely_controls = title:d_antioch
		completely_controls = title:d_palestine
		completely_controls = title:d_alexandria
		completely_controls = title:d_athens
		completely_controls = title:d_tunis
		completely_controls = title:d_croatia
		completely_controls = title:d_thessalonika
	}

	is_valid_showing_failures_only = {
		is_landed = yes
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes

		OR = {
			religion = { is_in_family = rf_abrahamic }
			religion = religion:hellenism_religion
			culture = { has_cultural_pillar = heritage_latin }
			culture = { has_cultural_pillar = heritage_byzantine }
		}
	}

	effect = {
		if = { 
			limit = { has_global_variable = sclavinia_imperium_universalis }     
			hidden_effect = { 
				title:h_roman_empire = {
					set_title_name = roman_sclavinia_imperium_universalis
					set_coa = h_roman_empire_sclavinia
					set_capital_county = title:k_poland.title_capital_county 
				}
			}
			custom_tooltip = restore_roman_empire_sclavinia_decision_effect_tooltip2
		}
		else_if = { 
			limit = { has_global_variable = imperator_imperium_universalis }
			hidden_effect = { 
				title:h_roman_empire = {
					set_title_name = roman_imperium_universalis
					set_coa = h_roman_empire_imperator
				}
			}
			custom_tooltip = restore_roman_empire_sclavinia_decision_effect_tooltip
		}
		else = { 
			hidden_effect = { 
				title:h_roman_empire = {
					set_title_name = roman_imperium_universalis
				}
			}
			custom_tooltip = restore_roman_empire_sclavinia_decision_effect_tooltip
		}
		show_as_tooltip = {
			add_trait = augustus
		}
		trigger_event = sclavinia.0022
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_restored_roman_empire
			}
			set_global_variable = {
				name = flag_restored_roman_empire
				value = root
			}
		}
		show_as_tooltip = { 
			if = { 
				limit = { has_global_variable = universal_princely_elective_succession_law_sclavinia }
				title:h_roman_empire = { add_title_law = universal_princely_elective_succession_law }
			}
		}
	}
	
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_africa_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_africa_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
		} 
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_africa_hre_trigger_tooltip
						any_county_in_region = { 
							count > 44
							region = k_africa_hre  # 89
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
					any_county_in_region = { 
						count > 44
						region = k_africa_hre  # 89
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_africa_re_trigger_tooltip
						any_county_in_region = { 
							count > 44
							region = k_africa_hre  # 89
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
					any_county_in_region = { 
						count > 44
						region = k_africa_hre  # 89
						target_is_de_facto_liege_or_above = title:h_roman_empire 
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_africa = { is_titular = no } }
			OR = { 
				has_title = title:k_africa
				any_vassal = { has_title = title:k_africa } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_africa_established_sclavinia
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_africa_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_britannia_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_britannia_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
		} 
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_britannia_hre_trigger_tooltip
						any_county_in_region = { 
							count > 49
							region = k_britannia_hre  # 99
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
					any_county_in_region = { 
						count > 49
						region = k_britannia_hre  # 99
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_britannia_re_trigger_tooltip
						any_county_in_region = { 
							count > 49
							region = k_britannia_hre  # 99
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
					any_county_in_region = { 
						count > 49
						region = k_britannia_hre  # 99
						target_is_de_facto_liege_or_above = title:h_roman_empire 
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_england = { is_titular = no } }
			OR = { 
				has_title = title:k_england
				any_vassal = { has_title = title:k_england } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_britannia_established_sclavinia
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_britannia_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
} 
hre_kingdom_of_dacia_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_dacia_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
		} 
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				trigger_if = { 
					limit = { game_start_date > 1000.1.1  }
					AND = { 
						custom_tooltip = { 
							text = k_dacia_hre1066_trigger_tooltip
							any_county_in_region = { 
								count > 32
								region = k_dacia_hre1066  # 64
								target_is_de_facto_liege_or_above = title:e_hre 
							}
						}
						any_county_in_region = { 
							count > 32
							region = k_dacia_hre1066  # 64
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
				}
				trigger_else = { 
					AND = { 
						custom_tooltip = { 
							text = k_dacia_hre867_trigger_tooltip
							any_county_in_region = { 
								count > 26
								region = k_dacia_hre867  # 52
								target_is_de_facto_liege_or_above = title:e_hre 
							}
						}
						any_county_in_region = { 
							count > 26
							region = k_dacia_hre867  # 52
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				trigger_if = { 
					limit = { game_start_date > 1000.1.1  }
					AND = { 
						custom_tooltip = { 
							text = k_dacia_re1066_trigger_tooltip
							any_county_in_region = { 
								count > 32
								region = k_dacia_hre1066  # 64
								target_is_de_facto_liege_or_above = title:h_roman_empire 
							}
						}
						any_county_in_region = { 
							count > 32
							region = k_dacia_hre1066  # 64
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
				}
				trigger_else = { 
					AND = { 
						custom_tooltip = { 
							text = k_dacia_re867_trigger_tooltip
							any_county_in_region = { 
								count > 26
								region = k_dacia_hre867  # 52
								target_is_de_facto_liege_or_above = title:h_roman_empire 
							}
						}
						any_county_in_region = { 
							count > 26
							region = k_dacia_hre867  # 52
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_hungary = { is_titular = no } }
			OR = { 
				has_title = title:k_hungary
				any_vassal = { has_title = title:k_hungary } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_dacia_established_sclavinia 
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_dacia_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
} 
hre_kingdom_of_graecia_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_graecia_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
		} 
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_graecia_hre_trigger_tooltip
						any_county_in_region = { 
							count > 66
							region = k_graecia_hre  # 132
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
					any_county_in_region = { 
						count > 66
						region = k_graecia_hre  # 132
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_graecia_re_trigger_tooltip
						any_county_in_region = { 
							count > 66
							region = k_graecia_hre  # 132
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
					any_county_in_region = { 
						count > 66
						region = k_graecia_hre  # 132
						target_is_de_facto_liege_or_above = title:h_roman_empire 
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_thessalonika = { is_titular = no } }
			OR = { 
				has_title = title:k_thessalonika
				any_vassal = { has_title = title:k_thessalonika } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_graecia_established_sclavinia
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_graecia_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
} 
hre_kingdom_of_hierosolyma_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_hierosolyma_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
		} 
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_hierosolyma_hre_trigger_tooltip
						any_county_in_region = { 
							count > 28
							region = k_hierosolyma_hre  # 57
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
					any_county_in_region = { 
						count > 28
						region = k_hierosolyma_hre  # 57
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_hierosolyma_re_trigger_tooltip
						any_county_in_region = { 
							count > 28
							region = k_hierosolyma_hre  # 57
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
					any_county_in_region = { 
						count > 28
						region = k_hierosolyma_hre  # 57
						target_is_de_facto_liege_or_above = title:h_roman_empire 
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_jerusalem = { is_titular = no } }
			OR = { 
				has_title = title:k_jerusalem
				any_vassal = { has_title = title:k_jerusalem } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_hierosolyma_established_sclavinia
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_hierosolyma_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_hispania_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_hispania_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
		} 
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_hispania_hre_trigger_tooltip
						any_county_in_region = { 
							count > 43
							region = k_hispania_hre  # 87
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
					any_county_in_region = { 
						count > 43
						region = k_hispania_hre  # 87
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_hispania_re_trigger_tooltip
						any_county_in_region = { 
							count > 43
							region = k_hispania_hre  # 87
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
					any_county_in_region = { 
						count > 43
						region = k_hispania_hre  # 87
						target_is_de_facto_liege_or_above = title:h_roman_empire 
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_castille = { is_titular = no } }
			OR = { 
				has_title = title:k_castille
				any_vassal = { has_title = title:k_castille } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_hispania_established_sclavinia
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_hispania_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_normannia_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_normannia_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
		}
		game_start_date > 1000.1.1 		
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_normannia_hre_trigger_tooltip
						any_county_in_region = { 
							count > 34
							region = k_normannia_hre  # 69
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
					any_county_in_region = { 
						count > 34
						region = k_normannia_hre  # 69
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_normannia_re_trigger_tooltip
						any_county_in_region = { 
							count > 34
							region = k_normannia_hre  # 69
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
					any_county_in_region = { 
						count > 34
						region = k_normannia_hre  # 69
						target_is_de_facto_liege_or_above = title:h_roman_empire 
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_denmark = { is_titular = no } }
			OR = { 
				has_title = title:k_denmark
				any_vassal = { has_title = title:k_denmark } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_normannia_established_sclavinia
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_normannia_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_ruthenia_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_ruthenia_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
			has_global_variable = sclavinia_imperium_universalis
		}
		OR = {
			game_start_date > 1000.1.1 		
			has_global_variable = sclavinia_imperium_universalis
		}
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_ruthenia_hre_trigger_tooltip
						any_county_in_region = { 
							count > 34
							region = k_ruthenia_hre  # 68
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
					any_county_in_region = { 
						count > 34
						region = k_ruthenia_hre  # 68
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_ruthenia_re_trigger_tooltip
						any_county_in_region = { 
							count > 34
							region = k_ruthenia_hre  # 68
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
					any_county_in_region = { 
						count > 34
						region = k_ruthenia_hre  # 68
						target_is_de_facto_liege_or_above = title:h_roman_empire 
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_ruthenia = { is_titular = no } }
			OR = { 
				has_title = title:k_ruthenia
				any_vassal = { has_title = title:k_ruthenia } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_ruthenia_established_sclavinia
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_ruthenia_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
hre_kingdom_of_sclavonia_decision = {
	desc = hre_kingdom_of_decision_desc
	selection_tooltip = hre_kingdom_of_decision_tooltip
	confirm_text = hre_kingdom_of_decision_confirm
	picture = {
		reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds"
	}
	decision_group_type = sclavinia_group

	ai_check_interval = 1
	
	is_shown = {
		NOT = { has_global_variable = kingdom_of_sclavonia_established_sclavinia }
		has_title = title:k_poland 
		has_faith = faith:catholic
		has_culture = culture:polish
		OR = { 
			has_title = title:e_hre
			has_title = title:h_roman_empire
			is_vassal_of = title:e_hre.holder
			is_vassal_of = title:h_roman_empire.holder
		}
		OR = { 
			title:e_hre = { has_title_law = universal_princely_elective_succession_law }
			title:h_roman_empire = { has_title_law = universal_princely_elective_succession_law }
			has_global_variable = sclavinia_imperium_universalis
		}
	}
	is_valid = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
			trigger_if = { 
				limit = { has_title = title:e_hre }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:e_hre.holder = { prestige_level >= 3 }
				}
			}
			title:e_hre.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_sclavonia_hre_trigger_tooltip
						any_county_in_region = { 
							count > 25
							region = k_sclavonia_hre  # 51
							target_is_de_facto_liege_or_above = title:e_hre 
						}
					}
					any_county_in_region = { 
						count > 25
						region = k_sclavonia_hre  # 51
						target_is_de_facto_liege_or_above = title:e_hre 
					}
				}
			}
		}
		trigger_else_if = { 
			limit = { exists = title:h_roman_empire.holder }
			trigger_if = { 
				limit = { has_title = title:h_roman_empire }
				prestige_level >= 3
			}
			trigger_else = { 
				OR = { 
					prestige_level >= 3
					title:h_roman_empire.holder = { prestige_level >= 3 }
				}
			}
			title:h_roman_empire.holder = {
				AND = { 
					custom_tooltip = { 
						text = k_sclavonia_re_trigger_tooltip
						any_county_in_region = { 
							count > 25
							region = k_sclavonia_hre  # 51
							target_is_de_facto_liege_or_above = title:h_roman_empire 
						}
					}
					any_county_in_region = { 
						count > 25
						region = k_sclavonia_hre  # 51
						target_is_de_facto_liege_or_above = title:h_roman_empire 
					}
				}
			}
		}
		trigger_if = { 
			limit = { title:k_croatia = { is_titular = no } }
			OR = { 
				has_title = title:k_croatia
				any_vassal = { has_title = title:k_croatia } 
			}
		}
	}

	is_valid_showing_failures_only = {
		
	}

	effect = {
		custom_tooltip = kingdom_of_sclavonia_established_sclavinia
		if = { 
			limit = { 
				OR = { has_title = title:e_hre is_vassal_of = title:e_hre.holder }
			}
			title:e_hre = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		if = { 
			limit = { 
				OR = { has_title = title:h_roman_empire is_vassal_of = title:h_roman_empire.holder }
			}
			title:h_roman_empire = { save_temporary_scope_as = e_hre_re_sclavinia }
		}
		scope:e_hre_re_sclavinia.holder = { kingdom_of_sclavonia_decision_effect = yes }
	}

	cost = {
		
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
ask_for_innovations_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_golden_age.dds"
	}
	decision_group_type = sclavinia_group
	ai_check_interval = 1

	is_shown = {
		has_culture = culture:polish
		has_title = title:k_poland
		OR = { 
			has_global_variable = empire_unlock_sclavinia
			has_global_variable = orthodox_unlock_sclavinia
			has_global_variable = roman_catholic_unlock_sclavinia
		}
		OR = { 
			has_faith = faith:orthodox
			has_faith = faith:catholic
		}
		NOT = { has_global_variable = ask_for_innovations_decision_flag }
		game_start_date < 1000.1.1
	}

	is_valid = {
		prestige_level >= 4
		trigger_if = { 
			limit = { has_faith = faith:catholic }
			OR = {
				trigger_if = { 
					limit = { culture:italian.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:italian.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:cisalpine.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:cisalpine.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:sardinian.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:sardinian.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:sicilian.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:sicilian.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:lombard.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:lombard.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:saxon.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:saxon.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:franconian.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:franconian.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:swabian.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:swabian.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:bavarian.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:bavarian.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:dutch.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:dutch.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:french.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:french.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:occitan.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:occitan.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:breton.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:breton.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					}
				}
			}
		}
		trigger_if = { 
			limit = { has_faith = faith:orthodox }
			OR = {
				trigger_if = { 
					limit = { culture:greek.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:greek.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:georgian.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:georgian.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
				trigger_if = { 
					limit = { culture:armenian.culture_head = { sub_realm_size >= 50 } }
					AND = { 
						culture:armenian.culture_head = { 
							OR = {
								AND = { 
									opinion = { target = root value >= 100 }
									ROOT = { legitimacy_level >= 4 }
								}
								AND = { 
									opinion = { target = root value >= 75 }
									ROOT = { legitimacy_level = 5 }
								}
							}
						}
					} 
				}
			}
		}
	}
	cost = {
		prestige = 500
	}
	effect = {
		set_global_variable = {
			name = ask_for_innovations_decision_flag
			value = yes
		}
		house = { 
			add_house_modifier = {
				modifier = ask_for_innovations_decision_modifier_sclavinia
				years = 50
			}
		}
		show_as_tooltip = { 
			culture:polish = {
				add_random_innovation = culture_group_military
				add_random_innovation = culture_group_civic
			}
		}
		hidden_effect = { 
			random_list = {
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_motte } } }
					culture:polish = { add_innovation = innovation_motte }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_catapult } } }
					culture:polish = { add_innovation = innovation_catapult }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_barracks } } }
					culture:polish = { add_innovation = innovation_barracks }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_mustering_grounds } } }
					culture:polish = { add_innovation = innovation_mustering_grounds }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_bannus } } }
					culture:polish = { add_innovation = innovation_bannus }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_quilted_armor } } }
					culture:polish = { add_innovation = innovation_quilted_armor }
				}
				50 = { 
					trigger = {	
						culture:polish = { 
							has_innovation = innovation_motte
							has_innovation = innovation_catapult
							has_innovation = innovation_barracks
							has_innovation = innovation_mustering_grounds
							has_innovation = innovation_bannus
							has_innovation = innovation_quilted_armor
						} 
					}
					culture:polish = { add_random_innovation = culture_group_military }
				}
				
			} 
			random_list = {
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_gavelkind } } }
					culture:polish = { add_innovation = innovation_gavelkind }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_crop_rotation } } }
					culture:polish = { add_innovation = innovation_crop_rotation }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_city_planning } } }
					culture:polish = { add_innovation = innovation_city_planning }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_casus_belli } } }
					culture:polish = { add_innovation = innovation_casus_belli }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_plenary_assemblies } } }
					culture:polish = { add_innovation = innovation_plenary_assemblies }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_ledger } } }
					culture:polish = { add_innovation = innovation_ledger }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_development_01 } } }
					culture:polish = { add_innovation = innovation_development_01 }
				}
				50 = { 
					trigger = {	NOT = { culture:polish = { has_innovation = innovation_currency_01 } } }
					culture:polish = { add_innovation = innovation_currency_01 }
				}
				50 = { 
					trigger = {	
						culture:polish = { 
							has_innovation = innovation_gavelkind
							has_innovation = innovation_crop_rotation
							has_innovation = innovation_city_planning
							has_innovation = innovation_casus_belli
							has_innovation = innovation_plenary_assemblies
							has_innovation = innovation_ledger
							has_innovation = innovation_development_01
							has_innovation = innovation_currency_01
						} 
					}
					culture:polish = { add_random_innovation = culture_group_civic }
				}
			}
		}
	}
	

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}