namespace = legend_spread_events

############################
## Legend Spread Events
## & Buying Into A Legend Events
## 5000-5999
## by Nick Meredith
############################

# You attempt to spread a rumour that the ancient peoples founded your capital city
legend_spread_events.5000 = {
	type = character_event
	title = legend_spread_events.5000.t
	desc = legend_spread_events.5000.desc
	theme = legend
	override_background = { reference = alley_day }
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:chronicler
		animation = thinking
	}
	cooldown = { years = 20 }
	
	trigger = {
		promoted_legend ?= {
			has_legend_chronicle = ancient_people
			legend_protagonist = root
		}
		capital_province = {
			province_owner = root
			culture = root.culture
		}
		location = capital_province
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		capital_province = {
			save_scope_as = capital
		}
		culture = {
			save_scope_as = culture
		}
		save_scope_as = root_scope
	}
	
	option = { #The architecture of the oldest buildings PROVES it was them!
		name = legend_spread_events.5000.a

		trigger = {
			OR = {
				has_trait = scholar
				has_trait = architect
			}
		}

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		every_vassal = {
			vassal_stance = parochial
			custom = every_parochial_vassal
			add_opinion = {
				modifier = respect_opinion
				opinion = 15
				target = root
			}
		}

		stress_impact = {
			diligent = miniscule_stress_impact_loss
			lazy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = lazy
			}
		}
	}
	
	option = { #They _must_ have founded it!
		name = legend_spread_events.5000.b

		duel = {
			skill = diplomacy
			value = high_skill_rating
			50 = { #People are convinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5000.b.tt.success
				send_interface_toast = {
					title = legend_spread_events.5000.b.tt.success
					left_icon = root
					right_icon = scope:chronicler
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
				}
			}
			
			50 = { # People are unconvinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5000.b.tt.failure
				send_interface_toast = {
					title = legend_spread_events.5000.b.tt.failure
					left_icon = root
					right_icon = scope:chronicler

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}
				}
			}
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
			diligent = miniscule_stress_impact_loss
			lazy = minor_stress_impact_gain
			stubborn = miniscule_stress_impact_loss
			fickle = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = arrogant
					has_trait = lazy
					has_trait = fickle
				}
			}
		}
	}

	option = { #Re-use the masonry
		name = legend_spread_events.5000.c

		promoted_legend = {
			add_legend_county_modifier = {
				modifier = legend_edifices_enduring
			}
		}
	
		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
		}
	}

	
	option = { #Maybe that's a bit of a stretch
		name = legend_spread_events.5000.d

		add_character_modifier = {
			modifier = legend_character_culture_builders
			years = 15
		}

		scope:capital = {
			add_province_modifier = {
				modifier = legend_county_culture_builders
				years = 15
			}
		}
	
		stress_impact = {
			ambitious = medium_stress_impact_gain
			content = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = ambitious
			}
			modifier = {
				factor = 2
				has_trait = content
			}
		}
	}
}

# Your parent claims you fasted on holy days as a baby
legend_spread_events.5005 = {
	type = character_event
	title = legend_spread_events.5005.t
	desc = {
		desc = legend_spread_events.5005.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:parent = {
						this = scope:chronicler
					}
				}
				desc = legend_spread_events.5005.parent_chronicler
			}
			triggered_desc = {
				trigger = {
					NOT = {
						scope:parent = {
							this = scope:chronicler
						}
					}
				}
				desc = legend_spread_events.5005.regular
			}
		}
	}
	theme = legend
	override_background = { reference = temple }
	left_portrait = {
		character = root
		animation = love
	}
	right_portrait = {
		character = scope:parent
		animation = ecstasy
	}
	lower_center_portrait = {
		trigger = {
			NOT = {
				scope:chronicler = {
					this = scope:parent
				}
			}
		}
		character = scope:chronicler
	}
	cooldown = { years = 20 }
	
	trigger = {
		promoted_legend ?= { 
			legend_type = legend_type:holy
			legend_protagonist = root
		}
		any_parent = {
			is_alive = yes
			opinion = {
				target = root
				value >= low_positive_opinion
			}
			save_temporary_scope_as = parent
		}
		faith = { trait_is_virtue = temperate }
		any_courtier = {
			NOR = {
				this = root 
				this = scope:parent
			}
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		save_scope_as = root_scope
		grab_appropriate_chronicler_effect = yes
		random_parent = {
			limit = {
				is_alive = yes
				opinion = {
					target = root
					value >= low_positive_opinion
				}
			}
			save_scope_as = parent
		}
	}
	
	option = { #Mother please, you're embarrassing me
		name = legend_spread_events.5005.a

		trigger = {
			OR = {
				has_trait = humble
				has_trait = shy
			}
			NOT = {
				has_trait = arrogant
			}
		}

		add_character_modifier = {
			modifier = legend_humble_king
			years = 25
		}

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = pleased_opinion
				opinion = 25
				target = root
			}
		}

		stress_impact = {
			diligent = minor_stress_impact_gain
			lazy = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = diligent
			}
		}
	}
	
	option = { #Clearly I am a holy person!
		name = legend_spread_events.5005.b

		flavor = legend_spread_events.5005.b.tt

		add_piety = medium_piety_gain

		promoted_legend = {
			change_legend_quality_effect = { VALUE = medium_legend_quality_increase }
		}

		stress_impact = {
			zealous = miniscule_stress_impact_loss
			cynical = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			temperate = miniscule_stress_impact_loss
			gluttonous = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = cynical
					has_trait = humble
					has_trait = gluttonous
				}
			}
		}
	}
	
	option = { #Enough about me. How are you, mother?
		name = legend_spread_events.5005.c

		add_character_modifier = {
			modifier = legend_mothers_boy
			years = 15
		}		

		reverse_add_opinion = {
			modifier = love_opinion
			target = scope:parent
			opinion = 50
		}
	
		stress_impact = {
			ambitious = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = ambitious
			}
		}
	}
}

# Attempt to heal the sick with your touch
legend_spread_events.5010 = {
	type = character_event
	title = legend_spread_events.5010.t
	desc = legend_spread_events.5010.desc
	theme = legend
	override_background = { reference = alley_day }
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:sick
		animation = sick_stomach
	}
	lower_center_portrait = {
		character = scope:chronicler
	}
	cooldown = { years = 20 }
	
	trigger = {
		promoted_legend ?= { 
			legend_type = legend_type:holy
			legend_protagonist = root
		}
		any_pool_character = {
			province = root.location
			is_ai = yes
			is_adult = yes
			has_trait = ill
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		random_pool_character = {
			province = root.location
			limit = {
				is_ai = yes
				is_adult = yes
				has_trait = ill
			}
			save_scope_as = sick
		}
		root.location = {
			if = {
				limit = {
					province_owner = root
				}
				save_scope_as = location
			}
		}
		save_scope_value_as = {
			name = illness_range
			value = {
				integer_range = {
					min = 1
					max = 15
				}
			}
		}
	}
	
	option = { #Persuade them to give to those less fortunate and acquire salvation that way
		name = legend_spread_events.5010.a

		trigger = {
			OR = {
				has_trait = arbitrary
				intrigue > 13
			}
		}

		flavor = legend_spread_events.5010.a.tt

		scope:location ?= {
			add_province_modifier = {
				modifier = legend_charitable_donations
				years = 15
			}
		}

		reverse_add_opinion = {
			modifier = respect_opinion
			target = scope:sick
			opinion = 5
		}

		stress_impact = {
			ambitious = medium_stress_impact_gain
			humble = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
			lazy = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = ambitious
			}
		}
	}
	
	option = { #Give it a go, I suppose
		name = legend_spread_events.5010.b

		random_list = {
			30 = { #The sick person is healed!
				desc = legend_spread_events.5010.b.criticalsuccess
				send_interface_toast = {
					title = legend_spread_events.5010.b.criticalsuccess
					left_icon = root
					right_icon = scope:sick

					scope:sick = {
						remove_trait = ill
					}
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = major_legend_quality_increase }
					}		
				}				
			}
			50 = { #They get placebo'd a little
				modifier = {
					add = scope:illness_range
				}
				desc = legend_spread_events.5010.b.success
				send_interface_toast = {
					title = legend_spread_events.5010.b.success
					left_icon = root
					right_icon = scope:sick

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
				}
			}
			20 = { #They see no change at all
				desc = legend_spread_events.5010.b.failure
				send_interface_toast = {
					title = legend_spread_events.5010.b.failure
					left_icon = root
					right_icon = scope:sick

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}
				}				
			}
		}

		stress_impact = {
			brave = miniscule_stress_impact_loss
			gregarious = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
			trusting = miniscule_stress_impact_loss
			paranoid = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_zeal = 0.5
			}
		}
	}
	
	option = { #You must seek healing elsewhere!
		name = legend_spread_events.5010.c

		scope:location ?= {
			add_province_modifier = {
				modifier = legend_sick_hospitals
				years = 25
			}
		}	

		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:sick
			opinion = -20
		}
	
		stress_impact = {
			ambitious = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = ambitious
			}
		}
	}
}

# You have a famous weapon that has killed many; or has it?
legend_spread_events.5015 = {
	type = character_event
	title = legend_spread_events.5015.t
	desc = legend_spread_events.5015.desc
	theme = legend
	override_background = { reference = armory }
	left_portrait = {
		character = root
		animation = marshal
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	artifact = {
		target = scope:artifact
		position = lower_center_portrait
	}
	cooldown = { years = 20 }
	
	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:legitimizing
			legend_protagonist = root
		}
		location = capital_province
		any_character_artifact = {
			artifact_slot_type = primary_armament
			artifact_owner = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		root.location = {
			save_scope_as = location
		}
		random_character_artifact = {
			limit = {
				artifact_slot_type = primary_armament
				artifact_owner = root
			}
			save_scope_as = artifact
		}
	}

	option = { #And it'll take the lives of many more!
		name = legend_spread_events.5015.a

		trigger = {
			OR = {
				has_trait = wrathful
				prowess > 13
			}
		}

		add_character_modifier = {
			modifier = legend_bloodthirsty_warrior
			years = 15
		}

		stress_impact = {
			calm = medium_stress_impact_gain
			wrathful = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = calm
			}
		}
	}
	
	option = { #Well you see, those are just the ones I remember...
		name = legend_spread_events.5015.b

		duel = {
			skills = { diplomacy martial }
			value = high_skill_rating

			50 = { #Sounds legit!
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5015.b.success
				send_interface_toast = {
					title = legend_spread_events.5015.b.success
					left_icon = root
					right_icon = scope:chronicler

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
				}
			}
			
			50 = { # People are unconvinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5015.b.failure
				send_interface_toast = {
					title = legend_spread_events.5015.b.failure
					left_icon = root
					right_icon = scope:chronicler

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}
				}
			}
		}

		stress_impact = {
			just = minor_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			deceitful = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
				ai_honor = -0.5
			}
		}
	}
	
	option = { #It's quite something innit?
		name = legend_spread_events.5015.c

		custom_tooltip = legend_spread_events.5015.c.tt

		hidden_effect = {
			random_list = {
				1 = {
					scope:artifact = {
						add_artifact_modifier = artifact_monthly_prestige_1_modifier
					}
				}
				1 = {
					scope:artifact = {
						add_artifact_modifier = artifact_knight_effectiveness_1_modifier
					}
				}
				1 = {
					scope:artifact = {
						add_artifact_modifier = artifact_controlled_province_advantage_1_modifier
					}
				}
				1 = {
					scope:artifact = {
						add_artifact_modifier = artifact_prowess_1_modifier
					}
				}
				1 = {
					scope:artifact = {
						add_artifact_modifier = artifact_negate_prowess_penalty_add_1_modifier
					}
				}
			}
		}

		reverse_add_opinion = {
			modifier = impressed_opinion
			target = scope:chronicler
			opinion = 20
		}
	
		stress_impact = {
			ambitious = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_honor = 0.5
			}
		}
	}
}

# You can pretend a mark on your hand is a stigmata
legend_spread_events.5020 = {
	type = character_event
	title = legend_spread_events.5020.t
	desc = legend_spread_events.5020.desc
	theme = legend
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = lantern
	}
	right_portrait = {
		character = scope:chronicler
		animation = shock
	}
	cooldown = { years = 20 }
	
	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:holy
			legend_protagonist = root
		}
		OR = { faith.religion = religion:eastern_orthodox_religion faith.religion = religion:catholic_religion faith.religion = religion:protestant_religion }
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		save_scope_as = root_scope
	}

	option = { #I also have one in my side!
		name = legend_spread_events.5020.a

		trigger = {
			has_trait = scarred
		}

		promoted_legend = {
			change_legend_quality_effect = { VALUE = medium_legend_quality_increase }
		}

		add_character_modifier = {
			modifier = legend_stigmatic
			years = 15
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = cynical
			}
		}
	}
	
	option = { #It does look rather interesting, doesn't it?
		name = legend_spread_events.5020.b

		add_character_modifier = {
			modifier = legend_claimed_stigmatic
			years = 20
		}

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = hate_opinion
				opinion = -40
				target = root
			}
		}

		stress_impact = {
			just = minor_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			honest = minor_stress_impact_gain
			deceitful = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
				ai_honor = -0.5
			}
		}
	}

	option = { #It's just an old mark
		name = legend_spread_events.5020.c

		add_piety = minor_piety_gain

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = trust_opinion
				opinion = 20
				target = root
			}
		}		

		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:chronicler
			opinion = -5
		}
	
		stress_impact = {
			base = minor_stress_impact_loss
			honest = miniscule_stress_impact_loss
			deceitful = minor_stress_impact_gain
			ambitious = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
				ai_honor = 0.5
			}
		}
	}
}

