﻿###############################
### Artifact related sGUI's ###
###############################

# Determines if player can open crafting GUI
can_craft_artifacts = {
	is_shown = { always = yes }
	
	is_valid = { NOT = { culture = culture:wastelands } }
}

can_use_base_modifier = {
	is_valid = {
		trigger_if = {
			limit = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:armor_artifact
			}
		}
		trigger_else_if = {
			limit = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:helmet_artifact
				var:artifact_craft ?= flag:armor_artifact
			}
		}
		trigger_else_if = {
			limit = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:helmet_artifact
				var:artifact_craft ?= flag:armor_artifact
			}
		}
		trigger_else_if = {
			limit = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:helmet_artifact
				var:artifact_craft ?= flag:armor_artifact
			}
		}
		trigger_else_if = {
			limit = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:helmet_artifact
				var:artifact_craft ?= flag:armor_artifact
			}
		}
		trigger_else = { always = no }
	}
}

# Determines what type of metal modifiers to show

prowess_modifiers_shown = {
	is_valid = {
		OR = {
			var:artifact_craft ?= flag:weapon_artifact
			var:artifact_craft ?= flag:helmet_artifact
			var:artifact_craft ?= flag:armor_artifact
		}
	}
}

# Clears all appropriate variables from the character
select_no_artifact_type = {
	is_valid = {
		has_variable = artifact_craft
		custom_tooltip = {
			text = crafting_artifact_time_tt
			NOT = { has_variable = craft_time }
		}
	}
	effect = {
		# debug_log = " Artifact Var removed "
		hidden_effect = {
			if = {
				limit = {
					exists = var:selected_artifact
					var:selected_artifact.var:crafter = root
				}
				destroy_artifact = var:selected_artifact
			}
		}
		remove_crafting_artifact_variables = yes
	}
}

## Applies a var to a character to determine what TYPE of artifact he is crafting
select_weapon_artifact_type = {
	effect = { setting_starting_variables = { TYPE = weapon } }
}
select_armor_artifact_type = {
	effect = { setting_starting_variables = { TYPE = armor } }
}
select_regalia_artifact_type = {
	effect = { setting_starting_variables = { TYPE = regalia } }
}
select_helmet_artifact_type = {
	effect = { setting_starting_variables = { TYPE = helmet } }
}
select_trinket_artifact_type = {
	effect = { setting_starting_variables = { TYPE = trinket } }
}
select_crafting_tools_artifact_type = {
	effect = { setting_starting_variables = { TYPE = crafting_tools } }
}

#######################################
### Material (Metal) related sGUI's ###
#######################################

## Checks whether character can use a certain material (checks county modifiers)
mithril_crafting_modifier_prowess_county = {
	is_valid = {
		OR = {
			has_variable = mithril
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_mithril_province_modifier }
		}
	}
}
gold_crafting_modifier_prowess_county = {
	is_valid = { 
		OR = {
			has_variable = gold
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_gold_province_modifier }
		}
	}
}
silver_crafting_modifier_prowess_county = {
	is_valid = {
		OR = {
			has_variable = silver
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_silver_province_modifier }
		}
	}
}
steel_crafting_modifier_prowess_county = {
	is_valid = {
		OR = {
			has_variable = iron
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_iron_province_modifier }
		}
	}
}
iron_crafting_modifier_prowess_county = {
	is_valid = {
		OR = {
			has_variable = iron
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_iron_province_modifier }
		}
	}
}
bronze_crafting_modifier_prowess_county = {
	is_valid = {
		OR = {
			AND = {
				contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
				contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
			}
			AND = {
				contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
				has_variable = tin
			}
			AND = {
				contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
				has_variable = copper
			}
			AND = {
				has_variable = tin
				has_variable = copper
			}
		}
	}
}
copper_crafting_modifier_prowess_county = {
	is_valid = {
		OR = {
			has_variable = copper
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
		}
	}
}
tin_crafting_modifier_prowess_county = {
	is_valid = {
		OR = {
			has_variable = tin
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
		}
	}
}
lead_crafting_modifier_prowess_county = {
	is_valid = {
		OR = {
			has_variable = lead
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_lead_province_modifier }
		}
	}
}
## Checks whether character can use a certain material (checks county modifiers)
mithril_crafting_modifier_prestige_county = {
	is_valid = {
		OR = {
			has_variable = mithril
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_mithril_province_modifier }
		}
	}
}
gold_crafting_modifier_prestige_county = {
	is_valid = { 
		OR = {
			has_variable = gold
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_gold_province_modifier }
		}
	}
}
silver_crafting_modifier_prestige_county = {
	is_valid = {
		OR = {
			has_variable = silver
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_silver_province_modifier }
		}
	}
}
steel_crafting_modifier_prestige_county = {
	is_valid = {
		OR = {
			has_variable = iron
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_iron_province_modifier }
		}
	}
}
iron_crafting_modifier_prestige_county = {
	is_valid = {
		OR = {
			has_variable = iron
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_iron_province_modifier }
		}
	}
}
bronze_crafting_modifier_prestige_county = {
	is_valid = {
		OR = {
			AND = {
				contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
				contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
			}
			AND = {
				contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
				has_variable = tin
			}
			AND = {
				contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
				has_variable = copper
			}
			AND = {
				has_variable = tin
				has_variable = copper
			}
		}
	}
}
copper_crafting_modifier_prestige_county = {
	is_valid = {
		OR = {
			has_variable = copper
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
		}
	}
}
tin_crafting_modifier_prestige_county = {
	is_valid = {
		OR = {
			has_variable = tin
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
		}
	}
}
lead_crafting_modifier_prestige_county = {
	is_valid = {
		OR = {
			has_variable = lead
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_lead_province_modifier }
		}
	}
}

## Adds variable to character to determine what he is using to craft artifact with
mithril_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:mithril_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = mithril MODIFIER = prowess COST = 75 } }
	}
}
gold_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:gold_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = gold MODIFIER = prowess COST = 75 } }
	}
}
silver_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:silver_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = silver MODIFIER = prowess COST = 75 } }
	}
}
steel_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:steel_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = steel MODIFIER = prowess COST = 50 } }
	}
}
iron_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:iron_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = iron MODIFIER = prowess COST = 50 } }
	}
}
bronze_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = { 
				has_variable = used_material
				var:used_material = flag:bronze_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = bronze MODIFIER = prowess COST = 50 } }
	}
}
copper_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:copper_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = copper MODIFIER = prowess COST = 45 } }
	}
}
tin_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:tin_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = tin MODIFIER = prowess COST = 45 } }
	}
}
lead_crafting_modifier_prowess_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:lead_crafting_modifier_prowess
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = lead MODIFIER = prowess COST = 45 } }
	}
}

## Adds variable to character to determine what he is using to craft artifact with
mithril_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:mithril_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = mithril MODIFIER = prestige COST = 75 } }
	}
}
gold_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:gold_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = gold MODIFIER = prestige COST = 75 } }
	}
}
silver_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:silver_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = silver MODIFIER = prestige COST = 75 } }
	}
}
steel_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:steel_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = steel MODIFIER = prestige COST = 50 } }
	}
}
iron_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:iron_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = iron MODIFIER = prestige COST = 50 } }
	}
}
bronze_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = { 
				has_variable = used_material
				var:used_material = flag:bronze_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = bronze MODIFIER = prestige COST = 50 } }
	}
}
copper_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:copper_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = copper MODIFIER = prestige COST = 45 } }
	}
}
tin_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:tin_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = tin MODIFIER = prestige COST = 45 } }
	}
}
lead_crafting_modifier_prestige_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_material
				var:used_material = flag:lead_crafting_modifier_prestige
			}
			deselect_crafting_metal = yes
		}
		else = { setting_crafting_metal_variables = { METAL = lead MODIFIER = prestige COST = 45 } }
	}
}

#######################################
### Material (Gems) related sGUI's ###
#######################################

## Checks whether character can use a certain material (checks county modifiers)
elven_gems_crafting_modifier_county = {
	is_valid = {
		OR = {
			culture = culture:noldor
			has_variable = elven_gems
		}
	}
}
diamond_crafting_modifier_county = {
	is_valid = {
		OR = {
			has_variable = diamond
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_diamond_province_modifier }
		}
	}
}
emerald_crafting_modifier_county = {
	is_valid = { 
		OR = {
			has_variable = emerald
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_emerald_province_modifier }
		}
	}
}
sapphire_crafting_modifier_county = {
	is_valid = {
		OR = {
			has_variable = sapphire
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_sapphire_province_modifier }
		}
	}
}
ruby_crafting_modifier_county = {
	is_valid = {
		OR = {
			has_variable = ruby
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_ruby_province_modifier }
		}
	}
}
amethyst_crafting_modifier_county = {
	is_valid = {
		OR = {
			has_variable = amethyst
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_amethyst_province_modifier }
		}
	}
}
onyx_crafting_modifier_county = {
	is_valid = {
		OR = {
			has_variable = onyx
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_onyx_province_modifier }
		}
	}
}
peridot_crafting_modifier_county = {
	is_valid = {
		OR = {
			has_variable = peridot
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_peridot_province_modifier }
		}
	}
}
quartz_crafting_modifier_county = {
	is_valid = {
		OR = {
			has_variable = quartz
			contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_quartz_province_modifier }
		}
	}
}

## Adds variable to character to determine what he is using to craft artifact with
elven_gems_crafting_modifier_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_gem
				var:used_gem = flag:elven_gems_crafting_modifier
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = elven_gems COST = 100 } }
	}
}
diamond_crafting_modifier_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_gem
			 	var:used_gem = flag:diamond_crafting_modifier
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = diamond COST = 75 } }
	}
}
emerald_crafting_modifier_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_gem
				var:used_gem = flag:emerald_crafting_modifier
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = emerald COST = 50 } }
	}
}
sapphire_crafting_modifier_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_gem
				var:used_gem = flag:sapphire_crafting_modifier
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = sapphire COST = 50 } }
	}
}
ruby_crafting_modifier_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_gem
				var:used_gem = flag:ruby_crafting_modifier 
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = ruby COST = 50 } }
	}
}
amethyst_crafting_modifier_material = {
	effect = {
		if = {
			limit = { 
				has_variable = used_gem
				var:used_gem = flag:amethyst_crafting_modifier 
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = amethyst COST = 50 } }
	}
}
onyx_crafting_modifier_material = {
	effect = {
		if = {
			limit = { 
				has_variable = used_gem
				var:used_gem = flag:onyx_crafting_modifier 
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = onyx COST = 25 } }
	}
}
peridot_crafting_modifier_material = {
	effect = {
		if = {
			limit = {
				has_variable = used_gem 
				var:used_gem = flag:peridot_crafting_modifier 
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = peridot COST = 25 } }
	}
}
quartz_crafting_modifier_material = {
	effect = {
		if = {
			limit = { 
				has_variable = used_gem
				var:used_gem = flag:quartz_crafting_modifier 
			}
			deselect_crafting_gem = yes
		}
		else = { setting_crafting_gem_variables = { GEM = quartz COST = 25 } }
	}
}

refresh_materials = {
	is_valid = {
		OR = {
			trigger_if = {
				limit = { has_variable = used_material }
				NOT = { var:used_material = flag:no_material } 
			}
			has_variable = used_gem
			any_in_list = {
				variable = artifact_crafting_modifiers
			}
		}
	}
	effect = {
		refresh_button_effect = yes
	}
}

##################################
### Base Stat Modifiers sGUI's ###
##################################

## Diplomacy 
artifact_diplomacy_positive = {
	is_valid = {
		has_trait = lifestyle_artifact_crafting
		valid_increase_base_stat_modifier = { BASE_STAT = diplomacy_val }
		NOT = { has_variable = craft_time }
		crafting_lifestyle_valid_tier_base_stat = { 
			VALUE = 5
			NAME = diplomacy_val 
		}
		custom_tooltip = {
			text = artifact_crafting_diplomacy.tt
			OR = {
				var:artifact_craft ?= flag:helmet_artifact
				var:artifact_craft ?= flag:trinket_artifact
				var:artifact_craft ?= flag:armor_artifact
				var:artifact_craft ?= flag:regalia_artifact
			}
		}
	}
	effect = {
		if = {
			limit = { has_trait = lifestyle_artifact_crafting }
			custom_description_no_bullet = { text = increase_enhancement_modifier }
		}
		artifact_crafting_modifier_effect_increase = { 
			VALUE = diplomacy_val 
			NAME = artifact_diplomacy
		}
	}
}
artifact_diplomacy_negative = {
	is_valid = {
		valid_decrease_base_stat_modifier = { BASE_STAT = diplomacy_val }
		NOT = { has_variable = craft_time }
		custom_tooltip = {
			text = artifact_crafting_diplomacy.tt
			OR = {
				var:artifact_craft ?= flag:helmet_artifact
				var:artifact_craft ?= flag:trinket_artifact
				var:artifact_craft ?= flag:armor_artifact
				var:artifact_craft ?= flag:regalia_artifact
			}
		}
	}
	effect = {
		artifact_crafting_modifier_effect_decrease = { 
			VALUE = diplomacy_val 
			NAME = artifact_diplomacy
		}
	}
}

## Martial
artifact_martial_positive = {
	is_valid = {
		has_trait = lifestyle_artifact_crafting
		valid_increase_base_stat_modifier = { BASE_STAT = martial_val }
		NOT = { has_variable = craft_time }
		crafting_lifestyle_valid_tier_base_stat = {
			VALUE = 5
			NAME = martial_val
		}
		custom_tooltip = {
			text = artifact_crafting_martial.tt
			OR = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:armor_artifact
			}
		}
	}
	effect = {
		if = {
			limit = { has_trait = lifestyle_artifact_crafting }
			custom_description_no_bullet = { text = increase_enhancement_modifier }
		}
		artifact_crafting_modifier_effect_increase = {
			VALUE = martial_val 
			NAME = artifact_martial
		}
	}
}
artifact_martial_negative = {
	is_valid = {
		valid_decrease_base_stat_modifier = { BASE_STAT = martial_val }
		NOT = { has_variable = craft_time }
		custom_tooltip = {
			text = artifact_crafting_martial.tt
			OR = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:armor_artifact
			}
		}
	}
	effect = {
		artifact_crafting_modifier_effect_decrease = { 
			VALUE = martial_val 
			NAME = artifact_martial
		}
	}
}

## Stewardship
artifact_stewardship_positive = {
	is_valid = {
		has_trait = lifestyle_artifact_crafting
		valid_increase_base_stat_modifier = { BASE_STAT = stewardship_val }
		NOT = { has_variable = craft_time }
		crafting_lifestyle_valid_tier_base_stat = {
			VALUE = 5
			NAME = stewardship_val
		}
		custom_tooltip = {
			text = artifact_crafting_stewardship.tt
			OR = {
				var:artifact_craft ?= flag:trinket_artifact
			}
		}
	}
	effect = {
		if = {
			limit = { has_trait = lifestyle_artifact_crafting }
			custom_description_no_bullet = { text = increase_enhancement_modifier }
		}
		artifact_crafting_modifier_effect_increase = { 
			VALUE = stewardship_val 
			NAME = artifact_stewardship
		}
	}
}
artifact_stewardship_negative = {
	is_valid = {
		valid_decrease_base_stat_modifier = { BASE_STAT = stewardship_val }
		NOT = { has_variable = craft_time }
		custom_tooltip = {
			text = artifact_crafting_stewardship.tt
			OR = {
				var:artifact_craft ?= flag:trinket_artifact
			}
		}
	}
	effect = {
		artifact_crafting_modifier_effect_decrease = { 
			VALUE = stewardship_val 
			NAME = artifact_stewardship
		}
	}
}

## Intrigue
artifact_intrigue_positive = {
	is_valid = {
		has_trait = lifestyle_artifact_crafting
		valid_increase_base_stat_modifier = { BASE_STAT = intrigue_val }
		NOT = { has_variable = craft_time }
		crafting_lifestyle_valid_tier_base_stat = {
			VALUE = 5
			NAME = intrigue_val
		}
		custom_tooltip = {
			text = artifact_crafting_intrigue.tt
			OR = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:trinket_artifact
				var:artifact_craft ?= flag:regalia_artifact
			}
		}
	}
	effect = {
		if = {
			limit = { has_trait = lifestyle_artifact_crafting }
			custom_description_no_bullet = { text = increase_enhancement_modifier }
		}
		artifact_crafting_modifier_effect_increase = { 
			VALUE = intrigue_val 
			NAME = artifact_intrigue
		}
	}
}
artifact_intrigue_negative = {
	is_valid = {
		valid_decrease_base_stat_modifier = { BASE_STAT = intrigue_val }
		NOT = { has_variable = craft_time }
		custom_tooltip = {
			text = artifact_crafting_intrigue.tt
			OR = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:trinket_artifact
				var:artifact_craft ?= flag:regalia_artifact
			}
		}
	}
	effect = {
		artifact_crafting_modifier_effect_decrease = { 
			VALUE = intrigue_val 
			NAME = artifact_intrigue
		}
	}
}

## Learning
artifact_learning_positive = {
	is_valid = {
		has_trait = lifestyle_artifact_crafting
		valid_increase_base_stat_modifier = { BASE_STAT = learning_val }
		NOT = { has_variable = craft_time }
		crafting_lifestyle_valid_tier_base_stat = {
			VALUE = 5
			NAME = learning_val
		}
		custom_tooltip = {
			text = artifact_crafting_learning.tt
			OR = {
				var:artifact_craft ?= flag:regalia_artifact
				var:artifact_craft ?= flag:helmet_artifact
				var:artifact_craft ?= flag:crafting_tools_artifact
			}
		}
	}
	effect = {
		if = {
			limit = { has_trait = lifestyle_artifact_crafting }
			custom_description_no_bullet = { text = increase_enhancement_modifier }
		}
		artifact_crafting_modifier_effect_increase = { 
			VALUE = learning_val 
			NAME = artifact_learning
		}
	}
}
artifact_learning_negative = {
	is_valid = {
		valid_decrease_base_stat_modifier = { BASE_STAT = learning_val }
		NOT = { has_variable = craft_time }
		custom_tooltip = {
			text = artifact_crafting_learning.tt
			OR = {
				var:artifact_craft ?= flag:regalia_artifact
				var:artifact_craft ?= flag:helmet_artifact
				var:artifact_craft ?= flag:crafting_tools_artifact
			}
		}
	}
	effect = {
		artifact_crafting_modifier_effect_decrease = { 
			VALUE = learning_val 
			NAME = artifact_learning
		}
	}
}

## Prowesss
artifact_prowess_positive = {
	is_valid = {
		has_trait = lifestyle_artifact_crafting
		valid_increase_base_stat_modifier = { BASE_STAT = prowess_val }
		NOT = { has_variable = craft_time }
		crafting_lifestyle_valid_tier_base_stat = {
			VALUE = 5
			NAME = prowess_val
		}
		custom_tooltip = {
			text = artifact_crafting_prowess.tt
			OR = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:crafting_tools_artifact
			}
		}
	}
	effect = {
		if = {
			limit = { has_trait = lifestyle_artifact_crafting }
			custom_description_no_bullet = { text = increase_enhancement_modifier }
		}
		artifact_crafting_modifier_effect_increase = { 
			VALUE = prowess_val 
			NAME = artifact_prowess
		}
	}
}
artifact_prowess_negative = {
	is_valid = {
		valid_decrease_base_stat_modifier = { BASE_STAT = prowess_val }
		NOT = { has_variable = craft_time }
		custom_tooltip = {
			text = artifact_crafting_prowess.tt
			OR = {
				var:artifact_craft ?= flag:weapon_artifact
				var:artifact_craft ?= flag:crafting_tools_artifact
			}
		}
	}
	effect = {
		artifact_crafting_modifier_effect_decrease = { 
			VALUE = prowess_val
			NAME = artifact_prowess
		}
	}
}

