﻿# Historical Artifacts Creation #

set_artifact_rarity_common = {
	save_scope_value_as = {
		name = quality
		value = 15
	}
	save_scope_value_as = {
		name = wealth
		value = 15
	}
}

set_artifact_rarity_masterwork = {
	save_scope_value_as = {
		name = quality
		value = 30
	}
	save_scope_value_as = {
		name = wealth
		value = 30
	}
}

set_artifact_rarity_famed = {
	save_scope_value_as = {
		name = quality
		value = 70
	}
	save_scope_value_as = {
		name = wealth
		value = 70
	}
}

set_artifact_rarity_illustrious = {
	save_scope_value_as = {
		name = quality
		value = 100
	}
	save_scope_value_as = {
		name = wealth
		value = 100
	}
}

create_artifact_pedestal_christian_relic_effect_hist = {
	# 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
	get_artifact_quality_effect = yes
	get_artifact_wealth_effect = yes

	# Identify which relic it is
	random_list = {
		10 = {
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:nail
			}
		}
		10 = {
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:thorn
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = christian_sandals
					}
				}
			}
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:sandals
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = christian_girdle
					}
				}
			}
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:girdle
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = christian_lance
					}
				}
			}
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:lance
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						count > 5
						has_variable = christian_skull
					}
				}
			}
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:skull
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						count > 5
						has_variable = christian_arm
					}
				}
			}
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:arm
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = christian_loincloth
					}
				}
			}
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:loincloth
			}
		}
		10 = {
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:cross
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = christian_crown
					}
				}
			}
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:crown
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = christian_veil
					}
				}
			}
			save_scope_value_as = {
				name = christian_relic_name
				value = flag:veronica
			}
		}
	}

	# Create the artifact
	if = {
		limit = {
			exists = scope:christian_relic_name
			scope:christian_relic_name = flag:lance
		}
		set_artifact_rarity_illustrious = yes
		create_artifact = {	
			name = artifact_pedestal_spear_destiny_name
			description = artifact_pedestal_spear_destiny
			type = pedestal
			template = christian_artifact_template
			visuals = pedestal_longinus
			wealth = scope:wealth
			quality = scope:quality
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
			decaying = no
		}
	}
	else_if = {
		limit = {
			exists = scope:christian_relic_name
			OR = {
				scope:christian_relic_name = flag:sandals
				scope:christian_relic_name = flag:girdle
				scope:christian_relic_name = flag:loincloth
				scope:christian_relic_name = flag:crown
				scope:christian_relic_name = flag:veronica
			}
		}
		set_artifact_rarity_illustrious = yes
		create_artifact = {
			name = artifact_pedestal_reliquary_christian_name
			description = artifact_pedestal_reliquary_christian_description
			type = pedestal
			wealth = scope:wealth
			quality = scope:quality
			template = christian_artifact_template
			visuals = pedestal_christian_relic
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}
	else_if = {
		limit = {
			exists = scope:christian_relic_name
			scope:christian_relic_name = flag:skull
		}
		create_artifact = {
			name = artifact_pedestal_reliquary_christian_name
			description = artifact_pedestal_reliquary_christian_description
			type = pedestal
			wealth = scope:wealth
			quality = scope:quality
			template = christian_artifact_template
			visuals = human_skull
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}
	else = {
		create_artifact = {
			name = artifact_pedestal_reliquary_christian_name
			description = artifact_pedestal_reliquary_christian_description
			type = pedestal
			wealth = scope:wealth
			quality = scope:quality
			template = christian_artifact_template
			visuals = reliquary
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:christian
		}
		if = {
			limit = {
				exists = scope:christian_relic_name
				scope:christian_relic_name = flag:veronica
			}
			set_variable = christian_veil
		}
		else_if = {
			limit = {
				exists = scope:christian_relic_name
				scope:christian_relic_name = flag:crown
			}
			set_variable = christian_crown
		}
		else_if = {
			limit = {
				exists = scope:christian_relic_name
				scope:christian_relic_name = flag:loincloth
			}
			set_variable = christian_loincloth
		}
		else_if = {
			limit = {
				exists = scope:christian_relic_name
				scope:christian_relic_name = flag:lance
			}
			set_variable = christian_lance
		}
		else_if = {
			limit = {
				exists = scope:christian_relic_name
				scope:christian_relic_name = flag:arm
			}
			set_variable = christian_arm
		}
		else_if = {
			limit = {
				exists = scope:christian_relic_name
				scope:christian_relic_name = flag:sandals
			}
			set_variable = christian_sandals
		}
		else_if = {
			limit = {
				exists = scope:christian_relic_name
				scope:christian_relic_name = flag:girdle
			}
			set_variable = christian_girdle
		}
		else_if = {
			limit = {
				exists = scope:christian_relic_name
				scope:christian_relic_name = flag:skull
			}
			set_variable = christian_skull
		}
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		add_artifact_modifier = artifact_monthly_prestige_penalty_modifier #overwrite default creation modifier
		save_scope_as = epic
	}
}

create_artifact_pedestal_islamic_relic_effect_hist = {
	# 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
	get_artifact_quality_effect = yes
	get_artifact_wealth_effect = yes

	# Identify which relic it is
	random_list = {
		10 = {
			save_scope_value_as = {
				name = islam_relic_name
				value = flag:hair
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = islam_cloak
					}
				}
			}
			save_scope_value_as = {
				name = islam_relic_name
				value = flag:cloak
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = islam_hand
					}
				}
			}
			save_scope_value_as = {
				name = islam_relic_name
				value = flag:hand
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = islam_keys
					}
				}
			}
			save_scope_value_as = {
				name = islam_relic_name
				value = flag:keys
			}
		}
		10 = {
			save_scope_value_as = {
				name = islam_relic_name
				value = flag:tooth
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = islam_seal
					}
				}
			}
			save_scope_value_as = {
				name = islam_relic_name
				value = flag:seal
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = islam_banner
					}
				}
			}
			save_scope_value_as = {
				name = islam_relic_name
				value = flag:banner
			}
		}
	}

	# Create the artifact
	if = {
		limit = {
			exists = scope:islam_relic_name
			scope:islam_relic_name = flag:banner
		}
		set_artifact_rarity_illustrious = yes
		create_artifact = {	
			name = artifact_banner_islam_name
			description = artifact_banner_islam_description
			type = wall_big
			template = islam_artifact_template
			visuals = banner_islam
			visuals_source = title:d_shiite #Caliphate
			wealth = scope:wealth
			quality = scope:quality
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}
	else_if = {
		limit = {
			exists = scope:islam_relic_name
			OR = {
				scope:islam_relic_name = flag:cloak
				scope:islam_relic_name = flag:hand
				scope:islam_relic_name = flag:keys
				scope:islam_relic_name = flag:seal
			}
		}
		set_artifact_rarity_illustrious = yes
		create_artifact = {	
			name = artifact_pedestal_reliquary_islam_name
			description = artifact_pedestal_reliquary_islam_description
			type = pedestal
			template = islam_artifact_template
			visuals = pedestal_islamic_relic
			wealth = scope:wealth
			quality = scope:quality
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}	
	else = {
		create_artifact = {	
			name = artifact_pedestal_reliquary_islam_name
			description = artifact_pedestal_reliquary_islam_description
			type = pedestal
			template = islam_artifact_template
			visuals = reliquary
			wealth = scope:wealth
			quality = scope:quality
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:islamic
		}
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		add_artifact_modifier = artifact_monthly_prestige_penalty_modifier #overwrite default creation modifier
		if = {
			limit = {
				exists = scope:islam_relic_name
				scope:islam_relic_name = flag:cloak
			}
			set_variable = islam_cloak
		}
		else_if = {
			limit = {
				exists = scope:islam_relic_name
				scope:islam_relic_name = flag:seal
			}
			set_variable = islam_seal
		}
		else_if = {
			limit = {
				exists = scope:islam_relic_name
				scope:islam_relic_name = flag:keys
			}
			set_variable = islam_keys
		}
		else_if = {
			limit = {
				exists = scope:islam_relic_name
				scope:islam_relic_name = flag:hand
			}
			set_variable = islam_hand
		}
		else_if = {
			limit = {
				exists = scope:islam_relic_name
				scope:islam_relic_name = flag:banner
			}
			set_variable = islam_banner
		}
		add_scaled_artifact_modifier_devotion_effect = yes
		save_scope_as = epic
	}
}

create_artifact_pedestal_buddhism_relic_effect_hist = {
	# 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
	get_artifact_quality_effect = yes
	get_artifact_wealth_effect = yes

	# Identify which relic it is
	random_list = {
		10 = {
			save_scope_value_as = {
				name = buddhism_relic_name
				value = flag:tooth
			}
		}
		10 = {
			save_scope_value_as = {
				name = buddhism_relic_name
				value = flag:bone
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = buddhism_robe
					}
				}
			}
			save_scope_value_as = {
				name = buddhism_relic_name
				value = flag:robe
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = buddhism_bowl
					}
				}
			}
			save_scope_value_as = {
				name = buddhism_relic_name
				value = flag:bowl
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = buddhism_tongue
					}
				}
			}
			save_scope_value_as = {
				name = buddhism_relic_name
				value = flag:tongue
			}
		}
		10 = {
			save_scope_value_as = {
				name = buddhism_relic_name
				value = flag:hair
			}
		}
		10 = {
			save_scope_value_as = {
				name = buddhism_relic_name
				value = flag:sarira
			}
		}
		10 = {
			save_scope_value_as = {
				name = buddhism_relic_name
				value = flag:bo
			}
		}
	}

	# Create the artifact
	if = {
		limit = {
			exists = scope:buddhism_relic_name
			OR = {
				scope:buddhism_relic_name = flag:robe
				scope:buddhism_relic_name = flag:bowl
				scope:buddhism_relic_name = flag:tongue
			}
		}
		set_artifact_rarity_illustrious = yes
		create_artifact = {	
			name = artifact_pedestal_reliquary_buddhism_name
			description = artifact_pedestal_reliquary_buddhism_description
			type = pedestal
			template = buddhism_artifact_template
			visuals = pedestal_buddhism_relic
			wealth = scope:wealth
			quality = scope:quality
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}
	else_if = {
		limit = {
			exists = scope:buddhism_relic_name
			scope:buddhism_relic_name = flag:tooth
		}
		set_artifact_rarity_illustrious = yes
		create_artifact = {	
			name = artifact_pedestal_reliquary_buddhism_name
			description = artifact_pedestal_reliquary_buddhism_description
			type = pedestal
			template = buddhism_artifact_template
			visuals = buddha_tooth
			wealth = scope:wealth
			quality = scope:quality
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}
	else = {
		create_artifact = {	
			name = artifact_pedestal_reliquary_buddhism_name
			description = artifact_pedestal_reliquary_buddhism_description
			type = pedestal
			template = buddhism_artifact_template
			visuals = pedestal_buddhism_relic
			wealth = scope:wealth
			quality = scope:quality
			history = {
				type = created_before_history
			}
			modifier = artifact_placeholder_modifier
			save_scope_as = newly_created_artifact
		}
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:buddhism
		}
		if = {
			limit = {
				exists = scope:buddhism_relic_name
				scope:buddhism_relic_name = flag:tongue
			}
			set_variable = buddhism_tongue
		}
		else_if = {
			limit = {
				exists = scope:buddhism_relic_name
				scope:buddhism_relic_name = flag:bowl
			}
			set_variable = buddhism_bowl
		}
		else_if = {
			limit = {
				exists = scope:buddhism_relic_name
				scope:buddhism_relic_name = flag:robe
			}
			set_variable = buddhism_robe
		}
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		add_artifact_modifier = artifact_monthly_prestige_penalty_modifier #overwrite default creation modifier
		save_scope_as = epic
	}
}