# Claim descent from ancient peoples by deciphering an old manuscript
legend_spread_events.5025 = {
	type = character_event
	title = legend_spread_events.5025.t
	desc = legend_spread_events.5025.desc
	theme = legend
	override_background = { reference = study }
	left_portrait = {
		character = root
		animation = chancellor
	}
	right_portrait = {
		character = scope:chronicler
		animation = thinking
	}
	cooldown = { years = 20 }
	
	trigger = {
		promoted_legend ?= {
			has_legend_chronicle = ancient_people
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { #Easy!
		name = legend_spread_events.5025.a

		trigger = {
			has_trait = scholar
		}

		show_as_unavailable = { always = yes }

		add_learning_lifestyle_xp = major_lifestyle_xp

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		reverse_add_opinion = {
			modifier = impressed_opinion
			target = scope:chronicler
			opinion = 30
		}

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = 1
			}
		}
	}
	
	option = { #Let's give it a go
		name = legend_spread_events.5025.b

		duel = {
			skill = learning
			value = medium_skill_rating
			50 = { # You decipher it
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5025.b.success
				send_interface_toast = {
					title = legend_spread_events.5025.b.success
					left_icon = root
					right_icon = scope:chronicler
			
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
				}
			}
			
			50 = { # You are nonplussed
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5025.b.failure
				send_interface_toast = {
					title = legend_spread_events.5025.b.failure
					left_icon = root
					right_icon = scope:chronicler

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}
				}
			}
		}

		stress_impact = {
			diligent = miniscule_stress_impact_loss
			lazy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = 0.5
			}
		}
	}

	option = { #There must be another way
		name = legend_spread_events.5025.c

		add_character_modifier = {
			modifier = ce1_forward_thinking
			years = 15
		}

		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:chronicler
			opinion = -5
		}
	
		stress_impact = {
			honest = miniscule_stress_impact_loss
			deceitful = minor_stress_impact_gain
			ambitious = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# Powerful vassal is impressed by your legend
legend_spread_events.5030 = {
	type = character_event
	title = legend_spread_events.5030.t
	desc = legend_spread_events.5030.desc
	theme = legend
	override_background = { reference = study }
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:vassal
		animation = thinking
	}
	lower_center_portrait = {
		character = scope:chronicler
	}
	cooldown = { years = 20 }
	
	trigger = {
		any_powerful_vassal = {
			opinion = {
				target = root
				value >= low_positive_opinion
			}
			age > 15
			save_temporary_scope_as = potential_promoter_temp
		}
		promoted_legend ?= {
			legend_type = legend_type:legitimizing
			legend_protagonist = root
			any_legend_promoter = {
				this != scope:potential_promoter_temp
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		random_powerful_vassal = {
			limit = {
				opinion = {
					target = root
					value >= low_positive_opinion
				}
				age > 15
			}
			save_scope_as = vassal
		}
	}

	option = { #I would be indebted to you if you were to help spread it, perhaps?
		name = legend_spread_events.5030.a

		trigger = {
			scope:vassal = {
				can_add_hook = {
					target = root
					type = favor_hook
				}
			}
		}

		promoted_legend = {
			change_legend_quality_effect = { VALUE = major_legend_quality_increase }
		}

		scope:vassal = {
			add_hook = {
				target = root
				type = favor_hook
			}
			set_promoted_legend = root.promoted_legend
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			trusting = miniscule_stress_impact_loss
			paranoid = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_sociability = 1
				ai_vengefulness = -1
			}
		}
	}
	
	option = { #That's great to hear!
		name = legend_spread_events.5030.b

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		stress_impact = {
			lazy = miniscule_stress_impact_loss
			diligent = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -0.5
			}
		}
	}

	option = { #It is excellent to have you here!
		name = legend_spread_events.5030.c

		progress_towards_friend_effect = {
			REASON = friend_legend_agreement
			CHARACTER = scope:vassal
			OPINION = 35
		}

		stress_impact = {
			gregarious = miniscule_stress_impact_loss
			shy = minor_stress_impact_gain
			ambitious = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_compassion = 1
			}
		}
	}
}

# The chronicler rushes to you with documents disputing your lineage
legend_spread_events.5035 = {
	type = character_event
	title = legend_spread_events.5035.t
	desc = legend_spread_events.5035.desc
	theme = legend
	override_background = { reference = sitting_room }
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:chronicler
		animation = fear
	}
	cooldown = { years = 20 }
	
	trigger = {
		is_available_adult = yes
		promoted_legend ?= {
			legend_type = legend_type:legitimizing
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # Burn the documents, threaten the chronicler
		name = legend_spread_events.5035.a

		trigger = {
			OR = {
				has_trait = sadistic
				has_trait = callous
				has_trait = wrathful
				has_trait = ambitious
				has_trait = arbitrary
				has_trait = torturer
				dread > 50
			}
		}

		flavor = legend_spread_events.5035.a.tt

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		add_dread = medium_dread_gain

		reverse_add_opinion = {
			modifier = scared_opinion
			target = scope:chronicler
			opinion = -40
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			paranoid = miniscule_stress_impact_loss
			trusting = minor_stress_impact_gain
			sadistic = miniscule_stress_impact_loss
			compassionate = major_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = -1
				ai_vengefulness = 1
			}
		}
	}
	
	option = { # Nonsense, look, that's my father's name right there!
		name = legend_spread_events.5035.b

		duel = {
			skill = diplomacy
			value = high_skill_rating
			50 = { # Oh yeah!
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5035.b.success
				send_interface_toast = {
					title = legend_spread_events.5035.b.success
					left_icon = root
					right_icon = scope:chronicler

					promoted_legend = {
						change_legend_quality_effect = {
							VALUE = minor_legend_quality_increase
						}
					}
				}
			}
			
			50 = { # What? No it isn't
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5035.b.failure
				send_interface_toast = {
					title = legend_spread_events.5035.b.failure
					left_icon = root
					right_icon = scope:chronicler

					promoted_legend = {
						change_legend_quality_effect = {
							VALUE = minor_legend_quality_decrease
						}
					}
				}
			}
		}

		stress_impact = {
			arbitrary = miniscule_stress_impact_loss
			just = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			deceitful = miniscule_stress_impact_loss
			honest = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -0.5
				ai_honor = -0.5
			}
		}
	}

	option = { # Let's try to keep this one quiet, shall we?
		name = legend_spread_events.5035.c

		duel = {
			skill = intrigue
			value = medium_skill_rating
			50 = { # The secret stays secret
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5035.c.success
				send_interface_toast = {
					title = legend_spread_events.5035.c.success
					left_icon = root
					right_icon = scope:chronicler
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = medium_legend_quality_increase }
					}

					scope:chronicler = {
						add_hook = {
							target = root
							type = indebted_hook
						}
					}
				}
			}
			
			50 = { # The secret gets out
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5035.c.failure
				send_interface_toast = {
					title = legend_spread_events.5035.c.failure
					left_icon = root
					right_icon = scope:chronicler
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}
				}
			}
		}

		stress_impact = {
			lazy = miniscule_stress_impact_loss
			diligent = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -0.5
			}
		}
	}

	option = { # Ah. Well, let's see if we can find other ones, shall we?
		name = legend_spread_events.5035.d

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

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -0.5
			}
		}
	}
}

# You sit down with your chronicler to fill in some missing entries in the family tree
legend_spread_events.5040 = {
	type = character_event
	title = legend_spread_events.5040.t
	desc = legend_spread_events.5040.desc
	theme = legend
	override_background = { reference = sitting_room }
	left_portrait = {
		character = root
		animation = boredom
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }
	
	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:legitimizing
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes

		random_parent = {
			limit = {	
				is_alive = yes
				is_available_ai_adult = yes
			}
			save_scope_as = parent
		}

		set_up_regional_mythical_creature_effect = yes
	}

	option = { # You successfully lie your ass off
		name = legend_spread_events.5040.a

		trigger = {
			OR = {
				has_trait = deceitful
				has_trait = schemer
				intrigue > 20
			}
		}

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		stress_impact = {
			deceitful = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			just = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -1
				ai_rationality = 1
			}
		}
	}
	
	option = { # You ask a parent for help
		name = legend_spread_events.5040.b

		trigger = {
			scope:parent ?= {
				is_alive = yes
			}
		}

		add_internal_flag = special

		promoted_legend = {
			change_legend_quality_effect = { VALUE = medium_legend_quality_increase }
		}

		stress_impact = {
			compassionate = miniscule_stress_impact_loss
			callous = minor_stress_impact_gain
			trusting = miniscule_stress_impact_loss
			paranoid = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_sociability = -1
			}
		}
	}

	option = { # Attempt to make it up
		name = legend_spread_events.5040.a #Re-used on purpose

		trigger = {
			NOR = {
				has_trait = deceitful
				has_trait = schemer
				intrigue > 20
			}			
		}

		duel = {
			skills = { intrigue diplomacy }
			value = high_skill_rating
			50 = { # It looks like it all adds up
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5040.c.success
				send_interface_toast = {
					title = legend_spread_events.5040.c.success
					left_icon = root
					right_icon = scope:chronicler
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
				}
			}
			
			50 = { # Your family tree makes no sense
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5040.c.failure
				send_interface_toast = {
					title = legend_spread_events.5040.c.failure
					left_icon = root
					right_icon = scope:chronicler
								
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}
				}
			}
		}

		stress_impact = {
			deceitful = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			just = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -0.5
			}
		}
	}

	option = { # Oh my god, I don't care!
		name = legend_spread_events.5040.d

		random_list = {
			1 = {
				desc = legend_spread_events.5040.d.success
				add_prestige = minor_prestige_gain
			}
			1 = {
				desc = legend_spread_events.5040.d.failure
				add_prestige = minor_prestige_loss
			}
		}

		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:chronicler
			opinion = -15
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			irritable = major_stress_impact_loss
			lazy = miniscule_stress_impact_loss
			diligent = minor_stress_impact_gain
			content = miniscule_stress_impact_loss
			ambitious = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_energy = -0.5
			}
		}
	}

	after = {
		if = {
			limit = { exists = var:trinket_adjective_followup }
			remove_variable = trinket_adjective_followup
		}
	}
}

# You try to get your name in the khutbah
legend_spread_events.5045 = {
	type = character_event
	title = legend_spread_events.5045.t
	desc = legend_spread_events.5045.desc
	theme = legend
	override_background = { reference = temple }
	left_portrait = {
		character = root
		animation = scheme
	}
	right_portrait = {
		character = scope:imam
		animation = dismissal
	}
	lower_center_portrait = {
		character = scope:chronicler
	}
	cooldown = { years = 20 }
	
	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:holy
			legend_protagonist = root
		}
		OR = {
			cp:councillor_court_chaplain = {
				is_available_ai_adult = yes
				faith.religion = religion:islam_religion
			}
			any_court_position_holder = {
				type = camp_priest_camp_officer
				is_available_ai_adult = yes
				faith.religion = religion:islam_religion
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
		faith.religion = religion:islam_religion
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes

		cp:councillor_court_chaplain ?= {
			save_scope_as = imam
		}
		if = {
			limit = {
				NOT = { exists = scope:imam }
			}
			random_court_position_holder = {
				type = camp_priest_camp_officer
				save_scope_as = imam
			}
		}

		capital_province = {
			save_scope_as = capital
		}
	}

	option = { # Perhaps I can owe you a favour?
		name = legend_spread_events.5045.a

		trigger = {
			scope:imam = {
				can_add_hook = {
					target = root
					type = favor_hook
				}
			}
		}

		promoted_legend = {
			change_legend_quality_effect = { VALUE = medium_legend_quality_increase }
		}

		scope:imam = {
			add_hook = {
				target = root
				type = favor_hook
			}
		}

		reverse_add_opinion = {
			modifier = pleased_opinion
			target = scope:imam
			opinion = 20
		}

		stress_impact = {
			trusting = miniscule_stress_impact_loss
			paranoid = medium_stress_impact_gain
			zealous = miniscule_stress_impact_loss
			cynical = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = -1
			}
		}
	}
	
	option = { # Bribe him, maybe?
		name = legend_spread_events.5045.b

		duel = {
			skill = diplomacy
			target = scope:imam
			65 = { # He acquiesces
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5045.b.success

				# If he's not a very holy fella, he'll prioritise keeping his liege happy
				modifier = {
					add = 15
					scope:imam = {
						has_trait = cynical
					}
				}

				send_interface_toast = {
					title = legend_spread_events.5045.b.success
					left_icon = root
					right_icon = scope:imam

					pay_short_term_gold = {
						target = scope:imam
						gold = minor_gold_value
					}

					promoted_legend = {
						change_legend_quality_effect = { VALUE = medium_legend_quality_increase }
					}
				}
			}
			
			35 = { # He is not impressed
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5045.b.failure

				# If he's a holy fella, he'll listen to the hadith on rashwah
				modifier = {
					add = 50
					scope:imam = {
						has_trait = zealous
					}
				}

				send_interface_toast = {
					title = legend_spread_events.5045.b.failure
					left_icon = root
					right_icon = scope:imam

					reverse_add_opinion = {
						modifier = angry_opinion
						target = scope:imam
						opinion = -40
					}
				}
			}
		}

		stress_impact = {
			cynical = miniscule_stress_impact_loss
			zealous = minor_stress_impact_gain
			trusting = miniscule_stress_impact_loss
			paranoid = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_sociability = -1
			}
		}
	}

	option = { # Persuade him
		name = legend_spread_events.5045.c

		duel = {
			skill = diplomacy
			target = scope:imam

			50 = { # He sees your value
				desc = legend_spread_events.5045.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				# He likes ya
				modifier = {
					add = 5
					scope:imam = {
						opinion = {
							target = root
							value >= low_positive_opinion
						}
					}
				}

				# He likes ya a lot
				modifier = {
					add = 15
					scope:imam = {
						opinion = {
							target = root
							value >= high_positive_opinion
						}
					}
				}

				send_interface_toast = {
					title = legend_spread_events.5045.c.success
					left_icon = root
					right_icon = scope:imam
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
				}
			}
			
			50 = { # He is not impressed
				desc = legend_spread_events.5045.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5045.c.failure
					left_icon = root
					right_icon = scope:imam
					
					reverse_add_opinion = {
						modifier = dismissive_opinion
						target = scope:imam
						opinion = -15
					}
				}
			}
		}

		stress_impact = {
			diligent = miniscule_stress_impact_loss
			lazy = medium_stress_impact_gain
			stubborn = miniscule_stress_impact_loss
			fickle = minor_stress_impact_gain
			gregarious = miniscule_stress_impact_loss
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_sociability = 1
				ai_energy = 1
			}
		}
	}

	option = { # Bah, never mind
		name = legend_spread_events.5045.d

		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:chronicler
			opinion = -10
		}

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

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
			}
		}
	}
}