###################################
### Enchanting Modifiers sGUI's ###
###################################

artifact_enchanting_modifier_positive = {
	saved_scopes = {
		player_scope
	}
	
	is_valid = {
		scope:player_scope = { has_trait = lifestyle_artifact_crafting }
		
		trigger_if = { # Gatekeeps tier of modifier behind track level
			limit = { 
				switch = {
					trigger = root

					flag:artifact_knight_limit = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_knight_limit_value VALUE = 4 } } 
					}
					flag:artifact_knight_effectiveness = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_knight_effectiveness_value VALUE = 12 } } 
					}
					flag:artifact_controlled_province_advantage = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_controlled_province_advantage_value VALUE = 8 } } 
					}
					flag:artifact_levy_reinforcement_rate_same_faith = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_levy_reinforcement_rate_same_faith_value VALUE = 12 } } 
					}
					flag:artifact_negate_prowess_penalty_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_negate_prowess_penalty_add_value VALUE = 8 } } 
					}
					flag:artifact_raid_speed = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_raid_speed_value VALUE = 12 } } 
					}
					flag:artifact_enemy_hard_casualty_modifier = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_enemy_hard_casualty_modifier_value VALUE = 12 } } 
					}
					flag:artifact_hard_casualty_modifier = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_hard_casualty_modifier_value VALUE = 12 } } 
					}
					flag:artifact_heavy_cavalry_toughness = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_heavy_cavalry_toughness_value VALUE = 4 } } 
					}
					flag:artifact_heavy_infantry_toughness = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_heavy_infantry_toughness_value VALUE = 4 } } 
					}
					flag:artifact_retreat_losses = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_retreat_losses_value VALUE = 4 } } 
					}
					flag:artifact_pursue_efficiency = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_pursue_efficiency_value VALUE = 4 } } 
					}
					flag:artifact_monthly_minor_prestige = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_minor_prestige_value VALUE = 8 } } 
					}
					flag:artifact_monthly_prestige = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_prestige_value VALUE = 8 } } 
					}
					flag:artifact_short_reign_duration_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_short_reign_duration_mult_value VALUE = 8 } } 
					}
					flag:artifact_court_grandeur_baseline_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_court_grandeur_baseline_add_value VALUE = 6 } } 
					}
					flag:artifact_dynasty_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_dynasty_opinion_value VALUE = 8 } } 
					}
					flag:artifact_monthly_dynasty_prestige = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_dynasty_prestige_value VALUE = 4 } } 
					}
					flag:artifact_monthly_prestige_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_prestige_add_value VALUE = 8 } } 
					}
					flag:artifact_monthly_prestige_gain_per_dread_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_prestige_gain_per_dread_add_value VALUE = 4 } } 
					}
					flag:artifact_monthly_prestige_gain_per_knight_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_prestige_gain_per_knight_add_value VALUE = 4 } } 
					}
					flag:artifact_monthly_tyranny = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_tyranny_value VALUE = 8 } } 
					}
					flag:artifact_dread_gain_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_dread_gain_mult_value VALUE = 4 } } 
					}
					flag:artifact_dread_baseline_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_dread_baseline_add_value VALUE = 4 } } 
					}
					flag:artifact_mercenary_hire_cost_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_mercenary_hire_cost_mult_value VALUE = 4 } } 
					}
					flag:artifact_happy_powerful_vassal_tax_contribution_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_happy_powerful_vassal_tax_contribution_mult_value VALUE = 8 } } 
					}
					flag:artifact_courtly_tax_contribution_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_courtly_tax_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_glory_hound_tax_contribution_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_glory_hound_tax_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_parochial_tax_contribution_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_parochial_tax_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_zealot_tax_contribution_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_zealot_tax_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_glory_hound_levy_contribution_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_glory_hound_levy_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_zealot_levy_contribution_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_zealot_levy_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_vassal_limit = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_vassal_limit_value VALUE = 8 } } 
					}
					flag:artifact_courtly_vassal_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_courtly_vassal_opinion_value VALUE = 4 } } 
					}
					flag:artifact_glory_hound_vassal_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_glory_hound_vassal_opinion_value VALUE = 4 } } 
					}
					flag:artifact_parochial_vassal_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_parochial_vassal_opinion_value VALUE = 4 } } 
					}
					flag:artifact_zealot_vassal_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_zealot_vassal_opinion_value VALUE = 4 } } 
					}
					flag:artifact_powerful_vassal_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_powerful_vassal_opinion_value VALUE = 8 } } 
					}
					flag:artifact_independent_ruler_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_independent_ruler_opinion_value VALUE = 8 } } 
					}
					flag:artifact_men_at_arms_maintenance = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_men_at_arms_maintenance_value VALUE = 8 } } 
					}
					flag:artifact_domain_tax_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_domain_tax_mult_value VALUE = 4 } } 
					}
					flag:artifact_build_gold_cost = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_build_gold_cost_value VALUE = 4 } } 
					}
					flag:artifact_courtier_and_guest_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_courtier_and_guest_opinion_value VALUE = 8 } }
					}
					flag:artifact_attraction_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_attraction_opinion_value VALUE = 4 } } 
					}
					flag:artifact_build_time = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_build_time_value VALUE = 4 } } 
					}
					flag:artifact_monthly_income = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_income_value VALUE = 4 } } 
					}
					flag:artifact_monthly_piety = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_piety_value VALUE = 8 } } 
					}
					flag:artifact_monthly_piety_gain_per_knight_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_piety_gain_per_knight_add_value VALUE = 3 } } 
					}
					flag:artifact_domain_tax_same_faith_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_domain_tax_same_faith_mult_value VALUE = 4 } } 
					}
					flag:artifact_monthly_piety_gain_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_piety_gain_mult_value VALUE = 12 } } 
					}
					flag:artifact_same_faith_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_same_faith_opinion_value VALUE = 4 } } 
					}
					flag:artifact_monthly_piety_from_buildings_mult = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_piety_from_buildings_mult_value VALUE = 12 } } 
					}
					flag:artifact_clergy_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_clergy_opinion_value VALUE = 12 } } 
					}
					flag:artifact_church_holding_build_gold_cost = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_church_holding_build_gold_cost_value VALUE = 12 } } 
					}
					flag:artifact_different_faith_opinion = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_different_faith_opinion_value VALUE = 12 } } 
					}
					flag:artifact_owned_hostile_scheme_success_chance_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_owned_hostile_scheme_success_chance_add_value VALUE = 12 } } 
					}
					flag:artifact_owned_personal_scheme_success_chance_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_owned_personal_scheme_success_chance_add_value VALUE = 12 } } 
					}
					flag:artifact_owned_scheme_secrecy_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_owned_scheme_secrecy_add_value VALUE = 12 } } 
					}
					flag:artifact_hostile_scheme_phase_duration_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_hostile_scheme_phase_duration_add_value VALUE = 12 } } 
					}
					flag:artifact_personal_scheme_phase_duration_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_personal_scheme_phase_duration_add_value VALUE = 12 } } 
					}
					flag:artifact_fertility_gain = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_fertility_gain_value VALUE = 4 } } 
					}
					flag:artifact_courting_scheme_phase_duration_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_courting_scheme_phase_duration_add_value VALUE = 4 } } 
					}
					flag:artifact_seduce_scheme_phase_duration_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_seduce_scheme_phase_duration_add_value VALUE = 4 } } 
					}
					flag:artifact_spouse_opinion_add = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_spouse_opinion_add_value VALUE = 4 } } 
					}
					flag:artifact_stress_gain = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_stress_gain_value VALUE = 4 } } 
					}
					flag:artifact_monthly_diplomacy_lifestyle_xp = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_diplomacy_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_monthly_martial_lifestyle_xp = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_martial_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_monthly_stewardship_lifestyle_xp = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_stewardship_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_monthly_intrigue_lifestyle_xp = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_intrigue_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_monthly_learning_lifestyle_xp = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_monthly_learning_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_health_gain = { 
						scope:player_scope = { crafting_lifestyle_valid_tier = { NAME = artifact_health_gain_value VALUE = 4 } } 
					}
				}
			}
			custom_tooltip = {
				text = warning_low_enchanting_track_tt
				always = no
			}
		}

		trigger_if = { # Limits how many tiers of modifier can be added
			limit = { 
				switch = {
					trigger = root

					flag:artifact_knight_limit = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_knight_limit_value VALUE = 4 } } 
					}
					flag:artifact_knight_effectiveness = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_knight_effectiveness_value VALUE = 12 } } 
					}
					flag:artifact_controlled_province_advantage = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_controlled_province_advantage_value VALUE = 8 } } 
					}
					flag:artifact_levy_reinforcement_rate_same_faith = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_levy_reinforcement_rate_same_faith_value VALUE = 12 } } 
					}
					flag:artifact_negate_prowess_penalty_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_negate_prowess_penalty_add_value VALUE = 8 } } 
					}
					flag:artifact_raid_speed = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_raid_speed_value VALUE = 12 } } 
					}
					flag:artifact_enemy_hard_casualty_modifier = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_enemy_hard_casualty_modifier_value VALUE = 12 } } 
					}
					flag:artifact_hard_casualty_modifier = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_hard_casualty_modifier_value VALUE = 12 } } 
					}
					flag:artifact_heavy_cavalry_toughness = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_heavy_cavalry_toughness_value VALUE = 4 } } 
					}
					flag:artifact_heavy_infantry_toughness = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_heavy_infantry_toughness_value VALUE = 4 } } 
					}
					flag:artifact_retreat_losses = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_retreat_losses_value VALUE = 4 } } 
					}
					flag:artifact_pursue_efficiency = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_pursue_efficiency_value VALUE = 4 } } 
					}
					flag:artifact_monthly_minor_prestige = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_minor_prestige_value VALUE = 8 } } 
					}
					flag:artifact_monthly_prestige = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_prestige_value VALUE = 8 } } 
					}
					flag:artifact_short_reign_duration_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_short_reign_duration_mult_value VALUE = 8 } } 
					}
					flag:artifact_court_grandeur_baseline_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_court_grandeur_baseline_add_value VALUE = 6 } } 
					}
					flag:artifact_dynasty_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_dynasty_opinion_value VALUE = 8 } } 
					}
					flag:artifact_monthly_dynasty_prestige = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_dynasty_prestige_value VALUE = 4 } } 
					}
					flag:artifact_monthly_prestige_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_prestige_add_value VALUE = 8 } } 
					}
					flag:artifact_monthly_prestige_gain_per_dread_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_prestige_gain_per_dread_add_value VALUE = 4 } } 
					}
					flag:artifact_monthly_prestige_gain_per_knight_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_prestige_gain_per_knight_add_value VALUE = 4 } } 
					}
					flag:artifact_monthly_tyranny = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_tyranny_value VALUE = 8 } } 
					}
					flag:artifact_dread_gain_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_dread_gain_mult_value VALUE = 4 } } 
					}
					flag:artifact_dread_baseline_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_dread_baseline_add_value VALUE = 4 } } 
					}
					flag:artifact_mercenary_hire_cost_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_mercenary_hire_cost_mult_value VALUE = 4 } } 
					}
					flag:artifact_happy_powerful_vassal_tax_contribution_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_happy_powerful_vassal_tax_contribution_mult_value VALUE = 8 } } 
					}
					flag:artifact_courtly_tax_contribution_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_courtly_tax_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_glory_hound_tax_contribution_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_glory_hound_tax_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_parochial_tax_contribution_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_parochial_tax_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_zealot_tax_contribution_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_zealot_tax_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_glory_hound_levy_contribution_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_glory_hound_levy_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_zealot_levy_contribution_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_zealot_levy_contribution_mult_value VALUE = 4 } } 
					}
					flag:artifact_vassal_limit = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_vassal_limit_value VALUE = 8 } } 
					}
					flag:artifact_courtly_vassal_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_courtly_vassal_opinion_value VALUE = 4 } } 
					}
					flag:artifact_glory_hound_vassal_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_glory_hound_vassal_opinion_value VALUE = 4 } } 
					}
					flag:artifact_parochial_vassal_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_parochial_vassal_opinion_value VALUE = 4 } } 
					}
					flag:artifact_zealot_vassal_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_zealot_vassal_opinion_value VALUE = 4 } } 
					}
					flag:artifact_powerful_vassal_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_powerful_vassal_opinion_value VALUE = 8 } } 
					}
					flag:artifact_independent_ruler_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_independent_ruler_opinion_value VALUE = 8 } } 
					}
					flag:artifact_men_at_arms_maintenance = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_men_at_arms_maintenance_value VALUE = 8 } } 
					}
					flag:artifact_domain_tax_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_domain_tax_mult_value VALUE = 4 } } 
					}
					flag:artifact_build_gold_cost = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_build_gold_cost_value VALUE = 4 }  } 
					}
					flag:artifact_courtier_and_guest_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_courtier_and_guest_opinion_value VALUE = 8 } }
					}
					flag:artifact_attraction_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_attraction_opinion_value VALUE = 4 } } 
					}
					flag:artifact_build_time = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_build_time_value VALUE = 4 } } 
					}
					flag:artifact_monthly_income = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_income_value VALUE = 4 } } 
					}
					flag:artifact_monthly_piety = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_piety_value VALUE = 8 } } 
					}
					flag:artifact_monthly_piety_gain_per_knight_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_piety_gain_per_knight_add_value VALUE = 3 } } 
					}
					flag:artifact_domain_tax_same_faith_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_domain_tax_same_faith_mult_value VALUE = 4 } } 
					}
					flag:artifact_monthly_piety_gain_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_piety_gain_mult_value VALUE = 12 } } 
					}
					flag:artifact_same_faith_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_same_faith_opinion_value VALUE = 4 } } 
					}
					flag:artifact_monthly_piety_from_buildings_mult = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_piety_from_buildings_mult_value VALUE = 12 } } 
					}
					flag:artifact_clergy_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_clergy_opinion_value VALUE = 12 } } 
					}
					flag:artifact_church_holding_build_gold_cost = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_church_holding_build_gold_cost_value VALUE = 12 } } 
					}
					flag:artifact_different_faith_opinion = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_different_faith_opinion_value VALUE = 12 } } 
					}
					flag:artifact_owned_hostile_scheme_success_chance_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_owned_hostile_scheme_success_chance_add_value VALUE = 12 } } 
					}
					flag:artifact_owned_personal_scheme_success_chance_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_owned_personal_scheme_success_chance_add_value VALUE = 12 } } 
					}
					flag:artifact_owned_scheme_secrecy_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_owned_scheme_secrecy_add_value VALUE = 12 } } 
					}
					flag:artifact_hostile_scheme_phase_duration_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_hostile_scheme_phase_duration_add_value VALUE = 12 } } 
					}
					flag:artifact_personal_scheme_phase_duration_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_personal_scheme_phase_duration_add_value VALUE = 12 } } 
					}
					flag:artifact_fertility_gain = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_fertility_gain_value VALUE = 4 } } 
					}
					flag:artifact_courting_scheme_phase_duration_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_courting_scheme_phase_duration_add_value VALUE = 4 } } 
					}
					flag:artifact_seduce_scheme_phase_duration_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_seduce_scheme_phase_duration_add_value VALUE = 4 } } 
					}
					flag:artifact_spouse_opinion_add = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_spouse_opinion_add_value VALUE = 4 } } 
					}
					flag:artifact_stress_gain = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_stress_gain_value VALUE = 4 } } 
					}
					flag:artifact_monthly_diplomacy_lifestyle_xp = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_diplomacy_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_monthly_martial_lifestyle_xp = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_martial_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_monthly_stewardship_lifestyle_xp = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_stewardship_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_monthly_intrigue_lifestyle_xp = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_intrigue_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_monthly_learning_lifestyle_xp = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_monthly_learning_lifestyle_xp_value VALUE = 4 } } 
					}
					flag:artifact_health_gain = { 
						scope:player_scope = { valid_increase_enchanting_modifier = { NAME = artifact_health_gain_value VALUE = 4 } } 
					}
				}
			}
			always = no
		}

		trigger_if = { # Limits how many tiers of modifier can be added
			limit = { 
				scope:player_scope = { has_variable = artifact_craft }
				
				switch = {
					trigger = root

					flag:artifact_knight_limit = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_knight_effectiveness = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_controlled_province_advantage = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_levy_reinforcement_rate_same_faith = { 
						scope:player_scope = {  
							OR = {
								var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_negate_prowess_penalty_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_raid_speed = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_enemy_hard_casualty_modifier = { 
						scope:player_scope = { 
							OR = {
								# var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_hard_casualty_modifier = { 
						scope:player_scope = { 
							OR = {
								# var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_heavy_cavalry_toughness = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_heavy_infantry_toughness = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_retreat_losses = { 
						scope:player_scope = { 
							OR = {
								# var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_pursue_efficiency = { 
						scope:player_scope = { 
							OR = {
								# var:artifact_craft = flag:trinket_artifact
								var:artifact_craft = flag:regalia_artifact
							}
						} 
					}
					flag:artifact_monthly_minor_prestige = { always = no } # Can always select this one
					flag:artifact_monthly_prestige = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_short_reign_duration_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_court_grandeur_baseline_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_dynasty_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:helmet_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_monthly_dynasty_prestige = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_monthly_prestige_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_monthly_prestige_gain_per_dread_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_monthly_prestige_gain_per_knight_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_monthly_tyranny = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_dread_gain_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_dread_baseline_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_mercenary_hire_cost_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								# var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_happy_powerful_vassal_tax_contribution_mult = { 
						scope:player_scope = {
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_courtly_tax_contribution_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_glory_hound_tax_contribution_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_parochial_tax_contribution_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_zealot_tax_contribution_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_glory_hound_levy_contribution_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_zealot_levy_contribution_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_vassal_limit = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_courtly_vassal_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_glory_hound_vassal_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_parochial_vassal_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_zealot_vassal_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_powerful_vassal_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_independent_ruler_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_men_at_arms_maintenance = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								# var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_domain_tax_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_build_gold_cost = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_courtier_and_guest_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						}
					}
					flag:artifact_attraction_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_build_time = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_monthly_income = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_monthly_piety = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
							}
						} 
					}
					flag:artifact_monthly_piety_gain_per_knight_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:helmet_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_domain_tax_same_faith_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:helmet_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_monthly_piety_gain_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:helmet_artifact
								var:artifact_craft = flag:trinket_artifact
							}
						} 
					}
					flag:artifact_same_faith_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_monthly_piety_from_buildings_mult = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_clergy_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
							}
						} 
					}
					flag:artifact_church_holding_build_gold_cost = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_different_faith_opinion = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_owned_hostile_scheme_success_chance_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_owned_personal_scheme_success_chance_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_owned_scheme_secrecy_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_hostile_scheme_phase_duration_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_personal_scheme_phase_duration_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_fertility_gain = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_courting_scheme_phase_duration_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_seduce_scheme_phase_duration_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_spouse_opinion_add = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_stress_gain = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_monthly_diplomacy_lifestyle_xp = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_monthly_martial_lifestyle_xp = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_monthly_stewardship_lifestyle_xp = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_monthly_intrigue_lifestyle_xp = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_monthly_learning_lifestyle_xp = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
					flag:artifact_health_gain = { 
						scope:player_scope = { 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:weapon_artifact
								var:artifact_craft = flag:helmet_artifact
							}
						} 
					}
				}
			}
			switch = {
				trigger = root

				flag:artifact_knight_limit = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_knight_effectiveness = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_controlled_province_advantage = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_levy_reinforcement_rate_same_faith = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_negate_prowess_penalty_add = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_raid_speed = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_enemy_hard_casualty_modifier = { 
					custom_tooltip = {
						text = "regalia_tt"
						always = no
					} 
				}
				flag:artifact_hard_casualty_modifier = { 
					custom_tooltip = {
						text = "regalia_tt"
						always = no
					} 
				}
				flag:artifact_heavy_cavalry_toughness = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_heavy_infantry_toughness = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_retreat_losses = { 
					custom_tooltip = {
						text = "regalia_tt"
						always = no
					} 
				}
				flag:artifact_pursue_efficiency = { 
					custom_tooltip = {
						text = "regalia_tt"
						always = no
					} 
				}
				flag:artifact_monthly_minor_prestige = { always = no } # Can always select this one
				flag:artifact_monthly_prestige = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_short_reign_duration_mult = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_court_grandeur_baseline_add = { 
					custom_tooltip = {
						text = "armor_weapon_trinket_tt"
						always = no
					} 
				}
				flag:artifact_dynasty_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_trinket_tt"
						always = no
					} 
				}
				flag:artifact_monthly_dynasty_prestige = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_monthly_prestige_add = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_monthly_prestige_gain_per_dread_add = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_monthly_prestige_gain_per_knight_add = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_monthly_tyranny = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_dread_gain_mult = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_dread_baseline_add = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_mercenary_hire_cost_mult = { 
					custom_tooltip = {
						text = "regalia_tt"
						always = no
					} 
				}
				flag:artifact_happy_powerful_vassal_tax_contribution_mult = { 
					custom_tooltip = {
						text = "armor_weapon_trinket_tt"
						always = no
					} 
				}
				flag:artifact_courtly_tax_contribution_mult = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_glory_hound_tax_contribution_mult = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_parochial_tax_contribution_mult = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_zealot_tax_contribution_mult = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_glory_hound_levy_contribution_mult = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_zealot_levy_contribution_mult = { 
					custom_tooltip = {
						text = "trinket_regalia_tt"
						always = no
					} 
				}
				flag:artifact_vassal_limit = { 
					custom_tooltip = {
						text = "armor_weapon_trinket_tt"
						always = no
					} 
				}
				flag:artifact_courtly_vassal_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_glory_hound_vassal_opinion = { 
					custom_tooltip = {
						text = "armor_trinket_tt"
						always = no
					} 
				}
				flag:artifact_parochial_vassal_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_zealot_vassal_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_powerful_vassal_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_independent_ruler_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_men_at_arms_maintenance = { 
					custom_tooltip = {
						text = "regalia_tt"
						always = no
					} 
				}
				flag:artifact_domain_tax_mult = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_build_gold_cost = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_courtier_and_guest_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_attraction_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					}  
				}
				flag:artifact_build_time = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_monthly_income = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_monthly_piety = { 
					custom_tooltip = {
						text = "armor_tt"
						always = no
					}   
				}
				flag:artifact_monthly_piety_gain_per_knight_add = { 
					custom_tooltip = {
						text = "armor_helmet_trinket_tt"
						always = no
					}  
				}
				flag:artifact_domain_tax_same_faith_mult = { 
					custom_tooltip = {
						text = "armor_helmet_trinket_tt"
						always = no
					}  
				}
				flag:artifact_monthly_piety_gain_mult = { 
					custom_tooltip = {
						text = "armor_helmet_trinket_tt"
						always = no
					}  
				}
				flag:artifact_same_faith_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_monthly_piety_from_buildings_mult = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_clergy_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_tt"
						always = no
					} 
				}
				flag:artifact_church_holding_build_gold_cost = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_different_faith_opinion = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_owned_hostile_scheme_success_chance_add = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_owned_personal_scheme_success_chance_add = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_owned_scheme_secrecy_add = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_hostile_scheme_phase_duration_add = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_personal_scheme_phase_duration_add = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_fertility_gain = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_courting_scheme_phase_duration_add = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_seduce_scheme_phase_duration_add = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_spouse_opinion_add = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_stress_gain = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_monthly_diplomacy_lifestyle_xp = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_monthly_martial_lifestyle_xp = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_monthly_stewardship_lifestyle_xp = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_monthly_intrigue_lifestyle_xp = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					} 
				}
				flag:artifact_monthly_learning_lifestyle_xp = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					}
				}
				flag:artifact_health_gain = { 
					custom_tooltip = {
						text = "armor_weapon_helmet_tt"
						always = no
					}
				}
			}
		}
	}

	effect = {
		if = {
			limit = { scope:player_scope = { has_trait = lifestyle_artifact_crafting } }
			custom_description_no_bullet = { text = increase_enhancement_modifier }
		}

		switch = {
			trigger = root

			flag:artifact_knight_limit = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_knight_limit VALUE = artifact_knight_limit MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_knight_effectiveness = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_knight_effectiveness VALUE = artifact_knight_effectiveness MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_controlled_province_advantage = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_controlled_province_advantage VALUE = artifact_controlled_province_advantage MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_levy_reinforcement_rate_same_faith = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_levy_reinforcement_rate_same_faith VALUE = artifact_levy_reinforcement_rate_same_faith MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_negate_prowess_penalty_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_negate_prowess_penalty_add VALUE = artifact_negate_prowess_penalty_add MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_raid_speed = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_raid_speed VALUE = artifact_raid_speed MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_enemy_hard_casualty_modifier = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_enemy_hard_casualty_modifier VALUE = artifact_enemy_hard_casualty_modifier MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_hard_casualty_modifier = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_hard_casualty_modifier VALUE = artifact_hard_casualty_modifier MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_heavy_cavalry_toughness = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_heavy_cavalry_toughness VALUE = artifact_heavy_cavalry_toughness MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_heavy_infantry_toughness = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_heavy_infantry_toughness VALUE = artifact_heavy_infantry_toughness MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_retreat_losses = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_retreat_losses VALUE = artifact_retreat_losses MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_pursue_efficiency = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_pursue_efficiency VALUE = artifact_pursue_efficiency MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_monthly_minor_prestige = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_minor_prestige VALUE = artifact_monthly_minor_prestige MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_monthly_prestige = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_prestige VALUE = artifact_monthly_prestige MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_short_reign_duration_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_short_reign_duration_mult VALUE = artifact_short_reign_duration_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_court_grandeur_baseline_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_court_grandeur_baseline_add VALUE = artifact_court_grandeur_baseline_add MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_dynasty_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_dynasty_opinion VALUE = artifact_dynasty_opinion MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_monthly_dynasty_prestige = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_dynasty_prestige VALUE = artifact_monthly_dynasty_prestige MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_prestige_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_prestige_add VALUE = artifact_monthly_prestige_add MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_monthly_prestige_gain_per_dread_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_prestige_gain_per_dread_add VALUE = artifact_monthly_prestige_gain_per_dread_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_prestige_gain_per_knight_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_prestige_gain_per_knight_add VALUE = artifact_monthly_prestige_gain_per_knight_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_tyranny = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_tyranny VALUE = artifact_monthly_tyranny MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_dread_gain_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_dread_gain_mult VALUE = artifact_dread_gain_mult MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_dread_baseline_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_dread_baseline_add VALUE = artifact_dread_baseline_add MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_mercenary_hire_cost_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_mercenary_hire_cost_mult VALUE = artifact_mercenary_hire_cost_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_happy_powerful_vassal_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_happy_powerful_vassal_tax_contribution_mult VALUE = artifact_happy_powerful_vassal_tax_contribution_mult MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_courtly_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_courtly_tax_contribution_mult VALUE = artifact_courtly_tax_contribution_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_glory_hound_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_glory_hound_tax_contribution_mult VALUE = artifact_glory_hound_tax_contribution_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_parochial_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_parochial_tax_contribution_mult VALUE = artifact_parochial_tax_contribution_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_zealot_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_zealot_tax_contribution_mult VALUE = artifact_zealot_tax_contribution_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_glory_hound_levy_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_glory_hound_levy_contribution_mult VALUE = artifact_glory_hound_levy_contribution_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_zealot_levy_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_zealot_levy_contribution_mult VALUE = artifact_zealot_levy_contribution_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_vassal_limit = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_vassal_limit VALUE = artifact_vassal_limit MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_courtly_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_courtly_vassal_opinion VALUE = artifact_courtly_vassal_opinion MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_glory_hound_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_glory_hound_vassal_opinion VALUE = artifact_glory_hound_vassal_opinion MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_parochial_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_parochial_vassal_opinion VALUE = artifact_parochial_vassal_opinion MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_zealot_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_zealot_vassal_opinion VALUE = artifact_zealot_vassal_opinion MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_powerful_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_powerful_vassal_opinion VALUE = artifact_powerful_vassal_opinion MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_independent_ruler_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_independent_ruler_opinion VALUE = artifact_independent_ruler_opinion MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_men_at_arms_maintenance = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_men_at_arms_maintenance VALUE = artifact_men_at_arms_maintenance MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_domain_tax_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_domain_tax_mult VALUE = artifact_domain_tax_mult MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_build_gold_cost = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_build_gold_cost VALUE = artifact_build_gold_cost MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_courtier_and_guest_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_courtier_and_guest_opinion VALUE = artifact_courtier_and_guest_opinion MODIFIER_VALUE = 15 } }
			}
			flag:artifact_attraction_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_attraction_opinion VALUE = artifact_attraction_opinion MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_build_time = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_build_time VALUE = artifact_build_time MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_income = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_income VALUE = artifact_monthly_income MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_piety = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_piety VALUE = artifact_monthly_piety MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_piety_gain_per_knight_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_piety_gain_per_knight_add VALUE = artifact_monthly_piety_gain_per_knight_add MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_domain_tax_same_faith_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_domain_tax_same_faith_mult VALUE = artifact_domain_tax_same_faith_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_monthly_piety_gain_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_piety_gain_mult VALUE = artifact_monthly_piety_gain_mult MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_same_faith_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_same_faith_opinion VALUE = artifact_same_faith_opinion MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_monthly_piety_from_buildings_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_piety_from_buildings_mult VALUE = artifact_monthly_piety_from_buildings_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_clergy_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_clergy_opinion VALUE = artifact_clergy_opinion MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_church_holding_build_gold_cost = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_church_holding_build_gold_cost VALUE = artifact_church_holding_build_gold_cost MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_different_faith_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_different_faith_opinion VALUE = artifact_different_faith_opinion MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_owned_hostile_scheme_success_chance_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_owned_hostile_scheme_success_chance_add VALUE = artifact_owned_hostile_scheme_success_chance_add MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_owned_personal_scheme_success_chance_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_owned_personal_scheme_success_chance_add VALUE = artifact_owned_personal_scheme_success_chance_add MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_owned_scheme_secrecy_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_owned_scheme_secrecy_add VALUE = artifact_owned_scheme_secrecy_add MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_hostile_scheme_phase_duration_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_hostile_scheme_phase_duration_add VALUE = artifact_hostile_scheme_phase_duration_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_personal_scheme_phase_duration_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_personal_scheme_phase_duration_add VALUE = artifact_personal_scheme_phase_duration_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_fertility_gain = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_fertility_gain VALUE = artifact_fertility_gain MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_courting_scheme_phase_duration_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_courting_scheme_phase_duration_add VALUE = artifact_courting_scheme_phase_duration_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_seduce_scheme_phase_duration_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_seduce_scheme_phase_duration_add VALUE = artifact_seduce_scheme_phase_duration_add MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_spouse_opinion_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_spouse_opinion_add VALUE = artifact_spouse_opinion_add MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_stress_gain = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_stress_gain VALUE = artifact_stress_gain MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_diplomacy_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_diplomacy_lifestyle_xp VALUE = artifact_monthly_diplomacy_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_martial_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_martial_lifestyle_xp VALUE = artifact_monthly_martial_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_stewardship_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_stewardship_lifestyle_xp VALUE = artifact_monthly_stewardship_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_intrigue_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_intrigue_lifestyle_xp VALUE = artifact_monthly_intrigue_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_learning_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_monthly_learning_lifestyle_xp VALUE = artifact_monthly_learning_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_health_gain = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_increase = { NAME = artifact_health_gain VALUE = artifact_health_gain MODIFIER_VALUE = 60 } } 
			}
		}
	}
}

