﻿namespace = jason_locale_events

# VISITOR'S CAMP EVENTS

##################################################
# He Who Spurns the Fight
# by Jason Cantalini
# 100
##################################################

scripted_trigger jason_locale_events_100_knight_trigger = {
	is_knight_of = root
	is_ai = yes
	is_healthy = yes
	highest_held_title_tier < tier_county
	prowess > medium_skill_rating
}

scripted_trigger jason_locale_events_100_depressed_trigger = {
	OR = {
		AND = {
			any_memory = {
				memory_type = broke_up_lovers
			}
			NOR = {
				has_trait = callous
				has_trait = vengeful
				has_trait = brave
			}
		}
		AND = {
			any_memory = {
				memory_type = lover_died
			}
			NOR = {
				has_trait = callous
				has_trait = vengeful
				has_trait = brave
			}
		}
		AND = {
			any_memory = {
				memory_type = soulmate_died
			}
			NOR = {
				has_trait = callous
				has_trait = vengeful
				has_trait = brave
			}
		}
		AND = {
			any_memory = {
				memory_type = dog_died
			}
			NOR = {
				has_trait = callous
				has_trait = vengeful
				has_trait = brave
			}
		}
		AND = {
			any_memory = {
				memory_type = friend_died
			}
			NOR = {
				has_trait = callous
				has_trait = vengeful
				has_trait = brave
			}
		}
		AND = {
			has_trait = flagellant
			NOR = {
				has_trait = callous
				has_trait = vengeful
				has_trait = brave
			}
		}
		has_trait = depressed_genetic
		has_trait = depressed_1
		has_trait = reclusive
		has_trait = craven
	}
	NOR = {
		has_trait = diligent
		has_trait = ambitious
		has_trait = sadistic
	}
}

scripted_trigger jason_locale_events_100_mad_trigger = {
	OR = {
		has_trait = lunatic
		has_trait = berserker
	}
}

scripted_trigger jason_locale_events_100_demanding_trigger = {
	OR = {
		has_trait = greedy
		has_trait = ambitious
		has_trait = arrogant
		has_trait = disloyal
		has_trait = stubborn
	}
	NOR = {
		has_trait = diligent
		has_trait = loyal
		has_trait = humble
		has_trait = content
	}
}

scripted_trigger jason_locale_events_100_intoxicated_trigger = {
	OR = {
		has_trait = drunkard
		has_trait = hashishiyah
	}
	NOT = {
		has_trait = diligent
		has_trait = temperate
	}
}



