﻿#DB Events for Pilgrimages

namespace = db_pilgrimage

db_pilgrimage.1001 = {
	type = activity_event
	title = db_pilgrimage.1001.t
	desc = {
    	first_valid = {
    		triggered_desc = {
    		    trigger = { has_trait = cynical }
    		   desc = db_pilgrimage.1001.desc_cynical
    		}
    		triggered_desc = {
    		    trigger = {
					NOT = {
						has_trait = cynical
					}
				}
    		    desc = db_pilgrimage.1001.desc
    		}
    	}
    }
	theme = dragon_of_the_north
	override_background = { reference = ivarstead }

	
	center_portrait = {
		character = root
		animation = happiness
	}
	trigger = {
		scope:activity.activity_location.county = title:c_ivarstead
	}
	immediate = {
		play_music_cue = mx_cue_pilgrimage_arrival
	}
	
	option = {
		name = db_pilgrimage.1001.a
		involved_activity ?= {
			add_activity_log_entry = {
				key = ivarstead_log
				tags = { good }
				score = 10
				character = root
			}
		}
		give_pilgrim_trait_or_xp_effect = yes
		pilgrimage_arrival_stress_loss_effect = yes
		trigger_event = db_pilgrimage.0001
	}
	
	option = {
		name = db_pilgrimage.1001.b
		trigger = {
			OR = {
				has_trait = dragonborn
				AND = {
					OR = {
						learning >= 20
						has_trait = education_learning_4
						has_trait = education_learning_5
					}	
					OR = {
						faith = { has_doctrine = doctrine_pantheon_nord }
						faith = { has_doctrine = doctrine_pantheon_atmoran_totems }
					}
				}
			}
		}
		involved_activity ?= {
			add_activity_log_entry = {
				key = ivarstead_log
				tags = { good }
				score = 10
				character = root
			}
		}
		give_pilgrim_trait_or_xp_effect = yes
		pilgrimage_arrival_stress_loss_effect = yes
		add_trait = thuum_mastery
		trigger_event = db_pilgrimage.0001
	}
}


db_pilgrimage.0001 = {
	type = activity_event
	title = db_pilgrimage.0001.t
	desc = db_pilgrimage.0001.desc
	theme = dragon_of_the_north
	override_background = { reference = tablets }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		location.county = title:c_ivarstead
	}
	
	immediate = {
		root = { set_variable = { name = db_high_hrothgar_tablets value = 1 } }
	}
	
	option = {
		name = db_pilgrimage.0001.a
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_I_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			patient = minor_stress_impact_loss
			humble = minor_stress_impact_loss
		}
	}
	option = {
		name = db_pilgrimage.0001.b
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_I_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_loss
			humble = miniscule_stress_impact_gain
		}
	}
	option = {
		name = db_pilgrimage.0001.c
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_I_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
					add_learning_lifestyle_xp = minor_lifestyle_xp
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
	}
	after = {
		trigger_event = db_pilgrimage.0002
	}
}

db_pilgrimage.0002 = {
	type = activity_event
	title = db_pilgrimage.0002.t
	desc = db_pilgrimage.0002.desc
	theme = dragon_of_the_north
	override_background = { reference = tablets }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 1
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	
	option = {
		name = db_pilgrimage.0002.a
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_II_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			patient = minor_stress_impact_loss
			humble = minor_stress_impact_loss
			callous = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0002.b
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_II_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
		}
	}
	option = {
		name = db_pilgrimage.0002.c
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_II_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
					add_learning_lifestyle_xp = minor_lifestyle_xp
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
	}
	after = {
		hidden_effect = {
			random_list = {
				15 = { trigger_event = db_pilgrimage.0011 }
				15 = { trigger_event = db_pilgrimage.0012 }
				70 = { trigger_event = db_pilgrimage.0003 }
			}
		}
	}
}
db_pilgrimage.0003 = {
	type = activity_event
	title = db_pilgrimage.0003.t
	desc = db_pilgrimage.0003.desc
	theme = dragon_of_the_north
	override_background = { reference = tablets }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 2
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	option = {
		name = db_pilgrimage.0003.a
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_III_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			brave = minor_stress_impact_loss
			craven = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0003.b
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_III_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_loss
			melancholic = minor_stress_loss
			callous = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0003.c
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_III_tablet_log
				tags = { bad }
				score = 20
				character = root

				#Effects
				root = {
				}
			}
		}
		stress_impact = {
			cynical = minor_stress_loss
			patient = minor_stress_loss
			zealous = minor_stress_gain
		}
	}
	after = {
		hidden_effect = {
			random_list = {
				15 = { trigger_event = db_pilgrimage.0011 }
				15 = { trigger_event = db_pilgrimage.0012 }
				70 = { trigger_event = db_pilgrimage.0004 }
			}
		}
	}
}