artifact_enchanting_modifier_negative = {
	saved_scopes = {
		player_scope
	}

	is_valid = {
		trigger_if = {  
			limit = { 
				switch = {
					trigger = root
		
					flag:artifact_knight_limit = { scope:player_scope = { NOT = { has_variable = artifact_knight_limit_value } } }
					flag:artifact_knight_effectiveness = { scope:player_scope = { NOT = { has_variable = artifact_knight_effectiveness_value } } }
					flag:artifact_controlled_province_advantage = { scope:player_scope = { NOT = { has_variable = artifact_controlled_province_advantage_value } } }
					flag:artifact_levy_reinforcement_rate_same_faith = { scope:player_scope = { NOT = { has_variable = artifact_levy_reinforcement_rate_same_faith_value } } }
					flag:artifact_negate_prowess_penalty_add = { scope:player_scope = { NOT = { has_variable = artifact_negate_prowess_penalty_add_value } } }
					flag:artifact_raid_speed = { scope:player_scope = { NOT = { has_variable = artifact_raid_speed_value } } }
					flag:artifact_enemy_hard_casualty_modifier = { scope:player_scope = { NOT = { has_variable = artifact_enemy_hard_casualty_modifier_value } } }
					flag:artifact_hard_casualty_modifier = { scope:player_scope = { NOT = { has_variable = artifact_hard_casualty_modifier_value } } }
					flag:artifact_heavy_cavalry_toughness = { scope:player_scope = { NOT = { has_variable = artifact_heavy_cavalry_toughness_value } } }
					flag:artifact_heavy_infantry_toughness = { scope:player_scope = { NOT = { has_variable = artifact_heavy_infantry_toughness_value } } }
					flag:artifact_retreat_losses = { scope:player_scope = { NOT = { has_variable = artifact_retreat_losses_value } } }
					flag:artifact_pursue_efficiency = { scope:player_scope = { NOT = { has_variable = artifact_pursue_efficiency_value } } }
					flag:artifact_monthly_minor_prestige = { scope:player_scope = { NOT = { has_variable = artifact_monthly_minor_prestige_value } } }
					flag:artifact_monthly_prestige = { scope:player_scope = { NOT = { has_variable = artifact_monthly_prestige_value } } }
					flag:artifact_short_reign_duration_mult = { scope:player_scope = { NOT = { has_variable = artifact_short_reign_duration_mult_value } } }
					flag:artifact_court_grandeur_baseline_add = { scope:player_scope = { NOT = { has_variable = artifact_court_grandeur_baseline_add_value } } }
					flag:artifact_dynasty_opinion = { scope:player_scope = { NOT = { has_variable = artifact_dynasty_opinion_value } } }
					flag:artifact_monthly_dynasty_prestige = { scope:player_scope = { NOT = { has_variable = artifact_monthly_dynasty_prestige_value } } }
					flag:artifact_monthly_prestige_add = { scope:player_scope = { NOT = { has_variable = artifact_monthly_prestige_add_value } } }
					flag:artifact_monthly_prestige_gain_per_dread_add = { scope:player_scope = { NOT = { has_variable = artifact_monthly_prestige_gain_per_dread_add_value } } }
					flag:artifact_monthly_prestige_gain_per_knight_add = { scope:player_scope = { NOT = { has_variable = artifact_monthly_prestige_gain_per_knight_add_value } } }
					flag:artifact_monthly_tyranny = { scope:player_scope = { NOT = { has_variable = artifact_monthly_tyranny_value } } }
					flag:artifact_dread_gain_mult = { scope:player_scope = { NOT = { has_variable = artifact_dread_gain_mult_value } } }
					flag:artifact_dread_baseline_add = { scope:player_scope = { NOT = { has_variable = artifact_dread_baseline_add_value } } }
					flag:artifact_mercenary_hire_cost_mult = { scope:player_scope = { NOT = { has_variable = artifact_mercenary_hire_cost_mult_value } } }
					flag:artifact_happy_powerful_vassal_tax_contribution_mult = { scope:player_scope = { NOT = { has_variable = artifact_happy_powerful_vassal_tax_contribution_mult_value } } }
					flag:artifact_courtly_tax_contribution_mult = { scope:player_scope = { NOT = { has_variable = artifact_courtly_tax_contribution_mult_value } } }
					flag:artifact_glory_hound_tax_contribution_mult = { scope:player_scope = { NOT = { has_variable = artifact_glory_hound_tax_contribution_mult_value } } }
					flag:artifact_parochial_tax_contribution_mult = { scope:player_scope = { NOT = { has_variable = artifact_parochial_tax_contribution_mult_value } } }
					flag:artifact_zealot_tax_contribution_mult = { scope:player_scope = { NOT = { has_variable = artifact_zealot_tax_contribution_mult_value } } }
					flag:artifact_glory_hound_levy_contribution_mult = { scope:player_scope = { NOT = { has_variable = artifact_glory_hound_levy_contribution_mult_value } } }
					flag:artifact_zealot_levy_contribution_mult = { scope:player_scope = { NOT = { has_variable = artifact_zealot_levy_contribution_mult_value } } }
					flag:artifact_vassal_limit = { scope:player_scope = { NOT = { has_variable = artifact_vassal_limit_value } } }
					flag:artifact_courtly_vassal_opinion = { scope:player_scope = { NOT = { has_variable = artifact_courtly_vassal_opinion_value } } }
					flag:artifact_glory_hound_vassal_opinion = { scope:player_scope = { NOT = { has_variable = artifact_glory_hound_vassal_opinion_value } } }
					flag:artifact_parochial_vassal_opinion = { scope:player_scope = { NOT = { has_variable = artifact_parochial_vassal_opinion_value } } }
					flag:artifact_zealot_vassal_opinion = { scope:player_scope = { NOT = { has_variable = artifact_zealot_vassal_opinion_value } } }
					flag:artifact_powerful_vassal_opinion = { scope:player_scope = { NOT = { has_variable = artifact_powerful_vassal_opinion_value } } }
					flag:artifact_independent_ruler_opinion = { scope:player_scope = { NOT = { has_variable = artifact_independent_ruler_opinion_value } } }
					flag:artifact_men_at_arms_maintenance = { scope:player_scope = { NOT = { has_variable = artifact_men_at_arms_maintenance_value } } }
					flag:artifact_domain_tax_mult = { scope:player_scope = { NOT = { has_variable = artifact_domain_tax_mult_value } } }
					flag:artifact_build_gold_cost = { scope:player_scope = { NOT = { has_variable = artifact_build_gold_cost_value } } }
					flag:artifact_courtier_and_guest_opinion = { scope:player_scope = { NOT = { has_variable = artifact_courtier_and_guest_opinion_value } } }
					flag:artifact_attraction_opinion = { scope:player_scope = { NOT = { has_variable = artifact_attraction_opinion_value } } }
					flag:artifact_build_time = { scope:player_scope = { NOT = { has_variable = artifact_build_time_value } } }
					flag:artifact_monthly_income = { scope:player_scope = { NOT = { has_variable = artifact_monthly_income_value } } }
					flag:artifact_monthly_piety = { scope:player_scope = { NOT = { has_variable = artifact_monthly_piety_value } } }
					flag:artifact_monthly_piety_gain_per_knight_add = { scope:player_scope = { NOT = { has_variable = artifact_monthly_piety_gain_per_knight_add_value } } }
					flag:artifact_domain_tax_same_faith_mult = { scope:player_scope = { NOT = { has_variable = artifact_domain_tax_same_faith_mult_value } } }
					flag:artifact_monthly_piety_gain_mult = { scope:player_scope = { NOT = { has_variable = artifact_monthly_piety_gain_mult_value } } }
					flag:artifact_same_faith_opinion = { scope:player_scope = { NOT = { has_variable = artifact_same_faith_opinion_value } } }
					flag:artifact_monthly_piety_from_buildings_mult = { scope:player_scope = { NOT = { has_variable = artifact_monthly_piety_from_buildings_mult_value } } }
					flag:artifact_clergy_opinion = { scope:player_scope = { NOT = { has_variable = artifact_clergy_opinion_value } } }
					flag:artifact_church_holding_build_gold_cost = { scope:player_scope = { NOT = { has_variable = artifact_church_holding_build_gold_cost_value } } }
					flag:artifact_different_faith_opinion = { scope:player_scope = { NOT = { has_variable = artifact_different_faith_opinion_value } } }
					flag:artifact_owned_hostile_scheme_success_chance_add = { scope:player_scope = { NOT = { has_variable = artifact_owned_hostile_scheme_success_chance_add_value } } }
					flag:artifact_owned_personal_scheme_success_chance_add = { scope:player_scope = { NOT = { has_variable = artifact_owned_personal_scheme_success_chance_add_value } } }
					flag:artifact_owned_scheme_secrecy_add = { scope:player_scope = { NOT = { has_variable = artifact_owned_scheme_secrecy_add_value } } }
					flag:artifact_hostile_scheme_phase_duration_add = { scope:player_scope = { NOT = { has_variable = artifact_hostile_scheme_phase_duration_add_value } } }
					flag:artifact_personal_scheme_phase_duration_add = { scope:player_scope = { NOT = { has_variable = artifact_personal_scheme_phase_duration_add_value } } }
					flag:artifact_fertility_gain = { scope:player_scope = { NOT = { has_variable = artifact_fertility_gain_value } } }
					flag:artifact_courting_scheme_phase_duration_add = { scope:player_scope = { NOT = { has_variable = artifact_courting_scheme_phase_duration_add_value } } }
					flag:artifact_seduce_scheme_phase_duration_add = { scope:player_scope = { NOT = { has_variable = artifact_seduce_scheme_phase_duration_add_value } } }
					flag:artifact_spouse_opinion_add = { scope:player_scope = { NOT = { has_variable = artifact_spouse_opinion_add_value } } }
					flag:artifact_stress_gain = { scope:player_scope = { NOT = { has_variable = artifact_stress_gain_value } } }
					flag:artifact_monthly_diplomacy_lifestyle_xp = { scope:player_scope = { NOT = { has_variable = artifact_monthly_diplomacy_lifestyle_xp_value } } }
					flag:artifact_monthly_martial_lifestyle_xp = { scope:player_scope = { NOT = { has_variable = artifact_monthly_martial_lifestyle_xp_value } } }
					flag:artifact_monthly_stewardship_lifestyle_xp = { scope:player_scope = { NOT = { has_variable = artifact_monthly_stewardship_lifestyle_xp_value } } }
					flag:artifact_monthly_intrigue_lifestyle_xp = { scope:player_scope = { NOT = { has_variable = artifact_monthly_intrigue_lifestyle_xp_value } } }
					flag:artifact_monthly_learning_lifestyle_xp = { scope:player_scope = { NOT = { has_variable = artifact_monthly_learning_lifestyle_xp_value } } }
					flag:artifact_health_gain = { scope:player_scope = { NOT = { has_variable = artifact_health_gain_value } } }
				}
			}
			always = no
		}
	}	

	effect = {
		switch = {
			trigger = root

			flag:artifact_knight_limit = {
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_knight_limit VALUE = artifact_knight_limit MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_knight_effectiveness = {
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_knight_effectiveness VALUE = artifact_knight_effectiveness MODIFIER_VALUE = 60 } }
			}
			flag:artifact_controlled_province_advantage = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_controlled_province_advantage VALUE = artifact_controlled_province_advantage MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_levy_reinforcement_rate_same_faith = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_levy_reinforcement_rate_same_faith VALUE = artifact_levy_reinforcement_rate_same_faith MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_negate_prowess_penalty_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_negate_prowess_penalty_add VALUE = artifact_negate_prowess_penalty_add MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_raid_speed = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_raid_speed VALUE = artifact_raid_speed MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_enemy_hard_casualty_modifier = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_enemy_hard_casualty_modifier VALUE = artifact_enemy_hard_casualty_modifier MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_hard_casualty_modifier = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_hard_casualty_modifier VALUE = artifact_hard_casualty_modifier MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_heavy_cavalry_toughness = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_heavy_cavalry_toughness VALUE = artifact_heavy_cavalry_toughness MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_heavy_infantry_toughness = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_heavy_infantry_toughness VALUE = artifact_heavy_infantry_toughness MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_retreat_losses = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_retreat_losses VALUE = artifact_retreat_losses MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_pursue_efficiency = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_pursue_efficiency VALUE = artifact_pursue_efficiency MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_monthly_minor_prestige = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_minor_prestige VALUE = artifact_monthly_minor_prestige MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_monthly_prestige = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_prestige VALUE = artifact_monthly_prestige MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_short_reign_duration_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_short_reign_duration_mult VALUE = artifact_short_reign_duration_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_court_grandeur_baseline_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_court_grandeur_baseline_add VALUE = artifact_court_grandeur_baseline_add MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_dynasty_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_dynasty_opinion VALUE = artifact_dynasty_opinion MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_monthly_dynasty_prestige = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_dynasty_prestige VALUE = artifact_monthly_dynasty_prestige MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_prestige_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_prestige_add VALUE = artifact_monthly_prestige_add MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_monthly_prestige_gain_per_dread_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_prestige_gain_per_dread_add VALUE = artifact_monthly_prestige_gain_per_dread_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_prestige_gain_per_knight_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_prestige_gain_per_knight_add VALUE = artifact_monthly_prestige_gain_per_knight_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_tyranny = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_tyranny VALUE = artifact_monthly_tyranny MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_dread_gain_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_dread_gain_mult VALUE = artifact_dread_gain_mult MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_dread_baseline_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_dread_baseline_add VALUE = artifact_dread_baseline_add MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_mercenary_hire_cost_mult = {
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_mercenary_hire_cost_mult VALUE = artifact_mercenary_hire_cost_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_happy_powerful_vassal_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_happy_powerful_vassal_tax_contribution_mult VALUE = artifact_happy_powerful_vassal_tax_contribution_mult MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_courtly_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_courtly_tax_contribution_mult VALUE = artifact_courtly_tax_contribution_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_glory_hound_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_glory_hound_tax_contribution_mult VALUE = artifact_glory_hound_tax_contribution_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_parochial_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_parochial_tax_contribution_mult VALUE = artifact_parochial_tax_contribution_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_zealot_tax_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_zealot_tax_contribution_mult VALUE = artifact_zealot_tax_contribution_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_glory_hound_levy_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_glory_hound_levy_contribution_mult VALUE = artifact_glory_hound_levy_contribution_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_zealot_levy_contribution_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_zealot_levy_contribution_mult VALUE = artifact_zealot_levy_contribution_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_vassal_limit = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_vassal_limit VALUE = artifact_vassal_limit MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_courtly_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_courtly_vassal_opinion VALUE = artifact_courtly_vassal_opinion MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_glory_hound_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_glory_hound_vassal_opinion VALUE = artifact_glory_hound_vassal_opinion MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_parochial_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_parochial_vassal_opinion VALUE = artifact_parochial_vassal_opinion MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_zealot_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_zealot_vassal_opinion VALUE = artifact_zealot_vassal_opinion MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_powerful_vassal_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_powerful_vassal_opinion VALUE = artifact_powerful_vassal_opinion MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_independent_ruler_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_independent_ruler_opinion VALUE = artifact_independent_ruler_opinion MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_men_at_arms_maintenance = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_men_at_arms_maintenance VALUE = artifact_men_at_arms_maintenance MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_domain_tax_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_domain_tax_mult VALUE = artifact_domain_tax_mult MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_build_gold_cost = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_build_gold_cost VALUE = artifact_build_gold_cost MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_courtier_and_guest_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_courtier_and_guest_opinion VALUE = artifact_courtier_and_guest_opinion MODIFIER_VALUE = 15 } }
			}
			flag:artifact_attraction_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_attraction_opinion VALUE = artifact_attraction_opinion MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_build_time = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_build_time VALUE = artifact_build_time MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_income = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_income VALUE = artifact_monthly_income MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_piety = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_piety VALUE = artifact_monthly_piety MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_piety_gain_per_knight_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_piety_gain_per_knight_add VALUE = artifact_monthly_piety_gain_per_knight_add MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_domain_tax_same_faith_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_domain_tax_same_faith_mult VALUE = artifact_domain_tax_same_faith_mult MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_monthly_piety_gain_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_piety_gain_mult VALUE = artifact_monthly_piety_gain_mult MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_same_faith_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_same_faith_opinion VALUE = artifact_same_faith_opinion MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_monthly_piety_from_buildings_mult = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_piety_from_buildings_mult VALUE = artifact_monthly_piety_from_buildings_mult MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_clergy_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_clergy_opinion VALUE = artifact_clergy_opinion MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_church_holding_build_gold_cost = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_church_holding_build_gold_cost VALUE = artifact_church_holding_build_gold_cost MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_different_faith_opinion = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_different_faith_opinion VALUE = artifact_different_faith_opinion MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_owned_hostile_scheme_success_chance_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_owned_hostile_scheme_success_chance_add VALUE = artifact_owned_hostile_scheme_success_chance_add MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_owned_personal_scheme_success_chance_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_owned_personal_scheme_success_chance_add VALUE = artifact_owned_personal_scheme_success_chance_add MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_owned_scheme_secrecy_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_owned_scheme_secrecy_add VALUE = artifact_owned_scheme_secrecy_add MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_hostile_scheme_phase_duration_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_hostile_scheme_phase_duration_add VALUE = artifact_hostile_scheme_phase_duration_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_personal_scheme_phase_duration_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_personal_scheme_phase_duration_add VALUE = artifact_personal_scheme_phase_duration_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_fertility_gain = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_fertility_gain VALUE = artifact_fertility_gain MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_courting_scheme_phase_duration_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_courting_scheme_phase_duration_add VALUE = artifact_courting_scheme_phase_duration_add MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_seduce_scheme_phase_duration_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_seduce_scheme_phase_duration_add VALUE = artifact_seduce_scheme_phase_duration_add MODIFIER_VALUE = 15 } } 
			}
			flag:artifact_spouse_opinion_add = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_spouse_opinion_add VALUE = artifact_spouse_opinion_add MODIFIER_VALUE = 45 } } 
			}
			flag:artifact_stress_gain = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_stress_gain VALUE = artifact_stress_gain MODIFIER_VALUE = 30 } } 
			}
			flag:artifact_monthly_diplomacy_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_diplomacy_lifestyle_xp VALUE = artifact_monthly_diplomacy_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_martial_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_martial_lifestyle_xp VALUE = artifact_monthly_martial_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_stewardship_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_stewardship_lifestyle_xp VALUE = artifact_monthly_stewardship_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_intrigue_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_intrigue_lifestyle_xp VALUE = artifact_monthly_intrigue_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_monthly_learning_lifestyle_xp = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_monthly_learning_lifestyle_xp VALUE = artifact_monthly_learning_lifestyle_xp MODIFIER_VALUE = 60 } } 
			}
			flag:artifact_health_gain = { 
				scope:player_scope = { artifact_crafting_enchanting_modifier_decrease = { NAME = artifact_health_gain VALUE = artifact_health_gain MODIFIER_VALUE = 60 } } 
			}
		}
	}
}