#One of your best knights refuses to leave his tent and compete
jason_locale_events.100 = {
	type = activity_event
	title = jason_locale_events.100.t
	desc = {
		desc = jason_locale_events.100.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_mad_trigger = yes
					}
				}
				desc = jason_locale_events.100.desc.self_harm
			}
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				desc = jason_locale_events.100.desc.mess
			}
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_depressed_trigger = yes
					}
				}
				desc = jason_locale_events.100.desc.self_harm
			}
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_demanding_trigger = yes
					}
				}
				desc = jason_locale_events.100.desc.smug
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_mad_trigger = yes
					}
				}
				desc = jason_locale_events.100.desc.insanity
			}
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_intoxicated_trigger = yes
						has_trait = drunkard
					}
				}
				desc = jason_locale_events.100.desc.drunk
			}
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_intoxicated_trigger = yes
						has_trait = hashishiyah
					}
				}
				desc = jason_locale_events.100.desc.hash
			}
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_depressed_trigger = yes
					}
				}
				desc = jason_locale_events.100.desc.depressed
			}
			triggered_desc = {
				trigger = {
					scope:unreliable_knight = {
						jason_locale_events_100_demanding_trigger = yes
					}
				}
				desc = jason_locale_events.100.desc.demand
			}
		}
	}

	theme = tournament_locale_camp
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:unreliable_knight
  		triggered_animation = {
			trigger = {
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
			}
  			animation = paranoia
  		}
  		triggered_animation = {
			trigger = {
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					has_trait = drunkard
				}
			}
  			animation = drink_goblet
  		}
  		triggered_animation = {
			trigger = {
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					has_trait = hashishiyah
				}
			}
  			animation = happiness
  		}
  		triggered_animation = {
			trigger = {
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
				}
			}
  			animation = grief
  		}
  		#demanding knight
		animation = personality_callous
	}

	trigger = {
		scope:activity = {
			any_attending_character = {
				jason_locale_events_100_knight_trigger = yes
				OR = {
					jason_locale_events_100_depressed_trigger = yes
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_mad_trigger = yes
					jason_locale_events_100_intoxicated_trigger = yes
				}
			}
		}
		is_ruler = yes
	}

	immediate = {
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_100_knight_trigger = yes
						OR = {
							jason_locale_events_100_depressed_trigger = yes
							jason_locale_events_100_demanding_trigger = yes
							jason_locale_events_100_mad_trigger = yes
							jason_locale_events_100_intoxicated_trigger = yes
						}
						prowess > extremely_high_skill_rating
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_100_knight_trigger = yes
						OR = {
							jason_locale_events_100_depressed_trigger = yes
							jason_locale_events_100_demanding_trigger = yes
							jason_locale_events_100_mad_trigger = yes
							jason_locale_events_100_intoxicated_trigger = yes
						}
						prowess > extremely_high_skill_rating
					}
					weight = {
						base = 1
						modifier = {
							add = 25
							is_acclaimed = yes
						}
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = unreliable_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
		else_if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_100_knight_trigger = yes
						OR = {
							jason_locale_events_100_depressed_trigger = yes
							jason_locale_events_100_demanding_trigger = yes
							jason_locale_events_100_mad_trigger = yes
							jason_locale_events_100_intoxicated_trigger = yes
						}
						prowess > high_skill_rating
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_100_knight_trigger = yes
						OR = {
							jason_locale_events_100_depressed_trigger = yes
							jason_locale_events_100_demanding_trigger = yes
							jason_locale_events_100_mad_trigger = yes
							jason_locale_events_100_intoxicated_trigger = yes
						}
						prowess > high_skill_rating
					}
					weight = {
						base = 1
						modifier = {
							add = 25
							is_acclaimed = yes
						}
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = unreliable_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
		else_if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_100_knight_trigger = yes
						OR = {
							jason_locale_events_100_depressed_trigger = yes
							jason_locale_events_100_demanding_trigger = yes
							jason_locale_events_100_mad_trigger = yes
							jason_locale_events_100_intoxicated_trigger = yes
						}
						prowess > decent_skill_rating
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_100_knight_trigger = yes
						OR = {
							jason_locale_events_100_depressed_trigger = yes
							jason_locale_events_100_demanding_trigger = yes
							jason_locale_events_100_mad_trigger = yes
							jason_locale_events_100_intoxicated_trigger = yes
						}
						prowess > decent_skill_rating
					}
					weight = {
						base = 1
						modifier = {
							add = 25
							is_acclaimed = yes
						}
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = unreliable_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
		else_if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_100_knight_trigger = yes
						OR = {
							jason_locale_events_100_depressed_trigger = yes
							jason_locale_events_100_demanding_trigger = yes
							jason_locale_events_100_mad_trigger = yes
							jason_locale_events_100_intoxicated_trigger = yes
						}
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_100_knight_trigger = yes
						OR = {
							jason_locale_events_100_depressed_trigger =yes
							jason_locale_events_100_demanding_trigger =yes
							jason_locale_events_100_mad_trigger = yes
							jason_locale_events_100_intoxicated_trigger =yes
						}
					}
					weight = {
						base = 1
						modifier = {
							add = 25
							is_acclaimed = yes
						}
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = unreliable_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
	}

	# pressure the knight into competing
	option = {
		name = jason_locale_events.100.a
		flavor = jason_locale_events.100.a.tt

		every_knight = {
 			custom = custom.every_knight
 			add_opinion = {
				target = root
				modifier = angry_opinion
				opinion = -5
			}
 		}

		progress_towards_rival_effect = {
			CHARACTER = scope:unreliable_knight
			REASON = rival_forced_to_compete
			OPINION = -20
		}

		# knight gains character modifier making them bad at tournaments
		scope:unreliable_knight = {
			add_character_modifier = {
  				modifier = unwilling_tourneyer_modifier
 				years = 5
 			}
		}

		# stress effects based on knight's issue
		if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
			}
			stress_impact = {
				paranoid = major_stress_impact_gain
				lunatic_1 = major_stress_impact_gain
				lunatic_genetic = major_stress_impact_gain
				berserker = medium_stress_impact_gain
				zealous = major_stress_impact_gain
				forgiving = medium_stress_impact_gain
				compassionate = medium_stress_impact_gain
				craven = minor_stress_impact_gain
			}
		}
		else_if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_depressed_trigger = yes
				}
			}
			stress_impact = {
				craven = major_stress_impact_gain
				depressed_1 = medium_stress_impact_gain
				depressed_genetic = medium_stress_impact_gain
				forgiving = medium_stress_impact_gain
				compassionate = medium_stress_impact_gain
			}
		}

		# demanding knight is different enough to warrant separate stress block
		if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
			}
			stress_impact = {
				generous = medium_stress_impact_gain
				humble = medium_stress_impact_gain
				forgiving = medium_stress_impact_gain
				craven = minor_stress_impact_gain
				content = minor_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				content = major_stress_impact_gain
				compassionate = minor_stress_impact_gain
				humble = medium_stress_impact_gain
				forgiving = medium_stress_impact_gain
			}
		}

		ai_chance = {
			base = 100

			modifier = {
				factor = 0
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
				OR = {
					has_trait = berserker
					has_trait = lunatic_1
					has_trait = lunatic_genetic
					has_trait = paranoid
					has_trait = zealous
				}
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
				OR = {
					has_trait = forgiving
					has_trait = compassionate
					has_trait = craven
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
				has_trait = cynical

			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					has_trait = hashishiyah
					jason_locale_events_100_mad_trigger = no
				}
				has_trait = hashishiyah
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					has_trait = drunkard
					jason_locale_events_100_mad_trigger = no
				}
				has_trait = drunkard
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					jason_locale_events_100_mad_trigger = no
				}
				has_trait = temperate
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				has_trait = craven
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = depressed_1
					has_trait = depressed_genetic
					has_trait = forgiving
					has_trait = compassionate
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				has_trait = brave
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = humble
					has_trait = forgiving
					has_trait = craven
					has_trait = content
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = callous
					has_trait = sadistic
					has_trait = greedy
					has_trait = ambitious
					has_trait = just
					has_trait = diligent
				}
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				has_trait = content
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				OR = {
					has_trait = forgiving
					has_trait = compassionate
					has_trait = humble
					has_trait = forgiving
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				OR = {
					has_trait = callous
					has_trait = sadistic
					has_trait = ambitious
					has_trait = greedy
					has_trait = diligent
				}
			}
		}
	}
	# offer him and your other knights greater rewards for service
	option = {
		trigger = {
			scope:unreliable_knight = {
				OR = {
					AND = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = no
						jason_locale_events_100_intoxicated_trigger = no
					}
					AND = {
						jason_locale_events_100_demanding_trigger = yes
						jason_locale_events_100_mad_trigger = no
						jason_locale_events_100_intoxicated_trigger = no
						jason_locale_events_100_depressed_trigger = no
					}
				}
			}
		}
		name = jason_locale_events.100.b
		flavor = jason_locale_events.100.b.tt
		show_unlock_reason = no

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

		add_character_modifier = {
			modifier = generous_to_knights_modifier
			years = 20
		}

		# demanding knight is different enough to warrant separate stress block
		if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
			}
			stress_impact = {
				trusting = minor_stress_impact_loss
				stubborn = major_stress_impact_gain
				greedy = major_stress_impact_gain
				wrathful = major_stress_impact_gain
				content = major_stress_impact_gain
				vengeful = medium_stress_impact_gain
				just = medium_stress_impact_gain
				arrogant = minor_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				content = major_stress_impact_gain
				greedy = medium_stress_impact_gain
				wrathful = medium_stress_impact_gain
				compassionate = minor_stress_impact_gain
				forgiving = minor_stress_impact_gain
			}
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = stubborn
					has_trait = greedy
					has_trait = wrathful
					has_trait = content
				}
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = vengeful
					has_trait = just
					has_trait = arrogant
					has_trait = cynical
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = trusting
					has_trait = ambitious
					has_trait = generous
				}
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
				}
				has_trait = content
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
				}
				OR = {
					has_trait = wrathful
					has_trait = compassionate
					has_trait = greedy
					has_trait = forgiving
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
				}
				OR = {
					has_trait = ambitious
					has_trait = generous
				}
			}
		}
	}
	# dismiss the knight for this affront
	option = {
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							scope:unreliable_knight = {
								jason_locale_events_100_mad_trigger = yes
							}
						}
						desc = jason_locale_events.100.c.mad
					}
					triggered_desc = {
						trigger = {
							scope:unreliable_knight = {
								jason_locale_events_100_intoxicated_trigger = yes
								has_trait = drunkard
							}
						}
						desc = jason_locale_events.100.c.drunk
					}
					triggered_desc = {
						trigger = {
							scope:unreliable_knight = {
								jason_locale_events_100_intoxicated_trigger = yes
								has_trait = hashishiyah
							}
						}
						desc = jason_locale_events.100.c.hash
					}
					triggered_desc = {
						trigger = {
							scope:unreliable_knight = {
								jason_locale_events_100_depressed_trigger = yes
							}
						}
						desc = jason_locale_events.100.c.depressed
					}
					triggered_desc = {
						trigger = {
							scope:unreliable_knight = {
								jason_locale_events_100_demanding_trigger = yes
							}
						}
						desc = jason_locale_events.100.c.demanding
					}
				}
			}
		}
		flavor = jason_locale_events.100.c.tt
		if = {
			limit = {
				scope:unreliable_knight = {
					is_landed = yes
				}
			}
			hidden_effect = {
				scope:unreliable_knight = {
					set_knight_status = forbid
				}
			}
			scope:activity = {
				add_activity_log_entry = {
					key = knight_not_participating_log
					tags = { knight bad }
					score = 10
					character = root
					target = scope:unreliable_knight

					# Effects
					root = { custom_tooltip = jason_locale_events.100.c.forbid_knight }
				}
			}
		}
		else = {
			scope:activity = {
				add_activity_log_entry = {
					key = knight_dismissed_log
					tags = { knight bad }
					score = 20
					character = root
					target = scope:unreliable_knight

					# Effects
					root = {
						remove_courtier_or_guest = {
							character = scope:unreliable_knight
							new_location = root.location
						}
					}
				}
			}
		}

 		if = {
 			limit = {
 				can_set_relation_rival_trigger = {
					CHARACTER = scope:unreliable_knight
 				}
 				NOT = {
 					has_relation_nemesis = scope:unreliable_knight
 				}
 			}
 			set_relation_rival = {
				target = scope:unreliable_knight
				reason = rival_dismissed_knight
			}
		}
		else_if = {
			limit = {
				can_set_relation_rival_trigger = {
					CHARACTER = scope:unreliable_knight
 				}
			}
			set_relation_nemesis = {
				target = scope:unreliable_knight
				reason = rival_dismissed_knight
			}
		}
		else = {
 			progress_towards_rival_effect = {
				CHARACTER = scope:unreliable_knight
				REASON = rival_dismissed_knight
				OPINION = -40
			}
 		}
 		custom_tooltip = jason_locale_events.100.d.not_competing
 		scope:unreliable_knight = {
 			add_character_flag = tournament_not_competing
 		}

 		if = {
 			limit = {
 		 		faith_forbids_alcohol_trigger = yes
 		 		scope:unreliable_knight = {
 		 			jason_locale_events_100_mad_trigger = no
 		 			has_trait = drunkard
 		 		}
 			}
 			add_piety = medium_piety_gain
 		}

		# hypocrisy stress
		if = {
			limit = {
				OR = {
					has_trait = depressed_1
					has_trait = depressed_genetic
					has_trait = flagellant
					has_trait = reclusive
					has_trait = craven
				}
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
					NOR = {
						jason_locale_events_100_intoxicated_trigger = yes
						jason_locale_events_100_mad_trigger = yes
					}
				}
			}
			stress_impact = {
				depressed_1 = medium_stress_impact_gain
				depressed_genetic = medium_stress_impact_gain
				flagellant = medium_stress_impact_gain
				reclusive = medium_stress_impact_gain
				craven = medium_stress_impact_gain
			}
		}
		else_if = {
			limit = {
				has_trait = ambitious
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					NOR = {
						jason_locale_events_100_intoxicated_trigger = yes
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
					}
				}
			}
			stress_impact = {
				ambitious = minor_stress_impact_gain
			}
		}
		else_if = {
			limit = {
				has_trait = hashishiyah
				scope:unreliable_knight = {
					has_trait = hashishiyah
					NOT = {
						jason_locale_events_100_mad_trigger = yes
					}
				}
			}
			stress_impact = {
				hashishiyah = major_stress_impact_gain
			}
		}
		else_if = {
			limit = {
				has_trait = drunkard
				scope:unreliable_knight = {
					has_trait = drunkard
					NOT = {
						jason_locale_events_100_mad_trigger = yes
					}
				}
			}
			stress_impact = {
				drunkard = major_stress_impact_gain
			}
		}
		else_if = {
			limit = {
				OR = {
					has_trait = lunatic_1
					has_trait = lunatic_genetic
					has_trait = berserker
				}
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
			}
			stress_impact = {
				lunatic_1 = major_stress_impact_gain
				lunatic_genetic = major_stress_impact_gain
				berserker = medium_stress_impact_gain
			}
		}

		# stress effects based on knight's issue
		if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
			}
			stress_impact = {
				paranoid = minor_stress_impact_loss
			}
		}
		else_if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					jason_locale_events_100_mad_trigger = no
				}
			}
			stress_impact = {
				temperate = minor_stress_impact_loss
			}
		}
		else_if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
			}
			stress_impact = {
				brave = minor_stress_impact_loss
			}
		}

		# demanding knight is different enough to warrant separate stress block
		if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
			}
			stress_impact = {
				vengeful = minor_stress_impact_loss
				wrathful = minor_stress_impact_loss
				greedy = minor_stress_impact_loss
				content = minor_stress_impact_loss
				ambitious = major_stress_impact_gain
				generous = major_stress_impact_gain
				craven = medium_stress_impact_gain
				calm = minor_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				vengeful = minor_stress_impact_loss
				wrathful = minor_stress_impact_loss
				forgiving = major_stress_impact_gain
				compassionate = medium_stress_impact_gain
				generous = medium_stress_impact_gain
				ambitious = medium_stress_impact_gain
				calm = minor_stress_impact_gain
			}
		}

		ai_chance = {
			base = 100

			modifier = {
				factor = 0
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
				OR = {
					has_trait = possessed
					has_trait = lunatic_1
					has_trait = lunatic_genetic
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
				has_trait = paranoid

			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					has_trait = hashishiyah
					jason_locale_events_100_mad_trigger = no
				}
				has_trait = hashishiyah
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					has_trait = drunkard
					jason_locale_events_100_mad_trigger = no
				}
				has_trait = drunkard
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					jason_locale_events_100_mad_trigger = no
				}
				has_trait = temperate
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = depressed_1
					has_trait = depressed_genetic
					has_trait = flagellant
					has_trait = reclusive
					has_trait = craven
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				has_trait = brave
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = ambitious
					has_trait = generous
				}
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = craven
					has_trait = calm
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = vengeful
					has_trait = wrathful
					has_trait = greedy
					has_trait = content
				}
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				has_trait = forgiving
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				OR = {
					has_trait = generous
					has_trait = ambitious
					has_trait = calm
					has_trait = compassionate
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				OR = {
					has_trait = vengeful
					has_trait = wrathful
				}
			}
		}
	}
	# bid the knight rest
	option = {
		name = jason_locale_events.100.d
 		if = {
 			limit = {
 				OR = {
 					jason_locale_events_100_mad_trigger = yes
 					jason_locale_events_100_intoxicated_trigger = yes
 					jason_locale_events_100_depressed_trigger = yes
 				}
 			}
 			progress_towards_friend_effect = {
				CHARACTER = scope:unreliable_knight
				OPINION = 20
				REASON = friend_sympathy_to_unwilling_knight
			}
		}
		scope:unreliable_knight = {
			accolade_minimal_glory_loss_with_checks_effect = yes
		}
		add_prestige = minor_prestige_loss

		custom_tooltip = jason_locale_events.100.d.not_competing
		scope:unreliable_knight = {
 			add_character_flag = tournament_not_competing
 		}

		scope:activity = {
			add_activity_log_entry = {
				key = knight_not_participating_log
				tags = { bad }
				score = 10
				character = root
				target = scope:unreliable_knight
			}
		}

		if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
			}
			stress_impact = {
				just = medium_stress_impact_gain
			}
		}
		else_if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					jason_locale_events_100_mad_trigger = no
				}
			}
			stress_impact = {
				temperate = major_stress_impact_gain
				just = medium_stress_impact_gain
				diligent = minor_stress_impact_gain
			}
		}
		else_if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_depressed_trigger = yes
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
			}
			stress_impact = {
				brave = medium_stress_impact_gain
			}
		}

		if = {
			limit = {
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
			}
			stress_impact = {
				ambitious = major_stress_impact_gain
				wrathful = major_stress_impact_gain
				vengeful = major_stress_impact_gain
				diligent = medium_stress_impact_gain
				generous = minor_stress_impact_gain
				brave = minor_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				ambitious = major_stress_impact_gain
				callous = major_stress_impact_gain
				sadistic = major_stress_impact_gain
				wrathful = major_stress_impact_gain
				stubborn = medium_stress_impact_gain
				arrogant = medium_stress_impact_gain
				vengeful = minor_stress_impact_gain
			}
		}

		ai_chance = {
			base = 100

			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
				has_trait = just

			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_mad_trigger = yes
				}
				OR = {
					has_trait = possessed
					has_trait = lunatic_1
					has_trait = lunatic_genetic
				}
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					jason_locale_events_100_mad_trigger = no
				}
				has_trait = temperate
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					jason_locale_events_100_mad_trigger = no
				}
				OR = {
					has_trait = just
					has_trait = diligent
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					jason_locale_events_100_intoxicated_trigger = yes
					jason_locale_events_100_mad_trigger = no
				}
				OR = {
					has_trait = hashishiyah
					has_trait = drunkard
				}
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = ambitious
					has_trait = wrathful
					has_trait = vengeful
					has_trait = generous
					has_trait = diligent
					has_trait = brave
				}
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					jason_locale_events_100_demanding_trigger = yes
					jason_locale_events_100_depressed_trigger = no
					jason_locale_events_100_mad_trigger = no
					jason_locale_events_100_intoxicated_trigger = no
				}
				OR = {
					has_trait = generous
					has_trait = diligent
					has_trait = brave
				}
			}
			modifier = {
				factor = 0
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				OR = {
					has_trait = ambitious
					has_trait = callous
					has_trait = sadistic
					has_trait = wrathful
				}
			}
			modifier = {
				add = -75
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				OR = {
					has_trait = arrogant
					has_trait = vengeful
					has_trait = impatient
					has_trait = stubborn
				}
			}
			modifier = {
				add = 100
				scope:unreliable_knight = {
					OR = {
						jason_locale_events_100_depressed_trigger = yes
						jason_locale_events_100_mad_trigger = yes
						jason_locale_events_100_intoxicated_trigger = yes
					}
				}
				OR = {
					has_trait = compassionate
					has_trait = forgiving
				}
			}
		}
	}
}


# TAVERN EVENTS

##################################################
# Allegiance, Burped
# by Jason Cantalini
# 200
##################################################

scripted_trigger jason_locale_events_200_knight_trigger = {
	is_knight = yes
	NOR = {
		is_courtier_of = root
		# No champions
		liege.court_position:champion_court_position ?= this
	}
	is_ai = yes
	is_healthy = yes
	is_landed = no
	prowess >= 14
	opinion = {
		target = root
		value > -15
	}
	opinion = {
		target = liege
		value <= 25
	}
	OR = {
		has_trait = drunkard
		NOR = {
			has_trait = temperate
			has_trait = loyal
			has_trait = just
			has_trait = shy
			has_trait = reclusive
			has_trait = calm
			faith_forbids_alcohol_trigger = yes
		}
	}
}

scripted_trigger jason_locale_events_200_extra_knight_trigger = {
	is_knight = yes
	NOR = {
		is_courtier_of = root
		this = scope:drunk_knight
		liege.court_position:champion_court_position ?= this
	}
	is_ai = yes
	is_healthy = yes
	is_landed = no
	prowess >= 11
	opinion = {
		target = root
		value >= -20
	}
	trigger_if = {
		limit = { exists = liege }
		liege = { is_ai = yes }
		opinion = {
			target = liege
			value < 40
		}
	}
	liege = { is_ai = yes }
	OR = {
		has_trait = drunkard
		NOR = {
			has_trait = temperate
			has_trait = loyal
			has_trait = just
			has_trait = shy
			has_trait = reclusive
			has_trait = calm
			faith_forbids_alcohol_trigger = yes
		}
	}
	is_acclaimed = no
}

scripted_trigger jason_locale_events_200_drunk_root_trigger = {
	OR = {
		has_trait = drunkard
		AND = {
			faith_forbids_alcohol_trigger = no
			has_trait = lifestyle_reveler
		}
	}
}

