
namespace = FOUNDTOMB

#Found the tomb of Attila
narrative_event = {
	id = FOUNDTOMB.1
	title = "EVTTITL_FOUNDTOMB.1"
	desc = "EVTDESC_FOUNDTOMB.1"
	picture = GFX_evt_gravedigger_hf
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_global_flag = tomb_attila }
		any_owned_bloodline = {
			has_bloodline_flag = attila_the_hun
		}
		any_demesne_title = {
			OR = {
				title = c_bihar
				title = c_heves
				title = c_pest
				title = c_csanad
				title = c_bacs
			}
		}
	}
	immediate = {
		random_owned_bloodline = {
			limit = {
				has_bloodline_flag = attila_the_hun
			}
			founder = {
				save_event_target_as = tomb_person
				add_artifact = sword_of_attila
				new_artifact = {
					set_creation_date = 1.1.1
					save_event_target_as = tomb_treasure
					#set_name = "[tomb_person.GetFirstName]"
				}
			}
		}
	}
	option = {
		name = "EVTOPTA_FOUNDTOMB.1" #Re-burial carefully.
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0.2
				trait = greedy
			}
			modifier = {
				factor = 0.2
				trait = cynical
			}
			modifier = {
				factor = 0.2
				trait = deceitful
			}
		}
		wealth = -300
		piety = 500
		prestige = 500
		log = "Tomb of Attila was found and he was re-burial carefully by his descent, [Root.GetBestName]."
		hidden_tooltip = {
			event_target:target_artifact = {
				destroy_artifact = yes
			}
		}
	}
	option = {
		name = "EVTOPTB_FOUNDTOMB.1" #Let's have treasures.
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0.2
				trait = zealous
			}
			modifier = {
				factor = 0.2
				trait = honest
			}
			modifier = {
				factor = 0.2
				trait = temperate
			}
			modifier = {
				factor = 0.2
				trait = humble
			}
			modifier = {
				factor = 0.2
				trait = genius
			}
		}
		wealth = 100
		piety = -50
		prestige = 300
		event_target:tomb_treasure = {
			transfer_artifact = {
				from = event_target:tomb_person
				to = ROOT
			}
		}
		log = "Tomb of Attila was found and his treasures were taken away by his descent, [Root.GetBestName]."
	}
	after = {
		set_global_flag = tomb_attila
	}
}
