﻿namespace = aureliani

# A founder's personal chapter. House progression never depends on these scenes.
aureliani.0050 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani.0050.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:aureliani_chapter_partner }
				desc = aureliani.0050.desc.partner
			}
			desc = aureliani.0050.desc.alone
		}
	}
	theme = learning
	left_portrait = { character = root }
	right_portrait = {
		character = scope:aureliani_chapter_partner
		trigger = { exists = scope:aureliani_chapter_partner }
	}
	trigger = {
		aureliani_founder_chapter_available_trigger = yes
		var:aureliani_chapter_stage = 0
	}
	on_trigger_fail = {
		if = {
			limit = { has_character_flag = aureliani_chapter_active }
			aureliani_end_founder_chapter_effect = yes
		}
	}
	immediate = { aureliani_prepare_chapter_cast_effect = yes }
	option = {
		name = aureliani.0050.a
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_0 var:aureliani_chapter_stage = 0 } exists = scope:aureliani_chapter_partner }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 0 exists = scope:aureliani_chapter_partner }
			custom_tooltip = aureliani_chapter_dispute_tt
			scope:aureliani_chapter_partner = {
				add_opinion = { target = root modifier = aureliani_chapter_heard_opinion years = 3 }
			}
		}
		ai_chance = { base = 50 }
	}
	option = {
		name = aureliani.0050.b
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_0 var:aureliani_chapter_stage = 0 } }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 0 }
			custom_tooltip = aureliani_chapter_dispute_tt
			add_learning_lifestyle_xp = 100
			stress_impact = { diligent = 5 shy = -5 }
		}
		ai_chance = { base = 40 }
	}
	option = {
		name = aureliani.0050.c
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_0 var:aureliani_chapter_stage = 0 } }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 0 }
			custom_tooltip = aureliani_chapter_ended_tt
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 10 }
	}
	option = {
		name = aureliani_chapter_close
		trigger = { NOT = { AND = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_0 var:aureliani_chapter_stage = 0 } } } }
		if = {
			limit = { has_character_flag = aureliani_chapter_active NOT = { aureliani_founder_chapter_available_trigger = yes } }
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 100 }
	}
	after = {
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 0 }
			aureliani_queue_chapter_dispute_effect = yes
		}
	}
}
aureliani.0051 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani.0051.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:aureliani_chapter_adviser }
				desc = aureliani.0051.desc.adviser
			}
			desc = aureliani.0051.desc.alone
		}
	}
	theme = stewardship
	left_portrait = { character = root }
	right_portrait = {
		character = scope:aureliani_chapter_adviser
		trigger = { exists = scope:aureliani_chapter_adviser }
	}
	lower_right_portrait = {
		character = scope:aureliani_chapter_partner
		trigger = { exists = scope:aureliani_chapter_partner }
	}
	trigger = {
		aureliani_founder_chapter_available_trigger = yes
		var:aureliani_chapter_stage = 1
		aureliani_civic_vision_trigger = yes
	}
	on_trigger_fail = {
		if = {
			limit = { has_character_flag = aureliani_chapter_active }
			aureliani_end_founder_chapter_effect = yes
		}
	}
	immediate = { aureliani_prepare_chapter_cast_effect = yes }
	option = {
		name = aureliani.0051.a
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_civic_vision_trigger = yes gold >= 25 }
		show_as_unavailable = { always = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_civic_vision_trigger = yes gold >= 25 }
			custom_tooltip = aureliani_chapter_reflection_tt
			remove_short_term_gold = 25
			title:c_firenze = {
				add_county_modifier = { modifier = aureliani_chapter_civic_trial years = 2 }
			}
			set_variable = { name = aureliani_chapter_stance value = 1 }
			scope:aureliani_chapter_adviser ?= {
				add_opinion = { target = root modifier = aureliani_chapter_heard_opinion years = 3 }
			}
			stress_impact = { greedy = 10 generous = -5 }
		}
		ai_chance = { base = 40 }
	}
	option = {
		name = aureliani.0051.b
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_civic_vision_trigger = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_civic_vision_trigger = yes }
			custom_tooltip = aureliani_chapter_reflection_tt
			title:c_firenze = {
				add_county_modifier = { modifier = aureliani_chapter_civic_compromise years = 2 }
			}
			set_variable = { name = aureliani_chapter_stance value = 2 }
			stress_impact = { ambitious = 5 patient = -5 }
		}
		ai_chance = { base = 40 }
	}
	option = {
		name = aureliani.0051.c
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_civic_vision_trigger = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_civic_vision_trigger = yes }
			custom_tooltip = aureliani_chapter_reflection_tt
			set_variable = { name = aureliani_chapter_stance value = 3 }
			scope:aureliani_chapter_adviser ?= {
				add_opinion = { target = root modifier = aureliani_chapter_dismissed_opinion years = 3 }
			}
			stress_impact = { just = 5 ambitious = -5 }
		}
		ai_chance = { base = 20 }
	}
	option = {
		name = aureliani_chapter_close
		trigger = { NOT = { AND = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_civic_vision_trigger = yes } } }
		if = {
			limit = { has_character_flag = aureliani_chapter_active NOT = { aureliani_founder_chapter_available_trigger = yes } }
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 100 }
	}
	after = {
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_civic_vision_trigger = yes }
			set_variable = { name = aureliani_chapter_stage value = 2 }
			trigger_event = { id = aureliani.0054 days = 90 }
		}
	}
}
aureliani.0052 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani.0052.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:aureliani_chapter_adviser }
				desc = aureliani.0052.desc.adviser
			}
			desc = aureliani.0052.desc.alone
		}
	}
	theme = faith
	left_portrait = { character = root }
	right_portrait = {
		character = scope:aureliani_chapter_adviser
		trigger = { exists = scope:aureliani_chapter_adviser }
	}
	lower_right_portrait = {
		character = scope:aureliani_chapter_partner
		trigger = { exists = scope:aureliani_chapter_partner }
	}
	trigger = {
		aureliani_founder_chapter_available_trigger = yes
		var:aureliani_chapter_stage = 1
		aureliani_sacred_vision_trigger = yes
	}
	on_trigger_fail = {
		if = {
			limit = { has_character_flag = aureliani_chapter_active }
			aureliani_end_founder_chapter_effect = yes
		}
	}
	immediate = { aureliani_prepare_chapter_cast_effect = yes }
	option = {
		name = aureliani.0052.a
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_sacred_vision_trigger = yes gold >= 25 }
		show_as_unavailable = { always = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_sacred_vision_trigger = yes gold >= 25 }
			custom_tooltip = aureliani_chapter_reflection_tt
			remove_short_term_gold = 25
			add_character_modifier = { modifier = aureliani_chapter_church_trial years = 2 }
			set_variable = { name = aureliani_chapter_stance value = 1 }
			scope:aureliani_chapter_adviser ?= {
				add_opinion = { target = root modifier = aureliani_chapter_heard_opinion years = 3 }
			}
			stress_impact = { greedy = 10 generous = -5 }
		}
		ai_chance = { base = 40 }
	}
	option = {
		name = aureliani.0052.b
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_sacred_vision_trigger = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_sacred_vision_trigger = yes }
			custom_tooltip = aureliani_chapter_reflection_tt
			add_piety = 25
			set_variable = { name = aureliani_chapter_stance value = 2 }
			stress_impact = { ambitious = 5 patient = -5 }
		}
		ai_chance = { base = 40 }
	}
	option = {
		name = aureliani.0052.c
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_sacred_vision_trigger = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_sacred_vision_trigger = yes }
			custom_tooltip = aureliani_chapter_reflection_tt
			set_variable = { name = aureliani_chapter_stance value = 3 }
			scope:aureliani_chapter_adviser ?= {
				add_opinion = { target = root modifier = aureliani_chapter_dismissed_opinion years = 3 }
			}
			stress_impact = { just = 5 ambitious = -5 }
		}
		ai_chance = { base = 20 }
	}
	option = {
		name = aureliani_chapter_close
		trigger = { NOT = { AND = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_sacred_vision_trigger = yes } } }
		if = {
			limit = { has_character_flag = aureliani_chapter_active NOT = { aureliani_founder_chapter_available_trigger = yes } }
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 100 }
	}
	after = {
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_sacred_vision_trigger = yes }
			set_variable = { name = aureliani_chapter_stage value = 2 }
			trigger_event = { id = aureliani.0054 days = 90 }
		}
	}
}
aureliani.0053 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani.0053.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:aureliani_chapter_adviser }
				desc = aureliani.0053.desc.adviser
			}
			desc = aureliani.0053.desc.alone
		}
	}
	theme = martial
	left_portrait = { character = root }
	right_portrait = {
		character = scope:aureliani_chapter_adviser
		trigger = { exists = scope:aureliani_chapter_adviser }
	}
	lower_right_portrait = {
		character = scope:aureliani_chapter_partner
		trigger = { exists = scope:aureliani_chapter_partner }
	}
	trigger = {
		aureliani_founder_chapter_available_trigger = yes
		var:aureliani_chapter_stage = 1
		aureliani_imperial_vision_trigger = yes
	}
	on_trigger_fail = {
		if = {
			limit = { has_character_flag = aureliani_chapter_active }
			aureliani_end_founder_chapter_effect = yes
		}
	}
	immediate = { aureliani_prepare_chapter_cast_effect = yes }
	option = {
		name = aureliani.0053.a
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_imperial_vision_trigger = yes gold >= 25 }
		show_as_unavailable = { always = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_imperial_vision_trigger = yes gold >= 25 }
			custom_tooltip = aureliani_chapter_reflection_tt
			remove_short_term_gold = 25
			add_character_modifier = { modifier = aureliani_chapter_military_trial years = 2 }
			set_variable = { name = aureliani_chapter_stance value = 1 }
			scope:aureliani_chapter_adviser ?= {
				add_opinion = { target = root modifier = aureliani_chapter_heard_opinion years = 3 }
			}
			stress_impact = { greedy = 10 generous = -5 }
		}
		ai_chance = { base = 40 }
	}
	option = {
		name = aureliani.0053.b
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_imperial_vision_trigger = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_imperial_vision_trigger = yes }
			custom_tooltip = aureliani_chapter_reflection_tt
			add_prestige = 25
			set_variable = { name = aureliani_chapter_stance value = 2 }
			stress_impact = { ambitious = 5 patient = -5 }
		}
		ai_chance = { base = 40 }
	}
	option = {
		name = aureliani.0053.c
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_imperial_vision_trigger = yes }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_imperial_vision_trigger = yes }
			custom_tooltip = aureliani_chapter_reflection_tt
			set_variable = { name = aureliani_chapter_stance value = 3 }
			scope:aureliani_chapter_adviser ?= {
				add_opinion = { target = root modifier = aureliani_chapter_dismissed_opinion years = 3 }
			}
			stress_impact = { just = 5 ambitious = -5 }
		}
		ai_chance = { base = 20 }
	}
	option = {
		name = aureliani_chapter_close
		trigger = { NOT = { AND = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_1 var:aureliani_chapter_stage = 1 } aureliani_imperial_vision_trigger = yes } } }
		if = {
			limit = { has_character_flag = aureliani_chapter_active NOT = { aureliani_founder_chapter_available_trigger = yes } }
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 100 }
	}
	after = {
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 1 aureliani_imperial_vision_trigger = yes }
			set_variable = { name = aureliani_chapter_stage value = 2 }
			trigger_event = { id = aureliani.0054 days = 90 }
		}
	}
}
aureliani.0054 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani.0054.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { var:aureliani_chapter_stance = 1 }
				desc = aureliani.0054.desc.funded
			}
			triggered_desc = {
				trigger = { var:aureliani_chapter_stance = 2 }
				desc = aureliani.0054.desc.compromise
			}
			desc = aureliani.0054.desc.refused
		}
	}
	theme = family
	left_portrait = { character = root }
	right_portrait = {
		character = scope:aureliani_chapter_partner
		trigger = { exists = scope:aureliani_chapter_partner }
	}
	trigger = {
		aureliani_founder_chapter_available_trigger = yes
		var:aureliani_chapter_stage = 2
	}
	on_trigger_fail = {
		if = {
			limit = { has_character_flag = aureliani_chapter_active }
			aureliani_end_founder_chapter_effect = yes
		}
	}
	immediate = { aureliani_prepare_chapter_cast_effect = yes }
	option = {
		name = aureliani.0054.a
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_2 var:aureliani_chapter_stage = 2 } exists = scope:aureliani_chapter_partner }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 2 exists = scope:aureliani_chapter_partner }
			scope:aureliani_chapter_partner = {
				add_opinion = { target = root modifier = aureliani_chapter_heard_opinion years = 3 }
			}
			add_stress = -10
			if = {
				limit = { NOT = { aureliani_foundation_completed_trigger = yes } }
				custom_tooltip = aureliani_chapter_waiting_tt
			}
			else = { custom_tooltip = aureliani_chapter_conclusion_tt }
		}
		ai_chance = { base = 50 }
	}
	option = {
		name = aureliani.0054.b
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_2 var:aureliani_chapter_stage = 2 } }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 2 }
			add_stress = 10
			add_learning_lifestyle_xp = 100
			if = {
				limit = { NOT = { aureliani_foundation_completed_trigger = yes } }
				custom_tooltip = aureliani_chapter_waiting_tt
			}
			else = { custom_tooltip = aureliani_chapter_conclusion_tt }
		}
		ai_chance = { base = 40 }
	}
	option = {
		name = aureliani.0054.c
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_2 var:aureliani_chapter_stage = 2 } }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 2 }
			custom_tooltip = aureliani_chapter_ended_tt
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 10 }
	}
	option = {
		name = aureliani_chapter_close
		trigger = { NOT = { AND = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_2 var:aureliani_chapter_stage = 2 } } } }
		if = {
			limit = { has_character_flag = aureliani_chapter_active NOT = { aureliani_founder_chapter_available_trigger = yes } }
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 100 }
	}
	after = {
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 2 }
			set_variable = { name = aureliani_chapter_stage value = 3 }
			aureliani_try_conclude_chapter_effect = yes
		}
	}
}

