﻿namespace = az_examination

# Examiner: You are asked to review and comment on entrants' calligraphy and prose styles
az_examination.0001 = {
	type = activity_event
	title = az_examination.0001.t
	desc  = az_examination.0001.desc

	theme = imperial_examination
	cooldown = { months = 6 }
	
	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = { 
				name = entrants 
				is_physically_able_ai_adult = yes
				this != root
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = entrants
				limit = {
					is_physically_able_ai_adult = yes
					this != root				
				}
				save_scope_as = entrant
			}
		}
	}

	left_portrait = {
		character = root
		animation = interested
	}

	right_portrait = {
		character = scope:entrant
		animation = throne_room_messenger_3
	}

	option = {
		name = az_examination.0001.intrigue # What do I get?
		add_internal_flag = special
		trigger = {
			intrigue >= high_skill_rating
			can_add_hook = {
				target = scope:entrant
				type = favor_hook
			}
		}
		add_hook_if_possible_default_length_effect = {
			TARGET = scope:entrant
			TYPE = favor_hook
		}

		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		
		stress_impact = { deceitful = minor_stress_impact_loss }

		ai_chance = {
			base = 45
			modifier = {
				add = 15
				has_trait = deceitful
			}
			ai_value_modifier = {
				ai_greed = 2
				ai_honor = -2
			}
		}
	}

	option = {
		name = az_examination.0001.a # Gentle feedback

		trigger = {
			diplomacy >= high_skill_rating
		}

		progress_towards_friend_effect = {
			CHARACTER = scope:entrant
			REASON = friend_helped_me
			OPINION = 20
		}

		add_diplomacy_lifestyle_xp = medium_lifestyle_xp
		stress_impact = { compassionate = minor_stress_impact_loss }

		ai_chance = {
			base = 45
			modifier = {
				add = 15
				has_trait = compassionate
			}
			ai_value_modifier = {
				ai_compassion = 2
			}
		}
	}

	option = {
		name = az_examination.0001.b # Mock them

		add_prestige = minor_prestige_gain
		if = {
  			limit = { government_has_flag = government_has_influence }
 			change_influence = medium_influence_gain
 		}

		scope:entrant = {
			add_opinion = {
				target = root
				modifier = tournament_mocked_opinion #Re-using
				opinion = -20
			}
			add_stress = minor_stress_gain
		}

		every_vassal_or_below = {
			limit = {
				has_vassal_stance = belligerent
				is_participant_in_activity = scope:activity
			}
			custom = every_participating_belligerent_vassal
			add_opinion = {
				target = root
				modifier = amused_opinion
				opinion = 10
			}
		}

		stress_impact = { 
			arrogant = minor_stress_impact_loss 
			arbitrary = minor_stress_impact_loss 
			sadistic = minor_stress_impact_loss 
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			modifier = {
				add = 25
				has_trait = arrogant
			}
			ai_value_modifier = {
				ai_vengefulness = 2
				ai_compassion = -2
			}
		}
	}

	option = {
		name = az_examination.0001.c # Essay response

		change_merit = medium_merit_gain
		add_learning_lifestyle_xp = medium_lifestyle_xp

		if = {
			limit = { has_trait = confucian_education }
			add_trait_xp = {
				trait = confucian_education
				value = lifestyle_confucian_education_xp_gain_minor_value
			}
		}

		reverse_add_opinion = {
			target = scope:entrant
			modifier = respect_opinion
			opinion = 10
		}

		stress_impact = { 
			scholar = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 20
				has_trait = scholar
			}
			modifier = {
				add = 15
				has_trait = diligent
			}
			ai_value_modifier = {
				ai_zeal = 1
				ai_greed = -1
			}
		}
	}
}

#Examiner: You debate with another attending character
az_examination.0002 = {
	type = activity_event
	title = az_examination.0002.t
	desc = az_examination.0002.desc.exam

	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		learning >= 6
		scope:activity = {
			any_attending_character = {
				is_ai = yes
				learning <= 6
				NOT = { this = root }
			}
		}
	}

	left_portrait = {
		character = root
		animation = anger
	}

	right_portrait = {
		character = scope:debater
		animation = debating
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_ai = yes
					learning >= 6
					NOT = { this = root }
				}
				save_scope_as = debater
			}
		}
	}

	option = {
		name = az_examination.0002.b  # Argue for the revisionist view

		add_learning_lifestyle_xp = medium_lifestyle_xp
		if = {
			limit = { has_trait = confucian_education }
			add_trait_xp = {
				trait = confucian_education
				value = lifestyle_confucian_education_xp_gain_minor_value
			}
		}

		scope:debater = {
			if = {
				limit = {
					NOT = { has_relation_rival = root }
				}
				set_relation_rival = {
					target = root
					reason = rival_humiliated_in_debate
				}
			}
		}

		ai_chance = {
			base = 30
			ai_value_modifier = {
				ai_zeal = 1
			}
		}
	}

	option = {
		name = az_examination.0002.c  # Calm the debater

		add_diplomacy_lifestyle_xp = medium_lifestyle_xp
		change_merit = medium_merit_gain

		scope:debater = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 10
			}
		}

		stress_impact = { trusting = minor_stress_impact_loss }
		ai_chance = {
			base = 25
			modifier = {
				add = 15
				has_trait = trusting
			}
			ai_value_modifier = {
				ai_compassion = 2
			}
		}
	}

	option = {
		name = az_examination.0002.d  # Stay out of it

		add_stress = minor_stress_loss
		ai_chance = {
			base = 15
			modifier = {
				add = 20
				has_trait = shy
			}
			modifier = {
				add = 20
				has_trait = lazy
			}
			modifier = {
				add = 20
				has_trait = callous
			}
			ai_value_modifier = {
				ai_sociability = -2
			}
		}
	}
}

#Examiner: A clumsy entrant is improperly serving tea
az_examination.0003 = {
	type = activity_event
	title = az_examination.0003.t
	desc  = az_examination.0003.desc

	theme = imperial_examination
	override_background = { reference = feast }
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = { 
				name = entrants
				this != root
				is_ai = yes
			}
			any_guest_subset = { 
				name = imperial_examiners 
				this != root
				is_ai = yes
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = entrants
				limit = {
					this != root
					is_ai = yes
				}
				save_scope_as = tea_offender
			}
			random_guest_subset = {
				name = imperial_examiners
				limit = {
					this != root
					is_ai = yes
				}
				save_scope_as = host_examiner
			}
		}
	}

	left_portrait = {
		character = root
		animation = disapproval
	}

	center_portrait = {
		character = scope:tea_offender
		animation = serving_tray
		camera = camera_event_center_pointing_forward
	}

	right_portrait = {
		character = scope:host_examiner
		animation = dismissal
	}

	option = {
		name = az_examination.0003.a # Demonstrate proper rites

		add_diplomacy_lifestyle_xp = medium_lifestyle_xp
		change_merit = medium_merit_gain

		scope:host_examiner = {
			add_opinion = {
				target = root
				modifier = impressed_opinion
				opinion = 15
			}
		}

		scope:tea_offender = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 10
			}
		}

		stress_impact = { diligent = minor_stress_impact_loss }
		ai_chance = {
			base = 40
			modifier = {
				add = 20
				has_trait = diligent
			}
			ai_value_modifier = {
				ai_compassion = 1
			}
		}

	}

	option = {
		name = az_examination.0003.b # Side with the examiner

		add_prestige = minor_prestige_gain
		if = {
  			limit = { government_has_flag = government_has_influence }
 			change_influence = medium_influence_gain
 		}

		scope:host_examiner = {
			add_opinion = {
				target = root
				modifier = helpful_opinion
				opinion = 20
			}
		}

		scope:tea_offender = {
			add_opinion = {
				target = root
				modifier = humiliated_opinion
				opinion = -20
			}
			add_stress = minor_stress_gain
		}

		stress_impact = { 
			compassionate = minor_stress_impact_gain
			arrogant = minor_stress_impact_loss 
		}
		ai_chance = {
			base = 30
			modifier = {
				add = 20
				has_trait = arrogant
			}
			ai_value_modifier = {
				ai_compassion = -1
			}
		}
	}

	option = {
		name = az_examination.0003.c # Stay out of it

		add_stress = minor_stress_loss
		ai_chance = {
			base = 30
			modifier = {
				add = 15
				has_trait = shy
			}
			ai_value_modifier = {
				ai_sociability = -2
			}
		}
	}
}