db_pilgrimage.0004 = {
	type = activity_event
	title = db_pilgrimage.0004.t
	desc = db_pilgrimage.0004.desc
	theme = dragon_of_the_north
	override_background = { reference = tablets }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 3
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	option = {
		name = db_pilgrimage.0004.a
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IV_tablet_log
				tags = { good }
				score = 30
				character = root

				root = {
					add_piety = minor_piety_gain
					if = {
						limit = { has_trait = p_dv_kynareth }
						add_piety = minor_piety_gain
					}
				}
			}
		}
		stress_impact = {
			zealous = minor_stress_loss
			compassionate = minor_stress_loss
			cynical = minor_stress_gain
			p_dv_kynareth = medium_stress_loss
		}
	}
	option = {
		name = db_pilgrimage.0004.b
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IV_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_learning_lifestyle_xp = minor_lifestyle_xp
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
		stress_impact = {
			patient = minor_stress_loss
			scholar = minor_stress_loss
		}
	}
	option = {
		name = db_pilgrimage.0004.c
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IV_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			brave = minor_stress_loss
			wrathful = minor_stress_loss
			craven = minor_stress_gain
		}
	}
	after = {
		hidden_effect = {
			random_list = {
				15 = { trigger_event = db_pilgrimage.0011 }
				15 = { trigger_event = db_pilgrimage.0012 }
				15 = { trigger_event = db_pilgrimage.0014 }
				15 = { trigger_event = db_pilgrimage.0015 }
				70 = { trigger_event = db_pilgrimage.0005 }
			}
		}
	}
}

db_pilgrimage.0005 = {
	type = activity_event
	title = db_pilgrimage.0005.t
	desc = db_pilgrimage.0005.desc
	theme = dragon_of_the_north
	override_background = { reference = tablets }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 4
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	option = {
		name = db_pilgrimage.0005.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_V_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_loss
			arrogant = minor_stress_loss
			craven = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0005.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_V_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_loss
			just = minor_stress_loss
			callous = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0005.c
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_V_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_learning_lifestyle_xp = minor_lifestyle_xp
					if = {
						limit = { 
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
	}
	after = {
		hidden_effect = {
			random_list = {
				15 = { trigger_event = db_pilgrimage.0011 }
				15 = { trigger_event = db_pilgrimage.0012 }
				15 = { trigger_event = db_pilgrimage.0014 }
				15 = { trigger_event = db_pilgrimage.0015 }
				70 = { trigger_event = db_pilgrimage.0006 }
			}
		}
	}
}

db_pilgrimage.0006 = {
	type = activity_event
	title = db_pilgrimage.0006.t
	desc = db_pilgrimage.0006.desc
	theme = dragon_of_the_north
	override_background = { reference = tablets }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 5
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	option = {
		name = db_pilgrimage.0006.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_VI_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
					if = {
						limit = { has_trait = conqueror }
						add_prestige = minor_prestige_gain
					}
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_loss
			brave = minor_stress_loss
			content = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0006.b
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_VI_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_learning_lifestyle_xp = minor_lifestyle_xp
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
		stress_impact = {
			patient = minor_stress_loss
			wrathful = minor_stress_loss
		}
	}
	
	after = {
		hidden_effect = {
			random_list = {
				15 = { trigger_event = db_pilgrimage.0011 }
				15 = { trigger_event = db_pilgrimage.0012 }
				15 = { trigger_event = db_pilgrimage.0014 }
				15 = { trigger_event = db_pilgrimage.0015 }
				15 = { trigger_event = db_pilgrimage.0016 }
				15 = { trigger_event = db_pilgrimage.0017 }
				70 = { trigger_event = db_pilgrimage.0007 }
			}
		}
	}
}

db_pilgrimage.0007 = {
	type = activity_event
	title = db_pilgrimage.0007.t
	desc = db_pilgrimage.0007.desc
	theme = dragon_of_the_north
	override_background = { reference = tablets }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 6
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	option = {
		name = db_pilgrimage.0007.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_VII_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			humble = minor_stress_loss
			patient = minor_stress_loss
			arrogant = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0007.b
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_VII_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_learning_lifestyle_xp = minor_lifestyle_xp
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
		stress_impact = {
			scholar = minor_stress_loss
			cynical = minor_stress_loss
		}
	}
	option = {
		name = db_pilgrimage.0007.c
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_VII_tablet_log
				tags = { bad }
				score = 20
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			wrathful = minor_stress_loss
			arrogant = minor_stress_loss
			humble = minor_stress_gain
			patient = minor_stress_gain
		}
	}
	after = {
		hidden_effect = {
			random_list = {
				15 = { trigger_event = db_pilgrimage.0011 }
				15 = { trigger_event = db_pilgrimage.0012 }
				15 = { trigger_event = db_pilgrimage.0014 }
				15 = { trigger_event = db_pilgrimage.0015 }
				15 = { trigger_event = db_pilgrimage.0016 }
				15 = { trigger_event = db_pilgrimage.0017 }
				70 = { trigger_event = db_pilgrimage.0008 }
			}
		}
	}
}

db_pilgrimage.0008 = {
	type = activity_event
	title = db_pilgrimage.0008.t
	desc = db_pilgrimage.0008.desc
	theme = dragon_of_the_north
	override_background = { reference = tablets }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 7
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	option = {
		name = db_pilgrimage.0008.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_VIII_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			patient = minor_stress_loss
			stubborn = minor_stress_loss
			wrathful = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0008.b
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_VIII_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_learning_lifestyle_xp = minor_lifestyle_xp
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
		stress_impact = {
			scholar = minor_stress_loss
			calm = minor_stress_loss
		}
	}
	option = {
		name = db_pilgrimage.0008.c
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_VIII_tablet_log
				tags = { bad }
				score = 20
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			wrathful = minor_stress_loss
			arrogant = minor_stress_loss
			patient = minor_stress_gain
			craven = minor_stress_gain
		}
	}
	after = {
		hidden_effect = {
			random_list = {
				15 = { trigger_event = db_pilgrimage.0011 }
				15 = { trigger_event = db_pilgrimage.0012 }
				15 = { trigger_event = db_pilgrimage.0014 }
				15 = { trigger_event = db_pilgrimage.0015 }
				15 = { trigger_event = db_pilgrimage.0016 }
				15 = { trigger_event = db_pilgrimage.0017 }
				15 = { trigger_event = db_pilgrimage.0018 }
				15 = { trigger_event = db_pilgrimage.0019 }
				70 = {
					if = {
						limit = {
							is_target_in_global_variable_list = {
								name = talos_patron_available
								target = flag:db_ysmir_dragon_of_the_north
							}
						}
						trigger_event = db_pilgrimage.2009
					}
					else = { trigger_event = db_pilgrimage.0009 }
				}
			}
		}
	}
}