scripted_trigger jason_locale_events_200_surpise_marriage_trigger = {
	is_courtier_of = root
	is_adult = yes
	is_ai = yes
	is_married = no
	NOR = {
		has_relation_lover = root
		has_relation_soulmate = root
	}
	can_marry_character_trigger = { CHARACTER = scope:drunk_knight }
}

scripted_trigger jason_locale_events_200_family_trigger = {
	is_councillor = no
	is_landed = no
	NAND = {
		exists = liege
		is_heir_of = liege
	}
}

#A renowned knight drunkenly offers you his fealty, although it would violate his oaths to his liege

jason_locale_events.200 = {
	type = activity_event
	title = jason_locale_events.200.t
	desc = {
		desc = jason_locale_events.200.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					jason_locale_events_200_drunk_root_trigger = no
				}
				desc = jason_locale_events.200.desc.caution
			}
			triggered_desc = {
				trigger = {
					jason_locale_events_200_drunk_root_trigger = yes
				}
				desc = jason_locale_events.200.desc.party
			}
		}
	}

	theme = tournament_locale_tavern
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				jason_locale_events_200_drunk_root_trigger = yes
			}
  			animation = toast_goblet
  		}
  		animation = personality_content
	}
	right_portrait = {
		character = scope:drunk_knight
  		animation = wedding_drunk
	}
	lower_right_portrait = {
		character = scope:drunk_knight.liege
	}

	trigger = {
		is_ai = no
		scope:activity = {
			any_attending_character = {
				jason_locale_events_200_knight_trigger = yes
			}
		}
		scope:host = {
			faith_forbids_alcohol_trigger = no
		}
		age >= 12
		is_ruler = yes
	}

	immediate = {
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_200_knight_trigger = yes
						liege = {
							is_powerful_vassal_of = root
						}
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_200_knight_trigger = yes
						liege = {
							is_powerful_vassal_of = root
						}
					}
					weight = {
						base = 1
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = drunk_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
		else_if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_200_knight_trigger = yes
						liege = {
							is_vassal_of = root
						}
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_200_knight_trigger = yes
						liege = {
							is_vassal_of = root
						}
					}
					weight = {
						base = 1
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = drunk_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
		else_if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_200_knight_trigger = yes
						liege = {
							this = root.liege
						}
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_200_knight_trigger = yes
						liege = {
							this = root.liege
						}
					}
					weight = {
						base = 1
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = drunk_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
		else_if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_200_knight_trigger = yes
						liege = {
							highest_held_title_tier = root.highest_held_title_tier
						}
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_200_knight_trigger = yes
						liege = {
							highest_held_title_tier = root.highest_held_title_tier
						}
					}
					weight = {
						base = 1
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = drunk_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_200_knight_trigger = yes
					}
					weight = {
						base = 1
						activity_recurring_character_weight_modifier = { VALUE = 100 }
					}
					save_scope_as = drunk_knight
					try_to_create_recurring_character_effect = { CHARACTER = root }
				}
			}
		}
		# save a character to be the victim of the drunken marriage arrangement
		scope:drunk_knight.liege = {
			save_scope_as = drunk_knight_liege
		}
		if = {
			limit = {
				exists = root.house
				root.house = {
					any_house_member = {
						jason_locale_events_200_surpise_marriage_trigger = yes
					}
				}
			}
			root.house = {
				random_house_member = {
					limit = {
						jason_locale_events_200_surpise_marriage_trigger = yes
					}
					save_scope_as = surprise_spouse
				}
			}
		}
		# save knights to get caught up in the drunken oath-swearings
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_200_extra_knight_trigger = yes
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_200_extra_knight_trigger = yes
					}
					save_scope_as = extra_knight
				}
			}
			scope:extra_knight.liege = {
				save_scope_as = extra_knight_liege
			}
		}
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						jason_locale_events_200_extra_knight_trigger = yes
						this != scope:extra_knight
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_200_extra_knight_trigger = yes
						this != scope:extra_knight
					}
					save_scope_as = extra_knight_2
				}
			}
			scope:extra_knight_2.liege = {
				save_scope_as = extra_knight_2_liege
			}
		}
	}

	# YES! PARTY TIME!
	option = {
		trigger = {
			jason_locale_events_200_drunk_root_trigger = yes
		}
		name = jason_locale_events.200.a
		flavor = jason_locale_events.200.a.tt

		if = {
			limit = {
				faith_forbids_alcohol_trigger = yes
			}
			add_piety = minor_piety_loss
		}

		scope:drunk_knight = {
			accolade_minimal_glory_loss_with_checks_effect = yes
		}

		hidden_effect = { #Progress in the reveler lifestyle
			if = {
				limit = { NOT = { has_variable = reveler_lifestyle_progress } }
				set_variable = {
					name = reveler_lifestyle_progress
					value = 1
				}
			}
			else = {
				change_variable = {
					name = reveler_lifestyle_progress
					add = 1
				}
			}
			if = {
				limit = {
					scope:drunk_knight = {
						NOT = { has_variable = reveler_lifestyle_progress }
					}
				}
				scope:drunk_knight = {
					set_variable = {
						name = reveler_lifestyle_progress
						value = 1
					}
				}
			}
			else = {
				scope:drunk_knight = {
					change_variable = {
						name = reveler_lifestyle_progress
						add = 1
					}
				}
			}
		}

		random_list = {
			25 = {
				modifier = {
					factor = 1.5
					has_trait = gallant
				}
				modifier = {
					factor = 1.5
					prestige_level >= 4
				}
				trigger = {
					exists = scope:extra_knight
					exists = scope:extra_knight_2
				}
				desc = jason_locale_events.200.a.tt.recruit
				hidden_effect = {
					scope:extra_knight_liege = {
						add_opinion = {
							target = root
							opinion = -15
							modifier = angry_opinion
						}
					}
					scope:extra_knight_2_liege = {
						add_opinion = {
							target = root
							opinion = -15
							modifier = angry_opinion
						}
					}
					add_courtier = scope:extra_knight
					add_courtier = scope:extra_knight_2
					if = {
						limit = {
							exists = scope:extra_knight.primary_spouse
							scope:extra_knight.primary_spouse = {
								jason_locale_events_200_family_trigger = yes
								is_courtier_of = scope:extra_knight_liege
							}
						}
						add_courtier = scope:extra_knight.primary_spouse
					}
					if = {
						limit = {
							exists = scope:extra_knight_2.primary_spouse
							scope:extra_knight_2.primary_spouse = {
								jason_locale_events_200_family_trigger = yes
								is_courtier_of = scope:extra_knight_liege
							}
						}
						add_courtier = scope:extra_knight_2.primary_spouse
					}
					if = {
						limit = {
							scope:extra_knight = {
								any_child = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:extra_knight_liege
									is_adult = no
								}
							}
						}
						scope:extra_knight = {
							every_child = {
								limit = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:extra_knight_liege
									is_adult = no
								}
								save_scope_as = new_courtier
								root = {
									add_courtier = scope:new_courtier
								}
							}
						}
					}
					if = {
						limit = {
							scope:extra_knight_2 = {
								any_child = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:extra_knight_liege
									is_adult = no
								}
							}
						}
						scope:extra_knight_2 = {
							every_child = {
								limit = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:extra_knight_liege
									is_adult = no
								}
								save_scope_as = new_courtier
								root = {
									add_courtier = scope:new_courtier
								}
							}
						}
					}
				}
				custom_tooltip = {
					text = jason_locale_events.200.a.tt.recruit_desc
				}
				send_interface_toast = {
					title = jason_locale_events.200.a.tt.recruit_specific
					left_icon = scope:extra_knight
					right_icon = scope:extra_knight_2
					scope:activity = {
						add_activity_log_entry = {
							key = drunk_oaths_log
							tags = { knight good }
							score = 20
							character = root
							target = scope:drunk_knight

							# Effect
							root = {
								custom_tooltip = jason_locale_events.200.a.tt.join_three
								custom_tooltip = jason_locale_events.200.a.tt.recruit_lieges
							}
						}
					}
					hidden_effect = {
						add_courtier = scope:drunk_knight
						if = {
							limit = {
								exists = scope:drunk_knight.primary_spouse
								scope:drunk_knight.primary_spouse = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:drunk_knight_liege
								}
							}
							add_courtier = scope:drunk_knight.primary_spouse
						}
						if = {
							limit = {
								scope:drunk_knight = {
									any_child = {
										jason_locale_events_200_family_trigger = yes
										is_courtier_of = scope:drunk_knight_liege
										is_adult = no
									}
								}
							}
							scope:extra_knight = {
								every_child = {
									limit = {
										jason_locale_events_200_family_trigger = yes
										is_courtier_of = scope:drunk_knight_liege
										is_adult = no
									}
									save_scope_as = new_courtier
									root = {
										add_courtier = scope:new_courtier
									}
								}
							}
						}
						progress_towards_rival_effect = {
							CHARACTER = scope:drunk_knight_liege
							REASON = rival_poached_drunk_knight
							OPINION = -20
						}
					}
				}

			}
			# the drunk knight sings of your glory
			30 = {
				modifier = {
					factor = 1.5
					scope:drunk_knight.culture = {
						OR = {
							has_cultural_tradition = tradition_fp1_northern_stories
 							has_cultural_tradition = tradition_poetry
							has_cultural_tradition = tradition_storytellers
						}
					}
				}
				modifier = {
					factor = 2
					scope:drunk_knight = {
						has_trait = lifestyle_poet
					}
				}
				modifier = {
					factor = 1.5
					scope:drunk_knight = {
						diplomacy > 14
					}
				}
				modifier = {
					factor = 0.5
					scope:drunk_knight = {
						diplomacy < 10
					}
				}
				trigger = {
					scope:drunk_knight = {
						NOT = {
							has_trait = compassionate
						}
					}
				}
				desc = jason_locale_events.200.a.tt.song
				send_interface_toast = {
					title = jason_locale_events.200.a.tt.song_specific
					left_icon = scope:drunk_knight
					scope:activity = {
						add_activity_log_entry = {
							key = poached_drunk_knight_log
							tags = { knight good }
							score = 20
							character = root
							target = scope:drunk_knight

							# Effect
							root = {
								add_prestige = minor_prestige_gain
							}
						}
					}
					custom_tooltip = jason_locale_events.200.a.tt.join
					if = {
						limit = {
							scope:drunk_knight = {
								has_trait = tourney_participant
							}
						}
						scope:drunk_knight = {
							add_trait_xp = {
								trait = tourney_participant
								track = wit
								value = 10
							}
						}
					}
					hidden_effect = {
						add_courtier = scope:drunk_knight
						if = {
							limit = {
								exists = scope:drunk_knight.primary_spouse
								scope:drunk_knight.primary_spouse = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:drunk_knight_liege
								}
							}
							add_courtier = scope:drunk_knight.primary_spouse
						}
						if = {
							limit = {
								scope:drunk_knight = {
									any_child = {
										jason_locale_events_200_family_trigger = yes
										is_courtier_of = scope:drunk_knight_liege
										is_adult = no
									}
								}
							}
							scope:extra_knight = {
								every_child = {
									limit = {
										jason_locale_events_200_family_trigger = yes
										is_courtier_of = scope:drunk_knight_liege
										is_adult = no
									}
									save_scope_as = new_courtier
									root = {
										add_courtier = scope:new_courtier
									}
								}
							}
						}
						progress_towards_rival_effect = {
							CHARACTER = scope:drunk_knight_liege
							REASON = rival_poached_drunk_knight
							OPINION = -20
						}
					}
				}
			}
			# the drunk knight beats up a bunch of people
			25 = {
				modifier = {
					factor = 1.5
					scope:drunk_knight = {
						has_trait = wrathful
					}
				}
				modifier = {
					factor = 1.5
					scope:drunk_knight = {
						has_trait = sadistic
					}
				}
				modifier = {
					factor = 1.5
					scope:drunk_knight = {
						has_trait = berserker
					}
				}
				trigger = {
					scope:drunk_knight = {
						NOT = {
							has_trait = compassionate
						}
					}
				}
				desc = jason_locale_events.200.a.tt.beatings
				send_interface_toast = {
					title = jason_locale_events.200.a.tt.beatings_specific
					left_icon = scope:drunk_knight
					scope:activity = {
						add_activity_log_entry = {
							key = drunk_knight_beats_log
							score = 25
							tags = { good }
							character = root
							target = scope:drunk_knight

							# Effects
							scope:activity = {
								tournament_wound_non_root_combatants_effect = yes
							}
							root = {
								add_dread = minor_dread_gain
								custom_tooltip = jason_locale_events.200.a.tt.join
							}
						}
					}
					if = {
						limit = {
							scope:drunk_knight = {
								has_trait = tourney_participant
							}
						}
						scope:drunk_knight = {
							add_trait_xp = {
								trait = tourney_participant
								track = foot
								value = 10
							}
						}
					}
					hidden_effect = {
						add_courtier = scope:drunk_knight
						if = {
							limit = {
								exists = scope:drunk_knight.primary_spouse
								scope:drunk_knight.primary_spouse = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:drunk_knight_liege
								}
							}
							add_courtier = scope:drunk_knight.primary_spouse
						}
						if = {
							limit = {
								scope:drunk_knight = {
									any_child = {
										jason_locale_events_200_family_trigger = yes
										is_courtier_of = scope:drunk_knight_liege
										is_adult = no
									}
								}
							}
							scope:drunk_knight = {
								every_child = {
									limit = {
										jason_locale_events_200_family_trigger = yes
										is_courtier_of = scope:drunk_knight_liege
										is_adult = no
									}
									save_scope_as = new_courtier
									root = {
										add_courtier = scope:new_courtier
									}
								}
							}
						}
						progress_towards_rival_effect = {
							CHARACTER = scope:drunk_knight_liege
							REASON = rival_poached_drunk_knight
							OPINION = -20
						}
					}
				}
			}
			# the knight gets himself a marriage into your family
			10 = {
				modifier = {
					factor = 2
					scope:surprise_spouse = {
						NOT = {
							is_child_of = root
						}
					}
				}
				trigger = {
					exists = scope:surprise_spouse
					scope:drunk_knight = {
						can_marry_trigger = yes
					}
				}
				desc = jason_locale_events.200.a.tt.marry
				hidden_effect = {
					if = {
						limit = {
							scope:surprise_spouse = { is_female = yes }
							scope:drunk_knight = {
								NOT = { is_heir_of = scope:drunk_knight_liege }
							}
						}
						scope:surprise_spouse = { marry_matrilineal = scope:drunk_knight }
					}
					else = {
						scope:surprise_spouse = { marry = scope:drunk_knight }
					}
				}
				custom_tooltip = jason_locale_events.200.a.tt.marry_desc
				send_interface_toast = {
					title = jason_locale_events.200.a.tt.marry_specific
					left_icon = scope:surprise_spouse
					right_icon = scope:drunk_knight
					scope:activity = {
						add_activity_log_entry = {
							key = drunk_knight_marries_log
							score = 25
							tags = { knight good }
							character = root
							target = scope:drunk_knight

							# Effects
							root = {
								custom_tooltip = jason_locale_events.200.a.tt.join
								add_prestige = miniscule_prestige_loss
							}
						}
					}
					hidden_effect = {
						reverse_add_opinion = {
							target = scope:drunk_knight
							modifier = grateful_opinion
							opinion = 25
						}
						add_courtier = scope:drunk_knight
						if = {
							limit = {
								exists = scope:drunk_knight.primary_spouse
								scope:drunk_knight.primary_spouse = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:drunk_knight_liege
								}
							}
							add_courtier = scope:drunk_knight.primary_spouse
						}
						if = {
							limit = {
								scope:drunk_knight = {
									any_child = {
										jason_locale_events_200_family_trigger = yes
										is_courtier_of = scope:drunk_knight_liege
										is_adult = no
									}
								}
							}
							scope:drunk_knight = {
								every_child = {
									limit = {
										jason_locale_events_200_family_trigger = yes
										is_courtier_of = scope:drunk_knight_liege
										is_adult = no
									}
									save_scope_as = new_courtier
									root = {
										add_courtier = scope:new_courtier
									}
								}
							}
						}
						progress_towards_rival_effect = {
							CHARACTER = scope:drunk_knight_liege
							REASON = rival_poached_drunk_knight
							OPINION = -20
						}
					}
				}
			}
			# the knight can't keep up... and drinks himself to death
			10 = {
				modifier = {
					factor = 2
					scope:drunk_knight = {
						OR = {
							has_trait = physique_bad_1
							has_trait = physique_bad_2
							has_trait = physique_bad_3
						}
					}
				}
				modifier = {
					factor = 0.5
					scope:drunk_knight = {
						OR = {
							has_trait = physique_good_1
							has_trait = physique_good_2
							has_trait = physique_good_3
							has_trait = giant
							AND = {
								has_trait = lifestyle_reveler
								has_trait_xp = {
									trait = lifestyle_reveler
									value < 50
								}
							}
						}
					}
				}
				modifier = {
					factor = 0.1
					scope:drunk_knight = {
						OR = {
							has_trait = drunkard
							has_trait = lifestyle_reveler
							AND = {
								has_trait = lifestyle_reveler
								has_trait_xp = {
									trait = lifestyle_reveler
									value >= 50
								}
							}
						}
					}
				}
				desc = jason_locale_events.200.a.tt.death
				send_interface_toast = {
					title = jason_locale_events.200.a.tt.death_specific
					left_icon = scope:drunk_knight
					scope:activity = {
						add_activity_log_entry = {
							key = drunk_knight_dies_log
							tags = { knight bad }
							score = 20
							character = root
							target = scope:drunk_knight

							# Effect
							scope:drunk_knight = {
								death = { death_reason = death_drinking_passive }
							}
						}
					}
					hidden_effect = {
						if = {
							limit = {
								scope:drunk_knight = {
									is_acclaimed = yes
								}
							}
							scope:drunk_knight = {
								accolade = {
									add_glory = minor_glory_loss
								}
							}
						}
					}
					if = {
						limit = {
							NOR = {
								has_trait = sadistic
								has_trait = callous
								has_trait = arrogant
							}
						}
						stress_impact = {
							base = medium_stress_impact_gain
						}
					}
				}

			}
		}

		stress_impact = {
			drunkard = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
			temperate = massive_stress_impact_gain
			just = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25

			modifier = {
				factor = 0
				OR = {
					has_trait = temperate
					has_trait = shy
					has_trait = paranoid
					has_trait = just
				}
			}
			modifier = {
				add = -20
				OR = {
					has_trait = humble
					has_trait = calm
					has_trait = craven
				}
			}
			modifier = {
				add = 50
				OR = {
					has_trait = drunkard
					has_trait = gregarious
					has_trait = arbitrary
					has_trait = arrogant
				}
			}
		}
	}

	# accept the drunken oath
	option = {
		name = jason_locale_events.200.b
		flavor = jason_locale_events.200.b.tt
		scope:drunk_knight = {
			accolade_minimal_glory_loss_with_checks_effect = yes
		}
		scope:activity = {
			add_activity_log_entry = {
				key = poached_drunk_knight_log
				tags = { knight good }
				score = 20
				character = root
				target = scope:drunk_knight

				# Effect
				root = {
					add_courtier = scope:drunk_knight
					if = {
						limit = {
							exists = scope:drunk_knight.primary_spouse
							scope:drunk_knight.primary_spouse = {
								jason_locale_events_200_family_trigger = yes
								is_courtier_of = scope:drunk_knight_liege
							}
						}
						add_courtier = scope:drunk_knight.primary_spouse
					}
					if = {
						limit = {
							scope:drunk_knight = {
								any_child = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:drunk_knight_liege
									is_adult = no
								}
							}
						}
						scope:drunk_knight = {
							every_child = {
								limit = {
									jason_locale_events_200_family_trigger = yes
									is_courtier_of = scope:drunk_knight_liege
									is_adult = no
								}
								save_scope_as = new_courtier
								root = {
									add_courtier = scope:new_courtier
								}
							}
						}
					}
					progress_towards_rival_effect = {
						CHARACTER = scope:drunk_knight_liege
						REASON = rival_poached_drunk_knight
						OPINION = -20
					}
				}
			}
		}

		stress_impact = {
			paranoid = major_stress_impact_gain
			just = major_stress_impact_gain
			honest = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			temperate = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100

			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = just
				}
			}
			modifier = {
				add = -75
				OR = {
					has_trait = honest
					has_trait = forgiving
					has_trait = content
					has_trait = temperate
				}
			}
			modifier = {
				add = 50
				OR = {
					has_trait = trusting
					has_trait = ambitious
					has_trait = deceitful
				}
			}
		}
	}
	# rat on the knight to their liege
	option = {
		trigger = {
			jason_locale_events_200_drunk_root_trigger = no
		}
		name = jason_locale_events.200.c
		flavor = jason_locale_events.200.c.tt

		if = {
			limit = {
				faith_forbids_alcohol_trigger = yes
			}
			add_piety = minor_piety_gain
		}

		# DOES THE DRUNK SLAP YOU?
		random_list = {
			# Slap? You? Ridiculous
			75 = {
				desc = jason_locale_events.200.c.unchallenged
				send_interface_toast = {
					title = jason_locale_events.200.c.unchallenged
					left_icon = root
					right_icon = scope:drunk_knight
					if = {
						limit = {
							scope:drunk_knight = {
								is_acclaimed = yes
								exists = accolade
							}
						}
						scope:drunk_knight = {
							accolade = {
								add_glory = major_glory_loss
							}
						}
					}
					add_dread = minor_dread_gain
				}
			}
			# Liquid courage is a helluva drug
			25 = {
				desc = jason_locale_events.200.c.attacked
				# is he going to attack a woman? Unlikely
				modifier = {
					add = -25
					NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:drunk_knight } }
				}
				# you're too scary to attack
				modifier = {
					add = -10
					dread >= 70
				}
				modifier = {
					add = -10
					dread >= 40
				}
				# he's an angry bean
				modifier = {
					add = 25
					scope:drunk_knight = {
						OR = {
							has_trait = irritable
							has_trait = wrathful
							has_trait = sadistic
							has_trait = callous
							has_trait = fickle
							has_trait = vengeful
						}
					}
				}
				# he's a nice boi
				modifier = {
					add = -15
					scope:drunk_knight = {
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = craven
						}
					}
				}
				#Brawl!
				if = {
					limit = {
						can_start_single_combat_trigger = yes
						scope:drunk_knight = { can_start_single_combat_trigger = yes }
					}
					custom_tooltip = jason_locale_events.200.c.duel.tt
					save_scope_as = snitch
					send_interface_toast = {
						title = jason_locale_events.200.c.duel.tt
						left_icon = root
						right_icon = scope:drunk_knight

						scope:drunk_knight = {
							hidden_effect = {
								force_character_skill_recalculation = yes
								add_character_modifier = duel_edge_debuff_08_modifier
							}
						}
						configure_start_single_combat_effect = {
							SC_INITIATOR = scope:drunk_knight
							SC_ATTACKER = scope:drunk_knight
							SC_DEFENDER = root
							FATALITY = practice
							FIXED = no
							LOCALE = tavern
							OUTPUT_EVENT = jason_locale_events.201
							INVALIDATION_EVENT = single_combat.1006
						}
					}
				}
				# the knight just slaps you, there's no fight to be had
				else = {
					send_interface_toast = {
						title = jason_locale_events.200.c.attacked
						left_icon = root
						right_icon = scope:drunk_knight
						custom_tooltip = jason_locale_events.200.c.slap.tt

						stress_impact = {
							base = minor_stress_impact_gain
						}
						scope:drunk_knight = {
							accolade = {
								add_glory = major_glory_loss
							}
						}
					}
				}
			}
		}
		scope:drunk_knight_liege = {
			add_opinion = {
   				target = root
				modifier = grateful_opinion
				opinion = 20
			}
		}
		scope:drunk_knight = {
			add_opinion = {
   				target = root
				modifier = angry_opinion
				opinion = -40
			}
		}

		hidden_effect = {
			scope:drunk_knight_liege = {
				add_opinion = {
   					target = scope:drunk_knight
					modifier = annoyed_opinion
					opinion = -40
				}
			}
		}
		stress_impact = {
			temperate = minor_stress_impact_loss
			arbitrary = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			craven = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100

			modifier = {
				factor = 0
				OR = {
					has_trait = arbitrary
					has_trait = forgiving
					has_trait = compassionate
				}
			}
			modifier = {
				add = -75
				has_trait = craven

			}
			modifier = {
				add = 50
				OR = {
					has_trait = just
					has_trait = vengeful
					has_trait = paranoid
				}
			}
		}
	}

	# gently persuade the knight not to make rash choices
	option = {
		name = jason_locale_events.200.d
		flavor = jason_locale_events.200.d.tt

		add_character_modifier = {
  			modifier = safeguards_knightly_honor_modifier
 			years = 5
 		}

		stress_impact = {
			loyal = minor_stress_impact_loss
			disloyal = medium_stress_impact_gain
			ambitious = medium_stress_impact_gain
			drunkard = medium_stress_impact_gain
			gregarious = minor_stress_impact_gain
			deceitful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100

			modifier = {
				factor = 0
				OR = {
					has_trait = drunkard
					has_trait = disloyal
					has_trait = ambitious
				}
			}
			modifier = {
				add = -75
				OR = {
					has_trait = gregarious
					has_trait = deceitful
				}
			}
			modifier = {
				add = 50
				OR = {
					has_trait = compassionate
					has_trait = honest
					has_trait = humble
					has_trait = calm
				}
			}
		}
	}
}