#Examiner: You witness an entrant perusing an illicit exam guide
az_examination.0004 = {
	type = activity_event
	title = az_examination.0004.t
	desc  = az_examination.0004.desc

	theme = imperial_examination
	override_background = { reference = market }
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = {
				name = entrants
				is_physically_able_ai_adult = yes
				NOT = { this = root }
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = entrants
				limit = {
					is_physically_able_ai_adult = yes
					NOT = { this = root }
				}
				save_scope_as = caught_entrant
			}
		}
		create_character = {
			template = merchant_template
			dynasty = none
			location = scope:activity.activity_location
			save_scope_as = merchant
		}
	}

	left_portrait = {
		character = root
		animation = page_flipping
	}

	center_portrait = {
		character = scope:caught_entrant
		animation = map_worry
		camera = camera_event_center_away
	}

	right_portrait = {
		character = scope:merchant
		animation = steward
	}

	option = {
		name = az_examination.0004.b  # Report and confiscate

		change_merit = medium_merit_gain
		scope:caught_entrant = {
			add_opinion = {
				target = root
				modifier = humiliated_opinion
				opinion = -15
			}
			add_stress = minor_stress_gain
		}

		add_prestige = minor_prestige_gain

		stress_impact = { honest = minor_stress_impact_loss }
		ai_chance = {
			base = 30
			modifier = {
				add = 15
				has_trait = honest
			}
			ai_value_modifier = {
				ai_honor = 2
			}
		}
	}

	option = {
		name = az_examination.0004.c  # Buy the whole stash

		if = {
			limit = { has_trait = confucian_education }
			add_trait_xp = {
				trait = confucian_education
				value = lifestyle_confucian_education_xp_gain_minor_value
			}
		}
		add_learning_lifestyle_xp = medium_lifestyle_xp
		custom_tooltip = az_examination.0004.c.tt
		hidden_effect = {
 			create_artifact = {
			name = artifact_scroll_name
			description = artifact_scroll_desc
			modifier = artifact_learning_1_modifier
			modifier = artifact_monthly_confucian_education_xp_2_modifier
			type = miscellaneous
			visuals = artifact_scroll
			save_scope_as = artifact_scroll
			}
 		}
		pay_short_term_gold = {
			target = scope:merchant
			gold = major_gold_value
		}
		send_interface_toast = {
			title = az_examination.0004.c.tt_equipped
			left_icon = root
			right_icon = scope:artifact_scroll
			scope:artifact_scroll = {
				set_variable = {
					name = suppress_artifact_notifications
					value = yes
					days = 1
				}
				set_owner = {
					target = root
					history = {
						location = root.location
						actor = scope:merchant
						recipient = root
						type = purchased
					}
				}
			}
		}

		scope:activity = {
			every_guest_subset = {
				name = entrants
				limit = {
					is_ai = yes
					this != root
					has_trait = cynical
				}
				custom = custom.every_cynical_entrant
				add_opinion = {
					target = root
					modifier = amused_opinion
					opinion = 10
				}
			}
		}

		stress_impact = { greedy = minor_stress_impact_loss }
		ai_chance = {
			base = 20
			modifier = {
				add = 25
				has_trait = greedy
			}
			ai_value_modifier = {
				ai_greed = 2
			}
		}
	}

	option = {
		name = az_examination.0004.d  # Stay out of it

		scope:caught_entrant = {
			add_opinion = {
				target = root
				modifier = relieved_opinion
				opinion = 10
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 20
				has_trait = shy
			}
			ai_value_modifier = {
				ai_sociability = -2
			}
		}
	}

	after = {
		scope:merchant = {
			silent_disappearance_effect = yes
		}
	}
}

# Examiner: You find a fellow examiner contemplating an ancient verse
az_examination.0005 = {
	type = activity_event
	title = {
		first_valid = {
			triggered_desc = {
				trigger = {
					culture = { has_cultural_pillar = heritage_chinese }
				}
				desc = az_examination.0005.china.t
			}
			triggered_desc = {
				trigger = {
					culture = { has_cultural_pillar = heritage_korean }
				}
				desc = az_examination.0005.korea.t
			}
			desc = az_examination.0005.t
		}
	}
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					culture = { has_cultural_pillar = heritage_chinese }
				}
				desc = az_examination.0005.china.desc
			}
			triggered_desc = {
				trigger = {
					culture = { has_cultural_pillar = heritage_korean }
				}
				desc = az_examination.0005.korea.desc
			}
			desc = az_examination.0005.desc
		}
	}

	theme = imperial_examination
	override_background = { reference = study }
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			scope:activity = {
				any_guest_subset = { 
					name = imperial_examiners
					is_physically_able_ai_adult = yes
					this != root
				}
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = imperial_examiners
				limit = {
					is_physically_able_ai_adult = yes
					this != root
				}
				save_scope_as = fellow_examiner
			}
		}
	}

	left_portrait = {
		character = root
		animation = pondering
		camera = camera_body_right
	}

	right_portrait = {
		character = scope:fellow_examiner
		animation = debating
		camera = camera_body_left
	}

	# Interpret it as a lesson in virtue
	option = {
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							culture = { has_cultural_pillar = heritage_chinese }
						}
						desc = az_examination.0005.china.a
					}
					desc = az_examination.0005.a
				}
			}
		} 

		add_piety = minor_piety_gain
		if = {
			limit = { has_trait = confucian_education }
			add_trait_xp = {
				trait = confucian_education
				value = lifestyle_confucian_education_xp_gain_minor_value
			}
		}

		scope:fellow_examiner = {
			add_opinion = {
				target = root
				modifier = pious_opinion
				opinion = 10
			}
		}

		stress_impact = { 
			just = minor_stress_impact_loss 
			temperate = minor_stress_impact_loss 
		}

		ai_chance = {
			base = 30
			modifier = {
				add = 20
				has_trait = just
			}
			modifier = {
				add = 15
				has_trait = temperate
			}
			ai_value_modifier = {
				ai_honor = 2
				ai_zeal = 1
			}
		}
	}

	option = {
		name = az_examination.0005.b  # Interpret it as a call for lawful order

		if = {
			limit = { has_trait = confucian_education }
			add_trait_xp = {
				trait = confucian_education
				value = lifestyle_confucian_education_xp_gain_minor_value
			}
			change_merit = miniscule_merit_gain
		}
		else = {
			add_learning_lifestyle_xp = medium_lifestyle_xp
		}

		scope:fellow_examiner = {
			add_opinion = {
				target = root
				modifier = impressed_opinion
				opinion = 10
			}
		}

		stress_impact = { diligent = minor_stress_impact_loss }

		ai_chance = {
			base = 35
			modifier = {
				add = 15
				has_trait = diligent
			}
			ai_value_modifier = {
				ai_honor = 2
				ai_greed = -1
			}
		}
	}

	option = {
		name = az_examination.0005.c  # Twist the words cynically (requires cynical or arbitrary)

		trigger = {
			OR = {
				has_trait = cynical
				has_trait = arbitrary
			}
		}

		add_intrigue_lifestyle_xp = minor_lifestyle_xp

		scope:fellow_examiner = {
			add_opinion = {
				target = root
				modifier = amused_opinion
				opinion = 10
			}
		}

		stress_impact = { 
			cynical = minor_stress_impact_loss 
			arbitrary = minor_stress_impact_loss 
		}

		ai_chance = {
			base = 20
			modifier = {
				add = 20
				has_trait = cynical
			}
			modifier = {
				add = 15
				has_trait = arbitrary
			}
			ai_value_modifier = {
				ai_greed = 1
				ai_honor = -2
			}
		}
	}

	option = {
		name = az_examination.0005.d  # Leave them to it

		add_prestige = minor_prestige_gain

		reverse_add_opinion = {
			target = scope:fellow_examiner
			modifier = disappointed_opinion
			opinion = -30
		}

		ai_chance = {
			base = 15
			modifier = {
				add = 15
				has_trait = shy
			}
			modifier = {
				add = 10
				has_trait = lazy
			}
			ai_value_modifier = {
				ai_sociability = -2
			}
		}
	}
}