##############################
### Crafting Artifact sGUI ###
##############################

craft_artifact = {
	is_valid = {
		custom_tooltip = {
			text = select_crafting_material_tooltip
			AND = {
				has_variable = used_material
				NOT = {
					var:used_material = flag:no_material
				}
			}
		}
		custom_tooltip = {
			text = crafting_artifact_time_tt
			NOT = { has_variable = craft_time }
		}

		trigger_if = { #Metals
			limit = { has_variable = used_material }
			trigger_if = { #Bronze
				limit = {
					OR = {
						var:used_material = flag:bronze_crafting_modifier_prestige
						var:used_material = flag:bronze_crafting_modifier_prowess
					}
				}
				custom_tooltip = {
					text = does_not_have_bronze
					OR = {
						AND = {
							contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
							contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
						}
						AND = {
							contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
							has_variable = tin
						}
						AND = {
							contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
							has_variable = copper
						}
						AND = {
							has_variable = tin
							has_variable = copper
						}
					}
				}
			}
			trigger_else_if = { #Mithril
				limit = {
					OR = {
						var:used_material = flag:mithril_crafting_modifier_prestige
						var:used_material = flag:mithril_crafting_modifier_prowess
					}
				}
				custom_tooltip = {
					text = does_not_have_mithril
					OR = {
						has_variable = mithril
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_mithril_province_modifier }
					}
				}
			}
			trigger_else_if = { #Gold
				limit = {
					OR = {
						var:used_material = flag:gold_crafting_modifier_prestige
						var:used_material = flag:gold_crafting_modifier_prowess
					}
				}
				custom_tooltip = {
					text = does_not_have_gold
					OR = {
						has_variable = gold
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_gold_province_modifier }
					}
				}
			}
			trigger_else_if = { #Silver
				limit = {
					OR = {
						var:used_material = flag:silver_crafting_modifier_prestige
						var:used_material = flag:silver_crafting_modifier_prowess
					}
				}
				custom_tooltip = {
					text = does_not_have_silver
					OR = {
						has_variable = silver
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_silver_province_modifier }
					}
				}
			}
			trigger_else_if = { #Steel
				limit = {
					OR = {
						var:used_material = flag:iron_crafting_modifier_prestige
						var:used_material = flag:iron_crafting_modifier_prowess
					}
				}
				custom_tooltip = {
					text = does_not_have_steel
					OR = {
						has_variable = iron
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_iron_province_modifier }
					}
				}
			}
			trigger_else_if = { #Iron
				limit = {
					OR = {
						var:used_material = flag:iron_crafting_modifier_prestige
						var:used_material = flag:iron_crafting_modifier_prowess
					}
				}
				custom_tooltip = {
					text = does_not_have_iron
					OR = {
						has_variable = iron
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_iron_province_modifier }
					}
				}
			}
			trigger_else_if = { #Copper
				limit = {
					OR = {
						var:used_material = flag:copper_crafting_modifier_prestige
						var:used_material = flag:copper_crafting_modifier_prowess
					}
				}
				custom_tooltip = {
					text = does_not_have_copper
					OR = {
						has_variable = copper
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_copper_province_modifier }
					}
				}
			}
			trigger_else_if = { #Tin
				limit = {
					OR = {
						var:used_material = flag:tin_crafting_modifier_prestige
						var:used_material = flag:tin_crafting_modifier_prowess
					}
				}
				custom_tooltip = {
					text = does_not_have_tin
					OR = {
						has_variable = tin
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_tin_province_modifier }
					}
				}
			}
			trigger_else = { #Lead
				trigger_if = {
					limit = {
						OR = {
							var:used_material = flag:lead_crafting_modifier_prestige
							var:used_material = flag:lead_crafting_modifier_prowess
						}
					}
					custom_tooltip = {
						text = does_not_have_lead
						OR = {
							has_variable = lead
							contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_lead_province_modifier }
						}
					}
				}
			}
		}

		trigger_if = { #Gems
			limit = { has_variable = used_gem }
			trigger_if = { #Elven Gems
				limit = { var:used_gem = flag:elven_gems_crafting_modifier }
				custom_tooltip = {
					text = does_not_have_elven_gems
					OR = {
						culture = culture:noldor
						has_variable = elven_gems
					}
				}
			}
			trigger_else_if = { #Diamond
				limit = { var:used_gem = flag:diamond_crafting_modifier }
				custom_tooltip = {
					text = does_not_have_diamond
					OR = {
						has_variable = diamond
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_diamond_province_modifier }
					}
				}
			}
			trigger_else_if = { #Emerald
				limit = { var:used_gem = flag:emerald_crafting_modifier }
				custom_tooltip = {
					text = does_not_have_emerald
					OR = {
						has_variable = emerald
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_emerald_province_modifier }
					}
				}
			}
			trigger_else_if = { #Sapphire
				limit = { var:used_gem = flag:sapphire_crafting_modifier }
				custom_tooltip = {
					text = does_not_have_sapphire
					OR = {
						has_variable = sapphire
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_sapphire_province_modifier }
					}
				}
			}
			trigger_else_if = { #Ruby
				limit = { var:used_gem = flag:ruby_crafting_modifier }
				custom_tooltip = {
					text = does_not_have_ruby
					OR = {
						has_variable = ruby
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_ruby_province_modifier }
					}
				}
			}
			trigger_else_if = { #Amethyst
				limit = { var:used_gem = flag:amethyst_crafting_modifier }
				custom_tooltip = {
					text = does_not_have_amethyst
					OR = {
						has_variable = amethyst
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_amethyst_province_modifier }
					}
				}
			}
			trigger_else_if = { #Onyx
				limit = { var:used_gem = flag:onyx_crafting_modifier }
				custom_tooltip = {
					text = does_not_have_onyx
					OR = {
						has_variable = onyx
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_onyx_province_modifier }
					}
				}
			}
			trigger_else_if = { #Peridot
				limit = { var:used_gem = flag:peridot_crafting_modifier }
				custom_tooltip = {
					text = does_not_have_peridot
					OR = {
						has_variable = peridot
						contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_peridot_province_modifier }
					}
				}
			}
			trigger_else = { #Quartz
				trigger_if = {
					limit = { var:used_gem = flag:quartz_crafting_modifier }
					custom_tooltip = {
						text = does_not_have_quartz
						OR = {
							has_variable = quartz
							contains_prospecting_modifier = { PROSPECTING_MODIFIER = mining_quartz_province_modifier }
						}
					}
				}
			}
		}

		trigger_if = {
			limit = { exists = var:total_gold_cost }
			custom_tooltip = {
				text = disable_crafting_no_gold
				trigger_if = {
					limit = {
						gold < var:total_gold_cost
					}
					always = no
				}
			}
		}
	}

	effect = {
		if = {
			limit = { NOT = { has_trait = lifestyle_artifact_crafting } }
			add_trait = lifestyle_artifact_crafting
		}
		set_variable = {
			name = craft_time
			value = artifact_craft_time
			days = artifact_craft_time
		}

		if = {
			limit = { has_perk = experimental_methods_perk }
			custom_tooltip = {
				text = experimental_methods_button_tooltip
				add_random_artifact_modifier_effect = yes
			}
		}

		### Metals ###
		destroy_ingot_artifact = {
			SELECTED_METAL = mithril_crafting_modifier
			ARTIFACT_VAR = mithril
		}
		destroy_ingot_artifact = {
			SELECTED_METAL = gold_crafting_modifier
			ARTIFACT_VAR = gold
		}
		destroy_ingot_artifact = {
			SELECTED_METAL = silver_crafting_modifier
			ARTIFACT_VAR = silver
		}
		destroy_alloy_steel_artifact = { SELECTED_METAL = steel_crafting_modifier }
		destroy_ingot_artifact = {
			SELECTED_METAL = iron_crafting_modifier
			ARTIFACT_VAR = iron
		}
		destroy_alloy_bronze_artifact = { SELECTED_METAL = bronze_crafting_modifier }
		destroy_ingot_artifact = {
			SELECTED_METAL = copper_crafting_modifier
			ARTIFACT_VAR = copper
		}
		destroy_ingot_artifact = {
			SELECTED_METAL = tin_crafting_modifier
			ARTIFACT_VAR = tin
		}
		destroy_ingot_artifact = {
			SELECTED_METAL = lead_crafting_modifier
			ARTIFACT_VAR = lead
		}

		### Gems ###
		destroy_gem_artifact = {
			SELECTED_GEM = elven_gems_crafting_modifier
			ARTIFACT_VAR = elven_gems
		}
		destroy_gem_artifact = {
			SELECTED_GEM = diamond_crafting_modifier
			ARTIFACT_VAR = diamond
		}
		destroy_gem_artifact = {
			SELECTED_GEM = emerald_crafting_modifier
			ARTIFACT_VAR = emerald
		}
		destroy_gem_artifact = {
			SELECTED_GEM = sapphire_crafting_modifier
			ARTIFACT_VAR = sapphire
		}
		destroy_gem_artifact = {
			SELECTED_GEM = ruby_crafting_modifier
			ARTIFACT_VAR = ruby
		}
		destroy_gem_artifact = {
			SELECTED_GEM = amethyst_crafting_modifier
			ARTIFACT_VAR = amethyst
		}
		destroy_gem_artifact = {
			SELECTED_GEM = onyx_crafting_modifier
			ARTIFACT_VAR = onyx
		}
		destroy_gem_artifact = {
			SELECTED_GEM = peridot_crafting_modifier
			ARTIFACT_VAR = peridot
		}
		destroy_gem_artifact = {
			SELECTED_GEM = quartz_crafting_modifier
			ARTIFACT_VAR = quartz
		}

		if = {
			limit = { has_variable = total_gold_cost }
			remove_short_term_gold = var:total_gold_cost
		}
		trigger_event = {
			id = crafting_mechanic.0003
			days = artifact_craft_time
		}

		if = {
			limit = { has_variable = used_material }
			if = { # Highest level of smithing
				limit = {
					OR = {
						AND = { # Weapon Smithing
							exists = var:artifact_craft
							var:artifact_craft = flag:weapon_artifact
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = weapon_smith
								value >= 65
							}
							NOR = {
								var:used_material = flag:mithril_crafting_modifier_prowess
								var:used_material = flag:steel_crafting_modifier_prowess
							}
						}
						AND = { # Armour Smithing
							exists = var:artifact_craft 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:helmet_artifact
							}
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = armour_smith
								value >= 65
							}
							NOR = {
								var:used_material = flag:mithril_crafting_modifier_prowess
								var:used_material = flag:steel_crafting_modifier_prowess
							} 
						}
						AND = { # Jewel Smithing
							exists = var:artifact_craft 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = jewel_smith
								value >= 65
							}
							NOR = {
								var:used_material = flag:mithril_crafting_modifier_prowess
								var:used_material = flag:steel_crafting_modifier_prowess
							} 
						}
					}
				}
				custom_tooltip = "crafting_use_certain_metal"
			}
			else_if = { # Medium level of smithing
				limit = {
					OR = {
						AND = { # Weapon Smithing
							exists = var:artifact_craft
							var:artifact_craft = flag:weapon_artifact
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = weapon_smith
								value >= 30
							}
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = weapon_smith
								value < 65
							}
							NOR = {
								var:used_material = flag:mithril_crafting_modifier_prowess
								var:used_material = flag:steel_crafting_modifier_prowess
								var:used_material = flag:iron_crafting_modifier_prowess
								var:used_material = flag:bronze_crafting_modifier_prowess
								var:used_material = flag:silver_crafting_modifier_prowess
							}
						}
						AND = { # Armour Smithing
							exists = var:artifact_craft 
							OR = {
								var:artifact_craft = flag:armor_artifact
								var:artifact_craft = flag:helmet_artifact
							}
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = armour_smith
								value >= 30
							}
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = armour_smith
								value < 65
							}
							NOR = {
								var:used_material = flag:mithril_crafting_modifier_prowess
								var:used_material = flag:steel_crafting_modifier_prowess
								var:used_material = flag:iron_crafting_modifier_prowess
								var:used_material = flag:bronze_crafting_modifier_prowess
								var:used_material = flag:silver_crafting_modifier_prowess
							}
						}
						AND = { # Jewel Smithing
							exists = var:artifact_craft 
							OR = {
								var:artifact_craft = flag:regalia_artifact
								var:artifact_craft = flag:trinket_artifact
							}
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = jewel_smith
								value >= 30
							}
							has_trait_xp = {
								trait = lifestyle_artifact_crafting
								track = jewel_smith
								value < 65
							}
							NOR = {
								var:used_material = flag:mithril_crafting_modifier_prowess
								var:used_material = flag:steel_crafting_modifier_prowess
								var:used_material = flag:iron_crafting_modifier_prowess
								var:used_material = flag:bronze_crafting_modifier_prowess
								var:used_material = flag:silver_crafting_modifier_prowess
							}
						}
					}
				}
				custom_tooltip = "crafting_use_certain_metal"
			}
			else = { # Lowest level of smithing | Every Metal gives XP 
			}
		}
	}
}