# resolve single_combat
jason_locale_events.201 = {
	hidden = yes

	immediate = {
		scope:snitch = {
			if = {
				limit = {
					this = scope:sc_victor
				}
				send_interface_toast = {
					title = jason_locale_events.200.c.won_brawl.tt
					left_icon = root
					right_icon = scope:sc_loser

					add_prestige = medium_prestige_gain
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = foot
							value = 5
						}
					}
					if = {
						limit = {
							scope:sc_loser = {
								is_acclaimed = yes
							}
						}
						scope:sc_loser = {
							accolade = { add_glory = major_glory_loss }
						}
					}
					if = {
						limit = {
							is_acclaimed = yes
						}
						accolade = { add_glory = minor_glory_gain }
					}
				}
			}
			else = {
				send_interface_toast = {
					title = jason_locale_events.200.c.lost_brawl.tt
					left_icon = root
					right_icon = scope:sc_victor

					add_prestige = minor_prestige_loss
					if = {
						limit = {
							scope:sc_loser = {
								is_acclaimed = yes
							}
						}
						scope:sc_loser = {
							accolade = { add_glory = medium_glory_loss }
						}
					}
				}
			}
		}
	}
}

##################################################
# Foreign Ways of War
# by Jason Cantalini
# 210
##################################################

scripted_trigger jason_locale_events_210_foreign_lord_trigger = {
	is_ai = yes
	age >= 12
	NOT = { has_trait = incapable }
	is_imprisoned = no
	is_landed = yes
	highest_held_title_tier >= tier_county
	NOR = {
		has_relation_rival = root
		has_relation_nemesis = root
	}
	culture = {
		NOR = {
			this = root.culture
			has_cultural_tradition = tradition_isolationist
			has_cultural_parameter = courtiers_less_likely_to_leave_same_culture_court
		}
	}
	NOR = {
		has_trait = shy
		has_trait = humble
		has_trait = reclusive
	}
}