create_artifact_pedestal_branch_relic_zoroastr_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	# Identify which relic it is
	random_list = {
		10 = {
			save_scope_value_as = {
				name = branch_name
				value = flag:haoma
			}
		}
		10 = {
			save_scope_value_as = {
				name = branch_name
				value = flag:cypress
			}
		}
	}

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_branch_name
		description = artifact_pedestal_branch_description
		type = pedestal
		visuals = pedestal_branch_relic_zoroastr
		wealth = scope:wealth
		quality = scope:quality
		template = branch_zoroastr_template
		history = {
			type = created_before_history
		}
		modifier = artifact_placeholder_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:zoroastr
		}
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		add_artifact_modifier = artifact_monthly_prestige_penalty_modifier #overwrite default creation modifier
		save_scope_as = epic
	}
}

create_artifact_pedestal_branch_relic_germanic_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	# Identify which relic it is
	random_list = {
		10 = {
			save_scope_value_as = {
				name = branch_name
				value = flag:thor
			}
		}
		10 = {
			save_scope_value_as = {
				name = branch_name
				value = flag:uppsala
			}
		}
	}

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_branch_name
		description = artifact_pedestal_branch_description
		type = pedestal
		template = branch_germanic_template
		visuals = pedestal_branch_relic_germanic
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = artifact_placeholder_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:germanic
		}
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		save_scope_as = epic
	}
}

create_artifact_pedestal_branch_relic_slavic_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	save_scope_value_as = {
		name = branch_name
		value = flag:alatyr
	}

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_branch_name
		description = artifact_pedestal_branch_description
		type = pedestal
		template = branch_slavic_template
		visuals = pedestal_branch_relic_slavic
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = artifact_placeholder_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:slavic
		}
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		save_scope_as = epic
	}
}

create_artifact_pedestal_branch_relic_boog_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	save_scope_value_as = {
		name = branch_name
		value = flag:somb
	}

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_branch_name
		description = artifact_pedestal_branch_description
		type = pedestal
		template = branch_boog_template
		visuals = pedestal_branch_relic_boog
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = artifact_placeholder_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:boog
		}
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		add_artifact_modifier = artifact_monthly_prestige_penalty_modifier #overwrite default creation modifier
		save_scope_as = epic
	}
}

create_artifact_pedestal_branch_relic_hinduism_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	save_scope_value_as = {
		name = branch_name
		value = flag:kalpavriksha
	}

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_branch_name
		description = artifact_pedestal_branch_description
		type = pedestal
		template = branch_hinduism_template
		visuals = pedestal_branch_relic_hinduism
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = artifact_placeholder_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:hinduism
		}
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		save_scope_as = epic
	}
}

create_artifact_pedestal_branch_relic_general_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	save_scope_value_as = {
		name = branch_name
		value = flag:general
	}

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_branch_name
		description = artifact_pedestal_branch_description
		type = pedestal
		template = branch_general_template
		visuals = pedestal_branch_relic_hinduism
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = artifact_placeholder_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = {	#This is needed to determine what religion the branch will work for.
			name = relic_religion
			value = $RELIGION$
		}
		set_variable = { name = historical_unique_artifact value = yes }
		add_scaled_artifact_modifier_piety_effect = yes
		add_scaled_artifact_modifier_grandeur_small_effect = yes
		if = {
			limit = {
				OR = {
					rarity = famed
					rarity = illustrious
				}
			}
			add_2_scaled_artifact_modifier_devotion_effect = yes
			
		}
		else = {
			add_scaled_artifact_modifier_devotion_effect = yes
		}
		save_scope_as = epic
	}
}

#Common Artifacts

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_edmund_head_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = edmund_head_name
		description = edmund_head_description
		type = pedestal
		visuals = head
		wealth = scope:wealth
		quality = scope:quality
		template = christian_relic_template
		history = {
			type = created
			date = 869.11.20
			recipient = character:163064 #Eadmund the Martyr
			location = province:1520 #Blything
		}
		modifier = edmund_head_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = edmund_head
		add_scaled_artifact_modifier_devotion_effect = yes
		set_variable = {
			name = relic
			value = flag:christian
		}
		save_scope_as = epic
		add_artifact_history = {
			type = given
			date = 946.5.27
			recipient = character:33350 # Æthelstan
		}
		add_artifact_title_history = {
			target = title:k_england
			date = 955.11.24
		}
	}
}

