﻿create_artifact_bones_of_mark_the_evangelist_inventio_sancti_marci_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_bones_of_mark_the_evangelist_name
		description = artifact_bones_of_mark_the_evangelist_description
		template = christian_relic_template
		type = pedestal
		visuals = bones_of_mark_the_evangelist
		wealth = scope:wealth
		quality = scope:quality
		history = {
			type = stolen
			date = 828.1.31 #Arrival of the stolen bones in Venice.
                        actor = character:184022 #Giustiniano Participazio
			recipient = character:161519 #Markos II
			location = province:2517 #Venice
		}
		modifier = bones_of_mark_the_evangelist_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = bones_of_mark_the_evangelist
		set_variable = christian_relic
		add_artifact_history = {
			type = inherited
			date = 829.1.1
			recipient = character:184023 #Giovanni I Participazio
		}
		add_artifact_history = {
			type = inherited
			date = 837.1.1
			recipient = character:184052 #Pietro Tradonico
		}
		add_artifact_history = {
			type = inherited
			date = 864.7.13
			recipient = character:184026 #Orso I Participazio
		}
		add_artifact_history = {
			type = inherited
			date = 881.1.1
			recipient = character:184028 #Giovanni II Participazio
		}
		add_artifact_history = {
			type = inherited
			date = 887.1.1
			recipient = character:184036 #Pietro I Candiano
		}
		add_artifact_history = {
			type = inherited
			date = 888.1.1
			recipient = character:184054 #Pietro I Tribuno
		}
		add_artifact_history = {
			type = inherited
			date = 912.1.1
			recipient = character:184081 #Orso II Participazio
		}
		add_artifact_history = {
			type = inherited
			date = 932.1.1
			recipient = character:184042 #Pietro II Candiano
		}
		add_artifact_history = {
			type = inherited
			date = 939.1.1 
			recipient = character:184059 #Pietro Participazio
		}
		add_artifact_history = {
			type = inherited
			date = 942.1.1
			recipient = character:184044 #Pietro III Candiano
		}
		add_artifact_history = {
			type = inherited
			date = 959.1.1
			recipient = character:184048 #Pietro IV Candiano
		}
		add_artifact_history = {
			type = inherited
			date = 976.1.1
			recipient = character:539 #Pietro I Orseolo
		}
		add_artifact_history = {
			type = discovered
			date = 1094.6.25
                        actor = scope:realm_priest
			recipient = scope:venezia_holder
			location = province:2517 #Venice
		}
		add_artifact_title_history = {
			target = title:c_venezia
			date = 1094.6.25
		}
		save_scope_as = epic
		set_variable = {
			name = relic
			value = flag:christian
		}
		set_variable = {
			name = artifact_succession_title
			value = title:c_venezia
		}
	}
}

holy_stuff_inventio_sancti_marci_scripted_effect = {
      
	scope:venezia = {
		add_county_modifier = {
			modifier = inventio_sancti_marci_modifier
		}
	}
}