# Examiner: You uncover a well-connected entrant
az_examination.0006 = {
	type = activity_event
	title = az_examination.0006.t
	desc  = az_examination.0006.desc

	theme = imperial_examination
	override_background = { reference = study }

    cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = {
				name = guests
				this != root
				is_ai = yes
				OR = {
					has_activity_intent = local_exam_support_entrants_intent
					has_activity_intent = imperial_exam_support_entrants_intent
				}
			}
			any_guest_subset = {
				name = entrants
				this != root
				is_physically_able_ai_adult = yes
				OR = {
					is_close_or_extended_family_of = root
					has_relation_disciple = root
				}
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = guests
				limit = {
					this != root
					is_ai = yes
					OR = {
						has_activity_intent = local_exam_support_entrants_intent
						has_activity_intent = imperial_exam_support_entrants_intent
					}
				}
				save_scope_as = local_ruler
			}
			random_guest_subset = {
				name = entrants
				limit = {
					this != root
					is_physically_able_ai_adult = yes
					OR = {
						is_close_or_extended_family_of = root
						has_relation_disciple = root
					}
				}
				save_scope_as = favored_entrant
			}

		}
	}

	left_portrait = {
		character = root
		animation = personality_zealous
	}

	right_portrait = {
		character = scope:favored_entrant
		animation = nervous
		camera = camera_event_center_pointing_left
	}

	center_portrait = {
		character = scope:local_ruler
		animation = personality_bold
		camera = camera_event_center_pointing_left
	}

	option = {
		name = az_examination.0006.a # Show them favor

		trigger = {
			OR = {
				can_add_hook = {
					target = scope:local_ruler
					type = favor_hook
				}
				scope:favored_entrant = {
					NOT = {
						any_relation = {
							type = elder
						}
					}
				}
			}
		}

		if = {
			limit = {
				scope:favored_entrant = {
					NOT = {
						any_relation = {
							type = elder
						}
					}
				}
			}
			set_elder_relation_effect = {
				ELDER = root
				DISCIPLE = scope:favored_entrant
				MERIT = minor_merit_gain
			}
		}
		
		if = {
			limit = {
				can_add_hook = {
					target = scope:local_ruler
					type = favor_hook
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:local_ruler
			}
		}

		scope:favored_entrant = {
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 20
			}
		}

		scope:local_ruler = {
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 20
			}
		}

		stress_impact = { 
			paranoid = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			diligent = minor_stress_impact_loss
		}

		ai_chance = {
			base = 20
			modifier = {
				add = 20
				has_trait = diligent
			}
			modifier = {
				add = -20
				has_trait = paranoid
			}
			modifier = {
				add = -20
				has_trait = shy
			}
			ai_value_modifier = {
				ai_zeal = 2
				ai_sociability = 2
			}
		}
	}

	option = {
		name = az_examination.0006.b # Stay neutral

		add_piety = minor_piety_gain

		scope:favored_entrant = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 10
			}
		}

		stress_impact = { just = minor_stress_impact_loss }

		ai_chance = {
			base = 50
			modifier = {
				add = 15
				has_trait = just
			}
			ai_value_modifier = {
				ai_honor = 2
			}
		}
	}

	option = {
		name = az_examination.0006.c # Opt-out

	 	stress_impact = { 
	 		base = minor_stress_impact_loss
	 		diligent = minor_stress_impact_gain
	 	}

		ai_chance = {
			base = 30
			modifier = {
				add = -20
				has_trait = diligent
			}
			ai_value_modifier = {
				ai_zeal = -2
				ai_sociability = -1
			}
		}
	}
}

# Examiner: Preparing the Ink for the Examination Scrolls
az_examination.0007 = {
	type = activity_event
	title = az_examination.0007.t
	desc  = az_examination.0007.desc

	theme = imperial_examination
	override_background = { reference = study }
	cooldown = { months = 6 }

	left_portrait = {
		character = root
		animation = throne_room_conversation_4
		camera = camera_event_center_pointing_right
	}

	right_portrait = {
		character = scope:aged_examiner
		animation = physician
	}

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = { 
				name = imperial_examiners 
				is_physically_able_ai_adult = yes
				NOT = { this = root }
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			scope:activity = {
				any_guest_subset = { 
					name = imperial_examiners 
					is_physically_able_ai_adult = yes
					NOT = { this = root }
					age >= root.age
				}
			}
			factor = 2
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = { 
				name = imperial_examiners 
				limit = {
					is_physically_able_ai_adult = yes
					NOT = { this = root }
				}
				weight = {
					base = 1
					modifier = {
						age >= root.age
						add = 20
					}
				}
				save_scope_as = aged_examiner
			}
		}
	}

	option = {
		name = az_examination.0007.a # Prepare the ink according to the Book of Rites

		add_piety = medium_piety_gain

		if = {
			limit = { has_trait = confucian_education }
			add_trait_xp = {
				trait = confucian_education
				value = lifestyle_confucian_education_xp_gain_minor_value
			}
		}
		else = {
			add_learning_lifestyle_xp = minor_lifestyle_xp
		}

		stress_impact = { diligent = medium_stress_impact_loss }

		ai_chance = {
			base = 40
			modifier = {
				add = 20
				has_trait = diligent
			}
			ai_value_modifier = {
				ai_zeal = 1
				ai_honor = 1
			}
		}
	}

	option = {
		name = az_examination.0007.b # Add a secret ingredient to prolong longevity

		add_character_modifier = {
			modifier = tgp_ginseng_resin_modifier
			years = 5
		}

		stress_impact = { arbitrary = minor_stress_impact_loss }

		ai_chance = {
			base = 20
			modifier = {
				add = 20
				has_trait = arbitrary
			}
			ai_value_modifier = {
				ai_greed = 1
				ai_zeal = -1
			}
		}
	}

	option = {
		name = az_examination.0007.c # This task is beneath you

		stress_impact = { 
			base = medium_stress_loss
			shy = minor_stress_impact_loss 
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 20
				has_trait = shy
			}
			ai_value_modifier = {
				ai_sociability = -2
			}
		}
	}
}

# Examiner: A Rediscovered Scroll Sparks a Challenge
az_examination.0008 = {
	type = activity_event
	title = az_examination.0008.t
	desc  = az_examination.0008.desc

	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		any_memory = { 
			OR = {
				has_memory_type = passed_child_exam_memory
				has_memory_type = failed_child_exam_memory
				has_memory_type = passed_provincial_exam_memory
				has_memory_type = failed_provincial_exam_memory
				has_memory_type = passed_metropolitan_exam_memory
				has_memory_type = failed_metropolitan_exam_memory
				has_memory_type = passed_palace_exam_memory
			}			
		}
		scope:activity = {
			any_guest_subset = {
				name = imperial_examiners
				is_physically_able_ai_adult = yes
				NOT = { this = root }
				age >= root.age
			}
		}
	}

	immediate = {
		assign_quirk_effect = yes
		scope:activity = {
			random_guest_subset = {
				name = imperial_examiners
				limit = {
					is_physically_able_ai_adult = yes
					NOT = { this = root }
					age >= root.age
				}
				save_scope_as = examiner
			}
		}
		random_memory = {
			limit = {
				OR = {
					has_memory_type = passed_child_exam_memory
					has_memory_type = failed_child_exam_memory
					has_memory_type = passed_provincial_exam_memory
					has_memory_type = failed_provincial_exam_memory
					has_memory_type = passed_metropolitan_exam_memory
					has_memory_type = failed_metropolitan_exam_memory
					has_memory_type = passed_palace_exam_memory
				}
			}
			save_scope_as = memory
		}
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
		camera = camera_event_center_close_to_right
	}

	right_portrait = {
		character = scope:examiner
		animation = chancellor
		camera = camera_event_center_pointing_left
	}

	option = {
		name = az_examination.0008.a # "Let us grade one another's answers."

		duel = {
			skill = learning
			target = scope:examiner

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3
					min = -49
				}
				desc = az_examination.0008.a.success.tt
				send_interface_toast = {
					title = az_examination.0008.a.success.tt
					change_merit = minor_merit_gain
					add_learning_lifestyle_xp = medium_lifestyle_xp
					scope:examiner = {
						add_opinion = {
							target = root
							modifier = respect_opinion
							opinion = 10
						}
					}
					if = {
						limit = { has_trait = confucian_education }
						add_trait_xp = {
							trait = confucian_education
							value = lifestyle_confucian_education_xp_gain_minor_value
						}
					}
				}
			}

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3
					min = -49
				}
				desc = az_examination.0008.a.failure.tt
				send_interface_toast = {
					title = az_examination.0008.a.failure.tt
					add_prestige = minor_prestige_loss
				}
			}
		}

		stress_impact = {
			diligent = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 35
			modifier = {
				add = 15
				has_trait = diligent
			}
			modifier = {
				add = 15
				has_trait = arrogant
			}
			modifier = {
				add = -15
				has_trait = shy
			}
			ai_value_modifier = {
				ai_zeal = 1
			}
		}
	}

	option = {
		name = az_examination.0008.b # "Ah, those days…"

		add_piety = minor_piety_gain

		scope:examiner = {
			add_opinion = {
				target = root
				modifier = friendliness_opinion
				opinion = 10
			}
		}

		stress_impact = {
			base = minor_stress_impact_loss
			content = minor_stress_impact_loss
		}

		ai_chance = {
			base = 40
			modifier = {
				add = 15
				has_trait = content
			}
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}
}