create_artifact_makarakundala_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_makarakundala_name
		description = artifact_makarakundala_description
		type = pedestal
		visuals = riches
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = makarakundala_modifier
		save_scope_as = newly_created_artifact
	}

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

#Masterwork Artifacts

create_artifact_ibeji_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_ibeji_name
		description = artifact_ibeji_description
		template = general_unique_template
		type = pedestal
		visuals = medium_box
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = ibeji_modifier
		save_scope_as = newly_created_artifact
	}

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

create_artifact_chinese_caligraphy_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_masterwork = yes

	# Create the artifact
	create_artifact = {
		type = pedestal
		visuals = scroll
		wealth = scope:wealth
		template = general_unique_template
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = caligraphy_modifier
		save_scope_as = newly_created_artifact
		name = artifact_chinese_caligraphy_name
		description = artifact_chinese_caligraphy_description
	}

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

create_artifact_throne_charlemagne_effect = { #Create at start
	# 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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_throne_charlemagne_name
		description = artifact_throne_charlemagne_description
		type = throne_special
		visuals = throne_charlemagne
		wealth = scope:wealth
		quality = scope:quality
		template = throne_charlemagne_template
		history = {
			type = created
			date = 800.12.25
			recipient = character:6392 #Karl I the Great
			location = province:2092 #Aachen
		}
		modifier = throne_charlemagne_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = charlamagne_throne
		# k_lotharingia history copied manually because it is destroyed before 1066
		add_artifact_history = {
			type = inherited
			date = 814.1.2
			recipient = character:90095 #Louis I
		}
		add_artifact_history = {
			type = inherited
			date = 817.1.1
			recipient = character:30227 #Lothair I
		}
		add_artifact_title_history = {
			target = title:e_hre
			date = 973.5.7
		}
		add_scaled_artifact_modifier_majesty_effect = yes
		add_scaled_artifact_modifier_rulership_effect = yes
		save_scope_as = epic
		save_scope_value_as = {
			name = throne
			value = yes
		}
	}
}

create_artifact_throne_solomon_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_throne_solomon_name
		description = artifact_throne_solomon_description
		type = throne_special
		visuals = throne_solomon
		wealth = scope:wealth
		quality = scope:quality
		template = throne_solomon_template
		history = {
			type = created_before_history
		}
		modifier = throne_solomon_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = throne_of_solomon
		save_scope_as = epic
		add_scaled_artifact_modifier_majesty_effect = yes
		add_scaled_artifact_modifier_rulership_effect = yes
		add_scaled_artifact_modifier_devotion_effect = yes
		save_scope_value_as = {
			name = throne
			value = yes
		}
	}
}

create_artifact_byz_throne_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_byz_throne_name
		description = artifact_byz_throne_description
		type = throne_special
		visuals = ep3_throne_of_solomon
		wealth = scope:wealth
		quality = scope:quality
		template = byz_throne_template
		history = {
			type = created_before_history
		}
		modifier = byz_throne_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		#set_variable = byz_throne_of_solomon
		save_scope_as = epic
		save_scope_value_as = {
			name = throne
			value = yes
		}
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 940.1.1
		}
	}
}

create_artifact_throne_scone_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_throne_stone_scone_name
		description = artifact_throne_stone_scone
		type = throne_special
		visuals = throne_scone
		wealth = scope:wealth
		quality = scope:quality
		template = throne_scone_template
		history = {
			type = created
			date = 841.6.1
			recipient = character:6018 #Kenneth mac Ailpín
			location = province:1742 #Scone
		}
		modifier = throne_scone_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = throne_scone
		save_scope_as = epic
		add_scaled_artifact_modifier_rulership_effect = yes
		save_scope_value_as = {
			name = throne
			value = yes
		}
		add_artifact_title_history = {
			target = title:k_scotland
			date = 858.1.1
		}
	}
}

create_artifact_wall_banner_kaviani_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_wall_banner_kaviani_name
		description = artifact_wall_banner_kaviani
		type = wall_big
		template = kaviani_template
		visuals = banner
		visuals_source = dynasty:jamshid
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = banner_kaviani_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_sculpture_cabinet_pentapyrgion_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_sculpture_cabinet_pentapyrgion_name
		description = artifact_sculpture_cabinet_pentapyrgion_description
		type = sculpture
		visuals = sculpture_cabinet_pentapyrgion
		template = pentapyrgion_template
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 839.6.1
			recipient = character:70491 #Theophilos
			location = province:496 #Constantinople
		}
		modifier = pentapyrgion_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 842.1.20
		}
		save_scope_value_as = {
			name = cupboard
			value = yes
		}
	}
}

create_artifact_monomachus_crown_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_famed = yes

	# Create the artifact
	create_artifact = {	
		name = monomachus_crown_name
		description = monomachus_crown_description
		template = crown_wearable_template
		type = helmet
		visuals = pedestal_justinian
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 1042.6.11
			recipient = character:1726 #Konstantinos IX
			location = province:496 #Constantinople
		}
		modifier = monomachus_crown_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 1055.1.11
		}
	}
}

create_artifact_ruyi_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_ruyi_name
		description = artifact_ruyi_description
		type = pedestal
		visuals = regalia_court
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = ruyi_modifier
		save_scope_as = newly_created_artifact
	}

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

create_artifact_jewelled_danda_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_jewelled_danda_name
		description = artifact_jewelled_danda_description
		type = regalia_simple
		visuals = regalia
		wealth = scope:wealth
		quality = scope:quality
		template = regalia_template
		history = {
			type = created_before_history
		}
		modifier = jewelled_danda_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_2_scaled_artifact_modifier_rulership_effect = yes
		add_scaled_artifact_modifier_scholarship_effect = yes
		set_variable = danda
		save_scope_as = epic
	}
}

create_artifact_khanda_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_khanda_name
		description = artifact_khanda_description
		template = branch_hinduism_template
		type = pedestal
		visuals = wall_khanda_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = khanda_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = khanda
		set_variable = {
			name = relic
			value = flag:hinduism
		}
		save_scope_as = epic
	}
}

create_artifact_dagger_of_rostam_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_dagger_of_rostam_name
		description = artifact_dagger_of_rostam_description
		type = pedestal
		visuals = dagger_court
		template = general_unique_template
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = rustam_dagger_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_ascalon_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_spear_of_ascalon_name
		description = artifact_spear_of_ascalon_description
		type = pedestal
		visuals = spear_court
		template = general_unique_template
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = spear_ascalon_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = ascalon
		set_variable = {
			name = relic
			value = flag:christian
		}
		save_scope_as = epic
	}
}

create_artifact_zomorrodnegar_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_zomorrodnegar_name
		description = artifact_zomorrodnegar_description
		type = pedestal
		visuals = sword_court
		template = general_unique_template
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = zomorrodnegar_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_kaves_apron_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_kaves_apron_name
		description = artifact_kaves_apron_description
		type = wall_big
		visuals = banner
		visuals_source = dynasty:jamshid
		template = general_unique_template
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = kaves_apron_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_muhammads_epistles_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_masterwork = yes

	# Create the artifact
	create_artifact = {
		type = pedestal
		visuals = scroll
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = artifact_placeholder_modifier
		save_scope_as = newly_created_artifact
		template = islam_artifact_template
		name = artifact_muhammads_epistles_name
		description = artifact_muhammads_epistles_description
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = muhammads_epistles
		add_scaled_artifact_modifier_devotion_effect = yes
		add_scaled_artifact_modifier_combat_effect = yes
		set_variable = {
			name = relic
			value = flag:islamic
		}
		save_scope_as = epic
	}
}