aureliani.0055 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani.0055.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:aureliani_chapter_partner }
				desc = aureliani.0055.desc.partner
			}
			desc = aureliani.0055.desc.alone
		}
	}
	theme = dynasty
	left_portrait = { character = root }
	right_portrait = {
		character = scope:aureliani_chapter_partner
		trigger = { exists = scope:aureliani_chapter_partner }
	}
	trigger = {
		aureliani_founder_chapter_available_trigger = yes
		var:aureliani_chapter_stage = 3
		aureliani_foundation_completed_trigger = yes
		has_character_flag = aureliani_chapter_conclusion_queued
	}
	on_trigger_fail = {
		if = {
			limit = { has_character_flag = aureliani_chapter_active }
			aureliani_end_founder_chapter_effect = yes
		}
	}
	immediate = { aureliani_prepare_chapter_cast_effect = yes }
	option = {
		name = aureliani.0055.a
		trigger = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_3 var:aureliani_chapter_stage = 3 } aureliani_foundation_completed_trigger = yes custom_description = { text = aureliani_option_req_chapter_final_ready has_character_flag = aureliani_chapter_conclusion_queued } }
		if = {
			limit = { aureliani_founder_chapter_available_trigger = yes var:aureliani_chapter_stage = 3 aureliani_foundation_completed_trigger = yes has_character_flag = aureliani_chapter_conclusion_queued }
			custom_tooltip = aureliani_chapter_completed_tt
			add_character_flag = aureliani_chapter_completed
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 100 }
	}
	option = {
		name = aureliani_chapter_close
		trigger = { NOT = { AND = { aureliani_founder_chapter_available_trigger = yes custom_description = { text = aureliani_option_req_chapter_stage_3 var:aureliani_chapter_stage = 3 } aureliani_foundation_completed_trigger = yes custom_description = { text = aureliani_option_req_chapter_final_ready has_character_flag = aureliani_chapter_conclusion_queued } } } }
		if = {
			limit = { has_character_flag = aureliani_chapter_active NOT = { aureliani_founder_chapter_available_trigger = yes } }
			aureliani_end_founder_chapter_effect = yes
		}
		ai_chance = { base = 100 }
	}
}