db_pilgrimage.0009 = {
	type = activity_event
	title = db_pilgrimage.0009.t
	desc = db_pilgrimage.0009.desc
	theme = dragon_of_the_north
	
	override_background = { reference = greaybeards_no_talos }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		NOT =  {
			is_target_in_global_variable_list = {
				name = talos_patron_available
				target = flag:db_ysmir_dragon_of_the_north
			}
		}
		root.var:db_high_hrothgar_tablets = 8
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	option = {
		name = db_pilgrimage.0009.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IX_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_loss
			arrogant = minor_stress_loss
			content = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0009.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IX_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			patient = minor_stress_loss
			humble = minor_stress_loss
			impatient = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0009.c
		
		trigger = {
			has_trait = dragonborn
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IX_tablet_log
				tags = { good }
				score = 100
				character = root

				#Effects
				root = {
					add_piety = major_piety_gain
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
	}
	after = {
		trigger_event = db_pilgrimage.0010
	}
}

db_pilgrimage.2009 = {
	type = activity_event
	title = db_pilgrimage.2009.t
	desc = db_pilgrimage.2009.desc
	theme = dragon_of_the_north
	
	override_background = { reference = greaybeards_talos }
	
	cooldown = { years = 1 }
	
	trigger = {
		is_target_in_global_variable_list = {
			name = talos_patron_available
			target = flag:db_ysmir_dragon_of_the_north
		}
		root.var:db_high_hrothgar_tablets = 8
	}
	
	immediate = {
		global_var:db_ysmir_dotn = {
			save_scope_as = ysmir
		}
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	right_portrait = {
		character = scope:ysmir
		animation = personality_bold
	}
	
	option = {
		name = db_pilgrimage.2009.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IX_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
					if = {
						limit = { 
							has_trait = p_dv_talos
						}
						add_piety = minor_piety_gain
					}
				}
			}
		}
		stress_impact = {
			zealous = minor_stress_loss
			p_dv_talos = medium_stress_loss
			cynical = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.2009.b
		
		trigger = {
			OR = {
				has_trait = dragonborn
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IX_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_loss
			arrogant = minor_stress_loss
		}
	}
	option = {
		name = db_pilgrimage.2009.c
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_IX_tablet_log
				tags = { bad }
				score = 20
				character = root
			}
		}
		stress_impact = {
			cynical = minor_stress_loss
			paranoid = minor_stress_loss
			zealous = minor_stress_gain
			trusting = minor_stress_gain
		}
	}
	after = {
		trigger_event = db_pilgrimage.0010
	}
}

db_pilgrimage.0010 = {
	type = activity_event
	title = db_pilgrimage.0010.t
	desc = db_pilgrimage.0010.desc
	theme = dragon_of_the_north
	override_background = { reference = greybeards }
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 9
	}
	
	immediate = {
		root = { change_variable = { name = db_high_hrothgar_tablets add = 1 } }
	}
	option = {
		name = db_pilgrimage.0010.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_X_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			humble = minor_stress_loss
			calm = minor_stress_loss
			patient = minor_stress_loss
			impatient = minor_stress_gain
			wrathful = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0010.b
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_X_tablet_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_magic_lifestyle_xp = minor_lifestyle_xp
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
		stress_impact = {
			humble = minor_stress_loss
			patient = minor_stress_loss
		}
	}
	option = {
		name = db_pilgrimage.0010.c
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = hrothgar_X_tablet_log
				tags = { bad }
				score = 20
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			wrathful = minor_stress_loss
			arrogant = minor_stress_loss
			ambitious = minor_stress_loss
			humble = minor_stress_gain
			craven = minor_stress_gain
		}
	}
	after = {
		if = {
			limit = {
				has_trait = dragonborn
				has_character_flag = flag_summoned_by_greybeards
				NOT = { has_character_flag = flag_ysmir_dragon_of_the_north }
			}
			trigger_event = db_pilgrimage.0022
		}
		else_if = {
			limit = {
				has_trait = dragonborn
			}
			trigger_event = db_pilgrimage.0021
		}
		else_if = {
			limit = {
				has_trait = thuum_mastery
				has_trait_xp = {
					trait = thuum_mastery
					value >= 20
				}
			}
			trigger_event = db_pilgrimage.0021
		}
		else = {
			trigger_event = db_pilgrimage.0020
		}
	}
}
db_pilgrimage.0011 = {
	type = activity_event
	title = db_pilgrimage.0011.t
	desc = db_pilgrimage.0011.desc
	theme = dragon_of_the_north
	override_background = { reference = between_tablets }
	
	right_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets > 1
		root.var:db_high_hrothgar_tablets < 9
	}
	
	immediate = {
		
	}
	option = {
		name = db_pilgrimage.0011.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = wolf_attack_log
				tags = { good }
				score = 20
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
					random = {
						chance = 40
						modifier = {
							add = -20
							prowess >= 12
						}
						modifier = {
							add = -10
							prowess >= 18
						}
						add_trait = wounded_1
					}
				}
			}
		}
		stress_impact = {
			brave = minor_stress_loss
			wrathful = minor_stress_loss
			craven = minor_stress_gain
		}
		random = {
			chance = 10
			remove_trait = craven
			add_trait = brave
		}
	}
	option = {
		name = db_pilgrimage.0011.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = wolf_attack_log
				tags = { bad }
				score = 10
				character = root
			}
		}
		stress_impact = {
			craven = minor_stress_loss
			brave = minor_stress_gain
			arrogant = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0011.c
		
		trigger = {
			has_perk = illusion_journeyman_perk
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = wolf_attack_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_magic_lifestyle_xp = minor_lifestyle_xp
				}
			}
		}
		stress_impact = {
			patient = minor_stress_loss
			calm = minor_stress_loss
		}
	}
	after = {
		if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 2
			}
			trigger_event = db_pilgrimage.0003
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 3
			}
			trigger_event = db_pilgrimage.0004
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 4
			}
			trigger_event = db_pilgrimage.0005
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 5
			}
			trigger_event = db_pilgrimage.0006
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 6
			}
			trigger_event = db_pilgrimage.0007
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 7
			}
			trigger_event = db_pilgrimage.0008
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
				is_target_in_global_variable_list = {
					name = talos_patron_available
					target = flag:db_ysmir_dragon_of_the_north
				}
			}
			trigger_event = db_pilgrimage.2009
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
			}
			trigger_event = db_pilgrimage.0009
		}
	}
}