scripted_trigger jason_locale_events_210_camel_cavalry_trigger = {
	culture = {
		has_innovation = innovation_war_camels
	}
}

scripted_trigger jason_locale_events_210_elephant_cavalry_trigger = {
	culture = {
		OR = {
			has_cultural_tradition = tradition_burman_royal_army
			has_cultural_tradition = tradition_lords_of_the_elephant
			has_innovation = innovation_elephantry
		}
	}
}

scripted_trigger jason_locale_events_210_horse_archer_trigger = {
	culture = {
		has_cultural_tradition = tradition_horse_lords
	}
}

scripted_trigger jason_locale_events_210_heavy_cavalry_trigger = {
	culture = {
		has_innovation = innovation_arched_saddle
	}
}

scripted_trigger jason_locale_events_210_crossbowmen_trigger = {
	culture = {
		has_innovation = innovation_advanced_bowmaking
	}
}

scripted_trigger jason_locale_events_210_heavy_infantry_trigger = {
	culture = {
		has_innovation = innovation_quilted_armor
	}
}



#A foreigner challenges you to their native martial pursuits
jason_locale_events.210 = {
	type = activity_event
	title = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:camel_lord
				}
				desc = jason_locale_events.210.t.camel_cavalry
			}
			triggered_desc = {
				trigger = {
					exists = scope:elephant_lord
				}
				desc = jason_locale_events.210.t.elephant_cavalry
			}
			triggered_desc = {
				trigger = {
					exists = scope:horse_archer_lord
				}
				desc = jason_locale_events.210.t.horse_archer
			}
			triggered_desc = {
				trigger = {
					exists = scope:heavy_cavalry_lord
				}
				desc = jason_locale_events.210.t.heavy_cavalry
			}
			triggered_desc = {
				trigger = {
					exists = scope:crossbow_lord
				}
				desc = jason_locale_events.210.t.crossbowmen
			}
			triggered_desc = {
				trigger = {
					exists = scope:heavy_infantry_lord
				}
				desc = jason_locale_events.210.t.heavy_infantry
			}
		}
	}
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:foreign_lord = { age < 17 }
				}
				desc = jason_locale_events.210.desc.teen
			}
			triggered_desc = {
				trigger = {
					scope:foreign_lord = { age >= 17 }
				}
				desc = jason_locale_events.210.desc
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:camel_lord
				}
				desc = jason_locale_events.210.desc.camel_cavalry
			}
			triggered_desc = {
				trigger = {
					exists = scope:elephant_lord
				}
				desc = jason_locale_events.210.desc.elephant_cavalry
			}
			triggered_desc = {
				trigger = {
					exists = scope:horse_archer_lord
				}
				desc = jason_locale_events.210.desc.horse_archer
			}
			triggered_desc = {
				trigger = {
					exists = scope:heavy_cavalry_lord
				}
				desc = jason_locale_events.210.desc.heavy_cavalry
			}
			triggered_desc = {
				trigger = {
					exists = scope:crossbow_lord
				}
				desc = jason_locale_events.210.desc.crossbowmen
			}
			triggered_desc = {
				trigger = {
					exists = scope:heavy_infantry_lord
				}
				desc = jason_locale_events.210.desc.heavy_infantry
			}
		}
	}

	theme = tournament_locale_camp
	left_portrait = {
		character = root
  		animation = war_over_win
	}
	right_portrait = {
		character = scope:foreign_lord
  		animation = personality_bold
	}
	lower_left_portrait = {
		character = scope:root_culture_knight
	}
	lower_right_portrait = {
		character = scope:foreign_knight
	}

	trigger = {
		age >= 13
		is_imprisoned = no
		is_ruler = yes
		NOT = { has_trait = incapable }
		culture = {
			NOR = {
				has_cultural_tradition = tradition_isolationist
				has_cultural_parameter = courtiers_less_likely_to_leave_same_culture_court
			}
		}
		scope:activity = {
			has_active_locale = tournament_locale_visitor_camp
			any_attending_character = {
				jason_locale_events_210_foreign_lord_trigger = yes
				OR = {
					AND = {
						jason_locale_events_210_camel_cavalry_trigger = yes
						root = {
							jason_locale_events_210_camel_cavalry_trigger = no

							NOR = {
								any_acclaimed_knight = {
									accolade = {
										has_accolade_type = camelry_attribute
									}
								}
								has_character_flag = camel_challenge
							}
						}
					}
					AND = {
						jason_locale_events_210_elephant_cavalry_trigger = yes
						root = {
							jason_locale_events_210_elephant_cavalry_trigger = no
							NOR = {
								has_character_flag = elephant_challenge
								any_acclaimed_knight = {
									accolade = {
										has_accolade_type = elephantry_attribute
									}
								}
							}
						}
					}
					AND = {
						jason_locale_events_210_horse_archer_trigger = yes
						root = {
							jason_locale_events_210_horse_archer_trigger = no
							NOR = {
								has_character_flag = horse_archer_challenge
								any_acclaimed_knight = {
									accolade = {
										has_accolade_type = horse_archer_attribute
									}
								}
							}
						}
					}
					AND = {
						jason_locale_events_210_heavy_cavalry_trigger = yes
						root = {
							jason_locale_events_210_heavy_cavalry_trigger = no
							NOR = {
								has_character_flag = heavy_cavalry_challenge
								any_acclaimed_knight = {
									accolade = {
										has_accolade_type = lancer_attribute
									}
								}
							}
						}
					}
					AND = {
						jason_locale_events_210_crossbowmen_trigger = yes
						root = {
							jason_locale_events_210_crossbowmen_trigger = no
							NOR = {
								has_character_flag = crossbow_challenge
								any_acclaimed_knight = {
									accolade = {
										has_accolade_type = crossbowmen_attribute
									}
								}
							}
						}
					}
					AND = {
						jason_locale_events_210_heavy_infantry_trigger = yes
						root = {
							jason_locale_events_210_heavy_infantry_trigger = no
							NOR = {
								has_character_flag = heavy_infantry_challenge
								any_acclaimed_knight = {
									accolade = {
										has_accolade_type = vanguard_attribute
									}
								}
							}
						}
					}
				}
			}
		}
	}

	immediate = {
		# finding a foreign lord to challenge ROOT
		if = {
			limit = {
				jason_locale_events_210_crossbowmen_trigger = no
				NOR = {
					any_acclaimed_knight = {
						accolade = {
							has_accolade_type = crossbowmen_attribute
						}
					}
					has_character_flag = crossbow_challenge
				}
				scope:activity = {
					any_attending_character = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_crossbowmen_trigger = yes
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_crossbowmen_trigger = yes
					}
					save_scope_as = foreign_lord
					save_scope_as = crossbow_lord
				}
			}
			add_character_flag = {
				flag = crossbow_challenge
				years = 30
			}
		}
		else_if = {
			limit = {
				jason_locale_events_210_heavy_cavalry_trigger = no
				NOR = {
					any_acclaimed_knight = {
						accolade = {
							has_accolade_type = lancer_attribute
						}
					}
					has_character_flag = heavy_cavalry_challenge
				}
				scope:activity = {
					any_attending_character = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_heavy_cavalry_trigger = yes
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_heavy_cavalry_trigger = yes
					}
					save_scope_as = foreign_lord
					save_scope_as = heavy_cavalry_lord
				}
			}
			add_character_flag = {
				flag = heavy_cavalry_challenge
				years = 30
			}
		}
		else_if = {
			limit = {
				jason_locale_events_210_heavy_infantry_trigger = no
				NOR = {
					any_acclaimed_knight = {
						accolade = {
							has_accolade_type = vanguard_attribute
						}
					}
					has_character_flag = heavy_infantry_challenge
				}
				scope:activity = {
					any_attending_character = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_heavy_infantry_trigger = yes
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_heavy_infantry_trigger = yes
					}
					save_scope_as = foreign_lord
					save_scope_as = heavy_infantry_lord
				}
			}
			add_character_flag = {
				flag = heavy_infantry_challenge
				years = 30
			}
		}
		else_if = {
			limit = {
				jason_locale_events_210_horse_archer_trigger = no
				NOR = {
					any_acclaimed_knight = {
						accolade = {
							has_accolade_type = horse_archer_attribute
						}
					}
					has_character_flag = horse_archer_challenge
				}
				scope:activity = {
					any_attending_character = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_horse_archer_trigger = yes
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_horse_archer_trigger = yes
					}
					save_scope_as = foreign_lord
					save_scope_as = horse_archer_lord
				}
			}
			add_character_flag = {
				flag = horse_archer_challenge
				years = 30
			}
		}
		else_if = {
			limit = {
				jason_locale_events_210_camel_cavalry_trigger = no
				NOR = {
					any_acclaimed_knight = {
						accolade = {
							has_accolade_type = camelry_attribute
						}
					}
					has_character_flag = camel_challenge
				}
				scope:activity = {
					any_attending_character = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_camel_cavalry_trigger = yes
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_camel_cavalry_trigger = yes
					}
					save_scope_as = foreign_lord
					save_scope_as = camel_lord
				}
			}
			add_character_flag = {
				flag = camel_challenge
				years = 30
			}
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						jason_locale_events_210_foreign_lord_trigger = yes
						jason_locale_events_210_elephant_cavalry_trigger = yes
					}
					save_scope_as = foreign_lord
					save_scope_as = elephant_lord
				}
			}
			add_character_flag = {
				flag = elephant_challenge
				years = 30
			}
		}
		# find a same culture knight to represent you
		if = {
			limit = {
				any_knight = {
					is_healthy = yes
					is_imprisoned = no
					culture = {
						has_same_culture_heritage = root.culture
						this != scope:foreign_lord.culture
					}
					location = root.location
					trigger_if = {
						limit = {
							exists = scope:camel_lord
						}
						jason_locale_events_210_camel_cavalry_trigger = no
					}
					trigger_else_if = {
						limit = {
							exists = scope:elephant_lord
						}
						jason_locale_events_210_elephant_cavalry_trigger = no
					}
					trigger_else_if = {
						limit = {
							exists = scope:horse_archer_lord
						}
						jason_locale_events_210_horse_archer_trigger = no
					}
					trigger_else_if = {
						limit = {
							exists = scope:heavy_cavalry_lord
						}
						jason_locale_events_210_heavy_cavalry_trigger = no
					}
					trigger_else_if = {
						limit = {
							exists = scope:crossbow_lord
						}
						jason_locale_events_210_crossbowmen_trigger = no
					}
					trigger_else = {
						jason_locale_events_210_heavy_infantry_trigger = no
					}
				}
			}
			ordered_knight = {
				limit = {
					is_knight_of = root
					is_ai = yes
					is_healthy = yes
					is_imprisoned = no
					culture = {
						has_same_culture_heritage = root.culture
						this != scope:foreign_lord.culture
					}
					location = root.location
					trigger_if = {
						limit = {
							exists = scope:camel_lord
						}
						jason_locale_events_210_camel_cavalry_trigger = no
					}
					trigger_else_if = {
						limit = {
							exists = scope:elephant_lord
						}
						jason_locale_events_210_elephant_cavalry_trigger = no
					}
					trigger_else_if = {
						limit = {
							exists = scope:horse_archer_lord
						}
						jason_locale_events_210_horse_archer_trigger = no
					}
					trigger_else_if = {
						limit = {
							exists = scope:heavy_cavalry_lord
						}
						jason_locale_events_210_heavy_cavalry_trigger = no
					}
					trigger_else_if = {
						limit = {
							exists = scope:crossbow_lord
						}
						jason_locale_events_210_crossbowmen_trigger = no
					}
					trigger_else = {
						jason_locale_events_210_heavy_infantry_trigger = no
					}
				}
				order_by = prowess
				save_scope_as = root_culture_knight
			}
		}
		# find one of target's knights you can hire
		if = {
			limit = {
				scope:foreign_lord = {
					any_knight = {
						is_ai = yes
						is_landed = no
						is_councillor = no
						can_be_knight_trigger = { ARMY_OWNER = root }
						is_acclaimed = no
						NOR = {
							is_close_family_of = scope:foreign_lord
							is_close_family_of = root
						}
						is_healthy = yes
						is_imprisoned = no
						culture = {
							has_same_culture_heritage = scope:foreign_lord.culture
							this != root.culture
						}
						trigger_if = {
							limit = {
								exists = scope:camel_lord
							}
							jason_locale_events_210_camel_cavalry_trigger = yes
						}
						trigger_else_if = {
							limit = {
								exists = scope:elephant_lord
							}
							jason_locale_events_210_elephant_cavalry_trigger = yes
						}
						trigger_else_if = {
							limit = {
								exists = scope:horse_archer_lord
							}
							jason_locale_events_210_horse_archer_trigger = yes
						}
						trigger_else_if = {
							limit = {
								exists = scope:heavy_cavalry_lord
							}
							jason_locale_events_210_heavy_cavalry_trigger = yes
						}
						trigger_else_if = {
							limit = {
								exists = scope:crossbow_lord
							}
							jason_locale_events_210_crossbowmen_trigger = yes
						}
						trigger_else = {
							jason_locale_events_210_heavy_infantry_trigger = yes
						}
					}
				}
			}
			scope:foreign_lord = {
				random_knight = {
					limit = {
						is_ai = yes
						is_landed = no
						is_councillor = no
						can_be_knight_trigger = { ARMY_OWNER = root }
						is_acclaimed = no
						NOR = {
							is_close_family_of = scope:foreign_lord
							is_close_family_of = root
						}
						is_healthy = yes
						is_imprisoned = no
						culture = {
							has_same_culture_heritage = scope:foreign_lord.culture
							this != root.culture
						}
						trigger_if = {
							limit = {
								exists = scope:camel_lord
							}
							jason_locale_events_210_camel_cavalry_trigger = yes
						}
						trigger_else_if = {
							limit = {
								exists = scope:elephant_lord
							}
							jason_locale_events_210_elephant_cavalry_trigger = yes
						}
						trigger_else_if = {
							limit = {
								exists = scope:horse_archer_lord
							}
							jason_locale_events_210_horse_archer_trigger = yes
						}
						trigger_else_if = {
							limit = {
								exists = scope:heavy_cavalry_lord
							}
							jason_locale_events_210_heavy_cavalry_trigger = yes
						}
						trigger_else_if = {
							limit = {
								exists = scope:crossbow_lord
							}
							jason_locale_events_210_crossbowmen_trigger = yes
						}
						trigger_else = {
							jason_locale_events_210_heavy_infantry_trigger = yes
						}
					}
					save_scope_as = foreign_knight
					# make him an eligible MaA accolade knight
					hidden_effect = {
						scope:foreign_knight = {
							if = {
								limit = { prowess < accolade_prowess_requirement_value }
								add_prowess_skill = jason_locale_events_210_desired_prowess_value
								force_character_skill_recalculation = yes
							}
							if = {
								limit = { martial < maa_accolade_minimum_martial_value }
								add_martial_skill = jason_locale_events_210_desired_martial_value
								force_character_skill_recalculation = yes
							}
						}
						if = {
							limit = {
								NOT = {
									has_trait = tourney_participant
								}
							}
							add_trait = tourney_participant
						}
						if = {
							limit = {
								OR = {
									exists = scope:camel_lord
									exists = scope:elephant_lord
									exists = scope:heavy_cavalry_lord
								}
							}
							add_trait_xp = {
								trait = tourney_participant
								track = horse
								value = 20
							}
						}
						else_if = {
							limit = {
								exists = scope:horse_archer_lord
							}
							add_trait_xp = {
								trait = tourney_participant
								track = bow
								value = 20
							}
							add_trait_xp = {
								trait = tourney_participant
								track = horse
								value = 20
							}
						}
						else_if = {
							limit = {
								exists = scope:crossbow_lord
							}
							add_trait_xp = {
								trait = tourney_participant
								track = bow
								value = 10
							}
						}
						else_if = {
							limit = {
								exists = scope:heavy_infantry_lord
							}
							add_trait_xp = {
								trait = tourney_participant
								track = foot
								value = 20
							}
						}
					}
				}
			}
		}
	}

	# You accept the challenge yourself
	option = {
		trigger = {
			can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
		}
		name = jason_locale_events.210.a

		duel = {
			skill = prowess
			value = decent_skill_rating
			50 = {
				desc = jason_locale_events.210.a.win
				compare_modifier = {
					value = scope:duel_value
					multiplier = 2.5
					min = -45
				}
				modifier = {
					OR = {
						exists = scope:camel_lord
						exists = scope:elephant_lord
						exists = scope:heavy_cavalry_lord
					}
					has_trait_xp = {
						trait = tourney_participant
						track = horse
						value >= 20
					}
					add = 20
				}
				modifier = {
					OR = {
						exists = scope:camel_lord
						exists = scope:elephant_lord
						exists = scope:heavy_cavalry_lord
					}
					has_trait_xp = {
						trait = tourney_participant
						track = horse
						value >= 50
					}
					add = 30
				}
				modifier = {
					OR = {
						exists = scope:camel_lord
						exists = scope:elephant_lord
						exists = scope:heavy_cavalry_lord
					}
					has_trait_xp = {
						trait = tourney_participant
						track = horse
						value >= 100
					}
					add = 50
				}
				modifier = {
					exists = scope:horse_archer_lord
					has_trait_xp = {
						trait = tourney_participant
						track = horse
						value >= 10
					}
					has_trait_xp = {
						trait = tourney_participant
						track = bow
						value >= 10
					}
					add = 20
				}
				modifier = {
					exists = scope:horse_archer_lord
					has_trait_xp = {
						trait = tourney_participant
						track = horse
						value >= 20
					}
					has_trait_xp = {
						trait = tourney_participant
						track = bow
						value >= 20
					}
					add = 30
				}
				modifier = {
					exists = scope:horse_archer_lord
					has_trait_xp = {
						trait = tourney_participant
						track = horse
						value >= 50
					}
					has_trait_xp = {
						trait = tourney_participant
						track = bow
						value >= 50
					}
					add = 50
				}
				modifier = {
					exists = scope:crossbow_lord
					has_trait_xp = {
						trait = tourney_participant
						track = bow
						value >= 20
					}
					add = 20
				}
				modifier = {
					exists = scope:crossbow_lord
					has_trait_xp = {
						trait = tourney_participant
						track = bow
						value >= 50
					}
					add = 30
				}
				modifier = {
					exists = scope:crossbow_lord
					has_trait_xp = {
						trait = tourney_participant
						track = bow
						value >= 100
					}
					add = 50
				}
				modifier = {
					exists = scope:heavy_infantry_lord
					has_trait_xp = {
						trait = tourney_participant
						track = foot
						value >= 20
					}
					add = 20
				}
				modifier = {
					exists = scope:heavy_infantry_lord
					has_trait_xp = {
						trait = tourney_participant
						track = foot
						value >= 50
					}
					add = 30
				}
				modifier = {
					exists = scope:heavy_infantry_lord
					has_trait_xp = {
						trait = tourney_participant
						track = foot
						value >= 100
					}
					add = 50
				}
				send_interface_toast = {
					title = jason_locale_events.210.a.win
					left_icon = root
					if = {
						limit = {
							root.culture.culture_head = root
						}
						culture = {
 							change_cultural_acceptance = {
 								target = scope:foreign_lord.culture
 								value = medium_cultural_acceptance_gain
 								desc = cultural_acceptance_knightly_camaraderie
 							}
 						}
					}
					if = {
						limit = {
							OR = {
								exists = scope:camel_lord
								exists = scope:heavy_cavalry_lord
							}
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = horse
							value = 10
						}
					}
					else_if = {
						limit = {
							exists = scope:elephant_lord
							has_trait = tourney_participant
						}
						add_prestige = medium_prestige_gain
					}
					else_if = {
						limit = {
							exists = scope:horse_archer_lord
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = horse
							value = 5
						}
						add_trait_xp = {
							trait = tourney_participant
							track = bow
							value = 5
						}
					}
					else_if = {
						limit = {
							exists = scope:crossbow_lord
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = bow
							value = 10
						}
					}
					else_if = {
						limit = {
							exists = scope:heavy_infantry_lord
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = foot
							value = 10
						}
					}
					add_character_modifier = {
						modifier = tournament_open_minded_warrior_modifier
						years = 20
					}
				}
			}
			50 = {
				desc = jason_locale_events.210.a.lose
				compare_modifier = {
					value = scope:duel_value
					multiplier = -2.5
					min = -45
				}
				send_interface_toast = {
					title = jason_locale_events.210.a.lose
					left_icon = root
					every_knight = {
 						custom = custom.every_knight
 						add_opinion = {
							target = root
							modifier = contempt_opinion
							opinion = -10
						}
 					}
				}
			}
		}

		stress_impact = {
			craven = medium_stress_impact_gain
			stubborn = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			lazy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				add = -50
				has_trait = lazy
			}
			modifier = {
				add = 100
				OR = {
					has_trait = arbitrary
					has_trait = fickle
					has_trait = brave
					has_trait = ambitious
				}
			}
			modifier = {
				add = 50
				culture = {
					has_cultural_pillar = ethos_bellicose
				}
			}
			modifier = {
				add = -100
				prowess <= 10
			}
			modifier = {
				add = -50
				prowess <= 14
			}
			modifier = {
				add = -25
				prowess <= 18
			}
			modifier = {
				add = 50
				prowess >= 22
			}
			modifier = {
				add = 100
				prowess >= 26
			}
			modifier = {
				factor = 0
				OR = {
					is_healthy = no
					has_trait = craven
					has_trait = stubborn
					has_trait = paranoid
					prowess <= 5
				}
			}
		}
	}

	# one of my best knights will give the challenge one of his best tries
	option = {
		trigger = {
			exists = scope:root_culture_knight
		}

		name = {
			trigger = {
				scope:root_culture_knight = {
					culture = root.culture
				}
			}
			text = jason_locale_events.210.b
		}
		name = {
			trigger = {
				NOT = {
					scope:root_culture_knight = {
						culture = root.culture
					}
				}
			}
			text = jason_locale_events.210.b.same_heritage
		}
		flavor = jason_locale_events.210.b.tt

		scope:root_culture_knight = {
			duel = {
				skill = prowess
				value = decent_skill_rating
				50 = {
					desc = jason_locale_events.210.b.win
					compare_modifier = {
						value = scope:duel_value
						multiplier = 2.5
						min = -45
					}
					modifier = {
						OR = {
							exists = scope:camel_lord
							exists = scope:elephant_lord
							exists = scope:heavy_cavalry_lord
						}
						has_trait_xp = {
							trait = tourney_participant
							track = horse
							value >= 20
						}
						add = 20
					}
					modifier = {
						OR = {
							exists = scope:camel_lord
							exists = scope:elephant_lord
							exists = scope:heavy_cavalry_lord
						}
						has_trait_xp = {
							trait = tourney_participant
							track = horse
							value >= 50
						}
						add = 30
					}
					modifier = {
						OR = {
							exists = scope:camel_lord
							exists = scope:elephant_lord
							exists = scope:heavy_cavalry_lord
						}
						has_trait_xp = {
							trait = tourney_participant
							track = horse
							value >= 100
						}
						add = 50
					}
					modifier = {
						exists = scope:horse_archer_lord
						has_trait_xp = {
							trait = tourney_participant
							track = horse
							value >= 10
						}
						has_trait_xp = {
							trait = tourney_participant
							track = bow
							value >= 10
						}
						add = 20
					}
					modifier = {
						exists = scope:horse_archer_lord
						has_trait_xp = {
							trait = tourney_participant
							track = horse
							value >= 20
						}
						has_trait_xp = {
							trait = tourney_participant
							track = bow
							value >= 20
						}
						add = 30
					}
					modifier = {
						exists = scope:horse_archer_lord
						has_trait_xp = {
							trait = tourney_participant
							track = horse
							value >= 50
						}
						has_trait_xp = {
							trait = tourney_participant
							track = bow
							value >= 50
						}
						add = 50
					}
					modifier = {
						exists = scope:crossbow_lord
						has_trait_xp = {
							trait = tourney_participant
							track = bow
							value >= 20
						}
						add = 20
					}
					modifier = {
						exists = scope:crossbow_lord
						has_trait_xp = {
							trait = tourney_participant
							track = bow
							value >= 50
						}
						add = 30
					}
					modifier = {
						exists = scope:crossbow_lord
						has_trait_xp = {
							trait = tourney_participant
							track = bow
							value >= 100
						}
						add = 50
					}
					modifier = {
						exists = scope:heavy_infantry_lord
						has_trait_xp = {
							trait = tourney_participant
							track = foot
							value >= 20
						}
						add = 20
					}
					modifier = {
						exists = scope:heavy_infantry_lord
						has_trait_xp = {
							trait = tourney_participant
							track = foot
							value >= 50
						}
						add = 30
					}
					modifier = {
						exists = scope:heavy_infantry_lord
						has_trait_xp = {
							trait = tourney_participant
							track = foot
							value >= 100
						}
						add = 50
					}
					send_interface_toast = {
						title = jason_locale_events.210.b.win
						left_icon = scope:root_culture_knight
						if = {
							limit = {
								is_acclaimed = yes
							}
							accolade = {
								add_glory = medium_glory_gain
							}
						}
						if = {
							limit = {
								NOT = { has_trait = tourney_participant }
							}
							add_prowess_skill = 2
						}
						if = {
							limit = {
								OR = {
									exists = scope:camel_lord
									exists = scope:heavy_cavalry_lord
								}
								has_trait = tourney_participant
							}
							add_trait_xp = {
								trait = tourney_participant
								track = horse
								value = 10
							}
						}
						else_if = {
							limit = {
								exists = scope:elephant_lord
								has_trait = tourney_participant
							}
							add_prestige = medium_prestige_gain
						}
						else_if = {
							limit = {
								exists = scope:horse_archer_lord
								has_trait = tourney_participant
							}
							add_trait_xp = {
								trait = tourney_participant
								track = horse
								value = 5
							}
							add_trait_xp = {
								trait = tourney_participant
								track = bow
								value = 5
							}
						}
						else_if = {
							limit = {
								exists = scope:crossbow_lord
								has_trait = tourney_participant
							}
							add_trait_xp = {
								trait = tourney_participant
								track = bow
								value = 10
							}
						}
						else_if = {
							limit = {
								exists = scope:heavy_infantry_lord
								has_trait = tourney_participant
							}
							add_trait_xp = {
								trait = tourney_participant
								track = foot
								value = 10
							}
						}
					}
				}
				50 = {
					desc = jason_locale_events.210.b.lose
					compare_modifier = {
						value = scope:duel_value
						multiplier = -2.5
						min = -45
					}
					send_interface_toast = {
						title = jason_locale_events.210.b.lose
						left_icon = scope:root_culture_knight
						if = {
							limit = {
								is_acclaimed = yes
							}
							accolade = {
								add_glory = minor_glory_loss
							}
						}
						root = {
							add_character_modifier = {
								modifier = tournament_knight_humiliated_modifier
								years = 5
							}
						}
					}
				}
			}
		}
		stress_impact = {
			paranoid = minor_stress_impact_gain
			brave = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100

			modifier = {
				add = -50
				OR = {
					has_trait = paranoid
					has_trait = brave
					has_trait = humble
				}
			}
			modifier = {
				add = 100
				OR = {
					has_trait = trusting
					has_trait = ambitious
					has_trait = arrogant
				}
			}
			modifier = {
				add = 50
				culture = {
					has_cultural_pillar = ethos_bellicose
				}
			}
			modifier = {
				add = -100
				scope:root_culture_knight = { prowess <= 10 }
			}
			modifier = {
				add = -50
				scope:root_culture_knight = { prowess <= 14 }
			}
			modifier = {
				add = -25
				scope:root_culture_knight = { prowess <= 18 }
			}
			modifier = {
				add = 25
				scope:root_culture_knight = { prowess >= 22 }
			}
			modifier = {
				add = 75
				scope:root_culture_knight = { prowess >= 26 }
			}
			modifier = {
				factor = 0
				scope:root_culture_knight = {
					is_healthy = no
				}
			}
		}
	}
	# we can't do your thing - but perhaps you'll spare someone to teach us?
	option = {
		trigger = {
			exists = scope:foreign_knight
		}
		name = jason_locale_events.210.c
		flavor = jason_locale_events.210.c.tt

		add_courtier = scope:foreign_knight

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

		stress_impact = {
			arrogant = major_stress_impact_gain
			greedy = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			wrathful = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100

			modifier = {
				add = -50
				OR = {
					has_trait = wrathful
					has_trait = stubborn
				}
			}
			modifier = {
				add = 100
				OR = {
					has_trait = trusting
					has_trait = ambitious
					has_trait = humble
					has_trait = patient
				}
			}
			modifier = {
				add = -50
				culture = {
					has_cultural_pillar = ethos_stoic
				}
			}
			modifier = {
				add = 50
				culture = {
					has_cultural_pillar = ethos_egalitarian
				}
			}
			modifier = {
				add = -75
				gold <= massive_gold_value
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = arrogant
					has_trait = greedy
					has_trait = paranoid
					gold <= major_gold_value
				}
			}
		}
	}

	# your skills are stupid
	option = {
		name = {
			trigger = {
				exists = scope:camel_lord
			}
			text = jason_locale_events.210.d.camel_cavalry
		}
		name = {
			trigger = {
				exists = scope:elephant_lord
			}
			text = jason_locale_events.210.d.elephant_cavalry
		}
		name = {
			trigger = {
				exists = scope:horse_archer_lord
			}
			text = jason_locale_events.210.d.horse_archer
		}
		name = {
			trigger = {
				exists = scope:heavy_cavalry_lord
			}
			text = jason_locale_events.210.d.heavy_cavalry
		}
		name = {
			trigger = {
				exists = scope:crossbow_lord
			}
			text = jason_locale_events.210.d.crossbowmen
		}
		name = {
			trigger = {
				exists = scope:heavy_infantry_lord
			}
			text = jason_locale_events.210.d.heavy_infantry
		}
		flavor = {
			first_valid = {
				triggered_desc = {
					trigger = {
						exists = scope:camel_lord
					}
					desc = jason_locale_events.210.d.tt.camel_cavalry
				}
				triggered_desc = {
					trigger = {
						exists = scope:elephant_lord
					}
					desc = jason_locale_events.210.d.tt.elephant_cavalry
				}
				triggered_desc = {
					trigger = {
						exists = scope:horse_archer_lord
					}
					desc = jason_locale_events.210.d.tt.horse_archer
				}
				triggered_desc = {
					trigger = {
						exists = scope:heavy_cavalry_lord
					}
					desc = jason_locale_events.210.d.tt.heavy_cavalry
				}
				triggered_desc = {
					trigger = {
						exists = scope:crossbow_lord
					}
					desc = jason_locale_events.210.d.tt.crossbowmen
				}
				triggered_desc = {
					trigger = {
						exists = scope:heavy_infantry_lord
					}
					desc = jason_locale_events.210.d.tt.heavy_infantry
				}
			}
		}
		add_character_modifier = {
			modifier = tournament_loyalty_martial_traditions_modifier
			years = 20
		}
 		if = {
			limit = {
				root.culture.culture_head = root
			}
			culture = {
 				change_cultural_acceptance = {
 					target = scope:foreign_lord.culture
 					value = medium_cultural_acceptance_loss
 					desc = cultural_acceptance_knightly_rivalry
 				}
 			}
		}
		else_if = {
			limit = {
				highest_held_title_tier >= tier_kingdom
			}
			culture = {
 				change_cultural_acceptance = {
 					target = scope:foreign_lord.culture
 					value = minor_cultural_acceptance_loss
 					desc = cultural_acceptance_knightly_rivalry
 				}
 			}
		}
		else = {
			reverse_add_opinion = {
				target = scope:foreign_lord
				modifier = angry_opinion
				opinion = -30
			}
		}

		stress_impact = {
			compassionate = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			calm = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100


			modifier = {
				add = -50
				OR = {
					has_trait = calm
					has_trait = forgiving
				}
			}
			modifier = {
				add = -50
				culture = {
					has_cultural_pillar = ethos_egalitarian
				}
			}
			modifier = {
				add = 100
				OR = {
					has_trait = paranoid
					has_trait = wrathful
					has_trait = arrogant
					has_trait = vengeful
				}
			}
			modifier = {
				add = 50
				culture = {
					has_cultural_pillar = ethos_stoic
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = compassionate
					has_trait = trusting
					has_trait = humble
				}
			}
		}
	}
}