# Make an entry in the style of your ancestors?
legend_spread_events.5050 = {
	type = character_event
	title = legend_spread_events.5050.t
	desc = legend_spread_events.5050.desc
	theme = legend
	override_background = { reference = relaxing_room }
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = admiration
	}
	lower_center_portrait = {
		character = scope:jeweller
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:legitimizing
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
		any_pool_character = {
			province = root.capital_province
			is_ai = yes
			is_adult = yes
		}
		location = capital_province
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		random_pool_character = {
			province = root.capital_province
			limit = {
				is_ai = yes
				is_adult = yes
			}
			save_scope_as = jeweller
		}
		capital_province = {
			save_scope_as = capital
		}
		save_scope_as = root_scope
	}

	option = { # Bedeck me in the very finest!
		name = legend_spread_events.5050.a

		trigger = {
			OR = {
				has_trait = profligate
				has_trait = arrogant
			}
		}

		remove_short_term_gold = major_gold_value

		save_scope_as = owner # This is needed for the crown artifact just below

		create_artifact = {
			name = artifact_magnificent_crown_name
			description = artifact_magnificent_crown_description
			template = crown_wearable_template
			wealth = 120
			quality = 120
			creator = scope:jeweller
			type = helmet_simple
			visuals = crown
			modifier = artifact_monthly_minor_prestige_3_modifier
			modifier = artifact_courtly_vassal_opinion_3_modifier
			modifier = artifact_legend_spread_mult_10_modifier
			modifier = artifact_dynasty_opinion_6_modifier
			modifier = artifact_monthly_dynasty_prestige_1_modifier
			save_scope_as = artifact
		}

		every_vassal = {
			vassal_stance = courtly
			custom = every_courtly_vassal
			add_opinion = {
				modifier = respect_opinion
				opinion = 15
				target = root
			}
		}

		stress_impact = {
			profligate = medium_stress_impact_loss
			generous = miniscule_stress_impact_loss
			greedy = major_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
				ai_greed = -1
			}
		}
	}
	
	option = { # All right, gimme something nice
		name = legend_spread_events.5050.b

		remove_short_term_gold = medium_gold_value

		create_artifact = {
			name = artifact_splendid_necklace_name
			description = artifact_splendid_necklace_description
			wealth = 80
			quality = 80
			creator = scope:jeweller
			type = miscellaneous
			visuals = necklace
			modifier = artifact_monthly_minor_prestige_2_modifier
			modifier = artifact_courtly_vassal_opinion_2_modifier
			modifier = artifact_legend_spread_mult_6_modifier
			modifier = artifact_dynasty_opinion_3_modifier
			save_scope_as = artifact
		}

		every_vassal = {
			vassal_stance = courtly
			custom = every_courtly_vassal
			add_opinion = {
				modifier = respect_opinion
				opinion = 5
				target = root
			}
		}

		stress_impact = {
			profligate = minor_stress_impact_loss
			generous = miniscule_stress_impact_loss
			greedy = medium_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_greed = -0.5
			}
		}
	}

	option = { # A small brooch will do
		name = legend_spread_events.5050.c

		remove_short_term_gold = minor_gold_value

		create_artifact = {
			name = artifact_fine_brooch_name
			description = artifact_fine_brooch_description
			wealth = 50
			quality = 50
			creator = scope:jeweller
			type = miscellaneous
			visuals = brooch
			modifier = artifact_monthly_minor_prestige_1_modifier
			modifier = artifact_courtly_vassal_opinion_1_modifier
			modifier = artifact_legend_spread_mult_3_modifier
			modifier = artifact_dynasty_opinion_1_modifier
			save_scope_as = artifact
		}

		stress_impact = {
			profligate = miniscule_stress_impact_loss
			greedy = minor_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = -0.5
			}
		}
	}

	option = { # There's no need for this
		name = legend_spread_events.5050.d

		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:chronicler
			opinion = -15
		}

		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:jeweller
			opinion = -5
		}

		stress_impact = {
			profligate = medium_stress_impact_gain
			generous = medium_stress_impact_gain
			greedy = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -0.5
				ai_greed = 1
			}
		}
	}
}

# Choose to dress like one of your vassals' cultures
# Nothing is more legit than a king who wears your threads!
legend_spread_events.5055 = {
	type = character_event
	title = legend_spread_events.5055.t
	desc = legend_spread_events.5055.desc
	theme = legend
	override_background = { reference = relaxing_room }
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:chronicler
		animation = worry
	}
	lower_left_portrait = {
		character = scope:vassal1
	}
	lower_right_portrait = {
		character = scope:vassal2
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:legitimizing
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
		any_vassal = { #Requires a vassal who is part of your culture
			is_ai = yes
			is_adult = yes
			culture = root.culture
			trigger_if = {
				limit = {
					root.highest_held_title_tier >= tier_empire
				}
				highest_held_title_tier >= tier_duchy
			}
			trigger_else = {
				highest_held_title_tier >= tier_county
			}
		}
		any_vassal = { #And one who isn't
			is_ai = yes
			is_adult = yes
			culture != root.culture
			culture = {
				save_temporary_scope_as = other_culture
			}
			#Should have at least two vassals of culture
			root = {
				any_vassal = {
					count >= 2
					culture = scope:other_culture
				}
			}
			trigger_if = {
				limit = {
					root.highest_held_title_tier >= tier_empire
				}
				highest_held_title_tier >= tier_duchy
			}
			trigger_else = {
				highest_held_title_tier >= tier_county
			}
		}
		location = capital_province
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		random_vassal = { #Requires a vassal who is part of your culture
			limit = {
				is_ai = yes
				is_adult = yes
				culture = root.culture
				trigger_if = {
					limit = {
						root.highest_held_title_tier = tier_empire
					}
					highest_held_title_tier >= tier_duchy
				}
				trigger_else = {
					highest_held_title_tier >= tier_county
				}
			}
			save_scope_as = vassal1
		}
		random_vassal = { #And one who isn't
			limit = {
				is_ai = yes
				is_adult = yes
				culture != root.culture
				culture = {
					save_temporary_scope_as = other_culture
				}
				#Should have at least two vassals of culture
				root = {
					any_vassal = {
						count >= 2
						culture = scope:other_culture
					}
				}
				trigger_if = {
					limit = {
						root.highest_held_title_tier = tier_empire
					}
					highest_held_title_tier >= tier_duchy
				}
				trigger_else = {
					highest_held_title_tier >= tier_county
				}
			}
			save_scope_as = vassal2
		}
		capital_province = {
			save_scope_as = capital
		}
	}

	option = { # Perhaps I can please both sides?
		name = legend_spread_events.5055.a

		trigger = {
			OR = {
				has_trait = shrewd
				has_trait = education_diplomacy_4
				has_trait = education_diplomacy_5
				has_trait = diplomat
			}
		}

		flavor = legend_spread_events.5055.a.tt

		add_character_modifier = {
			modifier = legend_culturally_sensitive
			years = 20
		}

		scope:vassal1 = {
			set_promoted_legend = root.promoted_legend
			add_opinion = {
				modifier = pleased_opinion
				opinion = 25
				target = root
			}
		}

		scope:vassal2 = {
			set_promoted_legend = root.promoted_legend
			add_opinion = {
				modifier = pleased_opinion
				opinion = 25
				target = root
			}
		}

		every_vassal = {
			limit = { 
				OR = {
					culture = root.culture
					culture = scope:vassal2.culture
				}
			}
			custom = 5055_every_culture_vassal
			add_opinion = {
				modifier = respect_opinion
				opinion = 15
				target = root
			}
		}

		stress_impact = {
			compassionate = miniscule_stress_impact_loss
			callous = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
			just = miniscule_stress_impact_loss
			arbitrary = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 1
				ai_sociability = 1
			}
		}
	}
	
	option = { # I shall represent my people!
		name = legend_spread_events.5055.b

		scope:vassal1 = {
			set_promoted_legend = root.promoted_legend
		}

		every_vassal = {
			limit = { 
				culture = root.culture
			}
			custom = 5055_vassal1_culture
			add_opinion = {
				modifier = respect_opinion
				opinion = 15
				target = root
			}
		}

		reverse_add_opinion = {
			modifier = angry_opinion
			target = scope:vassal2
			opinion = -25
		}

		stress_impact = {
			compassionate = minor_stress_impact_gain
			callous = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			just = minor_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_sociability = -0.5
			}
		}
	}

	option = { # Vassal 2's people need to feel represented by me too
		name = legend_spread_events.5055.c

		scope:vassal2 = {
			set_promoted_legend = root.promoted_legend
		}

		every_vassal = {
			custom = 5055_vassal2_culture
			limit = { 
				culture = scope:vassal2.culture
			}
			add_opinion = {
				modifier = respect_opinion
				opinion = 15
				target = root
			}
		}

		reverse_add_opinion = {
			modifier = angry_opinion
			target = scope:vassal1
			opinion = -25
		}

		stress_impact = {
			compassionate = minor_stress_impact_gain
			callous = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			just = minor_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_sociability = -0.5
			}
		}
	}

	option = { # I should avoid making enemies
		name = legend_spread_events.5055.d

		flavor = legend_spread_events.5055.d.tt

		reverse_add_opinion = {
			modifier = pleased_opinion
			target = scope:vassal1
			opinion = 10
		}

		reverse_add_opinion = {
			modifier = pleased_opinion
			target = scope:vassal2
			opinion = 10
		}

		stress_impact = {
			compassionate = miniscule_stress_impact_loss
			callous = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -0.5
				ai_compassion = 0.5
			}
		}
	}
}

# You claim your blindness was due to being blinded by seeing God
legend_spread_events.5060 = {
	type = character_event
	title = legend_spread_events.5060.t
	desc = {
		desc = legend_spread_events.5060.opening
		desc = {
			triggered_desc = {
				trigger = {
					has_trait = one_eyed
				}
				desc = legend_spread_events.5060.one_eyed
			}
			triggered_desc = {
				trigger = {
					has_trait = blind
				}
				desc = legend_spread_events.5060.blind
			}
		}
		desc = legend_spread_events.5060.ending
	}

	theme = legend
	override_background = { reference = bp2_courtyard }
	left_portrait = {
		character = root
		animation = personality_zealous
	}
	right_portrait = {
		character = scope:chronicler
		animation = admiration
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:holy
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
		OR = {
			has_trait = blind
			has_trait = one_eyed
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		save_scope_as = root_scope
	}

	option = { # His glory struck me fully blind!
		name = legend_spread_events.5060.a

		trigger = {
			has_trait = blind
		}

		add_character_modifier = {
			modifier = legend_visions_of_god
			years = 15
		}

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = pious_opinion
				opinion = 50
				target = root
			}
		}

		stress_impact = {
			zealous = miniscule_stress_impact_loss
			cynical = major_stress_impact_gain
			deceitful = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			just = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = 1
			}
		}
	}
	
	option = { # He asked for a sacrifice of my eye, which I gladly gave!
		name = legend_spread_events.5060.b

		trigger = {
			has_trait = one_eyed
		}

		add_character_modifier = {
			modifier = legend_holy_sacrifice
			years = 15
		}

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = pious_opinion
				opinion = 35
				target = root
			}
		}

		stress_impact = {
			zealous = miniscule_stress_impact_loss
			cynical = major_stress_impact_gain
			deceitful = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			just = minor_stress_impact_gain
		}

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

	option = { # Losing my sight has humbled me in the eyes of god
		name = legend_spread_events.5060.c

		add_character_modifier = {
			modifier = legend_gods_humble_servant
			years = 15
		}

		stress_impact = {
			humble = miniscule_stress_impact_loss
			arrogant = medium_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 1
			}
		}
	}

	option = { # It's just an old malady
		name = legend_spread_events.5060.d

		flavor = legend_spread_events.5060.d.tt

		add_prestige = minor_prestige_value

		stress_impact = {
			base = minor_stress_impact_loss
			honest = medium_stress_impact_loss
			deceitful = medium_stress_impact_gain
			cynical = minor_stress_impact_loss
			zealous = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = -1
			}
		}
	}
}

# Lose weight to show holiness
legend_spread_events.5065 = {
	type = character_event
	title = legend_spread_events.5065.t
	desc = legend_spread_events.5065.desc

	theme = legend
	override_background = { reference = bp1_kitchen_western }
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:chronicler
		animation = thinking
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:holy
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
		faith = { trait_is_virtue = temperate }
		current_weight > -15
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes

		save_scope_as = root_scope
	}

	option = { # Bah, I am much happier like this!
		name = legend_spread_events.5065.a

		add_character_modifier = {
			modifier = legend_fat_and_happy
			years = 15
		}

		change_current_weight = 20

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = impious_opinion
				opinion = -15
				target = root
			}
		}

		stress_impact = {
			base = medium_stress_impact_loss
			zealous = major_stress_impact_gain
			cynical = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = -1
				ai_greed = 1
			}
		}
	}
	
	option = { # I will do better.
		name = legend_spread_events.5065.b

		change_current_weight = -20

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = pious_opinion
				opinion = 25
				target = root
			}
		}

		stress_impact = {
			zealous = miniscule_stress_impact_loss
			cynical = medium_stress_impact_gain
			gluttonous = medium_stress_impact_gain
			temperate = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = 1
				ai_greed = -1
			}
		}
	}

	option = { # A little bit here and there won't hurt, surely?
		name = legend_spread_events.5065.c

		add_character_modifier = {
			modifier = legend_sneaks_food
			years = 10
		}

		stress_impact = {
			gluttonous = miniscule_stress_impact_loss
			temperate = minor_stress_impact_gain
			deceitful = miniscule_stress_impact_loss
			honest = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = -0.5
				ai_greed = 0.5
			}
		}
	}
}

# You consider dressing in the style of ancestors
legend_spread_events.5070 = {
	type = character_event
	title = legend_spread_events.5070.t
	desc = legend_spread_events.5070.desc

	theme = legend
	override_background = { reference = throne_room }
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = ecstasy
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:legitimizing
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes

		culture = {
			save_scope_as = culture
		}
		save_scope_as = root_scope
	}

	option = { # I shall dress myself as the first of my culture did!
		name = legend_spread_events.5070.a

		remove_short_term_gold = minor_gold_value

		duel = {
			skill = diplomacy
			value = high_skill_rating
			50 = { #People are convinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5070.a.success
				send_interface_toast = {
					title = legend_spread_events.5070.a.success
					left_icon = root
					right_icon = scope:chronicler
					
					add_character_modifier = {
						modifier = legend_historical_bedecking
						years = 15
					}

					every_vassal = {
						limit = { 
							culture = root.culture 
						}
						custom = every_culture_vassal
						add_opinion = {
							modifier = impressed_opinion
							opinion = 20
							target = root
						}
					}
				}
			}
			
			50 = { # People are unconvinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5070.a.failure
				send_interface_toast = {
					title = legend_spread_events.5070.a.failure
					left_icon = root
					right_icon = scope:chronicler
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}
				}
			}
		}

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
				ai_boldness = 1
			}
		}
	}
	
	option = { # Maybe just a few?
		name = legend_spread_events.5070.b

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		stress_impact = {
			fickle = miniscule_stress_impact_loss
			stubborn = minor_stress_impact_gain
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}

	option = { # I won't defer to the past
		name = legend_spread_events.5070.c

		add_character_modifier = {
			modifier = legend_modern_ruler
			years = 15
		}

		stress_impact = {
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
			content = miniscule_stress_impact_loss
			ambitious = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -0.5
			}
		}
	}
}