db_pilgrimage.0012 = {
	type = activity_event
	title = db_pilgrimage.0012.t
	desc = db_pilgrimage.0012.desc
	theme = dragon_of_the_north
	override_background = { reference = between_tablets }
	
	right_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets > 1
		root.var:db_high_hrothgar_tablets < 9
	}
	
	immediate = {
		
	}
	option = {
		name = db_pilgrimage.0012.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = kyn_sanctuary_log
				tags = { good }
				score = 40
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
					
					if = {
						limit = { 
							has_trait = p_dv_kynareth 
						}
						add_character_modifier = {
							modifier = travel_health_boost_modifier
							years = 2
						}
					}
					else = {
						add_character_modifier = {
							modifier = travel_health_boost_modifier
							years = 1
						}
					}
				}
			}
		}
		stress_impact = {
			zealous = minor_stress_loss
			p_dv_kynareth = minor_stress_loss
			lazy = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0012.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = kyn_sanctuary_log
				tags = { good }
				score = 20
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			impatient = minor_stress_loss
			patient = minor_stress_loss
			cynical = minor_stress_gain
		}
	}
	after = {
		if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 2
			}
			trigger_event = db_pilgrimage.0003
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 3
			}
			trigger_event = db_pilgrimage.0004
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 4
			}
			trigger_event = db_pilgrimage.0005
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 5
			}
			trigger_event = db_pilgrimage.0006
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 6
			}
			trigger_event = db_pilgrimage.0007
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 7
			}
			trigger_event = db_pilgrimage.0008
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
				is_target_in_global_variable_list = {
					name = talos_patron_available
					target = flag:db_ysmir_dragon_of_the_north
				}
			}
			trigger_event = db_pilgrimage.2009
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
			}
			trigger_event = db_pilgrimage.0009
		}
	}
}

db_pilgrimage.0014 = {
	type = activity_event
	title = db_pilgrimage.0014.t
	desc = db_pilgrimage.0014.desc
	theme = dragon_of_the_north
	override_background = { reference = between_tablets }
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets > 3
		root.var:db_high_hrothgar_tablets < 9
	}
	
	immediate = {
		db_spawn_random_nord_pilgrim_effect = yes
	}
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	right_portrait = {
		character = scope:random_nord_pilgrim
		animation = prayer
	}
	
	option = {
		name = db_pilgrimage.0014.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = loser_pilgrim_log
				tags = { good }
				score = 40
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_loss
			callous = minor_stress_gain
			sadistic = minor_stress_gain
		}
		random = {
			chance = 20
			remove_trait = callous
			add_trait = compassionate
		}
	}
	option = {
		name = db_pilgrimage.0014.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = loser_pilgrim_log
				tags = { bad }
				score = 10
				character = root
			}
		}
		stress_impact = {
			callous = minor_stress_loss
			arrogant = minor_stress_loss
			compassionate = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0014.c
		
		trigger = {
			has_trait = sadistic
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = loser_pilgrim_log
				tags = { bad }
				score = 0
				character = root

				#Effects
				root = {
					add_gold = minor_gold_value
				}
			}
		}
		stress_impact = {
			sadistic = medium_stress_loss
		}
	}
	after = {
		hidden_effect = {
			scope:random_nord_pilgrim = {
				death = { death_reason = death_vanished }
			}
		}
		if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 2
			}
			trigger_event = db_pilgrimage.0003
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 3
			}
			trigger_event = db_pilgrimage.0004
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 4
			}
			trigger_event = db_pilgrimage.0005
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 5
			}
			trigger_event = db_pilgrimage.0006
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 6
			}
			trigger_event = db_pilgrimage.0007
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 7
			}
			trigger_event = db_pilgrimage.0008
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
				is_target_in_global_variable_list = {
					name = talos_patron_available
					target = flag:db_ysmir_dragon_of_the_north
				}
			}
			trigger_event = db_pilgrimage.2009
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
			}
			trigger_event = db_pilgrimage.0009
		}
	}
}

