UB_spawn_historical_characters_effect = {

	if = { Vitus of Kotor
		limit = {
			current_year >= 1067
			current_year <= 1070
			NOT = { exists = global_var:hchar_vituskotor }
		}
		set_global_variable = { name = hchar_vituskotor value = yes }
		title:b_cattaro = {
			save_scope_as = birth_location
			create_character = {
				age = 20
				name = Vita
				gender_female_chance = 0
				random_traits = no
				location = scope:birth_location.title_province
				faith = faith:catholic
				culture = scope:birth_location.title_province.culture
				trait = education_education_3
				trait = devoted
				trait = architect
				random_traits_list = {
					count = 3
					zealous = {}
					diligent = {}
					honest = {}
				}
				diplomacy = { min_template_high_skill max_template_high_skill }
				martial = { min_template_high_skill max_template_high_skill }
				stewardship = { min_template_decent_skill max_template_decent_skill }
				intrigue = { min_template_decent_skill max_template_decent_skill }
				learning = { min_template_low_skill max_template_low_skill }
				prowess = { min_template_high_skill max_template_high_skill }
				save_scope_as = historical_character
			}
			scope:historical_character ?= {
				UB_historical_character_finalization_effect = yes
				set_variable = vituskotor
				add_character_flag = ai_will_not_convert
			}
			if = { limit = { has_variable = vituskotor 	 } } # Error suppression
			spawn_historical_characters_boilerplate_effect = yes
		}
	}
}