namespace = dragon_soul

#dragon_soul.0001:

dragon_soul.0001 = {
	type = activity_event
	content_source = dlc_ek
	title = dragon_soul.0001.t

	desc = dragon_soul.0001.desc

	theme = dragon_soul
	
	override_background = { reference = absorbtion }
	
	immediate = {
		add_character_flag = flag_kill_the_dragon
	}
	
	right_portrait = {
		character = root
		animation = interested
	}

	option = {
		name = dragon_soul.0001.a
		add_prestige = 1000
		custom_tooltip = {
			text = dragon_soul.0001.a.desc
		}
		if = {
			limit = {
				has_trait = thuum_mastery
			}
			add_trait_xp = { trait = thuum_mastery value = 20 }
		}
		hidden_effect = {
			add_random_skill_point_effect = yes
			if = {
				limit = {
					dynasty = { has_dynasty_perk = dragonblood_legacy_3 }
				}
				add_random_skill_point_effect = yes
			}
			if = {
				limit = {
					has_focus_martial = yes
				}
				add_martial_lifestyle_xp = 1000
			}
			if = {
				limit = {
					has_focus_diplomacy = yes
				}
				add_diplomacy_lifestyle_xp = 1000
			}
			if = {
				limit = {
					has_focus_learning = yes
				}
				add_learning_lifestyle_xp = 1000
			}
			if = {
				limit = {
					has_focus_stewardship = yes
				}
				add_stewardship_lifestyle_xp = 1000
			}
			if = {
				limit = {
					has_focus_intrigue = yes
				}
				add_intrigue_lifestyle_xp = 1000
			}
			if = {
				limit = {
					has_focus_magic = yes
				}
				add_magic_lifestyle_xp = 1000
			}
			if = {
				limit = {
					has_focus_dark_arts = yes
				}
				add_dark_arts_lifestyle_xp = 1000
			}
		}
	}
}

dragon_soul.0002 = {
	type = character_event
	hidden = yes
	
	immediate = {
		db_dragonborn_trait_house_effect = yes
	}
}

dragon_soul.0003 = {
	type = character_event
	hidden = yes
	
	trigger = {
		OR = {
			AND = {
				exists = mother
				mother = {
					has_trait = dragonborn
				}
			}
			AND = {
				exists = father
				father = {
					has_trait = dragonborn
				}
			}
			AND = {
				exists = scope:dragon_house_blood
				OR = {
					is_grandchild_of = scope:dragon_house_blood 
					is_great_grandchild_of = scope:dragon_house_blood
				}
			}
		}
		NOT = { has_trait = dragonborn }
	}
	
	immediate = {
		if = {
			limit = {
				OR = {
					AND = {
						exists = mother
						mother = {
							has_trait = dragonborn
						}
					}
					AND = {
						exists = father
						father = {
							has_trait = dragonborn
						}
					}
				}
			}
			add_trait = dragonborn
		}
		else = {
			add_trait = dragonborn
		}
		every_child = {
			trigger_event = dragon_soul.0002
		}
	}
}