###############################
### Selectable Icons sGUI's ###
###############################

#
# Need a flag here so that it adds appropriate variable;
# variable is how the specific icon is chosen for when artifact is created
#

select_artifact_icon = {
	saved_scopes = {
		player_scope
	}

	effect = {
		switch = {
			trigger = root

			###############
			### Weapons ###
			###############

			### Swords ###
			flag:dalish_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = dalish_sword } } }
			flag:avari_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = avari_sword } } }
			flag:silvan_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = silvan_sword } } }
			flag:rohirrim_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = rohirrim_sword } } }
			flag:northern_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = northern_sword } } }
			flag:gondorian_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = gondorian_sword } } }
			flag:noldor_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = noldor_sword } } }
			flag:gundabad_orc_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = gundabad_orc_sword } } }
			flag:isengard_urukhai_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = isengard_urukhai_sword } } }
			flag:african_sword = { scope:player_scope = { add_artifact_icon_variable = { NAME = african_sword } } }
			flag:dwarven_sword_01 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_sword_01 } } }
			flag:dwarven_sword_02 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_sword_02 } } }
			flag:dwarven_sword_03 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_sword_03 } } }
			flag:dwarven_sword_04 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_sword_04 } } }
			flag:boromir_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = boromir_sword_crafted } } }
			flag:anduril_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = anduril_crafted } } }
			flag:guthwine_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = guthwine_crafted } } }
			flag:herugrim_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = herugrim_crafted } } }
			flag:niluzagarr_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = niluzagarr_crafted } } }
			flag:sarazzam_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = sarazzam_crafted } } }
			flag:anguirel_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = anguirel_crafted } } }
			flag:aranthel_and_ungoldagnir_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = aranthel_and_ungoldagnir_crafted } } }
			flag:glamdring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = glamdring_crafted } } }
			flag:hadhafang_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = hadhafang_crafted } } }
			flag:hyandolire_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = hyandolire_crafted } } }
			flag:orcrist_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = orcrist_crafted } } }
			flag:wulf_fang_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = wulf_fang_crafted } } }
			flag:urfael_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = urfael_crafted } } }
			flag:numenorean_sword_rop_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = numenorean_sword_rop_crafted } } }
			flag:numenorean_sword_rop_alt_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = numenorean_sword_rop_alt_crafted } } }
			flag:thingol_sword_rop_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = thingol_sword_rop_crafted } } }
			flag:corsair_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = corsair_sword_crafted } } }
			flag:blacklock_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = blacklock_sword_crafted } } }
			flag:edmund_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = edmund_sword_crafted } } }
			flag:blessed_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = blessed_sword_crafted } } }
			flag:longsword_gem_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = longsword_gem_crafted } } }
			flag:rhun_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = rhun_sword_crafted } } }
			flag:dunachar_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dunachar_crafted } } }
			flag:ringil_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ringil_crafted } } }
			flag:dwarf_regal_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarf_regal_sword_crafted } } }
			flag:faramir_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = faramir_sword_crafted } } }
			flag:isildur_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = isildur_sword_crafted } } }
			flag:nazgul_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = nazgul_sword_crafted } } }
			flag:witchking_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = witchking_sword_crafted } } }
			flag:dark_longsword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dark_longsword_crafted } } }
			flag:rohan_sword_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = rohan_sword_sow_crafted } } }
			flag:royal_sword_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = royal_sword_crafted } } }
			flag:artifact_celebrimbor_sword_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_celebrimbor_sword_sow_crafted } } }

			### Daggers ###
			flag:gondorian_dagger = { scope:player_scope = { add_artifact_icon_variable = { NAME = gondorian_dagger } } }
			flag:silvan_dagger = { scope:player_scope = { add_artifact_icon_variable = { NAME = silvan_dagger } } }
			flag:rohirrim_dagger = { scope:player_scope = { add_artifact_icon_variable = { NAME = rohirrim_dagger } } }
			flag:default_dagger = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_dagger } } }
			flag:avari_dagger = { scope:player_scope = { add_artifact_icon_variable = { NAME = avari_dagger } } }
			flag:dalish_dagger = { scope:player_scope = { add_artifact_icon_variable = { NAME = dalish_dagger } } }
			flag:noldor_dagger = { scope:player_scope = { add_artifact_icon_variable = { NAME = noldor_dagger } } }
			flag:dwarven_dagger = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_dagger } } }
			flag:westernesse_dagger_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = westernesse_dagger_crafted } } }
			flag:morgul_dagger_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = morgul_dagger_crafted } } }
			flag:sting_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = sting_crafted } } }
			flag:galadriel_dagger_rop_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = galadriel_dagger_rop_crafted } } }
			flag:corsair_dagger_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = corsair_dagger_crafted } } }
			flag:blacklock_dagger_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = blacklock_dagger_crafted } } }

			### Spears ###
			flag:gundabad_orc_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = gundabad_orc_spear } } }
			flag:dalish_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = dalish_spear } } }
			flag:avari_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = avari_spear } } }
			flag:silvan_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = silvan_spear } } }
			flag:rohirrim_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = rohirrim_spear } } }
			flag:noldor_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = noldor_spear } } }
			flag:default_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_spear } } }
			flag:gondorian_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = gondorian_spear } } }
			flag:isengard_urukhai_spear = { scope:player_scope = { add_artifact_icon_variable = { NAME = isengard_urukhai_spear } } }
			flag:dwarven_spear_01 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_spear_01 } } }
			flag:dwarven_spear_02 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_spear_02 } } }
			flag:lindalf_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = lindalf_crafted } } }
			flag:sealord_spear_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = sealord_spear_crafted } } }
			flag:fram_spear_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = fram_spear_crafted } } }
			flag:scorpion_sting_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = scorpion_sting_crafted } } }
			flag:haradrim_spear_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = haradrim_spear_crafted } } }
			flag:rhun_spear_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = rhun_spear_crafted } } }
			flag:aeglos_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = aeglos_crafted } } }

			### Axes ###
			flag:steppe_axe = { scope:player_scope = { add_artifact_icon_variable = { NAME = steppe_axe } } }
			flag:default_axe = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_axe } } }
			flag:gondorian_axe = { scope:player_scope = { add_artifact_icon_variable = { NAME = gondorian_axe } } }
			flag:rohirrim_axe = { scope:player_scope = { add_artifact_icon_variable = { NAME = rohirrim_axe } } }
			flag:african_axe = { scope:player_scope = { add_artifact_icon_variable = { NAME = african_axe } } }
			flag:dwarven_axe = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_axe } } }
			flag:dwarven_axe_02 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_axe_02 } } }
			flag:dwarven_axe_03 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_axe_03 } } }
			flag:dwarven_axe_04 = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_axe_04 } } }
			flag:gimli_battleaxe_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = gimli_battleaxe_crafted } } }
			flag:fedarda_axe_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = fedarda_axe_crafted } } }
			flag:durin_axe_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = durin_axe_crafted } } }
			flag:barazanthual_axe_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = barazanthual_axe_crafted } } }
			flag:dramborleg_axe_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dramborleg_axe_crafted } } }
			flag:forestel_axe_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = forestel_axe_crafted } } }
			flag:pickaxe_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = pickaxe_crafted } } }
			flag:narunuphkaran_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = narunuphkaran_crafted } } }
			flag:nogrod_battleaxe_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = nogrod_battleaxe_crafted } } }

			### Maces ###
			flag:byzantine_mace = { scope:player_scope = { add_artifact_icon_variable = { NAME = byzantine_mace } } }
			flag:steppe_mace = { scope:player_scope = { add_artifact_icon_variable = { NAME = steppe_mace } } }
			flag:dalish_mace = { scope:player_scope = { add_artifact_icon_variable = { NAME = dalish_mace } } }
			flag:default_mace = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_mace } } }
			flag:sauron_mace_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = sauron_mace_crafted } } }
			flag:orc_whip_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = orc_whip_crafted } } }
			flag:witness_of_restraint_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = witness_of_restraint_crafted } } }
			flag:witchking_flail_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = witchking_flail_crafted } } }
			flag:mace_of_anarion_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = mace_of_anarion_crafted } } }

			### Hammers ###
			flag:default_hammer = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_hammer } } }
			flag:turann_hammer_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = turann_hammer_crafted } } }
			flag:nardring_hammer_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = nardring_hammer_crafted } } }

			### Longsword ###
			flag:default_longsword = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_longsword } } }

			################
			### Trinkets ###
			################

			flag:Necklace = { scope:player_scope = { add_artifact_icon_variable = { NAME = Necklace } } }
			flag:Medallion = { scope:player_scope = { add_artifact_icon_variable = { NAME = Medallion } } }
			flag:pocket_figurine = { scope:player_scope = { add_artifact_icon_variable = { NAME = pocket_figurine } } }
			flag:pocket_figurine = { scope:player_scope = { add_artifact_icon_variable = { NAME = pocket_figurine } } }
			flag:pocket_goblet = { scope:player_scope = { add_artifact_icon_variable = { NAME = pocket_goblet } } }
			flag:pocket_basic_case = { scope:player_scope = { add_artifact_icon_variable = { NAME = pocket_basic_case } } }
			flag:witchking_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = witchking_ring_crafted } } }
			flag:khamul_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = khamul_ring_crafted } } }
			flag:goldenking_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = goldenking_ring_crafted } } }
			flag:yi_indur_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = yi_indur_ring_crafted } } }
			flag:blindsorceror_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = blindsorceror_ring_crafted } } }
			flag:mauhoshat_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = mauhoshat_ring_crafted } } }
			flag:dendra_dwar_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dendra_dwar_ring_crafted } } }
			flag:ren_iey_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ren_iey_ring_crafted } } }
			flag:uvatha_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = uvatha_ring_crafted } } }
			flag:ring_of_longbeards_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ring_of_longbeards_crafted } } }
			flag:ring_of_firebeards_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ring_of_firebeards_crafted } } }
			flag:ring_of_broadbeams_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ring_of_broadbeams_crafted } } }
			flag:ring_of_stiffbeards_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ring_of_stiffbeards_crafted } } }
			flag:ring_of_stonefoots_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ring_of_stonefoots_crafted } } }
			flag:ring_of_blacklocks_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ring_of_blacklocks_crafted } } }
			flag:ring_of_ironfists_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ring_of_ironfists_crafted } } }
			flag:narya_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = narya_crafted } } }
			flag:nenya_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = nenya_crafted } } }
			flag:vilya_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = vilya_crafted } } }
			flag:one_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = one_ring_crafted } } }
			flag:new_ring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = new_ring_crafted } } }
			flag:ring_barahir_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = ring_barahir_crafted } } }
			flag:mithrellas_talisman_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = mithrellas_talisman_crafted } } }
			flag:nimrodel_gem_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = nimrodel_gem_crafted } } }
			flag:elven_brooch_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = elven_brooch_crafted } } }
			flag:evenstar_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = evenstar_crafted } } }
			flag:elven_cape_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = elven_cape_crafted } } }
			flag:elessar_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = elessar_crafted } } }
			flag:galadriel_phial_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = galadriel_phial_crafted } } }
			flag:silver_harp_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = silver_harp_crafted } } }

			##############
			### Armour ###
			##############

			flag:dwarven_armor = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_armor } } }
			flag:noldor_armor = { scope:player_scope = { add_artifact_icon_variable = { NAME = noldor_armor } } }
			flag:galadhrim_armor = { scope:player_scope = { add_artifact_icon_variable = { NAME = galadhrim_armor } } }
			flag:lordly_noldor_armor_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = lordly_noldor_armor_crafted } } }
			flag:rivendell_armor_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = rivendell_armor_crafted } } }
			flag:fountain_guard_armor_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = fountain_guard_armor_crafted } } }
			flag:lordly_dwarven_armor_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = lordly_dwarven_armor_crafted } } }
			flag:castamir_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = castamir_armor_sow_crafted } } }
			flag:theoden_armor_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = theoden_armor_crafted } } }
			flag:cloak_ancient_ones_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = cloak_ancient_ones_crafted } } }
			flag:haradrim_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = haradrim_armor_sow_crafted } } }
			flag:sauron_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = sauron_armor_sow_crafted } } }
			flag:artifact_ranger_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_ranger_armor_sow_crafted } } }
			flag:artifact_numenor_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_numenor_armor_sow_crafted } } }
			flag:artifact_gondor_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_gondor_armor_sow_crafted } } }
			flag:artifact_baranor_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_baranor_armor_sow_crafted } } }
			flag:artifact_castamir_armor_sow_alt_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_castamir_armor_sow_alt_crafted } } }
			flag:artifact_easterling_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_easterling_armor_sow_crafted } } }
			flag:artifact_celebrimbor_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_celebrimbor_armor_sow_crafted } } }
			flag:artifact_galadhrim_armor_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_galadhrim_armor_sow_crafted } } }
			flag:artifact_darkelf_armor_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = artifact_darkelf_armor_crafted } } }

			##############
			### Helmet ###
			##############

			flag:dwarven_helmet = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_helmet } } }
			flag:ironhills_helm = { scope:player_scope = { add_artifact_icon_variable = { NAME = ironhills_helm } } }
			flag:dwarven_crown = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarven_crown } } }
			flag:noldor_helmet = { scope:player_scope = { add_artifact_icon_variable = { NAME = noldor_helmet } } }
			flag:silvan_helmet = { scope:player_scope = { add_artifact_icon_variable = { NAME = silvan_helmet } } }
			flag:elven_circlet = { scope:player_scope = { add_artifact_icon_variable = { NAME = elven_circlet } } }
			flag:dain_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dain_helm_crafted } } }
			flag:rivendell_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = rivendell_helm_crafted } } }
			flag:anarion_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = anarion_helm_crafted } } }
			flag:elendil_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = elendil_helm_crafted } } }
			flag:numenorean_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = numenorean_helm_crafted } } }
			flag:gondorian_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = gondorian_helm_crafted } } }
			flag:fountain_guard_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = fountain_guard_helm_crafted } } }
			flag:crown_of_gondor_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = crown_of_gondor_crafted } } }
			flag:theoden_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = theoden_helm_crafted } } }
			flag:theodred_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = theodred_helm_crafted } } }
			flag:easterling_helmet_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = easterling_helmet_crafted } } }
			flag:sauron_helmet_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = sauron_helmet_crafted } } }
			flag:sauron_helm_alt_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = sauron_helm_alt_crafted } } }
			flag:mouth_sauron_mask_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = mouth_sauron_mask_crafted } } }
			flag:moria_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = moria_helm_crafted } } }
			flag:urukhai_general_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = urukhai_general_helm_crafted } } }
			flag:urukhai_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = urukhai_helm_crafted } } }
			flag:witchking_crown_alt_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = witchking_crown_alt_crafted } } }
			flag:durins_helm_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = durins_helm_crafted } } }
			flag:azaghal_helmet_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = azaghal_helmet_crafted } } }
			flag:dragon_helm_of_dor_lomin_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dragon_helm_of_dor_lomin_crafted } } }
			flag:dragon_helm_of_dor_lomin_alt_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dragon_helm_of_dor_lomin_alt_crafted } } }
			flag:alpharazon_nazgul_helmet_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = alpharazon_nazgul_helmet_crafted } } }
			flag:hammerhand_nazgul_helmet_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = hammerhand_nazgul_helmet_sow_crafted } } }
			flag:isildur_nazgul_helmet_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = isildur_nazgul_helmet_sow_crafted } } }
			flag:nazgul_helmet_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = nazgul_helmet_sow_crafted } } }
			flag:sisters_nazgul_helmet_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = sisters_nazgul_helmet_sow_crafted } } }
			flag:witchking_helmet_sow_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = witchking_helmet_sow_crafted } } }
			flag:cele_circlet_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = cele_circlet_crafted } } }
			
			###############
			### Regalia ###
			###############

			flag:staff_gandalf_grey_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = staff_gandalf_grey_crafted } } }
			flag:staff_gandalf_white_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = staff_gandalf_white_crafted } } }
			flag:staff_radagast_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = staff_radagast_crafted } } }
			flag:staff_saruman_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = staff_saruman_crafted } } }
			flag:thranduil_staff_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = thranduil_staff_crafted } } }
			flag:boromir_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = boromir_shield_crafted } } }
			flag:dwarf_regal_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarf_regal_shield_crafted } } }
			flag:dwarf_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = dwarf_shield_crafted } } }
			flag:easterling_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = easterling_shield_crafted } } }
			flag:faramir_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = faramir_shield_crafted } } }
			flag:gondor_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = gondor_shield_crafted } } }
			flag:moria_orc_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = moria_orc_shield_crafted } } }
			flag:noldor_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = noldor_shield_crafted } } }
			flag:numenorean_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = numenorean_shield_crafted } } }
			flag:rohan_royalguard_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = rohan_royalguard_shield_crafted } } }
			flag:uruk_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = uruk_shield_crafted } } }
			flag:whitehand_shield_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = whitehand_shield_crafted } } }
			
			######################
			### Crafting Tools ### 
			######################
			
			flag:turann_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = turann_crafted } } }
			flag:nardring_crafted = { scope:player_scope = { add_artifact_icon_variable = { NAME = nardring_crafted } } }
			
			###############
			### Default ###
			###############
			
			flag:default_armor = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_armor } } }
			flag:default_regalia = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_regalia } } }
			flag:default_helmet = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_helmet } } }
			flag:default_trinket = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_trinket } } }
			flag:default_weapon = { scope:player_scope = { add_artifact_icon_variable = { NAME = default_weapon } } }
		}
	}
}