##################################################
# Where Victory is Fostered
# by Jason Cantalini
# 220
##################################################

scripted_trigger jason_locale_events_0220_senior_knight = {
	is_physically_able_ai_adult = yes
	is_healthy = yes
	is_knight_of = root
	NOT = {
		has_trait = shy
	}
	age >= 20
}

scripted_trigger jason_locale_events_0220_competitive_knight = {
	location = root.location
	is_acclaimed = yes
	accolade = {
		OR = {
			has_accolade_type = contender_attribute
			has_accolade_type = tactician_attribute
			has_accolade_category = amoral
		}
	}
}

scripted_trigger jason_locale_events_0220_showy_knight = {
	location = root.location
	is_acclaimed = yes
	accolade = {
		OR = {
			has_accolade_type = house_knight_attribute
			has_accolade_category = social
		}
	}
}

scripted_trigger jason_locale_events_0220_warrior_knight = {
	location = root.location
	is_acclaimed = yes
	accolade = {
		OR = {
			has_accolade_category = equestrian
			has_accolade_category = infantry
		}
	}
}

scripted_trigger jason_locale_events_0220_ranged_knight = {
	location = root.location
	is_acclaimed = yes
	accolade = {
		has_accolade_category = ranged_fighter

	}
}

scripted_trigger jason_locale_events_0220_courageous_knight = {
	location = root.location
	is_acclaimed = yes
	accolade = {
		OR = {
			has_accolade_type = valiant_attribute
			has_accolade_type = blademaster_attribute
		}
	}
}