db_pilgrimage.0015 = {
	type = activity_event
	title = db_pilgrimage.0015.t
	desc = db_pilgrimage.0015.desc
	theme = dragon_of_the_north
	override_background = { reference = between_tablets }
	
	right_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets > 3
		root.var:db_high_hrothgar_tablets < 9
	}
	
	immediate = {
		
	}
	
	option = {
		name = db_pilgrimage.0015.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = windstorm_log
				tags = { good }
				score = 40
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
					
					random = {
						chance = 20
						play_music_cue = "mx_cue_illness"
						show_as_tooltip = { add_trait = ill }
						hidden_effect = {
							contract_disease_effect = { 
								DISEASE = ill 
								TREATMENT_EVENT = yes 
							} 	
						}
						current_travel_plan = {
							if = {
								limit = {
									any_entourage_character = { has_court_position = court_physician_court_position }
								}
								random_entourage_character = {
									limit = { has_court_position = court_physician_court_position }
									save_scope_as = traveling_court_physician
								}
							}
						}
					}
				}
			}
		}
		stress_impact = {
			brave = minor_stress_loss
			zealous = minor_stress_loss
			craven = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0015.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = windstorm_log
				tags = { good }
				score = 10
				character = root
			}
		}
		stress_impact = {
			patient = minor_stress_loss
			craven = minor_stress_loss
			impatient = minor_stress_gain
			brave = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0015.c
		
		trigger = {
			has_trait = thuum_mastery
			has_trait_xp = {
				trait = thuum_mastery
				value >= 80
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = windstorm_log
				tags = { good }
				score = 60
				character = root

				#Effects
				root = {
					add_prestige = medium_prestige_gain
					
					add_trait_xp = {
						trait = thuum_mastery
						value = 5
					}
				}
			}
		}
		stress_impact = {
			arrogant = minor_stress_loss
			ambitious = minor_stress_loss
		}
	}
	after = {
		if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 2
			}
			trigger_event = db_pilgrimage.0003
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 3
			}
			trigger_event = db_pilgrimage.0004
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 4
			}
			trigger_event = db_pilgrimage.0005
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 5
			}
			trigger_event = db_pilgrimage.0006
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 6
			}
			trigger_event = db_pilgrimage.0007
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 7
			}
			trigger_event = db_pilgrimage.0008
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
				is_target_in_global_variable_list = {
					name = talos_patron_available
					target = flag:db_ysmir_dragon_of_the_north
				}
			}
			trigger_event = db_pilgrimage.2009
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
			}
			trigger_event = db_pilgrimage.0009
		}
	}
}

db_pilgrimage.0016 = {
	type = activity_event
	title = db_pilgrimage.0016.t
	desc = db_pilgrimage.0016.desc
	theme = dragon_of_the_north
	override_background = { reference = between_tablets }
	
	right_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets > 5
		root.var:db_high_hrothgar_tablets < 9
	}
	
	immediate = {
		
	}
	option = {
		name = db_pilgrimage.0016.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = frost_troll_log
				tags = { good }
				score = 40
				character = root

				#Effects
				root = {
					random_list = {
						50 = {
							add_prestige = medium_prestige_gain
							modifier = {
								add = 20
								prowess >= 15
							}
							modifier = {
								add = 10
								prowess >= 20
							}
							modifier = {
								add = 10
								prowess >= 25
							}
							modifier = {
								add = 10
								prowess >= 30
							}
							modifier = {
								add = 40
								prowess >= 35
							}
							modifier = {
								add = 40
								prowess >= 40
							}
						}
						25 = {
							add_trait = wounded_1
						}
						20 = {
							add_trait = wounded_2
						}
						5 = {
							death = { death_reason = death_wild_animal }
						}
					}
				}
			}
		}
		stress_impact = {
			brave = minor_stress_loss
			wrathful = minor_stress_loss
			craven = minor_stress_gain
		}
		random = {
			chance = 20
			remove_trait = craven
			add_trait = brave
		}
	}
	option = {
		name = db_pilgrimage.0016.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = frost_troll_log
				tags = { bad }
				score = 10
				character = root
			}
		}
		stress_impact = {
			craven = minor_stress_loss
			patient = minor_stress_loss
			brave = minor_stress_gain
			arrogant = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0016.c
		
		trigger = {
			has_perk = illusion_expert_perk
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = frost_troll_log
				tags = { good }
				score = 40
				character = root

				#Effects
				root = {
					add_learning_lifestyle_xp = minor_lifestyle_xp
				}
			}
		}
		stress_impact = {
			calm = minor_stress_loss
		}
	}
	after = {
		if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 2
			}
			trigger_event = db_pilgrimage.0003
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 3
			}
			trigger_event = db_pilgrimage.0004
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 4
			}
			trigger_event = db_pilgrimage.0005
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 5
			}
			trigger_event = db_pilgrimage.0006
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 6
			}
			trigger_event = db_pilgrimage.0007
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 7
			}
			trigger_event = db_pilgrimage.0008
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
				is_target_in_global_variable_list = {
					name = talos_patron_available
					target = flag:db_ysmir_dragon_of_the_north
				}
			}
			trigger_event = db_pilgrimage.2009
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
			}
			trigger_event = db_pilgrimage.0009
		}
	}
}