# Examiner: An Ink Crate Spill
az_examination.0009 = {
	type = activity_event
	title = az_examination.0009.t
	desc  = az_examination.0009.desc

	theme = imperial_examination
    cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = {
				name = entrants
				is_physically_able_ai_adult = yes
				has_any_mild_good_relationship_with_character_trigger = { CHARACTER = root }
				can_set_relation_friend_trigger = { CHARACTER = root }
			}
			any_guest_subset = {
				name = imperial_examiners
				NOT = { this = root }
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = entrants
				limit = { 
					is_physically_able_ai_adult = yes
					has_any_mild_good_relationship_with_character_trigger = { CHARACTER = root }
					can_set_relation_friend_trigger = { CHARACTER = root }
				}
				save_scope_as = clumsy_entrant
			}
			random_guest_subset = {
				name = imperial_examiners
				limit = { NOT = { this = root } }
				save_scope_as = angry_examiner
			}
		}
	}

	left_portrait = {
		character = root
		animation = stunned
	}

	center_portrait = {
		character = scope:clumsy_entrant
		animation = disbelief
	}

	right_portrait = {
		character = scope:angry_examiner
		animation = rage
		camera = camera_event_right_pointing_right
	}

	option = {
		name = az_examination.0009.a # Take the blame

		add_piety = minor_piety_gain

		set_relation_friend = { 
			reason = friend_took_blame 
			target = scope:clumsy_entrant 
		}

		stress_impact = {
			compassionate = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 30
			modifier = {
				add = 20
				has_trait = compassionate
			}
			modifier = {
				add = -20
				has_trait = arrogant
			}
			ai_value_modifier = {
				ai_compassion = 1
				ai_honor = 1
			}
		}
	}

	option = {
		name = az_examination.0009.b # Side with the examiner

		add_prestige = minor_prestige_gain

		scope:angry_examiner = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 15
			}
		}

		scope:clumsy_entrant = {
			add_opinion = {
				target = root
				modifier = humiliated_opinion
				opinion = -15
			}
			add_stress = minor_stress_gain
		}

		stress_impact = {
			arrogant = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}

		ai_chance = {
			base = 35
			modifier = {
				add = 20
				has_trait = arrogant
			}
			modifier = {
				add = -20
				has_trait = compassionate
			}
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_greed = 1
			}
		}
	}

	option = {
		name = az_examination.0009.c # Quietly order cleanup

		stress_impact = {
			base = minor_stress_loss
			humble = minor_stress_impact_loss
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 15
				has_trait = humble
			}
			ai_value_modifier = {
				ai_sociability = -1
			}
		}
	}
}

# Examiner: Entrant tries to pass a secret message
az_examination.0010 = {
	type = activity_event
	title = az_examination.0010.t
	desc  = az_examination.0010.desc

	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity ?= {
			any_attending_character = {
				is_physically_able_ai_adult = yes
				OR = {
					is_in_guest_subset = { name = guests }
					is_in_guest_subset = { name = entrants }
				}
				this != root
				any_secret = {
					NOT = {
						any_secret_knower = { this = root }
					}
				}
			}
			any_guest_subset = {
				name = imperial_examiners
				is_physically_able_ai_adult = yes
				this != root
			}
		}
	}

	immediate = {
		scope:activity = {
			#Find a secret, a secret holder and a secret knower
			random_attending_character = {
				limit = {
					is_physically_able_ai_adult = yes
					OR = {
						is_in_guest_subset = { name = guests }
						is_in_guest_subset = { name = entrants }
					}
					this != root
					any_secret = {
						NOT = {
							any_secret_knower = { this = root }
						}
					}
				}
				save_scope_as = requesting_entrant
				random_secret = {
					limit = {
						NOT = {
							any_secret_knower = { this = root }
						}
					}
					save_scope_as = secret
				}
			}
			random_guest_subset = {
				name = imperial_examiners
				limit = {
					is_physically_able_ai_adult = yes
					NOT = { this = root }
				}
				save_scope_as = target_examiner
			}
		}
	}

	left_portrait = {
		character = root
		animation = personality_forgiving
	}

	center_portrait = {
		character = scope:requesting_entrant
		animation = throne_room_messenger_3
		camera = camera_event_center_pointing_left
	}

	lower_right_portrait = {
		character = scope:target_examiner
		animation = idle
	}

	option = {
		name = az_examination.0010.a  # Deliver the letter discreetly

		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		add_hook_if_possible_default_length_effect = {
			TARGET = scope:target_examiner
			TYPE = favor_hook
		}

		scope:requesting_entrant = {
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 10
			}
		}

		stress_impact = { deceitful = minor_stress_impact_loss }

		ai_chance = {
			base = 35
			modifier = { 
				add = 20 
				has_trait = deceitful 
			}
			modifier = { 
				add = -15 
				has_trait = honest 
			}
			ai_value_modifier = {
				ai_greed = 1
				ai_vengefulness = -1
			}
		}
	}

	option = {
		name = az_examination.0010.b  # Refuse and report the attempt

		change_merit = medium_merit_gain
		add_prestige = minor_prestige_gain

		scope:requesting_entrant = {
			add_opinion = {
				target = root
				modifier = betrayal_opinion
				opinion = -20
			}
		}

		scope:target_examiner = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 15
			}
		}

		stress_impact = { just = minor_stress_impact_loss }

		ai_chance = {
			base = 40
			modifier = { 
				add = 20 
				has_trait = just 
			}
			modifier = { 
				add = -15 
				has_trait = cynical 
			}
			ai_value_modifier = {
				ai_honor = 2
			}
		}
	}

	option = {
		name = az_examination.0010.c  # Read the letter

		custom_tooltip = az_examination.0010.c.tt
		send_interface_toast = {
			title = az_examination.0010.c.toast
			left_icon = scope:requesting_entrant
		 	scope:secret = {
				reveal_to = root
			}   
		}
		add_piety = minor_piety_loss

		scope:requesting_entrant = {
			add_opinion = {
				target = root
				modifier = unfriendly_opinion
				opinion = -10
			}
		}

		stress_impact = { content = minor_stress_impact_gain }

		ai_chance = {
			base = 25
			modifier = { add = -20 has_trait = content }
			ai_value_modifier = {
				ai_zeal = -1
			}
		}
	}
}