# You notice an imam has a prayer callus
legend_spread_events.5075 = {
	type = character_event
	title = legend_spread_events.5075.t
	desc = legend_spread_events.5075.desc

	theme = legend
	override_background = { reference = corridor_day }
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = ecstasy
	}
	lower_center_portrait = {
		character = scope:imam
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_type = legend_type:holy
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
		OR = {
			cp:councillor_court_chaplain = {
				is_available_ai_adult = yes
				faith.religion = religion:islam_religion
			}
			any_court_position_holder = {
				type = camp_priest_camp_officer
				is_available_ai_adult = yes
				faith.religion = religion:islam_religion
			}
		}
		faith.religion = religion:islam_religion
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes

		cp:councillor_court_chaplain ?= {
			save_scope_as = imam
		}
		if = {
			limit = {
				NOT = { exists = scope:imam }
			}
			random_court_position_holder = {
				type = camp_priest_camp_officer
				save_scope_as = imam
			}
		}

		save_scope_as = root_scope
	}

	option = { # Try and trick everyone
		name = legend_spread_events.5075.a

		trigger = {
			has_trait = deceitful
		}

		duel = {
			skill = intrigue
			value = high_skill_rating
			50 = { #It works
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5075.a.success
				send_interface_toast = {
					title = legend_spread_events.5075.a.success
					left_icon = root
					right_icon = scope:chronicler
					
					add_character_modifier = {
						modifier = legend_prayer_callus
						years = 15
					}

					every_vassal = {
						vassal_stance = zealot
						custom = every_zealot_vassal
						add_opinion = {
							modifier = pious_opinion
							opinion = 15
							target = root
						}
					}
				}
			}
			
			50 = { # It does not work
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5075.a.failure
				send_interface_toast = {
					title = legend_spread_events.5075.a.failure
					left_icon = root
					right_icon = scope:chronicler
					
					add_piety = miniscule_piety_loss

					every_vassal = {
						vassal_stance = zealot
						custom = every_zealot_vassal
						add_opinion = {
							modifier = impious_opinion
							opinion = -35
							target = root
						}
					}
				}
			}
		}

		stress_impact = {
			arbitrary = miniscule_stress_impact_loss
			just = medium_stress_impact_gain
			cynical = miniscule_stress_impact_loss
			zealous = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -1
				ai_boldness = 1
			}
		}
	}
	
	option = { # Give it a go
		name = legend_spread_events.5075.b

		duel = {
			skills = { learning prowess }
			value = high_skill_rating
			50 = { #It works
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5075.b.success
				send_interface_toast = {
					title = legend_spread_events.5075.b.success
					left_icon = root
					right_icon = scope:chronicler
					
					add_character_modifier = {
						modifier = legend_prayer_callus
						years = 15
					}

					every_vassal = {
						vassal_stance = zealot
						custom = every_zealot_vassal
						add_opinion = {
							modifier = pious_opinion
							opinion = 15
							target = root
						}
					}
				}
			}
			
			50 = { # Ow
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5075.b.failure
				send_interface_toast = {
					title = legend_spread_events.5075.b.failure
					left_icon = root
					right_icon = scope:chronicler
					
					add_character_modifier = {
						modifier = legend_bruised_head
						years = 5
					}					
				}
			}
		}

		stress_impact = {
			zealous = miniscule_stress_impact_loss
			cynical = medium_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
		}

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

	option = { # This is ridiculous
		name = legend_spread_events.5075.c

		add_piety = minor_prestige_gain

		reverse_add_opinion = {
			modifier = angry_opinion
			target = scope:imam
			opinion = -15
		}

		stress_impact = {
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
			content = miniscule_stress_impact_loss
			ambitious = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = -1
			}
		}
	}
}

# Motivation, Discovery and Battle chapters - 5200-5299

# MOTIVATION EVENTS

# I did this to acquire EXOTIC MEATS
# by Nick Meredith
legend_spread_events.5200 = {
	type = character_event
	title = legend_spread_events.5200.t
	desc = legend_spread_events.5200.desc
	theme = legend

	left_portrait = {
		character = root
		animation = drink_goblet
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			legend_protagonist = {
				AND = {
					this = root
					has_trait = gluttonous
				}
			}
			has_legend_chapter = motivation
			has_legend_chapter = hunt
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		promoted_legend = {
			save_scope_as = legend
		}
		random_parent = {
			even_if_dead = yes
			limit = {
				is_alive = no
			}
			save_scope_as = dead_parent
		}
	}

	option = { # I did it for the MEATS
		name = legend_spread_events.5200.a

		trigger = {
			has_trait = gluttonous
		}

		promoted_legend = {
			set_legend_chapter = { name = motivation localization_key = legend_chapter_motivation_delicious_meats }
			add_legend_owner_modifier = {
				modifier = legend_palatial_palatable
			}
		}

		reverse_add_opinion = {
			modifier = confused_opinion
			target = scope:chronicler
			opinion = -5
		}

		stress_impact = {
			base = medium_stress_impact_loss
			honest = miniscule_stress_impact_loss
			deceitful = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -1
			}
		}
	}

	option = { # I did it to AVENGE MY MUM/DAD
		name = legend_spread_events.5200.b

		trigger = {
			exists = scope:dead_parent
		}

		duel = {
			skills = { intrigue diplomacy }
			value = medium_skill_rating

			50 = { #People believe this
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { #Helps if your parents copped it in unknown ways
					add = 75
					scope:dead_parent = {
						death_reason = death_mysterious
					}
				}
				modifier = { #Helps if your parents copped it in specifically animal-related ways
					add = 125
					scope:dead_parent = {
						OR = {
							death_reason = death_deer
							death_reason = death_antelope
							death_reason = death_gazelle
							death_reason = death_bison
							death_reason = death_boar
							death_reason = death_aurochs
							death_reason = death_hyena
							death_reason = death_lion
							death_reason = death_tiger
							death_reason = death_leopard
							death_reason = death_roe
							death_reason = death_hart
						}
					}
				}
				desc = legend_spread_events.5200.b.success
				send_interface_toast = {
					title = legend_spread_events.5200.b.success
					left_icon = root
					right_icon = scope:chronicler

					add_character_modifier = {
						modifier = ce1_avenging_child
						years = 10
					}

					promoted_legend = {
						set_legend_chapter = { name = discovery localization_key = legend_chapter_motivation_dead_parent }
					}
				}
			}
			
			50 = { #Who are you trying to kid?
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5200.b.failure
				send_interface_toast = {
					title = legend_spread_events.5200.b.failure
					left_icon = root
					right_icon = scope:chronicler

					add_prestige = medium_prestige_loss
				}
			}
		}

		promoted_legend = {
			set_legend_chapter = { name = motivation localization_key = legend_chapter_motivation_dead_parent }
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			deceitful = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -1
			}
		}
	}

	option = { # What? No, no, I did it for the glory, duh. Haha.
		name = legend_spread_events.5200.c

		add_prestige = minor_prestige_gain

		reverse_add_opinion = {
			modifier = respect_opinion
			target = scope:chronicler
			opinion = 15
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			deceitful = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}
}

# I did this to prove my skill
# by Nick Meredith
legend_spread_events.5205 = {
	type = character_event
	title = legend_spread_events.5205.t
	desc = legend_spread_events.5205.desc
	theme = legend

	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			legend_protagonist = root
			has_legend_chapter = motivation
			has_legend_chapter = hunt
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes

		if = {
			limit = {
				any_sub_realm_county = {
					NOT = {
						has_county_modifier = hunt_sighting_dangerous_modifier
					}
				}
			}
			random_sub_realm_county = {
				limit = {
					NOT = {
						has_county_modifier = hunt_sighting_dangerous_modifier
					}
				}
				save_scope_as = hunt_sighting
			}
		}
	}

	option = { # I did this to prove I am the greatest hunter in the land!
		name = legend_spread_events.5205.a

		trigger = {
			has_trait = lifestyle_hunter
		}

		promoted_legend = {
			set_legend_chapter = { name = motivation localization_key = legend_chapter_motivation_great_venator }
		}

		add_trait_xp = {
			trait = lifestyle_hunter
			track = hunter
			value = tournament_hastiludes_xp_gain_minor_value #Just as a randomised but low value
		}

		reverse_add_opinion = {
			modifier = respect_opinion
			target = scope:chronicler
			opinion = 20
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			diligent = miniscule_stress_impact_loss
			lazy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
				ai_boldness = 1
			}
		}
	}

	option = { # I did it to hunt more dangerous game
		name = legend_spread_events.5205.b

		trigger = {
			# No extant Dangerous sightings
			NOT = {
				any_sub_realm_county = { has_county_modifier = hunt_sighting_dangerous_modifier }
			}
		}

		flavor = legend_spread_events.5205.b.tt

		random_sub_realm_county = {
			limit = { hunt_activity_recent_hunt_sighting_trigger = no }
			weight = {
				base = 1
				hunt_activity_sighting_county_modifier = yes
			}
			random_county_province = {
				weight = {
					base = 1
					hunt_activity_sighting_terrain_modifier = yes
					hunt_activity_sighting_building_modifier = { PROVINCE = this }
					hunt_activity_game_building_modifier = { PROVINCE = this }
				}
				save_scope_as = sighting_province
			}
			save_scope_as = sighting_county
			hidden_effect = {
				hunt_activity_dangerous_game_effect = { PROVINCE = scope:sighting_province }
			}
			# Create new sighting
			hunt_create_sighting_effect = {
				TYPE = dangerous
				ANIMAL = var:animal_type
				OWNER = root
			}
		}

		stress_impact = {
			brave = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}

	option = { # I did it to discover more amnimals
		name = legend_spread_events.5205.c

		add_trait = lifestyle_hunter
		add_trait_xp = {
			trait = lifestyle_hunter
			track = falconer
			value = 15
		}

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}

	option = { # To prove my skill as a hunter!
		name = legend_spread_events.5205.d

		promoted_legend = {
			set_legend_chapter = { name = motivation localization_key = legend_chapter_motivation_accomplished_hunter }
		}

		add_prestige = minor_prestige_gain

		reverse_add_opinion = {
			modifier = respect_opinion
			target = scope:chronicler
			opinion = 15
		}

		stress_impact = {
			base = minor_stress_impact_loss
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}
}

# DISCOVERY EVENTS

# I saw a cyclops!
# by Nick Meredith
legend_spread_events.5210 = {
	type = character_event
	title = legend_spread_events.5210.t
	desc = legend_spread_events.5210.desc
	theme = legend

	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = discovery
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
		NOT = {
			has_trait = blind
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		save_scope_as = root_scope
	}

	option = { # And he thought I was a cyclops too!
		name = legend_spread_events.5210.a

		trigger = {
			has_trait = one_eyed
			promoted_legend ?= {
				legend_protagonist = root
			}
		}

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_befriended_cyclops }
		}

		give_nickname = nick_the_cyclops

		reverse_add_opinion = {
			modifier = amazed_opinion
			target = scope:chronicler
			opinion = 20
		}

		stress_impact = {
			deceitful = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -0.5
				ai_boldness = 0.5
			}
		}
	}
	
	option = { # I saw a cyclops
		name = legend_spread_events.5210.b

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_cyclops }
			change_legend_quality_effect = {
				VALUE = minor_legend_quality_increase
			}
		}

		reverse_add_opinion = {
			modifier = amazed_opinion
			target = scope:chronicler
			opinion = 5
		}

		stress_impact = {
			deceitful = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			just = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Just a local
		name = legend_spread_events.5210.c

		add_prestige = miniscule_prestige_gain

		promoted_legend = {
			add_legend_county_modifier = {
				modifier = legend_monophthalmic_mythical
			}
		}

		every_vassal = {
			vassal_stance = parochial
			custom = every_parochial_vassal
			add_opinion = {
				modifier = respect_opinion
				opinion = 15
				target = root
			}
		}

		stress_impact = {
			lazy = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
				ai_boldness = -1
			}
		}
	}
}

