###########################################
#                                         #
# M&M Monastic Orders Events              #
#                                         #
# ID MNM.4000-MNM.4999                    #
#                                         #
###########################################

# IDs:
# 4100-4199 David
# 4200-4399 Milla -> Matthew used 4300 for 2.8 MO additions
# 4399 Used to clear secluded meditation/prayer mission in certain cases
# 4400-4599 Mathilda -> Drikus used 4435 - 4443
# 4600-4799 Drikus
# 4800-4999 Jakob

namespace = MNM

### JOINING ###

# Welcome letter

# ROOT is character
# FROM is society
letter_event = {
	id = MNM.4450
	desc = EVTDESC_MNM_4450
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes # on_character_ask_to_join_society

	trigger = {
		FROM = {
			leader = { is_monastic_member_trigger = yes }
		}
	}

	immediate = {
		set_character_flag = society_join_block

		FROM = {
			leader = { save_event_target_as = monastic_leader }
		}
	}

	option = {
		name = EVTOPTA_MNM_4450

		join_society = FROM
		scaled_wealth = -0.25
		clr_character_flag = society_join_block
	}
}

### MISSIONS ###
# CleanSlate: Offset to avoid firing events on same day as random society events. Previously occured between tombola and quest event.
character_event = {
	id = MNM.4000

	hide_window = yes
	is_triggered_only = yes # on_society_bi_yearly_pulse

	immediate = {
		character_event = {
			id = MNM.4001
			days = 7
			random = 7
		}
	}
}

# 4001 is tombola
character_event = {
	id = MNM.4001

	hide_window = yes
	is_triggered_only = yes

	only_capable = yes
	prisoner = no

	trigger = {
		has_any_quest = no
		is_monastic_member_trigger = yes
		is_society_grandmaster = no
		is_inaccessible_trigger = no
		NOT = { has_character_modifier = quest_cooldown_timer }
	}

	immediate = {
		society = {
			leader = { save_event_target_as = monastic_leader }
		}

		random_list = {
			10 = { society_quest_event = { id = MNM.4402 } } # Penance/Meditation

			10 = { # Donate to charity
				trigger = {
					is_playable = yes
					NOT = { society_member_of = monastic_order_stoics }
				}

				society_quest_event = { id = MNM.4011 }
			}

			10 = { # Change focus to theology
				trigger = {
					has_dlc = "Way of Life"
					is_playable = yes # Only playable characters get focuses
					NOT = { has_focus = focus_theology }
				}

				society_quest_event = { id = MNM.4015 }
			}

			10 = { # Go on christian pilgrimage
				trigger = {
					has_dlc = "Sons of Abraham"
					is_playable = yes
					religion_group = christian

					NOR = {
						trait = pilgrim
						trait = on_pilgrimage

						has_alternate_start_parameter = {
							key = religion_names
							value = random
						}
					}
				}

				society_quest_event = { id = MNM.4019 }
			}

			10 = { # Go on indian pilgrimage
				trigger = {
					is_playable = yes
					religion_group = indian_group

					NOR = {
						trait = indian_pilgrim
						trait = on_indian_pilgrimage

						has_alternate_start_parameter = {
							key = religion_names
							value = random
						}
					}
				}

				society_quest_event = { id = MNM.8095 }
			}

			10 = { # Build a temple
				trigger = {
					is_playable = yes
					is_tribal = no
					is_nomadic = no
					NOT = { society_member_of = monastic_order_stoics }

					any_demesne_province = {
						num_of_empty_holdings >= 1
						owned_by = PREV
					}
				}

				society_quest_event = { id = MNM.4023 }
			}

			50 = { # AI bypasses missions at times
				trigger = { ai = yes}

				random_list = {
					70 = {
						mult_modifier = {
							factor = 0.9
							society_influence >= 30
						}
						mult_modifier = {
							factor = 0.9
							society_influence >= 40
						}
						mult_modifier = {
							factor = 0.8
							society_influence >= 50
						}
						mult_modifier = {
							factor = 0.7
							society_influence >= 70
						}
						mult_modifier = {
							factor = 0.6
							society_influence >= 80
						}
						mult_modifier = {
							factor = 0.5
							society_influence >= 90
						}

						add_mission_succeed_influence_effect = yes
						monastic_order_purity_effect = yes
					}

					30 = { add_mission_fail_influence_effect = yes }
				}
			}

			85 = {
				trigger = { ai = yes }
				# Do nothing for AI
			}
		}
	}
}

# QUEST: Do penance/meditate
society_quest_event = {
	id = MNM.4402
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	desc = {
		text = EVTDESC_4402_PENANCE
		trigger = { is_christian_monastic_member_trigger = yes }
	}
	desc = {
		text = EVTDESC_4402_MEDITATION
		trigger = { is_dharmic_monastic_member_trigger = yes }
	}
	desc = {
		text = EVTDESC_4402_DIALOGUE
		trigger = { society_member_of = monastic_order_stoics }
	}

	is_triggered_only = yes

	option = {
		name = ACCEPT

		if = {
			limit = { is_christian_monastic_member_trigger = yes }
			set_quest = quest_monastic_order_penance
		}
		else = {
			set_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = DECLINE

		custom_tooltip = { text = decline_quest_tooltip }

		add_character_modifier = {
			name = quest_cooldown_timer
			hidden = yes
			days = 1000
		}

		ai_chance = { factor = 0 }
	}
}

# Penance/meditation begins
character_event = {
	id = MNM.4403
	picture = GFX_evt_secluded_in_prayer
	desc = EVTDESC_4403
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # mnm_monastic_order_decisions.txt

	option = {
		name = {
			text = EVTOPTA_MNM_4403_GOD
			trigger = {
				OR = {
					is_christian_monastic_member_trigger = yes
					society_member_of = monastic_order_hindu
				}
			}
		}
		name = {
			text = EVTOPTA_MNM_4403_NOGOD
			trigger = {
				OR = {
					society_member_of = monastic_order_buddhist
					society_member_of = monastic_order_jain
					society_member_of = monastic_order_stoics
					society_member_of = monastic_order_bon
				}
			}
		}

		lose_weight_small_effect = yes
		weight_trait_check_effect = yes
		set_character_flag = holy_seclusion_timer

		hidden_effect = { set_variable = { which = holy_seclusion_points value = 0 } }

		character_event = {
			id = MNM.4404
			days = 40
			random = 30
		}
	}
}

# Tombola & outcome evaluator for meditation/penance
character_event = {
	id = MNM.4404

	hide_window = yes
	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes
		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	fail_trigger_effect = {
		character_event = { id = MNM.4399 }
	}

	immediate = {
		if = {
			limit = {
				OR = {
					has_character_modifier = in_meditation
					has_character_modifier = doing_penance
				}
			}

			if = {
				limit = {
					check_variable = { which = holy_seclusion_points value >= -2 }
					check_variable = { which = holy_seclusion_points value < 4 }
				}

				clear_event_target = interrupting_child

				random_list = { # Next mission
					30 = { # Struggle with a vice
						trigger = {
							NOT = { has_character_flag = holy_seclusion_struggled_with_vice }

							NAND = {
								trait = temperate
								trait = charitable
								trait = diligent

								trigger_if = {
									limit = {
										NOT = { religion = hindu }
									}

									NOT = { trait = lustful }
								}
							}
						}

						set_character_flag = holy_seclusion_struggled_with_vice

						random_list = {
							10 = {
								trigger = {
									trait = lustful
									NOT = { religion = hindu }
								}

								set_character_flag = holy_seclusion_lustful
							}

							10 = {
								trigger = { NOT = { trait = temperate } }
								set_character_flag = holy_seclusion_gluttonous
							}

							10 = {
								trigger = { NOT = { trait = charitable } }
								set_character_flag = holy_seclusion_greedy
							}

							10 = {
								trigger = { NOT = { trait = diligent } }
								set_character_flag = holy_seclusion_slothful
							}
						}

						character_event = { id = MNM.4405 }
					}

					10 = { # Lonely
						trigger = {
							NOT = { has_character_flag = holy_seclusion_struggled_with_loneliness }

							OR = {
								trait = gregarious
								trait = socializer
							}

							any_courtier = {
								is_adult = yes
								prisoner = no

								NOR = {
									is_friend = ROOT
									is_lover = ROOT
									is_rival = ROOT
									is_married = ROOT
								}
							}
						}

						set_character_flag = holy_seclusion_struggled_with_loneliness
						character_event = { id = MNM.4410 }
					}

					10000 = { # Scripture reading
						trigger = {
							NOT = { has_character_flag = holy_seclusion_scripture_reading }
							job_spiritual = { always = yes }
						}

						set_character_flag = holy_seclusion_scripture_reading
						character_event = { id = MNM.4414 }
					}

					# Child interrupting
					10 = {
						trigger = {
							NOT = { has_character_flag = holy_seclusion_interrupting_child }

							any_child = {
								age >= 4
								is_adult = no
								prisoner = no
								host = { character = ROOT }

								opinion = {
									who = ROOT
									value >= 5
								}
							}
						}

						random_child = {
							limit = {
								age >= 4
								is_adult = no
								prisoner = no
								host = { character = ROOT }

								opinion = {
									who = ROOT
									value >= 5
								}
							}

							preferred_limit = {
								is_primary_heir = ROOT

								NOR = {
									has_opinion_modifier = {
										name = kind_parent
										who = ROOT
									}

									has_opinion_modifier = {
										name = cruel_parent
										who = ROOT
									}
								}
							}

							save_event_target_as = interrupting_child
						}

						set_character_flag = holy_seclusion_interrupting_child
						character_event = { id = MNM.4420 }
					}

					10 = { # General success
						mult_modifier = {
							factor = 1.5
							is_virtous = yes
						}
						mult_modifier = {
							factor = 0.7
							is_wicked = yes
						}
						mult_modifier = {
							factor = 1.5
							is_learned_trigger = yes
						}

						character_event = { id = MNM.4426 }
					}

					10 = { # If all missions have been done already....
						trigger = {
							has_character_flag = holy_seclusion_struggled_with_vice
							has_character_flag = holy_seclusion_struggled_with_loneliness
							has_character_flag = holy_seclusion_scripture_reading
							has_character_flag = holy_seclusion_interrupting_child
						}

						clr_character_flag = holy_seclusion_struggled_with_vice
						clr_character_flag = holy_seclusion_struggled_with_loneliness
						clr_character_flag = holy_seclusion_scripture_reading
						clr_character_flag = holy_seclusion_interrupting_child
					}
				}

				# Sends the tombola again
				repeat_event = {
					id = MNM.4404
					days = 40
					random = 30
				}
			}

			# Mission success/fail
			else = {
				society = {
					leader = { save_event_target_as = monastic_leader }
				}

				if = {
					limit = { check_variable = { which = holy_seclusion_points value >= 4 } }
					letter_event = { id = MNM.4428 }
				}
				else = {
					letter_event = { id = MNM.4429 }
				}
			}
		}
	}
}

# Penance/seclusion: Dealing with vice
character_event = {
	id = MNM.4405
	picture = GFX_evt_dark_love
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_4405_LUSTFUL
		picture = GFX_evt_dark_love
		trigger = { has_character_flag = holy_seclusion_lustful }
	}
	desc = {
		text = EVTDESC_4405_GLUTTONOUS
		picture = GFX_evt_feast
		trigger = { has_character_flag = holy_seclusion_gluttonous }
	}
	desc = {
		text = EVTDESC_4405_GREEDY
		picture = GFX_evt_charity
		trigger = { has_character_flag = holy_seclusion_greedy }
	}
	desc = {
		text = EVTDESC_4405_SLOTHFUL
		picture = GFX_evt_recovery
		trigger = { has_character_flag = holy_seclusion_slothful }
	}

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	immediate = {
		trigger_switch = {
			on_trigger = has_character_flag

			holy_seclusion_lustful = {
				if = {
					limit = {
						any_artifact = {
							OR = {
								has_artifact_flag = about_religion
								artifact_type = the_confessions_of_root
							}

							is_artifact_equipped = yes
						}
					}

					random_artifact = {
						limit = {
							OR = {
								has_artifact_flag = about_religion
								artifact_type = the_confessions_of_root
							}

							is_artifact_equipped = yes
						}

						preferred_limit = { quality >= 3 }
						preferred_limit = { quality >= 2 }

						save_event_target_as = book_target
					}
				}
			}

			holy_seclusion_gluttonous = {
				if = {
					limit = {
						any_artifact = {
							has_artifact_flag = cooking
							is_artifact_equipped = yes
						}
					}

					random_artifact = {
						limit = {
							has_artifact_flag = cooking
							is_artifact_equipped = yes
							NOT = { artifact_type = gastronomic_tonics } # Not really about food
						}

						preferred_limit = { quality >= 3 }
						preferred_limit = { quality >= 2 }

						save_event_target_as = book_target
					}
				}
			}

			holy_seclusion_greedy = {
				if = {
					limit = {
						any_artifact = {
							OR = {
								artifact_type = the_confessions_of_root
								has_artifact_flag = about_diplomacy
							}

							is_artifact_equipped = yes
						}
					}

					random_artifact = {
						limit = {
							OR = {
								artifact_type = the_confessions_of_root
								has_artifact_flag = about_diplomacy
							}

							is_artifact_equipped = yes
						}

						preferred_limit = { quality >= 3 }
						preferred_limit = { quality >= 2 }

						save_event_target_as = book_target
					}
				}
			}

			holy_seclusion_slothful = {
				if = {
					limit = {
						any_artifact = {
							OR = {
								AND = {
									has_artifact_flag = about_dynasty
									original_owner = { NOT = { character = ROOT } }
								}

								has_artifact_flag = poetry
							}

							is_artifact_equipped = yes
						}
					}

					random_artifact = {
						limit = {
							OR = {
								AND = {
									has_artifact_flag = about_dynasty
									original_owner = { NOT = { character = ROOT } }
								}

								has_artifact_flag = poetry
							}

							is_artifact_equipped = yes
						}

						preferred_limit = { quality >= 3 }
						preferred_limit = { quality >= 2 }

						save_event_target_as = book_target
					}
				}
			}
		}
	}

	# Indulge
	option = {
		name = {
			text = EVTOPTA_4405_LUSTFUL
			trigger = { has_character_flag = holy_seclusion_lustful }
		}
		name = {
			text = EVTOPTA_4405_GLUTTONOUS
			trigger = { has_character_flag = holy_seclusion_gluttonous }
		}
		name = {
			text = EVTOPTA_4405_GREEDY
			trigger = { has_character_flag = holy_seclusion_greedy }
		}
		name = {
			text = EVTOPTA_4405_SLOTHFUL
			trigger = { has_character_flag = holy_seclusion_slothful }
		}

		if = {
			limit = { has_character_flag = holy_seclusion_gluttonous }
			gain_weight_small_effect = yes
			weight_trait_check_effect = yes
		}

		random_list = {
			65 = {
				custom_tooltip = {
					text = EVTOPTA_MNM_4405_tt_success
					character_event = { id = MNM.4406 days = 3 }
				}
			}

			35 = {
				custom_tooltip = {
					text = EVTOPTA_MNM_4405_tt_fail
					character_event = { id = MNM.4407 days = 3 }
				}
			}
		}
	}

	# Fight it (with reading from your library!)
	option = {
		name = {
			text = EVTOPTB_4405_LUSTFUL_book
			trigger = { has_character_flag = holy_seclusion_lustful }
		}
		name = {
			text = EVTOPTB_4405_GLUTTONOUS_book
			trigger = { has_character_flag = holy_seclusion_gluttonous }
		}
		name = {
			text = EVTOPTB_4405_GREEDY_book
			trigger = { has_character_flag = holy_seclusion_greedy }
		}
		name = {
			text = EVTOPTB_4405_SLOTHFUL_book
			trigger = { has_character_flag = holy_seclusion_slothful }
		}

		tooltip_info_custom = available_because_books_tt

		trigger = {
			event_target:book_target = { always = yes }
		}

		if = {
			limit = { has_character_flag = holy_seclusion_gluttonous }
			lose_weight_small_effect = yes
			weight_trait_check_effect = yes
		}

		set_character_flag = used_a_book

		random_list = {
			70 = {
				custom_tooltip = {
					text = EVTOPTB_MNM_4405_tt_success
					character_event = { id = MNM.4408 days = 14 }
				}
			}

			30 = {
				custom_tooltip = {
					text = EVTOPTB_MNM_4405_tt_fail
					character_event = { id = MNM.4409 days = 14 }
				}
			}
		}
	}

	# Fight it
	option = {
		name = {
			text = EVTOPTB_4405_LUSTFUL
			trigger = { has_character_flag = holy_seclusion_lustful }
		}
		name = {
			text = EVTOPTB_4405_GLUTTONOUS
			trigger = { has_character_flag = holy_seclusion_gluttonous }
		}
		name = {
			text = EVTOPTB_4405_GREEDY
			trigger = { has_character_flag = holy_seclusion_greedy }
		}
		name = {
			text = EVTOPTB_4405_SLOTHFUL
			trigger = { has_character_flag = holy_seclusion_slothful }
		}

		if = {
			limit = { has_character_flag = holy_seclusion_greedy }
			scaled_wealth = { value = -0.5 min = -50 }
		}
		else_if = {
			limit = { has_character_flag = holy_seclusion_gluttonous }
			lose_weight_small_effect = yes
			weight_trait_check_effect = yes
		}

		random_list = {
			40 = {
				custom_tooltip = {
					text = EVTOPTB_MNM_4405_tt_success
					character_event = { id = MNM.4408 days = 14 }
				}
			}

			60 = {
				custom_tooltip = {
					text = EVTOPTB_MNM_4405_tt_fail
					character_event = { id = MNM.4409 days = 14 }
				}
			}
		}
	}
}

# Vice outcome - small success
character_event = {
	id = MNM.4406
	picture = GFX_evt_dark_love
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_4406_LUSTFUL_A
		picture = GFX_evt_dark_love
		trigger = {
			has_character_flag = holy_seclusion_lustful
			event_target:holy_seclusion_lover = { always = yes }
		}
	}
	desc = {
		text = EVTDESC_4406_LUSTFUL_B
		picture = GFX_evt_dark_love
		trigger = {
			has_character_flag = holy_seclusion_lustful
			event_target:holy_seclusion_lover = { always = no }
		}
	}
	desc = {
		text = EVTDESC_4406_GLUTTONOUS
		picture = GFX_evt_feast
		trigger = { has_character_flag = holy_seclusion_gluttonous }
	}
	desc = {
		text = EVTDESC_4406_GREEDY
		picture = GFX_evt_charity
		trigger = { has_character_flag = holy_seclusion_greedy }
	}
	desc = {
		text = EVTDESC_4406_SLOTHFUL
		picture = GFX_evt_recovery
		trigger = { has_character_flag = holy_seclusion_slothful }
	}

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	immediate = {
		if = {
			limit = { has_character_flag = holy_seclusion_lustful }

			random_courtier = {
				limit = {
					is_adult = yes
					prisoner = no
					is_incapable = no
					is_married = no
					is_attractive_trigger = yes
					root_attraction_trigger = yes

					NOR = {
						trait = celibate
						is_close_relative = ROOT
					}
				}

				save_event_target_as = holy_seclusion_lover
			}
		}
	}

	option = {
		name = {
			text = EVTOPTA_4406_LUSTFUL
			trigger = { has_character_flag = holy_seclusion_lustful }
		}
		name = {
			text = EVTOPTA_4406_GLUTTONOUS
			trigger = { has_character_flag = holy_seclusion_gluttonous }
		}
		name = {
			text = EVTOPTA_4406_GREEDY
			trigger = { has_character_flag = holy_seclusion_greedy }
		}
		name = {
			text = EVTOPTA_4406_SLOTHFUL
			trigger = { has_character_flag = holy_seclusion_slothful }
		}

		custom_tooltip = {
			text = EVTOPTA_4406_TOOLTIP
		}

		hidden_effect = { change_variable = { which = holy_seclusion_points value = 1 } }

		if = {
			limit = {
				has_character_flag = holy_seclusion_lustful
				NOT = { is_lover = event_target:holy_seclusion_lover }
			}

			random = {
				chance = 30

				add_lover = event_target:holy_seclusion_lover
			}
		}

		clr_character_flag = holy_seclusion_lustful
		clr_character_flag = holy_seclusion_gluttonous
		clr_character_flag = holy_seclusion_greedy
		clr_character_flag = holy_seclusion_slothful
	}
}

