﻿namespace = reman_tomb

reman_tomb.0001 = { # amulet of kings event
	type = character_event
	content_source = dlc_ek
	title = reman_tomb.0001.t
	is_triggered_only = yes

	desc = reman_tomb.0001.desc

	theme = dragon_soul

	override_background = { reference = ce1_catacombs }

	right_portrait = {
		character = character:reman_104
		animation = throne_room_conversation_3
	}

	left_portrait = {
		character = root
		animation = throne_room_conversation_4
	}
	
	artifact = {
		target = scope:newly_created_artifact
		position = lower_center_portrait
	}
	
	immediate = {
		create_artifact_aok_effect = {
			OWNER = root
		}
	}
	
	option = {
		name = reman_tomb.0001.a
		dynasty = { add_dynasty_prestige = 200 }
		hidden_effect = {
			remove_character_flag = flag_ttst
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:reman_tomb_decision
			}
			if = {
				limit = {
					exists = title:d_imperial_isle.holder
				}
				add_pressed_claim = title:d_imperial_isle
			}
			if = {
				limit = {
					exists = title:c_imperial_city.holder
				}
				add_pressed_claim = title:c_imperial_city
			}
			if = {
				limit = {
					exists = title:k_heartlands.holder
				}
				add_pressed_claim = title:k_heartlands
			}
		}
	}
}

reman_tomb.0002 = {
	type = character_event
	content_source = dlc_ek
	title = reman_tomb.0002.t
	is_triggered_only = yes

	desc = reman_tomb.0002.desc

	theme = diplomacy_foreign_affairs_focus

	override_background = { reference = heartlands }

	right_portrait = {
		character = root
		animation = throne_room_conversation_4
	}
	
	option = {
		name = reman_tomb.0002.a
		add_prestige = 500
		add_piety = 1000
		hidden_effect = {
			remove_character_flag = flag_ttst
		}
	}
}

reman_tomb.0003 = {
	type = character_event
	content_source = dlc_ek
	title = reman_tomb.0003.t
	is_triggered_only = yes

	desc = reman_tomb.0003.desc

	theme = diplomacy_foreign_affairs_focus

	override_background = { reference = heartlands }

	right_portrait = {
		character = root
		animation = throne_room_conversation_4
	}
	
	option = {
		name = reman_tomb.0003.a
		add_gold = 400
		add_prestige = 1000
		add_piety = 1000
		hidden_effect = {
			remove_character_flag = flag_ttst
		}
	}
}

reman_tomb.0004 = {
	type = character_event
	content_source = dlc_ek
	title = reman_tomb.0004.t
	
	desc = {
    	first_valid = {
    		triggered_desc = {
    		    trigger = {
    				NOT = { is_landless_adventurer = yes }
    		    }
    		    desc = reman_tomb.0004.desc
    		}
    		triggered_desc = {
    		    trigger = {
    				is_landless_adventurer = yes
    		    }
    		    desc = reman_tomb.0004.desc_camp
    		}
    	}
    }
	
	trigger = {
		is_ai = no
		age >= 16
		NOR = {
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_reman_tomb_available
			}
			any_character_artifact = {
				has_artifact_modifier = aok_modifier
			}
			has_character_flag = race_daedra
		}
		OR = {
			AND = {
				is_landless_adventurer = yes
				piety_level >= 2
				prestige_level >= 3
				OR = {
					has_trait = dragonborn
					has_trait = p_dv_akatosh
					has_trait = p_dv_shezarr
					has_trait = p_at_fox
					has_trait = p_at_bear
					has_arcana >= { VALUE = 24 }
				}
			}
			AND = {
				highest_held_title_tier >= tier_kingdom
				piety_level >= 2
				prestige_level >= 3
				capital_province = {
					geographical_region = mundus_tamriel_cyrodiil
				}
			}
			AND = {
				OR = {
					has_trait = dragonborn
					has_trait = p_dv_akatosh
					has_trait = p_dv_shezarr
					has_trait = p_at_fox
					has_trait = p_at_bear
					has_arcana >= { VALUE = 24 }
					completely_controls = title:c_sancre_tor
					has_title = title:k_heartlands
				}
				piety_level >= 2
				prestige_level >= 3
				highest_held_title_tier >= tier_kingdom
			}
		}
	}
	
	immediate = {
		character:reman_104 = { save_scope_as = reman }
		title:c_sancre_tor = { save_scope_as = sancr_tor_county }
	}

	theme = dragon_soul

	override_background = { reference = heartlands }

	right_portrait = {
		character = root
		animation = throne_room_conversation_4
	}
	
	option = {
		name = reman_tomb.0004.a
		hidden_effect = {
			add_to_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_reman_tomb_available
			}
		}
	}
}