db_pilgrimage.0017 = {
	type = activity_event
	title = db_pilgrimage.0017.t
	desc = db_pilgrimage.0017.desc
	theme = dragon_of_the_north
	override_background = { reference = between_tablets }
	
	right_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets > 5
		root.var:db_high_hrothgar_tablets < 9
	}
	
	immediate = {
		
	}
	option = {
		name = db_pilgrimage.0017.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = beautiful_view_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			calm = minor_stress_loss
			patient = minor_stress_loss
		}
	}
	option = {
		name = db_pilgrimage.0017.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = beautiful_view_log
				tags = { bad }
				score = 10
				character = root
			}
		}
		stress_impact = {
			cynical = minor_stress_loss
			impatient = minor_stress_loss
			arrogant = minor_stress_loss
			zealous = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0017.c
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = beautiful_view_log
				tags = { good }
				score = 40
				character = root

				#Effects
				root = {
					if = {
						limit = { 
							has_trait = lifestyle_poet 
						}
						add_trait_xp = {
							trait = lifestyle_poet 
							value = 10
						}
					}
					else = {
						add_trait = lifestyle_poet
					}
				}
			}
		}
		stress_impact = {
			arrogant = minor_stress_loss
		}
	}
	after = {
		if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 2
			}
			trigger_event = db_pilgrimage.0003
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 3
			}
			trigger_event = db_pilgrimage.0004
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 4
			}
			trigger_event = db_pilgrimage.0005
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 5
			}
			trigger_event = db_pilgrimage.0006
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 6
			}
			trigger_event = db_pilgrimage.0007
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 7
			}
			trigger_event = db_pilgrimage.0008
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
				is_target_in_global_variable_list = {
					name = talos_patron_available
					target = flag:db_ysmir_dragon_of_the_north
				}
			}
			trigger_event = db_pilgrimage.2009
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
			}
			trigger_event = db_pilgrimage.0009
		}
	}
}

db_pilgrimage.0018 = {
	type = activity_event
	title = db_pilgrimage.0018.t
	desc = db_pilgrimage.0018.desc
	theme = dragon_of_the_north
	override_background = { reference = between_tablets }
	
	right_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 8
	}
	
	immediate = {
		
	}
	option = {
		name = db_pilgrimage.0018.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = avalanche_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			diligent = minor_stress_loss
			stubborn = minor_stress_loss
			lazy = minor_stress_gain
			arrogant = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0018.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = avalanche_log
				tags = { bad }
				score = 20
				character = root

				#Effects
				root = {
					random_list = {
						80 = {
							add_prestige = minor_prestige_gain
						}
						20 = {
							add_trait = wounded_1
						}
					}
				}
			}
		}
		stress_impact = {
			brave = minor_stress_loss
			impatient = minor_stress_loss
			craven = minor_stress_gain
		}
	}
	option = {
		name = db_pilgrimage.0018.c
		
		trigger = {
			has_perk = destruction_journeyman_perk
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = avalanche_log
				tags = { good }
				score = 40
				character = root

				#Effects
				root = {
					add_learning_lifestyle_xp = minor_lifestyle_xp
				}
			}
		}
		stress_impact = {
			arrogant = minor_stress_loss
			impatient = minor_stress_loss
		}
	}
	after = {
		if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 2
			}
			trigger_event = db_pilgrimage.0003
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 3
			}
			trigger_event = db_pilgrimage.0004
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 4
			}
			trigger_event = db_pilgrimage.0005
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 5
			}
			trigger_event = db_pilgrimage.0006
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 6
			}
			trigger_event = db_pilgrimage.0007
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 7
			}
			trigger_event = db_pilgrimage.0008
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
				is_target_in_global_variable_list = {
					name = talos_patron_available
					target = flag:db_ysmir_dragon_of_the_north
				}
			}
			trigger_event = db_pilgrimage.2009
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
			}
			trigger_event = db_pilgrimage.0009
		}
	}
}

db_pilgrimage.0019 = {
	type = activity_event
	title = db_pilgrimage.0019.t
	desc = db_pilgrimage.0019.desc
	theme = dragon_of_the_north
	override_background = { reference = between_tablets }
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 8
	}
	
	immediate = {
		title:d_greybeards.holder = { save_scope_as = greybeards_leader }
	}
	
	left_portrait = {
		character = root
		animation = shock
	}
	
	lower_center_portrait = {
		character = scope:greybeards_leader
	}
	
	option = {
		name = db_pilgrimage.0019.a
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = mighty_tuum_log
				tags = { good }
				score = 40
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		stress_impact = {
			humble = minor_stress_loss
			zealous = minor_stress_loss
			arrogant = minor_stress_gain
			cynical = minor_stress_gain
		}
		random = {
			chance = 20
			remove_trait = cynical
			add_trait = zealous
		}
	}
	option = {
		name = db_pilgrimage.0019.b
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = mighty_tuum_log
				tags = { bad }
				score = 10
				character = root

				#Effects
				root = {
					add_prestige = minor_prestige_gain
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_loss
			arrogant = minor_stress_loss
			brave = minor_stress_loss
			humble = minor_stress_gain
			craven = minor_stress_gain
		}
	}
	
	option = {
		name = db_pilgrimage.0019.c
		
		trigger = {
			OR = {
				learning >= 15
				has_trait = thuum_mastery
			}
		}
		
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = mighty_tuum_log
				tags = { good }
				score = 60
				character = root

				#Effects
				root = {
					add_prestige = medium_prestige_gain
					if = {
						limit = {
							has_trait = thuum_mastery
							has_trait_xp = {
								trait = thuum_mastery
								value <= 20
							}
						}
						add_trait_xp = {
							trait = thuum_mastery
							value = 4
						}
					}
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_loss
			brave = minor_stress_loss
		}
	}
	after = {
		if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 2
			}
			trigger_event = db_pilgrimage.0003
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 3
			}
			trigger_event = db_pilgrimage.0004
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 4
			}
			trigger_event = db_pilgrimage.0005
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 5
			}
			trigger_event = db_pilgrimage.0006
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 6
			}
			trigger_event = db_pilgrimage.0007
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 7
			}
			trigger_event = db_pilgrimage.0008
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
				is_target_in_global_variable_list = {
					name = talos_patron_available
					target = flag:db_ysmir_dragon_of_the_north
				}
			}
			trigger_event = db_pilgrimage.2009
		}
		else_if = {
			limit = {
				root.var:db_high_hrothgar_tablets = 8
			}
			trigger_event = db_pilgrimage.0009
		}
	}
}