#################################
### Change Description + Name ###
#################################

change_artifact_name_description = {
	is_valid = {
		custom_tooltip = {
			text = crafting_artifact_time_tt
			NOT = { has_variable = craft_time }
		}
	}

	effect = { 
		set_variable = custom_artifact_inscriptions
		trigger_event = crafting_mechanic.0004
	}
}

#########################
### Perk Interactions ###
#########################

dismantle_artifact = {
	saved_scopes = {
		player_scope
		recipient_scope
	}
	is_valid = {
		exists = root
		scope:player_scope ?= { has_perk = tinkerer_perk }
		scope:recipient_scope ?= scope:player_scope
		trigger_if = {
			limit = { exists = root }
			NOT = {
				# Metals
				has_variable = lead
				has_variable = tin
				has_variable = copper
				has_variable = bronze
				has_variable = iron
				has_variable = steel
				has_variable = silver
				has_variable = gold
				has_variable = mithril
				# Gems
				has_variable = quartz
				has_variable = peridot
				has_variable = onyx
				has_variable = amethyst
				has_variable = ruby
				has_variable = sapphire
				has_variable = emerald
				has_variable = diamond
				has_variable = elven_gems
			}
		}
	}
	effect = {
		if = {
			limit = { rarity = common }
			random_list = { # Metals
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = lead
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = lead }
					}
				}
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = tin
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = tin }
					}
				}
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = copper
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = copper }
					}
				}
				15 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = iron
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = iron }
					}
				}
			}
			random_list = { # Gems
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = quartz
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = quartz }
					}
				}
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = peridot
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = peridot }
					}
				}
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = onyx
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = onyx }
					}
				}
				15 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = ruby
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = ruby }
					}
				}
			}
		}
		else_if = {
			limit = { rarity = masterwork }
			random_list = { # Metals
				15 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = lead
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = lead }
					}
				}
				15 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = tin
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = tin }
					}
				}
				15 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = copper
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = copper }
					}
				}
				30 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = iron
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = iron }
					}
				}
				5 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = silver
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = silver }
					}
				}
				5 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = gold
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = gold }
					}
				}
			}
			random_list = { # Gems
				10 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = quartz
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = quartz }
					}
				}
				10 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = peridot
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = peridot }
					}
				}
				10 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = onyx
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = onyx }
					}
				}
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = ruby
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = ruby }
					}
				}
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = emerald
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = ruby }
					}
				}
				20 = {
					scope:player_scope = {
						create_metal_gem_artifact = {
							METAL = amethyst
							MODIFIER = artifact_monthly_minor_prestige_1_modifier
						}
						set_metal_gem_variable = { METAL = ruby }
					}
				}
			} 
		}
		
		destroy_artifact = root
	}
}

##############################
### Save Artifact Template ###
##############################

save_template_button = {
	is_valid = {
		custom_tooltip = {
			text = need_metal_for_tempalte_tooltip
			AND = {
				has_variable = used_material
				NOT = {
					var:used_material = flag:no_material
				}
			}
		}
		custom_tooltip = {
			text = already_saved_template_of_same_modifiers
		}
	}

	effect = {
		create_story = story_artifact_saved_template
	}
}

