﻿namespace = wendia_culture


scripted_trigger east_german_culture_shift_trigger = {
	tier = tier_county
	exists = holder
	title_province = {
		geographical_region = ce_custom_wendia_germania
	}
	NOT = { exists = var:had_east_german_county_conversion }
	exists = var:had_german_settlement
	culture = {
		NOT = { has_cultural_pillar = heritage_central_germanic }
		OR = {
			has_cultural_pillar = heritage_baltic
			has_cultural_pillar = heritage_west_slavic
		}
	}
}

wendia_culture.0001 = {
	scope = none
	hidden = yes
	
	trigger = {
		OR = {
			culture = { has_cultural_pillar = heritage_central_germanic }
			culture = { has_cultural_pillar = heritage_central_germanic }
		}
		any_held_title = {
			east_german_culture_shift_trigger = yes
		}
	}

	immediate = {
		random_held_title = {
			limit = { 
				east_german_culture_shift_trigger = yes 
			}
			set_variable = {
				name = had_east_german_county_conversion
				value = yes
			}
			if = {
				limit = {
					title_province = {	
						geographical_region = ce_custom_pomoria
					}
				}
				set_county_culture = culture:pomeranian
				set_county_faith = faith:catholic
			}
			else_if = {
				limit = {
					title_province = {	
						geographical_region = ce_custom_margravia
					}
				}
				set_county_culture = culture:markish
				set_county_faith = faith:catholic
			}
			else_if = {
				limit = {
					title_province = {	
						geographical_region = ce_custom_estphalia_saxonia
					}
				}
				set_county_culture = culture:saxon
				set_county_faith = faith:catholic
			}
			else_if = {
				limit = {
					title_province = {	
						geographical_region = ce_custom_upper_saxonia
					}
				}
				set_county_culture = culture:meissener
				set_county_faith = faith:catholic
			}
			else_if = {
				limit = {
					title_province = {	
						geographical_region = ce_custom_german_silesia
					}
				}
				set_county_culture = culture:lausitzian
				set_county_faith = faith:catholic
			}
		}
	}

}