# Vice outcome - small failure
character_event = {
	id = MNM.4407
	picture = GFX_evt_recovery
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_4407_LUSTFUL
		picture = GFX_evt_recovery
		trigger = { has_character_flag = holy_seclusion_lustful }
	}
	desc = {
		text = EVTDESC_4407_GLUTTONOUS
		picture = GFX_evt_drunk
		trigger = { has_character_flag = holy_seclusion_gluttonous }
	}
	desc = {
		text = EVTDESC_4407_GREEDY
		picture = GFX_evt_drunk
		trigger = { has_character_flag = holy_seclusion_greedy }
	}
	desc = {
		text = EVTDESC_4407_SLOTHFUL
		picture = GFX_evt_drunk
		trigger = { has_character_flag = holy_seclusion_slothful }
	}

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = {
			text = EVTOPTA_4407_LUSTFUL
			trigger = { has_character_flag = holy_seclusion_lustful }
		}
		name = {
			text = EVTOPTA_4407_GLUTTONOUS
			trigger = { has_character_flag = holy_seclusion_gluttonous }
		}
		name = {
			text = EVTOPTA_4407_GREEDY
			trigger = { has_character_flag = holy_seclusion_greedy }
		}
		name = {
			text = EVTOPTA_4407_SLOTHFUL
			trigger = { has_character_flag = holy_seclusion_slothful }
		}

		custom_tooltip = { text = EVTOPTA_4407_TOOLTIP }

		clr_character_flag = holy_seclusion_lustful
		clr_character_flag = holy_seclusion_gluttonous
		clr_character_flag = holy_seclusion_greedy
		clr_character_flag = holy_seclusion_slothful
	}
}

# Vice outcome big success
character_event = {
	id = MNM.4408
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_4408_LUSTFUL
		trigger = { has_character_flag = holy_seclusion_lustful }
	}
	desc = {
		text = EVTDESC_4408_GLUTTONOUS
		trigger = { has_character_flag = holy_seclusion_gluttonous }
	}
	desc = {
		text = EVTDESC_4408_GREEDY
		trigger = {
			has_character_flag = holy_seclusion_greedy
			NOT = { has_character_flag = used_a_book }
		}
	}
	desc = {
		text = EVTDESC_4408_SLOTHFUL
		trigger = {
			has_character_flag = holy_seclusion_slothful
			NOT = { has_character_flag = used_a_book }

		}
	}
	desc = {
		text = EVTDESC_4408_GREEDY_book
		trigger = {
			has_character_flag = holy_seclusion_greedy
			has_character_flag = used_a_book
		}
	}
	desc = {
		text = EVTDESC_4408_SLOTHFUL_book
		trigger = {
			has_character_flag = holy_seclusion_slothful
			has_character_flag = used_a_book
		}
	}

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = {
			text = EVTOPTA_4408_LUSTFUL
			trigger = { has_character_flag = holy_seclusion_lustful }
		}
		name = {
			text = EVTOPTA_4408_GLUTTONOUS
			trigger = { has_character_flag = holy_seclusion_gluttonous }
		}
		name = {
			text = EVTOPTA_4408_GREEDY
			trigger = { has_character_flag = holy_seclusion_greedy }
		}
		name = {
			text = EVTOPTA_4408_SLOTHFUL
			trigger = { has_character_flag = holy_seclusion_slothful }
		}

		custom_tooltip = { text = EVTOPTA_4408_TOOLTIP }

		hidden_effect = {
			change_variable = { which = holy_seclusion_points value = 2 }
			monastic_order_purity_effect = yes
		}

		trigger_switch = {
			on_trigger = has_character_flag

			holy_seclusion_lustful = {
				add_trait = celibate

				add_character_modifier = {
					name = promise_of_celibacy
					years = 3
				}

				random = {
					chance = 50
					remove_trait_lustful_effect = yes
				}
			}

			holy_seclusion_gluttonous = {
				random = {
					chance = 50
					add_trait_partially_temperate_effect = yes
				}
			}

			holy_seclusion_greedy = {
				random = {
					chance = 50
					add_trait_partially_charitable_effect = yes
				}
			}

			holy_seclusion_slothful = {
				random = {
					chance = 50
					add_trait_partially_diligent_effect = yes
				}
			}
		}

		clr_character_flag = holy_seclusion_lustful
		clr_character_flag = holy_seclusion_gluttonous
		clr_character_flag = holy_seclusion_greedy
		clr_character_flag = holy_seclusion_slothful
		clr_character_flag = used_a_book
	}
}

# Vice outcome - big failure
character_event = {
	id = MNM.4409
	picture = GFX_evt_drunk
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_4409_LUSTFUL
		picture = GFX_evt_brothel
		trigger = { has_character_flag = holy_seclusion_lustful }
	}
	desc = {
		text = EVTDESC_4409_GLUTTONOUS
		picture = GFX_evt_drunk
		trigger = { has_character_flag = holy_seclusion_gluttonous }
	}
	desc = {
		text = EVTDESC_4409_GREEDY
		picture = GFX_evt_drunk
		trigger = { has_character_flag = holy_seclusion_greedy }
	}
	desc = {
		text = EVTDESC_4409_SLOTHFUL
		picture = GFX_evt_drunk
		trigger = { has_character_flag = holy_seclusion_slothful }
	}

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = {
			text = EVTOPTA_4409_LUSTFUL
			trigger = { has_character_flag = holy_seclusion_lustful }
		}
		name = {
			text = EVTOPTA_4409_GLUTTONOUS
			trigger = { has_character_flag = holy_seclusion_gluttonous }
		}
		name = {
			text = EVTOPTA_4409_GREEDY
			trigger = { has_character_flag = holy_seclusion_greedy }
		}
		name = {
			text = EVTOPTA_4409_SLOTHFUL
			trigger = { has_character_flag = holy_seclusion_slothful }
		}

		custom_tooltip = { text = EVTOPTA_4409_TOOLTIP }

		hidden_effect = { change_variable = { which = holy_seclusion_points value = -5 } }

		trigger_switch = {
			on_trigger = has_character_flag

			holy_seclusion_lustful = {
				if = {
					limit = {
						NOT = { trait = lovers_pox }
					}

					add_trait = lovers_pox

					if = {
						limit = { is_married = yes }
						character_event = { id = 20 }
					}
				}
			}

			holy_seclusion_gluttonous = {
				random = {
					chance = 30
					add_trait_gluttonous_effect = yes
				}
			}

			holy_seclusion_greedy = {
				scaled_wealth = { value = 0.5 min = 50 }

				random = {
					chance = 30
					add_trait_greedy_effect = yes
				}
			}

			holy_seclusion_slothful = {
				random = {
					chance = 30
					add_trait_slothful_effect = yes
				}
			}
		}

		if = {
			limit = { is_christian_monastic_member_trigger = yes }

			add_character_modifier = {
				name = rampant_sinner_christian
				years = 3
			}
		}
		else = {
			add_character_modifier = {
				name = rampant_sinner_dharmic
				years = 3
			}
		}

		clr_character_flag = holy_seclusion_lustful
		clr_character_flag = holy_seclusion_gluttonous
		clr_character_flag = holy_seclusion_greedy
		clr_character_flag = holy_seclusion_slothful
		clr_character_flag = used_a_book
	}
}

# Penance/meditation: struggle with loneliness
character_event = {
	id = MNM.4410
	desc = EVTDESC_MNM_4410
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	immediate = {
		random_courtier = {
			limit = {
				is_adult = yes
				prisoner = no

				NOR = {
					is_friend = ROOT
					is_rival = ROOT
					is_lover = ROOT
					is_married = ROOT
				}
			}

			save_event_target_as = potential_friend
		}
	}

	# Go out and talk with them
	option = {
		name = EVTOPTA_MNM_4410

		custom_tooltip = { text = EVTOPTA_MNM_4410_TOOLTIP }

		character_event = { id = MNM.4411 days = 2 }

		random = {
			chance = 50

			tooltip = { add_friend = event_target:potential_friend }
			set_character_flag = new_friend
		}

	}

	option = {
		name = EVTOPTB_MNM_4410

		random_list = {
			65 = {
				custom_tooltip = { text = EVTOPTA_4406_TOOLTIP }
				character_event = { id = MNM.4412 days = 2 }
			}

			35 = {
				custom_tooltip = { text = EVTOPTA_4407_TOOLTIP }

				random = {
					chance = 50

					if = {
						limit = {
							NOT = { trait = stressed }
						}

						tooltip = { add_trait = stressed }
						set_character_flag = add_stressed
					}
					else_if = {
						limit = {
							NOT = { trait = depressed }
						}

						tooltip = { add_trait = depressed }
						set_character_flag = add_depressed
					}
				}

				character_event = { id = MNM.4413 days = 2 }
			}
		}

		if = {
			limit = { trait = gregarious }

			random = {
				chance = 20

				tooltip = { remove_trait = gregarious }
				set_character_flag = lose_gregarious
			}
		}
	}
}

# You went to talk to them
character_event = {
	id = MNM.4411
	desc = EVTDESC_MNM_4411
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4411

		custom_tooltip = { text = EVTOPTA_MNM_4410_TOOLTIP }

		hidden_effect = { change_variable = { which = holy_seclusion_points value = -1 } }

		if = {
			limit = { has_character_flag = new_friend }
			add_friend = event_target:potential_friend
			clr_character_flag = new_friend
		}
	}
}

# You managed to deal with it
character_event = {
	id = MNM.4412
	desc = EVTDESC_MNM_4412
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4412

		custom_tooltip = { text = EVTOPTA_4406_TOOLTIP }

		hidden_effect = { change_variable = { which = holy_seclusion_points value = 1 } }

		if = {
			limit = { has_character_flag = lose_gregarious }
			remove_trait = gregarious
			clr_character_flag = lose_gregarious
		}
	}
}

# You get very lonely
character_event = {
	id = MNM.4413
	desc = EVTDESC_MNM_4413
	picture = GFX_evt_recovery
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4413

		custom_tooltip = { text = EVTOPTA_4406_TOOLTIP }

		if = {
			limit = { has_character_flag = lose_gregarious }
			remove_trait = gregarious
			clr_character_flag = lose_gregarious
		}

		if = {
			limit = { has_character_flag = add_depressed }
			add_trait = depressed
			clr_character_flag = add_depressed
		}

		if = {
			limit = { has_character_flag = add_stressed }
			add_trait = stressed
			clr_character_flag = add_stressed
		}
	}
}

# You struggle with the scripture
character_event = {
	id = MNM.4414
	desc = EVTDESC_MNM_4414
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	immediate = {
		job_spiritual = { save_event_target_as = court_spiritual }
	}

	# You keep reading
	option = {
		name = EVTOPTA_MNM_4414

		random_list = {
			35 = {
				mult_modifier = {
					factor = 1.4
					is_smart_trigger = yes
				}
				mult_modifier = {
					factor = 1.4
					learning >= 14
				}
				mult_modifier = {
					factor = 1.4
					learning >= 16
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				custom_tooltip = { text = EVTOPTA_MNM_4414_TOOLTIP_SUCCESS }
				character_event = { id = MNM.4415 days = 3 }
			}

			65 = {
				mult_modifier = {
					factor = 1.5
					is_dumb_trigger = yes
				}
				mult_modifier = {
					factor = 1.5
					learning < 8
				}

				custom_tooltip = { text = EVTOPTA_MNM_4414_TOOLTIP_FAILURE }
				character_event = { id = MNM.4416 days = 3 }
			}
		}
	}

	option = {
		name = EVTOPTB_MNM_4414

		random_list = {
			65 = {
				custom_tooltip = { text = EVTOPTB_MNM_4414_TOOLTIP_SUCCESS }
				character_event = { id = MNM.4417 days = 3 }
			}

			35 = {
				custom_tooltip = { text = EVTOPTB_MNM_4414_TOOLTIP_FAILURE }
				character_event = { id = MNM.4418 days = 3 }
			}
		}
	}
}

# You interpret the text
character_event = {
	id = MNM.4415
	desc = EVTDESC_MNM_4415
	picture = GFX_evt_library
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = {
			text = EVTOPTA_MNM_4415_A
			trigger = {
				NOR = {
					religion = buddhist
					religion = jain
					religion_openly_bon_or_reformed_trigger = yes
				}
			}
		}
		name = {
			text = EVTOPTA_MNM_4415_B
			trigger = {
				OR = {
					religion = buddhist
					religion = jain
					religion_openly_bon_or_reformed_trigger = yes
				}
			}
		}

		custom_tooltip = { text = EVTOPTA_MNM_4414_TOOLTIP_SUCCESS }

		hidden_effect = {
			change_variable = { which = holy_seclusion_points value = 2 }
			monastic_order_purity_effect = yes
		}

		piety = 100

		if = {
			limit = {
				NOT = { trait = erudite }
			}

			add_trait = erudite
		}
	}
}

# You fail to interpret the text
character_event = {
	id = MNM.4416
	desc = EVTDESC_MNM_4416
	picture = GFX_evt_recovery
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = {
			text = EVTOPTA_MNM_4416_A
			trigger = {
				NOR = {
					religion = buddhist
					religion = jain
					religion_openly_bon_or_reformed_trigger = yes
				}
			}
		}
		name = {
			text = EVTOPTA_MNM_4416_B
			trigger = {
				OR = {
					religion = buddhist
					religion = jain
					religion_openly_bon_or_reformed_trigger = yes
				}
			}
		}

		custom_tooltip = { text = EVTOPTA_MNM_4414_TOOLTIP_FAILURE }
	}
}

# You get help
character_event = {
	id = MNM.4417
	desc = EVTDESC_MNM_4417
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = {
			text = EVTOPTA_MNM_4415_A
			trigger = {
				NOR = {
					religion = buddhist
					religion = jain
					religion_openly_bon_or_reformed_trigger = yes
				}
			}
		}
		name = {
			text = EVTOPTA_MNM_4415_B
			trigger = {
				OR = {
					religion = buddhist
					religion = jain
					religion_openly_bon_or_reformed_trigger = yes
				}
			}
		}

		custom_tooltip = { text = EVTOPTB_MNM_4414_TOOLTIP_SUCCESS }
		hidden_effect = { change_variable = { which = holy_seclusion_points value = 1 } }
	}
}

# Unhelpful court chaplain
character_event = {
	id = MNM.4418
	desc = EVTDESC_MNM_4418
	picture = GFX_evt_recovery
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4418

		custom_tooltip = { text = EVTOPTB_MNM_4414_TOOLTIP_FAILURE }

		hidden_effect = { change_variable = { which = holy_seclusion_points value = -1 } }

		if = {
			limit = {
				event_target:court_spiritual = { is_alive = yes }
			}

			opinion = {
				name = opinion_ungrateful
				who = event_target:court_spiritual
				years = 5
			}

			reverse_opinion = {
				name = opinion_ignorant
				who = event_target:court_spiritual
				years = 5
			}
		}
	}
}

# Your child wants your attention
character_event = {
	id = MNM.4420
	desc = EVTDESC_MNM_4420
	picture = GFX_evt_child_play
	border = GFX_event_normal_frame_diplomacy
	portrait = event_target:interrupting_child

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	# Teach them about the scripture
	option = {
		name = EVTOPTA_MNM_4420

		random_list = {
			50 = {
				mult_modifier = {
					factor = 1.5
					event_target:interrupting_child = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.5
					event_target:interrupting_child = {
						OR = {
							trait = idolizer
							trait = zealous
						}
					}
				}
				mult_modifier = {
					factor = 1.5
					reverse_opinion = {
						who = event_target:interrupting_child
						value >= 50
					}
				}

				custom_tooltip = { text = EVTOPTA_MNM_4420_TOOLTIP_SUCCESS }
				character_event = { id = MNM.4422 }
			}

			50 = {
				mult_modifier = {
					factor = 1.5
					event_target:interrupting_child = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 1.5
					event_target:interrupting_child = { trait = cynical }
				}

				custom_tooltip = { text = EVTOPTA_MNM_4420_TOOLTIP_FAILURE }
				character_event = { id = MNM.4423 }
			}
		}
	}

	# Be patient with them
	option = {
		name = EVTOPTB_MNM_4420

		custom_tooltip = { text = EVTOPTB_MNM_4420_TOOLTIP }
		hidden_effect = { change_variable = { which = holy_seclusion_points value = -1 } }

		random = {
			chance = 20
			add_trait_kind_effect = yes
		}

		random_list = {
			80 = {
				reverse_opinion = {
					name = kind_parent
					who = event_target:interrupting_child
					years = 10
				}
			}

			20 = {
				trigger = {
					NOT = { is_friend = event_target:interrupting_child }
				}

				add_friend = event_target:interrupting_child
			}
		}
	}

	# Sho away
	option = {
		name = EVTOPTC_MNM_4420

		random_list = {
			65 = {
				mult_modifier = {
					factor = 1.5
					is_benevolent_trigger = yes
				}
				mult_modifier = {
					factor = 1.5
					has_pleasant_personality_trigger = yes
				}

				custom_tooltip = { text = EVTOPTC_MNM_4420_TOOLTIP_SUCCESS }
				character_event = { id = MNM.4424 }
			}

			35 = {
				mult_modifier = {
					factor = 1.5
					is_evil_trigger = yes
				}
				mult_modifier = {
					factor = 1.5
					has_unpleasant_personality_trigger = yes
				}

				custom_tooltip = { text = EVTOPTC_MNM_4420_TOOLTIP_FAILURE }
				character_event = { id = MNM.4425 }
			}
		}
	}
}

# Understood lesson
character_event = {
	id = MNM.4422
	desc = EVTDESC_MNM_4422
	picture = GFX_evt_child_reading
	border = GFX_event_normal_frame_diplomacy
	portrait = event_target:interrupting_child

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4422

		custom_tooltip = { text = EVTOPTA_MNM_4420_TOOLTIP_SUCCESS }

		hidden_effect = {
			change_variable = { which = holy_seclusion_points value = 2 }
			monastic_order_purity_effect = yes
		}

		event_target:interrupting_child = {
			show_scope_change = no

			if = {
				limit = {
					has_dlc = "Conclave"
					NOT = { trait = idolizer }
				}
				add_trait = idolizer
			}
			else_if = {
				limit = {
					NOR = {
						has_dlc = "Conclave"
						trait = zealous
					}
				}

				add_trait = zealous
			}

			if = {
				limit = { is_smart_trigger = no }

				random = {
					chance = 20
					add_trait = shrewd
				}
			}
		}

		random_list = {
			80 = {
				reverse_opinion = {
					who = event_target:interrupting_child
					name = kind_parent
					years = 10
				}
			}

			20 = {
				trigger = {
					NOT = { is_friend = event_target:interrupting_child }
				}

				add_friend = event_target:interrupting_child
			}
		}
	}
}

# Did not understand lesson
character_event = {
	id = MNM.4423
	desc = EVTDESC_MNM_4423
	picture = GFX_evt_child_bully
	border = GFX_event_normal_frame_diplomacy
	portrait = event_target:interrupting_child

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4423

		custom_tooltip = { text = EVTOPTA_MNM_4420_TOOLTIP_FAILURE }

		hidden_effect = { change_variable = { which = holy_seclusion_points value = -1 } }

		event_target:interrupting_child = {
			show_scope_change = no

			if = {
				limit = { is_dumb_trigger = no }

				random = {
					chance = 15
					add_trait = dull
				}
			}
		}
	}
}

# Kindly rejected
character_event = {
	id = MNM.4424
	desc = EVTDESC_MNM_4424
	picture = GFX_evt_child_reading
	border = GFX_event_normal_frame_diplomacy
	portrait = event_target:interrupting_child

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4424

		custom_tooltip = { text = EVTOPTC_MNM_4420_TOOLTIP_SUCCESS }

		hidden_effect = { change_variable = { which = holy_seclusion_points value = 1 } }
	}
}

# Cruelly rejected
character_event = {
	id = MNM.4425
	desc = EVTDESC_MNM_4425
	picture = GFX_evt_child_bully
	border = GFX_event_normal_frame_diplomacy
	portrait = event_target:interrupting_child

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	immediate = {
		event_target:interrupting_child = {
			mother_even_if_dead = {
				if = {
					limit = {
						NOT = { character = ROOT }
					}

					save_event_target_as = other_parent
				}
			}

			father_even_if_dead = {
				if = {
					limit = {
						NOT = { character = ROOT }
					}

					save_event_target_as = other_parent
				}
			}
		}
	}

	option = {
		name = EVTOPTA_MNM_4425

		custom_tooltip = { text = EVTOPTC_MNM_4420_TOOLTIP_FAILURE }

		hidden_effect = { change_variable = { which = holy_seclusion_points value = -2 } }

		random = {
			chance = 20
			add_trait_cruel_effect = yes
		}

		random_list = {
			80 = {
				reverse_opinion = {
					name = cruel_parent
					who = event_target:interrupting_child
					years = 10
				}
			}

			20 = {
				trigger = {
					NOT = { is_rival = event_target:interrupting_child }
				}

				add_rival = event_target:interrupting_child
			}
		}
	}
}

