﻿namespace = aureliani_office

aureliani_office.0001 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani_office.0001.t
	desc = {
		first_valid = {
			triggered_desc = { trigger = { scope:aureliani_office_holder = { aureliani_senator_personal_support_trigger = yes } } desc = aureliani_office.0001.supports_desc }
			triggered_desc = { trigger = { scope:aureliani_office_holder = { NOT = { aureliani_senator_personal_support_trigger = yes } } } desc = aureliani_office.0001.opposes_desc }
			triggered_desc = { trigger = { always = yes } desc = aureliani_office.0001.fallback_desc }
		}
	}
	theme = diplomacy
	left_portrait = { character = root }
	right_portrait = { character = scope:aureliani_office_holder animation = thinking }
	trigger = {
		aureliani_office_presiding_event_available_trigger = yes
		house = { has_variable = aureliani_senate_proposal has_variable = aureliani_senate_deliberating NOT = { has_variable = aureliani_senate_recognition_pending } }
		exists = house:house_aureliani.var:aureliani_office_presiding
	}
	immediate = {
		house = { set_variable = { name = aureliani_office_presiding_cooldown value = 1 days = 365 } }
		house = { save_scope_value_as = { name = aureliani_office_bill_serial value = var:aureliani_senate_bill_serial } }
		house:house_aureliani.var:aureliani_office_presiding = { save_scope_as = aureliani_office_holder }
	}
	option = {
		name = aureliani_office.0001.a
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_presiding_current_trigger = yes house = { custom_description = { text = aureliani_option_req_senate_deliberating has_variable = aureliani_senate_deliberating } custom_description = { text = aureliani_option_req_senate_bill_current var:aureliani_senate_bill_serial = scope:aureliani_office_bill_serial } } }
		custom_tooltip = aureliani_office.0001.vote.tt
		house = { remove_variable = aureliani_senate_deliberating }
		if = {
			limit = { scope:aureliani_office_holder = { diplomacy >= 12 opinion = { target = root value >= 20 } aureliani_senator_personal_support_trigger = yes } }
			add_prestige = 75
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_respected_opinion years = 2 } }
		}
		else = {
			add_tyranny = 2
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 2 } }
		}
		if = { limit = { scope:aureliani_office_holder = { var:aureliani_senator_faction = 5 aureliani_senator_personal_support_trigger = yes } } add_prestige = 25 }
	}
	option = {
		name = aureliani_office.0001.b
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_presiding_current_trigger = yes house = { custom_description = { text = aureliani_option_req_senate_deliberating has_variable = aureliani_senate_deliberating } custom_description = { text = aureliani_option_req_senate_bill_current var:aureliani_senate_bill_serial = scope:aureliani_office_bill_serial } } }
		custom_tooltip = aureliani_office.0001.delay.tt
		house = { set_variable = { name = aureliani_senate_deliberating value = 1 days = 45 } }
		if = {
			limit = { scope:aureliani_office_holder = { has_trait = just opinion = { target = root value >= 0 } NOT = { aureliani_senator_personal_support_trigger = yes } } }
			add_prestige = 50
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_respected_opinion years = 2 } }
		}
		else = {
			add_stress = 10
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_complicit_opinion years = 2 } }
		}
		ai_chance = { base = 0 }
	}
	option = {
		name = aureliani_office.0001.stale
		trigger = { OR = { NOT = { aureliani_senate_mandate_trigger = yes } NOT = { aureliani_office_presiding_current_trigger = yes } NOT = { house = { custom_description = { text = aureliani_option_req_senate_proposal has_variable = aureliani_senate_proposal } custom_description = { text = aureliani_option_req_senate_deliberating has_variable = aureliani_senate_deliberating } custom_description = { text = aureliani_option_req_senate_bill_current var:aureliani_senate_bill_serial = scope:aureliani_office_bill_serial } } } } }
		ai_chance = { base = 0 }
	}
}