# I was drugged by an evil plant
# by Nick Meredith
legend_spread_events.5215 = {
	type = character_event
	title = legend_spread_events.5215.t
	desc = legend_spread_events.5215.desc
	theme = legend

	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = discovery
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # And I learned much from it!
		name = legend_spread_events.5215.a

		trigger = {
			has_trait = lifestyle_herbalist
			promoted_legend ?= {
				legend_protagonist = root
			}	
		}

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_renowned_herbalist }
		}

		add_character_modifier = {
			modifier = legend_renowned_herbalist
			years = 15
		}

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 0.5
				ai_boldness = 0.5
			}
		}
	}
	
	option = { # It was a terrible trap, but I fought through
		name = legend_spread_events.5215.b

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_evil_plants }
		}

		add_prestige = medium_prestige_gain

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { # I dunno where you heard that m8
		name = legend_spread_events.5215.c

		if = {
			limit = { has_trait = lifestyle_herbalist }
			add_learning_lifestyle_xp = major_lifestyle_xp
		}
		else = {
			add_trait = lifestyle_herbalist
			add_learning_lifestyle_xp = medium_lifestyle_xp
		}

		reverse_add_opinion = {
			modifier = honesty_opinion
			target = scope:chronicler
			opinion = 10
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			lazy = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# I was challenged to an archery contest
# by Nick Meredith
legend_spread_events.5216 = {
	type = character_event
	title = legend_spread_events.5216.t
	desc = legend_spread_events.5216.desc
	theme = legend

	left_portrait = {
		character = root
		animation = ecstasy
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = discovery
			legend_protagonist = {
				NOR = {
					has_trait = maimed
					has_trait = incapable
				}
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # And I won it by splitting their arrow in twain!
		name = legend_spread_events.5216.a

		trigger = {
			has_trait = tourney_participant
			has_trait_xp = {
				trait = tourney_participant
				track = bow
				value >= 50
			}
			promoted_legend ?= {
				legend_protagonist = {
					this = root
				}
			}
		}

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_legendary_archer }
		}

		add_character_modifier = {
			modifier = legend_eagle_eyed
			years = 15
		}

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
				ai_boldness = 1
			}
		}
	}
	
	option = { # And I beat them!
		name = legend_spread_events.5216.b

		duel = {
			skill = prowess
			value = medium_skill_rating

			50 = { #People believe this
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5216.b.success
				send_interface_toast = {
					title = legend_spread_events.5216.b.success
					left_icon = root
					right_icon = scope:chronicler

					add_prestige = medium_prestige_gain

					promoted_legend = {
						set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_archery_contest_won }
					}
				}
			}
			
			50 = { #Who are you trying to kid?
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5216.b.failure
				send_interface_toast = {
					title = legend_spread_events.5216.b.failure
					left_icon = root
					right_icon = scope:chronicler

					add_prestige = medium_prestige_loss
				}
			}
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { # I can't really remember who won tbh
		name = legend_spread_events.5216.c

		if = {
			limit = {
				NOT = {
					has_trait = tourney_participant
				}
			}
			add_trait = tourney_participant
		}

		add_trait_xp = {
			trait = tourney_participant
			track = bow
			value = {
				integer_range = {
					min = 1
					max = 5
				}
			}
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			lazy = miniscule_stress_impact_loss
			humble = medium_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# I fell in quicksand/bog!
# by Nick Meredith
legend_spread_events.5220 = {
	type = character_event
	title = legend_spread_events.5220.t
	theme = legend
	desc = {
		desc = legend_spread_events.5220.desc.start
		triggered_desc = { #Quick n dirty choice between bog and quicksand
			trigger = { #Using capital province is a cheap way to choose a more 'familiar' hazard for the character
				root.capital_province = {
					OR = {
						terrain = plains
						terrain = hills
						terrain = jungle
						terrain = forest
						terrain = taiga
						terrain = wetlands
						terrain = steppe
						terrain = farmlands
						terrain = floodplains
						terrain = mountains
					}
				}
			}
			desc = legend_spread_events.5220.desc.wet
		}
		triggered_desc = {
			trigger = {
				root.capital_province = {
					OR = {
						terrain = desert
						terrain = desert_mountains
						terrain = oasis
						terrain = drylands
					}
				}
			}
			desc = legend_spread_events.5220.desc.dry
		}
		desc = legend_spread_events.5220.desc.ending
	}

	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = discovery
			legend_protagonist = {
				this = root
				NOT = {
					has_trait = incapable
				}
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # I hauled myself free easily!
		name = legend_spread_events.5220.a

		trigger = {
			OR = {
				has_trait = physique_good
				has_trait = strong
			}
		}

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_bog_stronk }
		}

		add_prestige = medium_prestige_gain

		give_nickname = nick_natures_bane

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}
	
	option = { # I struggled through
		name = legend_spread_events.5220.b

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_bog_struggle }
		}

		add_prestige = minor_prestige_gain

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
			diligent = miniscule_stress_impact_loss
			lazy = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { # I don't remember any bog
		name = legend_spread_events.5220.c

		if = {
			limit = {
				NOT = {
					has_trait = forder
				}
			}
			random = {
				chance = 50
				add_trait = forder
			}
		}
		else = {
			add_martial_lifestyle_xp = minor_lifestyle_experience
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			lazy = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# I discovered a new type of flower
# by Nick Meredith
legend_spread_events.5225 = {
	type = character_event
	title = legend_spread_events.5225.t
	theme = legend
	desc = legend_spread_events.5225.desc

	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = discovery
			legend_protagonist = {
				this = root
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # Of course I have proof!
		name = legend_spread_events.5225.a

		trigger = {
			has_trait = lifestyle_herbalist
		}

		flavor = legend_spread_events.5225.a.tt

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_wildflower_expert }
		}

		create_artifact_pressed_flower_effect = { OWNER = root }

		add_prestige = medium_prestige_gain

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}
	
	option = { # Er, um, of course I have proof...
		name = legend_spread_events.5225.b

		flavor = legend_spread_events.5225.b.tt

		duel = {
			skill = intrigue
			target = scope:chronicler

			50 = { #The chronicler's never seen a flower like that before!
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5225.b.success
				send_interface_toast = {
					title = legend_spread_events.5225.b.success
					left_icon = root
					right_icon = scope:chronicler

					add_prestige = medium_prestige_gain

					promoted_legend = {
						set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_wildflower_expert }
					}
				}
			}
			
			50 = { #...that's a daffodil mate.
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5225.b.failure
				send_interface_toast = {
					title = legend_spread_events.5225.b.failure
					left_icon = root
					right_icon = scope:chronicler

					add_prestige = medium_prestige_loss
				}
			}
		}

		stress_impact = {
			deceitful = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			just = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { # Let's stay on topic, shall we?
		name = legend_spread_events.5225.c

		add_character_modifier = {
			modifier = ce1_black_thumb
			years = 15
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			lazy = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}

	option = { # They were just regular flowers
		name = legend_spread_events.5225.d

		stress_impact = {
			base = minor_stress_impact_loss
			lazy = minor_stress_impact_loss
			humble = minor_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# I fought off cannibals
# by Nick Meredith
legend_spread_events.5230 = {
	type = character_event
	title = legend_spread_events.5230.t
	theme = legend
	desc = legend_spread_events.5230.desc

	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:chronicler
		animation = shock
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = discovery
			legend_protagonist = {
				this = root
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
		# Just to ensure people are actually freaked out by this
		trait_is_shunned_or_criminal_in_my_or_lieges_faith_trigger = {
			TRAIT = cannibal
			GENDER_CHARACTER = root
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # One of them even bit me!
		name = legend_spread_events.5230.a

		trigger = {
			has_trait = scarred
		}

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_cannibal_scarred }
		}

		add_character_modifier = {
			modifier = legend_cannibal_scarred
			years = 25
		}

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}
	
	option = { # Mmm, meats
		name = legend_spread_events.5230.b

		add_internal_flag = dangerous

		add_secret = { type = secret_cannibal }

		reverse_add_opinion = {
			modifier = uncertain_opinion
			target = scope:chronicler
			opinion = -10
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			callous = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # And I lived to tell the tale!
		name = legend_spread_events.5230.c

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_cannibal_fight }
		}

		add_prestige = minor_prestige_gain

		stress_impact = {
			deceitful = miniscule_stress_impact_loss
			honest = medium_stress_impact_gain
			arbitrary = miniscule_stress_impact_loss
			just = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { # Honestly, I think they were just bandits.
		name = legend_spread_events.5230.d

		if = {
			limit = {
				NOT = {
					has_trait = shrewd
				}
			}
			random = {
				chance = 10
				add_trait = shrewd
			}
		}
		else = {
			add_learning_lifestyle_xp = minor_lifestyle_experience
		}

		stress_impact = {
			base = minor_stress_impact_loss
			lazy = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# BATTLE EVENTS

# Did you slay the enemy commander?
# by Nick Meredith
legend_spread_events.5235 = {
	type = character_event
	title = legend_spread_events.5235.t
	theme = legend
	desc = legend_spread_events.5235.desc

	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:chronicler
		animation = shock
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = battle
			legend_protagonist = {
				this = root
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # Yeah I slapped him around
		name = legend_spread_events.5235.a

		promoted_legend = {
			set_legend_chapter = { name = battle localization_key = legend_chapter_battle_enemy_commander }
		}

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}
	
	option = { # They fell before I could get to them, sadge
		name = legend_spread_events.5235.b

		add_character_modifier = {
			modifier = ce1_modest_leader
			years = 15
		}

		reverse_add_opinion = {
			modifier = honesty_opinion
			target = scope:chronicler
			opinion = 5
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			humble = major_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# Did I do a tacticool retreat
# by Nick Meredith
legend_spread_events.5240 = {
	type = character_event
	title = legend_spread_events.5240.t
	theme = legend
	desc = legend_spread_events.5240.desc

	left_portrait = {
		character = root
		animation = personality_dishonorable
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = battle
			legend_protagonist = {
				AND = {
					this = root
					has_trait = craven
				}
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # It was, of course, a tactical retreat.
		name = legend_spread_events.5240.a

		trigger = {
			OR = {
				has_trait = deceitful
				has_trait = schemer
				has_trait = education_intrigue_5
			}
		}

		promoted_legend = {
			set_legend_chapter = { name = battle localization_key = legend_chapter_battle_faked_retreat }
		}

		add_prestige = medium_prestige_gain

		stress_impact = {
			base = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			brave = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { # It was a tactical retreat!
		name = legend_spread_events.5240.b

		duel = {
			skills = { martial intrigue }
			value = medium_skill_rating

			50 = { #People believe this
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = legend_spread_events.5240.b.success
				send_interface_toast = {
					title = legend_spread_events.5240.b.success
					left_icon = root
					right_icon = scope:chronicler

					add_prestige = medium_prestige_gain

					add_stress = minor_stress_loss

					promoted_legend = {
						set_legend_chapter = { name = battle localization_key = legend_chapter_battle_faked_retreat }
					}
				}
			}
			
			50 = { #Who are you trying to kid?
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5240.b.failure
				send_interface_toast = {
					title = legend_spread_events.5240.b.failure
					left_icon = root
					right_icon = scope:chronicler

					add_prestige = minor_prestige_loss

					add_character_modifier = {
						modifier = legend_bravely_ran_away
						years = 10
					}
				}
			}
		}

		stress_impact = {
			arrogant = miniscule_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}
	
	option = { # Let's focus on the results eh
		name = legend_spread_events.5240.c

		add_character_modifier = {
			modifier = ce1_consequentialist
			years = 10
		}

		add_prestige = minor_prestige_gain

		stress_impact = {
			base = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# Did you lead the flank that crushed the enemy?
# by Nick Meredith
legend_spread_events.5245 = {
	type = character_event
	title = legend_spread_events.5245.t
	theme = legend
	desc = legend_spread_events.5245.desc

	left_portrait = {
		character = root
		animation = marshal
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = battle
			legend_protagonist = {
				this = root
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # Of course, and it's believable right?
		name = legend_spread_events.5245.a

		promoted_legend = {
			set_legend_chapter = { name = battle localization_key = legend_chapter_battle_flanking_success }
		}

		random = {
			chance = 25
			add_martial_skill = 1
		}

		add_prestige = medium_prestige_gain

		stress_impact = {
			arrogant = minor_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { # We actually crushed them with a frontal assault!
		name = legend_spread_events.5245.b

		random = {
			chance = 50
			add_trait = aggressive_attacker
		}

		add_prestige = minor_prestige_gain

		stress_impact = {
			brave = miniscule_stress_impact_loss
			craven = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}
	
	option = { # I was merely overseeing the battle
		name = legend_spread_events.5245.c

		if = {
			limit = {
				NOT = {
					has_trait = logistician
				}
			}
			random = {
				chance = 75
				add_trait = logistician
			}
		}
		else = {
			add_martial_lifestyle_xp = minor_lifestyle_experience
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# I heard you saved a noble maiden/mandem
# by Nick Meredith
legend_spread_events.5250 = {
	type = character_event
	title = legend_spread_events.5250.t
	theme = legend
	desc = legend_spread_events.5250.desc

	left_portrait = {
		character = root
		animation = flirtation_left
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	lower_center_portrait = {
		trigger = { exists = scope:spouse }
		character = scope:spouse
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = battle
			legend_protagonist = {
				this = root
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes

		if = {
			limit = {
				exists = primary_spouse
			}
			random_spouse = {
				save_scope_as = spouse
			}
		}
	}

	option = { # I did, and I RAVISHED EM
		name = legend_spread_events.5250.a

		promoted_legend = {
			add_legend_owner_modifier = {
				modifier = legend_lecherous_lewd
			}
		}

		reverse_add_opinion = {
			modifier = angry_opinion
			target = scope:spouse
			opinion = -65
		}

		promoted_legend = {
			set_legend_chapter = { name = battle localization_key = legend_chapter_battle_ravished_maiden }
		}

		stress_impact = {
			lustful = major_stress_impact_loss
			gregarious = miniscule_stress_impact_loss
			shy = medium_stress_impact_gain
			honest = miniscule_stress_impact_loss
			deceitful = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 1
			}
		}
	}

	option = { # 'Twas merely a kisseth! How did it end up like thiseth?
		name = legend_spread_events.5250.b # 'Twere only a kisseth, 'twere only a kisseth

		promoted_legend = {
			set_legend_chapter = { name = battle localization_key = legend_chapter_battle_maiden_kiss }
		}

		reverse_add_opinion = {
			modifier = annoyed_opinion
			target = scope:spouse
			opinion = -10
		}

		stress_impact = {
			lustful = medium_stress_impact_loss
			chaste = medium_stress_impact_gain
			brave = miniscule_stress_impact_loss
			craven = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}
	
	option = { # Me?! Never!
		name = legend_spread_events.5250.c

		promoted_legend = {
			add_legend_owner_modifier = {
				modifier = legend_chaste_faithful
			}
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# I heard you fought through some grievous wounds
# by Nick Meredith
legend_spread_events.5255 = {
	type = character_event
	title = legend_spread_events.5255.t
	theme = legend
	desc = legend_spread_events.5255.desc

	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = battle
			legend_protagonist = {
				this = root
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
		save_scope_as = root_scope
	}

	option = { # How d'you think I got these massive bodily injuries?
		name = legend_spread_events.5255.a

		trigger = {
			OR = {
				has_trait = one_eyed
				has_trait = maimed
				has_trait = one_legged
			}
		}

		promoted_legend = {
			set_legend_chapter = { name = battle localization_key = legend_chapter_battle_wounded }
		}

		every_vassal = {
			vassal_stance = glory_hound
			custom = every_glory_hound_vassal
			add_opinion = {
				modifier = respect_opinion
				target = root
				opinion = 25
			}
		}

		stress_impact = {
			brave = miniscule_stress_impact_loss
			craven = medium_stress_impact_gain
			wrathful = miniscule_stress_impact_loss
			calm = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}

	option = { # How d'you think I got these scars?
		name = legend_spread_events.5255.b

		trigger = {
			OR = {
				has_trait = scarred
				has_trait = disfigured
			}
		}

		promoted_legend = {
			set_legend_chapter = { name = battle localization_key = legend_chapter_battle_wounded }
		}

		every_vassal = {
			vassal_stance = glory_hound
			custom = every_glory_hound_vassal
			add_opinion = {
				modifier = respect_opinion
				target = root
				opinion = 15
			}
		}

		stress_impact = {
			brave = miniscule_stress_impact_loss
			craven = medium_stress_impact_gain
			wrathful = miniscule_stress_impact_loss
			calm = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { # Thanks to god I avoided any such pain
		name = legend_spread_events.5255.c

		add_piety = medium_piety_gain

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = respect_opinion
				target = root
				opinion = 25
			}
		}

		stress_impact = {
			zealous = miniscule_stress_impact_loss
			cynical = minor_stress_impact_gain
		}

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

	option = { # I pushed through like a legend mate
		name = legend_spread_events.5255.d

		add_prestige = medium_prestige_gain

		every_vassal = {
			vassal_stance = glory_hound
			custom = every_glory_hound_vassal
			add_opinion = {
				modifier = respect_opinion
				target = root
				opinion = 25
			}
		}

		stress_impact = {
			zealous = minor_stress_impact_gain
			cynical = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = -1
			}
		}
	}
}

# I heard you arrived in the nick of time with reinforcements!
# by Nick Meredith
legend_spread_events.5260 = {
	type = character_event
	title = legend_spread_events.5260.t
	theme = legend
	desc = legend_spread_events.5260.desc

	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = battle
			legend_protagonist = {
				this = root
			}
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}
	
	immediate = {
		grab_appropriate_chronicler_effect = yes
	}

	option = { # I sure did!
		name = legend_spread_events.5260.a

		promoted_legend = {
			set_legend_chapter = { name = battle localization_key = legend_chapter_battle_reinforcement_arrival }
		}

		if = {
			limit = {
				NOT = {
					has_trait = reckless
				}
			}
			random = {
				chance = 50
				add_trait = reckless
			}
		}
		else = {
			add_martial_lifestyle_xp = minor_lifestyle_experience
		}

		add_character_modifier = {
			modifier = legend_nick_of_time
			years = 15
		}

		stress_impact = {
			brave = miniscule_stress_impact_loss
			craven = medium_stress_impact_gain
			wrathful = miniscule_stress_impact_loss
			calm = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}

	option = { # Actually we already had that organised!
		name = legend_spread_events.5260.b

		if = {
			limit = {
				NOT = {
					has_trait = organizer
				}
			}
			random = {
				chance = 50
				add_trait = organizer
			}
		}
		else = {
			add_martial_lifestyle_xp = minor_lifestyle_experience
		}

		add_character_modifier = {
			modifier = legend_well_organised
			years = 15
		}

		stress_impact = {
			craven = miniscule_stress_impact_loss
			brave = minor_stress_impact_gain
			patient = miniscule_stress_impact_loss
			impatient = minor_stress_impact_gain
		}

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

## Buying into legend events

# You write a missive to a neighbouring ruler
legend_spread_events.5305 = {
	type = character_event
	title = legend_spread_events.5305.t
	desc = legend_spread_events.5305.desc
	theme = legend
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	lower_center_portrait = {
		character = scope:potential_promoter
	}
	cooldown = { years = 25 }

	trigger = {
		highest_held_title_tier > tier_barony
		any_neighboring_realm_same_rank_owner = {
			is_available_healthy_ai_adult = yes
			save_temporary_scope_as = potential_promoter_temp
		}
		promoted_legend ?= {
			legend_owner = root
			any_legend_promoter = {
				this != scope:potential_promoter_temp
			}
		}
	}

	immediate = {
		random_neighboring_realm_same_rank_owner = {
			limit = {
				is_available_healthy_ai_adult = yes
			}

			save_scope_as = potential_promoter
		}

		promoted_legend = { save_scope_as = promoted_legend }
		culture = { save_scope_as = root_culture }
		grab_appropriate_chronicler_effect = yes
	}

	option = { # Don't you want to see a fellow [x culture] succeed?
		name = legend_spread_events.5305.a

		trigger = {
			culture = scope:potential_promoter.culture
		}

		duel = {
			skill = diplomacy
			value = average_skill_rating

			50 = { # They agree
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # Likes you
					scope:potential_promoter = { 
						opinion = {
							target = root
							value >= 60
						}
					}
					add = 25
				}
				send_interface_toast = {
					title = legend_spread_events.5305.a.success
					scope:potential_promoter = {
						set_promoted_legend = root.promoted_legend
					}
				}
			}

			50 = { # They disagree
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # Reluctant to drop their existing legend
					scope:potential_promoter = { exists = promoted_legend }
					add = 10
				}
				send_interface_toast = {
					title = legend_spread_events.5305.a.failure
					add_prestige = miniscule_prestige_loss
				}
			}
		}

		stress_impact = {
			calm = minor_stress_impact_loss
			gregarious = miniscule_stress_impact_loss
			trusting = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}

	option = { # Else I'll beat you up m8
		name = legend_spread_events.5305.b
		duel = {
			skills = { martial prowess }
			value = medium_skill_rating

			50 = { # They acquiesce
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # You are scary
					dread > 49
					add = 15
				}
				modifier = { # You are stronger than them
					root.current_military_strength > scope:potential_promoter.current_military_strength
					add = 20
				}
				modifier = { # You are significantly stronger than them
					root.current_military_strength > scope:potential_promoter.one_and_a_half_times_current_military_strength
					add = 30
				}
				send_interface_toast = {
					title = legend_spread_events.5305.b.success
					scope:potential_promoter = {
						set_promoted_legend = root.promoted_legend
						add_opinion = {
							target = root
							modifier = threatened_opinion
							opinion = -50
						}
					}
				}
			}

			50 = { # They don't care for your threats
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # Reluctant to drop their existing legend
					scope:potential_promoter = { exists = promoted_legend }
					add = 25
				}
				modifier = { # Dislikes you
					scope:potential_promoter = { 
						opinion = {
							target = root
							value <= 0
						}
					}
					add = 20
				}
				modifier = { # Stubborn to a fault
					scope:potential_promoter = { 
						has_trait = stubborn
					}
					add = 10
				}
				send_interface_toast = {
					title = legend_spread_events.5305.b.failure

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}

					reverse_add_opinion = {
						target = scope:potential_promoter
						modifier = dismissive_opinion
						opinion = -20
					}
				}
			}
		}

		stress_impact = {
			calm = minor_stress_impact_gain
			gregarious = miniscule_stress_impact_gain
			trusting = miniscule_stress_impact_gain
			wrathful = miniscule_stress_impact_loss
			ambitious = miniscule_stress_impact_loss
			vengeful = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # It's the neighbourly thing to do!
		name = legend_spread_events.5305.c

		duel = {
			skill = diplomacy
			target = scope:potential_promoter

			50 = { # Agreed!
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5305.c.success
					scope:potential_promoter = {
						set_promoted_legend = root.promoted_legend
					}
				}
			}

			50 = { #Disagree!
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # Reluctant to drop their existing legend
					scope:potential_promoter = { exists = promoted_legend }
					add = 15
				}
				send_interface_toast = {
					title = legend_spread_events.5305.c.failure
					add_prestige = minor_prestige_loss
				}
			}
		}

		stress_impact = {
			gregarious = miniscule_stress_impact_loss
			trusting = miniscule_stress_impact_gain
			shy = minor_stress_impact_gain
			deceitful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 1
			}
		}
	}

	option = { # Just send the letter as-is
		name = legend_spread_events.5305.d

		random = {
			chance = 10
			modifier = { # Likes you a bit
				scope:potential_promoter = {
					opinion = {
						target = root
						value > low_positive_opinion
					}
				}
				add = 10
			}
			modifier = { # Likes you a lot
				scope:potential_promoter = {
					opinion = {
						target = root
						value > medium_positive_opinion
					}
				}
				add = 10
			}
			send_interface_toast = {
				title = legend_spread_events.5305.d.success

				scope:potential_promoter = {
					set_promoted_legend = root.promoted_legend
				}
			}
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# You send a chronicler/herald to convince a neighbouring ruler
legend_spread_events.5310 = {
	type = character_event
	title = legend_spread_events.5310.t
	desc = legend_spread_events.5310.desc
	theme = legend
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:herald
		animation = chancellor
	}
	lower_center_portrait = {
		character = scope:potential_promoter
	}
	cooldown = { years = 25 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
		}
		any_neighboring_top_liege_realm_owner = {
			is_available_healthy_ai_adult = yes
			NOT = {
				promoted_legend ?= {
					legend_owner = root
				}
			}
		}

		OR = {
			any_court_position_holder = {
				type = chronicler_court_position
				is_available_healthy_ai_adult = yes
			}
			any_court_position_holder = {
				type = court_poet_court_position
				is_available_healthy_ai_adult = yes
			}
		}
	}

	immediate = {
		random_neighboring_top_liege_realm_owner = {
			limit = {
				is_available_healthy_ai_adult = yes
				NOT = {
					promoted_legend ?= {
						legend_owner = root
					}
				}
			}

			save_scope_as = potential_promoter
		}

		if = {
			limit = {
				any_court_position_holder = {
					type = chronicler_court_position
					is_available_healthy_ai_adult = yes
				}
			}
			random_court_position_holder = {
				type = chronicler_court_position
				limit = {
					is_available_healthy_ai_adult = yes
				}
				save_scope_as = herald
			}
		}
		else = {
			random_court_position_holder = {
				type = court_poet_court_position
			}
			save_scope_as = herald
		}

		promoted_legend = { save_scope_as = promoted_legend }

		save_scope_value_as = {
			name = random_range
			value = {
				integer_range = {
					min = 1
					max = 15
				}
			}
		}
	}

	option = { # Try to charm them with your wit!
		name = legend_spread_events.5310.a

		scope:herald = {
			duel = {
				skills = { diplomacy learning }
				value = average_skill_rating

				50 = { # They agree
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					modifier = { # Likes the diplomat
						scope:potential_promoter = {
							opinion = {
								target = scope:herald
								value > medium_positive_opinion
							}
						}
						add = 25
					}
					root = {
						send_interface_toast = {
							title = legend_spread_events.5310.a.success
							scope:potential_promoter = {
								set_promoted_legend = root.promoted_legend
							}
						}
					}
				}

				50 = { # They disagree
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					modifier = { # Reluctant to drop their existing legend
						scope:potential_promoter = { exists = promoted_legend }
						add = 10
					}
					root = {
						send_interface_toast = {
							title = legend_spread_events.5310.a.failure
							
							add_stress = minor_stress_gain
						}
					}
				}
			}
		}

		stress_impact = {
			trusting = miniscule_stress_impact_loss
			paranoid = miniscule_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}

	option = { # Take them a gift of gold to persuade them
		name = legend_spread_events.5310.b

		pay_short_term_gold = {
			target = scope:potential_promoter
			gold = medium_gold_value
		}

		random_list = {
			70 = { # They acquiesce
				modifier = { # They want your money
					scope:potential_promoter = {
						has_trait = greedy
					}
					add = 15
				}
				modifier = { #Natural randomness
					add = scope:random_range
				}
				send_interface_toast = {
					title = legend_spread_events.5310.b.success

					scope:potential_promoter = {
						set_promoted_legend = root.promoted_legend
					}
				}
			}

			30 = { # They decline
				modifier = { # They don't want your money
					scope:potential_promoter = {
						OR = {
							has_trait = profligate
							has_trait = generous
						}
					}
					add = 15
				}
				modifier = { # Dislikes you
					scope:potential_promoter = {
						opinion = {
							target = root
							value <= 0
						}
					}
					add = 20
				}
				modifier = { # Reluctant to drop their existing legend
					scope:potential_promoter = { exists = promoted_legend }
					add = 10
				}
				send_interface_toast = {
					title = legend_spread_events.5310.b.failure

					add_stress = miniscule_stress_gain
				}
			}
		}

		stress_impact = {
			greedy = medium_stress_impact_gain
			generous = medium_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = -1
			}
		}
	}

	option = { # Just go there and don't balls it up!
		name = legend_spread_events.5310.c

		random = {
			chance = 20
			send_interface_toast = {
				title = legend_spread_events.5305.c.success

				scope:potential_promoter = {
					set_promoted_legend = root.promoted_legend
				}
			}
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# You attempt to persuade a vassal by appealing to one of their traits
legend_spread_events.5315 = {
	type = character_event
	title = legend_spread_events.5315.t
	desc = legend_spread_events.5315.desc
	theme = legend
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:vassal
		animation = thinking
	}
	cooldown = { years = 25 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
		}
		any_vassal = {
			is_available_healthy_ai_adult = yes
			OR = {
				has_trait = ambitious
				has_trait = vengeful
				has_trait = honest
				has_trait = arrogant
			}
		}
	}

	immediate = {
		random_vassal = {
			limit = {
				is_available_healthy_ai_adult = yes
				OR = {
					has_trait = ambitious
					has_trait = vengeful
					has_trait = honest
					has_trait = arrogant
				}
			}

			save_scope_as = vassal
		}

		promoted_legend = { save_scope_as = promoted_legend }
	}

	option = { # Appeal to their ambition
		name = legend_spread_events.5315.a

		duel = {
			skill = diplomacy
			value = low_skill_rating

			50 = { # They agree
				desc = legend_spread_events.5315.a.success
				show_chance = no
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # Boost for correct deduction
					scope:vassal = { 
						has_trait = ambitious
					}
					add = 200
				}
				send_interface_toast = {
					title = legend_spread_events.5315.a.success
					scope:vassal = {
						set_promoted_legend = root.promoted_legend
					}
				}
			}

			50 = { # They disagree
				desc = legend_spread_events.5315.a.failure
				show_chance = no
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # Loss for incorrect deduction
					scope:vassal = { 
						NOT = {
							has_trait = ambitious
						}
					}
					add = 200
				}
				send_interface_toast = {
					title = legend_spread_events.5315.a.failure
					
					add_stress = minor_stress_gain
				}
			}
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}

	option = { # Appeal to their vengefulness
		name = legend_spread_events.5315.b

		duel = {
			skill = diplomacy
			value = low_skill_rating

			50 = { # They agree
				desc = legend_spread_events.5315.a.success
				show_chance = no
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # Boost for correct deduction
					scope:vassal = { 
						has_trait = vengeful
					}
					add = 200
				}
				send_interface_toast = {
					title = legend_spread_events.5315.a.success
					scope:vassal = {
						set_promoted_legend = root.promoted_legend
					}
				}
			}

			50 = { # They disagree
				desc = legend_spread_events.5315.a.failure
				show_chance = no
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # Loss for incorrect deduction
					scope:vassal = { 
						NOT = {
							has_trait = vengeful
						}
					}
					add = 200
				}
				send_interface_toast = {
					title = legend_spread_events.5315.a.failure
					
					add_stress = minor_stress_gain
				}
			}
		}

		stress_impact = {
			vengeful = miniscule_stress_impact_loss
			forgiving = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = -1
			}
		}
	}

	option = { # Appeal to their honesty
		name = legend_spread_events.5315.c

		duel = {
			skill = diplomacy
			value = low_skill_rating

			50 = { # They agree
				desc = legend_spread_events.5315.a.success
				show_chance = no
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # Boost for correct deduction
					scope:vassal = { 
						has_trait = honest
					}
					add = 200
				}
				send_interface_toast = {
					title = legend_spread_events.5315.a.success
					scope:vassal = {
						set_promoted_legend = root.promoted_legend
					}
				}
			}

			50 = { # They disagree
				desc = legend_spread_events.5315.a.failure
				show_chance = no
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # Loss for incorrect deduction
					scope:vassal = { 
						NOT = {
							has_trait = honest
						}
					}
					add = 200
				}
				send_interface_toast = {
					title = legend_spread_events.5315.a.failure
					
					add_stress = minor_stress_gain
				}
			}
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			deceitful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 1
			}
		}
	}

	option = { # Appeal to their arrogance
		name = legend_spread_events.5315.d

		duel = {
			skill = diplomacy
			value = low_skill_rating

			50 = { # They agree
				desc = legend_spread_events.5315.a.success
				show_chance = no
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # Boost for correct deduction
					scope:vassal = { 
						has_trait = arrogant
					}
					add = 200
				}
				send_interface_toast = {
					title = legend_spread_events.5315.a.success
					scope:vassal = {
						set_promoted_legend = root.promoted_legend
					}
				}
			}

			50 = { # They disagree
				desc = legend_spread_events.5315.a.failure
				show_chance = no
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # Loss for incorrect deduction
					scope:vassal = { 
						NOT = {
							has_trait = arrogant
						}
					}
					add = 200
				}
				send_interface_toast = {
					title = legend_spread_events.5315.a.failure
					
					add_stress = minor_stress_gain
				}
			}
		}

		stress_impact = {
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

# You attempt to bribe a vassal into promoting your legend
legend_spread_events.5320 = {
	type = character_event
	title = legend_spread_events.5320.t
	desc = {
		desc = legend_spread_events.5320.desc
		desc = {
			triggered_desc = {
				trigger = {
					scope:artifact = {
						exists = scope:artifact
					}
				}
				desc = legend_spread_events.5320.artifact
			}
		}
	}
	theme = legend
	left_portrait = {
		character = root
		animation = scheme
	}
	right_portrait = {
		character = scope:vassal
		animation = happiness
	}
	artifact = {
		target = scope:artifact
		position = lower_center_portrait
	}
	cooldown = { years = 25 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
		}
		any_vassal = {
			is_available_healthy_ai_adult = yes
		}
	}

	immediate = {
		random_vassal = {
			limit = {
				is_available_healthy_ai_adult = yes
			}

			save_scope_as = vassal
		}

		random_character_artifact = {
			limit = {
				NOR = {
					#Ensure it's not trash
					has_variable = unwanted_artifact

					#And doesn't have a claim on it
					any_artifact_claimant = {
						is_alive = no
					}
				}
			}

			save_scope_as = artifact
		}

		scope:vassal.capital_county =  { save_scope_as = capital_county }

		promoted_legend = { save_scope_as = promoted_legend }
	}

	option = { # Offer them an artifact
		name = legend_spread_events.5320.a

		trigger = {
			exists = scope:artifact
		}

		duel = {
			skill = diplomacy
			value = medium_skill_rating

			60 = { # They agree
				desc = legend_spread_events.5320.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # Boost for anything that's above common
					scope:artifact = { 
						rarity = masterwork
					}
					add = 15
				}
				modifier = {
					scope:artifact = { 
						rarity = famed
					}
					add = 30
				}
				modifier = {
					scope:artifact = { 
						rarity = illustrious
					}
					add = 80
				}
				send_interface_toast = {
					title = legend_spread_events.5320.a.success
					scope:vassal = {
						set_promoted_legend = root.promoted_legend
					}
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
					scope:artifact = {
						set_owner = {
							target = scope:vassal
							history = {
								location = root.capital_province
								actor = root
								recipient = scope:vassal
								type = given
							}
						}
					}
				}
			}

			40 = { # They disagree
				desc = legend_spread_events.5320.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5320.a.failure
					
					custom_tooltip = legend_spread_events.5320.a.artifact

					hidden_effect = {
						scope:artifact = {
							add_artifact_modifier = artifact_monthly_prestige_penalty_modifier
						}
					}

					reverse_add_opinion = {
						target = scope:vassal
						modifier = dismissive_opinion
						opinion = -5
					}
				}
			}
		}

		stress_impact = {
			generous = miniscule_stress_impact_loss
			greedy = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = -1
			}
		}
	}

	option = { # Offer them investment in their holding
		name = legend_spread_events.5320.b

		duel = {
			skills = { diplomacy stewardship }
			value = medium_skill_rating

			50 = { # They agree
				desc = legend_spread_events.5320.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5320.a.success
					scope:vassal = {
						set_promoted_legend = root.promoted_legend
					}

					scope:capital_county = {
						add_county_modifier = {
							modifier = legend_investments
							years = 20
						}
					}

					remove_short_term_gold = minor_gold_value
				}
			}

			50 = { # They disagree
				desc = legend_spread_events.5320.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5320.b.failure
					
					reverse_add_opinion = {
						target = scope:vassal
						modifier = dismissive_opinion
						opinion = -20
					}
				}
			}
		}

		stress_impact = {
			generous = miniscule_stress_impact_loss
			greedy = minor_stress_impact_gain
			trusting = miniscule_stress_impact_loss
			paranoid = miniscule_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = -1
				ai_sociability = 0.5
			}
		}
	}

	option = { # Offer them a favour
		name = legend_spread_events.5320.c

		duel = {
			skills = { diplomacy intrigue }
			value = low_skill_rating

			50 = { # They agree
				desc = legend_spread_events.5320.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5320.a.success
					scope:vassal = {
						set_promoted_legend = root.promoted_legend
						add_hook = {
							target = root
							type = favor_hook
						}
					}
				}
			}

			50 = { # They disagree
				desc = legend_spread_events.5320.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5320.a.failure
					
					add_character_modifier = {
						modifier = legend_loose_lips
						years = 15
					}
				}
			}
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			deceitful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 1
			}
		}
	}

	option = { # Opt-out
		name = legend_spread_events.5320.d

		random = {
			chance = 15
			send_interface_toast = {
				title = legend_spread_events.5320.d.success

				scope:vassal = {
					set_promoted_legend = root.promoted_legend
				}
			}
		}

		stress_impact = {
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
			content = miniscule_stress_impact_loss
			ambitious = minor_stress_impact_gain
			craven = miniscule_stress_impact_loss
			brave = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -0.5
			}
		}
	}
}

# Legend is spreading towards you: do you become a promoter for extra rewards?
legend_spread_events.5325 = {
	type = character_event
	title = legend_spread_events.5325.t
	desc = {
		desc = legend_spread_events.5325.desc
		triggered_desc = {
			trigger = {
				scope:promoted_legend_owner = {
					is_ai = yes
				}				
			}
			desc = legend_spread_events.5325.protag
		}
	}
	theme = legend
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:legend_person
		animation = happiness
	}
	lower_center_portrait = {
		character = scope:promoted_legend_owner
		trigger = {
			this != scope:legend_person
		}
	}
	cooldown = { years = 25 }

	trigger = {
		#You have a neighbour who has a legend
		any_neighboring_top_liege_realm_owner = {
			promoted_legend ?= {
				NOR = {
					any_legend_promoter = { this = root	}
					legend_owner = root
				}
				legend_owner ?= {
					is_within_diplo_range = { CHARACTER = root }
				}
			}
		}
	}

	immediate = {
		random_neighboring_top_liege_realm_owner = { #Grab neighbouring ruler with a legend
			limit = {
				promoted_legend ?= {
					NOR = {
						any_legend_promoter = { this = root	}
						legend_owner = root
					}
					legend_owner ?= {
						is_within_diplo_range = { CHARACTER = root }
					}
				}
			}
			save_scope_as = legend_person
			promoted_legend = {
				save_scope_as = promoted_legend
				legend_owner = { save_scope_as = promoted_legend_owner }
			}
		}

		promoted_legend ?= { save_scope_as = your_legend }
	}

	option = { # Take it on and it gains good stuff because you're cool
		name = legend_spread_events.5325.a

		trigger = {
			prestige_level > 2
		}

		add_internal_flag = special

		if = {
			limit = {
				exists = scope:your_legend
			}
			custom_tooltip = legend_spread_events.5325.stop_promoting_warning
			custom_tooltip = legend_spread_events.5325.stop_promoting

			stop_promoting_legend = yes
		}

		set_promoted_legend = scope:promoted_legend

		scope:promoted_legend = {
			add_legend_county_modifier = {
				modifier = legend_esteemed_expanding
			}
		}

		stress_impact = {
			arrogant = minor_stress_impact_loss
			humble = medium_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Sure, I'll take it
		name = legend_spread_events.5325.b

		trigger = {
			NOT = {
				prestige_level > 2
			}
		}

		if = {
			limit = {
				exists = scope:your_legend
			}
			custom_tooltip = legend_spread_events.5325.stop_promoting_warning
			custom_tooltip = legend_spread_events.5325.stop_promoting

			stop_promoting_legend = yes
		}

		set_promoted_legend = scope:promoted_legend

		add_prestige = minor_prestige_gain

		stress_impact = {
			generous = miniscule_stress_impact_loss
			greedy = minor_stress_impact_gain
			trusting = miniscule_stress_impact_loss
			paranoid = miniscule_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = -1
				ai_sociability = 0.5
			}
		}
	}

	option = { # I'll do it, but for a sum...
		name = legend_spread_events.5325.c

		trigger = { #Ensure you're not taking money from humans
			scope:promoted_legend_owner = {
				is_ai = yes
			}
		}

		duel = {
			skill = diplomacy
			target = scope:promoted_legend_owner

			50 = { # They agree
				desc = legend_spread_events.5325.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				custom_tooltip = legend_spread_events.5325.c.success.tt
				trigger_event = legend_spread_events.5326
			}

			50 = { # They disagree
				desc = legend_spread_events.5325.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				custom_tooltip = legend_spread_events.5325.c.failure.tt
				trigger_event = legend_spread_events.5327
			}
		}

		stress_impact = {
			greedy = miniscule_stress_impact_loss
			generous = minor_stress_impact_gain
			deceitful = miniscule_stress_impact_loss
			honest = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}

	option = { # No thanks
		name = legend_spread_events.5325.d

		reverse_add_opinion = {
			target = scope:legend_person
			modifier = angry_opinion
			opinion = -10
		}

		stress_impact = {
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
			content = miniscule_stress_impact_loss
			ambitious = minor_stress_impact_gain
			craven = miniscule_stress_impact_loss
			brave = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -0.5
			}
		}
	}
}

legend_spread_events.5326 = {
	type = letter_event
	opening = {
		desc = legend_spread_events.5326.opening
	}
	desc = legend_spread_events.5326.desc
		
	sender = {
		character = scope:promoted_legend_owner
		animation = personality_honorable
	}

	option = {
		name = legend_spread_events.5326.a

		scope:promoted_legend_owner = {
			pay_short_term_gold = {
				target = root
				gold = minor_gold_value
			}
		}

		custom_tooltip = legend_spread_events.5325.stop_promoting

		stop_promoting_legend = yes		

		set_promoted_legend = scope:promoted_legend
	}

	option = {
		name = legend_spread_events.5326.b

		reverse_add_opinion = {
			modifier = angry_opinion
			opinion = -20
			target = scope:promoted_legend_owner
		}		
	}
}

legend_spread_events.5327 = {
	type = letter_event
	opening = {
		desc = legend_spread_events.5327.opening
	}
	desc = legend_spread_events.5327.desc
		
	sender = {
		character = scope:promoted_legend_owner
		animation = dismissal
	}

	option = {
		name = legend_spread_events.5327.a

		add_stress = minor_stress_gain
	}
}

# Legend owner is evil; stop promoting?
legend_spread_events.5330 = {
	type = character_event
	title = legend_spread_events.5330.t
	desc = legend_spread_events.5330.desc
	theme = legend
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:promoted_legend_owner
		animation = anger
	}
	cooldown = { years = 25 }

	trigger = {
		#You have a legend and the legend owner is sinful
		any_legend = {
			any_legend_promoter = { #You are promoting that legend
				this = root	
			}
			legend_owner = {
				num_sinful_traits >= 1 #They have at least one sinful trait
				save_temporary_scope_as = promoted_legend_owner_temp
			}
			save_temporary_scope_as = promoted_legend_temp
		}

		scope:promoted_legend_temp = { #Ensure they own the legend
			legend_owner = scope:promoted_legend_owner_temp
		}
	}

	immediate = {
		random_legend = { #Grab the legend you're promoting
			limit = {
				any_legend_promoter = {
					this = root
				}
				legend_owner = {
					num_sinful_traits >= 1
				}
			}
			save_scope_as = promoted_legend
		}

		scope:promoted_legend.legend_owner = {
			save_scope_as = promoted_legend_owner
		}

		save_scope_as = root_scope
	}

	option = { # How dare they! I am a godly WomanMan!
		name = legend_spread_events.5330.a

		trigger = {
			OR = {
				scope:promoted_legend_owner = { #They're REALLY evil
					num_sinful_traits >= 2
				}
				has_trait = zealous #Or you're really godly
			}
			NOT = {
				has_trait = cynical
			}
		}

		add_internal_flag = special

		promoted_legend = {
			add_legend_county_modifier = {
				modifier = legend_irreverent_immoral
				years = 10
			}
		}

		if = { #Just to ensure human players don't get blindsided
			limit = {
				scope:promoted_legend_owner = {
					is_ai = yes
				}
			}
			scope:promoted_legend_owner = {
				add_character_modifier = {
					modifier = legend_wicked_ways
					years = 15
				}
			}
		}

		stop_promoting_legend = yes

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = pleased_opinion
				opinion = 25
				target = root
			}
		}

		reverse_add_opinion = {
			modifier = angry_opinion
			opinion = -20
			target = scope:promoted_legend_owner
		}

		stress_impact = {
			zealous = minor_stress_impact_loss
			gregarious = minor_stress_impact_gain
		}

		ai_chance = { #Keep this low so we don't see non-player usage of it much if at all
			base = 15
			ai_value_modifier = {
				ai_zeal = 1
			}
		}
	}

	option = { # I have my own reputation to be thinking of
		name = legend_spread_events.5330.b

		stop_promoting_legend = yes

		add_piety = minor_piety_gain

		stress_impact = {
			zealous = miniscule_stress_impact_loss
			cynical = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = miniscule_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 0.5
				ai_sociability = -0.5
			}
		}
	}

	option = { # I'll grin and bear it
		name = legend_spread_events.5330.c

		random = {
			chance = 20
			send_interface_toast = {
				title = legend_spread_events.5330.c.success
				left_icon = root
				
				scope:promoted_legend_owner = {
					add_character_modifier = {
						modifier = legend_errors_exonerated
						years = 10
					}
				}
			}
		}

		reverse_add_opinion = {
			target = scope:promoted_legend_owner
			modifier = pleased_opinion
			opinion = 30
		}

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = angry_opinion
				opinion = -10
				target = root
			}
		}

		stress_impact = {
			humble = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
			content = miniscule_stress_impact_loss
			ambitious = minor_stress_impact_gain
			craven = miniscule_stress_impact_loss
			brave = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -0.5
			}
		}
	}
}

# Legend owner is very godly; promote more?
# Counterpart to 5330
legend_spread_events.5335 = {
	type = character_event
	title = legend_spread_events.5335.t
	desc = legend_spread_events.5335.desc
	theme = legend
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:promoted_legend_owner
		animation = personality_zealous
	}
	cooldown = { years = 25 }

	trigger = {
		#You have a legend and the legend owner is virtuous
		any_legend = {
			any_legend_promoter = { #You are promoting that legend
				this = root	
			}
			legend_owner = {
				num_virtuous_traits >= 1 #They have at least one virtuous trait
				save_temporary_scope_as = promoted_legend_owner_temp
			}
			save_temporary_scope_as = promoted_legend_temp
		}

		scope:promoted_legend_temp = { #Ensure they own the legend
			legend_owner = scope:promoted_legend_owner_temp
		}
	}

	immediate = {
		random_legend = { #Grab the legend you're promoting
			limit = {
				any_legend_promoter = {
					this = root
				}
				legend_owner = {
					num_virtuous_traits >= 1
				}
			}
			save_scope_as = promoted_legend
		}

		scope:promoted_legend.legend_owner = {
			save_scope_as = promoted_legend_owner
		}

		save_scope_as = root_scope
	}

	option = { # I love them!
		name = legend_spread_events.5335.a

		trigger = {
			OR = {
				scope:promoted_legend_owner = { #They're REALLY godly
					num_virtuous_traits >= 2
				}
				has_trait = zealous #Or you're really godly
			}
			NOT = {
				has_trait = cynical
			}
		}

		add_internal_flag = special

		promoted_legend = {
			add_legend_owner_modifier = {
				modifier = legend_saintly_sinless
				years = 15
			}
		}

		add_piety = medium_piety_value

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = pleased_opinion
				opinion = 20
				target = root
			}
		}

		stress_impact = {
			zealous = minor_stress_impact_loss
			cynical = medium_stress_impact_gain
		}

		ai_chance = { #Keep this low so we don't see non-player usage of it much if at all
			base = 15
			ai_value_modifier = {
				ai_zeal = 1
			}
		}
	}

	option = { # Use them to increase my fame
		name = legend_spread_events.5335.b

		add_prestige = minor_prestige_value

		promoted_legend = {
			add_legend_owner_modifier = {
				modifier = legend_principled_pious
				years = 10
			}
		}

		stress_impact = {
			zealous = minor_stress_impact_gain
			cynical = miniscule_stress_impact_loss
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 1
				ai_sociability = 0.5
			}
		}
	}

	option = { # Perhaps I should learn from him?
		name = legend_spread_events.5335.c

		random = {
			chance = 20
			send_interface_toast = {
				title = legend_spread_events.5335.c.success
				left_icon = root
				
				add_learning_skill = 1
			}
		}

		reverse_add_opinion = {
			target = scope:promoted_legend_owner
			modifier = flattered_opinion
			opinion = 15
		}

		every_vassal = {
			vassal_stance = zealot
			custom = every_zealot_vassal
			add_opinion = {
				modifier = pleased_opinion
				opinion = 10
				target = root
			}
		}

		stress_impact = {
			humble = medium_stress_impact_loss
			arrogant = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
			}
		}
	}
}