# General good outcome
character_event = {
	id = MNM.4426
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_MNM_4425_A
		trigger = { has_character_flag = success_seclusion_desc_A }
	}
	desc = {
		text = EVTDESC_MNM_4425_B
		trigger = { has_character_flag = success_seclusion_desc_B }
	}
	desc = {
		text = EVTDESC_MNM_4425_C
		trigger = { has_character_flag = success_seclusion_desc_C }
	}

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	immediate = {
		random_list = { # This setup
			33 = {
				trigger = { NOT = { has_character_flag = success_seclusion_desc_A } }
				set_character_flag = success_seclusion_desc_A
				clr_character_flag = success_seclusion_desc_B
				clr_character_flag = success_seclusion_desc_C
			}

			33 = {
				trigger = { NOT = { has_character_flag = success_seclusion_desc_B } }
				set_character_flag = success_seclusion_desc_B
				clr_character_flag = success_seclusion_desc_A
				clr_character_flag = success_seclusion_desc_C
			}

			33 = {
				trigger = { NOT = { has_character_flag = success_seclusion_desc_C } }
				set_character_flag = success_seclusion_desc_C
				clr_character_flag = success_seclusion_desc_B
				clr_character_flag = success_seclusion_desc_A
			}
		}
	}

	option = {
		name = {
			text = EVTOPTA_MNM_4426_GOD
			trigger = {
				NOR = {
					society_member_of = monastic_order_buddhist
					society_member_of = monastic_order_jain
					society_member_of = monastic_order_stoics
					society_member_of = monastic_order_bon
				}
			}
		}
		name = {
			text = EVTOPTA_MNM_4426_NOGOD
			trigger = {
				OR = {
					society_member_of = monastic_order_buddhist
					society_member_of = monastic_order_jain
					society_member_of = monastic_order_stoics
					society_member_of = monastic_order_bon
				}
			}
		}

		custom_tooltip = { text = EVTOPTA_4406_TOOLTIP }

		hidden_effect = {
			change_variable = { which = holy_seclusion_points value = 1 }
			# clr_character_flag = success_seclusion_desc_A
			# clr_character_flag = success_seclusion_desc_B
			# clr_character_flag = success_seclusion_desc_C
		}
	}
}

# Penance/meditation success
letter_event = {
	id = MNM.4428
	desc = EVTDESC_MNM_4428
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4428

		if = {
			limit = { has_quest = quest_monastic_order_penance }

			clr_quest = quest_monastic_order_penance
			sound_effect = monastic_orders_penance
			remove_character_modifier = doing_penance
		}
		else_if = {
			limit = { has_quest = quest_monastic_order_meditation }

			clr_quest = quest_monastic_order_meditation
			sound_effect = monastic_orders_meditate_in_seclusion
			remove_character_modifier = in_meditation
		}

		if = {
			limit = {
				any_owned_bloodline = {
					has_bloodline_flag = monastic_saintly_bloodline
					bloodline_is_active_for = PREV
				}
			}

			add_society_currency_major_effect = yes
		}
		else = {
			add_society_currency_medium_effect = yes
		}

		hidden_effect = { monastic_order_purity_effect = yes }

		clr_character_flag = success_seclusion_desc_A # Flags from 4426
		clr_character_flag = success_seclusion_desc_B
		clr_character_flag = success_seclusion_desc_C
		clr_character_flag = holy_seclusion_struggled_with_vice
		clr_character_flag = holy_seclusion_scripture_reading
		clr_character_flag = holy_seclusion_timer
		clr_character_flag = holy_seclusion_struggled_with_loneliness
		clr_character_flag = holy_seclusion_interrupting_child
	}
}

# Penance/meditation failure
letter_event = {
	id = MNM.4429
	border = GFX_event_letter_frame_religion
	desc = EVTDESC_MNM_4429
	portrait = event_target:monastic_leader

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			has_quest = quest_monastic_order_penance
			has_quest = quest_monastic_order_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4429

		if = {
			limit = { has_quest = quest_monastic_order_penance }

			clr_quest = {
				id = quest_monastic_order_penance
				failure = yes
			}

			remove_character_modifier = doing_penance
		}
		else_if = {
			limit = { has_quest = quest_monastic_order_meditation }

			clr_quest = {
				id = quest_monastic_order_meditation
				failure = yes
			}

			remove_character_modifier = in_meditation
		}

		clr_character_flag = success_seclusion_desc_A # Flags from 4426
		clr_character_flag = success_seclusion_desc_B
		clr_character_flag = success_seclusion_desc_C
	}
}

# Left Monastic Order or cancelled seclusion mission, and therefore rejoins the world of the living
character_event = {
	id = MNM.4399
	border = GFX_event_normal_frame_religion
	desc = EVTDESC_MNM_4399
	picture = GFX_evt_recovery

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			remove_character_modifier = doing_penance
			remove_character_modifier = in_meditation
		}
	}

	option = {
		name = EVTOPTA_MNM_4399

		if = {
			limit = { has_quest = quest_monastic_order_penance }

			clr_quest = {
				id = quest_monastic_order_penance
				failure = yes
			}
		}
		else_if = {
			limit = { has_quest = quest_monastic_order_meditation }

			clr_quest = {
				id = quest_monastic_order_meditation
				failure = yes
			}
		}

		clr_character_flag = success_seclusion_desc_A # Flags from 4426
		clr_character_flag = success_seclusion_desc_B
		clr_character_flag = success_seclusion_desc_C
		clr_character_flag = holy_seclusion_struggled_with_vice
		clr_character_flag = holy_seclusion_scripture_reading
		clr_character_flag = holy_seclusion_timer
		clr_character_flag = holy_seclusion_struggled_with_loneliness
		clr_character_flag = holy_seclusion_interrupting_child
	}
}


# MISSION: Do charity
society_quest_event = {
	id = MNM.4011
	desc = EVTDESC_MNM_4011
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes

	option = {
		name = ACCEPT

		set_quest = quest_monastic_order_donate_to_charity
	}

	option = {
		name = DECLINE

		custom_tooltip = { text = decline_quest_tooltip }

		add_character_modifier = {
			name = quest_cooldown_timer
			hidden = yes
			days = 1000
		}

		ai_chance = { factor = 0 }
	}
}


# MISSION: Theology focus
society_quest_event = {
	id = MNM.4015
	desc = EVTDESC_MNM_4015
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes

	trigger = {
		NOR = {
			has_focus = focus_theology
			has_any_quest = yes
		}
	}

	option = {
		name = ACCEPT

		set_quest = quest_monastic_order_theology_focus
	}

	option = {
		name = DECLINE

		custom_tooltip = { text = decline_quest_tooltip }

		add_character_modifier = {
			name = quest_cooldown_timer
			hidden = yes
			days = 1000
		}

		ai_chance = { factor = 0 }
	}
}

# Theology focus mission success
letter_event = {
	id = MNM.4016
	desc = EVTDESC_MNM_4016
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes

	immediate = {
		society = {
			leader = {
				save_event_target_as = monastic_leader
			}
		}
	}

	option = {
		name = EVTOPT_MNM_4016

		clr_quest = quest_monastic_order_theology_focus
		sound_effect = monastic_orders_pick_theology_focus

		hidden_effect = { monastic_order_purity_effect = yes }

		if = {
			limit = {
				any_owned_bloodline = {
					has_bloodline_flag = monastic_saintly_bloodline
					bloodline_is_active_for = PREV
				}
			}

			add_society_currency_medium_effect = yes
		}
		else = {
			add_society_currency_minor_effect = yes
		}
	}
}

# MISSION: Christian Pilgrimage
society_quest_event = {
	id = MNM.4019
	desc = EVTDESC_MNM_4019
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes


	option = {
		name = ACCEPT

		set_quest = quest_monastic_order_pilgrimage_christian
	}

	option = {
		name = DECLINE

		custom_tooltip = { text = decline_quest_tooltip }

		add_character_modifier = {
			name = quest_cooldown_timer
			hidden = yes
			days = 1000
		}

		ai_chance = { factor = 0 }
	}
}

# Pilgrimage completed
letter_event = {
	id = MNM.4020
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	desc = {
		text = EVTDESC_MNM_4020
		trigger = { event_target:monastic_leader = { always = yes } }
	}
	desc = {
		text = EVTDESC_MNM_4020_fallback
		trigger = { NOT = { event_target:monastic_leader = { always = yes } } } # Added in case everyone is in prison or something...!
	}

	is_triggered_only = yes

	immediate = {
		society = {
			if = { # If YOU are not the leader of the society, find the leader (provided they are available)...
				limit = {
					ROOT = { is_society_grandmaster = no }
					leader = { block_general_event_trigger = no }
				}

				leader = { save_event_target_as = monastic_leader }
			}
			else = { # Else, find someone who is...
				random_society_member = {
					limit = {
						NOT = { character = ROOT }
						block_general_event_trigger = no
					}

					save_event_target_as = monastic_leader
				}
			}
		}
	}

	option = {
		name = EVTOPT_MNM_4020

		clr_quest = quest_monastic_order_pilgrimage_christian
		sound_effect = monastic_orders_pilgrimage

		hidden_effect = { monastic_order_purity_effect = yes }

		if = {
			limit = {
				any_owned_bloodline = {
					has_bloodline_flag = monastic_saintly_bloodline
					bloodline_is_active_for = PREV
				}
			}

			add_society_currency_large_effect = yes
		}
		else = {
			add_society_currency_major_effect = yes
		}
	}
}

# MISSION: Dharmic Pilgrimage
society_quest_event = {
	id = MNM.8095
	desc = EVTDESC_MNM_4019
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes

	option = {
		name = ACCEPT

		set_quest = quest_indian_monastic_order_pilgrimage
	}

	option = {
		name = DECLINE

		hidden_effect = {
			add_character_modifier = {
				name = quest_cooldown_timer
				days = 1000
				hidden = yes
			}
		}

		ai_chance = { factor = 0 }
	}
}


# Dharmic Pilgrimage completed
letter_event = {
	id = MNM.8099
#	picture = GFX_evt_dharmic_pilgrims
	border = GFX_event_letter_frame_religion

	desc = {
		text = EVTDESC_MNM_8099
		trigger = { event_target:monastic_leader = { always = yes } }
	}
	desc = {
		text = EVTDESC_MNM_4020_fallback
		trigger = { NOT = { event_target:monastic_leader = { always = yes } } } # Added in case everyone is in prison or something...!
	}

	is_triggered_only = yes

	trigger = { has_quest = quest_indian_monastic_order_pilgrimage }

	immediate = {
		society = {
			if = { # If YOU are not the leader of the society, find the leader (provided they are available)...
				limit = {
					ROOT = { is_society_grandmaster = no }
					leader = { block_general_event_trigger = no }
				}

				leader = { save_event_target_as = monastic_leader }
			}
			else = { # Else, find someone who is...
				random_society_member = {
					limit = {
						NOT = { character = ROOT }
						block_general_event_trigger = no
					}

					save_event_target_as = monastic_leader
				}
			}
		}
	}

	option = {
		name = EVTOPT_MNM_8099

		clr_quest = quest_indian_monastic_order_pilgrimage
		sound_effect = monastic_orders_pilgrimage
		add_society_currency_major_effect = yes
	}
}

# MISSION: Build a Temple
society_quest_event = {
	id = MNM.4023
	desc = EVTDESC_MNM_4023
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes

	option = {
		name = ACCEPT

		set_quest = monastic_orders_temple_construction
	}

	option = {
		name = DECLINE

		custom_tooltip = { text = decline_quest_tooltip }

		add_character_modifier = {
			name = quest_cooldown_timer
			days = 1000
			hidden = yes
		}

		ai_chance = { factor = 0 }
	}
}

# Temple built
# ROOT is builder
# FROM is title
letter_event = {
	id = MNM.4026
	desc = EVTDESC_MNM_4026
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes # on_settlement_construction_completed

	trigger = {
		has_quest = monastic_orders_temple_construction
		FROM = { holding_type = temple }
		NOT = { has_character_flag = monastic_orders_temple_construction_ongoing } # flag to avoid doubling of letter events when finishing two buildings at the same time
	}

	immediate = {
		set_character_flag = monastic_orders_temple_construction_ongoing

		society = {
			leader = { save_event_target_as = monastic_leader }
		}
	}

	option = {
		name = EVTOPT_MNM_4026

		clr_quest = monastic_orders_temple_construction
		sound_effect = monastic_orders_build_temple_holding

		hidden_effect = { monastic_order_purity_effect = yes }

		if = {
			limit = {
				any_owned_bloodline = {
					has_bloodline_flag = monastic_saintly_bloodline
					bloodline_is_active_for = PREV
				}
			}

			add_society_currency_large_effect = yes
		}
		else = {
			add_society_currency_major_effect = yes
		}
	}

	after = {
		clr_character_flag = monastic_orders_temple_construction_ongoing
	}
}



### POWERS ###

# POWER: Swapping Celibacy
character_event = {
	id = MNM.4090
	desc = EVTDESC_MNM_4090
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # monastic_orders_go_celibate, mnm_monastic_order_decisions.txt

	option = {
		name = EVTOPT_MNM_4090

		add_trait = celibate
	}
}

character_event = {
	id = MNM.4091
	desc = EVTDESC_MNM_4091
	picture = GFX_evt_pregnancy
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # monastic_orders_stop_celibate, mnm_monastic_order_decisions.txt

	option = {
		name = EVTOPT_MNM_4091

		remove_trait = celibate
	}
}

# # POWER: Passive trait improvement ### Purity effect now only triggered through mission success
# character_event = {
#	id = MNM.4430
#
#	is_triggered_only = yes
#	hide_window = yes
#
#	religion_group = indian_group
#	is_in_society = yes
#	only_capable = yes
#	prisoner = no
#	min_age = 16
#
#	trigger = {
#		OR = {
#			society_member_of = monastic_order_buddhist
#			society_member_of = monastic_order_jain
#		}
#	}
#
#	immediate = {
#		change_variable = { which = global_passive_purity_possible value = 1 }
#
#		random = {
#			chance = 20
#
#			mult_modifier = {
#				factor = 1.3
#				society_rank >= 2
#			}
#			mult_modifier = {
#				factor = 1.3
#				society_rank >= 3
#			}
#			mult_modifier = {
#				factor = 1.3
#				society_rank >= 4
#			}
#
#			change_variable = { which = global_passive_purity_fired value = 1 }
#			character_event = { id = MNM.4400 }
#		}
#	}
# }


# POWER: Invite monk or nun
character_event = {
	id = MNM.4434
	desc = EVTDESC_MNM_4434
	picture = GFX_evt_monastery_nuns
	border = GFX_event_normal_frame_religion
	portrait = event_target:ascetic

	is_triggered_only = yes # monastic_orders_invite_ascetic, mnm_monastic_order_decisions.txt

	immediate = {
		clr_character_flag = ascetic_arriving

		random_list = {
			# Nun
			60 = {
				mult_modifier = {
					factor = 0.2
					gender_equality_trigger = no
				}

				create_character = {
					random_traits = yes
					dynasty = none
					religion = ROOT
					female = yes
					age = 20
					health = 6
				}
			}

			# Monk
			40 = {
				create_character = {
					random_traits = yes
					dynasty = none
					religion = ROOT
					female = no
					age = 22
					health = 6
				}
			}
		}

		new_character = {
			save_event_target_as = ascetic

			join_prev_monastic_order_society = yes

			random_list = {
				33 = { }
				33 = { add_age = 20 }
				33 = { add_age = 45 }
			}

			random_list = {
				3 = { }
				1 = { add_age = -3 }
				1 = { add_age = -2 }
				1 = { add_age = -1 }
				1 = { add_age = 1 }
				1 = { add_age = 2 }
				1 = { add_age = 3 }
			}

			# Set correct education
			clear_education_trait = yes
			random_list = {
				60 = { add_trait = scholarly_theologian }
				40 = { add_trait = mastermind_theologian }
			}

			# Up  learning
			random_list = {
				25 = { change_learning = 3 }
				25 = { change_learning = 4 }
				25 = { change_learning = 5 }
				25 = { change_learning = 6 }
			}

			# Set some interesting traits

			# Nun/monk traits
			add_ascetic_trait_effect = yes
			add_trait = celibate
			remove_trait = cynical
			add_trait = zealous

			if = {
				limit = {
					has_dharmic_religion_trigger = yes
					religion_openly_bon_or_reformed_trigger = no
				}
				remove_trait = kshatriya
				remove_trait = vaishya
				add_trait = brahmin
			}

			# Nice congential
			random_list = {
				10 = {
					remove_trait = ugly
					add_trait = attractive
				}

				5 = {
					remove_trait = imbecile
					remove_trait = quick
					remove_trait = slow
					add_trait = genius
				}

				10 = {
					remove_trait = imbecile
					remove_trait = genius
					remove_trait = slow
					add_trait = quick
				}

				5 = {
					remove_trait = weak
					add_trait = strong
				}

				100 = { }
			}

			# Lifestyle
			remove_lifestyle_trait_effect = yes

			random_list = {
				15 = { add_trait = scholar }
				15 = { add_trait = theologian }
				10 = { add_trait = mystic }

				20 = {
					trigger = { ROOT = { society_member_of = monastic_order_benedictine } }
					add_trait = gardener
				}
			}

			# Virtues
			remove_trait = lustful
			remove_trait = wroth
			remove_trait = gluttonous
			remove_trait = cruel

			random = {
				chance = 20
				add_trait = chaste
			}

			random = {
				chance = 20
				remove_trait = envious
				add_trait = kind
			}

			random = {
				chance = 20
				remove_trait = greedy
				add_trait = charitable
			}

			random = {
				chance = 10
				add_trait = temperate
				lose_weight_small_effect = yes
				weight_trait_check_effect = yes
			}

			random = {
				chance = 5
				remove_trait = wroth
				add_trait = patient
			}

			random = {
				chance = 10
				remove_trait = proud
				add_trait = humble
			}

			random = {
				chance = 5
				remove_trait = slothful
				add_trait = diligent
			}

			# Misc traits
			remove_trait = deceitful
			remove_trait = arbitrary

			random = {
				chance = 10
				add_trait = honest
			}

			random = {
				chance = 10
				add_trait = just
			}

			random = {
				chance = 15
				add_trait = erudite
			}

			random = {
				chance = 10
				remove_trait = ambitious
				add_trait = content
			}

			random = {
				chance = 15
				add_trait = homosexual
				set_character_flag = revealed_homosexual@ROOT
			}

			if = {
				limit = { has_dlc = "Reapers" }

				random = {
					chance = 33
					add_trait = physician
				}
			}

			# Nicknames
			random_list = {
				10 = { give_nickname = nick_the_holy }

				10 = {
					trigger = {
						trait = kind
						trait = charitable
						trait = humble
					}

					give_nickname = nick_the_saint
				}

				10 = {
					trigger = {
						trait = kind
						trait = charitable
					}

					give_nickname = nick_the_kind
				}

				10 = {
					trigger = {
						trait = charitable
						trait = just
					}

					give_nickname = nick_the_good
				}

				10 = {
					trigger = {
						OR = {
							is_smart_trigger = yes
							trait = just
							trait = patient
							trait = scholar
						}
					}

					give_nickname = nick_the_wise
				}

				10 = {
					trigger = { religion_group = christian }
					give_nickname = nick_the_confessor
				}

				10 = {
					trigger = { religion_group = christian }
					give_nickname = nick_the_blessed
				}

				10 = {
					trigger = { religion_group = christian }
					give_nickname = nick_the_apostle
				}

				10 = {
					trigger = { religion_group = christian }
					give_nickname = nick_the_pious
				}

				50 = { }
			}
		}
	}

	option = {
		name = EVTOPTA_MNM_4434

		reverse_opinion = {
			name = opinion_loyal_servant
			who = event_target:ascetic
		}
	}
}