load_template_button = {
	saved_scopes = {
		player_scope
	}
	is_valid = {
		custom_tooltip = {
			text = need_tempalte_to_load_button

			trigger_if = { # Helmet Artifact Templates
				limit = { 
					scope:player_scope = { has_variable = artifact_craft }
					scope:player_scope = { var:artifact_craft ?= flag:helmet_artifact }
				}
				root = { 
					has_variable = artifact_craft
					var:artifact_craft = flag:helmet_artifact
				}
			} 
			trigger_if = { # Trinket Artifact Templates
				limit = { 
					scope:player_scope = { has_variable = artifact_craft }
					scope:player_scope = { var:artifact_craft ?= flag:trinket_artifact }
				}
				root = { 
					has_variable = artifact_craft
					var:artifact_craft = flag:trinket_artifact
				}
			} 
			trigger_if = { # Armor Artifact Templates
				limit = { 
					scope:player_scope = { has_variable = artifact_craft }
					scope:player_scope = { var:artifact_craft ?= flag:armor_artifact }
				}
				root = { 
					has_variable = artifact_craft
					var:artifact_craft = flag:armor_artifact
				}
			} 
			trigger_if = { # Regaliaa Artifact Templates
				limit = { 
					scope:player_scope = { has_variable = artifact_craft }
					scope:player_scope = { var:artifact_craft ?= flag:regalia_artifact }
				}
				root = { 
					has_variable = artifact_craft
					var:artifact_craft = flag:regalia_artifact
				}
			} 
			trigger_if = { # Weapon Artifact Templates
				limit = { 
					scope:player_scope = { has_variable = artifact_craft }
					scope:player_scope = { var:artifact_craft ?= flag:weapon_artifact }
				}
				root = { 
					has_variable = artifact_craft
					var:artifact_craft = flag:weapon_artifact
				}
			} 
			trigger_if = { # Crafting Tools Artifact Templates
				limit = { 
					scope:player_scope = { has_variable = artifact_craft }
					scope:player_scope = { var:artifact_craft ?= flag:regalia_artifact }
				}
				root = {  
					has_variable = artifact_craft
					var:artifact_craft = flag:crafting_tools_artifact
				}
			}
		}
	}

	effect = {
		if = {
			limit = { has_variable = artifact_craft } 
			scope:player_scope = {
				set_variable = {
					name = artifact_craft
					value = root.var:artifact_craft
				}
			}
		}

		if = {
			limit = { scope:player_scope = { has_variable = artifact_craft } }
			# Artifact crafting cost
			if = { # material_gold_value
				limit = { scope:player_scope = { has_variable = material_gold_value } }
				scope:player_scope = {
					remove_variable = material_gold_value
				}
			}
			if = { # total_gold_cost
				limit = { scope:player_scope = { has_variable = total_gold_cost } }
				scope:player_scope = {
					remove_variable = total_gold_cost
				}
			}
			if = { # gold_value
				limit = { scope:player_scope = { has_variable = gold_value } }
				scope:player_scope = {
					remove_variable = gold_value
				}
			}
			if = { # gem_gold_value
				limit = { scope:player_scope = { has_variable = gem_gold_value } }
				scope:player_scope = {
					remove_variable = gem_gold_value
				}
			}
			if = { # num_enchants_used
				limit = { scope:player_scope = { has_variable = num_enchants_used } }
				scope:player_scope = {
					remove_variable = num_enchants_used
				}
			}
			if = { # random_variable
				limit = { scope:player_scope = { has_variable = random_variable } }
				scope:player_scope = {
					remove_variable = random_variable
				}
			}
			if = { # used_material
				limit = { scope:player_scope = { has_variable = used_material } }
				scope:player_scope = {
					remove_variable = used_material
				}
			}
			if = { # artifact_visual
				limit = { scope:player_scope = { has_variable = artifact_visual } }
				scope:player_scope = {
					remove_variable = artifact_visual
				}
			}
			if = { # selected_artifact
				limit = { scope:player_scope = { has_variable = selected_artifact } }
				scope:player_scope = {
					remove_variable = selected_artifact
				}
			}
			if = { # artifact_being_edited
				limit = { scope:player_scope = { has_variable = artifact_being_edited } }
				scope:player_scope = {
					remove_variable = artifact_being_edited
				}
			}
			if = { # editing_custom_artifact
				limit = { scope:player_scope = { has_variable = editing_custom_artifact } }
				scope:player_scope = {
					remove_variable = editing_custom_artifact
				}
			}
			if = { # artifact_crafting_modifiers
				limit = { scope:player_scope = { has_variable_list = artifact_crafting_modifiers } }
				scope:player_scope = {
					every_in_list = {
						variable = artifact_crafting_modifiers
						this = { save_scope_as = modifier_to_remove }
						scope:player_scope = {
							remove_list_variable = {
								name = artifact_crafting_modifiers
								target = scope:modifier_to_remove
							}
						}
					}
				}
			}

			# Artifact Modifier Back-end Variables

			if = { # gem_gold_value
				limit = { scope:player_scope = { has_variable = used_gem } }
				scope:player_scope = {
					remove_variable = used_gem
				}
			}
			if = { # martial_val
				limit = { scope:player_scope = { has_variable = martial_val } }
				scope:player_scope = {
					remove_variable = martial_val
				}
			}
			if = { # diplomacy_val
				limit = { scope:player_scope = { has_variable = diplomacy_val } }
				scope:player_scope = {
					remove_variable = diplomacy_val
				}
			}
			if = { # stewardship_val
				limit = { scope:player_scope = { has_variable = stewardship_val } }
				scope:player_scope = {
					remove_variable = stewardship_val
				}
			}
			if = { # intrigue_val
				limit = { scope:player_scope = { has_variable = intrigue_val } }
				scope:player_scope = {
					remove_variable = intrigue_val
				}
			}
			if = { # learning_val
				limit = { scope:player_scope = { has_variable = learning_val } }
				scope:player_scope = {
					remove_variable = learning_val
				}
			}
			if = { # prowess_val
				limit = { scope:player_scope = { has_variable = prowess_val } }
				scope:player_scope = {
					remove_variable = prowess_val
				}
			}
			if = { # artifact_knight_limit_value
				limit = { scope:player_scope = { has_variable = artifact_knight_limit_value } }
				scope:player_scope = {
					remove_variable = artifact_knight_limit_value
				}
				scope:player_scope = {
					remove_variable = artifact_knight_limit_gold_to_remove
				}
			}
			if = { # artifact_knight_limit_value
				limit = { scope:player_scope = { has_variable = artifact_knight_limit_value } }
				scope:player_scope = {
					remove_variable = artifact_knight_limit_value
				}
				scope:player_scope = {
					remove_variable = artifact_knight_limit_gold_to_remove
				}
			}
			if = { # artifact_knight_effectiveness_value
				limit = { scope:player_scope = { has_variable = artifact_knight_effectiveness_value } }
				scope:player_scope = {
					remove_variable = artifact_knight_effectiveness_value
				}
				scope:player_scope = {
					remove_variable = artifact_knight_effectiveness_gold_to_remove
				}
			}
			if = { # artifact_controlled_province_advantage_value
				limit = { scope:player_scope = { has_variable = artifact_controlled_province_advantage_value } }
				scope:player_scope = {
					remove_variable = artifact_controlled_province_advantage_value
				}
				scope:player_scope = {
					remove_variable = artifact_controlled_province_advantage_gold_to_remove
				}
			}
			if = { # artifact_levy_reinforcement_rate_same_faith_value
				limit = { scope:player_scope = { has_variable = artifact_levy_reinforcement_rate_same_faith_value } }
				scope:player_scope = {
					remove_variable = artifact_levy_reinforcement_rate_same_faith_value
				}
				scope:player_scope = {
					remove_variable = artifact_levy_reinforcement_rate_same_faith_gold_to_remove
				}
			}
			if = { # artifact_negate_prowess_penalty_add_value
				limit = { scope:player_scope = { has_variable = artifact_negate_prowess_penalty_add_value } }
				scope:player_scope = {
					remove_variable = artifact_negate_prowess_penalty_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_negate_prowess_penalty_add_gold_to_remove
				}
			}
			if = { # artifact_raid_speed_value
				limit = { scope:player_scope = { has_variable = artifact_raid_speed_value }}
				scope:player_scope = { 
					remove_variable = artifact_raid_speed_value
				}
				scope:player_scope = {
					remove_variable = artifact_raid_speed_gold_to_remove
				}
			}
			if = { # artifact_enemy_hard_casualty_modifier_value
				limit = { scope:player_scope = { has_variable = artifact_enemy_hard_casualty_modifier_value } }
				scope:player_scope = {
					remove_variable = artifact_enemy_hard_casualty_modifier_value
				}
				scope:player_scope = {
					remove_variable = artifact_enemy_hard_casualty_modifier_gold_to_remove
				}
			}
			if = { # artifact_hard_casualty_modifier_value
				limit = { scope:player_scope = { has_variable = artifact_hard_casualty_modifier_value } }
				scope:player_scope = {
					remove_variable = artifact_hard_casualty_modifier_value
				}
				scope:player_scope = {
					remove_variable = artifact_hard_casualty_modifier_gold_to_remove
				}
			}
			if = { # artifact_heavy_cavalry_toughness_value
				limit = { scope:player_scope = { has_variable = artifact_heavy_cavalry_toughness_value } }
				scope:player_scope = {
					remove_variable = artifact_heavy_cavalry_toughness_value
				}
				scope:player_scope = {
					remove_variable = artifact_heavy_cavalry_toughness_gold_to_remove
				}
			}
			if = { # artifact_heavy_infantry_toughness_value
				limit = { scope:player_scope = { has_variable = artifact_heavy_infantry_toughness_value } }
				scope:player_scope = {
					remove_variable = artifact_heavy_infantry_toughness_value
				}
				scope:player_scope = {
					remove_variable = artifact_heavy_infantry_toughness_gold_to_remove
				}
			}
			if = { # artifact_retreat_losses_value
				limit = { scope:player_scope = { has_variable = artifact_retreat_losses_value } }
				scope:player_scope = {
					remove_variable = artifact_retreat_losses_value
				}
				scope:player_scope = {
					remove_variable = artifact_retreat_losses_gold_to_remove
				}
			}
			if = { # artifact_pursue_efficiency_value
				limit = { scope:player_scope = { has_variable = artifact_pursue_efficiency_value } }
				scope:player_scope = {
					remove_variable = artifact_pursue_efficiency_value
				}
				scope:player_scope = {
					remove_variable = artifact_pursue_efficiency_gold_to_remove
				}
			}
			if = { # artifact_monthly_minor_prestige_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_minor_prestige_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_minor_prestige_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_minor_prestige_gold_to_remove
				}
			}
			if = { # artifact_monthly_prestige_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_prestige_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_prestige_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_prestige_gold_to_remove
				}
			}
			if = { # artifact_short_reign_duration_mult_value
				limit = { scope:player_scope = { has_variable = artifact_short_reign_duration_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_short_reign_duration_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_short_reign_duration_mult_gold_to_remove
				}
			}
			if = { # artifact_court_grandeur_baseline_add_value
				limit = { scope:player_scope = { has_variable = artifact_court_grandeur_baseline_add_value } }
				scope:player_scope = {
					remove_variable = artifact_court_grandeur_baseline_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_court_grandeur_baseline_add_gold_to_remove
				}
			}
			if = { # artifact_dynasty_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_dynasty_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_dynasty_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_dynasty_opinion_gold_to_remove
				}
			}
			if = { # artifact_monthly_dynasty_prestige_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_dynasty_prestige_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_dynasty_prestige_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_dynasty_prestige_gold_to_remove
				}
			}
			if = { # artifact_monthly_prestige_add_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_prestige_add_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_prestige_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_prestige_add_gold_to_remove
				}
			}
			if = { # artifact_monthly_prestige_gain_per_dread_add_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_prestige_gain_per_dread_add_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_prestige_gain_per_dread_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_prestige_gain_per_dread_add_gold_to_remove
				}
			}
			if = { # artifact_monthly_prestige_gain_per_knight_add_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_prestige_gain_per_knight_add_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_prestige_gain_per_knight_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_prestige_gain_per_knight_add_gold_to_remove
				}
			}
			if = { # artifact_monthly_tyranny_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_tyranny_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_tyranny_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_tyranny_gold_to_remove
				}
			}
			if = { # artifact_dread_gain_mult_value
				limit = { scope:player_scope = { has_variable = artifact_dread_gain_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_dread_gain_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_dread_gain_mult_gold_to_remove
				}
			}
			if = { # artifact_dread_baseline_add_value
				limit = { scope:player_scope = { has_variable = artifact_dread_baseline_add_value } }
				scope:player_scope = {
					remove_variable = artifact_dread_baseline_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_dread_baseline_add_gold_to_remove
				}
			}
			if = { # artifact_mercenary_hire_cost_mult_value
				limit = { scope:player_scope = { has_variable = artifact_mercenary_hire_cost_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_mercenary_hire_cost_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_mercenary_hire_cost_mult_gold_to_remove
				}
			}
			if = { # artifact_happy_powerful_vassal_tax_contribution_mult_value
				limit = { scope:player_scope = { has_variable = artifact_happy_powerful_vassal_tax_contribution_mult_value }}
				scope:player_scope = { 
					remove_variable = artifact_happy_powerful_vassal_tax_contribution_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_happy_powerful_vassal_tax_contribution_mult_gold_to_remove
				}
			}
			if = { # artifact_courtly_tax_contribution_mult_value
				limit = { scope:player_scope = { has_variable = artifact_courtly_tax_contribution_mult_value }}
				scope:player_scope = { 
					remove_variable = artifact_courtly_tax_contribution_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_courtly_tax_contribution_mult_gold_to_remove
				}
			}
			if = { # artifact_glory_hound_tax_contribution_mult_value
				limit = { scope:player_scope = { has_variable = artifact_glory_hound_tax_contribution_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_glory_hound_tax_contribution_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_glory_hound_tax_contribution_mult_gold_to_remove
				}
			}
			if = { # artifact_parochial_tax_contribution_mult_value
				limit = { scope:player_scope = { has_variable = artifact_parochial_tax_contribution_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_parochial_tax_contribution_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_parochial_tax_contribution_mult_gold_to_remove
				}
			}
			if = { # artifact_zealot_tax_contribution_mult_value
				limit = { scope:player_scope = { has_variable = artifact_zealot_tax_contribution_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_zealot_tax_contribution_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_zealot_tax_contribution_mult_gold_to_remove
				}
			}
			if = { # artifact_glory_hound_levy_contribution_mult_value
				limit = { scope:player_scope = { has_variable = artifact_glory_hound_levy_contribution_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_glory_hound_levy_contribution_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_glory_hound_levy_contribution_mult_gold_to_remove
				}
			}
			if = { # artifact_zealot_levy_contribution_mult_value
				limit = { scope:player_scope = { has_variable = artifact_zealot_levy_contribution_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_zealot_levy_contribution_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_zealot_levy_contribution_mult_gold_to_remove
				}
			}
			if = { # artifact_vassal_limit_value
				limit = { scope:player_scope = { has_variable = artifact_vassal_limit_value } }
				scope:player_scope = {
					remove_variable = artifact_vassal_limit_value
				}
				scope:player_scope = {
					remove_variable = artifact_vassal_limit_gold_to_remove
				}
			}
			if = { # artifact_courtly_vassal_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_courtly_vassal_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_courtly_vassal_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_courtly_vassal_opinion_gold_to_remove
				}
			}
			if = { # artifact_glory_hound_vassal_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_glory_hound_vassal_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_glory_hound_vassal_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_glory_hound_vassal_opinion_gold_to_remove
				}
			}
			if = { # artifact_parochial_vassal_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_parochial_vassal_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_parochial_vassal_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_parochial_vassal_opinion_gold_to_remove
				}
			}
			if = { # artifact_zealot_vassal_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_zealot_vassal_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_zealot_vassal_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_zealot_vassal_opinion_gold_to_remove
				}
			}
			if = { # artifact_powerful_vassal_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_powerful_vassal_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_powerful_vassal_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_powerful_vassal_opinion_gold_to_remove
				}
			}
			if = { # artifact_independent_ruler_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_independent_ruler_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_independent_ruler_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_independent_ruler_opinion_gold_to_remove
				}
			}
			if = { # artifact_men_at_arms_maintenance_value
				limit = { scope:player_scope = { has_variable = artifact_men_at_arms_maintenance_value } }
				scope:player_scope = {
					remove_variable = artifact_men_at_arms_maintenance_value
				}
				scope:player_scope = {
					remove_variable = artifact_men_at_arms_maintenance_gold_to_remove
				}
			}
			if = { # artifact_domain_tax_mult_value
				limit = { scope:player_scope = { has_variable = artifact_domain_tax_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_domain_tax_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_domain_tax_mult_gold_to_remove
				}
			}
			if = { # artifact_build_gold_cost_value
				limit = { scope:player_scope = { has_variable = artifact_build_gold_cost_value } }
				scope:player_scope = {
					remove_variable = artifact_build_gold_cost_value
				}
				scope:player_scope = {
					remove_variable = artifact_build_gold_cost_gold_to_remove
				}
			}
			if = { # artifact_courtier_and_guest_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_courtier_and_guest_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_courtier_and_guest_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_courtier_and_guest_opinion_gold_to_remove
				}
			}
			if = { # artifact_attraction_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_attraction_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_attraction_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_attraction_opinion_gold_to_remove
				}
			}
			if = { # artifact_build_time_value
				limit = { scope:player_scope = { has_variable = artifact_build_time_value } }
				scope:player_scope = {
					remove_variable = artifact_build_time_value
				}
				scope:player_scope = {
					remove_variable = artifact_build_time_gold_to_remove
				}
			}
			if = { # artifact_monthly_income_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_income_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_income_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_income_gold_to_remove
				}
			}
			if = { # artifact_monthly_piety_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_piety_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_piety_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_piety_gold_to_remove
				}
			}
			if = { # artifact_monthly_piety_gain_per_knight_add_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_piety_gain_per_knight_add_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_piety_gain_per_knight_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_piety_gain_per_knight_add_gold_to_remove
				}
			}
			if = { # artifact_domain_tax_same_faith_mult_value
				limit = { scope:player_scope = { has_variable = artifact_domain_tax_same_faith_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_domain_tax_same_faith_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_domain_tax_same_faith_mult_gold_to_remove
				}
			}
			if = { # artifact_monthly_piety_gain_mult_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_piety_gain_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_piety_gain_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_piety_gain_mult_gold_to_remove
				}
			}
			if = { # artifact_same_faith_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_same_faith_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_same_faith_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_same_faith_opinion_gold_to_remove
				}
			}
			if = { # artifact_monthly_piety_from_buildings_mult_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_piety_from_buildings_mult_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_piety_from_buildings_mult_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_piety_from_buildings_mult_gold_to_remove
				}
			}
			if = { # artifact_clergy_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_clergy_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_clergy_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_clergy_opinion_gold_to_remove
				}
			}
			if = { # artifact_church_holding_build_gold_cost_value
				limit = { scope:player_scope = { has_variable = artifact_church_holding_build_gold_cost_value } }
				scope:player_scope = {
					remove_variable = artifact_church_holding_build_gold_cost_value
				}
				scope:player_scope = {
					remove_variable = artifact_church_holding_build_gold_cost_gold_to_remove
				}
			}
			if = { # artifact_different_faith_opinion_value
				limit = { scope:player_scope = { has_variable = artifact_different_faith_opinion_value } }
				scope:player_scope = {
					remove_variable = artifact_different_faith_opinion_value
				}
				scope:player_scope = {
					remove_variable = artifact_different_faith_opinion_gold_to_remove
				}
			}
			if = { # artifact_owned_hostile_scheme_success_chance_add_value
				limit = { scope:player_scope = { has_variable = artifact_owned_hostile_scheme_success_chance_add_value } }
				scope:player_scope = {
					remove_variable = artifact_owned_hostile_scheme_success_chance_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_owned_hostile_scheme_success_chance_add_gold_to_remove
				}
			}
			if = { # artifact_owned_personal_scheme_success_chance_add_value
				limit = { scope:player_scope = { has_variable = artifact_owned_personal_scheme_success_chance_add_value } }
				scope:player_scope = {
					remove_variable = artifact_owned_personal_scheme_success_chance_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_owned_personal_scheme_success_chance_add_gold_to_remove
				}
			}
			if = { # artifact_owned_scheme_secrecy_add_value
				limit = { scope:player_scope = { has_variable = artifact_owned_scheme_secrecy_add_value } }
				scope:player_scope = {
					remove_variable = artifact_owned_scheme_secrecy_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_owned_scheme_secrecy_add_gold_to_remove
				}
			}
			if = { # artifact_hostile_scheme_phase_duration_add_value
				limit = { scope:player_scope = { has_variable = artifact_hostile_scheme_phase_duration_add_value }}
				scope:player_scope = { 
					remove_variable = artifact_hostile_scheme_phase_duration_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_hostile_scheme_phase_duration_add_gold_to_remove
				}
			}
			if = { # artifact_personal_scheme_phase_duration_add_value
				limit = { scope:player_scope = { has_variable = artifact_personal_scheme_phase_duration_add_value } }
				scope:player_scope = {
					remove_variable = artifact_personal_scheme_phase_duration_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_personal_scheme_phase_duration_add_gold_to_remove
				}
			}
			if = { # artifact_fertility_gain_value
				limit = { scope:player_scope = { has_variable = artifact_fertility_gain_value } }
				scope:player_scope = {
					remove_variable = artifact_fertility_gain_value
				}
				scope:player_scope = {
					remove_variable = artifact_fertility_gain_gold_to_remove
				}
			}
			if = { # artifact_courting_scheme_phase_duration_add_value
				limit = { scope:player_scope = { has_variable = artifact_courting_scheme_phase_duration_add_value } }
				scope:player_scope = {
					remove_variable = artifact_courting_scheme_phase_duration_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_courting_scheme_phase_duration_add_gold_to_remove
				}
			}
			if = { # artifact_seduce_scheme_phase_duration_add_value
				limit = { scope:player_scope = { has_variable = artifact_seduce_scheme_phase_duration_add_value } }
				scope:player_scope = {
					remove_variable = artifact_seduce_scheme_phase_duration_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_seduce_scheme_phase_duration_add_gold_to_remove
				}
			}
			if = { # artifact_spouse_opinion_add_value
				limit = { scope:player_scope = { has_variable = artifact_spouse_opinion_add_value } }
				scope:player_scope = {
					remove_variable = artifact_spouse_opinion_add_value
				}
				scope:player_scope = {
					remove_variable = artifact_spouse_opinion_add_gold_to_remove
				}
			}
			if = { # artifact_stress_gain_value
				limit = { scope:player_scope = { has_variable = artifact_stress_gain_value } }
				scope:player_scope = {
					remove_variable = artifact_stress_gain_value
				}
				scope:player_scope = {
					remove_variable = artifact_stress_gain_gold_to_remove
				}
			}
			if = { # artifact_monthly_diplomacy_lifestyle_xp_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_diplomacy_lifestyle_xp_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_diplomacy_lifestyle_xp_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_diplomacy_lifestyle_xp_gold_to_remove
				}
			}
			if = { # artifact_monthly_martial_lifestyle_xp_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_martial_lifestyle_xp_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_martial_lifestyle_xp_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_martial_lifestyle_xp_gold_to_remove
				}
			}
			if = { # artifact_monthly_stewardship_lifestyle_xp_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_stewardship_lifestyle_xp_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_stewardship_lifestyle_xp_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_stewardship_lifestyle_xp_gold_to_remove
				}
			}
			if = { # artifact_monthly_intrigue_lifestyle_xp_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_intrigue_lifestyle_xp_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_intrigue_lifestyle_xp_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_intrigue_lifestyle_xp_gold_to_remove
				}
			}
			if = { # artifact_monthly_learning_lifestyle_xp_value
				limit = { scope:player_scope = { has_variable = artifact_monthly_learning_lifestyle_xp_value } }
				scope:player_scope = {
					remove_variable = artifact_monthly_learning_lifestyle_xp_value
				}
				scope:player_scope = {
					remove_variable = artifact_monthly_learning_lifestyle_xp_gold_to_remove
				}
			}
			if = { # artifact_health_gain_value
				limit = { scope:player_scope = { has_variable = artifact_health_gain_value } }
				scope:player_scope = {
					remove_variable = artifact_health_gain_value
				}
				scope:player_scope = {
					remove_variable = artifact_health_gain_gold_to_remove
				}
			}

			#################################
			# Set the story cycle variables #
			#################################

			# Artifact crafting cost
			if = { # material_gold_value
				limit = { has_variable = material_gold_value } 
				scope:player_scope = {
					set_variable = {
						name = material_gold_value
						value = root.var:material_gold_value
					}
				}
			}
			if = { # total_gold_cost
				limit = { has_variable = total_gold_cost } 
				scope:player_scope = {
					set_variable = {
						name = total_gold_cost
						value = root.var:total_gold_cost
					}
				}
			}
			if = { # gold_value
				limit = { has_variable = gold_value } 
				scope:player_scope = {
					set_variable = {
						name = gold_value
						value = root.var:gold_value
					}
				}
			}
			if = { # gem_gold_value
				limit = { has_variable = gem_gold_value } 
				scope:player_scope = {
					set_variable = {
						name = gem_gold_value
						value = root.var:gem_gold_value
					}
				}
			}
			if = { # num_enchants_used
				limit = { has_variable = num_enchants_used } 
				scope:player_scope = {
					set_variable = {
						name = num_enchants_used
						value = root.var:num_enchants_used
					}
				}
			}
			if = { # random_variable
				limit = { has_variable = random_variable } 
				scope:player_scope = {
					set_variable = {
						name = random_variable
						value = root.var:random_variable
					}
				}
			}
			if = { # used_material
				limit = { has_variable = used_material } 
				scope:player_scope = {
					set_variable = {
						name = used_material
						value = root.var:used_material
					}
				}
			}
			if = { # artifact_visual
				limit = { has_variable = artifact_visual } 
				scope:player_scope = {
					set_variable = {
						name = artifact_visual
						value = root.var:artifact_visual
					}
				}
			}
			if = { # selected_artifact
				limit = { has_variable = selected_artifact } 
				scope:player_scope = {
					set_variable = {
						name = selected_artifact
						value = root.var:selected_artifact
					}
				}
			}
			if = { # artifact_being_edited
				limit = { has_variable = artifact_being_edited } 
				scope:player_scope = {
					set_variable = {
						name = artifact_being_edited
						value = root.var:artifact_being_edited
					}
				}
			}
			if = { # editing_custom_artifact
				limit = { has_variable = editing_custom_artifact } 
				scope:player_scope = {
					set_variable = {
						name = editing_custom_artifact
						value = root.var:editing_custom_artifact
					}
				}
			}
			if = { # artifact_crafting_modifiers
				limit = { has_variable_list = artifact_crafting_modifiers } 
				root = {
					every_in_list = {
						variable = artifact_crafting_modifiers
						save_scope_as = curr_scope
						scope:player_scope = {
							add_to_variable_list = {
								name = artifact_crafting_modifiers
								target = scope:curr_scope
							}
						}
					}
				}
			}

			# Artifact Modifier Back-end Variables
			if = { # gem_gold_value
				limit = { has_variable = used_gem } 
				scope:player_scope = {
					set_variable = {
						name = used_gem
						value = root.var:used_gem
					}
				}
			}
			if = { # martial_val
				limit = { has_variable = martial_val } 
				scope:player_scope = {
					set_variable = {
						name = martial_val
						value = root.var:martial_val
					}
				}
			}
			if = { # diplomacy_val
				limit = { has_variable = diplomacy_val } 
				scope:player_scope = {
					set_variable = {
						name = diplomacy_val
						value = root.var:diplomacy_val
					}
				}
			}
			if = { # stewardship_val
				limit = { has_variable = stewardship_val } 
				scope:player_scope = {
					set_variable = {
						name = stewardship_val
						value = root.var:stewardship_val
					}
				}
			}
			if = { # intrigue_val
				limit = { has_variable = intrigue_val } 
				scope:player_scope = {
					set_variable = {
						name = intrigue_val
						value = root.var:intrigue_val
					}
				}
			}
			if = { # learning_val
				limit = { has_variable = learning_val } 
				scope:player_scope = {
					set_variable = {
						name = learning_val
						value = root.var:learning_val
					}
				}
			}
			if = { # prowess_val
				limit = { has_variable = prowess_val } 
				scope:player_scope = {
					set_variable = {
						name = prowess_val
						value = root.var:prowess_val
					}
				}
			}
			if = { # artifact_knight_limit_value
				limit = { has_variable = artifact_knight_limit_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_knight_limit_value
						value = root.var:artifact_knight_limit_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_knight_limit_gold_to_remove
						value = root.var:artifact_knight_limit_gold_to_remove
					}
				}
			}
			if = { # artifact_knight_limit_value
				limit = { has_variable = artifact_knight_limit_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_knight_limit_value
						value = root.var:artifact_knight_limit_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_knight_limit_gold_to_remove
						value = root.var:artifact_knight_limit_gold_to_remove
					}
				}
			}
			if = { # artifact_knight_effectiveness_value
				limit = { has_variable = artifact_knight_effectiveness_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_knight_effectiveness_value
						value = root.var:artifact_knight_effectiveness_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_knight_effectiveness_gold_to_remove
						value = root.var:artifact_knight_effectiveness_gold_to_remove
					}
				}
			}
			if = { # artifact_controlled_province_advantage_value
				limit = { has_variable = artifact_controlled_province_advantage_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_controlled_province_advantage_value
						value = root.var:artifact_controlled_province_advantage_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_controlled_province_advantage_gold_to_remove
						value = root.var:artifact_controlled_province_advantage_gold_to_remove
					}
				}
			}
			if = { # artifact_levy_reinforcement_rate_same_faith_value
				limit = { has_variable = artifact_levy_reinforcement_rate_same_faith_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_levy_reinforcement_rate_same_faith_value
						value = root.var:artifact_levy_reinforcement_rate_same_faith_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_levy_reinforcement_rate_same_faith_gold_to_remove
						value = root.var:artifact_levy_reinforcement_rate_same_faith_gold_to_remove
					}
				}
			}
			if = { # artifact_negate_prowess_penalty_add_value
				limit = { has_variable = artifact_negate_prowess_penalty_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_negate_prowess_penalty_add_value
						value = root.var:artifact_negate_prowess_penalty_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_negate_prowess_penalty_add_gold_to_remove
						value = root.var:artifact_negate_prowess_penalty_add_gold_to_remove
					}
				}
			}
			if = { # artifact_raid_speed_value
				limit = { has_variable = artifact_raid_speed_value }
				scope:player_scope = { 
					set_variable = {
						name = artifact_raid_speed_value
						value = root.var:artifact_raid_speed_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_raid_speed_gold_to_remove
						value = root.var:artifact_raid_speed_gold_to_remove
					}
				}
			}
			if = { # artifact_enemy_hard_casualty_modifier_value
				limit = { has_variable = artifact_enemy_hard_casualty_modifier_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_enemy_hard_casualty_modifier_value
						value = root.var:artifact_enemy_hard_casualty_modifier_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_enemy_hard_casualty_modifier_gold_to_remove
						value = root.var:artifact_enemy_hard_casualty_modifier_gold_to_remove
					}
				}
			}
			if = { # artifact_hard_casualty_modifier_value
				limit = { has_variable = artifact_hard_casualty_modifier_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_hard_casualty_modifier_value
						value = root.var:artifact_hard_casualty_modifier_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_hard_casualty_modifier_gold_to_remove
						value = root.var:artifact_hard_casualty_modifier_gold_to_remove
					}
				}
			}
			if = { # artifact_heavy_cavalry_toughness_value
				limit = { has_variable = artifact_heavy_cavalry_toughness_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_heavy_cavalry_toughness_value
						value = root.var:artifact_heavy_cavalry_toughness_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_heavy_cavalry_toughness_gold_to_remove
						value = root.var:artifact_heavy_cavalry_toughness_gold_to_remove
					}
				}
			}
			if = { # artifact_heavy_infantry_toughness_value
				limit = { has_variable = artifact_heavy_infantry_toughness_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_heavy_infantry_toughness_value
						value = root.var:artifact_heavy_infantry_toughness_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_heavy_infantry_toughness_gold_to_remove
						value = root.var:artifact_heavy_infantry_toughness_gold_to_remove
					}
				}
			}
			if = { # artifact_retreat_losses_value
				limit = { has_variable = artifact_retreat_losses_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_retreat_losses_value
						value = root.var:artifact_retreat_losses_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_retreat_losses_gold_to_remove
						value = root.var:artifact_retreat_losses_gold_to_remove
					}
				}
			}
			if = { # artifact_pursue_efficiency_value
				limit = { has_variable = artifact_pursue_efficiency_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_pursue_efficiency_value
						value = root.var:artifact_pursue_efficiency_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_pursue_efficiency_gold_to_remove
						value = root.var:artifact_pursue_efficiency_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_minor_prestige_value
				limit = { has_variable = artifact_monthly_minor_prestige_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_minor_prestige_value
						value = root.var:artifact_monthly_minor_prestige_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_minor_prestige_gold_to_remove
						value = root.var:artifact_monthly_minor_prestige_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_prestige_value
				limit = { has_variable = artifact_monthly_prestige_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_prestige_value
						value = root.var:artifact_monthly_prestige_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_prestige_gold_to_remove
						value = root.var:artifact_monthly_prestige_gold_to_remove
					}
				}
			}
			if = { # artifact_short_reign_duration_mult_value
				limit = { has_variable = artifact_short_reign_duration_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_short_reign_duration_mult_value
						value = root.var:artifact_short_reign_duration_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_short_reign_duration_mult_gold_to_remove
						value = root.var:artifact_short_reign_duration_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_court_grandeur_baseline_add_value
				limit = { has_variable = artifact_court_grandeur_baseline_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_court_grandeur_baseline_add_value
						value = root.var:artifact_court_grandeur_baseline_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_court_grandeur_baseline_add_gold_to_remove
						value = root.var:artifact_court_grandeur_baseline_add_gold_to_remove
					}
				}
			}
			if = { # artifact_dynasty_opinion_value
				limit = { has_variable = artifact_dynasty_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_dynasty_opinion_value
						value = root.var:artifact_dynasty_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_dynasty_opinion_gold_to_remove
						value = root.var:artifact_dynasty_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_dynasty_prestige_value
				limit = { has_variable = artifact_monthly_dynasty_prestige_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_dynasty_prestige_value
						value = root.var:artifact_monthly_dynasty_prestige_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_dynasty_prestige_gold_to_remove
						value = root.var:artifact_monthly_dynasty_prestige_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_prestige_add_value
				limit = { has_variable = artifact_monthly_prestige_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_prestige_add_value
						value = root.var:artifact_monthly_prestige_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_prestige_add_gold_to_remove
						value = root.var:artifact_monthly_prestige_add_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_prestige_gain_per_dread_add_value
				limit = { has_variable = artifact_monthly_prestige_gain_per_dread_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_prestige_gain_per_dread_add_value
						value = root.var:artifact_monthly_prestige_gain_per_dread_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_prestige_gain_per_dread_add_gold_to_remove
						value = root.var:artifact_monthly_prestige_gain_per_dread_add_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_prestige_gain_per_knight_add_value
				limit = { has_variable = artifact_monthly_prestige_gain_per_knight_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_prestige_gain_per_knight_add_value
						value = root.var:artifact_monthly_prestige_gain_per_knight_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_prestige_gain_per_knight_add_gold_to_remove
						value = root.var:artifact_monthly_prestige_gain_per_knight_add_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_tyranny_value
				limit = { has_variable = artifact_monthly_tyranny_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_tyranny_value
						value = root.var:artifact_monthly_tyranny_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_tyranny_gold_to_remove
						value = root.var:artifact_monthly_tyranny_gold_to_remove
					}
				}
			}
			if = { # artifact_dread_gain_mult_value
				limit = { has_variable = artifact_dread_gain_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_dread_gain_mult_value
						value = root.var:artifact_dread_gain_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_dread_gain_mult_gold_to_remove
						value = root.var:artifact_dread_gain_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_dread_baseline_add_value
				limit = { has_variable = artifact_dread_baseline_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_dread_baseline_add_value
						value = root.var:artifact_dread_baseline_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_dread_baseline_add_gold_to_remove
						value = root.var:artifact_dread_baseline_add_gold_to_remove
					}
				}
			}
			if = { # artifact_mercenary_hire_cost_mult_value
				limit = { has_variable = artifact_mercenary_hire_cost_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_mercenary_hire_cost_mult_value
						value = root.var:artifact_mercenary_hire_cost_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_mercenary_hire_cost_mult_gold_to_remove
						value = root.var:artifact_mercenary_hire_cost_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_happy_powerful_vassal_tax_contribution_mult_value
				limit = { has_variable = artifact_happy_powerful_vassal_tax_contribution_mult_value }
				scope:player_scope = { 
					set_variable = {
						name = artifact_happy_powerful_vassal_tax_contribution_mult_value
						value = root.var:artifact_happy_powerful_vassal_tax_contribution_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_happy_powerful_vassal_tax_contribution_mult_gold_to_remove
						value = root.var:artifact_happy_powerful_vassal_tax_contribution_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_courtly_tax_contribution_mult_value
				limit = { has_variable = artifact_courtly_tax_contribution_mult_value }
				scope:player_scope = { 
					set_variable = {
						name = artifact_courtly_tax_contribution_mult_value
						value = root.var:artifact_courtly_tax_contribution_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_courtly_tax_contribution_mult_gold_to_remove
						value = root.var:artifact_courtly_tax_contribution_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_glory_hound_tax_contribution_mult_value
				limit = { has_variable = artifact_glory_hound_tax_contribution_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_glory_hound_tax_contribution_mult_value
						value = root.var:artifact_glory_hound_tax_contribution_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_glory_hound_tax_contribution_mult_gold_to_remove
						value = root.var:artifact_glory_hound_tax_contribution_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_parochial_tax_contribution_mult_value
				limit = { has_variable = artifact_parochial_tax_contribution_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_parochial_tax_contribution_mult_value
						value = root.var:artifact_parochial_tax_contribution_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_parochial_tax_contribution_mult_gold_to_remove
						value = root.var:artifact_parochial_tax_contribution_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_zealot_tax_contribution_mult_value
				limit = { has_variable = artifact_zealot_tax_contribution_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_zealot_tax_contribution_mult_value
						value = root.var:artifact_zealot_tax_contribution_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_zealot_tax_contribution_mult_gold_to_remove
						value = root.var:artifact_zealot_tax_contribution_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_glory_hound_levy_contribution_mult_value
				limit = { has_variable = artifact_glory_hound_levy_contribution_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_glory_hound_levy_contribution_mult_value
						value = root.var:artifact_glory_hound_levy_contribution_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_glory_hound_levy_contribution_mult_gold_to_remove
						value = root.var:artifact_glory_hound_levy_contribution_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_zealot_levy_contribution_mult_value
				limit = { has_variable = artifact_zealot_levy_contribution_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_zealot_levy_contribution_mult_value
						value = root.var:artifact_zealot_levy_contribution_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_zealot_levy_contribution_mult_gold_to_remove
						value = root.var:artifact_zealot_levy_contribution_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_vassal_limit_value
				limit = { has_variable = artifact_vassal_limit_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_vassal_limit_value
						value = root.var:artifact_vassal_limit_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_vassal_limit_gold_to_remove
						value = root.var:artifact_vassal_limit_gold_to_remove
					}
				}
			}
			if = { # artifact_courtly_vassal_opinion_value
				limit = { has_variable = artifact_courtly_vassal_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_courtly_vassal_opinion_value
						value = root.var:artifact_courtly_vassal_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_courtly_vassal_opinion_gold_to_remove
						value = root.var:artifact_courtly_vassal_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_glory_hound_vassal_opinion_value
				limit = { has_variable = artifact_glory_hound_vassal_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_glory_hound_vassal_opinion_value
						value = root.var:artifact_glory_hound_vassal_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_glory_hound_vassal_opinion_gold_to_remove
						value = root.var:artifact_glory_hound_vassal_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_parochial_vassal_opinion_value
				limit = { has_variable = artifact_parochial_vassal_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_parochial_vassal_opinion_value
						value = root.var:artifact_parochial_vassal_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_parochial_vassal_opinion_gold_to_remove
						value = root.var:artifact_parochial_vassal_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_zealot_vassal_opinion_value
				limit = { has_variable = artifact_zealot_vassal_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_zealot_vassal_opinion_value
						value = root.var:artifact_zealot_vassal_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_zealot_vassal_opinion_gold_to_remove
						value = root.var:artifact_zealot_vassal_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_powerful_vassal_opinion_value
				limit = { has_variable = artifact_powerful_vassal_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_powerful_vassal_opinion_value
						value = root.var:artifact_powerful_vassal_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_powerful_vassal_opinion_gold_to_remove
						value = root.var:artifact_powerful_vassal_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_independent_ruler_opinion_value
				limit = { has_variable = artifact_independent_ruler_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_independent_ruler_opinion_value
						value = root.var:artifact_independent_ruler_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_independent_ruler_opinion_gold_to_remove
						value = root.var:artifact_independent_ruler_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_men_at_arms_maintenance_value
				limit = { has_variable = artifact_men_at_arms_maintenance_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_men_at_arms_maintenance_value
						value = root.var:artifact_men_at_arms_maintenance_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_men_at_arms_maintenance_gold_to_remove
						value = root.var:artifact_men_at_arms_maintenance_gold_to_remove
					}
				}
			}
			if = { # artifact_domain_tax_mult_value
				limit = { has_variable = artifact_domain_tax_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_domain_tax_mult_value
						value = root.var:artifact_domain_tax_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_domain_tax_mult_gold_to_remove
						value = root.var:artifact_domain_tax_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_build_gold_cost_value
				limit = { has_variable = artifact_build_gold_cost_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_build_gold_cost_value
						value = root.var:artifact_build_gold_cost_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_build_gold_cost_gold_to_remove
						value = root.var:artifact_build_gold_cost_gold_to_remove
					}
				}
			}
			if = { # artifact_courtier_and_guest_opinion_value
				limit = { has_variable = artifact_courtier_and_guest_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_courtier_and_guest_opinion_value
						value = root.var:artifact_courtier_and_guest_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_courtier_and_guest_opinion_gold_to_remove
						value = root.var:artifact_courtier_and_guest_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_attraction_opinion_value
				limit = { has_variable = artifact_attraction_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_attraction_opinion_value
						value = root.var:artifact_attraction_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_attraction_opinion_gold_to_remove
						value = root.var:artifact_attraction_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_build_time_value
				limit = { has_variable = artifact_build_time_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_build_time_value
						value = root.var:artifact_build_time_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_build_time_gold_to_remove
						value = root.var:artifact_build_time_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_income_value
				limit = { has_variable = artifact_monthly_income_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_income_value
						value = root.var:artifact_monthly_income_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_income_gold_to_remove
						value = root.var:artifact_monthly_income_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_piety_value
				limit = { has_variable = artifact_monthly_piety_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_piety_value
						value = root.var:artifact_monthly_piety_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_piety_gold_to_remove
						value = root.var:artifact_monthly_piety_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_piety_gain_per_knight_add_value
				limit = { has_variable = artifact_monthly_piety_gain_per_knight_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_piety_gain_per_knight_add_value
						value = root.var:artifact_monthly_piety_gain_per_knight_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_piety_gain_per_knight_add_gold_to_remove
						value = root.var:artifact_monthly_piety_gain_per_knight_add_gold_to_remove
					}
				}
			}
			if = { # artifact_domain_tax_same_faith_mult_value
				limit = { has_variable = artifact_domain_tax_same_faith_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_domain_tax_same_faith_mult_value
						value = root.var:artifact_domain_tax_same_faith_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_domain_tax_same_faith_mult_gold_to_remove
						value = root.var:artifact_domain_tax_same_faith_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_piety_gain_mult_value
				limit = { has_variable = artifact_monthly_piety_gain_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_piety_gain_mult_value
						value = root.var:artifact_monthly_piety_gain_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_piety_gain_mult_gold_to_remove
						value = root.var:artifact_monthly_piety_gain_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_same_faith_opinion_value
				limit = { has_variable = artifact_same_faith_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_same_faith_opinion_value
						value = root.var:artifact_same_faith_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_same_faith_opinion_gold_to_remove
						value = root.var:artifact_same_faith_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_piety_from_buildings_mult_value
				limit = { has_variable = artifact_monthly_piety_from_buildings_mult_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_piety_from_buildings_mult_value
						value = root.var:artifact_monthly_piety_from_buildings_mult_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_piety_from_buildings_mult_gold_to_remove
						value = root.var:artifact_monthly_piety_from_buildings_mult_gold_to_remove
					}
				}
			}
			if = { # artifact_clergy_opinion_value
				limit = { has_variable = artifact_clergy_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_clergy_opinion_value
						value = root.var:artifact_clergy_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_clergy_opinion_gold_to_remove
						value = root.var:artifact_clergy_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_church_holding_build_gold_cost_value
				limit = { has_variable = artifact_church_holding_build_gold_cost_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_church_holding_build_gold_cost_value
						value = root.var:artifact_church_holding_build_gold_cost_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_church_holding_build_gold_cost_gold_to_remove
						value = root.var:artifact_church_holding_build_gold_cost_gold_to_remove
					}
				}
			}
			if = { # artifact_different_faith_opinion_value
				limit = { has_variable = artifact_different_faith_opinion_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_different_faith_opinion_value
						value = root.var:artifact_different_faith_opinion_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_different_faith_opinion_gold_to_remove
						value = root.var:artifact_different_faith_opinion_gold_to_remove
					}
				}
			}
			if = { # artifact_owned_hostile_scheme_success_chance_add_value
				limit = { has_variable = artifact_owned_hostile_scheme_success_chance_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_owned_hostile_scheme_success_chance_add_value
						value = root.var:artifact_owned_hostile_scheme_success_chance_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_owned_hostile_scheme_success_chance_add_gold_to_remove
						value = root.var:artifact_owned_hostile_scheme_success_chance_add_gold_to_remove
					}
				}
			}
			if = { # artifact_owned_personal_scheme_success_chance_add_value
				limit = { has_variable = artifact_owned_personal_scheme_success_chance_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_owned_personal_scheme_success_chance_add_value
						value = root.var:artifact_owned_personal_scheme_success_chance_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_owned_personal_scheme_success_chance_add_gold_to_remove
						value = root.var:artifact_owned_personal_scheme_success_chance_add_gold_to_remove
					}
				}
			}
			if = { # artifact_owned_scheme_secrecy_add_value
				limit = { has_variable = artifact_owned_scheme_secrecy_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_owned_scheme_secrecy_add_value
						value = root.var:artifact_owned_scheme_secrecy_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_owned_scheme_secrecy_add_gold_to_remove
						value = root.var:artifact_owned_scheme_secrecy_add_gold_to_remove
					}
				}
			}
			if = { # artifact_hostile_scheme_phase_duration_add_value
				limit = { has_variable = artifact_hostile_scheme_phase_duration_add_value }
				scope:player_scope = { 
					set_variable = {
						name = artifact_hostile_scheme_phase_duration_add_value
						value = root.var:artifact_hostile_scheme_phase_duration_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_hostile_scheme_phase_duration_add_gold_to_remove
						value = root.var:artifact_hostile_scheme_phase_duration_add_gold_to_remove
					}
				}
			}
			if = { # artifact_personal_scheme_phase_duration_add_value
				limit = { has_variable = artifact_personal_scheme_phase_duration_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_personal_scheme_phase_duration_add_value
						value = root.var:artifact_personal_scheme_phase_duration_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_personal_scheme_phase_duration_add_gold_to_remove
						value = root.var:artifact_personal_scheme_phase_duration_add_gold_to_remove
					}
				}
			}
			if = { # artifact_fertility_gain_value
				limit = { has_variable = artifact_fertility_gain_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_fertility_gain_value
						value = root.var:artifact_fertility_gain_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_fertility_gain_gold_to_remove
						value = root.var:artifact_fertility_gain_gold_to_remove
					}
				}
			}
			if = { # artifact_courting_scheme_phase_duration_add_value
				limit = { has_variable = artifact_courting_scheme_phase_duration_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_courting_scheme_phase_duration_add_value
						value = root.var:artifact_courting_scheme_phase_duration_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_courting_scheme_phase_duration_add_gold_to_remove
						value = root.var:artifact_courting_scheme_phase_duration_add_gold_to_remove
					}
				}
			}
			if = { # artifact_seduce_scheme_phase_duration_add_value
				limit = { has_variable = artifact_seduce_scheme_phase_duration_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_seduce_scheme_phase_duration_add_value
						value = root.var:artifact_seduce_scheme_phase_duration_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_seduce_scheme_phase_duration_add_gold_to_remove
						value = root.var:artifact_seduce_scheme_phase_duration_add_gold_to_remove
					}
				}
			}
			if = { # artifact_spouse_opinion_add_value
				limit = { has_variable = artifact_spouse_opinion_add_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_spouse_opinion_add_value
						value = root.var:artifact_spouse_opinion_add_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_spouse_opinion_add_gold_to_remove
						value = root.var:artifact_spouse_opinion_add_gold_to_remove
					}
				}
			}
			if = { # artifact_stress_gain_value
				limit = { has_variable = artifact_stress_gain_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_stress_gain_value
						value = root.var:artifact_stress_gain_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_stress_gain_gold_to_remove
						value = root.var:artifact_stress_gain_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_diplomacy_lifestyle_xp_value
				limit = { has_variable = artifact_monthly_diplomacy_lifestyle_xp_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_diplomacy_lifestyle_xp_value
						value = root.var:artifact_monthly_diplomacy_lifestyle_xp_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_diplomacy_lifestyle_xp_gold_to_remove
						value = root.var:artifact_monthly_diplomacy_lifestyle_xp_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_martial_lifestyle_xp_value
				limit = { has_variable = artifact_monthly_martial_lifestyle_xp_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_martial_lifestyle_xp_value
						value = root.var:artifact_monthly_martial_lifestyle_xp_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_martial_lifestyle_xp_gold_to_remove
						value = root.var:artifact_monthly_martial_lifestyle_xp_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_stewardship_lifestyle_xp_value
				limit = { has_variable = artifact_monthly_stewardship_lifestyle_xp_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_stewardship_lifestyle_xp_value
						value = root.var:artifact_monthly_stewardship_lifestyle_xp_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_stewardship_lifestyle_xp_gold_to_remove
						value = root.var:artifact_monthly_stewardship_lifestyle_xp_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_intrigue_lifestyle_xp_value
				limit = { has_variable = artifact_monthly_intrigue_lifestyle_xp_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_intrigue_lifestyle_xp_value
						value = root.var:artifact_monthly_intrigue_lifestyle_xp_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_intrigue_lifestyle_xp_gold_to_remove
						value = root.var:artifact_monthly_intrigue_lifestyle_xp_gold_to_remove
					}
				}
			}
			if = { # artifact_monthly_learning_lifestyle_xp_value
				limit = { has_variable = artifact_monthly_learning_lifestyle_xp_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_learning_lifestyle_xp_value
						value = root.var:artifact_monthly_learning_lifestyle_xp_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_monthly_learning_lifestyle_xp_gold_to_remove
						value = root.var:artifact_monthly_learning_lifestyle_xp_gold_to_remove
					}
				}
			}
			if = { # artifact_health_gain_value
				limit = { has_variable = artifact_health_gain_value } 
				scope:player_scope = {
					set_variable = {
						name = artifact_health_gain_value
						value = root.var:artifact_health_gain_value
					}
				}
				scope:player_scope = {
					set_variable = {
						name = artifact_health_gain_gold_to_remove
						value = root.var:artifact_health_gain_gold_to_remove
					}
				}
			}
		}
	}
}

delete_template_button = {
	is_valid = {
		title:k_wastelands = {
			has_variable_list = story_cycles_artifact_tempaltes
			variable_list_size = {
				name = story_cycles_artifact_tempaltes
				value > 0
			}
		}
	}
	effect = {
		title:k_wastelands = {
			random_in_list = {
				variable = story_cycles_artifact_tempaltes
				limit = { this = root }
				save_scope_as = saved_story
			}
			remove_list_variable = {
				name = story_cycles_artifact_tempaltes
				target = scope:saved_story
			}
			scope:saved_story = { end_story = yes }

			if = {
				limit = {
					variable_list_size = {
						name = story_cycles_artifact_tempaltes
						value = 0
					}
				}
				clear_variable_list = story_cycles_artifact_tempaltes
			}
		}
	}
}