﻿namespace = sclavinia

sclavinia.0001 = {
	type = character_event
	title = sclavinia.0001.t
	desc = {
		triggered_desc = {
			trigger = {
				NOT = { dynasty = { this = dynasty:699 } }
			}
			desc = sclavinia.0001.desc
		}
		triggered_desc = {
			trigger = {
				dynasty = { this = dynasty:699 }
			}
			desc = sclavinia.0001.desc.piast
		}
	}
	theme = realm
	left_portrait = {
		character = root
		animation = personality_callous
	}
	right_portrait = {
		character = scope:piastowie_sclavinia
		animation = personality_vengeful
	}

	trigger = {
		scope:title = title:k_poland
		NOT = { has_global_variable = poland_renamed_sclavinia }
		game_start_date < 1000.1.1
		has_culture = culture:polish 
	}

	immediate = {
		if = {
			limit = { NOT = { dynasty = { this = dynasty:699 } } }
			dynasty:699 = { dynast = { save_scope_as = piastowie_sclavinia } }
		}
		set_global_variable = {
			name = poland_renamed_sclavinia
			value = yes
		}
		if = {
			limit = { dynasty = { this = dynasty:699 } }
			title:k_poland = {
				set_capital_county = title:c_poznanska
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_poznanska
			}
			title:e_sclavinia = {
				set_capital_county = title:c_poznanska
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:2001004 } }
			title:k_poland = {
				set_title_name = lendia_sclavinia
				set_capital_county = title:c_peremyshl
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_peremyshl
			}
			title:e_sclavinia = {
				set_capital_county = title:c_peremyshl
			}
			title:k_malopolska = {
				set_capital_county = title:c_peremyshl
				set_title_name = k_malopolska_lendia_sclavinia
			}
			title:k_wielkopolska = {
				set_title_name = k_wielkopolska_lendia_sclavinia
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:2001003 } }
			title:k_poland = {
				set_title_name = vistulia_sclavinia
				set_capital_county = title:c_krakowska
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_krakowska
			}
			title:e_sclavinia = {
				set_capital_county = title:c_krakowska
			}
			
			title:k_malopolska = {
				set_capital_county = title:c_krakowska
				set_title_name = k_malopolska_vistulia_sclavinia
			}
			title:k_wielkopolska = {
				set_title_name = k_wielkopolska_vistulia_sclavinia
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:2001005 } }
			title:k_poland = {
				set_title_name = sandomiria_sclavinia
				set_capital_county = title:c_sandomierska
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_sandomierska
			}
			title:e_sclavinia = {
				set_capital_county = title:c_sandomierska
			}
			title:d_lesser_poland = {
				set_title_name = sandomiria_sclavinia
				set_capital_county = title:c_sandomierska
			}
			title:k_malopolska = {
				set_capital_county = title:c_sandomierska
				set_title_name = k_malopolska_sandomiria_sclavinia
			}
			title:k_wielkopolska = {
				set_title_name = k_wielkopolska_sandomiria_sclavinia
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:2001006 } }
			title:k_poland = {
				set_title_name = mazovia_sclavinia
				set_capital_county = title:c_plocka
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_plocka
			}
			title:e_sclavinia = {
				set_capital_county = title:c_plocka
			}
			title:k_wielkopolska = {
				set_capital_county = title:c_plocka
				set_title_name = k_wielkopolska_mazovia_sclavinia
			}
			title:k_malopolska = {
				set_capital_county = title:c_sandomierska
				set_title_name = k_malopolska_mazovia_sclavinia
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:2001007 } }
			title:k_poland = {
				set_title_name = goplania_sclavinia
				set_capital_county = title:c_kujawy
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_kujawy
			}
			title:e_sclavinia = {
				set_capital_county = title:c_kujawy
			}
			title:k_wielkopolska = {
				set_capital_county = title:c_kujawy
				set_title_name = k_wielkopolska_goplania_sclavinia
			}
			title:k_malopolska = {
				set_capital_county = title:c_sandomierska
				set_title_name = k_malopolska_goplania_sclavinia
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:2001008 } }
			title:k_poland = {
				set_title_name = kuyavia_sclavinia
				set_capital_county = title:c_sieradzka
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_sieradzka
			}
			title:e_sclavinia = {
				set_capital_county = title:c_sieradzka
			}
			title:d_kuyavia = {
				set_capital_county = title:c_sieradzka
			}
			title:k_wielkopolska = {
				set_capital_county = title:c_sieradzka
				set_title_name = k_wielkopolska_kuyavia_sclavinia
			}
			title:k_malopolska = {
				set_capital_county = title:c_sandomierska
				set_title_name = k_malopolska_kuyavia_sclavinia
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:9127 } }
			title:k_poland = {
				set_title_name = silesia_sclavinia
				set_capital_county = title:c_breslau
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_breslau
			}
			title:e_sclavinia = {
				set_capital_county = title:c_breslau
			}
			title:k_wielkopolska = {
				set_capital_county = title:c_breslau
				set_title_name = k_wielkopolska_silesia_sclavinia
			}
			title:k_malopolska = {
				set_capital_county = title:c_sandomierska
				set_title_name = k_malopolska_silesia_sclavinia
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:9128 } }
			title:k_poland = {
				set_title_name = opolia_sclavinia
				set_capital_county = title:c_opole
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_opole
			}
			title:e_sclavinia = {
				set_capital_county = title:c_opole
			}
			title:k_wielkopolska = {
				set_capital_county = title:c_opole
				set_title_name = k_wielkopolska_opolia_sclavinia
			}
			title:k_malopolska = {
				set_capital_county = title:c_sandomierska
				set_title_name = k_malopolska_opolia_sclavinia
			}
		}
		if = {
			limit = { dynasty = { this = dynasty:9129 } }
			title:k_poland = {
				set_title_name = brzegia_sclavinia
				set_capital_county = title:c_brzeg
			}
			title:e_wendish_empire = {
				set_capital_county = title:c_brzeg
			}
			title:e_sclavinia = {
				set_capital_county = title:c_brzeg
			}
			title:d_upper_silesia = {
				set_capital_county = title:c_brzeg
			}
			title:k_wielkopolska = {
				set_capital_county = title:c_brzeg
				set_title_name = k_wielkopolska_brzegia_sclavinia
			}
			title:k_malopolska = {
				set_capital_county = title:c_sandomierska
				set_title_name = k_malopolska_brzegia_sclavinia
			}
		}
		# Not really used, but if we don't set the scopes we get errors in the feature selection
		set_artifact_rarity_illustrious = yes

		# Create the artifact
		create_artifact = {
			name = artifact_szczerbiec_name
			description = artifact_szczerbiec_description_sclavinia
			template = general_unique_template
			type = pedestal
			visuals = wall_szczerbiec_sword
			wealth = scope:wealth
			quality = scope:quality
			history = {
				type = created
				recipient = ROOT
				location = title:k_poland.holder.capital_province
			}
			modifier = sclavinia_szczerbiec_modifier
			save_scope_as = newly_created_artifact
			decaying = no
		}

		scope:newly_created_artifact = {
			set_variable = { name = historical_unique_artifact value = yes }
			set_variable = szczerbiec
			save_scope_as = epic
		}
		play_music_cue = "mx_cue_epic_sacral_moment"
	}

	option = {
		name = sclavinia.0001.a
		ai_chance = {
			base = 0
		}
		custom_tooltip = nothing_happens_sclavinia
		trigger_event = {
			id = sclavinia.0002
			days = 14
		}
	}
	option = {
		name = sclavinia.0001.b
		ai_chance = {
			base = 0
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:699 }
			}
		}
		custom_tooltip = dynasty_to_poland_sclavinia
		dynasty = { set_coa = k_poland }
		house = { set_coa = k_poland }
		if = { 
			limit = { dynasty = { this = dynasty:699 } }
			dynasty = { set_dynasty_name="Piast" }
			house = { set_house_name="Piast" }
			set_global_variable = {
				name = piast_renamed_sclavinia
				value = yes
			}
			custom_tooltip = piast_renamed_sclavinia
		}
		trigger_event = {
			id = sclavinia.0002
			days = 14
		}
	}
	option = {
		name = sclavinia.0001.c
		ai_chance = {
			base = 0
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:2001003 }
			}
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:2001006 }
			}
		}
		custom_tooltip = poland_to_dynasty_sclavinia
		title:k_poland = { set_coa = root.dynasty }
		trigger_event = {
			id = sclavinia.0002
			days = 14
		}
		hidden_effect = { 
			if = {
				limit = { dynasty = { this = dynasty:699 } }
				title:k_wielkopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001004 } }
				title:k_malopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001003 } }
				title:k_malopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001005 } }
				title:k_malopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001006 } }
				title:k_wielkopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001007 } }
				title:k_wielkopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001008 } }
				title:k_wielkopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:9127 } }
				title:k_wielkopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:9128 } }
				title:k_wielkopolska = {
					set_coa = root.dynasty
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:9129 } }
				title:k_wielkopolska = {
					set_coa = root.dynasty
				}
			}
		}
	}
	option = {
		name = sclavinia.0001.d
		if = { 
			limit = { dynasty = { this = dynasty:699 } }
			custom_tooltip = poland_to_poznanskie_sclavinia
			title:k_poland = { set_coa = title:d_poznanskie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:2001004 } }
			custom_tooltip = poland_to_ruskie_sclavinia
			title:k_poland = { set_coa = title:d_ruskie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:2001003 } }
			custom_tooltip = poland_to_krakowskie_sclavinia
			title:k_poland = { set_coa = title:d_krakowskie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:2001005 } }
			custom_tooltip = poland_to_sandomierskie_sclavinia
			title:k_poland = { set_coa = title:d_sandomierskie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:2001006 } }
			custom_tooltip = poland_to_plockie_sclavinia
			title:k_poland = { set_coa = title:d_plockie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:2001007 } }
			custom_tooltip = poland_to_brzeskokujawskie_sclavinia
			title:k_poland = { set_coa = title:d_brzeskokujawskie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:2001008 } }
			custom_tooltip = poland_to_leczyckie_sclavinia
			title:k_poland = { set_coa = title:d_sieradzkie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:9127 } }
			custom_tooltip = poland_to_wroclawskie_sclavinia
			title:k_poland = { set_coa = title:d_wroclawskie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:9128 } }
			custom_tooltip = poland_to_opolskie_sclavinia
			title:k_poland = { set_coa = title:d_opolskie }
		}
		if = { 
			limit = { dynasty = { this = dynasty:9129 } }
			custom_tooltip = poland_to_brzeskie_sclavinia
			title:k_poland = { set_coa = title:d_brzeskie }
		}
		ai_chance = {
			base = 0
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:2001004 }
			}
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:9127 }
			}
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:9128 }
			}
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:9129 }
			}
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:2001007 }
			}
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:2001008 }
			}
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:2001005 }
			}
		}
		trigger_event = {
			id = sclavinia.0002
			days = 14
		}
		hidden_effect = { 
			if = {
				limit = { dynasty = { this = dynasty:699 } }
				title:k_wielkopolska = {
					set_coa = title:d_poznanskie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001004 } }
				title:k_malopolska = {
					set_coa = title:d_ruskie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001003 } }
				title:k_malopolska = {
					set_coa = title:d_krakowskie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001005 } }
				title:k_malopolska = {
					set_coa = title:d_sandomierskie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001006 } }
				title:k_wielkopolska = {
					set_coa = title:d_plockie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001007 } }
				title:k_wielkopolska = {
					set_coa = title:d_brzeskokujawskie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:2001008 } }
				title:k_wielkopolska = {
					set_coa = title:d_sieradzkie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:9127 } }
				title:k_wielkopolska = {
					set_coa = title:d_wroclawskie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:9128 } }
				title:k_wielkopolska = {
					set_coa = title:d_opolskie
				}
			}
			if = {
				limit = { dynasty = { this = dynasty:9129 } }
				title:k_wielkopolska = {
					set_coa = title:d_brzeskie
				}
			}
		}
	}
}
sclavinia.0002 = {
	type = character_event
	title = sclavinia.0002.t
	desc = sclavinia.0002.desc
	theme = realm
	immediate = {
		if = { 
			limit = { 
				title:d_nordmark = { holder = { exists = yes } }
			}
			title:d_nordmark = { holder = { save_scope_as = wieleci_sclavinia } }
		}
		else = { 
			dynasty:2001013 = { dynast = { save_scope_as = wieleci_sclavinia } }
		}
	}
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:wieleci_sclavinia
		animation = aggressive_axe
	}
	
	option = {
		trigger = { 
			has_faith = faith:slavic_pagan
		}
		name = sclavinia.0002.b
		ai_chance = {
			base = 40
		}
		add_piety = 1000
		set_global_variable = {
			name = empire_unlock_sclavinia
			value = yes
		}
		custom_tooltip = empire_unlock_sclavinia_generic_tooltip
	}
	option = {
		trigger = { 
			has_faith = faith:slavic_pagan
		}
		name = sclavinia.0002.a
		ai_chance = {
			base = 60
		}
		custom_tooltip = conversion_sclavinia
		trigger_event = sclavinia.0003
	}
	option = {
		trigger = { 
			NOT = { has_faith = faith:slavic_pagan }
		}
		name = sclavinia.0002.c
		custom_tooltip = not_conversion_sclavinia
	}
}
sclavinia.0003 = {
	type = character_event
	title = sclavinia.0003.t
	desc = sclavinia.0003.desc
	theme = realm
	immediate = { 
		title:k_papal_state = { holder = { save_scope_as = pope_sclavinia } }
		title:k_orthodox = { holder = { save_scope_as = patriarch_sclavinia } }
	}
	left_portrait = {
		character = root
		animation = personality_rational
	}
	lower_left_portrait = {
		character = scope:pope_sclavinia
	}
	lower_right_portrait = {
		character = scope:patriarch_sclavinia
	}
	
	option = {
		name = sclavinia.0003.a
		ai_chance = {
			base = 50
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:699 }
			}
			modifier = { 
				add = -1050
				dynasty = { this = dynasty:2001004 }
			}
			modifier = { 
				add = -1050
				dynasty = { this = dynasty:2001003 }
			}
		}      
		custom_tooltip = sclavinia_update_plot
		if = { 
			limit = {
				dynasty = { this = dynasty:699 }
			}
			custom_tooltip = recommended_conversion_sclavinia
			add_legitimacy = 25
		}
		add_prestige = 500
		custom_tooltip = conversion_partial_sclavinia
		set_character_faith_with_conversion = faith:catholic
		trigger_event = {
			id = sclavinia.0013
			days = 7
		}
		hidden_effect = {
			every_spouse = {
				if = { 
					limit = { this = character:3020617 }
					change_first_name = Anna
				}
			}
			if = { 
				limit = { this = character:302061 }
				remove_trait = stubborn
				remove_trait = vengeful
				remove_trait = greedy
				remove_trait = paranoid
				add_trait = fickle
				add_trait = ambitious
				add_trait = zealous
			}
		}
	}
	option = {
		name = sclavinia.0003.c
		ai_chance = {
			base = 35
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:2001003 }
			}
			modifier = { 
				add = 1000
				dynasty = { this = dynasty:2001004 }
			}
			modifier = { 
				add = -1035
				dynasty = { this = dynasty:699 }
			}
		}
		custom_tooltip = sclavinia_update_plot
		if = { 
			limit = {
				OR = { 
					dynasty = { this = dynasty:2001003 }
					dynasty = { this = dynasty:2001004 }
				}
			}
			custom_tooltip = recommended_conversion_sclavinia
			add_legitimacy = 25
		}
		add_piety = 250
		add_prestige = 250
		custom_tooltip = conversion_full_sclavinia
		show_as_tooltip = { set_character_faith = faith:orthodox }
		hidden_effect = {
			every_vassal_or_below = {
				limit = { NOT = { has_trait = zealous }  }
				set_character_faith = faith:orthodox
				capital_county = { 
					set_county_faith = faith:orthodox
				}
				every_spouse = { 
					set_character_faith = faith:orthodox
				}
				every_close_family_member = { 
					set_character_faith = faith:orthodox
				}
			}
			set_character_faith = faith:orthodox
			capital_county = { 
				set_county_faith = faith:orthodox
			}
			every_close_family_member = { 
				set_character_faith = faith:orthodox 
				if = { 
					limit = { this = character:3020617 }
					change_first_name = Anastazja
				}	
			}
			every_spouse = { 
				set_character_faith = faith:orthodox 
				if = { 
					limit = { this = character:3020617 }
					change_first_name = Anastazja
				}	
			}
			trigger_event = faith_conversion.1001
			if = { 
				limit = { this = character:302061 }
				remove_trait = stubborn
				remove_trait = vengeful
				remove_trait = greedy
				remove_trait = paranoid
				add_trait = eccentric
				add_trait = humble
				add_trait = trusting
				add_trait = zealous
			}
			title:e_sclavinia = { 
				set_coa = e_sclavinia_orthodox
				set_title_name = k_sklabonia
			}
			title:e_wendish_empire = { 
				set_coa = e_wendish_empire_orthodox
			}
		}
		trigger_event = {
			id = sclavinia.0007
			days = 7
		}
	}
	option = {
		name = sclavinia.0003.b
		ai_chance = {
			base = 15
			modifier = { 
				add = -1015
				dynasty = { this = dynasty:699 }
			}
			modifier = { 
				add = -1015
				dynasty = { this = dynasty:2001003 }
			}
			modifier = { 
				add = -1015
				dynasty = { this = dynasty:2001004 }
			}
		}
		add_piety = 100
		add_prestige = 100
		custom_tooltip = conversion_full_sclavinia
		custom_tooltip = conversion_bosnian_sclavinia
		show_as_tooltip = { set_character_faith = faith:bosnian_church }
		hidden_effect = {
			every_vassal_or_below = {
				limit = { NOT = { has_trait = zealous }  }
				set_character_faith = faith:bosnian_church
				capital_county = { 
					set_county_faith = faith:bosnian_church
				}
				every_close_family_member = { 
					set_character_faith = faith:bosnian_church
				}
				every_spouse = { 
					set_character_faith = faith:bosnian_church
				}
			}
			set_character_faith = faith:bosnian_church
			capital_county = { 
				set_county_faith = faith:bosnian_church
			}
			every_spouse = { 
				set_character_faith = faith:bosnian_church
			}
			every_close_family_member = { 
				set_character_faith = faith:bosnian_church
			}
			trigger_event = faith_conversion.1001
			set_global_variable = {
				name = empire_unlock_sclavinia
				value = yes
			}
		}
		custom_tooltip = empire_unlock_sclavinia_generic_tooltip
	}
}
sclavinia.0004 = {
	type = character_event
	title = sclavinia.0004.t
	desc = sclavinia.0004.desc
	theme = realm
	left_portrait = {
		character = root
		animation = personality_callous
	}
	immediate = { 
		set_global_variable = {
			name = divide_voivodeships_decision_sclavinia
			value = yes
		}
		show_as_tooltip = { 
			#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 }
			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
					}
				}
			}
		}
	}
	option = {
		name = sclavinia.0004.a
		ai_chance = {
			base = 100
		}
		custom_tooltip = divide_voivodeships_provinces_sclavinia
		#if = { 
		#	limit = { 
		#		dynasty.dynast = root
		#	}
		#	add_piety = 250
		#}
		#if = { 
		#	limit = { 
		#		dynasty = { this = dynasty:2001004 }
		#	}
		#	add_piety = 2500
		#}
	}
}
sclavinia.0005 = {
	type = character_event
	title = sclavinia.0005.t
	desc = {
		triggered_desc = {
			trigger = {
				game_start_date < 1000.1.1
			}
			desc = sclavinia.0005.desc
		}
		triggered_desc = {
			trigger = {
				game_start_date > 1000.1.1
			}
			desc = sclavinia.0005.desc.piast
		}
	}
	theme = realm
	left_portrait = {
		character = root
		animation = toast_goblet
	}
	right_portrait = {
		character = scope:empire_sclavinia
		animation = personality_vengeful
	}
	immediate = { 
		if = { 
			limit = { game_start_date < 1000.1.1 }
			dynasty:25061 = { dynast = { save_scope_as = empire_sclavinia } }
		}
		else = { 
			title:e_hre = { holder = { save_scope_as = empire_sclavinia } }
		}
		play_music_cue = "mx_cue_epic_sacral_moment"
		hidden_effect = { 
			title:k_novgorod = { set_de_jure_liege_title = title:e_volga-ural }
		}
	}
	option = {
		name = sclavinia.0005.a
		ai_chance = {
			base = 100
		}
		add_legitimacy = 500
		dynasty = {
			add_dynasty_prestige = 2500
			add_dynasty_modifier = {
				modifier = most_serene_kingdom_sclavinia
				years = 50
			}
		}
		legend_seed_great_deed_dynasty_effect = yes
	}
	option = {
		name = sclavinia.0005.b
		ai_chance = {
			base = 0
		}
		add_legitimacy = 500
		dynasty = {
			add_dynasty_prestige = 2500
			add_dynasty_modifier = {
				modifier = most_serene_kingdom_sclavinia
				years = 50
			}
		}
		legend_seed_great_deed_dynasty_effect = yes
		custom_tooltip = new_provinces_sclavinia_tp
		create_title_and_vassal_change = {
			type = created
			save_scope_as = change_title
			add_claim_on_loss = no
		}
		title:k_wielkopolska = {
			change_title_holder = {
				holder = ROOT
				change = scope:change_title
			}
		}
		title:k_malopolska = {
			change_title_holder = {
				holder = ROOT
				change = scope:change_title
			}
		}
		title:k_litewska = {
			change_title_holder = {
				holder = ROOT
				change = scope:change_title
			}
		}
		resolve_title_and_vassal_change = scope:change_title
		hidden_effect = { 
			title:d_poznanskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_kaliskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_sieradzkie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_leczyckie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_brzeskokujawskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_rawskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_plockie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_mazowieckie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_chelminskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_pomorskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_pruskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_wroclawskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_glogowskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_raciborskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_opolskie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_swidnickie = { set_de_jure_liege_title = title:k_wielkopolska }
			title:d_krosnienskie = { set_de_jure_liege_title = title:k_wielkopolska }
			if = { 
				limit = { has_global_variable = brzeskie_exists_sclavinia }
				title:d_brzeskie = { set_de_jure_liege_title = title:k_wielkopolska }
			}
			title:d_krakowskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_sandomierskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_lubelskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_ruskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_belskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_wolynskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_podolskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_kijowskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_zaporoskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_braclawskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_czernihowskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_kurskie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_bachmuckie = { set_de_jure_liege_title = title:k_malopolska }
			title:d_wilenskie = { set_de_jure_liege_title = title:k_litewska }
			title:d_trockie = { set_de_jure_liege_title = title:k_litewska }
			title:d_zmudzkie = { set_de_jure_liege_title = title:k_litewska }
			title:d_nowogrodzkie = { set_de_jure_liege_title = title:k_litewska }
			title:d_brzeskolitewskie = { set_de_jure_liege_title = title:k_litewska }
			title:d_minskie = { set_de_jure_liege_title = title:k_litewska }
			title:d_smolenskie = { set_de_jure_liege_title = title:k_litewska }
			title:d_witebskie = { set_de_jure_liege_title = title:k_litewska }
			title:d_polockie = { set_de_jure_liege_title = title:k_litewska }
			title:d_wendenskie = { set_de_jure_liege_title = title:k_litewska }
			title:d_dorpackie = { set_de_jure_liege_title = title:k_litewska }
			title:d_parnawskie = { set_de_jure_liege_title = title:k_litewska }
			title:d_kurlandzkie = { set_de_jure_liege_title = title:k_litewska }
			title:d_orlowskie = { set_de_jure_liege_title = title:k_litewska }
			title:k_wielkopolska = { set_de_jure_liege_title = title:e_wendish_empire }
			title:k_malopolska = { set_de_jure_liege_title = title:e_wendish_empire }
			title:k_litewska = { set_de_jure_liege_title = title:e_wendish_empire }	
			if = { 
				limit = { has_title = title:e_sclavinia }
				title:k_wielkopolska = { set_de_jure_liege_title = title:e_sclavinia }
				title:k_malopolska = { set_de_jure_liege_title = title:e_sclavinia }
				title:k_litewska = { set_de_jure_liege_title = title:e_sclavinia}
			}	
			if = { 
				limit = { has_title = title:e_slavia }
				title:k_wielkopolska = { set_de_jure_liege_title = title:e_slavia }
				title:k_malopolska = { set_de_jure_liege_title = title:e_slavia }
				title:k_litewska = { set_de_jure_liege_title = title:e_slavia }
			}
			title:k_white_rus = { set_de_jure_liege_title = title:e_russia }
			title:k_galicia-volhynia = { set_de_jure_liege_title = title:e_russia }
			title:k_ruthenia = { set_de_jure_liege_title = title:e_russia }			
			set_global_variable = {
				name = provinces_established_sclavinia
				value = yes
			}
		}
	}
}
sclavinia.0006 = {
	type = character_event
	title = sclavinia.0006.t
	desc = {
		triggered_desc = {
			trigger = {
				OR = { 
					AND = { 
						has_global_variable = empire_unlock_sclavinia
						NOT = { OR = { 
							has_faith = faith:orthodox 
							has_faith = faith:catholic
						} } 
					}
					NOT = { has_culture = culture:polish }
				}
			}
			desc = sclavinia.0006.desc
		}
		triggered_desc = {
			trigger = {
				has_global_variable = empire_unlock_sclavinia
				has_faith = faith:orthodox
				has_culture = culture:polish
			}
			desc = sclavinia.0006.desc.empire.orthodox
		}
		triggered_desc = {
			trigger = {	
				has_global_variable = orthodox_unlock_sclavinia
				has_culture = culture:polish 
			}
			desc = sclavinia.0006.desc.orthodox
		}    
		triggered_desc = {
			trigger = {
				has_global_variable = empire_unlock_sclavinia
				has_faith = faith:catholic
				has_culture = culture:polish
			}
			desc = sclavinia.0006.desc.empire.roman_catholic
		}
		triggered_desc = {
			trigger = {	
				has_global_variable = roman_catholic_unlock_sclavinia
				has_culture = culture:polish 
				NOT = { title:e_hre = { holder = { exists = yes } } }
			}
			desc = sclavinia.0006.desc.empire.roman_catholic.hre_no
		}
		triggered_desc = {
			trigger = {	
				has_global_variable = roman_catholic_unlock_sclavinia
				has_culture = culture:polish 
				title:e_hre = { holder = { exists = yes } }
			}
			desc = sclavinia.0006.desc.empire.roman_catholic.hre_yes
		}
	}
	theme = realm
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:empire_sclavinia
		animation = personality_rational
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		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 }
				}
			}
			unite_the_western_slavs_decision_effects = yes
		}
		if = {
			limit = { 
				has_global_variable = orthodox_unlock_sclavinia
				has_culture = culture:polish
			}
			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
			}
			roman_catholic_unite_the_western_slavs_decision_effects = yes
		}
		if = { 
			limit = { game_start_date > 1000.1.1 }
			title:e_hre = { holder = { save_scope_as = empire_sclavinia } }
		}
		if = {
			limit = { 
				has_faith = faith:orthodox
				OR = { 
					has_global_variable = empire_unlock_sclavinia
					has_global_variable = orthodox_unlock_sclavinia
				}
			}
			title:e_byzantium = { holder = { save_scope_as = empire_sclavinia } }
		}
		if = {
			limit = { 
				has_faith = faith:catholic
				has_global_variable = empire_unlock_sclavinia
			}
			title:k_papal_state = { holder = { save_scope_as = empire_sclavinia } }
		}
		if = {
			limit = { 
				has_faith = faith:catholic
				has_global_variable = roman_catholic_unlock_sclavinia 
				NOT = { title:e_hre = { holder = { exists = yes } } }
			}
			title:k_papal_state = { holder = { save_scope_as = empire_sclavinia } }
		}
		if = {
			limit = { 
				has_faith = faith:catholic
				has_global_variable = roman_catholic_unlock_sclavinia
				title:e_hre = { holder = { exists = yes } }
			}
			title:e_hre = { holder = { save_scope_as = empire_sclavinia } }
		}
		legend_seed_great_deed_title_effect = {
			TITLE = root.primary_title
		}
	}
	
	option = {
		name = sclavinia.0006.a
		if = { 
			limit = { 
				OR = { 
					has_global_variable = roman_catholic_unlock_sclavinia
					has_global_variable = orthodox_unlock_sclavinia
				}
			}
			give_nickname = nick_the_crowned
		}
		if = { 
			limit = { 
				game_start_date < 1000.1.1
				has_global_variable = empire_unlock_sclavinia
			}
			give_nickname = nick_the_restorer
		}
		if = { 
			limit = { 
				game_start_date > 1000.1.1
				has_global_variable = empire_unlock_sclavinia
			}
			give_nickname = nick_the_great
		}
	}
}
sclavinia.0007 = {
	type = character_event
	title = sclavinia.0007.t
	desc = sclavinia.0007.desc
	theme = faith
	
	left_portrait = {
		character = root
		animation = personality_vengeful
	}
	right_portrait = {
		character = scope:patriarch_sclavinia
		animation = personality_zealous
	}
	lower_left_portrait = { 
		character = scope:moravia_sclavinia
	}
	lower_center_portrait = { 
		character = scope:transdanubia_sclavinia
	}
	lower_right_portrait = { 
		character = scope:croatia_sclavinia
	}
	
	immediate = {
		title:k_orthodox = { holder = { save_scope_as = patriarch_sclavinia } }
		if = { 
			limit = { 
				title:k_moravia = { holder = { exists = yes } }
			}
			title:k_moravia = { holder = { save_scope_as = moravia_sclavinia } }
		}
		if = { 
			limit = { 
				title:k_transdanubia = { holder = { exists = yes } }
			}
			title:k_transdanubia = { holder = { save_scope_as = transdanubia_sclavinia } }
		}
		else_if = { 
			limit = { 
				title:d_somogy = { holder = { exists = yes } }
			}
			title:d_somogy = { holder = { save_scope_as = transdanubia_sclavinia } }
		}
		if = { 
			limit = { 
				title:d_croatia = { holder = { exists = yes } }
			}
			title:d_croatia = { holder = { save_scope_as = croatia_sclavinia } }
		}
	}
	option = {
		name = sclavinia.0007.a
		custom_tooltip = orthodox_poland_sclavinia_tooltip
		set_global_variable = {
			name = orthodox_poland_sclavinia
			value = yes
		}
	}
}
sclavinia.0008 = {
	type = character_event
	title = sclavinia.0008.t
	desc = sclavinia.0008.desc
	theme = faith
	
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:basileus_sclavinia
		animation = personality_rational
	}
	lower_center_portrait = { 
		character = scope:moravia_sclavinia
	}
	
	immediate = {
		title:e_byzantium = { holder = { save_scope_as = basileus_sclavinia } }  
		show_as_tooltip = { 
			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
				}
			}
		}
		if = {
			limit = { 
				title:k_moravia = { holder = { exists = yes } }
			}
			title:k_moravia = { holder = { save_scope_as = moravia_sclavinia } }
		}
	}
	option = {
		name = sclavinia.0008.a
		custom_tooltip = orthodox_baptism_sclavinia_tooltip1
		custom_tooltip = empire_unlock_sclavinia_tooltip
		if = { limit = { game_start_date < 1000 }
		custom_tooltip = ask_for_innovations_decision_unlock_tooltip }
		set_global_variable = {
			name = empire_unlock_sclavinia
			value = yes
		}
	}
	option = {
		name = sclavinia.0008.b
		custom_tooltip = orthodox_baptism_sclavinia_tooltip2
		custom_tooltip = orthodox_unlock_sclavinia_tooltip
		if = { limit = { game_start_date < 1000 }
		custom_tooltip = ask_for_innovations_decision_unlock_tooltip }
		set_global_variable = {
			name = orthodox_unlock_sclavinia
			value = yes
		}
	}
}
sclavinia.0009 = {
	type = character_event
	title = sclavinia.0009.t
	desc = sclavinia.0009.desc
	theme = faith
	
	left_portrait = {
		character = root
		animation = personality_zealous
	}
	right_portrait = {
		character = scope:prusians_sclavonia
		animation = personality_vengeful
	}
	immediate = {
		if = { 
			limit = { 
				title:c_natangia = { 
					holder = { 
						exists = yes 
						NOT = { this = ROOT }
					} 
				}
			}
			title:c_natangia = { holder = { save_scope_as = prusians_sclavonia } }
		}
	}
	option = {
		name = sclavinia.0009.a
		set_global_variable = {
			name = prussians_baptised
			value = yes
		}
	}
}
sclavinia.0010 = {
	type = character_event
	title = sclavinia.0010.t
	desc = sclavinia.0010.desc
	theme = realm
	
	left_portrait = {
		character = root
		animation = personality_callous
	}
	trigger = {
		scope:title = title:e_byzantium
		NOT = { has_global_variable = byzantium_conquered_sclavinia }
		has_global_variable = sclavinia_poland_vassalized_byzantine
		has_culture = culture:polish 
	}
	immediate = {
		set_global_variable = {
			name = byzantium_conquered_sclavinia
			value = yes
		}
	}
	option = {
		name = sclavinia.0010.a
		add_piety_level = -2
		set_global_variable = {
			name = byzantium_conquered_sclavinia_polish_ere
			value = yes
		}
		custom_tooltip = sclavinia.0010.tooltip_c
		title:e_byzantium = { 
			#set_capital_county = ROOT.primary_title.title_capital_county
			set_capital_county = title:k_poland.title_capital_county
			set_title_name = e_byzantium_sclavinia
		}
		title:k_poland.title_capital_county = { 
			add_county_modifier = sclavinia_third_rome_modifier
		}
		add_character_modifier = sclavinia_third_rome_character_modifier
		hidden_effect = { 
			every_county = { 
				limit = { 
					OR = { 
						holder = { is_vassal_or_below_of = ROOT }
						holder = { this = ROOT }
					}
					OR = { 
						culture = { this = culture:polish }
						culture = { this = culture:pommeranian }
						culture = { this = culture:polabian }
					}
				}
				add_county_modifier = sclavinia_sklabonia_positive_modifier
			}
			title:k_poland.title_capital_county = { 
				remove_county_modifier = sclavinia_sklabonia_positive_modifier
			}
			every_county = { 
				limit = { 
					OR = { 
						holder = { is_vassal_or_below_of = ROOT }
						holder = { this = ROOT }
					}
					culture = { this = culture:greek }
				}
				add_county_modifier = sclavinia_sklabonia_negative_modifier
			}
		}
		custom_tooltip = sclavinia.0010.tooltip_a
		show_as_tooltip = { title:c_gnieznienska = { add_county_modifier = sclavinia_sklabonia_positive_modifier } }
		show_as_tooltip = { title:c_byzantion = { add_county_modifier = sclavinia_sklabonia_negative_modifier } }
		custom_tooltip = cultural_acceptance_greeks_tooltip
		custom_tooltip = cultural_acceptance_lechites_tooltip
		hidden_effect = {
			culture:polish = {
				change_cultural_acceptance = {
					target = culture:greek
					value = -50
					desc = sclavinia_third_rome_modifier
				}
				change_cultural_acceptance = {
					target = culture:pommeranian
					value = 25
					desc = sclavinia_third_rome_modifier
				}
				change_cultural_acceptance = {
					target = culture:polabian
					value = 25
					desc = sclavinia_third_rome_modifier
				}
			}
		}
		capital_province.county = { change_development_level = 5 }
		title:c_byzantion = { change_development_level = -5 }
		custom_tooltip = sclavinia.0010.tooltip_e
		trigger_event = {
			id = sclavinia.0011
			days = 31
		}
	}
	option = {
		name = sclavinia.0010.c
		custom_tooltip = sclavinia.0010.tooltip_h		
		add_piety_level = -1
		set_global_variable = {
			name = byzantium_conquered_sclavinia_slavic_ere
			value = yes
		}
		custom_tooltip = sclavinia.0010.tooltip_g
		title:e_byzantium = { 
			#set_capital_county = ROOT.primary_title.title_capital_county
			set_capital_county = title:k_poland.title_capital_county
			set_title_name = e_byzantium_sclavinia_slavic
		}
		title:k_poland.title_capital_county = { 
			add_county_modifier = sclavinia_third_rome_modifier
		}
		add_character_modifier = sclavinia_third_rome_character_modifier_slavic
		hidden_effect = { 
			every_county = { 
				limit = { 
					OR = { 
						holder = { is_vassal_or_below_of = ROOT }
						holder = { this = ROOT }
					}
					OR = { 
						culture = { this = culture:polish }
						culture = { this = culture:pommeranian }
						culture = { this = culture:polabian }
					}
				}
				add_county_modifier = sclavinia_sklabonia_positive_modifier_slavic
			}
			title:k_poland.title_capital_county = { 
				remove_county_modifier = sclavinia_sklabonia_positive_modifier_slavic
			}
			every_county = { 
				limit = { 
					OR = { 
						holder = { is_vassal_or_below_of = ROOT }
						holder = { this = ROOT }
					}
					culture = { this = culture:greek }
				}
				add_county_modifier = sclavinia_sklabonia_negative_modifier
			}
		}
		custom_tooltip = sclavinia.0010.tooltip_a_slavic
		show_as_tooltip = { title:c_gnieznienska = { add_county_modifier = sclavinia_sklabonia_positive_modifier_slavic } }
		show_as_tooltip = { title:c_byzantion = { add_county_modifier = sclavinia_sklabonia_negative_modifier } }
		custom_tooltip = cultural_acceptance_greeks_tooltip
		custom_tooltip = cultural_acceptance_slavs_tooltip
		hidden_effect = {
			culture:polish = {
				change_cultural_acceptance = {
					target = culture:greek
					value = -50
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:pommeranian
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:polabian
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:czech
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:slovien
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:carantanian
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:croatian
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:serbian
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:bosnian
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:bulgarian
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
				change_cultural_acceptance = {
					target = culture:russian
					value = 25
					desc = sclavinia_empire_of_the_slavs
				}
			}
		}
		capital_province.county = { change_development_level = 5 }
		title:c_byzantion = { change_development_level = -5 }
		custom_tooltip = sclavinia.0010.tooltip_e
		trigger_event = {
			id = sclavinia.0011
			days = 31
		}
	}
	option = {
		name = sclavinia.0010.b
		set_global_variable = {
			name = byzantium_conquered_sclavinia_carogrod
			value = yes
		}
		custom_tooltip = sclavinia.0010.tooltip_d
		title:c_byzantion = { set_title_name = carogrod_sclavinia }
		title:b_constantinople = { set_title_name = carogrod_sclavinia }
		if = { #Usurp if not held personally.
			limit = {
				NOT = { title:c_byzantion.holder = { this = root } }
			}
			title:c_byzantion.holder = { save_scope_as = target_for_denunciation }
			create_title_and_vassal_change = {
				type = returned
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:c_byzantion = {
				change_title_holder = {
					holder = root
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title

		}
		set_realm_capital = title:c_byzantion
		if = {
			limit = {
				exists = scope:target_for_denunciation
			}
			scope:target_for_denunciation = {
				trigger_event = roman_restoration.1204
			}
		}		
		culture:polish = {
			change_cultural_acceptance = {
				target = culture:greek
				value = 25
				desc = sclavinia_carogrod_acceptance
			}
		}
		custom_tooltip = sclavinia.0010.tooltip_f
		trigger_event = {
			id = sclavinia.0011
			days = 31
		}
	}
}
sclavinia.0011 = {
	type = character_event
	title = sclavinia.0011.t
	desc = sclavinia.0011.desc
	theme = stewardship
	
	left_portrait = {
		character = root
		animation = personality_callous
	}
	option = {
		name = sclavinia.0011.a
		if = { 
			limit = { 
				OR = { 
					has_global_variable = byzantium_conquered_sclavinia_polish_ere 
					has_global_variable = byzantium_conquered_sclavinia_slavic_ere 
				}
			}
			add_prestige = -1000
		}
		culture:polish = { 
			remove_culture_tradition = tradition_martial_admiration
			if = { 
				limit = { 
					has_dlc_feature = roads_to_power
				}
				add_culture_tradition = tradition_ep3_imperial_tagmata
			}
			else = { 
				add_culture_tradition = tradition_roman_legacy
			}
			change_cultural_acceptance = {
				target = culture:greek
				value = 5
				desc = sclavinia_assimilation
			 }
		}
	}
	option = {
		name = sclavinia.0011.b
		if = { 
			limit = { 
				OR = { 
					has_global_variable = byzantium_conquered_sclavinia_polish_ere 
					has_global_variable = byzantium_conquered_sclavinia_slavic_ere 
				}
			}
			add_prestige = -1000
		}
		culture:polish = { 
			remove_culture_tradition = tradition_esteemed_hospitality   
			if = { 
				limit = { 
					has_dlc_feature = roads_to_power
				}
				add_culture_tradition = tradition_ep3_roman_ceremonies
				add_culture_tradition = tradition_ep3_palace_politics
			}
			else = {
				add_culture_tradition = tradition_byzantine_succession
			}
			change_cultural_acceptance = {
				target = culture:greek
				value = 5
				desc = sclavinia_assimilation
			}
		}
	}
	option = {
		name = sclavinia.0011.c
		if = { 
			limit = { 
				OR = { 
					has_global_variable = byzantium_conquered_sclavinia_polish_ere 
					has_global_variable = byzantium_conquered_sclavinia_slavic_ere 
				}
			}
			add_prestige = -2000
		}
		culture:polish = { 
			remove_culture_tradition = tradition_martial_admiration
			if = { 
				limit = { 
					has_dlc_feature = roads_to_power
				}
				add_culture_tradition = tradition_ep3_imperial_tagmata
			}
			else = { 
				add_culture_tradition = tradition_roman_legacy
			}
			remove_culture_tradition = tradition_esteemed_hospitality  
			if = { 
				limit = { 
					has_dlc_feature = roads_to_power
				}
				add_culture_tradition = tradition_ep3_roman_ceremonies
				add_culture_tradition = tradition_ep3_palace_politics
			}
			else = {
				add_culture_tradition = tradition_byzantine_succession
			}
			change_cultural_acceptance = {
				target = culture:greek
				value = 10
				desc = sclavinia_assimilation
			}
		}		
	}
	option = {
		name = sclavinia.0011.d
		culture:polish = { 
			get_random_innovation_from = culture:greek 
			get_random_innovation_from = culture:greek 
		}
		if = { 
			limit = { has_global_variable = byzantium_conquered_sclavinia_polish_ere }
			culture:pommeranian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:polabian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
		}
		if = { 
			limit = { has_global_variable = byzantium_conquered_sclavinia_slavic_ere }
			culture:pommeranian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:polabian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:czech = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:slovien = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:carantanian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:croatian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:bosnian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:serbian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:bulgarian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
			culture:russian = { 
				get_random_innovation_from = culture:greek 
				get_random_innovation_from = culture:greek 
				change_cultural_acceptance = {
					target = culture:polish
					value = 5
					desc = sclavinia_third_rome_technology
				}
			}
		}
	}
}
sclavinia.0012 = {
	type = character_event
	title = east_europe.0010.t
	desc = east_europe.0010.desc
	theme = realm
	left_portrait = {
		character = scope:slav_uniter
		animation = personality_honorable
	}

	immediate = {
		if = { 
			limit = { 
				has_global_variable = byzantium_conquered_sclavinia_slavic_ere 
				has_culture = culture:polish
			}
			unite_the_slavs_decision_effects_slavic_ere = yes
		}
		else = { 
			unite_the_slavs_decision_effects = yes
		}
		play_music_cue = "mx_cue_epic_sacral_moment"
	}
	
	option = {
		name = east_europe.0010.a
		
		if = {
			limit = { is_female = yes }
			give_nickname = nick_the_polyanitsa
		}
		else = {
			give_nickname = nick_the_bogatyr
		}
	}
}
sclavinia.0013 = {
	type = character_event
	title = sclavinia.0013.t
	desc = sclavinia.0013.desc
	theme = faith
	
	left_portrait = {
		character = root
		animation = personality_callous
	}
	right_portrait = {
		character = scope:pope_sclavinia
		animation = personality_zealous
	}
	lower_left_portrait = { 
		character = scope:france_sclavinia
	}
	lower_center_portrait = { 
		character = scope:italy_sclavinia
	}
	lower_right_portrait = { 
		character = scope:east_francia_sclavinia
	}
	
	immediate = {
		title:k_papal_state = { holder = { save_scope_as = pope_sclavinia } }
		if = { 
			limit = { 
				title:e_hre = { holder = { exists = yes } }
			}
			title:e_hre = { holder = { save_scope_as = east_francia_sclavinia } }
		}
		else_if = { 
			limit = { 
				title:k_east_francia = { holder = { exists = yes } }
			}
			title:k_east_francia = { holder = { save_scope_as = east_francia_sclavinia } }
		}
		if = { 
			limit = { 
				title:k_france = { holder = { exists = yes } }
			}
			title:k_france = { holder = { save_scope_as = france_sclavinia } }
		}
		if = { 
			limit = { 
				title:k_italy = { holder = { exists = yes } }
			}
			title:k_italy = { holder = { save_scope_as = italy_sclavinia } }
		}
	}
	option = {
		name = sclavinia.0013.a
		custom_tooltip = roman_catholic_poland_sclavinia_tooltip
		set_global_variable = {
			name = roman_catholic_poland_sclavinia
			value = yes
		}
	}

}
sclavinia.0014 = {
	type = character_event
	title = sclavinia.0014.t
	desc = sclavinia.0014.desc
	theme = battle
	
	left_portrait = {
		character = root
		animation = personality_vengeful
	}
	right_portrait = {
		character = scope:prusians_sclavonia
		animation = personality_vengeful
	}
	immediate = {
		if = { 
			limit = { 
				title:c_natangia = { 
					holder = { 
						exists = yes 
						NOT = { this = ROOT }
					} 
				}
			}
			title:c_natangia = { holder = { save_scope_as = prusians_sclavonia } }
			set_global_variable = {
				name = roman_catholic_poland_congress_of_gniezno_prussia
				value = yes
			}
		}
		add_legitimacy = 50
	}
	option = {
		name = sclavinia.0014.a
		if = { 
			limit = { 
				has_global_variable = roman_catholic_poland_congress_of_gniezno_prussia
				has_global_variable = roman_catholic_poland_congress_of_gniezno_pope
			}			
			trigger_event = {
				id = sclavinia.0016   
				days = 7
			}
		}
		set_artifact_rarity_illustrious = yes
		create_artifact = {
			name = sclavinia_head_adalbert
			description = sclavinia_head_adalbert_desc
			type = pedestal
			wealth = scope:wealth
			quality = scope:quality
			template = christian_artifact_template
			visuals = head
			history = {
				type = created
				recipient = ROOT
				location = province:2835
			}
			modifier = sclavinia_head_adalbert_modifier
			decaying = no
			save_scope_as = newly_created_artifact
		}
		scope:newly_created_artifact = {
			set_variable = christian_skull
			save_scope_as = epic
		} 
	}
}
sclavinia.0015 = {
	type = character_event
	title = sclavinia.0015.t
	desc = sclavinia.0015.desc
	theme = diplomacy
	
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:pope_sclavinia
		animation = personality_callous
	}                 
	lower_center_portrait = { 
		character = scope:moravia_sclavinia
	}
	immediate = {
		title:k_papal_state = { holder = { save_scope_as = pope_sclavinia } }
		if = { 
			limit = { 
				title:k_moravia = { holder = { exists = yes } }
			}
			title:k_moravia = { holder = { save_scope_as = moravia_sclavinia } }
		}
		else_if = { 
			limit = { 
				title:d_moravia = { holder = { exists = yes } }
			}
			title:d_moravia = { holder = { save_scope_as = moravia_sclavinia } }
		}
		set_global_variable = {
			name = roman_catholic_poland_congress_of_gniezno_pope
			value = yes
		}          
		add_legitimacy = 50
	}
	option = {
		name = sclavinia.0015.a	
		add_character_modifier = {
			modifier = dagome_iudex_character_modifier_sclavinia
			years = 25
		}
		dynasty = { add_dynasty_prestige = 250 }
		house = { 
			add_house_modifier = {
				modifier = dagome_iudex_house_modifier_sclavinia
				years = 25
			}
		}
		if = { 
			limit = { 
				has_global_variable = roman_catholic_poland_congress_of_gniezno_prussia
				has_global_variable = roman_catholic_poland_congress_of_gniezno_pope
			}			
			trigger_event = {
				id = sclavinia.0016  
				days = 7
			}
		}
	}
}
sclavinia.0016 = {
	type = character_event
	title = sclavinia.0016.t
	desc = {
		triggered_desc = {
			trigger = { 
				title:e_hre = { holder = { exists = yes } }
				has_global_variable = roman_catholic_poland_congress_of_gniezno_prussia
				has_global_variable = roman_catholic_poland_congress_of_gniezno_pope				
			}		
			desc = sclavinia.0016.desc.1066
		}
		triggered_desc = {
			trigger = { 
				NOT = { title:e_hre = { holder = { exists = yes } } }   
				has_global_variable = roman_catholic_poland_congress_of_gniezno_prussia
				has_global_variable = roman_catholic_poland_congress_of_gniezno_pope				
			}
			desc = sclavinia.0016.desc.867
		}  
		triggered_desc = {
			trigger = { 
				title:e_hre = { holder = { exists = yes } }
				NOT = { has_global_variable = roman_catholic_poland_congress_of_gniezno_prussia }
				NOT = { has_global_variable = roman_catholic_poland_congress_of_gniezno_pope }
			}		
			desc = sclavinia.0016.desc.1066b
		}
	}
	theme = party
	
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:empire_sclavinia
		animation = debating
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		if = { 
			limit = { title:e_hre = { holder = { exists = yes } } }
			title:e_hre = { holder = { save_scope_as = empire_sclavinia } }
		}
		else = { title:k_papal_state = { holder = { save_scope_as = empire_sclavinia } } }
		if = { 
			limit = { 
				game_start_date > 1000.1.1
			}
			set_artifact_rarity_illustrious = yes
			create_artifact = {
				name = artifact_szczerbiec_name
				description = artifact_szczerbiec_description_sclavinia
				template = general_unique_template
				type = pedestal
				visuals = wall_szczerbiec_sword
				wealth = scope:wealth
				quality = scope:quality
				history = {
					type = created
					recipient = ROOT
					location = title:k_poland.holder.capital_province
				}
				modifier = sclavinia_szczerbiec_modifier
				save_scope_as = newly_created_artifact
				decaying = no
			}

			scope:newly_created_artifact = {
				set_variable = { name = historical_unique_artifact value = yes }
				set_variable = szczerbiec
				save_scope_as = epic
			}
			set_artifact_rarity_illustrious = yes
			create_artifact = {
				name = sclavinia_head_adalbert
				description = sclavinia_head_adalbert_desc
				type = pedestal
				wealth = scope:wealth
				quality = scope:quality
				template = christian_artifact_template
				visuals = head
				history = {
					type = created
					recipient = ROOT
					location = province:2835
				}
				modifier = sclavinia_head_adalbert_modifier
				decaying = no
				save_scope_as = newly_created_artifact2
			}
			scope:newly_created_artifact2 = {
				set_variable = christian_skull
				save_scope_as = epic
			}
		}
		
	}
	option = {
		name = sclavinia.0016.a
		custom_tooltip = empire_unlock_sclavinia_tooltip
		set_global_variable = {
			name = empire_unlock_sclavinia
			value = yes
		}
		if = { limit = { game_start_date < 1000 }
		custom_tooltip = ask_for_innovations_decision_unlock_tooltip }
	}
	option = {
		name = sclavinia.0016.b	
		if = { 
			limit = { title:e_hre = { holder = { exists = yes } } }
			custom_tooltip = roman_catholic_unlock_sclavinia_1066_tooltip
		}
		else = { 
			custom_tooltip = roman_catholic_unlock_sclavinia_867_tooltip
		}
		set_global_variable = {
			name = roman_catholic_unlock_sclavinia
			value = yes
		}
		if = { limit = { game_start_date < 1000 }
		custom_tooltip = ask_for_innovations_decision_unlock_tooltip }
	}
}              
sclavinia.0017 = {
	type = character_event
	title = middle_europe_decisions.0015.t
	desc = sclavinia.0017.desc
	theme = realm
	left_portrait =	{
		character = scope:founder
		animation = personality_bold
	}                
	right_portrait = {
		character = scope:pope_sclavinia
		animation = personality_callous
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"     
		set_global_variable = {
			name = hre_reformed_election_sclavinia
			value = yes
		} 
		set_variable = hre_reformed_election_sclavinia
		restore_holy_roman_empire_decision_sclavinia_scripted_effect = yes
		legend_seed_new_title_effect = yes
		create_artifact_reichskrone_effect = { OWNER = this }
		title:k_papal_state = { holder = { save_scope_as = pope_sclavinia } }
	}

	#Renovatio Imperii!
	option = {
		name = sclavinia.0018.a
		give_nickname = nick_the_great
		add_prestige_experience = monumental_fame_gain
		every_vassal = {
			add_opinion = {
				modifier = reformed_holy_roman_empire_opinion
				target = root
			}
			custom = restore_holy_roman_empire_decision_effects_vassal_opinion.tt
		}
		ai_chance = {	#When taken, the AI should always pick this.
			base = 100
		}
	}
}          
sclavinia.0018 = {
	type = character_event
	title = sclavinia.0018.t
	desc = sclavinia.0018.desc
	theme = realm
	left_portrait =	{
		character = root
		animation = personality_bold
	}                
	right_portrait = {
		character = scope:pope_sclavinia
		animation = personality_callous
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		title:k_papal_state = { holder = { save_scope_as = pope_sclavinia } }
		set_global_variable = {
			name = hre_reformed_election_sclavinia
			value = yes
		}          
		show_as_tooltip = { 
			add_legitimacy = 100
		}
		reform_holy_roman_empire_sclavinia_decision_scripted_effect = yes
	}

	#Renovatio Imperii!
	option = {
		name = sclavinia.0018.a
		give_nickname = nick_the_lawgiver
		add_prestige_experience = monumental_fame_gain
		every_vassal = {
			add_opinion = {
				modifier = reformed_holy_roman_empire_opinion
				target = root
			}
			custom = restore_holy_roman_empire_decision_effects_vassal_opinion.tt
		}
		ai_chance = {	#When taken, the AI should always pick this.
			base = 100
		}
	}
}      
sclavinia.0019 = {
	type = character_event
	title = sclavinia.0019.t
	desc = sclavinia.0019.desc
	theme = claim_throne_scheme
	left_portrait =	{
		character = scope:emperor_sclavinia
		animation = rage
	}                
	right_portrait = {
		character = scope:pope_sclavinia
		animation = personality_vengeful
	}

	immediate = {
		title:k_papal_state = { holder = { save_scope_as = pope_sclavinia } }
		title:e_hre = { holder = { save_scope_as = emperor_sclavinia } }   
		show_as_tooltip = { 
			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
		}
	}

	option = {
		name = sclavinia.0019.a
		title:k_papal_state.holder = { 
			add_opinion = {
				modifier = claimed_my_title_opinion
				target = title:e_hre.holder
				opinion = -100
			}
		}
		title:e_hre.holder = { 
			add_opinion = {
				modifier = claimed_my_title_opinion
				target = title:k_papal_state.holder
				opinion = -100
			}
		}
	}
}
sclavinia.0020 = {
	type = character_event
	title = sclavinia.0020.t
	desc = sclavinia.0020.desc
	theme = war
	left_portrait =	{
		character = scope:emperor_sclavinia
		animation = personality_vengeful
	}                
	right_portrait = {
		character = scope:pope_sclavinia
		animation = rage
	}

	immediate = {
		title:k_papal_state = { holder = { save_scope_as = pope_sclavinia } }
		title:e_hre = { holder = { 
			save_scope_as = emperor_sclavinia 
			add_trait = excommunicated
		} }   
		show_as_tooltip = { 
			custom_tooltip = kingdom_of_italia_established_sclavinia    
		}  
		title:k_papal_state.holder = { 
			start_war = { 
				casus_belli = hre_papal_cb 
				target = title:e_hre.holder
			}
		}
	}

	option = {
		name = sclavinia.0020.a
		
	}
}
sclavinia.0021 = {
	type = character_event
	title = sclavinia.0021.t
	desc = {
		triggered_desc = {
			trigger = {	has_global_variable = empire_unlock_sclavinia }
			desc = sclavinia.0021.desc.pope
		}
		triggered_desc = {
			trigger = {	NOT = { has_global_variable = empire_unlock_sclavinia } }
			desc = sclavinia.0021.desc
		}
	}
	theme = claim_throne_scheme
	left_portrait =	{
		character = scope:emperor_sclavinia
		animation = war_defender
	}                
	right_portrait = {
		character = scope:pope_sclavinia
		animation = war_over_loss
	}

	immediate = { 
		if = { 
			limit = { 
				NOT = { has_global_variable = pope_hre_war_ended_sclavinia }
			}
			if = {
				limit = {
					any_county_in_region = { 
						count <= 63
						region = k_italia_hre  # 70
						target_is_de_facto_liege_or_above = title:e_hre 
					}
					title:e_hre.holder = { has_strong_usable_hook = faith.religious_head }
				}
				title:e_hre.holder = { use_hook = faith.religious_head }
			}
			else_if = { 
				limit = {
					any_county_in_region = { 
						count <= 63
						region = k_italia_hre  # 70
						target_is_de_facto_liege_or_above = title:e_hre 
					}
					has_strong_usable_hook = faith.religious_head
				}
				use_hook = faith.religious_head
			}
			custom_tooltip = kingdom_of_italia_established_sclavinia  
			title:k_papal_state = { set_de_jure_liege_title = title:e_hre }
			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
			} 
			if = { 
				limit = { NOT = { title:k_papal_state.holder = { is_close_or_extended_family_of = title:e_hre.holder } } }
				title:e_hre.holder = {
					if = {
						limit = { 
							any_close_family_member = { 
								count > 0
								filter = { 
									house = { this = title:e_hre.holder.house }
									is_landed = no 
									is_male = yes
									is_adult = yes
									is_imprisoned = no
									NOT = { 
										any_sub_realm_title = {
											place_in_line_of_succession = {
												target = prev
												value <= 1
											}
										}
									}
								}
							}
						}
						random_close_family_member = {
							limit = { 
								house = { this = title:e_hre.holder.house }
								is_landed = no 
								is_male = yes
								is_adult = yes 
								is_imprisoned = no
								NOT = { 
									any_sub_realm_title = {
										place_in_line_of_succession = {
											target = prev
											value <= 1
										}
									}
								}
							}
							save_scope_as = new_pope_sclavinia
							create_title_and_vassal_change = {
								type = usurped
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							show_as_tooltip = {
								title:k_papal_state = {
									change_title_holder = {
										holder = scope:new_pope_sclavinia
										change = scope:change_title
									}
								}
							}
							hidden_effect = {
								title:k_papal_state.holder = {
									every_held_title = { 
										change_title_holder = {
											holder = scope:new_pope_sclavinia
											change = scope:change_title
										}
									}
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}	
					}
					else_if = {
						limit = { 
							any_close_or_extended_family_member = { 
								count > 0
								filter = { 
									house = { this = title:e_hre.holder.house }
									is_landed = no 
									is_male = yes
									is_adult = yes 
									is_imprisoned = no
									NOT = { 
										any_sub_realm_title = {
											place_in_line_of_succession = {
												target = prev
												value <= 1
											}
										}
									}
								}
							}
						}
						random_close_or_extended_family_member = {
							limit = { 
								house = { this = title:e_hre.holder.house }
								is_landed = no 
								is_male = yes
								is_adult = yes
								is_imprisoned = no
								NOT = { 
									any_sub_realm_title = {
										place_in_line_of_succession = {
											target = prev
											value <= 1
										}
									}
								}
							}
							save_scope_as = new_pope_sclavinia
							create_title_and_vassal_change = {
								type = usurped
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							show_as_tooltip = {
								title:k_papal_state = {
									change_title_holder = {
										holder = scope:new_pope_sclavinia
										change = scope:change_title
									}
								}
							}
							hidden_effect = {
								title:k_papal_state.holder = {
									every_held_title = { 
										change_title_holder = {
											holder = scope:new_pope_sclavinia
											change = scope:change_title
										}
									}
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}	
					}
					else = { 
						show_as_tooltip = { title:k_papal_state.holder = { depose_effect = { DEPOSER = title:e_hre.holder }	} }
						random_living_character = {
							limit = { 
								is_landed = no 
								is_male = yes
								is_adult = yes 
								is_imprisoned = no
								has_same_culture_as = title:e_hre.holder
								NOT = { 
									any_sub_realm_title = {
										place_in_line_of_succession = {
											target = prev
											value <= 1
										}
									}
								}
							}
							save_scope_as = new_pope_sclavinia
							create_title_and_vassal_change = {
								type = usurped
								save_scope_as = change_title
								add_claim_on_loss = no
							}
							hidden_effect = {
								title:k_papal_state.holder = {
									every_held_title = { 
										change_title_holder = {
											holder = scope:new_pope_sclavinia
											change = scope:change_title
										}
									}
								}
							}
							resolve_title_and_vassal_change = scope:change_title
						}
					}
				}
			}
			hidden_effect = { 
				title:e_hre.holder = {
					add_hook_no_toast  = { 
						type = strong_influence_hook 
						target = title:k_papal_state.holder
					}
				}
			}
		}
		else = { 
			show_as_tooltip = {	
				scope:deposed_pope_sclavinia = { depose_effect = { DEPOSER = title:e_hre.holder } }
				title:k_papal_state = { set_de_jure_liege_title = title:e_hre }
				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
				} 
				create_title_and_vassal_change = {
					type = usurped
					save_scope_as = change_title
					add_claim_on_loss = no
				}
				show_as_tooltip = {
					title:k_papal_state = {
						change_title_holder = {
							holder = scope:new_pope_sclavinia
							change = scope:change_title
						}
					}
				}
				hidden_effect = {
					title:k_papal_state.holder = {
						every_held_title = { 
							change_title_holder = {
								holder = scope:new_pope_sclavinia
								change = scope:change_title
							}
						}
					}
				}
				resolve_title_and_vassal_change = scope:change_title	
				title:e_hre.holder = { remove_trait_force_tooltip = excommunicated }
				if = { 
					limit = { 
						exists = scope:papal_wife_sclavinia
					}
					scope:papal_wife_sclavinia = {
						add_trait_force_tooltip = devoted
						add_piety_level = 1
						divorce = scope:new_pope_sclavinia
					}
				}
			}
		}
		title:k_papal_state = { holder = { save_scope_as = pope_sclavinia } }
		title:e_hre = { holder = { save_scope_as = emperor_sclavinia } }     
		if = { 
			limit = { title:k_papal_state.holder = { has_title = title:k_romagna } }
			title:k_papal_state.holder = { hidden_effect = { destroy_title = title:k_romagna } }
		} 
		set_global_variable = {
			name = pope_hre_war_ended_sclavinia
			value = yes
		}
		custom_tooltip = hook_over_pope_sclavinia
		title:e_hre.holder = { add_legitimacy = 350 }
		faith:catholic = {
			change_fervor = {
				value = -33
				desc = vassalization_cb_victory_desc_sclavinia
			}
		} 
		faith:catholic = { 
			hidden_effect = { remove_doctrine = doctrine_clerical_succession_spiritual_fixed_appointment
			remove_doctrine = doctrine_pluralism_righteous }
			add_doctrine = doctrine_clerical_succession_temporal_appointment
			add_doctrine = doctrine_pluralism_fundamentalist
		}
		custom_tooltip = papacy_transfer_italia
		hidden_effect = {
			title:e_hre.holder = { 
				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 } } }					
						}
						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
					}
				}
			}
		}
	}

	option = {
		name = sclavinia.0021.a            
		custom_tooltip = provinces_in_new_update
		title:e_hre = { 
			set_title_name = imperium_universalis
		}
		custom_tooltip = set_title_name_imperium_universalis  
		set_global_variable = {
			name = universal_princely_elective_succession_law_sclavinia
			value = yes
		} 
		set_variable = universal_princely_elective_succession_law_sclavinia
		title:e_hre = { 
			add_title_law = universal_princely_elective_succession_law
		}              
		hidden_effect = { title:k_italy = { set_capital_county = title:c_roma } }
	}
	option = {
		name = sclavinia.0021.b
		trigger = { has_title = title:e_hre }
		show_as_unavailable = { always = yes }      
		title:e_hre = { 
			set_title_name = imperium_universalis
		}
		custom_tooltip = set_title_name_imperium_universalis 
		if = { 
			limit = { title:e_hre.holder = { NOT = { has_title = title:c_roma } } }
			create_title_and_vassal_change = {
				type = returned
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:c_roma = {
				change_title_holder = {
					holder = title:e_hre.holder
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
		}
		hidden_effect = { title:e_hre = { remove_title_law = destabilized_princely_elective_succession_law } }
		hidden_effect = { title:e_hre = { remove_title_law = reformed_princely_elective_succession_law } }
		title:e_hre.holder = { 
			add_realm_law = single_heir_succession_law 
			set_realm_capital = title:c_roma
		}
		title:e_hre = { set_capital_county = title:c_roma }         
		custom_tooltip = set_capital_county_title_c_roma
		set_global_variable = {
			name = imperator_imperium_universalis
			value = yes
		}
	}
	option = {
		name = sclavinia.0021.c
		custom_tooltip = slavic_imperial_kingdoms_tooltip
		trigger = { has_title = title:e_hre }
		show_as_unavailable = { always = yes }     
		title:e_hre = { 
			set_title_name = sclavinia_imperium_universalis
			set_coa = e_hre_sclavinia_holy
			custom_tooltip = set_coa_e_hre_sclavinia
		}
		custom_tooltip = set_title_name_sclavinia_imperium_universalis
		hidden_effect = { title:e_hre = { remove_title_law = destabilized_princely_elective_succession_law } }
		hidden_effect = { title:e_hre = { remove_title_law = reformed_princely_elective_succession_law } }
		title:e_hre.holder = { add_realm_law = single_heir_succession_law }
		hidden_effect = { 
			title:e_hre = { set_capital_county = title:k_poland.title_capital_county } 
			#title:h_roman_empire = { set_capital_county = title:k_poland.title_capital_county } 
			title:k_italy = { set_capital_county = title:c_roma }
		}
		set_global_variable = {
			name = sclavinia_imperium_universalis
			value = yes
		}	
	}
}
sclavinia.0022 = {
	type = character_event
	title = sclavinia.0022.t
	desc = {
		triggered_desc = {
			trigger = { 
				NOT = { has_global_variable = imperator_imperium_universalis }
				NOT = { has_global_variable = sclavinia_imperium_universalis }
			}
			desc = sclavinia.0022.desc.a
		}
		triggered_desc = {
			trigger = {
				OR = { 
					has_global_variable = imperator_imperium_universalis 
					has_global_variable = sclavinia_imperium_universalis
				}
			}
			desc = sclavinia.0022.desc.b
		}
	}
	theme = realm
	left_portrait = {
		character = scope:scoped_emperor
		animation = personality_honorable
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		save_scope_as = scoped_emperor
		create_roman_empire_sclavinia_scripted_effect = yes
		if = { 
			limit = { has_global_variable = universal_princely_elective_succession_law_sclavinia }
			title:h_roman_empire = { add_title_law = universal_princely_elective_succession_law }
		}
		if = {	#Add Salic law.
			limit = {
				root = {
					OR = {
						has_realm_law = male_preference_law
						has_realm_law = male_only_law
					}
				}
			}
			title:h_roman_empire = { add_title_law = male_only_law }
		}
		if = {	#Ignore Salic law.
			limit = {
				root = { has_realm_law = equal_law }
			}
			title:h_roman_empire = { add_title_law = equal_law }
		}
		if = {	#Invert Salic law. Take that, Clovis, y'big nerd.
			limit = {
				root = {
					OR = {
						has_realm_law = female_preference_law
						has_realm_law = female_only_law
					}
				}
			}
			title:h_roman_empire = { add_title_law = female_only_law }
		}
	}

	option = {
		name = sclavinia.0022.a
		trigger = { 
			NOT = { has_global_variable = imperator_imperium_universalis }
			NOT = { has_global_variable = sclavinia_imperium_universalis }
		}
		set_nickname_effect = { NICKNAME = nick_the_glorious }
		# Send narrative fluff to other players (if any).
		every_player = {
			limit = {
				NOT = { this = root }
				is_within_diplo_range = { CHARACTER = root }
			}
			trigger_event = roman_restoration.0004
		}
	}
	option = {
		name = sclavinia.0022.b
		trigger = { 
			has_global_variable = imperator_imperium_universalis
		}
		set_nickname_effect = { NICKNAME = nick_the_glorious }
		# Send narrative fluff to other players (if any).
		every_player = {
			limit = {
				NOT = { this = root }
				is_within_diplo_range = { CHARACTER = root }
			}
			trigger_event = roman_restoration.0004
		}
	}
	option = {
		name = sclavinia.0022.c
		trigger = { 
			has_global_variable = sclavinia_imperium_universalis
		}
		set_nickname_effect = { NICKNAME = nick_the_glorious }
		# Send narrative fluff to other players (if any).
		every_player = {
			limit = {
				NOT = { this = root }
				is_within_diplo_range = { CHARACTER = root }
			}
			trigger_event = roman_restoration.0004
		}
	}
}
###
sclavinia.9989 = {
	hidden = yes
	trigger = {
		has_title = title:k_poland 
		has_global_variable = kingdom_of_ruthenia_established_sclavinia
		NOT = { has_variable = kingdom_of_ruthenia_established_sclavinia }
	}
	immediate = { 
		set_variable = kingdom_of_ruthenia_established_sclavinia
	}
}
sclavinia.9990 = {
	hidden = yes
	trigger = {
		has_title = title:k_poland 
		has_global_variable = kingdom_of_sclavonia_established_sclavinia
		NOT = { has_variable = kingdom_of_sclavonia_established_sclavinia }
	}
	immediate = { 
		set_variable = kingdom_of_sclavonia_established_sclavinia
	}
}
sclavinia.9991 = {
	hidden = yes
	trigger = {
		has_title = title:k_poland 
		has_global_variable = hre_reformed_election_sclavinia
		NOT = { has_variable = hre_reformed_election_sclavinia }
	}
	immediate = { 
		set_variable = hre_reformed_election_sclavinia
	}
}
sclavinia.9992 = {
	hidden = yes
	trigger = {
		has_title = title:k_poland 
		has_global_variable = universal_princely_elective_succession_law_sclavinia
		NOT = { has_variable = universal_princely_elective_succession_law_sclavinia }
	}
	immediate = { 
		set_variable = universal_princely_elective_succession_law_sclavinia
	}
}
sclavinia.9993 = {
	hidden = yes
	trigger = {
		trigger_if = { 
			limit = { exists = title:e_hre.holder }
		}
		trigger_else = { 
			has_title = title:h_roman_empire			
		}
		OR = {
			has_global_variable = kingdom_of_gallia_established_sclavinia
			has_global_variable = kingdom_of_germania_established_sclavinia
			has_global_variable = kingdom_of_italia_established_sclavinia
			has_global_variable = kingdom_of_hispania_established_sclavinia
			has_global_variable = kingdom_of_britannia_established_sclavinia
			has_global_variable = kingdom_of_dacia_established_sclavinia
			has_global_variable = kingdom_of_africa_established_sclavinia
			has_global_variable = kingdom_of_hierosolyma_established_sclavinia
			has_global_variable = kingdom_of_graecia_established_sclavinia
			has_global_variable = kingdom_of_sclavonia_established_sclavinia
			has_global_variable = kingdom_of_normannia_established_sclavinia
		}
	}
	immediate = { 
		if = { 
			limit = { has_global_variable = kingdom_of_gallia_established_sclavinia }
			if = { 
				limit = { title:k_burgundy = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_burgundy
			}
			if = { 
				limit = { title:k_aquitaine = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_aquitaine
			}
			if = { 
				limit = { title:k_brittany = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_brittany
			}
		}
		if = { 
			limit = { has_global_variable = kingdom_of_germania_established_sclavinia }
			if = { 
				limit = { title:k_bavaria = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_bavaria
			}
			if = { 
				limit = { title:k_lotharingia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_lotharingia
			}
			if = { 
				limit = { title:k_frisia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_frisia
			}
			if = { 
				limit = { title:k_saxony = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_saxony
			}
		}
		if = { 
			limit = { has_global_variable = kingdom_of_italia_established_sclavinia }
			if = { 
				limit = { title:k_genoa = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_genoa
			}
			if = { 
				limit = { title:k_pisa = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_pisa
			}
			if = { 
				limit = { title:k_naples = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_naples
			}
			if = { 
				limit = { title:k_sardinia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_sardinia
			}
			if = { 
				limit = { title:k_romagna = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_romagna
			}
			if = { 
				limit = { title:k_sicily = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_sicily
			}
		}
		if = { 
			limit = { has_global_variable = kingdom_of_hispania_established_sclavinia }
			if = { 
				limit = { title:k_andalusia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_andalusia
			}
			if = { 
				limit = { title:k_badajoz = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_badajoz
			}
			if = { 
				limit = { title:k_valencia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_valencia
			}
			if = { 
				limit = { title:k_asturias = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_asturias
			}
			if = { 
				limit = { title:k_aragon = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_aragon
			}
			if = { 
				limit = { title:k_navarra = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_navarra
			}
			if = { 
				limit = { title:k_leon = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_leon
			}
			if = { 
				limit = { title:k_spanish_galicia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_spanish_galicia
			}
			if = { 
				limit = { title:k_portugal = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_portugal
			}
		}
		if = { 
			limit = { has_global_variable = kingdom_of_britannia_established_sclavinia }
			if = { 
				limit = { title:k_wales = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_wales
			}
			if = { 
				limit = { title:k_scotland = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_scotland
			}
			if = { 
				limit = { title:k_ireland = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_ireland
			}
			if = { 
				limit = { title:k_castille = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_castille
			}
			if = { 
				limit = { title:k_cornwall = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_cornwall
			}
			if = { 
				limit = { title:k_mann_the_isles = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_mann_the_isles
			}
			if = { 
				limit = { title:k_brittany = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_brittany
			}
			if = { 
				limit = { title:k_danelaw = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_danelaw
			}
			if = { 
				limit = { title:k_daneland = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_daneland
			}
		}
		if = { 
			limit = { has_global_variable = kingdom_of_dacia_established_sclavinia }
			if = { 
				limit = { title:k_dacia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_dacia
			}
			if = { 
				limit = { title:k_moldavia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_moldavia
			}
		} 
		if = { 
			limit = { has_global_variable = kingdom_of_africa_established_sclavinia }
			if = { 
				limit = { title:k_maghreb = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_maghreb
			}
			if = { 
				limit = { title:k_tahert = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_tahert
			}
			if = { 
				limit = { title:k_egypt = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_egypt
			}
			if = { 
				limit = { title:k_canarias = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_canarias
			}
		} 
		if = { 
			limit = { has_global_variable = kingdom_of_hierosolyma_established_sclavinia }
			if = { 
				limit = { title:k_syria = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_syria
			}
			if = { 
				limit = { title:k_jazira = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_jazira
			}
		} 
		if = { 
			limit = { has_global_variable = kingdom_of_graecia_established_sclavinia }
			if = { 
				limit = { title:k_epirus = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_epirus
			}
			if = { 
				limit = { title:k_hellas = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_hellas
			}
			if = { 
				limit = { title:k_krete = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_krete
			}
			if = { 
				limit = { title:k_cyprus = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_cyprus
			}
			if = { 
				limit = { title:k_nikaea = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_nikaea
			}
			if = { 
				limit = { title:k_anatolia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_anatolia
			}
			if = { 
				limit = { title:k_pontus = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_pontus
			}
			if = { 
				limit = { title:k_armenia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_armenia
			}
			if = { 
				limit = { title:k_georgia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_georgia
			}
		} 
		if = { 
			limit = { has_global_variable = kingdom_of_sclavonia_established_sclavinia }
			if = { 
				limit = { title:k_bosnia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_bosnia
			}
			if = { 
				limit = { title:k_serbia = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_serbia
			}
			if = { 
				limit = { title:k_bulgaria = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_bulgaria
			}
		} 
		if = { 
			limit = { has_global_variable = kingdom_of_normannia_established_sclavinia }
			if = { 
				limit = { title:k_norway = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_norway
			}
			if = { 
				limit = { title:k_sweden = { is_title_created = yes OR = { target_is_de_facto_liege_or_above = title:e_hre target_is_de_facto_liege_or_above = title:h_roman_empire } } }
				destroy_title = title:k_sweden
			}
		}
	}
}
sclavinia.9994 = {
	hidden = yes
	trigger = {
		has_title = title:k_papal_state 
		has_global_variable = pope_hre_war_ended_sclavinia
		NOT = { title:e_hre.holder = { has_strong_hook = title:k_papal_state.holder } }
	}
	immediate = { 
		title:e_hre.holder = {
			add_hook_no_toast  = { 
				type = strong_influence_hook 
				target = title:k_papal_state.holder
			}
		}
	}
}
sclavinia.9995 = {
	hidden = yes
	trigger = {
		NOT = { title:k_papal_state.holder = { has_opinion_modifier = { target = title:e_hre.holder modifier = claimed_my_title_opinion } } }
		has_title = title:k_papal_state 
		has_global_variable = war_with_pope_sclavinia
		NOT = { has_global_variable = kingdom_of_italia_established_sclavinia }
	}
	immediate = {   
		title:k_papal_state.holder = { 
			add_opinion = {
				modifier = claimed_my_title_opinion
				target = title:e_hre.holder
				opinion = -100
			}
		}
		title:e_hre.holder = { 
			add_opinion = {
				modifier = claimed_my_title_opinion
				target = title:k_papal_state.holder
				opinion = -100
			}
		}
	}
}
sclavinia.9996 = {
	hidden = yes
	trigger = {
		has_title = title:e_byzantium
		has_culture = culture:polish 
		OR = { 
			has_global_variable = byzantium_conquered_sclavinia_polish_ere
			has_global_variable = byzantium_conquered_sclavinia_slavic_ere
		}
	}
	immediate = {
		add_character_modifier = sclavinia_third_rome_character_modifier
		if = { 
			limit = { has_global_variable = byzantium_conquered_sclavinia_polish_ere }
			every_county = { 
				limit = { 
					OR = { 
						holder = { is_vassal_or_below_of = ROOT }
						holder = { this = ROOT }
					}
					OR = { 
						culture = { this = culture:polish }
						culture = { this = culture:pommeranian }
						culture = { this = culture:polabian }
					}
				}
				add_county_modifier = sclavinia_sklabonia_positive_modifier
			}
			title:k_poland.title_capital_county = { 
				remove_county_modifier = sclavinia_sklabonia_positive_modifier
			}
		}
		else = { 
			every_county = { 
				limit = { 
					OR = { 
						holder = { is_vassal_or_below_of = ROOT }
						holder = { this = ROOT }
					}
					OR = { 
						culture = { this = culture:polish }
						culture = { this = culture:pommeranian }
						culture = { this = culture:polabian }
						culture = { this = culture:czech }
						culture = { this = culture:slovien }
						culture = { this = culture:carantanian }
						culture = { this = culture:croatian }
						culture = { this = culture:bosnian }
						culture = { this = culture:serbian }
						culture = { this = culture:bulgarian }
						culture = { this = culture:russian }
					}
				}
				add_county_modifier = sclavinia_sklabonia_positive_modifier_slavic
			}
			title:k_poland.title_capital_county = { 
				remove_county_modifier = sclavinia_sklabonia_positive_modifier_slavic
			}
		}
		every_county = { 
			limit = { 
				OR = { 
					holder = { is_vassal_or_below_of = ROOT }
					holder = { this = ROOT }
				}
				culture = { this = culture:greek }
			}
			add_county_modifier = sclavinia_sklabonia_negative_modifier
		}
	}
}
sclavinia.9997 = {
	hidden = yes
	trigger = {
		NOT = { target_is_liege_or_above = title:e_byzantium.holder }
		NOT = { has_title = title:e_byzantium }
		NOT = { has_culture = culture:polish }
		OR = { 
			has_global_variable = byzantium_conquered_sclavinia_polish_ere
			has_global_variable = byzantium_conquered_sclavinia_slavic_ere
		}
	}
	immediate = {
		if = { 
			limit = { has_global_variable = byzantium_conquered_sclavinia_polish_ere }
			every_county = { 
				limit = { 
					OR = { 
						holder = { is_vassal_or_below_of = ROOT }
						holder = { this = ROOT }
					}
					OR = { 
						culture = { this = culture:polish }
						culture = { this = culture:pommeranian }
						culture = { this = culture:polabian }
					}
				}
				remove_county_modifier = sclavinia_sklabonia_positive_modifier
			}
		}
		else = { 
			every_county = { 
				limit = { 
					OR = { 
						holder = { is_vassal_or_below_of = ROOT }
						holder = { this = ROOT }
					}
					OR = { 
						culture = { this = culture:polish }
						culture = { this = culture:pommeranian }
						culture = { this = culture:polabian }
						culture = { this = culture:pommeranian }
						culture = { this = culture:polabian }
						culture = { this = culture:czech }
						culture = { this = culture:slovien }
						culture = { this = culture:carantanian }
						culture = { this = culture:croatian }
						culture = { this = culture:bosnian }
						culture = { this = culture:serbian }
						culture = { this = culture:bulgarian }
						culture = { this = culture:russian }
					}
				}
				remove_county_modifier = sclavinia_sklabonia_positive_modifier_slavic
			}
		}
		every_county = { 
			limit = { 
				OR = { 
					holder = { is_vassal_or_below_of = ROOT }
					holder = { this = ROOT }
				}
				culture = { this = culture:greek }
			}
			remove_county_modifier = sclavinia_sklabonia_negative_modifier
		}
	}
}
sclavinia.9998 = {
	hidden = yes
	trigger = {
		OR = { 
			has_government = feudal_government
			has_government = administrative_government
		}
		dynasty.dynast = root
		OR = {
			AND = { 
				NOT = { has_global_variable = ledzianski_renamed_sclavinia }
				dynasty = { this = dynasty:2001004 } 
			}
			AND = { 
				NOT = { has_global_variable = mazowiecki_renamed_sclavinia }
				dynasty = { this = dynasty:2001006 }  
			}
			AND = { 
				NOT = { has_global_variable = sandomierski_renamed_sclavinia }
				dynasty = { this = dynasty:2001005 } 
			}
			AND = { 
				NOT = { has_global_variable = wislanski_renamed_sclavinia } 
				dynasty = { this = dynasty:2001003 } 
			}
			AND = { 
				NOT = { has_global_variable = goplanski_renamed_sclavinia } 
				dynasty = { this = dynasty:2001007 } 
			}
			AND = { 
				NOT = { has_global_variable = leczycki_renamed_sclavinia } 
				dynasty = { this = dynasty:2001008 } 
			}
			AND = { 
				NOT = { has_global_variable = slaski_renamed_sclavinia } 
				dynasty = { this = dynasty:9127 }  
			}
			AND = { 
				NOT = { has_global_variable = piast_renamed_sclavinia }
				NOT = { has_global_variable = polanski_renamed_sclavinia }
				dynasty = { this = dynasty:699 }  
			}
			AND = { 
				NOT = { has_global_variable = kaszubski_renamed_sclavinia }
				dynasty = { this = dynasty:2001009 } 
			}
			AND = { 
				NOT = { has_global_variable = slowinski_renamed_sclavinia } 
				dynasty = { this = dynasty:2001010 } 
			}
			AND = { 
				NOT = { has_global_variable = wolinski_renamed_sclavinia } 
				dynasty = { this = dynasty:2001011 } 
			}
			AND = { 
				NOT = { has_global_variable = pyrzycki_renamed_sclavinia } 
				dynasty = { this = dynasty:2001012 } 
			}
			AND = { 
				NOT = { has_global_variable = lubuski_renamed_sclavinia } 
				dynasty = { this = dynasty:2001015 } 
			}
			AND = { 
				NOT = { has_global_variable = milczanski_renamed_sclavinia } 
				dynasty = { this = dynasty:1042804 } 
			}
			AND = { 
				NOT = { has_global_variable = luzycki_renamed_sclavinia } 
				dynasty = { this = dynasty:1042806 } 
			}
			AND = { 
				NOT = { has_global_variable = redarski_renamed_sclavinia } 
				dynasty = { this = dynasty:2001323 } 
			}
			AND = { 
				NOT = { has_global_variable = hawelski_renamed_sclavinia } 	
				dynasty = { this = dynasty:9605 } 	 
			}
			AND = { 
				NOT = { has_global_variable = wielecki_renamed_sclavinia }
				dynasty = { this = dynasty:2001013 } 
			}
			AND = { 
				NOT = { has_global_variable = ranowski_renamed_sclavinia } 	
				dynasty = { this = dynasty:2001014 } 
			}
			AND = { 
				NOT = { has_global_variable = obodrycki_renamed_sclavinia } 	
				dynasty = { this = dynasty:1042800 } 
			}
			AND = { 
				NOT = { has_global_variable = sprewanski_renamed_sclavinia } 	
				dynasty = { this = dynasty:9607 } 	 
			}
			AND = { 
				NOT = { has_global_variable = glubczycki_renamed_sclavinia }
				dynasty = { this = dynasty:9129 } 	 
			}
			AND = { 
				NOT = { has_global_variable = opolski_renamed_sclavinia }
				dynasty = { this = dynasty:9128 }
			}
		}
	}
	immediate = {
		lechits_getting_feudal_sclavinia_effect = yes
	}
}
sclavinia.9999 = {
	type = character_event
	title = sclavinia.9999.t
	desc = sclavinia.9999.desc
	theme = learning
	
	right_portrait = {
		character = scope:changelog_sclavinia
		animation = chancellor
		hide_info = yes
	}
	left_portrait = {
		character = root
		animation = boredom
		hide_info = yes
	}
	trigger = {
		NOT = { has_global_variable = changelog132_sclavinia }
		is_ai = no
	}
	immediate = { 
		title:k_papal_state = { holder = { save_scope_as = changelog_sclavinia } }
		set_global_variable = {
			name = changelog132_sclavinia
			value = yes
		}	
		#every_county_in_region = {
		#	region = polska_sclavinia
		#	create_title_and_vassal_change = {
		#		type = granted
		#		save_scope_as = title_change
		#		add_claim_on_loss = no
		#	}
		#	change_title_holder = {
		#		holder = title:k_poland.holder
		#		change = scope:title_change
		#	}  
		#	resolve_title_and_vassal_change = scope:title_change
		#}
	}
	option = {
		name = sclavinia.9999.a		
	}
}