# POWER: Benedictine becomes diligent
# Ping event for Benedictine Diligent (mentee)
character_event = {
	id = MNM.4600

	hide_window = yes
	is_triggered_only = yes # request_to_rank_up_within_society, mnm_society_decisions.txt

	trigger = { NOT = { trait = diligent } }

	immediate = {
		save_event_target_as = benedictines_diligent_mentee

		monastic_order_benedictine = {
			if = {
				limit = {
					NOT = {
						any_society_member = {
							trait = diligent
							NOT = { character = ROOT }
						}
					}
				}

				random_society_member = {
					limit = {
						ai = yes

						NOR = {
							trait = diligent
							character = ROOT
						}
					}

					add_trait = diligent
				}
			}

			random_society_member = {
				limit = {
					trait = diligent
					NOT = { character = ROOT }
				}

				preferred_limit = { society_rank == 4 }

				save_event_target_as = benedictines_diligent_mentor
			}
		}

		event_target:benedictines_diligent_mentor = { character_event = { id = MNM.4601 } }
	}
}

# Benedictine Diligent Mentor: should I help fellow benedictine become diligent?
character_event = {
	id = MNM.4601
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_MNM_4601_SLOTHFUL
		trigger = { # target is slothful
			event_target:benedictines_diligent_mentee = {
				trait = slothful
			}
		}
	}
	desc = {
		text = EVTDESC_MNM_4601_REGULAR
		trigger = { # target is not slothful
			event_target:benedictines_diligent_mentee = {
				NOT = { trait = slothful }
			}
		}
	}

	is_triggered_only = yes

	trigger = { is_monastic_member_trigger = yes }

	option = { # offer to help in exchange for money
		name = EVTOPTA_MNM_4601
		show_portrait = event_target:benedictines_diligent_mentee

		custom_tooltip = { text = EVTOPTA_MNM_4601_TOOLTIP }

		event_target:benedictines_diligent_mentee = {
			letter_event = {
				id = MNM.4603
				days = 7
				random = 7
			}
		}
	}

	option = { # nah
		name = EVTOPTB_MNM_4601
		custom_tooltip = { text = EVTOPTB_MNM_4601_TOOLTIP }

		ai_chance = { factor = 0 }
	}
}


# Benedictines Diligent Mentee: receive offer of help
letter_event = {
	id = MNM.4603
	border = GFX_event_letter_frame_religion

	desc = {
		text = EVTDESC_MNM_4603_SLOTHFUL
		trigger = { trait = slothful }
	}
	desc = {
		text = EVTDESC_MNM_4603_REGULAR
		trigger = {
			NOT = { trait = slothful }
		}
	}

	is_triggered_only = yes

	option = { # accept help in exchange for money
		name = EVTOPTA_MNM_4603

		event_target:benedictines_diligent_mentor = {
			letter_event = {
				id = MNM.4604
				days = 7
				random = 7
			}
		}

		transfer_scaled_wealth = {
			to = event_target:benedictines_diligent_mentor
			value = 0.25
			min = 30
		}

		ai_chance = { factor = 0.9 }
	}

	option = { # HOW DARE HE?!
		name = EVTOPTB_MNM_4603_SLOTHFUL

		trigger = { trait = slothful }

		event_target:benedictines_diligent_mentor = {
			set_character_flag = MNM_4603_rejected_help_outraged

			letter_event = {
				id = MNM.4608
				days = 7
				random = 7
			}
		}

		opinion = {
			name = opinion_outraged
			who = event_target:benedictines_diligent_mentor
			years = 5
		}

		prestige = 100

		ai_chance = {
			factor = 0.1

			mult_modifier = {
				factor = 2
				trait = proud
			}
			mult_modifier = {
				factor = 0.5
				trait = humble
			}
		}
	}

	option = { # I don't need help
		name = EVTOPTC_MNM_4603_REGULAR

		trigger = { NOT = { trait = slothful } }

		prestige = 25

		hidden_effect = {
			event_target:benedictines_diligent_mentor = {
				set_character_flag = MNM_4603_rejected_help_normal

				letter_event = {
					id = MNM.4608
					days = 7
					random = 7
				}
			}
		}

		ai_chance = {
			factor = 0.1

			mult_modifier = {
				factor = 2
				trait = proud
			}
			mult_modifier = {
				factor = 0.5
				trait = humble
			}
		}
	}
}

# Benedictines Diligent Mentor: mentee accepted offer
letter_event = {
	id = MNM.4604
	desc = EVTDESC_MNM_4604
	border = GFX_event_letter_frame_religion

	is_triggered_only = yes

	trigger = { is_monastic_member_trigger = yes }

	option = { # Give help
		name = EVTOPTA_MNM_4604

		custom_tooltip = { text = EVTOPTA_MNM_4604_TOOLTIP }

		event_target:benedictines_diligent_mentee = {
			character_event = {
				id = MNM.4605
				days = 7
				random = 7
			}
		}

		tooltip = {
			event_target:benedictines_diligent_mentee = {
				transfer_scaled_wealth = {
					to = event_target:benedictines_diligent_mentor
					value = 0.25
					min = 50
				}
			}

			reverse_opinion = {
				name = opinion_very_grateful
				who = event_target:benedictines_diligent_mentee
				years = 5
			}
		}
	}
}

# Benedictines Diligent Mentee: help received
character_event = {
	id = MNM.4605
	desc = EVTDESC_MNM_4605
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { # Receive help
		name = EVTOPTA_MNM_4605

		character_event = {
			id = MNM.4607
			days = 37
			random = 37
		}

		opinion = {
			name = opinion_very_grateful
			who = event_target:benedictines_diligent_mentor
			years = 5
		}
	}
}

# Benedictines Diligent Mentee: add Diligent (and remove slothful)
character_event = {
	id = MNM.4607
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion
	portrait = event_target:benedictines_diligent_mentor

	desc = {
		text = EVTDESC_MNM_4607_SLOTHFUL
		trigger = { trait = slothful }
	}
	desc = {
		text = EVTDESC_MNM_4607_REGULAR
		trigger = {
			NOT = { trait = slothful }
		}
	}

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { trait = slothful }
			set_character_flag = MNM_4609_had_slothful
		}
		else = {
			set_character_flag = MNM_4609_not_had_slothful
		}
	}

	option = {
		name = EVTOPTA_MNM_4607

		add_trait_fully_silently_diligent_effect = yes

		event_target:benedictines_diligent_mentor = {
			character_event = { id = MNM.4609 }
		}
	}
}

# Benedictine Diligent mentor: mentee rejected offer
letter_event = {
	id = MNM.4608
	border = GFX_event_letter_frame_religion

	desc = {
		text = EVTDESC_MNM_4608_OUTRAGED
		trigger = { has_character_flag = MNM_4603_rejected_help_outraged }
	}
	desc = {
		text = EVTDESC_MNM_4608_NORMAL
		trigger = { has_character_flag = MNM_4603_rejected_help_normal }
	}

	is_triggered_only = yes

	option = { # Oh dear...
		name = EVTOPTA_MNM_4608_OUTRAGED

		trigger = { has_character_flag = MNM_4603_rejected_help_outraged }

		custom_tooltip = { text = EVTOPTA_MNM_4608_TOOLTIP }

		tooltip = {
			reverse_opinion = {
				name = opinion_outraged
				who = event_target:benedictines_diligent_mentee
				years = 5
			}
		}
	}

	option = { # Alright then
		name = EVTOPTA_MNM_4608_NORMAL

		trigger = { has_character_flag = MNM_4603_rejected_help_normal }

		custom_tooltip = { text = EVTOPTA_MNM_4608_TOOLTIP }
	}
}

# Benedictines Diligent notify mentor mentee became Diligent
character_event = {
	id = MNM.4609
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_MNM_4609_SLOTHFUL
		trigger = { # target is slothful
			event_target:benedictines_diligent_mentee = {
				has_character_flag = MNM_4609_had_slothful
			}
		}
	}
	desc = {
		text = EVTDESC_MNM_4609_REGULAR
		trigger = { # target is not diligent
			event_target:benedictines_diligent_mentee = {
				has_character_flag = MNM_4609_not_had_slothful
			}
		}
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_4609

		event_target:benedictines_diligent_mentee = {
			show_scope_change = no

			tooltip = {
				if = {
					limit = { has_character_flag = MNM_4609_had_slothful }
					remove_trait = slothful
				}

				add_trait = diligent
			}

			clr_character_flag = MNM_4609_had_slothful
			clr_character_flag = MNM_4609_not_had_slothful
		}
	}
}

# POWER: Convert County
# Notification for ruler who performs the power
character_event = {
	id = MNM.4990
	picture = GFX_evt_charity
	desc = EVTDESC_MNM_4990
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # monastic_order_convert_county, mnm_monastic_order_decisions.txt
	notification = yes

	ai = no

	option = {
		name = EXCELLENT
	}
}

# Notification event for county owner if different from user
character_event = {
	id = MNM.4991
	picture = GFX_evt_charity
	desc = EVTDESC_MNM_4991
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # monastic_order_convert_county, mnm_monastic_order_decisions.txt

	ai = no

	option = {
		name = I_SEE
	}
}

# POWER: Rk2 Remove sin "spiritual_guidance"
# Notification for when you do it on someone
character_event = {
	id = MNM.4950
	picture = GFX_evt_secluded_in_prayer
	desc = EVTDESC_MNM_4950
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # monastic_orders_spiritual_guidance, mnm_monastic_order_decisions.txt

	ai = no

	option = {
		name = EXCELLENT
	}
}

# Notification for when you are targeted
character_event = {
	id = MNM.4951
	picture = GFX_evt_secluded_in_prayer
	desc = EVTDESC_MNM_4951
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # monastic_orders_spiritual_guidance, mnm_monastic_order_decisions.txt

	option = {
		name = I_SEE

		trigger_switch = {
			on_trigger = has_character_flag

			spiritual_guidance_lustful = {
				clr_character_flag = spiritual_guidance_lustful
				tooltip = { remove_trait = lustful }
			}

			spiritual_guidance_gluttonous = {
				clr_character_flag = spiritual_guidance_gluttonous
				tooltip = { remove_trait = gluttonous }
			}

			spiritual_guidance_greedy = {
				clr_character_flag = spiritual_guidance_greedy
				tooltip = { remove_trait = greedy }
			}

			spiritual_guidance_slothful = {
				clr_character_flag = spiritual_guidance_slothful
				tooltip = { remove_trait = slothful }
			}

			spiritual_guidance_wroth = {
				clr_character_flag = spiritual_guidance_wroth
				tooltip = { remove_trait = wroth }
			}

			spiritual_guidance_envious = {
				clr_character_flag = spiritual_guidance_envious
				tooltip = { remove_trait = envious }
			}

			spiritual_guidance_proud = {
				clr_character_flag = spiritual_guidance_proud
				tooltip = { remove_trait = proud }
			}
		}
	}
}

# POWER: Rk3 Remove sin "teach_virtue"
# Notification for when you do it on someone
character_event = {
	id = MNM.4960
	picture = GFX_evt_religious_exultation
	desc = EVTDESC_MNM_4960
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # monastic_orders_teach_virtue, mnm_monastic_order_decisions.txt

	ai = no

	option = {
		name = EXCELLENT
	}
}

# Notification for when you are targeted
character_event = {
	id = MNM.4961
	picture = GFX_evt_religious_exultation
	desc = EVTDESC_MNM_4961
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # monastic_orders_teach_virtue, mnm_monastic_order_decisions.txt

	option = {
		name = I_SEE

		trigger_switch = {
			on_trigger = has_character_flag

			teach_virtue_chaste = {
				clr_character_flag = teach_virtue_chaste
				tooltip = { add_trait = chaste }
			}

			teach_virtue_temperate = {
				clr_character_flag = teach_virtue_temperate
				tooltip = { add_trait = temperate }
			}

			teach_virtue_charitable = {
				clr_character_flag = teach_virtue_charitable
				tooltip = { add_trait = charitable }
			}

			teach_virtue_diligent = {
				clr_character_flag = teach_virtue_diligent
				tooltip = { add_trait = diligent }
			}

			teach_virtue_patient = {
				clr_character_flag = teach_virtue_patient
				tooltip = { add_trait = patient }
			}

			teach_virtue_kind = {
				clr_character_flag = teach_virtue_kind
				tooltip = { add_trait = kind }
			}

			teach_virtue_humble = {
				clr_character_flag = teach_virtue_humble
				tooltip = { add_trait = humble }
			}
		}
	}
}


### ACTIONS ###

# ACTION: Donating to charity
letter_event = {
	id = MNM.4014
	desc = EVTDESC_MNM_4014
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_leader

	is_triggered_only = yes # monastic_orders_donate_to_charity, mnm_monastic_order_decisions.txt

	trigger = { is_monastic_member_trigger = yes }

	option = {
		name = EVTOPT_MNM_4014

		wealth = -100

		if = {
			limit = { has_quest = quest_monastic_order_donate_to_charity }

			clr_quest = quest_monastic_order_donate_to_charity
			sound_effect = monastic_orders_donate_charity

			hidden_effect = { monastic_order_purity_effect = yes }

			if = {
				limit = {
					any_owned_bloodline = {
						has_bloodline_flag = monastic_saintly_bloodline
						bloodline_is_active_for = PREV
					}
				}

				add_society_currency_major_effect = yes
			}
			else = {
				add_society_currency_medium_effect = yes
			}
		}
		else = {
			if = {
				limit = {
					any_owned_bloodline = {
						has_bloodline_flag = monastic_saintly_bloodline
						bloodline_is_active_for = PREV
					}
				}

				add_society_currency_medium_effect = yes
			}
			else = {
				add_society_currency_minor_effect = yes
			}
		}

		add_character_modifier = {
			name = recently_donated_to_charity
			days = 360
		}

		if = {
			limit = { trait = greedy }

			random = {
				chance = 40
				remove_trait_greedy_effect = yes
			}
		}
		else = {
			random = {
				chance = 30
				add_trait_charitable_effect = yes
			}
		}

		clr_character_flag = donate_to_charity_cooldown
	}
}


### MISC ###

# Soul purity effect

character_event = {
	id = MNM.4400
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_4400_REMOVE_CYNICAL
		trigger = { has_character_flag = purity_remove_cynical }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_GLUTTONOUS
		trigger = { has_character_flag = purity_remove_gluttonous }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_GREEDY
		trigger = { has_character_flag = purity_remove_greedy }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_SLOTHFUL
		trigger = { has_character_flag = purity_remove_slothful }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_ENVIOUS
		trigger = { has_character_flag = purity_remove_envious }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_WROTH
		trigger = { has_character_flag = purity_remove_wroth }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_PROUD
		trigger = { has_character_flag = purity_remove_proud }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_DECEITFUL
		trigger = { has_character_flag = purity_remove_deceitful }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_CRUEL
		trigger = { has_character_flag = purity_remove_cruel }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_LUSTFUL
		trigger = { has_character_flag = purity_remove_lustful }
	}
	desc = {
		text = EVTDESC_4400_ADD_HUMBLE
		trigger = { has_character_flag = purity_add_humble }
	}
	desc = {
		text = EVTDESC_4400_ADD_CHARITABLE
		trigger = { has_character_flag = purity_add_charitable }
	}
	desc = {
		text = EVTDESC_4400_ADD_CHASTE
		trigger = { has_character_flag = purity_add_chaste }
	}
	desc = {
		text = EVTDESC_4400_ADD_KIND
		trigger = { has_character_flag = purity_add_kind }
	}
	desc = {
		text = EVTDESC_4400_ADD_TEMPERATE
		trigger = { has_character_flag = purity_add_temperate }
	}
	desc = {
		text = EVTDESC_4400_ADD_HONEST
		trigger = { has_character_flag = purity_add_honest }
	}
	desc = {
		text = EVTDESC_4400_REMOVE_AMBITIOUS
		trigger = { has_character_flag = purity_remove_ambitious }
	}
	desc = {
		text = EVTDESC_4400_ADD_CONTENT
		trigger = { has_character_flag = purity_add_content }
	}
	desc = {
		text = EVTDESC_4400_ADD_PATIENT
		trigger = { has_character_flag = purity_add_patient }
	}
	desc = {
		text = EVTDESC_4400_ADD_DILIGENT
		trigger = { has_character_flag = purity_add_diligent }
	}

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		OR = {
			trait = cynical
			trait = gluttonous
			trait = greedy
			trait = slothful
			trait = envious
			trait = wroth
			trait = proud
			trait = deceitful
			trait = cruel
			trait = ambitious

			trigger_if = {
				limit = { NOT = { religion = hindu } }
				trait = lustful
			}

			NAND = {
				trait = humble
				trait = charitable
				trait = kind
				trait = temperate
				trait = honest
				trait = patient
				trait = diligent
				trait = content

				trigger_if = {
					limit = { NOT = { religion = hindu } }
					trait = chaste
				}
			}
		}
	}

	immediate = {
		# FIRST STAGE
		# Removes cynic, gluttonous, greedy, slothful, lustful, envious, wrath, pride, deceitful,
		# Adds humble, charitable
		if = {
			limit = {
				OR = {
					trait = cynical
					trait = gluttonous
					trait = greedy
					trait = slothful
					trait = envious
					trait = wroth
					trait = proud
					trait = deceitful
					trait = cruel

					trigger_if = {
						limit = { NOT = { religion = hindu } }
						trait = lustful
					}

					NAND = {
						trait = humble
						trait = charitable
					}
				}
			}

			random_list = {
				15 = {
					trigger = { trait = cynical }
					set_character_flag = purity_remove_cynical
				}

				10 = {
					trigger = { trait = gluttonous }
					set_character_flag = purity_remove_gluttonous
				}

				10 = {
					trigger = { trait = greedy }
					set_character_flag = purity_remove_greedy
				}

				10 = {
					trigger = { trait = slothful }
					set_character_flag = purity_remove_slothful
				}

				10 = {
					trigger = { trait = envious }
					set_character_flag = purity_remove_envious
				}

				10 = {
					trigger = { trait = wroth }
					set_character_flag = purity_remove_wroth
				}

				10 = {
					trigger = { trait = proud }
					set_character_flag = purity_remove_proud
				}

				10 = {
					trigger = { trait = deceitful }
					set_character_flag = purity_remove_deceitful
				}

				10 = {
					trigger = { trait = cruel }
					set_character_flag = purity_remove_cruel
				}

				10 = {
					trigger = {
						trait = lustful
						NOT = { religion = hindu }
					}

					set_character_flag = purity_remove_lustful
				}

				10 = {
					trigger = {
						NOR = {
							trait = humble
							trait = proud
						}
					}

					set_character_flag = purity_add_humble
				}

				10 = {
					trigger = {
						NOR = {
							trait = charitable
							trait = greedy
						}
					}

					set_character_flag = purity_add_charitable
				}
			}
		}

		# SECOND STAGE
		# Add traits chaste, kind, temperate, honest
		else_if = {
			limit = {
				NAND = {
					trigger_if = {
						limit = { NOT = { religion = hindu } }
						trait = chaste
					}

					trait = kind
					trait = temperate
					trait = honest
				}
			}

			random_list = {
				10 = {
					trigger = {
						NOR = {
							trait = chaste
							religion = hindu
						}
					}

					set_character_flag = purity_add_chaste
				}

				10 = {
					trigger = { NOT = { trait = kind } }
					set_character_flag = purity_add_kind
				}

				10 = {
					trigger = { NOT = { trait = temperate } }
					set_character_flag = purity_add_temperate
				}

				10 = {
					trigger = { NOT = { trait = honest } }
					set_character_flag = purity_add_honest
				}
			}
		}

		# THIRD STAGE
		# Removes ambitious
		# Adds patient, diligent, content
		else = {
			random_list = {
				10 = {
					trigger = { trait = ambitious }
					set_character_flag = purity_remove_ambitious
				}

				10 = {
					trigger = {
						NOR = {
							trait = ambitious
							trait = content
						}
					}

					set_character_flag = purity_add_content
				}

				10 = {
					trigger = { NOT = { trait = patient } }
					set_character_flag = purity_add_patient
				}

				10 = {
					trigger = { NOT = { trait = diligent } }
					set_character_flag = purity_add_diligent
				}
			}
		}
	}

	option = {
		name = {
			text = EVTOPTA_MNM_4400_GOD
			trigger = {
				NOR = {
					society_member_of = monastic_order_buddhist
					society_member_of = monastic_order_jain
					society_member_of = monastic_order_bon
				}
			}
		}
		name = {
			text = EVTOPTA_MNM_4400_NOGOD
			trigger = {
				OR = {
					society_member_of = monastic_order_buddhist
					society_member_of = monastic_order_jain
					society_member_of = monastic_order_bon
				}
			}
		}

		trigger_switch = {
			on_trigger = has_character_flag

			purity_remove_cynical    = { remove_trait = cynical }
			purity_remove_gluttonous = { remove_trait = gluttonous }
			purity_remove_greedy     = { remove_trait = greedy }
			purity_remove_slothful   = { remove_trait = slothful }
			purity_remove_envious    = { remove_trait = envious }
			purity_remove_wroth      = { remove_trait = wroth }
			purity_remove_proud      = { remove_trait = proud }
			purity_remove_deceitful  = { remove_trait = deceitful }
			purity_remove_cruel      = { remove_trait = cruel }
			purity_remove_lustful    = { remove_trait = lustful }
			purity_add_humble        = { add_trait = humble }
			purity_add_charitable    = { add_trait = charitable }
			purity_add_chaste        = { add_trait = chaste }
			purity_add_kind          = { add_trait = kind }
			purity_add_temperate     = { add_trait = temperate }
			purity_add_honest        = { add_trait = honest }
			purity_remove_ambitious  = { remove_trait = ambitious }
			purity_add_content       = { add_trait = content }
			purity_add_patient       = { add_trait = patient }
			purity_add_diligent      = { add_trait = diligent }
		}

		clr_character_flag = purity_remove_cynical
		clr_character_flag = purity_remove_gluttonous
		clr_character_flag = purity_remove_greedy
		clr_character_flag = purity_remove_slothful
		clr_character_flag = purity_remove_envious
		clr_character_flag = purity_remove_wroth
		clr_character_flag = purity_remove_proud
		clr_character_flag = purity_remove_deceitful
		clr_character_flag = purity_remove_cruel
		clr_character_flag = purity_remove_lustful
		clr_character_flag = purity_add_humble
		clr_character_flag = purity_add_charitable
		clr_character_flag = purity_add_chaste
		clr_character_flag = purity_add_kind
		clr_character_flag = purity_add_temperate
		clr_character_flag = purity_add_honest
		clr_character_flag = purity_remove_ambitious
		clr_character_flag = purity_add_content
		clr_character_flag = purity_add_patient
		clr_character_flag = purity_add_diligent
	}
}