create_artifact_aruval_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_aruval_name
		description = artifact_aruval_description
		type = pedestal
		visuals = wall_khanda_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		template = branch_hinduism_template
		modifier = aruval_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = aruval
		set_variable = {
			name = relic
			value = flag:hinduism
		}
		save_scope_as = epic
	}
}

create_artifact_navaratna_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_navaratna_name
		description = artifact_navaratna_description
		visuals = necklace
		type = necklace
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = navaratna_modifier
		save_scope_as = newly_created_artifact
	}

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

create_artifact_pedestal_ikenga_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_ikenga_name
		description = artifact_ikenga_description
		type = pedestal
		visuals = small_box
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = ikenga_modifier
		save_scope_as = newly_created_artifact
	}

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

create_artifact_afarganyu_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = afarganyu_name
		description = artifact_afarganyu_description
		template = branch_zoroastr_template
		type = urn
		visuals = urn
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = afarganyu_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:zoroastr
		}
		save_scope_as = epic
	}
}

create_artifact_siddhachakra_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_masterwork = yes

	# Create the artifact
	create_artifact = {	
		name = siddhachakra_name
		description = artifact_siddhachakra_description
		template = jainism_artifact_template
		type = pedestal
		visuals = scroll
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = siddhachakra_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:jainism
		}
		save_scope_as = epic
	}
}

create_artifact_staff_kakusandha_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_staff_kakusandha
		description = artifact_staff_kakusandha_desc
		type = pedestal
		visuals = spear_court
		wealth = scope:wealth
		quality = scope:quality
		template = buddhism_artifact_template
		history = {
			type = created_before_history
		}
		modifier = kakusandha_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = staff_kakusandha
		set_variable = {
			name = relic
			value = flag:buddhism
		}
		save_scope_as = epic
	}
}

create_artifact_konagamana_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = water_filter_konagamana
		description = water_filter_konagamana_desc
		type = pedestal
		visuals = scroll
		wealth = scope:wealth
		quality = scope:quality
		template = buddhism_artifact_template
		history = {
			type = created_before_history
		}
		modifier = konagamana_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = konagamana
		set_variable = {
			name = relic
			value = flag:buddhism
		}
		save_scope_as = epic
	}
}

create_artifact_robe_kassapa_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = robe_kassapa
		description = robe_kassapa_desc
		template = buddhism_artifact_template
		type = pedestal
		visuals = reliquary
		wealth = scope:wealth
		quality = scope:quality
		template = buddhism_artifact_template
		history = {
			type = created_before_history
		}
		modifier = kassapa_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = kassapa
		set_variable = {
			name = relic
			value = flag:buddhism
		}
		save_scope_as = epic
	}
}

#Famed Artifacts

create_artifact_reichskrone_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = reichskrone_name
		description = reichskrone_description
		type = helmet
		visuals = hre_crown
		wealth = scope:wealth
		quality = scope:quality
		template = reichskrone_template
		history = {
			type = created
			date = 962.1.1
			recipient = character:1282 #Otto I
			location = province:2092 #Aachen
		}
		modifier = reichskrone_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = artifact_succession_title
			value = title:e_hre
		}
		add_artifact_title_history = {
			target = title:e_hre
			date = 962.1.1
		}
		set_variable = {
			name = reichskrone
			value = yes
		}
		save_scope_as = epic
	}
}

create_artifact_cintamani_hindu_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_cintamani_name
		description = artifact_cintamani_hindu_description
		type = pedestal
		visuals = rock
		wealth = scope:wealth
		quality = scope:quality
		template = branch_hinduism_template
		history = {
			type = created_before_history
		}
		modifier = cintamani_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = cintamani_hindu
		set_variable = {
			name = relic
			value = flag:hinduism
		}
	}
}

create_artifact_cintamani_buddhist_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_cintamani_name
		description = artifact_cintamani_buddhist_description
		type = pedestal
		visuals = rock
		wealth = scope:wealth
		quality = scope:quality
		template = buddhism_artifact_template
		history = {
			type = created_before_history
		}
		modifier = cintamani_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = cintamani_buddhist
		set_variable = {
			name = relic
			value = flag:buddhism
		}
	}
}

create_artifact_wall_banner_edessa_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = artifact_wall_big_edessa_name
		description = artifact_wall_big_edessa
		type = pedestal
		visuals = reliquary
		wealth = scope:wealth
		quality = scope:quality
		template = edessa_template
		history = {
			type = created_before_history
			location = province:4869 #Edessa
		}
		modifier = banner_of_edessa_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = banner_edessa
		set_variable = {
			name = relic
			value = flag:christian
		}
		save_scope_as = epic
	}
}

create_artifact_wall_cid_sword_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_famed = yes

	# Create the artifact
	create_artifact = {
		name = artifact_wall_cid_sword_name
		description = artifact_wall_el_cids_sword
		type = pedestal
		visuals = wall_cid_sword
		wealth = scope:wealth
		quality = scope:quality
		template = tizona_template
		history = {
			type = created_before_history
		}
		modifier = tizona_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		add_artifact_history = {
			type = won_in_duel
			date = 1097.1.1
			recipient = character:107590 #El Cid
		}
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = sword_cid
		save_scope_as = epic
	}
}

create_artifact_wall_muhammad_sword_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_famed = yes

	# Identify which sword it is
	random_list = {
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_aladb
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:aladb
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_almathur
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:almathur
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_arrasub
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:arrasub
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_albattar
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:albattar
			}
			
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_haft
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:haft
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_qali
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:qali
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_dhu
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:dhu
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_mikhdham
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:mikhdham
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_muhammad_alqadib
					}
				}
			}
			save_scope_value_as = {
				name = muhammad_sword_name
				value = flag:alqadib
			}
		}
	}

	# Create the artifact
	create_artifact = {	
		name = artifact_wall_sword_muhammad_name
		description = artifact_wall_sword_muhammad
		type = pedestal
		visuals = wall_muhammad_sword
		wealth = scope:wealth
		quality = scope:quality
		template = muhammad_sword_template
		history = {
			type = created_before_history
		}
		modifier = muhammed_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = sword_of_muhammad
		save_scope_as = muhammad_sword
		set_variable = {
			name = relic
			value = flag:islamic
		}
		random_list = {
			pick = 2
			unique = yes
			10 = {
				add_artifact_modifier = muhammed_sword_1_modifier
			}
			10 = {
				add_artifact_modifier = muhammed_sword_2_modifier
			}
			10 = {
				add_artifact_modifier = muhammed_sword_3_modifier
			}
			10 = {
				add_artifact_modifier = muhammed_sword_4_modifier
			}
			10 = {
				add_artifact_modifier = muhammed_sword_5_modifier
			}
			10 = {
				add_artifact_modifier = muhammed_sword_6_modifier
			}
			10 = {
				add_artifact_modifier = muhammed_sword_7_modifier
			}
			10 = {
				add_artifact_modifier = muhammed_sword_8_modifier
			}
		}
	}
	if = {
		limit = {
			scope:muhammad_sword_name = flag:aladb
		}
		scope:muhammad_sword = {
			add_artifact_history = {
				type = given
				date = 624.3.13
				recipient = character:33922 #Muhammad the Prophet
			}
			set_variable = sword_muhammad_aladb
		}
	}
	if = {
		limit = {
			scope:muhammad_sword_name = flag:almathur
		}
		scope:muhammad_sword = {
			add_artifact_history = {
				type = inherited
				date = 570.6.1
				recipient = character:33922 #Muhammad the Prophet
			}
			set_variable = sword_muhammad_almathur
		}
	}
	if = {
		limit = {
			scope:muhammad_sword_name = flag:arrasub
		}
		scope:muhammad_sword = {
			add_artifact_history = {
				type = inherited
				date = 570.6.1
				recipient = character:33922 #Muhammad the Prophet
			}
			set_variable = sword_muhammad_arrasub
		}
	}
	if = {
		limit = {
			OR = {
				scope:muhammad_sword_name = flag:albattar
				scope:muhammad_sword_name = flag:haft
				scope:muhammad_sword_name = flag:qali
			}
		}
		scope:muhammad_sword = {
			add_artifact_history = {
				type = conquest
				date = 622.5.1
				recipient = character:33922 #Muhammad the Prophet
				location = province:718
			}
			if = {
				limit = { scope:muhammad_sword_name = flag:albattar }
				set_variable = sword_muhammad_albattar
			}
			else_if = {
				limit = { scope:muhammad_sword_name = flag:haft }
				set_variable = sword_muhammad_haft
			}
			else = {
				set_variable = sword_muhammad_qali
			}
		}
	}
	if = {
		limit = {
			scope:muhammad_sword_name = flag:dhu
		}
		scope:muhammad_sword = {
			add_artifact_history = {
				type = conquest
				date = 624.3.13
				recipient = character:33922 #Muhammad the Prophet
				location = province:6210 #Al-Jar
			}
			set_variable = sword_muhammad_dhu
		}
	}
	if = {
		limit = {
			scope:muhammad_sword_name = flag:mikhdham
		}
		scope:muhammad_sword = {
			add_artifact_history = {
				type = given
				date = 610.1.1
				recipient = character:33922 #Muhammad the Prophet
			}
			set_variable = sword_muhammad_mikhdham
		}
	}
	if = {
		limit = {
			scope:muhammad_sword_name = flag:alqadib
		}
		scope:muhammad_sword = {
			add_artifact_history = {
				type = given
				date = 610.1.1
				recipient = character:33922 #Muhammad the Prophet
			}
			set_variable = sword_muhammad_alqadib
		}
	}
	scope:muhammad_sword = {
		save_scope_as = epic
	}
}