# Examiner: A Whispered Seat Swap
az_examination.0011 = {
	type = activity_event
	title = az_examination.0011.t
	desc  = az_examination.0011.desc
	
	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = {
				name = entrants
				is_ai = yes
				ai_honor <= 0
				NOR = { 
					has_trait = honest
					has_trait = just
					this = root 
				}
				count >= 2
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = entrants
				limit = { 
					is_ai = yes
					ai_honor <= 0
					NOR = { 
						has_trait = honest
						has_trait = just
						this = root 
					} 
				}
				save_scope_as = sneaky_entrant_1
			}
			random_guest_subset = {
				name = entrants
				limit = {
					is_ai = yes
					ai_honor <= 0
					NOR = { 
						has_trait = honest
						has_trait = just
						this = root 
						this = scope:sneaky_entrant_1
					}
				}
				save_scope_as = sneaky_entrant_2
			}
		}
	}

	left_portrait = {
		character = root
		animation = disbelief
	}

	center_portrait = {
		character = scope:sneaky_entrant_1
		animation = happiness
		camera = camera_event_very_left_activity
	}

	right_portrait = {
		character = scope:sneaky_entrant_2
		animation = debating
		camera = camera_event_very_right_far
	}

	option = {
		name = az_examination.0011.a  # Expose their scheme publicly

		change_merit = medium_merit_gain

		scope:sneaky_entrant_1 = {
			add_opinion = {
				target = root
				modifier = betrayal_opinion
				opinion = -15
			}
		}

		scope:sneaky_entrant_2 = {
			add_opinion = {
				target = root
				modifier = betrayal_opinion
				opinion = -15
			}
		}

		stress_impact = {
			just = minor_stress_impact_loss
			cynical = minor_stress_impact_gain
		}

		ai_chance = {
			base = 40
			modifier = {
				add = 20
				has_trait = just
			}
			modifier = {
				add = -15
				has_trait = cynical
			}
			ai_value_modifier = {
				ai_honor = 2
			}
		}
	}

	option = {
		name = az_examination.0011.b  # Help them pull it off

		add_intrigue_lifestyle_xp = medium_lifestyle_xp

		duel = {
			skill = intrigue
			value = high_skill_rating
			60 = {
				desc = az_examination.0011.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 2
				}
				modifier = {
					add = {
						value = scope:sneaky_entrant_1.intrigue
						subtract = high_skill_rating
						multiply = 2
						min = 10 #Guaranteed help
					}
				}
				modifier = {
					add = {
						value = scope:sneaky_entrant_2.intrigue
						subtract = high_skill_rating
						multiply = 2
						min = 10 #Guaranteed help
					}
				}
				send_interface_toast = {
					title = az_examination.0011.b.success
					left_icon = scope:sneaky_entrant_1
					right_icon = scope:sneaky_entrant_2
					if = {
						limit = {
							can_add_hook = { target = scope:sneaky_entrant_1 type = favor_hook }
						}
						add_hook_if_possible_default_length_effect = {
							TARGET = scope:sneaky_entrant_1
							TYPE = favor_hook
						}
					}

					if = {
						limit = {
							can_add_hook = { target = scope:sneaky_entrant_2 type = favor_hook }
						}
						add_hook_if_possible_default_length_effect = {
							TARGET = scope:sneaky_entrant_2
							TYPE = favor_hook
						}
					}
				}
			}
			40 = {
				desc = az_examination.0011.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -2
				}
				modifier = {
					add = {
						value = scope:sneaky_entrant_1.intrigue
						subtract = high_skill_rating
						multiply = -2
						max = 0 #They shouldn't make this worse
					}
				}
				modifier = {
					add = {
						value = scope:sneaky_entrant_2.intrigue
						subtract = high_skill_rating
						multiply = -2
						max = 0 #They shouldn't make this worse
					}
				}
				send_interface_toast = {
					title = az_examination.0011.b.failure
					left_icon = scope:sneaky_entrant_1
					right_icon = scope:sneaky_entrant_2
					change_influence = minor_influence_loss
				}
			}
		}

		stress_impact = {
			deceitful = minor_stress_impact_loss
			honest = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 20
				has_trait = deceitful
			}
			modifier = {
				add = -20
				has_trait = honest
			}
			ai_value_modifier = {
				ai_greed = 1
				ai_vengefulness = -1
			}
		}
	}

	option = {
		name = az_examination.0011.c  # Quietly urge them to stop

		add_diplomacy_lifestyle_xp = minor_lifestyle_xp

		scope:sneaky_entrant_1 = {
			add_opinion = {
				target = root
				modifier = helpful_opinion
				opinion = 10
			}
		}

		scope:sneaky_entrant_2 = {
			add_opinion = {
				target = root
				modifier = helpful_opinion
				opinion = 10
			}
		}

		stress_impact = {
			content = minor_stress_impact_loss
		}

		ai_chance = {
			base = 35
			modifier = {
				add = 15
				has_trait = content
			}
			modifier = {
				add = -10
				has_trait = zealous
			}
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}
}

# Examiner: A Private Tea Invitation
az_examination.0012 = {
	type = activity_event
	title = az_examination.0012.t
	desc  = az_examination.0012.desc

	theme = imperial_examination
	override_background = { reference = tgp_garden_asia }
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = {
				name = imperial_examiners
				is_ai = yes
				highest_held_title_tier >= root.highest_held_title_tier
				NOR = {
					this = root 
					dislikes_character_trigger = { CHARACTER = root }
				}
			}
			any_attending_character = {
				is_ai = yes
				NOT = {
					this = scope:host
				}
				has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = imperial_examiners
				limit = {
					is_ai = yes
					highest_held_title_tier >= root.highest_held_title_tier
					NOR = {
						this = root 
						dislikes_character_trigger = { CHARACTER = root }
					}
				}
				save_scope_as = senior_examiner
			}

			random_attending_character = {
				limit = {
					is_ai = yes
					NOT = {
						this = scope:host
					}
					has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
				}
				save_scope_as = jealous_rival
			}
		}
	}

	left_portrait = {
		character = root
		animation = interested
		camera = camera_event_center_pointing_right
	}

	center_portrait = {
		character = scope:senior_examiner
		animation = debating
		camera = camera_event_center_pointing_left
	}

	right_portrait = {
		character = scope:jealous_rival
		animation = serving_tray
		camera = camera_event_chariot_right
	}

	option = {
		name = az_examination.0012.a # Impress the examiner with your knowledge


		if = {
  			limit = { government_has_flag = government_has_influence }
 			change_influence = medium_influence_gain
 		}
		else = {
			add_prestige = medium_prestige_gain
		}

		scope:jealous_rival = {
			if = {
				limit = {
					NOT = { has_relation_rival = root }
				}
				progress_towards_rival_effect = {
					CHARACTER = root
					REASON = rival_drank_tea
					OPINION = default_rival_opinion
				}
			}
		}

		reverse_add_opinion = {
			modifier = impressed_opinion
			target = scope:senior_examiner
			opinion = 15
		}
	   
		stress_impact = { ambitious = minor_stress_impact_loss }

		ai_chance = {
			base = 40
			modifier = { 
				add = 20 
				has_trait = ambitious 
			}
			ai_value_modifier = {
				ai_zeal = 2
			}
		}
	}

	option = {
		name = az_examination.0012.b # Let's have tea together!

		change_merit = minor_merit_gain

		reverse_add_opinion = {
			modifier = impressed_opinion
			target = scope:senior_examiner
			opinion = 15
		}

		scope:jealous_rival = {
			if = {
				limit = {
					has_relation_rival = root
				}
				remove_relation_rival = root
			}
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 15
			}
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 30
			modifier = { 
				add = 20 
				has_trait = gregarious
			}
			modifier = { 
				add = -15 
				has_trait = shy
			}
			ai_value_modifier = {
				ai_sociability = 1
				ai_vengefulness = -1
			}
		}
	}

	option = {
		name = az_examination.0012.c # Decline the tea invitation politely to read some books

		add_learning_lifestyle_xp = medium_lifestyle_xp

		stress_impact = { 
			ambitious = minor_stress_impact_gain 
			gregarious = minor_stress_impact_gain
			shy = minor_stress_impact_loss
		}

		ai_chance = {
			base = 25
			modifier = {
				add = -20
				has_trait = ambitious
			}
			modifier = {
				add = -20
				has_trait = gregarious
			}
			modifier = {
				add = 20
				has_trait = shy
			}
			ai_value_modifier = {
				ai_sociability = -1
			}
		}
	}
}