# Random relic reward for lvl 3 event
letter_event = {
	id = MNM.4431
	desc = EVTDESC_MNM_4431
	portrait = event_target:my_grandmaster

	is_triggered_only = yes

	trigger = {
		society_rank >= 3
		is_christian_monastic_member_trigger = yes
		NOT = { has_artifact = fingerbone_of_saint }
	}

	option = {
	 	name = EVTOPTA_MNM_4428

		add_artifact = fingerbone_of_saint
	}
}

### INTERACTION EVENTS ###

# Monastic Friendship & Love #

# Starter Event for Monastic Friendship - I need a friend.
character_event = {
	id = MNM.4435
	desc = EVTDESC_MNM_4435
	picture = GFX_evt_stone_church
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_society_bi_yearly_pulse, random_events

	only_capable = yes

	trigger = {
		is_inaccessible_trigger = no
		NOT = { trait = homosexual }

		OR = {
			is_dharmic_monastic_member_trigger = yes
			is_christian_monastic_member_trigger = yes
		}

		society = {
			any_society_member = {
				same_sex = ROOT
				ai = yes
				has_education_intrigue_trigger = no

				opinion = {
					who = ROOT
					value >= 0
				}

				reverse_opinion = {
					who = ROOT
					value >= 0
				}

				NOR = {
					character = ROOT
					is_rival = ROOT
					is_friend = ROOT
					is_lover = ROOT
					trait = chaste
					trait = celibate
				}
			}
		}
	}

	immediate = {
		# save_event_target_as = monastic_befriender
		society = {
			random_society_member = {
				limit = {
					same_sex = ROOT
					ai = yes
					has_education_intrigue_trigger = no

					opinion = {
						who = ROOT
						value >= 0
					}
					reverse_opinion = {
						who = ROOT
						value >= 0
					}

					NOR = {
						character = ROOT
						is_rival = ROOT
						is_friend = ROOT
						is_lover = ROOT
						trait = chaste
						trait = celibate
					}
				}

				save_event_target_as = monastic_friend
			}
		}
	}

	option = { # I will come as summoned.
		name = EVTOPTA_MNM_4435

		character_event = {
			id = MNM.4437
			months = 1
			random = 30
		}
	}
}

# Become closer with other member (Shared activity might lead to friendship? What to do?)
character_event = {
	id = MNM.4437
	desc = EVTDESC_MNM_4437
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_friend

	picture = {
		picture = GFX_evt_monastery_monks
		trigger = { is_female = no }
	}
	picture = {
		picture = GFX_evt_monastery_nuns
		trigger = { is_female = yes }
	}

	is_triggered_only = yes

	trigger = { is_monastic_member_trigger = yes }


	immediate = {
		opinion = {
			name = opinion_budding_friendship
			who = event_target:monastic_friend
		}

		reverse_opinion = {
			name = opinion_budding_friendship
			who = event_target:monastic_friend
		}
	}

	option = { # play a game of strategy
		name = EVTOPTA_MNM_4437

		random = {
			chance = 75

			add_character_modifier = {
				name = played_strategy_game
				years = 5
			}
		}

		custom_tooltip = { text = monastic_may_become_friends }

		if = {
			limit = {
				event_target:monastic_friend = {
					has_education_martial_trigger = yes
				}
			}

			character_event = {
				id = MNM.4439
				days = 15
				random = 15
			}
		}
		else = {
			character_event = {
				id = MNM.4443
				days = 15
				random = 15
			}
		}
	}

	option = { # discuss the holy scripture
		name = EVTOPTB_MNM_4437

		random = {
			chance = 75

			add_character_modifier = {
				name = discussed_scripture
				years = 5
			}
		}

		custom_tooltip = { text = monastic_may_become_friends }

		if = {
			limit = {
				event_target:monastic_friend = {
					has_education_learning_trigger = yes
				}
			}

			character_event = {
				id = MNM.4439
				days = 15
				random = 15
			}
		}
		else = {
			character_event = {
				id = MNM.4443
				days = 15
				random = 15
			}
		}
	}

	option = { # discuss the intricacies of managing a realm
		name = EVTOPTC_MNM_4437

		random = {
			chance = 75

			add_character_modifier = {
				name = discussed_realm_management
				years = 5
			}
		}

		custom_tooltip = { text = monastic_may_become_friends }

		if = {
			limit = {
				event_target:monastic_friend = {
					has_education_stewardship_trigger = yes
				}
			}

			character_event = {
				id = MNM.4439
				days = 15
				random = 15
			}
		}
		else = {
			character_event = {
				id = MNM.4443
				days = 15
				random = 15
			}
		}
	}

	option = { # take a stroll while engaging in small talk
		name = EVTOPTD_MNM_4437

		random = {
			chance = 75

			add_character_modifier = {
				name = took_stroll_small_talk
				years = 5
			}
		}

		custom_tooltip = { text = monastic_may_become_friends }

		if = {
			limit = {
				event_target:monastic_friend = {
					has_education_diplomacy_trigger = yes
				}
			}

			character_event = {
				id = MNM.4439
				days = 15
				random = 15
			}
		}
		else = {
			character_event = {
				id = MNM.4443
				days = 15
				random = 15
			}
		}
	}
}

# Friendship Established! Pursue it further, or focus on monastic duties?
character_event = {
	id = MNM.4439
	desc = EVTDESC_MNM_4439
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_friend

	picture = {
		picture = GFX_evt_monastery_monks
		trigger = { is_female = no }
	}
	picture = {
		picture = GFX_evt_monastery_nuns
		trigger = { is_female = yes }
	}

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes
		NOT = { is_rival = event_target:monastic_friend }
	}

	immediate = {
		remove_opinion = {
			name = opinion_budding_friendship
			who = event_target:monastic_friend
		}

		reverse_remove_opinion = {
			name = opinion_budding_friendship
			who = event_target:monastic_friend
		}

		add_friend = event_target:monastic_friend
	}

	option = { # Focus on monastic duties
		name = EVTOPTA_MNM_4439

		tooltip = { add_friend = event_target:monastic_friend }

		piety = 25

		add_character_modifier = {
			name = focused_on_monastic_studies
			years = 10
		}
	}

	option = { # Pursue the friendship further
		name = EVTOPTB_MNM_4439

		tooltip = { add_friend = event_target:monastic_friend }

		custom_tooltip = {
			text = monastic_may_lead_to_more

			random_list = {
				50 = {
					trigger = {
						NOR = {
							trait = chaste
							trait = celibate
						}
					}

					character_event = {
						id = MNM.4441
						days = 30
						random = 30
					}
				}

				50 = {
					trigger = {
						NOT = { trait = lustful }
					}
				}
			}
		}

		if = {
			limit = {
				OR = {
					trait = depressed
					trait = stressed
					NOT = { trait = gregarious }
				}
			}

			random_list = {
				25 = {
					trigger = { trait = depressed }
					remove_trait = depressed
				}

				25 = {
					trigger = { trait = stressed }
					remove_trait = stressed
				}

				25 = {
					trigger = {
						NOT = { trait = gregarious }
					}

					add_trait_partially_gregarious_effect = yes
				}

				25 = { }
			}
		}

		ai_chance = {
			factor = 3

			trigger = {
				OR = {
					trait = depressed
					trait = stressed
				}
			}
		}
	}
}

# Long lonely time without your spouse
character_event = {
	id = MNM.4441
	desc = EVTDESC_MNM_4441
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_friend

	picture = {
		picture = GFX_evt_monastery_monks
		trigger = { is_female = no }
	}
	picture = {
		picture = GFX_evt_monastery_nuns
		trigger = { is_female = yes }
	}

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes
		event_target:monastic_friend = { is_alive = yes }
	}

	option = { # Suppress the urge
		name = EVTOPTA_MNM_4441

		random_list = {
			50 = {
				trigger = {
					NOT = { trait = stressed }
				}

				add_trait_stressed_effect = yes
			}

			50 = {
				trigger = {
					NOT = { trait = chaste }
				}

				add_trait_partially_chaste_effect = yes
			}
		}
	}

	option = { # Do it
		name = EVTOPTB_MNM_4441

		add_trait = homosexual

		event_target:monastic_friend = {
			show_scope_change = no

			add_trait = homosexual
			set_character_flag = revealed_homosexual@ROOT
			set_character_flag = monastic_friend_lover_@ROOT
		}

		add_lover = event_target:monastic_friend
		hidden_effect = { remove_friend = event_target:monastic_friend }
	}
}

# Friendship not established notification
character_event = {
	id = MNM.4443
	desc = EVTDESC_MNM_4443
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_friend

	picture = {
		picture = GFX_evt_monastery_monks
		trigger = { is_female = no }
	}
	picture = {
		picture = GFX_evt_monastery_nuns
		trigger = { is_female = yes }
	}

	is_triggered_only = yes

	trigger = { is_monastic_member_trigger = yes }

	immediate = {
		remove_opinion = {
			name = opinion_budding_friendship
			who = event_target:monastic_friend
		}

		reverse_remove_opinion = {
			name = opinion_budding_friendship
			who = event_target:monastic_friend
		}
	}

	option = {
		name = EVTOPTA_MNM_4443
	}
}

## Monastery has Artifact: To Steal or not to Steal? #

# Starter Event for Monastery has Artifact
character_event = {
	id = MNM.4610
	picture = GFX_evt_relic_box
	desc = EVTDESC_MNM_4610
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_society_bi_yearly_pulse, random_events

	only_capable = yes
	only_playable = yes

	trigger = {
		is_inaccessible_trigger = no

		NOR = {
			has_character_modifier = caught_stealing_artifact_penance
			has_character_flag = monastic_stole_artifact
		}

		OR = {
			is_dharmic_monastic_member_trigger = yes
			is_christian_monastic_member_trigger = yes
		}
	}

	immediate = {
		# save_event_target_as = monastic_artifact_stealer
		random_list = {
			10 = {
				trigger = {
					religion_group = christian
					NOT = { has_artifact = seamless_robe_of_jesus }
				}

				set_character_flag = monastic_artifact_seamless_robe_of_jesus
			}

			10 = {
				trigger = {
					religion_group = christian
					NOT = { has_artifact = crown_of_thorns }
				}

				set_character_flag = monastic_artifact_crown_of_thorns
			}

			20 = {
				trigger = {
					religion_group = christian
					NOT = { has_artifact = fragment_of_true_cross }
				}

				set_character_flag = monastic_artifact_fragment_of_true_cross
			}

			20 = {
				trigger = {
					religion_group = christian
					NOT = { has_artifact = holy_foreskin }
				}

				set_character_flag = monastic_artifact_holy_foreskin
			}

			20 = {
				trigger = {
					religion_group = christian
					NOT = { has_artifact = image_of_edessa }
				}

				set_character_flag = monastic_artifact_image_of_edessa
			}

			20 = {
				trigger = {
					religion_group = indian_group
					NOT = { has_artifact = elaborate_danda }
				}

				set_character_flag = monastic_artifact_elaborate_danda
			}

			20 = {
				trigger = {
					religion_group = indian_group
					NOT = { has_artifact = sariraka_actual_body_part }
				}

				set_character_flag = monastic_artifact_sariraka_actual_body_part
			}

			1 = {
				trigger = {
					religion_group = indian_group
					NOT = { has_artifact = sarira }
				}

				set_character_flag = monastic_artifact_sarira
			}
		}
	}

	option = { # That's nice I guess
		name = EVTOPTA_MNM_4610

		random = {
			chance = 25
			add_trait_partially_content_effect = yes
		}

		ai_chance = {
			factor = 50

			mult_modifier = {
				factor = 2
				trait = content
			}
			mult_modifier = {
				factor = 2
				trait = zealous
			}
		}
	}

	option = { # Pay for a celebration
		name = EVTOPTB_MNM_4610

		scaled_wealth = { value = -0.5 min = -50 }
		custom_tooltip = { text = EVTOPTB_MNM_4610_TT }

		character_event = {
			id = MNM.4618
			days = 15
			random = 30
		}

		ai_chance = {
			factor = 45

			mult_modifier = {
				factor = 2
				trait = charitable
			}
			mult_modifier = {
				factor = 2
				trait = zealous
			}
		}
	}

	option = { # Steal it!
		name = EVTOPTC_MNM_4610

		# There must be an artifact you can actually steal
		trigger = {
			OR = {
				has_character_flag = monastic_artifact_seamless_robe_of_jesus
			    has_character_flag = monastic_artifact_crown_of_thorns
			    has_character_flag = monastic_artifact_fragment_of_true_cross
			    has_character_flag = monastic_artifact_holy_foreskin
			    has_character_flag = monastic_artifact_image_of_edessa
			    has_character_flag = monastic_artifact_elaborate_danda
			    has_character_flag = monastic_artifact_sariraka_actual_body_part
			    has_character_flag = monastic_artifact_sarira
			}
		}

		random = {
			chance = 50
			add_trait_partially_ambitious_effect = yes
		}

		character_event = {
			id = MNM.4611
			days = 15
			random = 30
		}

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_artifact_seamless_robe_of_jesus    = { custom_tooltip = { text = EVTOPTC_MNM_4610_seamless_robe_of_jesus } }
			monastic_artifact_crown_of_thorns           = { custom_tooltip = { text = EVTOPTC_MNM_4610_crown_of_thorns } }
			monastic_artifact_fragment_of_true_cross    = { custom_tooltip = { text = EVTOPTC_MNM_4610_fragment_of_true_cross } }
			monastic_artifact_holy_foreskin             = { custom_tooltip = { text = EVTOPTC_MNM_4610_holy_foreskin } }
			monastic_artifact_image_of_edessa           = { custom_tooltip = { text = EVTOPTC_MNM_4610_image_of_edessa } }
			monastic_artifact_elaborate_danda           = { custom_tooltip = { text = EVTOPTC_MNM_4610_elaborate_danda } }
			monastic_artifact_sariraka_actual_body_part = { custom_tooltip = { text = EVTOPTC_MNM_4610_sariraka_actual_body_part } }
			monastic_artifact_sarira                    = { custom_tooltip = { text = EVTOPTC_MNM_4610_sarira } }
		}

		ai_chance = {
			factor = 5

			mult_modifier = {
				factor = 2
				trait = ambitious
			}
			mult_modifier = {
				factor = 2
				trait = greedy
			}
			mult_modifier = {
				factor = 2
				trait = cynical
			}
		}
	}
}

# Monastic Artifact: planning for the theft
character_event = {
	id = MNM.4611
	picture = GFX_evt_shady_meeting
	desc = EVTDESC_MNM_4611
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = { is_inaccessible_trigger = no }

	immediate = {
		society = {
			random_society_member = {
				limit = {
					ai = yes
					same_sex = ROOT
					is_lover = ROOT
					has_character_flag = monastic_friend_lover_@ROOT
				}

				save_event_target_as = monastic_artifact_lover
			}
		}
	}

	option = { # Grab it and run
		name = EVTOPTA_MNM_4611

		custom_tooltip = { text = EVTOPTA_MNM_4611_TT }

		hidden_effect = {
			if = {
				limit = { martial < 10 }

				random_list = {
					5 = {
						character_event = { id = MNM.4617 days = 15 random = 30 } # success
					}

					95 = {
						character_event = { id = MNM.4612 days = 15 random = 30 } # failure
					}
				}
			}
			else_if = {
				limit = { martial < 14 }

				random_list = {
					10 = {
						character_event = { id = MNM.4617 days = 15 random = 30 } # success
					}

					90 = {
						character_event = { id = MNM.4612 days = 15 random = 30 } # failure
					}
				}
			}
			else_if = {
				limit = { martial < 18 }

				random_list = {
					15 = {
						character_event = { id = MNM.4617 days = 15 random = 30 } # success
					}

					85 = {
						character_event = { id = MNM.4612 days = 15 random = 30 } # failure
					}
				}
			}
			if = {
				limit = { martial < 22 }

				random_list = {
					20 = {
						character_event = { id = MNM.4617 days = 15 random = 30 } # success
					}

					80 = {
						character_event = { id = MNM.4612 days = 15 random = 30 } # failure
					}
				}
			}
			else = {
				random_list = {
					25 = {
						character_event = { id = MNM.4617 days = 15 random = 30 } # success
					}

					75 = {
						character_event = { id = MNM.4612 days = 15 random = 30 } # failure
					}
				}
			}
		}
	}

	option = { # Bribe Abbot
		name = EVTOPTB_MNM_4611

		scaled_wealth = { value = -3 min = -300 }
		custom_tooltip = { text = EVTOPTB_MNM_4611_TT }

		hidden_effect = {
			random_list = {
				95 = {
					character_event = { id = MNM.4617 days = 15 random = 30 } # success
				}

				5 = {
					character_event = { id = MNM.4612 days = 15 random = 30 } # failure
				}
			}
		}
	}

	option = { # Trick everyone
		name = EVTOPTC_MNM_4611
		tooltip_info = intrigue

		trigger = { intrigue >= 18 }

		custom_tooltip = { text = EVTOPTC_MNM_4611_TT }

		hidden_effect = {
			random_list = {
				50 = {
					character_event = { id = MNM.4617 days = 15 random = 30 } # success
				}

				50 = {
					character_event = { id = MNM.4612 days = 15 random = 30 } # failure
				}
			}
		}
	}

	option = { # Get lover to help
		name = EVTOPTD_MNM_4611
		show_portrait = event_target:monastic_artifact_lover

		trigger = { event_target:monastic_artifact_lover = { always = yes } }

		custom_tooltip = { text = EVTOPTD_MNM_4611_TT }

		set_character_flag = monastic_artifact_lover

		hidden_effect = {
			random_list = {
				25 = {
					character_event = { id = MNM.4617 days = 15 random = 30 } # success
				}

				75 = {
					character_event = { id = MNM.4612 days = 15 random = 30 } # failure
				}
			}
		}
	}
}

# Initial ping event for failure event / getting caught
character_event = {
	id = MNM.4612

	hide_window = yes
	is_triggered_only = yes

	immediate = {
		society = {
			random_society_member = {
				limit = {
					ai = yes
					is_society_grandmaster = no

					NOR = {
						is_friend = ROOT
						is_lover = ROOT
					}
				}

				save_event_target_as = monastic_artifact_witness
			}
		}

		random_list = {
			40 = { character_event = { id = MNM.4614 } }

			60 = {
				trigger = { has_character_flag = monastic_artifact_lover }
				character_event = { id = MNM.4616 }
			}
		}
	}
}