create_artifact_sword_goujian_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_illustrious = yes

	# Identify which sword it is
	random_list = {
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_goujian_purity
					}
				}
			}
			save_scope_value_as = {
				name = goujian_sword_name
				value = flag:purity
			}
		}
		10 = {
			trigger = {
				NOT = {
					any_artifact = {
						has_variable = sword_goujian_refulgence
					}
				}
			}
			save_scope_value_as = {
				name = goujian_sword_name
				value = flag:refulgence
			}
			set_variable = sword_goujian_refulgence
		}
		10 = {
			#Nothing
		}
	}

	# Create the artifact
	create_artifact = {	
		name = artifact_sword_goujian_name
		description = artifact_sword_goujian
		type = pedestal
		visuals = tgp_sword_of_goujian
		wealth = scope:wealth
		quality = scope:quality
		template = sword_goujian_template
		history = {
			type = created_before_history
		}
		modifier = goujian_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = sword_of_goujian
		save_scope_as = gujian_sword
		random_list = {
			pick = 2
			unique = yes
			10 = {
				add_artifact_modifier = goujian_sword_1_modifier
			}
			10 = {
				add_artifact_modifier = goujian_sword_2_modifier
			}
			10 = {
				add_artifact_modifier = goujian_sword_3_modifier
			}
			10 = {
				add_artifact_modifier = goujian_sword_4_modifier
			}
			10 = {
				add_artifact_modifier = goujian_sword_5_modifier
			}
			10 = {
				add_artifact_modifier = goujian_sword_6_modifier
			}
			10 = {
				add_artifact_modifier = goujian_sword_7_modifier
			}
			10 = {
				add_artifact_modifier = goujian_sword_8_modifier
			}
		}
	}
	if = {
		limit = {
			exists = scope:goujian_sword_name
			scope:goujian_sword_name = flag:refulgence
		}
		scope:gujian_sword = {
			set_artifact_description = artifact_sword_goujian_refulgence
			set_variable = sword_goujian_refulgence
		}
	}
	if = {
		limit = {
			exists = scope:goujian_sword_name
			scope:goujian_sword_name = flag:purity
		}
		scope:gujian_sword = {
			set_artifact_description = artifact_sword_goujian_purity
			set_variable = sword_goujian_purity
		}
	}
	scope:gujian_sword = {
		save_scope_as = epic
	}
}

create_artifact_sword_mmaagha_kamalu_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_mmaagha_kamalu_name
		description = artifact_mmaagha_kamalu_description
		type = pedestal
		visuals = sword_court
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = mmaagha_kamalu_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_bronze_head_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_bronze_head_name
		description = artifact_bronze_head_description
		type = pedestal
		visuals = head
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = bronze_head_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_crystal_carving_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_crystal_carving_name
		description = artifact_crystal_carving_description
		type = pedestal
		visuals = riches
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = crystal_carving_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_wall_sword_attila_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_wall_sword_attila_name
		description = artifact_wall_sword_attila_description
		type = pedestal
		template = attila_template
		visuals = wall_sword_attila
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = attila_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_pedestal_great_diamond_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_great_diamond_name
		description = artifact_pedestal_great_diamond_description
		type = pedestal
		template = general_unique_template
		visuals = diamond
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = great_diamond_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_pedestal_al_jabal_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_al_jabal_name
		description = artifact_pedestal_al_jabal_description
		type = pedestal
		visuals = ring_court
		template = general_unique_template
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = al_jabal_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_pedestal_al_yatima_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_al_yatima_name
		description = artifact_pedestal_al_yatima_description
		type = pedestal
		visuals = diamond
		template = general_unique_template
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = al_yatima_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_pedestal_cup_jamshid_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_jamshid_name
		description = artifact_pedestal_cup_jamshid
		type = pedestal
		template = cup_jamshid_template
		visuals = pedestal_cup_jamshid
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = cup_jamshid_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_pedestal_crown_iron_effect = { #Create at start
	# 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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_crown_iron_name
		description = artifact_pedestal_crown_iron
		type = pedestal
		template = crown_iron_template
		visuals = pedestal_crown_iron
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 313.2.1
			recipient = character:70523 #Konstantinos I the Great
			location = province:496 #Constantinople
		}
		modifier = iron_crown_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = iron_crown
		add_artifact_history = {
			type = given
			date = 600.1.1
			actor = character:7893
			recipient = character:190171
			location = province:2475
		}
		add_artifact_history = {
			type = given
			date = 774.7.10
			recipient = character:6392
			location = province:2475
		}
		add_artifact_history = {
			type = given
			date = 781.1.1
			recipient = character:6394
			location = province:2475
		}
		add_artifact_history = {
			type = inherited
			date = 810.1.1
			recipient = character:6396
			location = province:2475
		}
		add_artifact_history = {
			type = inherited
			date = 818.4.17
			recipient = character:90095
			location = province:2475
		}
		add_artifact_history = {
			type = inherited
			date = 887.1.1
			recipient = character:71901
			location = province:2475
		}
		# k_italy history copied manually because it is destroyed before 1066
		add_artifact_history = {
			type = inherited
			date = 896.1.1
			recipient = character:167969 #Liutfrido
		}
		add_artifact_history = {
			type = inherited
			date = 905.3.1
			recipient = character:167970 #Gotofredo
		}
		add_artifact_history = {
			type = inherited
			date = 910.8.4
			recipient = character:167971 #Gausberto
		}
		add_artifact_history = {
			type = inherited
			date = 940.1.1
			recipient = character:167972 #Uberto
		}
		add_artifact_history = {
			type = inherited
			date = 941.11.1
			recipient = character:167973 #Adalberto
		}
		add_artifact_history = {
			type = inherited
			date = 967.1.1
			recipient = character:7727 #Aleramo Aleramicci
		}
		add_artifact_history = {
			type = inherited
			date = 991.1.1
			recipient = character:7728 #Ottone I
		}
		add_artifact_history = {
			type = inherited
			date = 991.6.1
			recipient = character:7729 #Guglielmo I
		}
		add_artifact_history = {
			type = inherited
			date = 941.11.1
			recipient = character:167973 #Adalberto
		}
		add_artifact_title_history = {
			target = title:e_hre
			date = 1039.2.4
		}
		save_scope_as = epic
	}
}