db_pilgrimage.0020 = {
	type = activity_event
	title = db_pilgrimage.0020.t
	desc = db_pilgrimage.0020.desc
	theme = dragon_of_the_north
	override_background = { reference = greybeards }
	
	right_portrait = {
		character = root
		animation = interested
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		root.var:db_high_hrothgar_tablets = 10
	}
	
	immediate = {
	
	}
	
	option = {
		name = db_pilgrimage.0020.a
		bonus_to_all_types_effect = yes
		hidden_effect = {
			random_list = {
				20 = {
					trigger_event = db_pilgrimage.0021
					modifier = {
						add = 10
						piety_level >= 5
					}
					modifier = {
						add = 10
						prestige_level >= 5
					}
				}
				80 = {
					trigger_event = db_pilgrimage.0023
					modifier = {
						add = -10
						piety_level >= 5
					}
					modifier = {
						add = -10
						prestige_level >= 5
					}
				}
			}
		}
	}
	option = {
		name = db_pilgrimage.0020.b
		bonus_to_all_types_effect = yes
		involved_activity ?= {
			add_activity_log_entry = {
				key = high_hrothgar_log
				tags = { good }
				score = 30
				character = root

				#Effects
				root = {
					add_piety = minor_piety_gain
				}
			}
		}
		trigger_event = db_pilgrimage.0023
	}
	after = {
		
	}
}

db_pilgrimage.0021 = {
	type = activity_event
	title = db_pilgrimage.0021.t
	
	desc = {
    	first_valid = {
			triggered_desc = {
    		    trigger = { has_trait = dragonborn }
    		   desc = db_pilgrimage.0021.desc_dragonborn
    		}
    		triggered_desc = {
    		    trigger = {
					NOT = {
						has_trait = dragonborn
					}
					has_trait_xp = {
						trait = thuum_mastery
						value >= 20
					}
				}
    		   desc = db_pilgrimage.0021.desc_thuum_mastery
    		}
    		triggered_desc = {
    		    trigger = {
					NOT = {
						has_trait = thuum_mastery
						has_trait = dragonborn
					}
				}
    		    desc = db_pilgrimage.0021.desc
    		}
    	}
    }
	
	theme = dragon_of_the_north
	override_background = { reference = high_hrothgar }
	
	cooldown = { years = 1 }
	
	trigger = {
		
	}
	
	immediate = {
		title:d_greybeards.holder = { save_scope_as = greybeards_leader }
	}
	
	right_portrait = {
		character = root
		animation = interested
	}
	left_portrait = {
		character = scope:greybeards_leader
		animation = personality_zealous
	}
	
	option = {
		name = db_pilgrimage.0021.a
		bonus_to_all_types_effect = yes
		add_piety = medium_piety_gain
	}
	option = {
		name = db_pilgrimage.0021.c
		trigger = {
			has_trait = thuum_mastery
			OR = {
				years_as_ruler >= 40
				ek_human_age_equivalent >= 70
			}
			player_heir = {
				exists = yes
				is_adult = yes
				is_imprisoned = no				
				NOT = { has_trait = incapable }
			}
		}
		trigger_event = db_pilgrimage.0026
	}
	option = {
		name = db_pilgrimage.0021.d
		trigger = {
			has_trait = dragonborn
			has_trait_xp = {
				trait = thuum_mastery
				value >= 20
			}
		}
		trigger_event = db_pilgrimage.0027
	}
	after = {
		
	}
}

db_pilgrimage.0022 = {
	type = activity_event
	title = db_pilgrimage.0022.t
	desc = db_pilgrimage.0022.desc
	theme = dragon_of_the_north
	override_background = { reference = high_hrothgar }
	cooldown = { years = 1 }
	
	immediate = {
		title:d_greybeards.holder = { save_scope_as = greybeards_leader }
	}
	
	left_portrait = {
		character = root
		animation = interested
	}
	
	right_portrait = {
		character = scope:greybeards_leader
		animation = personality_zealous
	}
	
	option = {
		name = db_pilgrimage.0022.a
		stress_impact = {
			ambitious = minor_stress_loss
			arrogant = minor_stress_loss
			brave = minor_stress_loss
			humble = minor_stress_gain
			craven = minor_stress_gain
		}
		trigger_event = db_pilgrimage.0025
	}
	option = {
		name = db_pilgrimage.0022.b
		stress_impact = {
			ambitious = minor_stress_gain
			arrogant = minor_stress_gain
			brave = minor_stress_gain
			humble = minor_stress_loss
			craven = minor_stress_loss
		}
		add_to_global_variable_list = {
			name = talos_patron_available
			target = flag:db_greybeards_rejected_call
		}
		remove_character_flag = flag_summoned_by_greybeards
		trigger_event = db_pilgrimage.0024
	}
	after = {
		
	}
}

