create_artifact_excalibur_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	# Not really used, but if we don't set the scopes we get errors in the feature selection
	set_artifact_rarity_common = yes

	# Create the artifact
	create_artifact = {
		name = excalibur_name
		description = excalibur_description
		type = pedestal
		visuals = excalibur
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = excalibur_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = excalibur
		save_scope_as = epic
	}
}

create_artifact_crown_wenceslas_effect = { # Crown of Saint Wenceslas
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	# Not really used, but if we don't set the scopes we get errors in the feature selection
	set_artifact_rarity_famed = yes

	# Create the artifact
	create_artifact = {
		name = crown_wenceslas_name
		description = crown_wenceslas_description
		modifier = crown_wenceslas_modifier
		template = crown_iron_template
		type = pedestal
		visuals = crown_court
		wealth = scope:wealth
		quality = scope:quality
		decaying = no
		save_scope_as = newly_created_artifact
		history = {
			type = created_before_history
			date = 1346.1.1
			location = province:4125 #Praha
		}
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = crown_wenceslas
		save_scope_as = epic
		add_artifact_history = {
			type = given
			date = 2521.4.3
			recipient = character:zapadoslavia0003 # Dalibor Karlovec
		}
		add_artifact_history = {
			type = given
			date = 2546.4.11
			recipient = character:zapadoslavia0001 # Bedrich Karlovec
		}
		add_artifact_history = {
			type = stolen
			date = 2552.4.12
			recipient = character:zapadoslavia0002 # Bedrich Karlovec
		}
	}
}

create_artifact_sword_wenceslas_effect = { # Ceremonial Czech Sword
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_famed = yes

	create_artifact = {
		name = sword_wenceslas_name
		description = sword_wenceslas_description
		modifier = sword_wenceslas_modifier
		template = sword_wenceslas_template
		type = pedestal
		visuals = sword_wenceslas
		wealth = scope:wealth
		quality = scope:quality
		decaying = no
		save_scope_as = newly_created_artifact
		history = {
			type = created_before_history
			date = 950.1.1
			location = province:4125 #Praha
		}
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = sword_wenceslas
		save_scope_as = epic
		add_artifact_history = {
			type = given
			date = 2521.4.3
			recipient = character:zapadoslavia0003 # Dalibor Karlovec
		}
		add_artifact_history = {
			type = given
			date = 2546.4.11
			recipient = character:zapadoslavia0001 # Bedrich Karlovec
		}
	}
}

create_artifact_codex_gigas_effect = { # Codex Gigas - largest medieval manuscript
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	create_artifact = {
		name = codex_gigas_name
		description = codex_gigas_description
		modifier = codex_gigas_modifier
		template = codex_template
		type = chronicle
		visuals = chronicle
		wealth = scope:wealth
		quality = scope:quality
		decaying = no
		save_scope_as = newly_created_artifact
		history = {
			type = created_before_history
			date = 1215.1.1
			location = province:4160 #Pardubice
		}
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = codex_gigas
		save_scope_as = epic
	}
}