create_artifact_nikephoros_crown_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = nikephoros_crown_name
		description = nikephoros_crown_description
		type = pedestal
		visuals = pedestal_justinian
		template = justinian_template #Same as Justinian
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 963.7.2
			recipient = character:1712 #Nikephoros Phokas
			location = province:496 #Constantinople
		}
		modifier = nikephoros_crown_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = artifact_succession_title
			value = title:e_byzantium
		}
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 969.12.10
		}
	}
}

create_artifact_pedestal_shankha_conch_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_shankha_conch_name
		description = artifact_shankha_conch_description
		template = branch_hinduism_template
		type = pedestal
		visuals = small_box
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = shankha_conch_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = conch
		set_variable = {
			name = relic
			value = flag:hinduism
		}
		save_scope_as = epic
	}
}

create_artifact_skull_cap_charlemagne_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = skull_cap_charlemagne_name
		description = skull_cap_charlemagne_description
		template = general_unique_template
		type = pedestal
		visuals = head
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = skull_cap_charlemagne_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
	}
}

create_artifact_essen_crown_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_famed = yes

	# Create the artifact
	create_artifact = {	
		name = essen_crown_name
		description = essen_crown_description
		type = pedestal
		wealth = scope:wealth
		quality = scope:quality
		visuals = hre_crown
		template = general_unique_template
		history = {
			type = created
			date = 983.1.1
			recipient = character:1288 #Otto III
			location = province:2677 #Essen
		}
		modifier = essen_crown_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_artifact_title_history = {
			target = title:e_hre
			date = 1002.1.23
		}
		set_variable = {
			name = artifact_succession_title
			value = title:e_hre
		}
	}
}

create_artifact_dhammapada_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_famed = yes

	# Create the artifact
	create_artifact = {
		name = dhammapada_name
		description = dhammapada_description
		type = book
		visuals = indian_book
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = dhammapada_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_vinaya_pitaka_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = vinaya_pitaka_name
		description = vinaya_pitaka_description
		type = book
		visuals = indian_book
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = vinaya_pitaka_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_sutta_pitaka_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = sutta_pitaka_name
		description = sutta_pitaka_description
		type = book
		visuals = indian_book
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = sutta_pitaka_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_abhidhamma_pitaka_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = abhidhamma_pitaka_name
		description = abhidhamma_pitaka_description
		type = book
		visuals = indian_book
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = abhidhamma_pitaka_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_qadib_al_mulk_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = qadib_al_mulk_name
		description = qadib_al_mulk_description
		template = regalia_template
		type = regalia
		visuals = regalia
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
			date = 670.1.1 #To order entries correctly
		}
		modifier = qadib_al_mulk_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = qadib_al_mulk
		save_scope_as = epic
		set_variable = {
			name = artifact_succession_title
			value = title:d_shiite #Caliphate
		}
		add_artifact_title_history = {
			target = title:d_shiite #Caliphate
			date = 881.1.1
		}
	}
}

create_artifact_al_dawat_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = al_dawat_name
		description = al_dawat_description
		template = general_unique_template
		type = pedestal
		visuals = small_box
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
			date = 670.1.1 #To order entries correctly
		}
		modifier = al_dawat_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = al_dawat
		set_variable = {
			name = artifact_succession_title
			value = title:d_shiite #Caliphate
		}
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:d_shiite #Caliphate
			date = 881.1.1
		}
	}
}

create_artifact_al_hafir_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = al_hafir_name
		description = al_hafir_description
		template = general_unique_template
		type = pedestal
		visuals = diamond
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
			date = 670.1.1 #To order entries correctly
		}
		modifier = al_hafir_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = al_hafir
		set_variable = {
			name = artifact_succession_title
			value = title:d_shiite #Caliphate
		}
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:d_shiite #Caliphate
			date = 881.1.1
		}
	}
}

create_artifact_al_sayf_al_khass_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = al_sayf_al_khass_name
		description = al_sayf_al_khass_description
		template = general_unique_template
		type = pedestal
		visuals = wall_muhammad_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
			date = 670.1.1 #To order entries correctly
		}
		modifier = al_sayf_al_khass_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = al_sayf_al_khass
		save_scope_as = epic
		set_variable = {
			name = artifact_succession_title
			value = title:d_shiite #Caliphate
		}
		add_artifact_title_history = {
			target = title:d_shiite #Caliphate
			date = 881.1.1
		}
	}
}

create_artifact_durendal_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_famed = yes

	# Create the artifact
	create_artifact = {
		name = artifact_durendal_name
		description = artifact_durendal_description
		template = general_unique_template
		type = pedestal
		visuals = wall_cid_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = durendal_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_nagelring_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_famed = yes

	# Create the artifact
	create_artifact = {
		name = artifact_nagelring_name
		description = artifact_nagelring_description
		template = general_unique_template
		type = pedestal
		visuals = wall_cid_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = nagelring_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_szczerbiec_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = artifact_szczerbiec_name
		description = artifact_szczerbiec_description
		template = general_unique_template
		type = pedestal
		visuals = wall_szczerbiec_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = 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
	}
}

create_artifact_kladenets_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_famed = yes

	# Create the artifact
	create_artifact = {
		name = artifact_kladenets_name
		description = artifact_kladenets_description
		template = general_unique_template
		type = pedestal
		visuals = sword_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = kladenets_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_legbiter_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = artifact_legbiter_name
		description = artifact_legbiter_description
		template = general_unique_template
		type = pedestal
		visuals = sword_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = legbiter_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_quernbiter_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = artifact_quernbiter_name
		description = artifact_quernbiter_description
		template = general_unique_template
		type = pedestal
		visuals = sword_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = quernbiter_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_dragvandil_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = artifact_dragvandil_name
		description = artifact_dragvandil_description
		template = general_unique_template
		type = pedestal
		visuals = sword_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = dragvandil_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_curtana_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = artifact_curtana_name
		description = artifact_curtana_description
		template = general_unique_template
		type = pedestal
		visuals = sword_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 1042.6.9
			recipient = character:114 #Eadward the Confessor
			location = province:1527 #Lunden
		}
		modifier = curtana_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = curtana
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:k_england
			date = 1066.1.5
		}
	}
}

create_colada_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_famed = yes

	# Create the artifact
	create_artifact = {
		name = artifact_colada_name
		description = artifact_colada_description
		template = general_unique_template
		type = pedestal
		visuals = sword_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = colada_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_angelicas_ring_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_ring_angelica_name
		description = artifact_ring_angelica_description
		template = general_unique_template
		type = pedestal
		visuals = ring_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = angelicas_ring_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_olifant_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_olifant_name
		description = artifact_olifant_description
		template = general_unique_template
		type = pedestal
		visuals = olifant_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = olifant_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = olifant
		add_artifact_modifier = artifact_courtier_and_guest_opinion_4_modifier
		add_artifact_modifier = artifact_court_grandeur_baseline_add_3_modifier
		save_scope_as = epic
	}
}

create_artifact_aram_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_aram_name
		description = artifact_aram_description
		template = general_unique_template
		type = pedestal
		visuals = spear_court
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = aram_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_sledovik_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_sledovik_name
		description = artifact_sledovik_description
		visuals = rock
		type = pedestal
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		template = relic_finno_ugric_template
		modifier = sledovik_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:finno_ugric_religion
		}
		add_artifact_modifier = artifact_court_grandeur_baseline_add_2_modifier
		save_scope_as = epic
	}
}

create_artifact_kantele_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_kantele_name
		description = artifact_kantele_description
		visuals = pedestal_david_harp
		type = pedestal
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		template = relic_finno_ugric_template
		modifier = kantele_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = kantele
		set_variable = {
			name = relic
			value = flag:finno_ugric_religion
		}
		save_scope_as = epic
	}
}

#Illustrious Artifacts