## Additional Spread Events

# You are asked how the tale goes
legend_spread_events.5400 = {
	type = character_event
	title = legend_spread_events.5400.t
	desc = legend_spread_events.5400.desc
	theme = legend
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}

	immediate = {
		promoted_legend = { save_scope_as = promoted_legend }
		culture = { save_scope_as = root_culture }
		grab_appropriate_chronicler_effect = yes
	}

	option = { # Improve your legend
		name = legend_spread_events.5400.a

		duel = {
			skill = diplomacy
			value = high_skill_rating

			50 = { # Your story is beautifully embellished
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				send_interface_toast = {
					title = legend_spread_events.5400.a.majorsuccess

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
				}
			}

			50 = { # Your story is only somewhat embellished
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5400.a.minorsuccess

					add_prestige = medium_prestige_value
				}
			}
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			content = miniscule_stress_impact_loss
			deceitful = minor_stress_impact_gain
			ambitious = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}

	option = { # Invent a story to change your legend
		name = legend_spread_events.5400.b

		duel = {
			skills = { diplomacy intrigue }
			value = medium_skill_rating

			50 = { # They believe you
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # Nobody wants to disagree with you
					dread > 49
					add = 5
				}
				send_interface_toast = {
					title = legend_spread_events.5400.b.success

					add_intrigue_skill = 1

					promoted_legend = {
						set_legend_chapter = {
							name = famous_deed
							localization_key = legend_chapter_silver_tongued
						}
					}
				}
			}

			50 = { # They don't really believe you
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # You're a crap liar
					has_trait = honest
					add = 5
				}
				send_interface_toast = {
					title = legend_spread_events.5400.b.failure

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}

					promoted_legend = {
						set_legend_chapter = {
							name = famous_deed
							localization_key = legend_chapter_easily_captured
						}
					}
				}
			}
		}

		stress_impact = {
			deceitful = minor_stress_impact_loss
			honest = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Opt-out
		name = legend_spread_events.5400.c

		promoted_legend = {
			add_legend_owner_modifier = {
				modifier = legend_tolerant_trusting
			}
		}

		stress_impact = {
			trusting = miniscule_stress_impact_loss
			shy = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.5
			}
		}
	}
}

