﻿on_death_relation_oathholder = { # Triggers from person that died.  -- We die essentially.
	on_actions = {
		the_permanent_oath_oathbound_perspective
	}
}

the_permanent_oath_oathbound_perspective = {
	trigger = {
		has_character_modifier = permanent_oath
		primary_heir.dynasty = root.dynasty
	}
	effect = {

		primary_heir = {
			add_character_modifier = { modifier = permanent_oath }
			add_trait = oathkeeper
			add_trait = loyal
			remove_trait = disloyal

			set_relation_oathholder = {
				target = scope:target
			}
			
			scope:target = {
				oathkeeper_assigned = { CHARACTER = root.primary_heir }
				add_character_modifier = { modifier = oathholder_life }
			}
			
			scope:target = {
				add_hook = {
					target = this
					type = obligation_hook
				}
			}
			oathholder_assigned = { CHARACTER = scope:target}

			trigger_event = {
				id = oathbound_permanent_events.0002
				days = 1
			}
		}
		
	}
}