aureliani_office.0002 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani_office.0002.t
	desc = aureliani_office.0002.desc
	theme = stewardship
	left_portrait = { character = root }
	right_portrait = { character = scope:aureliani_office_holder animation = thinking }
	trigger = {
		aureliani_office_treasurer_event_available_trigger = yes
		house = { NOT = { has_variable = aureliani_senate_recognition_pending } }
		exists = house:house_aureliani.var:aureliani_office_treasurer
	}
	immediate = {
		house = { set_variable = { name = aureliani_office_treasurer_cooldown value = 1 days = 365 } }
		house:house_aureliani.var:aureliani_office_treasurer = { save_scope_as = aureliani_office_holder }
	}
	option = {
		name = aureliani_office.0002.a
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_treasurer_current_trigger = yes }
		if = {
			limit = { scope:aureliani_office_holder = { stewardship >= 12 has_trait = diligent NOT = { has_trait = greedy } opinion = { target = root value >= 20 } } }
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_respected_opinion years = 2 } }
			if = { limit = { house = { var:aureliani_senate_stage = 2 var:aureliani_senate_policy_1_level >= 4 } } add_gold = 100 }
			else = { add_gold = 50 }
			if = { limit = { scope:aureliani_office_holder = { var:aureliani_senator_faction = 1 } } add_prestige = 25 }
		}
		else = {
			add_gold = 25
			if = { limit = { scope:aureliani_office_holder = { has_trait = greedy } } scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 2 } } }
		}
	}
	option = {
		name = aureliani_office.0002.b
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_treasurer_current_trigger = yes }
		add_gold = 100
		add_tyranny = 3
		if = { limit = { scope:aureliani_office_holder = { has_trait = greedy opinion = { target = root value >= 0 } } } scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_complicit_opinion years = 2 } } }
		else = { scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 3 } } }
		ai_chance = { base = 0 }
	}
	option = { name = aureliani_office.0002.stale trigger = { OR = { NOT = { aureliani_senate_mandate_trigger = yes } NOT = { aureliani_office_treasurer_current_trigger = yes } } } ai_chance = { base = 0 } }
}

aureliani_office.0003 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani_office.0003.t
	desc = {
		first_valid = {
			triggered_desc = { trigger = { aureliani_senate_recognition_petition_trigger = yes } desc = aureliani_office.0003.recognition_desc }
			triggered_desc = { trigger = { NOT = { house = { has_variable = aureliani_senate_recognition_pending } } } desc = aureliani_office.0003.petitions_desc }
			triggered_desc = { trigger = { always = yes } desc = aureliani_office.0003.fallback_desc }
		}
	}
	theme = learning
	left_portrait = { character = root }
	right_portrait = { character = scope:aureliani_office_holder animation = writing }
	trigger = {
		aureliani_office_records_event_available_trigger = yes
		exists = house:house_aureliani.var:aureliani_office_records
	}
	immediate = {
		house = { set_variable = { name = aureliani_office_records_cooldown value = 1 days = 365 } }
		house:house_aureliani.var:aureliani_office_records = { save_scope_as = aureliani_office_holder }
		if = { limit = { aureliani_senate_recognition_petition_trigger = yes } house = { save_scope_value_as = { name = aureliani_senate_recognition_attempt value = var:aureliani_senate_recognition_serial } } }
	}
	option = {
		name = aureliani_office.0003.a
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_records_current_trigger = yes aureliani_senate_recognition_funding_available_trigger = yes gold >= 100 }
		aureliani_senate_recognition_funded_hearing_effect = yes
		trigger_event = { id = aureliani.0120 days = 1 }
	}
	option = {
		name = aureliani_office.0003.b
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_records_current_trigger = yes NOT = { house = { custom_description = { text = aureliani_option_req_senate_recognition_pending has_variable = aureliani_senate_recognition_pending } } } gold >= 50 }
		remove_short_term_gold = 50
		if = {
			limit = { scope:aureliani_office_holder = { learning >= 12 has_trait = diligent opinion = { target = root value >= 20 } } }
			if = { limit = { house = { var:aureliani_senate_stage = 2 } } add_prestige = 100 }
			else = { add_prestige = 50 }
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_respected_opinion years = 2 } }
		}
		else = {
			add_prestige = 25
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 2 } }
		}
	}
	option = {
		name = aureliani_office.0003.c
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_records_current_trigger = yes }
		add_prestige = 50
		scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 3 } }
		ai_chance = { base = 0 }
	}
	option = { name = aureliani_office.0003.stale trigger = { OR = { NOT = { aureliani_senate_mandate_trigger = yes } NOT = { aureliani_office_records_current_trigger = yes } } } ai_chance = { base = 0 } }
}