# You are asked whether the tales of a mythical beast are true
legend_spread_events.5405 = {
	type = character_event
	title = legend_spread_events.5405.t
	desc = legend_spread_events.5405.desc
	theme = legend
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = discovery
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}

	immediate = {
		promoted_legend = { save_scope_as = promoted_legend }
		grab_appropriate_chronicler_effect = yes
		set_up_regional_mythical_creature_effect = yes
	}

	option = { # Of course it was!
		name = legend_spread_events.5405.a

		duel = {
			skills = { diplomacy learning }
			value = high_skill_rating

			50 = { # They buy it
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5405.a.success

					promoted_legend = {
						set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_mythical_beast }
						change_legend_quality_effect = { VALUE = medium_legend_quality_increase }
					}
				}
			}

			50 = { # They don't buy it
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5405.a.failure
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = medium_legend_quality_decrease }
					}
				}
			}
		}

		stress_impact = {
			deceitful = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			honest = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}

	option = { # That's nonsense: here's what I DID see, though...
		name = legend_spread_events.5405.b

		duel = {
			skill = intrigue
			value = high_skill_rating

			50 = { # You make up a new creature on the spot
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # Nobody wants to disagree with you
					dread > 49
					add = 5
				}
				modifier = { # You're a good liar
					has_trait = deceitful
					add = 5
				}
				send_interface_toast = {
					title = legend_spread_events.5405.b.success

					add_intrigue_skill = 1

					add_prestige = minor_prestige_gain

					promoted_legend = {
						set_legend_chapter = {
							name = discovery
							localization_key = legend_chapter_discovery_new_myth
						}
					}
				}
			}

			50 = { # What? That's ridiculous
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = { # You're a crap liar
					has_trait = honest
					add = 5
				}
				send_interface_toast = {
					title = legend_spread_events.5405.b.failure

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}

					add_prestige = medium_prestige_loss
				}
			}
		}

		stress_impact = {
			deceitful = minor_stress_impact_loss
			honest = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Who can say? So many wondrous things I saw...
		name = legend_spread_events.5405.c

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			deceitful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# You are asked what lies in the ocean depths
legend_spread_events.5410 = {
	type = character_event
	title = legend_spread_events.5410.t
	desc = legend_spread_events.5410.desc
	theme = legend
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
			has_legend_chapter = discovery
			legend_protagonist = root
		}
		any_courtier = {
			is_available_ai_adult = yes
		}
	}

	immediate = {
		promoted_legend = { save_scope_as = promoted_legend }
		grab_appropriate_chronicler_effect = yes
	}

	option = { # The tales of the Vinland were true!
		name = legend_spread_events.5410.a

		trigger = {
			AND = {
				culture = { has_cultural_pillar = heritage_north_germanic }
				current_year >= 1000 #Use a rough estimate of when rumours of Vinland were beginning to propagate
			}
		}

		flavor = legend_spread_events.5410.a.flavor

		duel = {
			skills = { diplomacy learning }
			value = medium_skill_rating

			50 = { # They buy it
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5410.a.success

					promoted_legend = {
						set_legend_chapter = { name = discovery localization_key = legend_chapter_discovery_vinland }
					}

					promoted_legend = {
						change_legend_quality_effect = { VALUE = major_legend_quality_increase }
					}
				}
			}

			50 = { # They don't buy it
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = legend_spread_events.5410.a.failure

					add_prestige = medium_prestige_loss
				}
			}
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			arbitrary = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			just = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -0.5
			}
		}
	}

	option = { # There were mighty sea monsters!
		name = legend_spread_events.5410.b

		promoted_legend = {
			set_legend_chapter = { name = discovery localization_key = legend_chapter_sea_monsters }
		}

		add_character_modifier = {
			modifier = sea_monsters_modifier
			years = 15
		}

		stress_impact = {
			deceitful = minor_stress_impact_loss
			honest = minor_stress_impact_gain
			ambitious = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Who can say? So many wondrous things I saw...
		name = legend_spread_events.5410.c

		promoted_legend = {
			change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			deceitful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}

	option = { # There's nothing there, boy!
		name = legend_spread_events.5410.d

		if = {
			limit = {
				NOT = {
					has_trait = lifestyle_traveler
				}
			}
			add_trait = lifestyle_traveler
		}

		add_trait_xp = {
			trait = lifestyle_traveler
			track = danger 
			value = { 5 15 } 
		}

		stress_impact = {
			honest = miniscule_stress_impact_loss
			deceitful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# Is your tale one of nobles or common folk?
legend_spread_events.5415 = {
	type = character_event
	title = legend_spread_events.5415.t
	desc = legend_spread_events.5415.desc
	theme = legend
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		promoted_legend ?= {
			legend_owner = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}

	immediate = {
		promoted_legend = { 
			save_scope_as = promoted_legend 
			legend_protagonist = { save_scope_as = protagonist }
		}
		grab_appropriate_chronicler_effect = yes
	}

	option = { # It's all about the nobles, baby
		name = legend_spread_events.5415.a

		promoted_legend = {
			add_legend_owner_modifier = {
				modifier = legend_nobles_noted
				years = 15
			}
		}

		stress_impact = {
			content = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
			ambitious = minor_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -1
			}
		}
	}

	option = { # It's about the common man!
		name = legend_spread_events.5415.b

		promoted_legend = {
			add_legend_county_modifier = {
				modifier = legend_commoners_celebrated
				years = 15
			}
		}

		stress_impact = {
			ambitious = miniscule_stress_impact_loss
			arrogant = miniscule_stress_impact_loss
			content = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 1
			}
		}
	}

	option = { # It's about the protag themselves, duh
		name = {
			trigger = {
				promoted_legend = {
					legend_protagonist = root
				}
			}
			text = legend_spread_events.5415.c.protag
		}
		name = {
			trigger = {
				NOT = {
					promoted_legend = {
						legend_protagonist = root
					}
				}
			}
			text = legend_spread_events.5415.c
		}

		promoted_legend = {
			change_legend_quality_effect = { VALUE = medium_legend_quality_increase }
		}

		if = {
			limit = {
				promoted_legend = {
					legend_protagonist = root
				}
			}
			add_prestige = minor_prestige_gain
		}

		stress_impact = {
			arrogant = minor_stress_impact_loss
			humble = minor_stress_impact_gain
			stubborn = minor_stress_impact_loss
			fickle = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}
}

# You supposedly drank a mighty ogre under the table
# Inspired by Kuba Potapczyk
# As in, he suggested the event, not that he's an ogre
# ...necessarily
legend_spread_events.5420 = {
	type = character_event
	title = legend_spread_events.5420.t
	desc = legend_spread_events.5420.desc
	theme = legend
	left_portrait = {
		character = root
		animation = toast
	}
	right_portrait = {
		character = scope:chronicler
		animation = chancellor
	}
	cooldown = { years = 20 }

	trigger = {
		drinks_alcohol_trigger = yes
		promoted_legend ?= {
			legend_owner = root
			legend_protagonist = root
		}
		any_courtier = {
			this != root
			is_available_ai_adult = yes
		}
	}

	immediate = {
		promoted_legend = {
			save_scope_as = promoted_legend 
		}
		grab_appropriate_chronicler_effect = yes
	}

	option = { # I'LL SHOW YOU RIGHT NOW
		name = legend_spread_events.5420.a

		duel = {
			skill = prowess
			value = high_skill_rating
			50 = { #Chronicler is convinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # You're a drunkard
					has_trait = drunkard
					add = 15
				}
				modifier = { # You're a legend mate
					has_trait = lifestyle_reveler
					add = 10
				}
				modifier = { # You'll drink anything
					has_trait = gluttonous
					add = 5
				}
				desc = legend_spread_events.5420.a.success
				send_interface_toast = {
					title = legend_spread_events.5420.a.success
					left_icon = root
					right_icon = scope:chronicler
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = major_legend_quality_increase }
					}
				}
			}
			
			50 = { # People are unconvinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5420.a.failure
				send_interface_toast = {
					title = legend_spread_events.5420.a.failure
					left_icon = root
					right_icon = scope:chronicler

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}

					add_character_modifier = {
						modifier = legend_hangover_modifier
						years = 3
					}
				}
			}
		}

		stress_impact = {
			arrogant = minor_stress_impact_loss
			gluttonous = minor_stress_impact_loss
			humble = minor_stress_impact_gain
			temperate = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}

	option = { # You'll just have to believe me
		name = legend_spread_events.5420.b

		duel = {
			skill = diplomacy
			value = very_high_skill_rating
			50 = { #Chronicler is convinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = { # You're a drunkard
					has_trait = drunkard
					add = 7
				}
				modifier = { # You're a legend mate
					has_trait = lifestyle_reveler
					add = 4
				}
				modifier = { # You'll drink anything
					has_trait = gluttonous
					add = 2
				}
				desc = legend_spread_events.5420.b.success
				send_interface_toast = {
					title = legend_spread_events.5420.b.success
					left_icon = root
					right_icon = scope:chronicler
					
					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_increase }
					}
				}
			}
			
			50 = { # Chronicler is unconvinced
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = legend_spread_events.5420.b.failure
				send_interface_toast = {
					title = legend_spread_events.5420.b.failure
					left_icon = root
					right_icon = scope:chronicler

					promoted_legend = {
						change_legend_quality_effect = { VALUE = minor_legend_quality_decrease }
					}
				}
			}
		}

		stress_impact = {
			humble = miniscule_stress_impact_loss
			temperate = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
			gluttonous = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -0.5
			}
		}
	}

	option = { # I'm not warmed up :(
		name = legend_spread_events.5420.c

		random = {
			chance = 20
			send_interface_toast = {
				title = legend_spread_events.5420.c.tt
				left_icon = root
				
				add_character_modifier = {
					modifier = legend_shy_drinker
					years = 10
				}
			}
		}

		stress_impact = {
			arrogant = medium_stress_impact_gain
			stubborn = minor_stress_impact_gain
			humble = minor_stress_impact_loss
			fickle = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -1
			}
		}
	}
}