# Monastic Artifact failure: got caught red-handed!
character_event = {
	id = MNM.4614
	picture = GFX_evt_eavesdropping
	desc = EVTDESC_MNM_4614
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_artifact_witness

	is_triggered_only = yes

	immediate = {
		add_character_modifier = {
			name = caught_red_handed
			years = 5
		}
	}

	option = { # Surrender
		name = EVTOPTA_MNM_4614

		custom_tooltip = { text = EVTOPTA_MNM_4614_TT }

		add_character_modifier = {
			name = caught_stealing_artifact_penance
			years = 10
		}

		hidden_effect = {
			society = {
				any_society_member = {
					opinion = {
						who = ROOT
						name = stole_artifact_penance
						years = 10
					}
				}
			}
		}
	}

	option = { # Rush past them
		name = EVTOPTB_MNM_4614
		custom_tooltip = { text = EVTOPTB_MNM_4614_TT }

		set_character_flag = flag_monastic_mid_theft # Prevents on_leave_society cleanup event to clear the artifact flags when leaving the society.

		hidden_effect = {
			society = {
				any_society_member = {
					opinion = {
						who = ROOT
						name = stole_artifact
						years = 20
					}
				}
			}
		}

		hidden_effect = {
			event_target:monastic_artifact_witness = { # Cleanslate: In case the player leaves the society before pressing the option.
				trigger_switch = {
					on_trigger = society_member_of

					monastic_order_benedictine = { ROOT = { set_character_flag = betrayed_monastic_order_benedictine } }
					monastic_order_dominican   = { ROOT = { set_character_flag = betrayed_monastic_order_dominican } }
					monastic_order_orthodox    = { ROOT = { set_character_flag = betrayed_monastic_order_orthodox } }
					monastic_order_nestorian   = { ROOT = { set_character_flag = betrayed_monastic_order_nestorian } }
					monastic_order_monophysite = { ROOT = { set_character_flag = betrayed_monastic_order_monophysite } }
					monastic_order_jain        = { ROOT = { set_character_flag = betrayed_monastic_order_jain } }
					monastic_order_hindu       = { ROOT = { set_character_flag = betrayed_monastic_order_hindu } }
					monastic_order_buddhist    = { ROOT = { set_character_flag = betrayed_monastic_order_buddhist } }
					monastic_order_stoics      = { ROOT = { set_character_flag = betrayed_monastic_order_stoics } }

					# CK2Plus
					monastic_order_apostolic   = { ROOT = { set_character_flag = betrayed_monastic_order_apostolic } }
					monastic_order_bon		   = { ROOT = { set_character_flag = betrayed_monastic_order_bon } }
				}
			}
		}

		if = {
			limit = { same_society_as = event_target:monastic_artifact_witness }
			leave_society = yes
		}

		character_event = {
			id = MNM.4615
			days = 10
			random = 10
		}
	}

	option = { # Leave no witnesses!
		name = EVTOPTC_MNM_4614

		add_trait_partially_silently_greedy_effect = yes

		custom_tooltip = { text = EVTOPTC_MNM_4614_TT }

		if = {
			limit = {
				combat_rating_diff = { who = event_target:monastic_artifact_witness value >= 50 }
			}

			custom_tooltip = { text = holmgang_chances_great } # Tooltip reuse FTW

			hidden_effect = {
				random_list = {
					84 = { character_event = { id = MNM.4619 } }
					10 = { character_event = { id = MNM.4620 } }
					 5 = { character_event = { id = MNM.4621 } }
					 1 = { character_event = { id = MNM.4622 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = { who = event_target:monastic_artifact_witness value >= 30 }
			}

			custom_tooltip = { text = holmgang_chances_very_good }

			hidden_effect = {
				random_list = {
					70 = { character_event = { id = MNM.4619 } }
					15 = { character_event = { id = MNM.4620 } }
					10 = { character_event = { id = MNM.4621 } }
					 5 = { character_event = { id = MNM.4622 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = { who = event_target:monastic_artifact_witness value >= 10 }
			}

			custom_tooltip = { text = holmgang_chances_good }

			hidden_effect = {
				random_list = {
					60 = { character_event = { id = MNM.4619 } }
					20 = { character_event = { id = MNM.4620 } }
					15 = { character_event = { id = MNM.4621 } }
					 5 = { character_event = { id = MNM.4622 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = { who = event_target:monastic_artifact_witness value > -10 }
			}

			custom_tooltip = { text = holmgang_chances_even }

			hidden_effect = {
				random_list = {
					20 = { character_event = { id = MNM.4619 } }
					20 = { character_event = { id = MNM.4620 } }
					20 = { character_event = { id = MNM.4621 } }
					40 = { character_event = { id = MNM.4622 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = { who = event_target:monastic_artifact_witness value > -30 }
			}

			custom_tooltip = { text = holmgang_chances_poor }

			hidden_effect = {
				random_list = {
					 5 = { character_event = { id = MNM.4619 } }
					15 = { character_event = { id = MNM.4620 } }
					20 = { character_event = { id = MNM.4621 } }
					60 = { character_event = { id = MNM.4622 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = { who = event_target:monastic_artifact_witness value > -50 }
			}

			custom_tooltip = { text = holmgang_chances_very_poor }

			hidden_effect = {
				random_list = {
					 1 = { character_event = { id = MNM.4619 } }
					 4 = { character_event = { id = MNM.4620 } }
					15 = { character_event = { id = MNM.4621 } }
					80 = { character_event = { id = MNM.4622 } }
				}
			}
		}
		else = {
			custom_tooltip = { text = holmgang_chances_terrible }

			hidden_effect = {
				random_list = {
					 1 = { character_event = { id = MNM.4620 } }
					 9 = { character_event = { id = MNM.4621 } }
					90 = { character_event = { id = MNM.4622 } }
				}
			}
		}
	}
}

character_event = { # win - no wound
	id = MNM.4619
	desc = EVTDESC_MNM.4619
	border = GFX_event_normal_frame_war
	picture = GFX_evt_melee
	portrait = event_target:monastic_artifact_witness

	is_triggered_only = yes

	immediate = {
		society = {
			random_society_member = {
				limit = {
					ai = yes
					is_society_grandmaster = no

					NOR = {
						is_friend = ROOT
						is_lover = ROOT
					}

					OR = {
						trait = greedy
						trait = deceitful
					}
				}

				save_event_target_as = monastic_artifact_blackmailer
			}
		}
	}

	option = {
		name = EVTOPTA_MNM.4619

		event_target:monastic_artifact_witness = {
			show_scope_change = no

			save_event_target_as = target_victim

			death = {
				death_reason = death_murder_unknown
				killer = ROOT
			}
		}

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_artifact_seamless_robe_of_jesus    = { add_artifact = seamless_robe_of_jesus }
			monastic_artifact_crown_of_thorns           = { add_artifact = crown_of_thorns }
			monastic_artifact_fragment_of_true_cross    = { add_artifact = fragment_of_true_cross }
			monastic_artifact_holy_foreskin             = { add_artifact = holy_foreskin }
			monastic_artifact_image_of_edessa           = { add_artifact = image_of_edessa }
			monastic_artifact_elaborate_danda           = { add_artifact = elaborate_danda }
			monastic_artifact_sariraka_actual_body_part = { add_artifact = sariraka_actual_body_part }
			monastic_artifact_sarira                    = { add_artifact = sarira }
		}

		set_character_flag = monastic_stole_artifact

		hidden_effect = {
			random = {
				chance = 10

				additive_modifier = {
					value = 10 # 20%
					intrigue < 22
				}
				additive_modifier = {
					value = 10 # 30%
					intrigue < 18
				}
				additive_modifier = {
					value = 10 # 40%
					intrigue < 14
				}
				additive_modifier = {
					value = 10 # 50%
					intrigue < 10
				}
				additive_modifier = {
					value = 25 # 75%
					intrigue < 6
				}

				set_character_flag = someone_figured_it_out
			}

			if = {
				limit = { has_character_flag = someone_figured_it_out }

				clr_character_flag = someone_figured_it_out

				letter_event = {
					id = MNM.4624
					months = 3
					random = 30
				}
			}
			else = {
				clr_character_flag = monastic_artifact_lover
				clr_character_flag = monastic_artifact_seamless_robe_of_jesus
				clr_character_flag = monastic_artifact_crown_of_thorns
				clr_character_flag = monastic_artifact_fragment_of_true_cross
				clr_character_flag = monastic_artifact_holy_foreskin
				clr_character_flag = monastic_artifact_image_of_edessa
				clr_character_flag = monastic_artifact_elaborate_danda
				clr_character_flag = monastic_artifact_sariraka_actual_body_part
				clr_character_flag = monastic_artifact_sarira
			}
		}
	}
}

character_event = { # win - wound
	id = MNM.4620
	desc = EVTDESC_MNM.4620
	border = GFX_event_normal_frame_war
	picture = GFX_evt_melee
	portrait = event_target:monastic_artifact_witness

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM.4620

		event_target:monastic_artifact_witness = {
			show_scope_change = no

			death = {
				death_reason = death_murder_unknown
				killer = ROOT
			}
		}

		add_trait_silently_wounded_effect = yes

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_artifact_seamless_robe_of_jesus    = { add_artifact = seamless_robe_of_jesus }
			monastic_artifact_crown_of_thorns           = { add_artifact = crown_of_thorns }
			monastic_artifact_fragment_of_true_cross    = { add_artifact = fragment_of_true_cross }
			monastic_artifact_holy_foreskin             = { add_artifact = holy_foreskin }
			monastic_artifact_image_of_edessa           = { add_artifact = image_of_edessa }
			monastic_artifact_elaborate_danda           = { add_artifact = elaborate_danda }
			monastic_artifact_sariraka_actual_body_part = { add_artifact = sariraka_actual_body_part }
			monastic_artifact_sarira                    = { add_artifact = sarira }
		}

		set_character_flag = monastic_stole_artifact

		hidden_effect = {
			random = {
				chance = 10

				additive_modifier = {
					value = 10 # 20%
					intrigue < 22
				}
				additive_modifier = {
					value = 10 # 30%
					intrigue < 18
				}
				additive_modifier = {
					value = 10 # 40%
					intrigue < 14
				}
				additive_modifier = {
					value = 10 # 50%
					intrigue < 10
				}
				additive_modifier = {
					value = 25 # 75%
					intrigue < 6
				}

				set_character_flag = someone_figured_it_out
			}

			if = {
				limit = { has_character_flag = someone_figured_it_out }

				clr_character_flag = someone_figured_it_out

				letter_event = {
					id = MNM.4624
					months = 3
					random = 30
				}
			}
			else = {
				clr_character_flag = monastic_artifact_lover
				clr_character_flag = monastic_artifact_seamless_robe_of_jesus
				clr_character_flag = monastic_artifact_crown_of_thorns
				clr_character_flag = monastic_artifact_fragment_of_true_cross
				clr_character_flag = monastic_artifact_holy_foreskin
				clr_character_flag = monastic_artifact_image_of_edessa
				clr_character_flag = monastic_artifact_elaborate_danda
				clr_character_flag = monastic_artifact_sariraka_actual_body_part
				clr_character_flag = monastic_artifact_sarira
			}
		}
	}
}

character_event = { # win - maimed
	id = MNM.4621
	desc = EVTDESC_MNM.4621
	border = GFX_event_normal_frame_war
	picture = GFX_evt_melee
	portrait = event_target:monastic_artifact_witness

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM.4621

		event_target:monastic_artifact_witness = {
			show_scope_change = no

			death = {
				death_reason = death_murder_unknown
				killer = ROOT
			}
		}

		if = {
			limit = { can_be_maimed_trigger = yes }
			add_maimed_trait_effect = yes
		}
		else = {
			add_trait_silently_wounded_effect = yes
		}

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_artifact_seamless_robe_of_jesus    = { add_artifact = seamless_robe_of_jesus }
			monastic_artifact_crown_of_thorns           = { add_artifact = crown_of_thorns }
			monastic_artifact_fragment_of_true_cross    = { add_artifact = fragment_of_true_cross }
			monastic_artifact_holy_foreskin             = { add_artifact = holy_foreskin }
			monastic_artifact_image_of_edessa           = { add_artifact = image_of_edessa }
			monastic_artifact_elaborate_danda           = { add_artifact = elaborate_danda }
			monastic_artifact_sariraka_actual_body_part = { add_artifact = sariraka_actual_body_part }
			monastic_artifact_sarira                    = { add_artifact = sarira }
		}

		set_character_flag = monastic_stole_artifact

		hidden_effect = {
			random = {
				chance = 10

				additive_modifier = {
					value = 10 # 20%
					intrigue < 22
				}
				additive_modifier = {
					value = 10 # 30%
					intrigue < 18
				}
				additive_modifier = {
					value = 10 # 40%
					intrigue < 14
				}
				additive_modifier = {
					value = 10 # 50%
					intrigue < 10
				}
				additive_modifier = {
					value = 25 # 75%
					intrigue < 6
				}

				set_character_flag = someone_figured_it_out
			}

			if = {
				limit = { has_character_flag = someone_figured_it_out }

				clr_character_flag = someone_figured_it_out

				letter_event = {
					id = MNM.4624
					months = 3
					random = 30
				}
			}
			else = {
				clr_character_flag = monastic_artifact_lover
				clr_character_flag = monastic_artifact_seamless_robe_of_jesus
				clr_character_flag = monastic_artifact_crown_of_thorns
				clr_character_flag = monastic_artifact_fragment_of_true_cross
				clr_character_flag = monastic_artifact_holy_foreskin
				clr_character_flag = monastic_artifact_image_of_edessa
				clr_character_flag = monastic_artifact_elaborate_danda
				clr_character_flag = monastic_artifact_sariraka_actual_body_part
				clr_character_flag = monastic_artifact_sarira
			}
		}
	}
}

character_event = { # loss - death
	id = MNM.4622
	desc = EVTDESC_MNM.4622
	border = GFX_event_normal_frame_war
	picture = GFX_evt_beheading
	portrait = event_target:monastic_artifact_witness

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM.4622

		death = {
			death_reason = death_duel
			killer = event_target:monastic_artifact_witness
		}
	}
}

# Ran off with it despite leaving witnesses
character_event = {
	id = MNM.4615
	desc = EVTDESC_MNM_4615
	picture = GFX_evt_uncomfortable
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_artifact_witness

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_4615

		set_character_flag = monastic_stole_artifact
		clr_character_flag = monastic_artifact_lover

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_artifact_seamless_robe_of_jesus = {
				add_artifact = seamless_robe_of_jesus
				clr_character_flag = monastic_artifact_seamless_robe_of_jesus
			}

			monastic_artifact_crown_of_thorns = {
				add_artifact = crown_of_thorns
				clr_character_flag = monastic_artifact_crown_of_thorns
			}

			monastic_artifact_fragment_of_true_cross = {
				add_artifact = fragment_of_true_cross
				clr_character_flag = monastic_artifact_fragment_of_true_cross
			}

			monastic_artifact_holy_foreskin = {
				add_artifact = holy_foreskin
				clr_character_flag = monastic_artifact_holy_foreskin
			}

			monastic_artifact_image_of_edessa = {
				add_artifact = image_of_edessa
				clr_character_flag = monastic_artifact_image_of_edessa
			}

			monastic_artifact_elaborate_danda = {
				add_artifact = elaborate_danda
				clr_character_flag = monastic_artifact_elaborate_danda
			}

			monastic_artifact_sariraka_actual_body_part = {
				add_artifact = sariraka_actual_body_part
				clr_character_flag = monastic_artifact_sariraka_actual_body_part
			}

			monastic_artifact_sarira = {
				add_artifact = sarira
				clr_character_flag = monastic_artifact_sarira
			}
		}
	}
}

# Lover stops witness, letting you escape
character_event = {
	id = MNM.4616
	desc = EVTDESC_MNM_4616
	picture = GFX_evt_eavesdropping
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_4616

		set_character_flag = monastic_stole_artifact
		clr_character_flag = monastic_artifact_lover

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_artifact_seamless_robe_of_jesus = {
				add_artifact = seamless_robe_of_jesus
				clr_character_flag = monastic_artifact_seamless_robe_of_jesus
			}

			monastic_artifact_crown_of_thorns = {
				add_artifact = crown_of_thorns
				clr_character_flag = monastic_artifact_crown_of_thorns
			}

			monastic_artifact_fragment_of_true_cross = {
				add_artifact = fragment_of_true_cross
				clr_character_flag = monastic_artifact_fragment_of_true_cross
			}

			monastic_artifact_holy_foreskin = {
				add_artifact = holy_foreskin
				clr_character_flag = monastic_artifact_holy_foreskin
			}

			monastic_artifact_image_of_edessa = {
				add_artifact = image_of_edessa
				clr_character_flag = monastic_artifact_image_of_edessa
			}

			monastic_artifact_elaborate_danda = {
				add_artifact = elaborate_danda
				clr_character_flag = monastic_artifact_elaborate_danda
			}

			monastic_artifact_sariraka_actual_body_part = {
				add_artifact = sariraka_actual_body_part
				clr_character_flag = monastic_artifact_sariraka_actual_body_part
			}

			monastic_artifact_sarira = {
				add_artifact = sarira
				clr_character_flag = monastic_artifact_sarira
			}
		}
	}
}

# Stole the artifact without any witnesses!
character_event = {
	id = MNM.4617
	desc = EVTDESC_MNM_4617
	picture = GFX_evt_relic_box
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_4617

		set_character_flag = monastic_stole_artifact
		clr_character_flag = monastic_artifact_lover

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_artifact_seamless_robe_of_jesus = {
				add_artifact = seamless_robe_of_jesus
				clr_character_flag = monastic_artifact_seamless_robe_of_jesus
			}

			monastic_artifact_crown_of_thorns = {
				add_artifact = crown_of_thorns
				clr_character_flag = monastic_artifact_crown_of_thorns
			}

			monastic_artifact_fragment_of_true_cross = {
				add_artifact = fragment_of_true_cross
				clr_character_flag = monastic_artifact_fragment_of_true_cross
			}

			monastic_artifact_holy_foreskin = {
				add_artifact = holy_foreskin
				clr_character_flag = monastic_artifact_holy_foreskin
			}

			monastic_artifact_image_of_edessa = {
				add_artifact = image_of_edessa
				clr_character_flag = monastic_artifact_image_of_edessa
			}

			monastic_artifact_elaborate_danda = {
				add_artifact = elaborate_danda
				clr_character_flag = monastic_artifact_elaborate_danda
			}

			monastic_artifact_sariraka_actual_body_part = {
				add_artifact = sariraka_actual_body_part
				clr_character_flag = monastic_artifact_sariraka_actual_body_part
			}

			monastic_artifact_sarira = {
				add_artifact = sarira
				clr_character_flag = monastic_artifact_sarira
			}
		}
	}
}

# Celebrate the artifact
character_event = {
	id = MNM.4618
	desc = EVTDESC_MNM_4618
	picture = GFX_evt_charity
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_4618

		add_character_modifier = {
			name = artifact_patron
			years = 5
		}

		custom_tooltip = { text = society_pleased_with_celebration }

		hidden_effect = {
			society = {
				any_society_member = {
					opinion = {
						who = ROOT
						name = paid_for_celebration_artifact
						years = 5
					}
				}
			}
		}
	}
}

# Someone pieced it together
letter_event = {
	id = MNM.4624
	desc = EVTDESC_MNM_4624
	border = GFX_event_letter_frame_religion
	portrait = event_target:monastic_artifact_blackmailer

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes
		event_target:monastic_artifact_blackmailer = { is_alive = yes }
	}

	option = { # Bribe them!
		name = EVTOPTA_MNM_4624

		transfer_scaled_wealth = {
			to = event_target:monastic_artifact_blackmailer
			value = 3
			min = 300
		}
	}

	option = { # Return the artifact and pay them to keep quiet
		name = EVTOPTB_MNM_4624

		trigger = {
			trigger_if = {
				limit = { has_character_flag = monastic_artifact_seamless_robe_of_jesus }
				has_artifact = seamless_robe_of_jesus
			}
			trigger_else_if = {
				limit = { has_character_flag = monastic_artifact_crown_of_thorns }
				has_artifact = crown_of_thorns
			}
			trigger_else_if = {
				limit = { has_character_flag = monastic_artifact_fragment_of_true_cross }
				has_artifact = fragment_of_true_cross
			}
			trigger_else_if = {
				limit = { has_character_flag = monastic_artifact_holy_foreskin }
				has_artifact = holy_foreskin
			}
			trigger_else_if = {
				limit = { has_character_flag = monastic_artifact_image_of_edessa }
				has_artifact = image_of_edessa
			}
			trigger_else_if = {
				limit = { has_character_flag = monastic_artifact_elaborate_danda }
				has_artifact = elaborate_danda
			}
			trigger_else_if = {
				limit = { has_character_flag = monastic_artifact_sariraka_actual_body_part }
				has_artifact = sariraka_actual_body_part
			}
			trigger_else = {
				has_character_flag = monastic_artifact_sarira
				has_artifact = sarira
			}
		}

		transfer_scaled_wealth = {
			to = event_target:monastic_artifact_blackmailer
			value = 1
			min = 100
		}

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_artifact_seamless_robe_of_jesus    = { destroy_artifact = seamless_robe_of_jesus }
			monastic_artifact_crown_of_thorns           = { destroy_artifact = crown_of_thorns }
			monastic_artifact_fragment_of_true_cross    = { destroy_artifact = fragment_of_true_cross }
			monastic_artifact_holy_foreskin             = { destroy_artifact = holy_foreskin }
			monastic_artifact_image_of_edessa           = { destroy_artifact = image_of_edessa }
			monastic_artifact_elaborate_danda           = { destroy_artifact = elaborate_danda }
			monastic_artifact_sariraka_actual_body_part = { destroy_artifact = sariraka_actual_body_part }
			monastic_artifact_sarira                    = { destroy_artifact = sarira }
		}
	}

	option = { # Keep it!
		name = EVTOPTC_MNM_4624

		custom_tooltip = { text = EVTOPTC_MNM_4624_TT }

		if = {
			limit = { has_character_flag = monastic_artifact_lover }
			custom_tooltip = { text = EVTOPTC_MNM_4624_2_TT }
			show_portrait = event_target:monastic_artifact_lover
		}

		tooltip = {
			add_character_modifier = {
				name = known_murderer
				years = 50
			}
		}

		hidden_effect = {
			character_event = { id = 10 }

			random = {
				chance = 75

				if = {
					limit = { has_character_flag = monastic_artifact_lover }
					character_event = {
						id = MNM.4626
						days = 5
						random = 10
					}
				}
			}

			society = {
				any_society_member = {
					opinion = {
						name = stole_artifact
						who = ROOT
						years = 20
					}
				}
			}

			event_target:monastic_artifact_blackmailer = { # Cleanslate: In case player leaves the society before pressing the option.
				trigger_switch = {
					on_trigger = society_member_of

					monastic_order_benedictine = { ROOT = { set_character_flag = betrayed_monastic_order_benedictine } }
					monastic_order_dominican   = { ROOT = { set_character_flag = betrayed_monastic_order_dominican } }
					monastic_order_orthodox    = { ROOT = { set_character_flag = betrayed_monastic_order_orthodox } }
					monastic_order_nestorian   = { ROOT = { set_character_flag = betrayed_monastic_order_nestorian } }
					monastic_order_monophysite = { ROOT = { set_character_flag = betrayed_monastic_order_monophysite } }
					monastic_order_jain        = { ROOT = { set_character_flag = betrayed_monastic_order_jain } }
					monastic_order_hindu       = { ROOT = { set_character_flag = betrayed_monastic_order_hindu } }
					monastic_order_buddhist    = { ROOT = { set_character_flag = betrayed_monastic_order_buddhist } }
					monastic_order_stoics      = { ROOT = { set_character_flag = betrayed_monastic_order_stoics } }

					# CK2Plus
					monastic_order_apostolic   = { ROOT = { set_character_flag = betrayed_monastic_order_apostolic } }
					monastic_order_bon		   = { ROOT = { set_character_flag = betrayed_monastic_order_bon } }
				}
			}
		}

		if = {
			limit = { same_society_as = event_target:monastic_artifact_blackmailer }
			leave_society = yes
		}
	}

	after = {
		clr_character_flag = monastic_artifact_lover
		clr_character_flag = monastic_artifact_seamless_robe_of_jesus
		clr_character_flag = monastic_artifact_crown_of_thorns
		clr_character_flag = monastic_artifact_fragment_of_true_cross
		clr_character_flag = monastic_artifact_holy_foreskin
		clr_character_flag = monastic_artifact_image_of_edessa
		clr_character_flag = monastic_artifact_elaborate_danda
		clr_character_flag = monastic_artifact_sariraka_actual_body_part
		clr_character_flag = monastic_artifact_sarira
	}
}