create_artifact_pedestal_david_harp_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_david_harp_name
		description = artifact_pedestal_david_harp
		type = pedestal
		template = david_harp_template
		visuals = pedestal_david_harp
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
			location = province:5965 #Jerusalem
		}
		modifier = david_harp_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_joyeuse_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = artifact_joyeuse_name
		description = artifact_joyeuse_description
		template = general_unique_template
		type = pedestal
		visuals = wall_cid_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = joyeuse_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_papal_tiara_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = papal_tiara_name
		description = papal_tiara_description
		template = papal_tiara_template
		type = helmet
		visuals = pope_tiara
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 800.1.1
			recipient = character:7862 #Leo III - fictitious date, probably somewhere between the 8th and 9th centuries
			location = province:2575 #Rome
		}
		modifier = artifact_monthly_piety_4_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:christian
		}
		set_variable = {
			name = artifact_succession_title
			value = title:k_papal_state
		}
		set_variable = {
			name = pope_hat
			value = yes
		}
		add_artifact_title_history = {
			target = title:k_papal_state
			date = 816.6.12
		}
		add_artifact_modifier = artifact_monthly_learning_lifestyle_xp_2_modifier
	}
}

create_artifact_sculpture_ark_of_covenant_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = artifact_sculpture_ark_of_covenant_name
		description = artifact_sculpture_ark_of_covenant_description
		type = sculpture
		template = ark_covenant_template
		visuals = sculpture_ark_of_covenant
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = ark_of_covenant_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = ark_of_the_covenant
		save_scope_as = epic
		save_scope_value_as = {
			name = ark_covenant
			value = yes
		}
	}
}

create_artifact_pedestal_koh_i_noor_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_koh_i_noor_name
		description = artifact_pedestal_koh_i_noor_description
		template = general_unique_template
		type = pedestal
		visuals = diamond
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = koh_i_noor
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_al_taj_crown_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }

	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = al_taj_crown_name
		description = al_taj_crown_description
		template = crown_wearable_template
		type = helmet
		visuals = al_taj_crown
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
			date = 670.1.1 #To order entries correctly
		}
		modifier = al_taj_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = al_taj
		save_scope_as = epic
		set_variable = {
			name = artifact_succession_title
			value = title:d_shiite #Caliphate
		}
		add_artifact_title_history = {
			target = title:d_shiite #Caliphate
			date = 881.1.1
		}
	}
}

create_artifact_wall_banner_thankfulness_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_wall_banner_thankfulness_name
		description = artifact_wall_banner_thankfulness_description
		template = banner_thankfulness
		type = wall_big
		visuals = banner_islam
		visuals_source = title:d_sunni
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
			date = 670.1.1 #To order entries correctly
		}
		modifier = banner_thankfulness
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = banner_thankfulness
		save_scope_as = epic
		set_variable = {
			name = artifact_succession_title
			value = title:d_shiite #Caliphate
		}
		add_artifact_title_history = {
			target = title:d_shiite #Caliphate
			date = 881.1.1
		}
	}
}

create_artifact_arms_of_alexander_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_arms_of_alex_name
		description = artifact_arms_of_alex_description
		template = general_unique_template
		type = pedestal
		visuals = pedestal_alexander_armor
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = alexander_the_great_armor_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_turquoise_throne_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		type = throne_special
		template = general_unique_template
		visuals = throne_turquoise
		wealth = scope:wealth
		quality = scope:quality
		name = turquoise_throne_name
		description = turquoise_throne_description
		history = {
			type = created_before_history
		}
		modifier = turquoise_throne_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_peacock_throne_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_illustrious = yes

	# Create the artifact
	create_artifact = {
		type = throne_special
		template = general_unique_template
		visuals = throne_peacock
		wealth = scope:wealth
		quality = scope:quality
		name = peacock_throne_name
		description = peacock_throne_description
		history = {
			type = created_before_history
		}
		modifier = peacock_throne_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_spear_of_the_prophet_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_spear_of_the_prophet_name
		description = artifact_spear_of_the_prophet_description
		type = pedestal
		visuals = spear_court
		template = islam_artifact_template
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = spear_prophet_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = spear_of_the_prophet
		save_scope_as = epic
		set_variable = {
			name = artifact_succession_title
			value = title:d_sunni
		}
	}
}

create_artifact_mantle_of_the_prophet_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_mantle_of_the_prophet_islam_name
		description = artifact_mantle_of_the_prophet_description
		template = islam_artifact_template
		type = regalia_simple
		visuals = regalia
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = mantle_prophet_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = {
			name = relic
			value = flag:islamic
		}
		set_variable = mantle_of_prophet
		save_scope_as = epic
		set_variable = {
			name = artifact_succession_title
			value = title:d_sunni
		}
	}
}

create_artifact_sculpture_babr_e_bayan_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_sculpture_armor_babr_name
		description = artifact_sculpture_armor_babr
		type = sculpture
		template = babr_template
		visuals = sculpture_babr_e_bayan
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = babr_e_bayan_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_pedestal_justinian_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_crown_justinian_name
		description = artifact_pedestal_crown_justinian
		type = pedestal
		template = justinian_template
		visuals = pedestal_justinian
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 527.4.1
			recipient = character:70512 #Justinian the Great
			location = province:496 #Constantinople
		}
		modifier = justinian_crown_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = crown_of_justinian
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 565.11.14
		}
		save_scope_as = epic
	}	
}

create_artifact_statue_constantine_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_statue_constantine_name
		description = artifact_statue_constantine
		type = sculpture
		visuals = statue_constantine
		wealth = scope:wealth
		quality = scope:quality
		template = statue_constantine_template
		history = {
			type = created
			date = 330.1.1
			recipient = character:70523 #Constantine the Great
			location = province:496 #Constantinople
		}
		modifier = statue_constantine_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = statue_constantine
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 330.1.1
		}
	}
}

create_artifact_tree_automa_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_tree_automa_name
		description = artifact_tree_automa
		type = pedestal
		visuals = tree_automa
		wealth = scope:wealth
		quality = scope:quality
		template = tree_automa_template
		history = {
			type = created_before_history
		}
		modifier = tree_automa_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		#set_variable = tree_automa
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 940.1.1
		}
	}
}

create_artifact_statue_four_tetrarchs_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_statue_four_tetrarchs_name
		description = artifact_statue_four_tetrarchs_desc
		type = wall_small
		visuals = statue_four_tetarchs
		wealth = scope:wealth
		quality = scope:quality
		template = tree_automa_template
		history = {
			type = created_before_history
		}
		modifier = statue_four_tetrarchs_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 940.1.1
		}
	}
}

create_artifact_statue_roman_woman_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_statue_roman_woman_name
		description = artifact_statue_roman_woman_desc
		type = sculpture
		visuals = statue_roman_woman
		wealth = scope:wealth
		quality = scope:quality
		template = statue_roman_woman_template
		history = {
			type = created_before_history
		}
		modifier = statue_roman_woman_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 940.1.1
		}
	}
}

create_artifact_hydraulic_organ_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_hydraulic_organ_name
		description = artifact_hydraulic_organ_desc
		type = sculpture
		visuals = hydraulic_organ
		wealth = scope:wealth
		quality = scope:quality
		template = hydraulic_organ_template
		history = {
			type = created_before_history
		}
		modifier = hydraulic_organ_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:e_byzantium
			date = 940.1.1
		}
	}
}

create_artifact_heirloom_seal_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	# Get artifact quality and wealth
	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = heirloom_seal.name
		description = heirloom_seal.desc
		creator = scope:owner
		visuals = special_seal
		type = seal_of_investiture_court
		wealth = scope:wealth
		quality = scope:quality
		modifier = heirloom_seal_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = heirloom_seal
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:h_china
			date = 1.1.1 #Actually 221 BCE
		}
	}
}

create_artifact_military_classics_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_masterwork = yes

	# Create the artifact
	create_artifact = {
		name = artifact_military_classics_name
		description = artifact_military_classics_description
		type = book
		visuals = book
		wealth = scope:wealth
		quality = scope:quality
		template = general_unique_template
		history = {
			type = created_before_history
		}
		modifier = complete_essentials_for_the_military_classics
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = military_classics
		add_artifact_title_history = {
			target = title:h_china
			date = 1044.1.1
		}
		save_scope_as = epic
	}
}