# You take a hands-on role in your knights' training
jason_locale_events.0220 = {
	type = activity_event
	title = jason_locale_events.0220.t
	desc = jason_locale_events.0220.desc
	theme = tournament_grounds

	left_portrait = {
		character = root
		animation = personality_bold
	}

	right_portrait = {
		character = scope:senior_knight
		animation = throne_room_two_handed_passive_1
	}

	cooldown = { years = 1 }

	trigger = {
		age > 10
		is_physically_able = yes
		is_ruler = yes
		scope:activity = {
			has_active_locale = tournament_locale_tournament_grounds
			any_attending_character = {
				jason_locale_events_0220_senior_knight = yes
			}
		}
		OR = {
			exists = var:progress_to_victory
			any_knight = {
				exists = var:progress_to_victory
			}
		}
	}


	weight_multiplier = {
		base = 1
		modifier = {
			factor = 3
			has_activity_intent = reduce_stress_intent
		}
		modifier = {
			factor = 3
			has_activity_intent = win_contest_intent
		}
	}

	immediate = {
		# trying to get the most skilled and esteemed knight root has
		scope:activity = {
			ordered_attending_character = {
				limit = {
					this != root
					jason_locale_events_0220_senior_knight = yes
				}
				order_by = {
					value = prowess
					#Weight up more esteemed characters
					if = {
						limit = {
							is_acclaimed = yes
						}
						add = 60
					}
					if = {
						limit = {
							has_court_position = champion_court_position
						}
						add = 15
					}
					if = {
						limit = {
							age >= 40
						}
						add = 10
					}
				}
				save_scope_as = senior_knight
			}
		}
		scope:senior_knight = {
			add_character_flag = wear_armor
		}
	}

	option = {
		name = jason_locale_events.0220.a
		add_internal_flag = special
		custom_tooltip = available_because_intent_tt

		trigger = {
			has_activity_intent = win_contest_intent
		}
		# big bonus if you have a cutthroat compettitive knight
		if = {
			limit = {
				any_knight = {
					jason_locale_events_0220_competitive_knight = yes
				}
			}
			# knights' scores increase
			custom_tooltip = every_knight_change_contestant_score_effect_tt
			hidden_effect = {
				every_knight = {
					limit = { activity_is_competing_trigger = yes }
					activity_tournament_change_contestant_score_effect = { SCORE = increase_medium }
				}
			}
			# your score increases
			if = {
				limit = { activity_is_competing_trigger = yes }
				activity_tournament_change_contestant_score_effect = { SCORE = increase_medium }
			}
			# glory for knights helping out
			every_knight = {
				limit = {
					jason_locale_events_0220_competitive_knight = yes
				}
				accolade = { add_glory = minor_glory_gain }
			}
		}
		# regular bonus for normies
		else = {
			# your score increases
			if = {
				limit = { activity_is_competing_trigger = yes }
				activity_tournament_change_contestant_score_effect = { SCORE = increase_minor }
			}
			# your knights' scores increase
			custom_tooltip = every_knight_change_contestant_score_effect_tt
			hidden_effect = {
				every_knight = {
					limit = { activity_is_competing_trigger = yes }
					activity_tournament_change_contestant_score_effect = { SCORE = increase_medium }
				}
			}
		}

		stress_impact = {
			flexible_leader = miniscule_stress_impact_loss
			ambitious = minor_stress_impact_loss
			content = minor_stress_impact_gain
			honest = minor_stress_impact_gain
			just = miniscule_stress_impact_gain
		}

		ai_chance = {
			base = 200

			modifier = {
				add = 200
				any_knight = {
					jason_locale_events_0220_competitive_knight = yes
				}
			}
			modifier = {
				add = 100
				OR = {
					has_trait = ambitious
					has_trait = deceitful
					has_trait = arbitrary
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = content
					has_trait = honest
					has_trait = just
					has_trait = brave
				}
			}
		}
	}

	option = {
		name = jason_locale_events.0220.b
		add_internal_flag = special
		custom_tooltip = available_because_intent_tt

		trigger = {
			has_activity_intent = reduce_stress_intent
		}
		if = {
			limit = {
				any_knight = {
					jason_locale_events_0220_showy_knight = yes
				}
			}
			every_knight = {
				limit = {
					jason_locale_events_0220_showy_knight = yes
				}
				accolade = { add_glory = major_glory_gain }
			}
			every_knight = {
				limit = {
					is_acclaimed = yes
					location = root.location
					jason_locale_events_0220_showy_knight = no
				}
				accolade = { add_glory = medium_glory_gain }
			}
		}
		else = {
			every_knight = {
				limit = {
					is_acclaimed = yes
					location = root.location
				}
				accolade = { add_glory = medium_glory_gain }
			}
		}

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

		ai_chance = {
			base = 100

			modifier = {
				add = 200
				any_knight = {
					jason_locale_events_0220_showy_knight = yes
				}
			}
			modifier = {
				add = 100
				OR = {
					has_trait = arrogant
					has_trait = fickle
					has_trait = content
					has_trait = lazy
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = diligent
					has_trait = ambitious
					has_trait = humble
				}
			}
		}
	}

	option = {
		name = jason_locale_events.0220.c
		flavor = jason_locale_events.0220.c.tt

		# knights are more ready for contest
		if = {
			# check contest is appropriate
			limit = {
				scope:activity = {
					OR = {
						has_current_phase = tournament_phase_joust
						has_current_phase = tournament_phase_melee
						has_current_phase = tournament_phase_duel
						has_current_phase = tournament_phase_horse_race
						has_current_phase = tournament_phase_wrestling
					}
				}
			}
			# are you competing?
			if = {
				limit = { activity_is_competing_trigger = yes }
				activity_tournament_change_contestant_score_effect = { SCORE = increase_minor }
			}
			# knights do a little better
			custom_tooltip = every_knight_change_contestant_score_effect_low_tt
			hidden_effect = {
				every_knight = {
					limit = { activity_is_competing_trigger = yes }
					activity_tournament_change_contestant_score_effect = { SCORE = increase_minor }
				}
			}
		}
		# give some glory to horsemen and foot fighting specialist knights
		# give some foot and horse XP
		if = {
			limit = {
				any_knight = {
					jason_locale_events_0220_warrior_knight = yes
				}
			}
			every_knight = {
				limit = {
					jason_locale_events_0220_warrior_knight = yes
				}
				accolade = { add_glory = minor_glory_gain }
			}
			every_knight = {
				limit = {
					has_trait = tourney_participant
				}
				add_trait_xp = {
  					trait = tourney_participant
 					track = horse
  					value = 5
 				}
 				add_trait_xp = {
  					trait = tourney_participant
 					track = foot
  					value = 5
 				}
			}
			if = {
				limit = {
					has_trait = tourney_participant
				}
				add_trait_xp = {
  					trait = tourney_participant
 					track = horse
  					value = 5
 				}
 				add_trait_xp = {
  					trait = tourney_participant
 					track = foot
  					value = 5
 				}
			}
			else_if = {
				limit = {
					can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				}
				add_trait = tourney_participant
			}
		}
		else = {
			if = {
				limit = {
					has_trait = tourney_participant
				}
				add_trait_xp = {
  					trait = tourney_participant
 					track = horse
  					value = 3
 				}
 				add_trait_xp = {
  					trait = tourney_participant
 					track = foot
  					value = 3
 				}
			}
			else_if = {
				limit = {
					can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				}
				add_trait = tourney_participant
			}
			every_knight = {
				custom = custom.every_knight
				limit = {
					NOT = { has_trait = tourney_participant }
				}
				add_trait = tourney_participant
			}
			every_knight = {
				custom = custom.every_knight
				add_trait_xp = {
  					trait = tourney_participant
 					track = horse
  					value = 3
 				}
 				add_trait_xp = {
  					trait = tourney_participant
 					track = foot
  					value = 3
 				}
			}
		}

		stress_impact = {
			brave = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 100

			modifier = {
				add = 100
				any_knight = {
					jason_locale_events_0220_warrior_knight = yes
				}
			}
			modifier = {
				add = -75
				OR = {
					has_trait = craven
					has_trait = calm
				}
			}
			modifier = {
				add = 50
				has_trait = brave

			}
			modifier = {
				add = 25
				scope:activity = {
					OR = {
						has_current_phase = tournament_phase_joust
						has_current_phase = tournament_phase_melee
						has_current_phase = tournament_phase_duel
						has_current_phase = tournament_phase_horse_race
						has_current_phase = tournament_phase_wrestling
					}
				}
			}
		}
	}

	option = {
		name = jason_locale_events.0220.d
		flavor = jason_locale_events.0220.d.tt

		# knights are more ready for contest
		if = {
			# check contest is appropriate
			limit = {
				scope:activity = {
					OR = {
						has_current_phase = tournament_phase_board_game
						has_current_phase = tournament_phase_recital
						has_current_phase = tournament_phase_archery
					}
				}
			}
			# are you competing?
			if = {
				limit = { activity_is_competing_trigger = yes }
				activity_tournament_change_contestant_score_effect = { SCORE = increase_minor }
			}
			# knights do a little better
			custom_tooltip = every_knight_change_contestant_score_effect_low_tt
			hidden_effect = {
				every_knight = {
					limit = { activity_is_competing_trigger = yes }
					activity_tournament_change_contestant_score_effect = { SCORE = increase_minor }
				}
			}
		}
		# give some glory to ranged fighting specialist knights
		# give some foot and horse XP
		if = {
			limit = {
				any_knight = {
					jason_locale_events_0220_ranged_knight = yes
				}
			}
			every_knight = {
				limit = {
					jason_locale_events_0220_ranged_knight = yes
				}
				accolade = { add_glory = minor_glory_gain }
			}
			every_knight = {
				limit = {
					has_trait = tourney_participant
				}
				add_trait_xp = {
  					trait = tourney_participant
 					track = bow
  					value = 5
 				}
 				add_trait_xp = {
  					trait = tourney_participant
 					track = wit
  					value = 5
 				}
			}
			if = {
				limit = {
					has_trait = tourney_participant
				}
				add_trait_xp = {
  					trait = tourney_participant
 					track = bow
  					value = 5
 				}
 				add_trait_xp = {
  					trait = tourney_participant
 					track = wit
  					value = 5
 				}
			}
			else_if = {
				limit = {
					can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				}
				add_trait = tourney_participant
			}
		}
		else = {
			if = {
				limit = {
					has_trait = tourney_participant
				}
				add_trait_xp = {
  					trait = tourney_participant
 					track = bow
  					value = 3
 				}
 				add_trait_xp = {
  					trait = tourney_participant
 					track = wit
  					value = 3
 				}
			}
			else_if = {
				limit = {
					can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				}
				add_trait = tourney_participant
			}
			every_knight = {
				custom = custom.every_knight
				limit = {
					NOT = { has_trait = tourney_participant }
				}
				add_trait = tourney_participant
			}
			every_knight = {
				custom = custom.every_knight
				add_trait_xp = {
  					trait = tourney_participant
 					track = bow
  					value = 3
 				}
 				add_trait_xp = {
  					trait = tourney_participant
 					track = wit
  					value = 3
 				}
			}
		}
		stress_impact = {
			calm = miniscule_stress_impact_loss
			patient = miniscule_stress_impact_loss
			impatient = miniscule_stress_impact_gain
			wrathful = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100

			modifier = {
				add = 100
				any_knight = {
					jason_locale_events_0220_ranged_knight = yes
				}
			}
			modifier = {
				add = 50
				OR = {
					has_trait = calm
					has_trait = patient
				}
			}
			modifier = {
				add = 25
				scope:activity = {
					OR = {
						has_current_phase = tournament_phase_board_game
						has_current_phase = tournament_phase_recital
						has_current_phase = tournament_phase_archery
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = impatient
					has_trait = wrathful
				}
			}
		}
	}

	option = {
		show_unlock_reason = no
		name = jason_locale_events.0220.e
		flavor = jason_locale_events.0220.e.tt

		trigger = {
			scope:senior_knight = {
				prowess >= 15
			}
		}

		# give some glory to the best battlers
		if = {
			limit = {
				scope:senior_knight = {
					jason_locale_events_0220_courageous_knight = yes
				}
			}
			scope:senior_knight = {
				accolade = { add_glory = massive_glory_gain }
			}
		}
		# give less glory to knight with other accolade
		else_if = {
			limit = {
				scope:senior_knight = { is_acclaimed = yes }
			}
			scope:senior_knight = {
				accolade = { add_glory = major_glory_gain }
			}
		}
		if = {
			limit = {
				scope:senior_knight = {
					has_trait = tourney_participant
				}
			}
			scope:senior_knight = {
				add_trait_xp = {
  					trait = tourney_participant
 					track = foot
  					value = 15
 				}
 			}
		}
		else = {
			scope:senior_knight = {
				add_trait = tourney_participant
				add_trait_xp = {
  					trait = tourney_participant
 					track = foot
  					value = 10
 				}
 			}
		}
		scope:senior_knight = {
			add_prowess_skill = 1
		}
		if = {
			limit = {
				scope:senior_knight = {
					has_any_nickname = no
				}
			}
			scope:senior_knight = {
				custom_tooltip = senior_knight_gains_nickname_tt
				hidden_effect = {
					random_list = {
						10 = { give_nickname = nick_the_vanquisher }
						10 = { give_nickname = nick_the_valiant }
						10 = { give_nickname = nick_the_courageous }
						10 = { give_nickname = nick_the_worthy }
						10 = { give_nickname = nick_the_thunderbolt }
						10 = { give_nickname = nick_the_whirlwind }
						10 = { give_nickname = nick_the_fury }
						10 = { give_nickname = nick_the_unrelenting }
						10 = { give_nickname = nick_the_glorious }
						10 = { give_nickname = nick_the_able }
						10 = { give_nickname = nick_the_victorious }
						10 = { give_nickname = nick_the_fearless }
						10 = { give_nickname = nick_the_brave }
						100 = { }
					}
				}
			}
		}

		stress_impact = {
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			compassionate = miniscule_stress_impact_gain
			forgiving = miniscule_stress_impact_gain
		}

		ai_chance = {
			base = 100

			modifier = {
				add = 100
				scope:senior_knight = {
					jason_locale_events_0220_courageous_knight = yes
				}
			}
			modifier = {
				add = 50
				OR = {
					has_trait = callous
					has_trait = sadistic
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = compassionate
					has_trait = forgiving
				}
			}
		}
	}
	after = {
		scope:senior_knight = {
			remove_character_flag = wear_armor
		}
	}
}