# Lover commits suicide
character_event = {
	id = MNM.4626
	desc = EVTDESC_MNM_4626
	picture = GFX_evt_bad_news
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_artifact_lover

	picture = {
		picture = GFX_evt_bad_news
		trigger = { is_female = no }
	}
	picture = {
		picture = GFX_evt_bad_news_female
		trigger = { is_female = yes }
	}

	is_triggered_only = yes

	trigger = { is_monastic_member_trigger = yes }

	option = {
		name = EVTOPTA_MNM_4626

		event_target:monastic_artifact_lover = {
			show_scope_change = no

			death = { death_reason = death_suicide_hanging }
		}
	}
}

############################################
####   Advising a Poet: Hidden start    ####
############################################

# CleanSlate: Event IDs off by 1000 from what they should be
character_event = {
	id = MNM.3260
	desc = EVTDESC_MNM_3262
	picture = GFX_evt_recieve_letter
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_poet

	is_triggered_only = yes # on_society_bi_yearly_pulse, random_events

	only_capable = yes
	prisoner = no

	trigger = {
		is_monastic_member_trigger = yes

		NOR = {
			has_character_modifier = patron_of_the_arts
			has_character_modifier = preserver_of_poetry
			has_character_modifier = published_poet
		}

		society = {
			any_society_member = {
				ai = yes
				in_command = no
				is_inaccessible_or_incapable_trigger = no
				is_within_diplo_range = ROOT

				OR = {
					trait = poet
					learning >= 15
					diplomacy = 15
				}

				NOT = { character = ROOT }
			}
		}
	}

	immediate = {
		# First look for someone at court
		society = {
			random_society_member = {
				limit = {
					ai = yes
					in_command = no
					is_inaccessible_or_incapable_trigger = no
					is_within_diplo_range = ROOT

					OR = {
						trait = poet
						learning >= 15
						diplomacy = 15
					}

					NOT = { character = ROOT }
				}

				preferred_limit = {
					host = { character = ROOT }
				}

				preferred_limit = {
					same_realm = ROOT
				}

				save_event_target_as = monastic_poet
			}
		}
	}

	option = { # Highlight X
		name = EVTOPTA_MNM_3262

		custom_tooltip = { text = EVTOPTA_MNM_3262_TT }

		set_character_flag = suggestion_A_flag

		character_event = {
			id = MNM.3264
			days = 15
			random = 30
		}
	}

	option = { # Go more in Y direction
		name = EVTOPTB_MNM_3262

		custom_tooltip = { text = EVTOPTA_MNM_3262_TT }

		set_character_flag = suggestion_B_flag

		character_event = {
			id = MNM.3264
			days = 15
			random = 30
		}
	}

	option = { # Writing is frivolous and dumb / opt out
		name = EVTOPTC_MNM_3262

		custom_tooltip = { text = EVTOPTC_MNM_3262_TT }

		reverse_opinion = {
			name = opinion_disappointed
			who = event_target:monastic_poet
			years = 10
		}
	}
}

character_event = {
	id = MNM.3264
	desc = EVTDESC_MNM_3264
	picture = GFX_evt_recieve_letter
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_poet

	is_triggered_only = yes

	trigger = {
		event_target:monastic_poet = { is_alive = yes }
		is_monastic_member_trigger = yes
	}

	option = { # This should be published! (The writer will NOT be pleased)
		name = EVTOPTA_MNM_3264

		custom_tooltip = { text = EVTOPTA_MNM_3264_TT }

		wealth = -55

		add_character_modifier = {
			name = patron_of_the_arts
			years = 10
		}

		character_event = { id = MNM.3266 }
	}

	option = { # Our Order will preserve these words for generations (The writer will be pleased)
		name = EVTOPTB_MNM_3264

		custom_tooltip = { text = EVTOPTB_MNM_3264_TT }

		add_character_modifier = {
			name = preserver_of_poetry
			years = 10
		}

		character_event = { id = MNM.3267 }
	}

	option = { # DEPRESSED - FEEL BETTER
		name = EVTOPTC_MNM_3264
		tooltip_info = depressed

		trigger = { trait = depressed }

		custom_tooltip = { text = EVTOPTC_MNM_3264_TT }

		random = {
			chance = 25
			remove_trait_depressed_effect = yes
		}

		character_event = { id = MNM.3268 }
	}

	option = { # DECEITFUL - STEAL TEXT
		name = EVTOPTD_MNM_3264
		tooltip_info = deceitful

		trigger = { trait = deceitful }

		custom_tooltip = { text = EVTOPTD_MNM_3264_TT }

		piety = -50

		add_character_modifier = {
			name = published_poet
			years = 15
		}

		character_event = { id = MNM.3269 }
	}

	after = {
		hidden_effect = {
			event_target:monastic_poet = {
				if = {
					limit = {
						NOT = { trait = poet }
					}

					add_trait = poet
				}
			}
		}
	}
}

# The writer's reaction - PUBLISHED AGAINST THEIR WISHES
character_event = {
	id = MNM.3266
	picture = GFX_evt_recieve_letter
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_poet

	desc = {
		text = EVTDESC_MNM_3266_A
		trigger = { has_character_flag = suggestion_A_flag }
	}
	desc = {
		text = EVTDESC_MNM_3266_B
		trigger = { has_character_flag = suggestion_B_flag }
	}

	is_triggered_only = yes

	trigger = {
		event_target:monastic_poet = { is_alive = yes }
	}

	option = { # I seized an opportunity
		name = EVTOPTA_MNM_3266

		custom_tooltip = { text = EVTOPTA_MNM_3266_TT }

		reverse_opinion = {
			name = opinion_insulted
			who = event_target:monastic_poet
			years = 10
		}

		clr_character_flag = suggestion_A_flag
		clr_character_flag = suggestion_B_flag
	}
}

# The writer's reaction - WRITINGS WILL BE SENT TO THE ORDER
character_event = {
	id = MNM.3267
	desc = EVTDESC_MNM_3267
	picture = GFX_evt_recieve_letter
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_poet

	is_triggered_only = yes

	trigger = {
		event_target:monastic_poet = { is_alive = yes }
		is_monastic_member_trigger = yes
	}

	option = { # This should be preserved
		name = EVTOPTA_MNM_3267

		if = {
			limit = {
				OR = {
					has_opinion_modifier = { who = event_target:monastic_poet name = opinion_budding_friendship }
					reverse_has_opinion_modifier = { who = event_target:monastic_poet name = opinion_budding_friendship }
					reverse_opinion = { who = event_target:monastic_poet value = 50 }
					opinion = { who = event_target:monastic_poet value = 50 }
				}
			}

			add_friend = event_target:monastic_poet
		}
		else_if = {
			limit = {
				NOT = { is_friend = event_target:monastic_poet }
			}

			opinion = {
				name = opinion_budding_friendship
				who = event_target:monastic_poet
				years = 10
			}

			reverse_opinion = {
				name = opinion_budding_friendship
				who = event_target:monastic_poet
				years = 10
			}
		}

		clr_character_flag = suggestion_A_flag
		clr_character_flag = suggestion_B_flag
	}
}

# The writer's reaction 3 - THEIR WRITING SAVED YOU FROM DEPRESSION
character_event = {
	id = MNM.3268
	desc = EVTDESC_MNM_3268
	picture = GFX_evt_recieve_letter
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_poet

	is_triggered_only = yes

	trigger = {
		event_target:monastic_poet = { is_alive = yes }
		is_monastic_member_trigger = yes
	}

	option = { # This saved me
		name = EVTOPTA_MNM_3268

		custom_tooltip = { text = EVTOPTA_MNM_3268_TT }

		if = {
			limit = {
				NOT = { is_friend = event_target:monastic_poet }
			}

			opinion = {
				name = opinion_budding_friendship
				who = event_target:monastic_poet
				years = 10
			}

			reverse_opinion = {
				name = opinion_budding_friendship
				who = event_target:monastic_poet
				years = 10
			}
		}

		clr_character_flag = suggestion_A_flag
		clr_character_flag = suggestion_B_flag
	}
}

# The writer's reaction - YOU STOLE THEIR WORK
character_event = {
	id = MNM.3269
	picture = GFX_evt_recieve_letter
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_poet

	desc = {
		text = EVTDESC_MNM_3269_A
		trigger = { has_character_flag = suggestion_A_flag }
	}
	desc = {
		text = EVTDESC_MNM_3269_B
		trigger = { has_character_flag = suggestion_B_flag }
	}

	is_triggered_only = yes

	trigger = {
		event_target:monastic_poet = { is_alive = yes }
		is_monastic_member_trigger = yes
	}

	option = { # tough luck
		name = EVTOPTA_MNM_3269

		custom_tooltip = { text = EVTOPTA_MNM_3269_TT }

		reverse_opinion = {
			name = opinion_betrayed
			who = event_target:monastic_poet
			years = 25
		}

		if = {
			limit = { is_friend = event_target:monastic_poet }
			remove_friend = event_target:monastic_poet
		}
		else_if = {
			limit = {
				NOT = { is_rival = event_target:monastic_poet }
			}

			random = {
				chance = 25
				add_rival = event_target:monastic_poet
			}
		}

		clr_character_flag = suggestion_A_flag
		clr_character_flag = suggestion_B_flag
	}
}

#######################################################
################## 4200 - Gardening ###################
#######################################################

character_event = {
	id = MNM.4200
	desc = EVTDESC_MNM_4200
	picture = GFX_evt_gathering_of_minds
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_botanist

	is_triggered_only = yes  # on_society_bi_yearly_pulse, random_events

	only_capable = yes
	prisoner = no

	trigger = {
		is_monastic_member_trigger = yes

		NOT = { has_character_modifier = gardening_cooldown_timer }

		society = {
			any_society_member = {
				ai = yes
				in_command = no
				is_inaccessible_or_incapable_trigger = no
				is_within_diplo_range = ROOT

				OR = {
					trait = gardener
					learning >= 15
				}

				NOT = { character = ROOT }
			}
		}
	}

	immediate = {
		society = {
			random_society_member = {
				limit = {
					ai = yes
					in_command = no
					is_inaccessible_or_incapable_trigger = no
					is_within_diplo_range = ROOT

					OR = {
						trait = gardener
						learning >= 15
					}

					NOT = { character = ROOT }
				}

				preferred_limit = {
					host = { character = ROOT }
				}

				preferred_limit = {
					same_realm = ROOT
				}

				save_event_target_as = monastic_botanist
			}
		}

		add_character_modifier = {
			name = gardening_cooldown_timer
			years = 5
			hidden = yes
		}
	}

	option = { # Go to the monastery/ashram
		name = {
			text = EVTOPTA_MNM_4200_CHRISTIAN
			trigger = { is_dharmic_monastic_member_trigger = no }
		}
		name = {
			text = EVTOPTA_MNM_4200_DHARMIC
			trigger = { is_dharmic_monastic_member_trigger = yes }
		}

		custom_tooltip = { text = EVTOPTA_MNM_4200_TT }

		character_event = { id = MNM.4204 }
	}

	option = { # Pay someone to acquire the roses
		name = EVTOPTB_MNM_4200

		custom_tooltip = { text = EVTOPTB_MNM_4200_TT }

		character_event = { id = MNM.4205 }
	}

	option = { # Send sample from my own garden
		name = EVTOPTC_MNM_4200
		tooltip_info = gardener

		trigger = { trait = gardener }

		custom_tooltip = { text = EVTOPTC_MNM_4200_TT }

		character_event = { id = MNM.4206 }
	}

	option = { # do nothing
		name = EVTOPTD_MNM_4200
	}
}

# Visited the monastery
character_event = {
	id = MNM.4204
	desc = EVTDESC_MNM_4204
	picture = GFX_evt_garden
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_botanist

	is_triggered_only = yes

	trigger = { is_monastic_member_trigger = yes }

	option = { # It's like coming home
		name = EVTOPTA_MNM_4204

		custom_tooltip = { text = EVTOPTA_MNM_4204_TT }

		trigger = {
			lifestyle_traits < 1
			has_character_modifier = green_fingers
			NOT = { trait = gardener }
		}

		add_trait = gardener
	}

	option = { # Embrace this new interest
		name = EVTOPTB_MNM_4204

		custom_tooltip = { text = EVTOPTB_MNM_4204_TT }

		random_list = {
			60 = {
				mult_modifier = {
					factor = 10
					trait = gardener
				}
				mult_modifier = {
					factor = 1.2
					trait = diligent
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}

				add_character_modifier = {
					name = green_fingers
					years = 10
				}
			}

			40 = {
				mult_modifier = {
					factor = 10
					trait = imbecile
				}
				mult_modifier = {
					factor = 0.5
					trait = genius
				}

				add_character_modifier = {
					name = dirty_hands
					years = 5
				}
			}
		}
	}

	option = { # Praise the botanist
		name = EVTOPTC_MNM_4204

		custom_tooltip = { text = EVTOPTC_MNM_4204_TT }

		reverse_opinion = {
			name = opinion_was_praised
			who = event_target:monastic_botanist
			years = 10
		}
	}
}

# I hired someone who brought me roses
character_event = {
	id = MNM.4205
	desc = EVTDESC_MNM_4205
	picture = GFX_evt_garden
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_botanist

	is_triggered_only = yes

	trigger = { is_monastic_member_trigger = yes }

	option = { # Praise the botanist
		name = EVTOPTA_MNM_4205

		custom_tooltip = { text = EVTOPTA_MNM_4205_TT }

		add_character_modifier = {
			name = rose_gardens
			years = 15
		}

		reverse_opinion = {
			name = opinion_was_praised
			who = event_target:monastic_botanist
			years = 10
		}
	}
}

# I sent some of my own flowers to the botanist
character_event = {
	id = MNM.4206
	desc = EVTDESC_MNM_4206
	picture = GFX_evt_garden
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_botanist

	is_triggered_only = yes

	trigger = { is_monastic_member_trigger = yes }

	option = { # I am happy to help
		name = EVTOPTA_MNM_4206

		custom_tooltip = { text = EVTOPTA_MNM_4206_TT }

		add_character_modifier = {
			name = the_name_of_the_rose
			years = 10
		}

		reverse_opinion = {
			name = opinion_was_praised
			who = event_target:monastic_botanist
			years = 10
		}
	}
}


#######################################################
############ 4210 - Someone falls asleep ##############
#######################################################

character_event = {
	id = MNM.4210
	desc = EVTDESC_MNM_4210
	picture = GFX_evt_gathering_of_minds
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_sleeper

	is_triggered_only = yes # on_society_bi_yearly_pulse, random_events

	only_capable = yes
	prisoner = no

	trigger = {
		is_monastic_member_trigger = yes
		is_inaccessible_trigger = no

		NOT = { has_character_modifier = fell_asleep_in_church_cooldown_timer }

		society = {
			any_society_member = {
				ai = yes
				in_command = no
				is_inaccessible_or_incapable_trigger = no
				is_within_diplo_range = ROOT
				has_vice_trigger = yes
				NOT = { character = ROOT }
			}
		}
	}

	immediate = {
		society = {
			random_society_member = {
				limit = {
					ai = yes
					in_command = no
					is_inaccessible_or_incapable_trigger = no
					is_within_diplo_range = ROOT
					has_vice_trigger = yes
					NOT = { character = ROOT }
				}

				preferred_limit = {
					host = { character = ROOT }
				}

				preferred_limit = {
					same_realm = ROOT
				}

				save_event_target_as = monastic_sleeper
			}
		}

		add_character_modifier = {
			name = fell_asleep_in_church_cooldown_timer
			years = 5
			hidden = yes
		}
	}

	option = { # Wake them up
		name = EVTOPTA_MNM_4210

		character_event = { id = MNM.4214 }
	}

	option = { # Let them sleep
		name = EVTOPTB_MNM_4210

		character_event = { id = MNM.4215 }
	}

	option = { # Prank
		name = EVTOPTC_MNM_4210
		tooltip_info = lunatic

		trigger = { trait = lunatic }

		character_event = { id = MNM.4216 }
	}
}