aureliani_office.0004 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani_office.0004.t
	desc = aureliani_office.0004.desc
	theme = stewardship
	left_portrait = { character = root }
	right_portrait = { character = scope:aureliani_office_holder animation = thinking }
	trigger = {
		aureliani_office_works_event_available_trigger = yes
		house = { NOT = { has_variable = aureliani_senate_recognition_pending } }
		exists = house:house_aureliani.var:aureliani_office_works
	}
	immediate = {
		house = { set_variable = { name = aureliani_office_works_cooldown value = 1 days = 365 } }
		house:house_aureliani.var:aureliani_office_works = { save_scope_as = aureliani_office_holder }
	}
	option = {
		name = aureliani_office.0004.a
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_works_current_trigger = yes gold >= 100 }
		remove_short_term_gold = 100
		if = {
			limit = { scope:aureliani_office_holder = { stewardship >= 12 has_trait = diligent } }
			capital_county = { add_county_modifier = { modifier = aureliani_office_works_surveyed years = 3 } }
			add_prestige = 100
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_respected_opinion years = 2 } }
		}
		else = {
			capital_county = { add_county_modifier = { modifier = aureliani_office_works_limited years = 3 } }
			add_prestige = 25
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 2 } }
		}
	}
	option = {
		name = aureliani_office.0004.b
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_works_current_trigger = yes gold >= 50 }
		remove_short_term_gold = 50
		add_tyranny = 2
		capital_county = { add_county_modifier = { modifier = aureliani_office_works_favored_contract years = 2 } }
		if = { limit = { scope:aureliani_office_holder = { opinion = { target = root value >= 0 } } } scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_complicit_opinion years = 2 } } }
		else = { scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 2 } } }
		ai_chance = { base = 0 }
	}
	option = {
		name = aureliani_office.0004.stale
		ai_chance = { base = 0 }
	}
}