# Examiner: The Vanishing Scrolls
az_examination.0013 = {
	type = activity_event
	title = az_examination.0013.t
	desc = az_examination.0013.desc

	theme = imperial_examination
	override_background = { reference = study }
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = exam_assist_exam_intent
		scope:activity = {
			any_guest_subset = {
				name = imperial_examiners
				is_ai = yes
				NOT = { this = root }
				OR = {
					has_relation_potential_rival = root
					has_relation_rival = root
				}
			}
			any_attending_character = {
				has_activity_intent = exam_assist_exam_intent
				is_ai = yes
				NOT = { this = root }
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = imperial_examiners
				limit = { 
					is_ai = yes
					NOT = { this = root }
					OR = {
						has_relation_potential_rival = root
						has_relation_rival = root
					} 
				}
				save_scope_as = calm_examiner
			}
			random_attending_character = {
				limit = { 
					is_ai = yes
					has_activity_intent = exam_assist_exam_intent
					NOT = { this = root } 
				}
				save_scope_as = fellow_assistant
			}
		}
	}

	left_portrait = {
		character = root
		animation = holding_scrolls
		camera = camera_event_left_pointing_right
	}

	center_portrait = {
		character = scope:fellow_assistant
		animation = disbelief
		camera = camera_event_center_pointing_left
	}

	right_portrait = {
		character = scope:calm_examiner
		animation = page_flipping
		camera = camera_event_right_forward
	}

	option = {
		name = az_examination.0013.c # "Rewrite them"

		trigger = { learning >= high_skill_rating }

		add_learning_lifestyle_xp = medium_lifestyle_xp

		stress_impact = { deceitful = minor_stress_impact_loss }

		ai_chance = {
			base = 20
			modifier = { 
				add = 20 
				has_trait = deceitful 
			}
			modifier = { 
				add = -15 
				has_trait = honest 
			}
			ai_value_modifier = {
				ai_greed = 1
				ai_zeal = -1
			}
		}
	}

	option = {
		name = az_examination.0013.a # "Search with the assistant."

		duel = {
			skill = stewardship
			value = average_skill_rating
			60 = {
				desc = az_examination.0013.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 2
				}
				modifier = {
					add = {
						value = scope:fellow_assistant.stewardship
						subtract = average_skill_rating
						multiply = 2
						min = 10 #Guaranteed help
					}
				}
				send_interface_toast = {
					title = az_examination.0013.a.success
					change_merit = medium_merit_gain
					scope:fellow_assistant = {
						add_opinion = {
							target = root
							modifier = helpful_opinion
							opinion = 10
						}
					}
				}
			}
			40 = {
				desc = az_examination.0013.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -2
				}
				modifier = {
					add = {
						value = scope:fellow_assistant.learning
						subtract = average_skill_rating
						multiply = -2
						max = 0 #They shouldn't make this worse
					}
				}
				send_interface_toast = {
					title = az_examination.0013.a.failure
					add_prestige = minor_prestige_loss
					scope:fellow_assistant = {
						add_opinion = {
							target = root
							modifier = disappointed_opinion
							opinion = -10
						}
					}
				}
			}
		}

		stress_impact = {
			diligent = minor_stress_impact_loss
			lazy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 35
			modifier = { 
				add = 20 
				has_trait = diligent 
			}
			modifier = { 
				add = -15 
				has_trait = lazy 
			}
			ai_value_modifier = {
				ai_honor = 1
				ai_sociability = 1
			}
		}
	}

	option = {
		name = az_examination.0013.b # "Accuse the calm examiner."

		duel = {
			skill = intrigue
			target = scope:calm_examiner

			60 = {
				desc = az_examination.0013.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 2
				}
				send_interface_toast = {
					title = az_examination.0013.b.success
					change_merit = medium_merit_gain
					scope:calm_examiner = {
						change_merit = medium_merit_loss
						add_stress = medium_stress_gain
					}
				}
			}
			40 = {
				desc = az_examination.0013.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -2
				}
				send_interface_toast = {
					title = az_examination.0013.b.failure
					add_prestige = minor_prestige_loss
					scope:fellow_assistant = {
						add_opinion = {
							target = root
							modifier = suspicion_opinion
							opinion = -10
						}
					}
				}
			}
		}

		stress_impact = {
			paranoid = minor_stress_impact_loss
			trusting = minor_stress_impact_gain
		}

		ai_chance = {
			base = 20
			modifier = { 
				add = 20 
				has_trait = paranoid 
			}
			modifier = { 
				add = -15 
				has_trait = trusting 
			}
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_zeal = 1
			}
		}
	}

	option = {
		name = az_examination.0013.d # "Stay out of it."

		stress_impact = {
			base = minor_stress_impact_loss
			lazy = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			modifier = { 
				add = 15 
				has_trait = lazy 
			}
			modifier = { 
				add = -15 
				has_trait = diligent 
			}
			ai_value_modifier = {
				ai_zeal = -2
			}
		}
	}
}

# Examiner praises you
az_examination.0014 = {

	type = activity_event
	title = az_examination.0014.t
	desc = az_examination.0014.desc
	theme = imperial_examination
	override_background = { reference = study }
	cooldown = { months = 6 }
	left_portrait = {
		character = root
		animation = delirium
		camera = camera_event_center_pointing_right
	}

	right_portrait = {
		character = scope:praising_examiner
		animation = admiration
	}
	
	trigger = {
		OR = {
			has_activity_intent = local_exam_taker_intent
			has_activity_intent = imperial_exam_taker_intent
		}
		# You have done something worth praising.
		has_variable = has_exam_advantage
		scope:activity = {
			any_guest_subset = {
				name = imperial_examiners
				is_ai = yes
				opinion = {
					target = root
					value > 10
				}
				NOR = {
					is_spouse_of = root
					is_close_family_of = root
				}
				calc_true_if = {
					amount = 2
					highest_held_title_tier > root.highest_held_title_tier
					learning > root.learning
					age > root.age
					has_trait_xp = {
						trait = confucian_education
						value > "root.has_trait_xp(confucian_education)"
					}
				}
			}
		}
	}

	immediate = {
		save_scope_as = root_scope
		scope:activity = {
			random_guest_subset = {
				name = imperial_examiners
				limit = {
					is_ai = yes
					opinion = {
						target = root
						value > 10
					}
					NOR = {
						is_spouse_of = root
						is_close_family_of = root
					}
					calc_true_if = {
						amount = 2
						highest_held_title_tier > root.highest_held_title_tier
						learning > root.learning
						age > root.age
						has_trait_xp = {
							trait = confucian_education
							value > "root.has_trait_xp(confucian_education)"
						}
					}
				}
				save_scope_as = praising_examiner
			}
		}
	}

	option = {
		name = az_examination.0014.a # "I'll make you proud."
		add_character_modifier = {
			modifier = tgp_examiner_promise_modifier
			years = 5
		}

		stress_impact = {
			humble = minor_stress_impact_gain
			ambitious = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
		}

		ai_chance = {
			base = 35
			modifier = { 
				add = 25 
				has_trait = ambitious 
			}
			modifier = { 
				add = 10 
				has_trait = just 
			}
			modifier = { 
				add = -15 
				has_trait = cynical 
			}
			ai_value_modifier = {
				ai_zeal = 2
				ai_honor = 1
			}
		}
	}

	option = {
		name = az_examination.0014.c # "Could you... mentor me?"
		trigger = {
			is_ai = no
			scope:praising_examiner = {
				eligible_for_elder_trigger = {
					DISCIPLE = scope:root_scope
				}			
			}
		}
		scope:praising_examiner = {
			set_elder_relation_effect = {
				ELDER = scope:praising_examiner
				DISCIPLE = scope:root_scope
				MERIT = minor_merit_gain
			}
		}

		stress_impact = {
			shy = minor_stress_impact_gain
			trusting = minor_stress_impact_loss
			arrogant = medium_stress_impact_gain
		}

		ai_chance = {
			base = 30
			modifier = { 
				add = 15 
				has_trait = trusting 
			}
			modifier = { 
				add = -10 
				has_trait = shy 
			}
			modifier = { 
				add = -20 
				has_trait = arrogant 
			}
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = 1
			}
		}
	}

	option = {
		name = az_examination.0014.d # Opt out
		stress_impact = {
			base = minor_stress_impact_loss
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 30
			modifier = { 
				add = -15 
				has_trait = humble 
			}
			ai_value_modifier = {
				ai_honor = -1
				ai_energy = -1
			}
		}
	}
}