create_artifact_eight_fold_chest_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_illustrious = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_eight_fold_chest_name
		description = artifact_eight_fold_chest_description
		template = buddhism_relic_template
		type = pedestal
		visuals = small_box
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = eight_fold_chest_modifier
		save_scope_as = newly_created_artifact
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = eight_fold_chest
		set_variable = {
			name = relic
			value = flag:buddhism
		}
		add_artifact_title_history = {
			target = title:h_china
			date = 650.1.1
		}
		save_scope_as = epic
	}
}


create_artifact_chinese_armillary_sphere_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_armillary_sphere_china_name
		description = artifact_armillary_sphere_china_desc
		type = scientific_apparatus
		visuals = fp2_armillary_sphere
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = artifact_chinese_armillary_sphere
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = chinese_armillary_sphere
		save_scope_as = epic
		add_artifact_title_history = {
			target = title:h_china
			date = 125.1.1
		}
	}
}

create_artifact_pedestal_baekje_incense_burner_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_famed = yes

	# Create the artifact
	create_artifact = {	
		name = artifact_pedestal_baekje_incense_burner_name
		description = artifact_pedestal_baekje_incense_burner_description
		type = pedestal
		template = general_unique_template
		visuals = incense_burner_artifact
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created_before_history
		}
		modifier = insence_burner_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

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

create_artifact_pedestal_sakanoue_sword_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_famed = yes
	# Create the artifact
	create_artifact = {
		name = artifact_pedestal_sakanoue_sword_name
		description = artifact_pedestal_sakanoue_sword_desc
		type = pedestal
		visuals = pedestal_sword_japan_single
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 785.1.1
			recipient = character:japanese_sakanoue_1 # Sakanoue Tamuramaro
			location = province:10603 # Kyoto
		}
		modifier = sakanoue_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_artifact_history = {
			type = given
			date = 811.6.17
			recipient = character:japanese_yamato_26 # Emperor Saga
		}
		add_artifact_title_history = {
			target = title:k_chrysanthemum_throne
			date = 811.6.17
		}
	}
}

create_artifact_higekiri_sword_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_masterwork = yes
	# Create the artifact
	create_artifact = {
		name = artifact_higekiri_sword_name
		description = artifact_higekiri_sword_desc
		type = sword
		visuals = japanese_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 950.1.1
			recipient = character:japanese_minamoto_seiwa_3 # Minamoto Mitsunaka
			location = province:10528 # Dazaifu (Chikuzen)
		}
		modifier = higekiri_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_artifact_title_history = {
			target = title:c_nf_minamoto_kawachi
			date = 1021.1.1
		}
	}
}

create_artifact_hizamaru_sword_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_masterwork = yes
	# Create the artifact
	create_artifact = {
		name = artifact_hizamaru_sword_name
		description = artifact_hizamaru_sword_desc
		type = sword
		visuals = japanese_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 950.1.1
			recipient = character:japanese_minamoto_seiwa_3 # Minamoto Mitsunaka
			location = province:10528 # Dazaifu (Chikuzen)
		}
		modifier = hizamaru_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
	}
}

create_artifact_dojigiri_sword_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_masterwork = yes
	# Create the artifact
	create_artifact = {
		name = artifact_dojigiri_sword_name
		description = artifact_dojigiri_sword_desc
		type = sword
		visuals = japanese_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 880.1.1
			recipient = character:japanese_fujiwara_577 # Fujiwara Toshihito
			location = province:10627 # Kume (Hoki)
		}
		modifier = dojigiri_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
	}
}

create_artifact_mikazuki_munechika_sword_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_masterwork = yes
	# Create the artifact
	create_artifact = {
		name = artifact_mikazuki_munechika_sword_name
		description = artifact_mikazuki_munechika_sword_desc
		type = sword
		visuals = japanese_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 980.1.1
			recipient = character:japanese_fujiwara_84 # Kampaku Yoritada
			location = province:10603 # Kyoto (Sanjo)
		}
		modifier = mikazuki_munechika_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
	}
}

create_artifact_odenta_sword_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_masterwork = yes
	# Create the artifact
	create_artifact = {
		name = artifact_odenta_sword_name
		description = artifact_odenta_sword_desc
		type = sword
		visuals = japanese_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 1082.1.1
			recipient = character:japanese_fujiwara_84 # Kampaku Yoritada
			location = province:10533 # Mii (Chikugo)
		}
		modifier = odenta_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
	}
}

create_artifact_pedestal_hamayumi_bow_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_masterwork = yes
	# Create the artifact
	create_artifact = {
		name = artifact_pedestal_hamayumi_bow_name
		description = artifact_pedestal_hamayumi_bow_desc
		type = pedestal
		visuals = japan_bow
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 1145.1.1
			recipient = character:japanese_minamoto_seiwa_59 # Minamoto Yorimasa
			location = province:10603 # Kyoto
		}
		modifier = hamayumi_bow_modifier
		save_scope_as = newly_created_artifact
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_artifact_history = {
			type = given
			date = 1150.1.1
			recipient = character:japanese_yamato_50 # Emperor Konoe
		}
		add_artifact_title_history = {
			target = title:k_chrysanthemum_throne
			date = 1150.1.1
		}
	}
}

create_artifact_pedestal_seven_branched_sword_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_illustrious = yes
	# Create the artifact
	create_artifact = {
		name = artifact_pedestal_seven_branched_sword_name
		description = artifact_pedestal_seven_branched_sword_desc
		type = pedestal
		visuals = seven_branched_sword_artifact
		wealth = scope:wealth
		quality = scope:quality
		history = { type = created_before_history }
		modifier = seven_branched_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_artifact_history = {
			type = given
			date = 503.3.3
			recipient = character:japanese_yamato_192 # Emperor Keitai
		}
		add_artifact_title_history = {
			target = title:k_chrysanthemum_throne
			date = 503.3.3
		}
	}
}

create_artifact_pedestal_gyerimro_dagger_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_illustrious = yes
	# Create the artifact
	create_artifact = {
		name = artifact_pedestal_gyerimro_dagger_name
		description = artifact_pedestal_gyerimro_dagger_desc
		type = pedestal
		visuals = gyerimro_dagger_artifact
		wealth = scope:wealth
		quality = scope:quality
		history = { type = created_before_history }
		modifier = gyerimro_dagger_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
	}
}

create_artifact_karakawa_armor_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_famed = yes
	# Create the artifact
	create_artifact = {
		name = artifact_karakawa_armor_name
		description = artifact_karakawa_armor_desc
		type = armor_brigandine
		visuals = armor_japan
		wealth = scope:wealth
		quality = scope:quality
		history = { type = created_before_history }
		modifier = karakawa_armor_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
	}
}

create_artifact_nukemaru_sword_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_masterwork = yes
	# Create the artifact
	create_artifact = {
		name = artifact_nukemaru_sword_name
		description = artifact_nukemaru_sword_desc
		type = sword
		visuals = japanese_sword
		wealth = scope:wealth
		quality = scope:quality
		history = { type = created_before_history }
		modifier = nukemaru_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_artifact_history = {
			type = given
			date = 1120.1.1
			recipient = character:japanese_taira_kanmu_32 # Tadamori
		}
	}
}

create_artifact_kogarasumaru_sword_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_famed = yes
	# Create the artifact
	create_artifact = {
		name = artifact_kogarasumaru_sword_name
		description = artifact_kogarasumaru_sword_desc
		type = sword
		visuals = japanese_sword
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = created
			date = 940.1.1
			recipient = character:japanese_yamato_35 # Suzaku
			location = province:10603 # Kyoto
		}
		modifier = kogarasumaru_sword_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}
	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		add_artifact_history = {
			type = given
			date = 945.1.1
			recipient = character:japanese_taira_kanmu_16 # Sadamori
		}
	}
}