aureliani_office.0005 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani_office.0005.t
	desc = {
		first_valid = {
			triggered_desc = { trigger = { house = { var:aureliani_senate_roman_portfolio = 1 } } desc = aureliani_office.0005.war_desc }
			triggered_desc = { trigger = { house = { var:aureliani_senate_roman_portfolio = 2 } } desc = aureliani_office.0005.justice_desc }
			triggered_desc = { trigger = { always = yes } desc = aureliani_office.0005.fallback_desc }
		}
	}
	theme = martial
	left_portrait = { character = root }
	right_portrait = { character = scope:aureliani_office_holder animation = thinking }
	trigger = {
		aureliani_office_fifth_event_available_trigger = yes
		house = { NOT = { has_variable = aureliani_senate_recognition_pending } }
		exists = house:house_aureliani.var:aureliani_office_fifth
	}
	immediate = {
		house = { set_variable = { name = aureliani_office_fifth_cooldown value = 1 days = 365 } }
		house:house_aureliani.var:aureliani_office_fifth = { save_scope_as = aureliani_office_holder }
	}
	option = {
		name = aureliani_office.0005.war
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_fifth_current_trigger = yes house = { custom_description = { text = aureliani_option_req_portfolio_1 var:aureliani_senate_roman_portfolio = 1 } } gold >= 100 }
		remove_short_term_gold = 100
		if = {
			limit = { scope:aureliani_office_holder = { martial >= 12 var:aureliani_senator_faction = 2 opinion = { target = root value >= 20 } } }
			if = {
				limit = { house = { var:aureliani_senate_policy_2_level <= 2 } }
				add_character_modifier = { modifier = aureliani_office_war_retinues years = 2 }
			}
			else = { add_character_modifier = { modifier = aureliani_office_war_stores years = 2 } }
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_respected_opinion years = 2 } }
		}
		else = {
			add_character_modifier = { modifier = aureliani_office_war_stores_wasteful years = 2 }
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 2 } }
		}
	}
	option = {
		name = aureliani_office.0005.war_refuse
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_fifth_current_trigger = yes house = { custom_description = { text = aureliani_option_req_portfolio_1 var:aureliani_senate_roman_portfolio = 1 } } }
		add_prestige = 100
		if = { limit = { scope:aureliani_office_holder = { opinion = { target = root value < 0 } } } scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 3 } } }
		else = { scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_respected_opinion years = 1 } } }
		ai_chance = { base = 0 }
	}
	option = {
		name = aureliani_office.0005.justice
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_fifth_current_trigger = yes house = { custom_description = { text = aureliani_option_req_portfolio_2 var:aureliani_senate_roman_portfolio = 2 } } prestige >= 75 }
		add_prestige = -75
		if = {
			limit = { scope:aureliani_office_holder = { learning >= 12 has_trait = just var:aureliani_senator_faction = 4 } }
			add_character_modifier = { modifier = aureliani_office_public_appeal years = 2 }
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_respected_opinion years = 2 } }
		}
		else = {
			add_character_modifier = { modifier = aureliani_office_public_appeal_clerk_error years = 2 }
			scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 2 } }
		}
	}
	option = {
		name = aureliani_office.0005.justice_force
		trigger = { aureliani_senate_mandate_trigger = yes aureliani_office_fifth_current_trigger = yes house = { custom_description = { text = aureliani_option_req_portfolio_2 var:aureliani_senate_roman_portfolio = 2 } } }
		add_tyranny = 3
		add_dread = 10
		scope:aureliani_office_holder = { add_opinion = { target = root modifier = aureliani_office_rebuffed_opinion years = 3 } }
		ai_chance = { base = 0 }
	}
	option = { name = aureliani_office.0005.stale trigger = { OR = { NOT = { aureliani_senate_mandate_trigger = yes } NOT = { aureliani_office_fifth_current_trigger = yes } } } ai_chance = { base = 0 } }
}

aureliani_office.0006 = {
	content_source = dlc_aureliani
	type = character_event
	title = aureliani_office.0006.t
	desc = aureliani_office.0006.desc
	theme = diplomacy
	left_portrait = { character = root }
	trigger = {
		aureliani_office_charter_available_trigger = yes
	}
	immediate = { house = { set_variable = { name = aureliani_office_charter_open value = 1 days = 30 } } }
	option = {
		name = aureliani_office.0006.war
		trigger = { aureliani_senate_mandate_trigger = yes house = { custom_description = { text = aureliani_option_req_roman_senate_established var:aureliani_senate_stage = 2 } NOT = { custom_description = { text = aureliani_option_req_portfolio_chosen has_variable = aureliani_senate_roman_portfolio } } } }
		custom_tooltip = aureliani_office.0006.war.tt
		house = { set_variable = { name = aureliani_senate_roman_portfolio value = 1 } }
	}
	option = {
		name = aureliani_office.0006.justice
		trigger = { aureliani_senate_mandate_trigger = yes house = { custom_description = { text = aureliani_option_req_roman_senate_established var:aureliani_senate_stage = 2 } NOT = { custom_description = { text = aureliani_option_req_portfolio_chosen has_variable = aureliani_senate_roman_portfolio } } } }
		custom_tooltip = aureliani_office.0006.justice.tt
		house = { set_variable = { name = aureliani_senate_roman_portfolio value = 2 } }
	}
	option = {
		name = aureliani_office.0006.stale
		trigger = { OR = { NOT = { aureliani_senate_mandate_trigger = yes } house = { custom_description = { text = aureliani_option_req_roman_senate_unestablished var:aureliani_senate_stage < 2 } } house = { custom_description = { text = aureliani_option_req_portfolio_chosen has_variable = aureliani_senate_roman_portfolio } } } }
		ai_chance = { base = 0 }
	}
	after = { house = { remove_variable = aureliani_office_charter_open } }
}