# Examiner: A Proud Voice in the Crowd
az_examination.0015 = {
	type = activity_event
	title = az_examination.0015.t
	desc = az_examination.0015.desc

	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		OR = {
			has_activity_intent = local_exam_taker_intent
			has_activity_intent = imperial_exam_taker_intent
		}
		scope:activity = {
			any_attending_character = {
				is_physically_able_ai_adult = yes
				opinion = {
					target = root
					value >= 10
				}
				OR = {
					is_spouse_of = root
					is_close_family_of = root
				}
				NOT = { 
					this = root 
					has_trait = shy
				}
			}
		}
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_physically_able_ai_adult = yes
					opinion = {
						target = root
						value >= 10
					}
					OR = {
						is_spouse_of = root
						is_close_family_of = root
					}
					NOT = { 
						this = root 
						has_trait = shy
					}
				}
				save_scope_as = proud_family_member
			}
		}
	}

	left_portrait = {
		character = root
		animation = disappointed
		camera = camera_event_center_pointing_right
	}

	right_portrait = {
		character = scope:proud_family_member
		animation = survey
		camera = camera_event_right_pointing_right
	}

	option = {
		name = az_examination.0015.a # "Bow to them with grace."

		trigger = {
			exists = dynasty
			OR = {
				scope:proud_family_member.age > root.age
				scope:proud_family_member.highest_held_title_tier > root.highest_held_title_tier
			}
		}

		dynasty ?= {
			add_dynasty_prestige = minor_dynasty_prestige_gain
		}

		scope:proud_family_member = {
			add_opinion = {
				target = root
				modifier = honored_opinion
				opinion = 15
			}
		}

		stress_impact = {
			humble = minor_stress_impact_loss
		}

		ai_chance = {
			base = 40
			modifier = { 
				add = 20 
				has_trait = humble 
			}
			ai_value_modifier = {
				ai_sociability = 2
				ai_honor = 1
			}
		}
	}

	option = {
		name = az_examination.0015.b # "Speak with them firmly later."

		trigger = {
			scope:proud_family_member.age < root.age
			scope:proud_family_member.highest_held_title_tier < root.highest_held_title_tier
		}

		add_prestige = medium_prestige_gain

		scope:proud_family_member = {
			add_opinion = {
				target = root
				modifier = audacity_opinion
				opinion = -10
			}
		}

		stress_impact = {
			shy = minor_stress_impact_loss
		}

		ai_chance = {
			base = 30
			modifier = { 
				add = -15 
				has_trait = humble 
			}
			modifier = { 
				add = 15 
				has_trait = shy 
			}
			ai_value_modifier = {
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = az_examination.0015.d # "Your kindness pulls me forward!"

		add_learning_lifestyle_xp = minor_lifestyle_xp

		stress_impact = {
			diligent = minor_stress_impact_loss
			content = minor_stress_impact_loss
			shy = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 35
			modifier = {
				add = 20
				has_trait = diligent
			}
			modifier = {
				add = 10
				has_trait = calm
			}
			modifier = {
				add = -10
				has_trait = arrogant
			}
			ai_value_modifier = {
				ai_zeal = 2
				ai_sociability = -1
			}
		}
	}


	option = {
		name = az_examination.0015.c # "Lower your head and disappear into the crowd."

		add_piety = minor_piety_gain
		
		stress_impact = {
			shy = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 20
			modifier = { 
				add = 20 
				has_trait = shy 
			}
			modifier = { 
				add = -20 
				has_trait = arrogant 
			}
			ai_value_modifier = {
				ai_sociability = -1
			}
		}
	}
}

# Examiner gives you consolation
az_examination.0016 = {
	type = activity_event
	title = az_examination.0016.t
	desc = az_examination.0016.desc

	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		is_ai = no
		OR = {
			has_activity_intent = local_exam_taker_intent
			has_activity_intent = imperial_exam_taker_intent
		}
		NOT = {
			is_in_guest_subset = { name = palace_entrants }
		}
		scope:activity = {
			any_guest_subset = {
				name = imperial_examiners
				is_ai = yes
				NOR = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
					has_trait = callous
					has_trait = sadistic
					ai_compassion < high_positive_compassion
				}
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = imperial_examiners
				limit = {
					is_ai = yes
					NOR = {
						has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
						has_trait = callous
						has_trait = sadistic
					}
				}
				save_scope_as = kind_examiner
			}
		}
	}

	left_portrait = {
		character = root
		animation = sadness
		camera = camera_event_center_pointing_right
	}

	center_portrait = {
		character = scope:kind_examiner
		animation = personality_forgiving
		camera = camera_event_center_pointing_left
	}

	option = {
		name = az_examination.0016.a # "Thank you. I needed that."

		add_character_modifier = {
			modifier = tgp_examiner_encouragement_modifier
			years = 10
		}

		 stress_impact = {
			arrogant = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 35
			modifier = {
				add = -20
				has_trait = arrogant
			}
			modifier = {
				add = -20
				has_trait = wrathful
			}
			ai_value_modifier = {
				ai_zeal = 1
				ai_honor = 1
			}
		}
	}

	option = {
		name = az_examination.0016.b # "Will you guide me, Elder?"

		trigger = {
			NOT = {
				any_relation = {
					type = elder
				}
			}
		}

		set_elder_relation_effect = {
			ELDER = scope:kind_examiner
			DISCIPLE = root
			MERIT = minor_merit_gain
		}

		stress_impact = {
			shy = minor_stress_impact_loss
			trusting = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 30
			modifier = {
				add = 15
				has_trait = trusting
			}
			modifier = {
				add = 10
				has_trait = shy
			}
			modifier = {
				add = -20
				has_trait = arrogant
			}
			ai_value_modifier = {
				ai_zeal = 2
				ai_sociability = 1
			}
		}
	}

	option = {
		name = az_examination.0016.c # "I’ll carry these words forward."

		add_learning_lifestyle_xp = medium_lifestyle_xp

		if = {
			limit = { has_trait = confucian_education }
			add_trait_xp = {
				trait = confucian_education
				value = lifestyle_confucian_education_xp_gain_medium_value
			}
		}

		stress_impact = {
			diligent = minor_stress_impact_loss
			ambitious = minor_stress_impact_loss
			content = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 35
			modifier = {
				add = 20
				has_trait = diligent
			}
			modifier = {
				add = 10
				has_trait = ambitious
			}
			modifier = {
				add = -20
				has_trait = content
			}
			modifier = {
				add = -20
				has_trait = lazy
			}
			ai_value_modifier = {
				ai_zeal = 2
				ai_greed = 1
			}
		}
	}
}

# A Hidden Letter of Encouragement
az_examination.0017 = {
	type = activity_event
	title = az_examination.0017.t
	desc = az_examination.0017.desc

	theme = imperial_examination
	cooldown = { months = 6 }
	left_portrait = {
		character = root
		animation = chancellor
		camera = camera_event_center_pointing_forward
	}

	right_portrait = {
		character = scope:letter_examiner
		animation = holding_scrolls
		camera = camera_event_center_close_to_right
	}

	trigger = {
		OR = {
			has_activity_intent = local_exam_taker_intent
			has_activity_intent = imperial_exam_taker_intent
		}
		scope:activity = {
			any_guest_subset = {
				name = imperial_examiners
				is_ai = yes
				this != root
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = imperial_examiners
				limit = {
					is_ai = yes
					this != root
				}
				save_scope_as = letter_examiner
			}
		}
	}

	option = {
		name = az_examination.0017.b # "Rewrite it — I am still that person."

		add_character_modifier = {
			modifier = tgp_letter_self_reflection_modifier
			years = 5
		}

		stress_impact = {
			humble = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			cynical = minor_stress_impact_gain
		}

		ai_chance = {
			base = 35
			modifier = { 
				add = 15 
				has_trait = diligent 
			}
			modifier = { 
				add = 15 
				has_trait = humble 
			}
			modifier = { 
				add = -15 
				has_trait = cynical 
			}
			ai_value_modifier = {
				ai_zeal = 1
				ai_honor = 1
			}
		}
	}

	option = {
		name = az_examination.0017.c # "Send it to an examiner as a sign of resolve."

		reverse_add_opinion = {
			target = scope:letter_examiner
			opinion = 15
			modifier = admiration_opinion
		}

		change_merit = minor_merit_gain

		stress_impact = {
			shy = minor_stress_impact_gain
			brave = minor_stress_impact_loss
		}

		ai_chance = {
			base = 30
			modifier = { 
				add = 15 
				has_trait = brave 
			}
			modifier = { 
				add = -15 
				has_trait = shy 
			}
			ai_value_modifier = {
				ai_sociability = 1
				ai_zeal = 1
			}
		}
	}
}