# Woke them up
character_event = {
	id = MNM.4214
	desc = EVTDESC_MNM_4214
	picture = GFX_evt_gathering_of_minds
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_sleeper

	is_triggered_only = yes

	option = { # Think nothing of it, friend
		name = EVTOPTA_MNM_4214

		reverse_opinion = {
			who = event_target:monastic_sleeper
			name = opinion_grateful
			years = 10
		}
	}

	option = { # Insinuate that they owe you
		name = EVTOPTB_MNM_4214

		trigger = {
			has_dlc = "Conclave"
			NOT = { holds_favor_on =  event_target:monastic_sleeper }
		}

		add_favor = event_target:monastic_sleeper
	}
}

# I let them sleep
character_event = {
	id = MNM.4215
	desc = EVTDESC_MNM_4215
	picture = GFX_evt_gathering_of_minds
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_sleeper

	is_triggered_only = yes

	option = { # They are embarrassed
		name = EVTOPTA_MNM_4215

		event_target:monastic_sleeper = {
			show_scope_change = no

			add_character_modifier = {
				name = embarrassed_believer
				years = 5
			}
		}
	}
}

# I pranked them
character_event = {
	id = MNM.4216
	desc = EVTDESC_MNM_4216
	picture = GFX_evt_gathering_of_minds
	border = GFX_event_normal_frame_religion
	portrait = event_target:monastic_sleeper

	is_triggered_only = yes

	option = { # Amazing
		name = EVTOPTA_MNM_4216

		reverse_opinion = {
			who = event_target:monastic_sleeper
			name = opinion_insulted
			years = 10
		}
	}
}

# I own heretical books!
character_event = {
	id = MNM.4217
	title = EVTTITLE_MNM_4217
	desc = EVTDESC_MNM_4217
	picture = GFX_evt_gathering_of_minds
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_society_bi_yearly_pulse, random_events

	only_capable = yes

	trigger = {
		is_monastic_member_trigger = yes

		any_artifact = {
			OR = {
				has_artifact_flag = unholy
				has_artifact_flag = hermetics
			}

			has_artifact_flag = book
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2.0
			society_rank >= 3
		}
		mult_modifier = {
			factor = 5.0
			society_member_of = monastic_order_dominican
		}
		mult_modifier = {
			factor = 0.1
			has_character_flag = considered_burning_heretical_books
		}
	}

	immediate = {
		random_artifact = {
			limit = {
				has_artifact_flag = book

				OR = {
					has_artifact_flag = unholy
					has_artifact_flag = hermetics
				}
			}

			save_event_target_as = selected_book
		}
	}

	option = { # Amazing. Burn that baby.
		name = {
			text = EVTOPTA_MNM_4217
			trigger = {
				NOT = { trait = zealous }
			}
		}
		name = {
			text = EVTOPTA_MNM_4217_zealous
			trigger = { trait = zealous }
		}

		if = { # Checks if you're about to burn the Necronomicon...
			limit = {
				event_target:selected_book = {
					artifact_type = necronomicon
				}
			}

			set_character_flag = burned_unholy_books

			character_event = {
				id = MNM.4218
				days = 100
				random = 365
			}
		}

		event_target:selected_book = { # destroys a book...
			show_scope_change = no

			destroy_artifact = yes
		}

		prestige = 50

		if = {
			limit = {
				any_owned_bloodline = {
					has_bloodline_flag = monastic_saintly_bloodline
					bloodline_is_active_for = PREV
				}
			}

			add_society_currency_major_effect = yes
		}
		else = {
			add_society_currency_medium_effect = yes
		}
	}

	option = { # I shall burn ALL the books... (only available if you have more than one book)
		name = {
			text = EVTOPTB_MNM_4217
			trigger = {
				NOT = { trait = zealous }
			}
		}
		name = {
			text = EVTOPTB_MNM_4217_zealous
			trigger = { trait = zealous }
		}

		trigger = {
			any_artifact = {
				count >= 2

				OR = {
					has_artifact_flag = unholy
					has_artifact_flag = hermetics
				}

				has_artifact_flag = book
			}
		}

		if = { # If you burn the Necronomicon...
			limit = {
				any_artifact = {
					artifact_type = necronomicon
				}
			}

			set_character_flag = burned_unholy_books

			character_event = {
				id = MNM.4218
				days = 100
				random = 365
			}
		}

		any_artifact = { # Burns any 'unholy' book...
			show_scope_change = no

			limit = {
				OR = {
					has_artifact_flag = unholy
					has_artifact_flag = hermetics
				}

				has_artifact_flag = book
			}

			destroy_artifact = yes
		}

		prestige = 100

		if = {
			limit = {
				any_owned_bloodline = {
					has_bloodline_flag = monastic_saintly_bloodline
					bloodline_is_active_for = PREV
				}
			}

			add_society_currency_large_effect = yes
		}
		else = {
			add_society_currency_major_effect = yes
		}
	}

	option = { # This sounds excessive!
		name = {
			text = EVTOPTC_MNM_4217
			trigger = { has_lifestyle_learning_trigger = no }
		}
		name = {
			text = EVTOPTC_MNM_4217_scholar
			trigger = { has_lifestyle_learning_trigger = yes }
		}

		set_character_flag = considered_burning_heretical_books
	}
}

# The Necronomicon comes back
character_event = {
	id = MNM.4218
	title = EVTTITLE_MNM_4218
	desc = EVTDESC_MNM_4218
	picture = GFX_evt_ritual_scroll
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		has_character_flag = burned_unholy_books
		NOT = {
			any_artifact = { artifact_type = necronomicon }
		}
	}

	immediate = {
		add_artifact = necronomicon
	}

	option = {
		name = EVTOPTA_MNM_4218

		custom_tooltip = { text = EVTOPTA_MNM_4218_TT }

		random_artifact = { # destroys the book...
			limit = { artifact_type = necronomicon }
			destroy_artifact = yes
		}
	}

	option = {
		name = EVTOPTB_MNM_4218

		custom_tooltip = { text = EVTOPTB_MNM_4218_TT }
	}
}

### Monastic Order Child Education Power ###
## 2.8 addition by Matthew Clohessy

character_event = {
	id = MNM.4300

	is_triggered_only = yes # on_childhood_pulse
	hide_window = yes

	trigger = {
		educator = {
			is_monastic_member_trigger = yes

			NOR = { # Buddhists and Jains have a different power
				society_member_of = monastic_order_buddhist
				society_member_of = monastic_order_jain
				society_member_of = monastic_order_bon
			}
		}

		check_variable = { which = monastic_order_education_event value < 3 }
	}

	immediate = {
		change_variable = { which = monastic_order_education_event value = 1 }

		random = {
			chance = 30
			educator = { character_event = { id = MNM.4301 days = 5 } }
		}
	}
}

# How do you try and nudge your ward
character_event = {
	id = MNM.4301
	picture = GFX_evt_child_reading
	border = GFX_event_normal_frame_religion

	desc = {
		text = evt_DESCA_MNM_4301
		picture = GFX_evt_child_reading
		trigger = {
			FROM = {
				age >= 6
				age <  8
			}
		}
	}
	desc = {
		text = evt_DESCB_MNM_4301
		picture = GFX_evt_charity
		trigger = {
			FROM = {
				age >= 8
				age < 10
			}
		}
	}
	desc = {
		text = evt_DESCC_MNM_4301
		picture = GFX_evt_stone_church
		trigger = {
			FROM = {
				age >= 10
			}
		}
	}

	is_triggered_only = yes

	immediate = {
		random_list = {
			25 = {
				trigger = { diplomacy >= 8 }
				set_character_flag = monastic_order_education_diplomacy
			}

			25 = {
				trigger = { martial >= 8 }
				set_character_flag = monastic_order_education_martial
			}

			25 = {
				trigger = { stewardship >= 8 }
				set_character_flag = monastic_order_education_stewardship
			}

			25 = {
				trigger = { intrigue >= 8 }
				set_character_flag = monastic_order_education_intrigue
			}

			fallback = {
				set_character_flag = monastic_order_education_learning
			}
		}
	}

	option = { # No other stat bonus
		name = evt_OPTA_MNM_4301

		trigger = { has_character_flag = monastic_order_education_learning }

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 3
				}
			}
		}
	}

	option = { # Diplomacy
		name = evt_OPTA_MNM_4301

		trigger = { has_character_flag = monastic_order_education_diplomacy }

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 3
				}
			}
		}

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_diplomacy = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_diplomacy = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_diplomacy = 3
				}
			}
		}
	}
	option = { # Martial
		name = evt_OPTA_MNM_4301

		trigger = { has_character_flag = monastic_order_education_martial }

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 3
				}
			}
		}

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_martial = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_martial = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_martial = 3
				}
			}
		}
	}

	option = { # Stewardship
		name = evt_OPTA_MNM_4301

		trigger = { has_character_flag = monastic_order_education_stewardship }

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 3
				}
			}
		}

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_stewardship = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_stewardship = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_stewardship = 3
				}
			}
		}
	}

	option = { # Intrigue
		name = evt_OPTA_MNM_4301

		trigger = { has_character_flag = monastic_order_education_intrigue }

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_learning = 3
				}
			}
		}

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.9
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_intrigue = 1
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5
					FROM = { is_dumb_trigger = yes }
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_intrigue = 2
				}
			}

			20 = {
				trigger = {
					FROM = { is_dumb_trigger = no }
				}

				mult_modifier = {
					factor = 2
					FROM = { is_smart_trigger = yes }
				}
				mult_modifier = {
					factor = 1.1
					learning >= 12
				}
				mult_modifier = {
					factor = 1.1
					learning >= 14
				}
				mult_modifier = {
					factor = 1.1
					learning >= 16
				}
				mult_modifier = {
					factor = 1.1
					learning >= 18
				}
				mult_modifier = {
					factor = 1.1
					learning >= 20
				}
				mult_modifier = {
					factor = 2
					is_learned_trigger = yes
				}

				FROM = {
					show_scope_change = no
					change_intrigue = 3
				}
			}
		}
	}

	after = {
		clr_character_flag = monastic_order_education_learning
		clr_character_flag = monastic_order_education_diplomacy
		clr_character_flag = monastic_order_education_martial
		clr_character_flag = monastic_order_education_stewardship
		clr_character_flag = monastic_order_education_intrigue
	}
}

# Child educated by a MO member reaches adulthood
character_event = {
	id = MNM.4302

	hide_window = yes
	is_triggered_only = yes # on_adulthood

	trigger = {
		educator = {
			is_monastic_member_trigger = yes

			NOR = { # Buddhists and Jains have a different power
				society_member_of = monastic_order_buddhist
				society_member_of = monastic_order_jain
				society_member_of = monastic_order_bon
			}
		}
	}

	fail_trigger_effect = {
		# Clear the variable for students who temporarily were ward to an MO member
		set_variable = { which = monastic_order_education_event value = 0 }
	}

	immediate = {
		set_variable = { which = monastic_order_education_event value = 0 } # set variable to zero to prune from saves

		random = {
			chance = 30

			educator = { character_event = { id = MNM.4303 days = 5 } }
		}
	}
}

# Educator can try to sway their former student to be better
character_event = {
	id = MNM.4303
	desc = evt_DESC_MNM_4303
	picture = GFX_evt_book_carolingian_script
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		is_monastic_member_trigger = yes

		NOR = { # Buddhists and Jains have a different power
			society_member_of = monastic_order_buddhist
			society_member_of = monastic_order_jain
			society_member_of = monastic_order_bon
		}
	}

	immediate = {
		FROM = {
			random_list = {
				1 = {
					trigger = {
						trait = lustful
						ROOT = { NOT = { religion = hindu } }
					}

					set_character_flag = monastic_order_education_remove_lustful
				}

				1 = {
					trigger = { trait = gluttonous }
					set_character_flag = monastic_order_education_remove_gluttonous
				}

				1 = {
					trigger = { trait = greedy }
					set_character_flag = monastic_order_education_remove_greedy
				}

				1 = {
					trigger = { trait = slothful }
					set_character_flag = monastic_order_education_remove_slothful
				}

				1 = {
					trigger = { trait = envious }
					set_character_flag = monastic_order_education_remove_envious
				}

				1 = {
					trigger = { trait = wroth }
					set_character_flag = monastic_order_education_remove_wroth
				}

				1 = {
					trigger = { trait = proud }
					set_character_flag = monastic_order_education_remove_proud
				}

				1 = {
					trigger = { trait = deceitful }
					set_character_flag = monastic_order_education_remove_deceitful
				}

				1 = {
					trigger = { trait = cruel }
					set_character_flag = monastic_order_education_remove_cruel
				}

				1 = {
					trigger = { trait = cynical }
					set_character_flag = monastic_order_education_remove_cynical
				}

				1 = {
					trigger = {
						NOT = { trait = humble }
					}

					set_character_flag = monastic_order_education_add_humble
				}

				1 = {
					trigger = {
						NOT = { trait = charitable }
					}

					set_character_flag = monastic_order_education_add_charitable
				}

				1 = {
					trigger = {
						NOT = { trait = chaste }

						ROOT = {
							society_rank >= 2
							NOT = { religion = hindu }
						}
					}

					set_character_flag = monastic_order_education_add_chaste
				}

				1 = {
					trigger = {
						NOT = { trait = kind }
						ROOT = { society_rank >= 2 }
					}

					set_character_flag = monastic_order_education_add_kind
				}

				1 = {
					trigger = {
						NOT = { trait = temperate }
						ROOT = { society_rank >= 2 }
					}

					set_character_flag = monastic_order_education_add_temperate
				}

				1 = {
					trigger = {
						NOT = { trait = honest }
						ROOT = { society_rank >= 2 }
					}

					set_character_flag = monastic_order_education_add_honest
				}

				1 = {
					trigger = {
						NOT = { trait = patient }
						ROOT = { society_rank >= 3 }
					}

					set_character_flag = monastic_order_education_add_patient
				}

				1 = {
					trigger = {
						NOT = { trait = diligent }
						ROOT = { society_rank >= 3 }
					}

					set_character_flag = monastic_order_education_add_diligent
				}

				1 = {
					trigger = {
						trait = ambitious
						ROOT = { society_rank >= 3 }
					}

					set_character_flag = monastic_order_education_remove_ambitious
				}

				1 = {
					trigger = {
						NOT = { trait = content }
						ROOT = { society_rank >= 3 }
					}

					set_character_flag = monastic_order_education_add_content
				}
			}
		}
	}

	option = {
		name = evt_OPTA_MNM_4303

		FROM = { character_event = { id = MNM.4304 days = 1 } }
	}
}

# Your Monastic Order educator convinces you to be better
character_event = {
	id = MNM.4304
	desc = evt_DESC_MNM_4304
	picture = GFX_evt_book_carolingian_script
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { # Sounds good
		name = evt_OPTA_MNM_4304

		trigger_switch = {
			on_trigger = has_character_flag

			monastic_order_education_remove_lustful    = { remove_trait = lustful }
			monastic_order_education_remove_gluttonous = { remove_trait = gluttonous }
			monastic_order_education_remove_greedy     = { remove_trait = greedy }
			monastic_order_education_remove_slothful   = { remove_trait = slothful }
			monastic_order_education_remove_envious    = { remove_trait = envious }
			monastic_order_education_remove_wroth      = { remove_trait = wroth }
			monastic_order_education_remove_proud      = { remove_trait = proud }
			monastic_order_education_remove_deceitful  = { remove_trait = deceitful }
			monastic_order_education_remove_cruel      = { remove_trait = cruel }
			monastic_order_education_remove_cynical    = { remove_trait = cynical }
			monastic_order_education_remove_ambitious  = { remove_trait = ambitious }
			monastic_order_education_add_humble        = { add_trait = humble }
			monastic_order_education_add_charitable    = { add_trait = charitable }
			monastic_order_education_add_chaste        = { add_trait = chaste }
			monastic_order_education_add_kind          = { add_trait = kind }
			monastic_order_education_add_temperate     = { add_trait = temperate }
			monastic_order_education_add_patient       = { add_trait = patient }
			monastic_order_education_add_diligent      = { add_trait = diligent }
			monastic_order_education_add_honest        = { add_trait = honest }
			monastic_order_education_add_content       = { add_trait = content }
		}

		FROM = { character_event = { id = MNM.4305 days = 1 } }
	}

	option = { # No thanks I like my sins
		name = evt_OPTB_MNM_4304

		piety = -10
		prestige = 20
		FROM = { character_event = { id = MNM.4306 days = 1 } }

		ai_chance = { factor = 0 }
	}
}

# Your ward did as you asked
character_event = {
	id = MNM.4305
	desc = evt_DESC_MNM_4305
	picture = GFX_evt_book_carolingian_script
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = evt_OPTA_MNM_4305

		piety = 10

		FROM = {
			show_scope_change = no

			tooltip = {
				trigger_switch = {
					on_trigger = has_character_flag

					monastic_order_education_remove_lustful    = { remove_trait = lustful }
					monastic_order_education_remove_gluttonous = { remove_trait = gluttonous }
					monastic_order_education_remove_greedy     = { remove_trait = greedy }
					monastic_order_education_remove_slothful   = { remove_trait = slothful }
					monastic_order_education_remove_envious    = { remove_trait = envious }
					monastic_order_education_remove_wroth      = { remove_trait = wroth }
					monastic_order_education_remove_proud      = { remove_trait = proud }
					monastic_order_education_remove_deceitful  = { remove_trait = deceitful }
					monastic_order_education_remove_cruel      = { remove_trait = cruel }
					monastic_order_education_remove_cynical    = { remove_trait = cynical }
					monastic_order_education_remove_ambitious  = { remove_trait = ambitious }
					monastic_order_education_add_humble        = { add_trait = humble }
					monastic_order_education_add_charitable    = { add_trait = charitable }
					monastic_order_education_add_chaste        = { add_trait = chaste }
					monastic_order_education_add_kind          = { add_trait = kind }
					monastic_order_education_add_temperate     = { add_trait = temperate }
					monastic_order_education_add_patient       = { add_trait = patient }
					monastic_order_education_add_diligent      = { add_trait = diligent }
					monastic_order_education_add_honest        = { add_trait = honest }
					monastic_order_education_add_content       = { add_trait = content }
				}
			}

			clr_character_flag = monastic_order_education_remove_lustful
			clr_character_flag = monastic_order_education_remove_gluttonous
			clr_character_flag = monastic_order_education_remove_greedy
			clr_character_flag = monastic_order_education_remove_slothful
			clr_character_flag = monastic_order_education_remove_envious
			clr_character_flag = monastic_order_education_remove_wroth
			clr_character_flag = monastic_order_education_remove_proud
			clr_character_flag = monastic_order_education_remove_deceitful
			clr_character_flag = monastic_order_education_remove_cruel
			clr_character_flag = monastic_order_education_remove_cynical
			clr_character_flag = monastic_order_education_remove_ambitious
			clr_character_flag = monastic_order_education_add_humble
			clr_character_flag = monastic_order_education_add_charitable
			clr_character_flag = monastic_order_education_add_chaste
			clr_character_flag = monastic_order_education_add_kind
			clr_character_flag = monastic_order_education_add_temperate
			clr_character_flag = monastic_order_education_add_patient
			clr_character_flag = monastic_order_education_add_diligent
			clr_character_flag = monastic_order_education_add_honest
			clr_character_flag = monastic_order_education_add_content
		}
	}
}

# Your ward ignored you
character_event = {
	id = MNM.4306
	desc = evt_DESC_MNM_4306
	picture = GFX_evt_book_carolingian_script
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = evt_OPTA_MNM_4306

		piety = -10

		FROM = {
			clr_character_flag = monastic_order_education_remove_lustful
			clr_character_flag = monastic_order_education_remove_gluttonous
			clr_character_flag = monastic_order_education_remove_greedy
			clr_character_flag = monastic_order_education_remove_slothful
			clr_character_flag = monastic_order_education_remove_envious
			clr_character_flag = monastic_order_education_remove_wroth
			clr_character_flag = monastic_order_education_remove_proud
			clr_character_flag = monastic_order_education_remove_deceitful
			clr_character_flag = monastic_order_education_remove_cruel
			clr_character_flag = monastic_order_education_remove_cynical
			clr_character_flag = monastic_order_education_remove_ambitious
			clr_character_flag = monastic_order_education_add_humble
			clr_character_flag = monastic_order_education_add_charitable
			clr_character_flag = monastic_order_education_add_chaste
			clr_character_flag = monastic_order_education_add_kind
			clr_character_flag = monastic_order_education_add_temperate
			clr_character_flag = monastic_order_education_add_patient
			clr_character_flag = monastic_order_education_add_diligent
			clr_character_flag = monastic_order_education_add_honest
			clr_character_flag = monastic_order_education_add_content
		}
	}
}