db_pilgrimage.0023 = {
	type = activity_event
	title = db_pilgrimage.0023.t
	desc = db_pilgrimage.0023.desc
	theme = dragon_of_the_north
	override_background = { reference = high_hrothgar }
	
	right_portrait = {
		character = root
		animation = disapproval
	}
	
	cooldown = { years = 1 }
	
	trigger = {
		is_target_in_global_variable_list = {
			name = db_high_hrothgar_tablets
			target = flag:db_greybeards
		}
	}
	
	immediate = {
		
	}
	
	option = {
		name = db_pilgrimage.0023.a
		stress_impact = {
			greedy = minor_stress_impact_gain
			avaricious = minor_stress_impact_gain
		}
	}
	after = {
		
	}
}

db_pilgrimage.0024 = {
	type = activity_event
	title = db_pilgrimage.0024.t
	desc = db_pilgrimage.0024.desc
	theme = dragon_of_the_north
	override_background = { reference = high_hrothgar }
	cooldown = { years = 1 }
	
	immediate = {
		title:d_greybeards.holder = { save_scope_as = greybeards_leader }
	}
	
	left_portrait = {
		character = root
		animation = personality_bold
	}
	
	right_portrait = {
		character = scope:greybeards_leader
		animation = shock
	}
	
	option = {
		name = db_pilgrimage.0024.a
	}
	after = {
		
	}
}

db_pilgrimage.0025 = {
	type = activity_event
	title = db_pilgrimage.0025.t
	desc = db_pilgrimage.0025.desc
	theme = dragon_of_the_north
	override_background = { reference = high_hrothgar }
	
	cooldown = { years = 1 }
	
	immediate = {
		title:d_greybeards.holder = { save_scope_as = greybeards_leader }
		add_character_flag = flag_ysmir_dragon_of_the_north
		save_scope_as = ysmir
		set_global_variable = {
			name = db_ysmir_dotn
			value = scope:ysmir
		}
		if = {
			limit = {
				exists = title:e_skyrim.holder
			}
			add_pressed_claim = title:e_skyrim
		}
	}
	
	left_portrait = {
		character = root
		animation = personality_bold
	}
	
	right_portrait = {
		character = scope:greybeards_leader
		animation = personality_zealous
	}
	
	option = {
		name = db_pilgrimage.0025.a
		add_character_modifier = { modifier = db_ysmir_dragon_of_the_north_modifier }
		add_character_modifier = {
			modifier = exhausted_modifier
			months = 3
		}
		add_stress = major_stress_gain
		add_trait_xp = {
			trait = thuum_mastery
			value = 80
		}
	}
	after = {
		remove_nickname = yes
		give_nickname = nick_the_ysmir_dragon_of_the_north
	}
}

db_pilgrimage.0026 = {
	type = activity_event
	title = db_pilgrimage.0026.t
	desc = db_pilgrimage.0026.desc
	theme = dragon_of_the_north
	override_background = { reference = high_hrothgar }
	
	cooldown = { years = 1 }
	
	immediate = {
		title:d_greybeards.holder = { save_scope_as = greybeards_leader }
		root = { save_scope_as = future_greybeard }
	}
	
	left_portrait = {
		character = root
		animation = personality_bold
	}
	
	right_portrait = {
		character = scope:greybeards_leader
		animation = personality_zealous
	}
	
	option = {
		name = db_pilgrimage.0026.a
		player_heir = { 
			add_opinion = {
				modifier = thankful_opinion
				target = root
				opinion = 25
			}
		}
		depose = yes
		hidden_effect = {
			dynasty = {
				add_dynasty_prestige = major_dynasty_prestige_loss
			}
		}
	}
	after = {
		scope:future_greybeard = {
			add_trait = greybeard
			set_employer = scope:greybeards_leader
		}
	}
}

db_pilgrimage.0027 = {
	type = activity_event
	title = db_pilgrimage.0027.t
	desc = db_pilgrimage.0027.desc
	theme = dragon_of_the_north
	override_background = { reference = high_hrothgar }
	
	cooldown = { years = 1 }
	
	immediate = {
		title:d_greybeards.holder = { save_scope_as = greybeards_leader }
	}
	
	left_portrait = {
		character = root
		animation = personality_bold
	}
	
	right_portrait = {
		character = scope:greybeards_leader
		animation = personality_zealous
	}
	
	option = {
		name = db_pilgrimage.0027.a
		add_stress = major_stress_gain
		if = {
			limit = {
				OR = {
					has_trait = education_learning_4
					has_trait = education_learning_5
				}
			}
			add_trait_xp = {
				trait = thuum_mastery
				value = 15
			}
		}
		else = {
			add_trait_xp = {
				trait = thuum_mastery
				value = 10
			}
		}
	}
	after = {
		
	}
}