# Elder Among the Entrants
az_examination.0018 = {
	type = activity_event
	title = az_examination.0018.t
	desc  = az_examination.0018.desc

	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		OR = {
			has_activity_intent = local_exam_taker_intent
			has_activity_intent = imperial_exam_taker_intent
		}
		age < 30
		scope:activity = {
			any_guest_subset = {
				name = entrants
				is_physically_able_ai_adult = yes
				age > 50
				NOR = { 
					this = root 
					has_any_good_relationship_with_character_trigger = { CHARACTER = root }
					has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
					is_close_family_of = root
					is_spouse_of = root
				}
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = entrants
				limit = {
					is_physically_able_ai_adult = yes
					age > 50
					NOR = { 
						this = root 
						has_any_good_relationship_with_character_trigger = { CHARACTER = root }
						has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
						is_close_family_of = root
						is_spouse_of = root
					}
				}
				save_scope_as = old_exam_taker
			}
		}
	}

	left_portrait = {
		character = root
		animation = pondering
		camera = camera_event_center_pointing_right
	}

	right_portrait = {
		character = scope:old_exam_taker
		animation = sadness
		camera = camera_event_center_pointing_left
	}

	option = {
		name = az_examination.0018.b # “Let me share what I’ve learned.”
		trigger = {
			learning > scope:old_exam_taker.learning
		}

		scope:old_exam_taker = {
			add_learning_skill = 1
			progress_towards_friend_effect = {
				CHARACTER = root
				REASON = friend_old_mentor
				OPINION = 20
			}
		}

		add_prestige = medium_prestige_gain
		change_merit = medium_merit_gain

		stress_impact = {
			compassionate = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
		}

		ai_chance = {
			base = 30
			modifier = { 
				add = 15 
				has_trait = compassionate
			}
			modifier = { 
				add = 10 
				has_trait = diligent 
			}
			ai_value_modifier = {
				ai_zeal = 1
				ai_greed = 1
			}
		}
	}

	option = {
		name = az_examination.0018.c # “I hope I never end up like that.”

		add_character_modifier = {
			modifier = tgp_not_getting_any_younger_modifier
			years = 1
		}

		stress_impact = {
			base = minor_stress_impact_gain
			cynical = minor_stress_impact_loss
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			modifier = { 
				add = 15 
				has_trait = cynical 
			}
			modifier = { 
				add = -15 
				has_trait = humble 
			}
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_greed = 1
			}
		}
	}

	option = {
		name = az_examination.0018.d # “You have my sympathy, Elder.”

		change_merit = minor_merit_gain

		stress_impact = {
			compassionate = minor_stress_impact_loss
			callous = minor_stress_impact_gain
		}

		ai_chance = {
			base = 30
			modifier = { 
				add = 15 
				has_trait = compassionate 
			}
			modifier = { 
				add = -15 
				has_trait = callous 
			}
			ai_value_modifier = {
				ai_sociability = 2
				ai_honor = 1
			}
		}
	}
}

# Family is disappointed
az_examination.0019 = {
	type = activity_event
	title = az_examination.0019.t
	desc = {
		desc = az_examination.0019.desc.intro
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:disappointed_relative = {
						has_trait = wrathful
						dislikes_character_trigger = { CHARACTER = root }
						age > root.age
					}
				}
				desc = az_examination.0019.desc.wrathful
			}
			triggered_desc = {
				trigger = {
					scope:disappointed_relative = {
						has_trait = callous
						dislikes_character_trigger = { CHARACTER = root }
						age > root.age
					}
				}
				desc = az_examination.0019.desc.callous
			}
			triggered_desc = {
				trigger = {
					scope:disappointed_relative = {
						has_trait = shy
						likes_character_trigger = { CHARACTER = root }
					}
				}
				desc = az_examination.0019.desc.shy
			}
			triggered_desc = {
				trigger = {
					scope:disappointed_relative = {
						has_trait = compassionate
						likes_character_trigger = { CHARACTER = root }
					}
				}
				desc = az_examination.0019.desc.compassionate
			}
			desc = az_examination.0019.desc.fallback
		}
	}

	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = imperial_exam_taker_intent
		NOT = { is_in_guest_subset = { name = palace_entrants } }
		scope:activity = {
			any_attending_character = {
				is_physically_able_ai_adult = yes
				OR = {
					is_spouse_of = root
					is_close_family_of = root
				}
				NOT = { this = root }
			}
		}
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_physically_able_ai_adult = yes
					OR = {
						is_spouse_of = root
						is_close_family_of = root
					}
					NOT = { this = root }
				}
				save_scope_as = disappointed_relative
			}
		}
	}

	left_portrait = {
		character = root
		animation = sadness
		camera = camera_event_center_pointing_right
	}

	center_portrait = {
		character = scope:disappointed_relative
		triggered_animation = {
			trigger = {
				has_trait = wrathful
				dislikes_character_trigger = { CHARACTER = root }
				age > root.age
			}
			animation = anger
		}
		triggered_animation = {
			trigger = { 
				has_trait = callous 
				dislikes_character_trigger = { CHARACTER = root }
				age > root.age
			}
			animation = disapproval
		}
		triggered_animation = {
			trigger = { 
				has_trait = shy 
				NOT = {
					dislikes_character_trigger = { CHARACTER = root }
				}
			}
			animation = shame
		}
		triggered_animation = {
			trigger = { 
				has_trait = compassionate 
				NOT = {
					dislikes_character_trigger = { CHARACTER = root }
				}
			}
			animation = disappointed
		}
		animation = sadness
		camera = camera_event_center_pointing_left
	}

	option = {
		name = az_examination.0019.a # "I’ll try again. I swear it."
        add_character_modifier = {
            modifier = tgp_brooding_reflection_modifier
            years = 3
        }
		scope:disappointed_relative = {
			add_opinion = {
				target = root
				modifier = proud_opinion
				opinion = 15
			}
		}
        stress_impact = {
            base = medium_stress_gain
            shy = major_stress_impact_loss
            reclusive = major_stress_impact_loss
            callous = major_stress_impact_loss
            gregarious = minor_stress_impact_gain
        }

		ai_chance = {
			base = 40
			modifier = { 
				add = 20 
				has_trait = ambitious 
			}
			modifier = { 
				add = 20 
				has_trait = humble
			}
			modifier = { 
				add = -15 
				has_trait = cynical 
			}
			ai_value_modifier = {
				ai_zeal = 2
				ai_honor = 1
			}
		}
	}

	option = {
		name = az_examination.0019.c # "I can’t face them right now…"

		scope:disappointed_relative = {
			add_opinion = {
				target = root
				modifier = upset_opinion
				opinion = -5
			}
		}

		ai_chance = {
			base = 20
			modifier = { 
				add = 20 
				has_trait = shy 
			}
			modifier = { 
				add = 20 
				has_trait = reclusive 
			}
			modifier = { 
				add = 20 
				has_trait = callous 
			}
			modifier = { 
				add = -10 
				has_trait = gregarious 
			}
			ai_value_modifier = {
				ai_sociability = -1
			}
		}
	}
}

# You find a colleague who has passed while you didn't
az_examination.0020 = {
	type = activity_event
	title = az_examination.0020.t
	desc  = az_examination.0020.desc

	theme = imperial_examination
	cooldown = { months = 6 }

	trigger = {
		has_activity_intent = imperial_exam_taker_intent
		NOT = { is_in_guest_subset = { name = palace_entrants } }
		scope:activity = {
			any_guest_subset = {
				name = palace_entrants
				is_physically_able_ai_adult = yes
				NOR = {
					is_spouse_of = root
					is_close_family_of = root
				}
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset = {
				name = palace_entrants
				limit = {
					is_physically_able_ai_adult = yes
					NOR = {
						is_spouse_of = root
						is_close_family_of = root
					}
				}
				save_scope_as = successful_peer
			}
		}
	}

	left_portrait = {
		character = root
		animation = interested
		camera = camera_event_center_pointing_right
	}

	center_portrait = {
		character = scope:successful_peer
		animation = happiness
		camera = camera_event_center_pointing_left
	}

	option = {
		name = az_examination.0020.a # "You’ve earned this. Truly."

		add_diplomacy_lifestyle_xp = minor_lifestyle_xp

		progress_towards_friend_effect = {
			CHARACTER = scope:successful_peer
			REASON = friend_paid_compliment
			OPINION = 20
		}

		stress_impact = {
			arrogant = minor_stress_impact_gain
			humble = minor_stress_impact_loss
		}

		ai_chance = {
			base = 40
			modifier = { 
				add = 15 
				has_trait = humble 
			}
			modifier = { 
				add = -10 
				has_trait = arrogant 
			}
			ai_value_modifier = {
				ai_sociability = 1
				ai_honor = 1
			}
		}
	}

	option = {
		name = az_examination.0020.b # "I’ll turn this bitterness into purpose."

		add_character_modifier = {
			modifier = tgp_envy_fueled_study_modifier
			years = 5
		}

		stress_impact = {
			base = medium_stress_impact_gain
			diligent = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 30
			modifier = { 
				add = 20 
				has_trait = diligent 
			}
			modifier = { 
				add = -15 
				has_trait = content 
			}
			ai_value_modifier = {
				ai_zeal = 2
				ai_greed = 1
			}
		}
	}

	option = {
		name = az_examination.0020.c # "It should’ve been me..."

		add_prestige = minor_prestige_gain

		scope:successful_peer = {
			add_opinion = {
				target = root
				modifier = insulted_opinion
				opinion = -15
			}
		}

		stress_impact = {
			greedy = minor_stress_impact_loss
			just = minor_stress_impact_gain
		}

		ai_chance = {
			base = 20
			modifier = { 
				add = 20 
				has_trait = greedy
			}
			modifier = { 
				add = -20
				has_trait = just 
			}
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_greed = 2
			}
		}
	}
}
