###########################################
#                                         #
# Way of Life theology events             #
#                                         #
# ID WoL.7000-WoL.7999                    #
#                                         #
###########################################

# Written by Tobias Bodlund
# Tweaks and additional events by Henrik Fåhraeus

namespace = WoL


# Study religious myths?
character_event = {
	id = WoL.7000
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	only_playable = yes
	min_age =  16
	capable_only = yes
	prisoner = no

	trigger = {
		is_priest = no
		holy_order = no
		has_focus = focus_theology
		NOT = { is_inaccessible_trigger = yes }
		NOT = { has_character_flag = studied_religious_myths }
	}

	desc = {
		trigger = {
			OR = {
				is_pagan_religion = no # Scriptures
				is_reformed_pagan_religion = yes
			}
		}
		text = EVTDESC_WoL_7000_non_unref_pagan
	}
	desc = {
		trigger = {
			is_pagan_religion = yes # Stories
			is_reformed_pagan_religion = no
		}
		text = EVTDESC_WoL_7000_unref_pagan
	}
	
	immediate = {
		set_character_flag = studied_religious_myths
	}
	
	option = {
		name = EVTOPTA_WoL_7000 # Yes, study scriptures
		trigger = {
			OR = {
				is_pagan_religion = no
				is_reformed_pagan_religion = yes
			}
		}
		piety = 20
		hidden_tooltip = { character_event = { id = WoL.7001 days = 90 } }
	}
	option = {
		name = EVTOPTB_WoL_7000 # Yes, listen to stories
		trigger = {
			is_pagan_religion = yes
			is_reformed_pagan_religion = no
		}
		piety = 20
		hidden_tooltip = { character_event = { id = WoL.7001 days = 90 } }
	}
	option = {
		name = EVTOPTC_WoL_7000  # I have no time
		piety = -5
		if = {
			limit = {
				has_character_modifier = religious_studies
			}
			remove_character_modifier = religious_studies
		}
	}
}

# Results of studying religous scriptures or stories
character_event = {
	id = WoL.7001
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	desc = {
		trigger = {
			OR = {
				is_pagan_religion = no # Scriptures
				is_reformed_pagan_religion = yes
			}
		}
		text = EVTDESC_WoL_7001_non_unref_pagan
	}
	desc = {
		trigger = {
			is_pagan_religion = yes # Stories
			is_reformed_pagan_religion = no
		}
		text = EVTDESC_WoL_7001_unref_pagan
	}

	option = {
		name = EVTOPTA_WoL_7001 # Scriptures
		trigger = {
			OR = {
				is_pagan_religion = no
				is_reformed_pagan_religion = yes
			}
		}
		piety = 20
		add_character_modifier = {
			name = ancient_wisdom
			years = 3
		}
		if = {
			limit = {
				NOT = { has_character_modifier = religious_studies }
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
			}
			add_character_modifier = {
				name = religious_studies
				duration = -1
			}
			set_character_flag = religious_studies_timer
		}
		if = {
			limit = {
				has_character_modifier = religious_studies
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
				had_character_flag = { flag = religious_studies_timer days = 1800 }
			}
			clr_character_flag = religious_studies_timer
			remove_character_modifier = religious_studies
			add_character_modifier = {
				name = religious_philosopher
				duration = -1
			}
		}
	}
	option = {
		name = EVTOPTB_WoL_7001 # Stories
		trigger = {
			is_pagan_religion = yes # Stories
			is_reformed_pagan_religion = no
		}
		piety = 20
		add_character_modifier = {
			name = ancient_wisdom
			years = 3
		}
		if = {
			limit = {
				NOT = { has_character_modifier = religious_studies }
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
			}
			add_character_modifier = {
				name = religious_studies
				duration = -1
			}
			set_character_flag = religious_studies_timer
		}
		if = {
			limit = {
				has_character_modifier = religious_studies
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
				had_character_flag = { flag = religious_studies_timer days = 1800 }
			}
			clr_character_flag = religious_studies_timer
			remove_character_modifier = religious_studies
			add_character_modifier = {
				name = religious_philosopher
				duration = -1
			}
		}
	}
}

# Befriend priest through your religious interest
character_event = {
	id = WoL.7010
	
	hide_window = yes
	
	is_triggered_only = yes

	only_playable = yes
	min_age =  16
	capable_only = yes
	prisoner = no

	trigger = {
		is_priest = no
		has_focus = focus_theology
		any_realm_character = {
			religion = ROOT
			is_priest = yes
			NOR = {
				trait = incapable
				is_inaccessible_trigger = yes
				is_friend = ROOT
			}
			prisoner = no
		}
	}
	
	immediate = {
		random_realm_character = {
			limit = {
				religion = ROOT
				is_priest = yes
				NOR = {
					trait = incapable
					is_inaccessible_trigger = yes
					is_friend = ROOT
				}
				prisoner = no
			}
			character_event = { id = WoL.7011 }
		}
	}
}

character_event = {
	id = WoL.7011

	hide_window = yes

	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = WoL.7012 } }
	}
}

character_event = {
	id = WoL.7012
	desc = EVTDESC_WoL_7012
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA_WoL_7012
		add_friend = FROM
	}
}

# Visit holy site and speak with priests there (not Muslims, Christians, Jews or Indians)
character_event = {
	id = WoL.7020
	desc = EVTDESC_WoL_7020
	picture = GFX_evt_cathedral
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	only_playable = yes
	min_age =  16
	capable_only = yes
	prisoner = no
	war = no

	trigger = {
		has_focus = focus_theology
		in_command_trigger = no
		NOT = { religion_group = christian }
		NOT = { religion_group = muslim }
		NOT = { religion_group = jewish_group }
		NOT = { religion_group = indian_group }
		NOT = { is_inaccessible_trigger = yes }
		is_not_busy_trigger = yes
		NOT = { has_character_flag = wol_theology_visited_holy_site }
		any_realm_title = {
			is_holy_site = ROOT
			holder_scope = { ai = yes }
		}
	}
	
	immediate = {
		set_character_flag = wol_theology_visited_holy_site
		random_realm_title = {
			limit = {
				is_holy_site = ROOT
				holder_scope = { ai = yes }
			}
			save_event_target_as = holy_site_visiting # For localization
		}
	}
	
	option = {
		name = EVTOPTA_WoL_7020  # Go
		piety = 20
		scaled_wealth = -0.2
		hidden_tooltip = { character_event = { id = WoL.7021 days = 20 } }
		add_character_modifier = {
			name = do_not_disturb
			days = 20
			hidden = yes
		}
	}
	option = {
		name = EVTOPTB_WoL_7020 # Don't go
		piety = -5
	}
}

# Experience at holy site
character_event = {
	id = WoL.7021
	desc = EVTDESC_WoL_7021
	picture = GFX_evt_cathedral
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA_WoL_7021
		piety = 50
		if = {
			limit = {
				NOT = { trait = cynical }
				NOT = { trait = zealous }
			}
			random = {
				chance = 20
				add_trait = zealous
				character_event = { id = 38269 } # Notify
			}
		}
		if = {
			limit = {
				trait = cynical
			}
			random = {
				chance = 20
				remove_trait = cynical
				character_event = { id = 38316 } # Notify
			}
		}
		remove_do_not_disturb_effect = yes
		clear_event_target = holy_site_visiting
		if = {
			limit = {
				NOT = { has_character_modifier = religious_studies }
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
			}
			add_character_modifier = {
				name = religious_studies
				duration = -1
			}
			set_character_flag = religious_studies_timer
		}
		if = {
			limit = {
				has_character_modifier = religious_studies
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
				had_character_flag = { flag = religious_studies_timer days = 1800 }
			}
			clr_character_flag = religious_studies_timer
			remove_character_modifier = religious_studies
			add_character_modifier = {
				name = religious_philosopher
				duration = -1
			}
		}
	}
}

# Reflect on own life and how it relates to the gods.
character_event = {
	id = WoL.7030
	desc = EVTDESC_WoL_7030
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	only_playable = yes
	min_age =  16
	capable_only = yes

	trigger = {
		is_priest = no
		has_focus = focus_theology
		NOT = { has_character_flag = wol_theology_reflect_on_self_and_gods }
		NOT = { trait = possessed }
		NOT = { trait = theologian }
		NOT = { has_character_modifier = religious_philosopher }
		any_realm_character = {
			religion = ROOT
			is_priest = yes
			NOT = { trait = incapable }
			NOT = { is_inaccessible_trigger = yes }
		}
	}
	
	immediate = {
		set_character_flag = wol_theology_reflect_on_self_and_gods
	}
	
	option = {
		name = EVTOPTA_WoL_7030  # Indeed
		ai_chance = {
			factor = 100
		}
		piety = 10
	}
	option = {
		name = EVTOPTB_WoL_7030  # Study more deeply
		ai_chance = {
			factor = 100
		}
		piety = 30
		if = {
			limit = {
				NOT = { has_character_modifier = religious_studies }
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
			}
			add_character_modifier = {
				name = religious_studies
				duration = -1
			}
			set_character_flag = religious_studies_timer
		}
		if = {
			limit = {
				has_character_modifier = religious_studies
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
				had_character_flag = { flag = religious_studies_timer days = 1800 }
			}
			clr_character_flag = religious_studies_timer
			remove_character_modifier = religious_studies
			add_character_modifier = {
				name = religious_philosopher
				duration = -1
			}
		}
	}
	option = {
		name = EVTOPTC_WoL_7030  # Stop this
		ai_chance = {
			factor = 0
		}
		piety = -10
		if = {
			limit = {
				has_character_modifier = religious_studies
			}
			remove_character_modifier = religious_studies
			add_trait = cynical
		}
		set_character_flag = religious_studies_timer
	}
}

# Theologian's view of other religions
character_event = {
	id = WoL.7040

	hide_window = yes
	
	is_triggered_only = yes

	only_playable = yes
	min_age =  16
	capable_only = yes

	trigger = {
		has_focus = focus_theology
		is_priest = no
		NOT = { trait = zealous }
		NOT = { trait = sympathy_christendom }
		NOT = { trait = sympathy_islam }
		NOT = { trait = sympathy_pagans }
		NOT = { trait = sympathy_zoroastrianism }
		NOT = { trait = sympathy_judaism }
		NOT = { trait = sympathy_indian }
		NOT = { has_character_flag = wol_theology_view_other_religions }
		any_realm_character = {
			NOT = { religion_group = ROOT }
		}
	}
	
	immediate = {
		set_character_flag = wol_theology_view_other_religions
		random_realm_character = {
			limit = {
				NOT = { religion_group = ROOT }
			}
			character_event = { id = WoL.7041 }
		}
	}
}

# Bounce
character_event = {
	id = WoL.7041
	
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		FROM = { character_event = { id = WoL.7042 } }
	}
}

# Choose stance on other religion
character_event = {
	id = WoL.7042
	desc = EVTDESC_WoL_7042
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_WoL_7042  # Accept
		ai_chance = {
			factor = 100
			modifier = {
				factor = 5.0
				trait = cynical
			}
		}
		FROM = {
			show_scope_change = no
			trigger_switch = {
				on_trigger = religion_group
				christian = { ROOT = { add_trait = sympathy_christendom } }
				muslim = { ROOT = { add_trait = sympathy_islam } }
				pagan_group = { ROOT = { add_trait = sympathy_pagans } }
				zoroastrian_group = { ROOT = { add_trait = sympathy_zoroastrianism } }
				jewish_group = { ROOT = { add_trait = sympathy_judaism } }
				indian_group = { ROOT = { add_trait = sympathy_indian } }
			}
		}
	}
	option = {
		name = EVTOPTB_WoL_7042  # Condemn
		ai_chance = {
			factor = 100
		}
		piety = 50
	}
}

# Question own faith
character_event = {
	id = WoL.7050
	
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	only_playable = yes
	min_age =  16
	capable_only = yes
	
	desc = {
		text = EVTDESC_WoL_7050
		trigger = {
			OR = {
				is_pagan_religion = no
				is_reformed_pagan_religion = yes
			}
		}
	}
	
	desc = {
		text = EVTDESC_WoL_7050_PAGAN
		trigger = {
			is_pagan_religion = yes
			is_reformed_pagan_religion = no
		}
	}

	trigger = {
		has_focus = focus_theology
		NOT = { has_character_flag = wol_theology_question_gods }
	}
	
	immediate = {
		set_character_flag = wol_theology_question_gods
	}
	
	option = {
		name = EVTOPTA_WoL_7050  # Become Cynical (non-zealous)
		ai_chance = {
			factor = 10
		}
		trigger = {
			NOT = { trait = cynical }
		}
		if = {
			limit = {
				NOT = { trait = zealous }
			}
			add_trait = cynical
		}
		if = {
			limit = {
				trait = zealous
			}
			remove_trait = zealous
		}
	}
	option = {
		name = EVTOPTB_WoL_7050  # Stay true to faith
		ai_chance = {
			factor = 10
		}
		piety = 100
		random = {
			chance = 30
			add_trait = depressed
			character_event = { id = 38288 } # Notify depressed
		}
	}
	option = {
		name = EVTOPTC_WoL_7050  # Become zealous
		ai_chance = {
			factor = 100
		}
		trigger = {
			NOT = { trait = zealous }
		}
		if = {
			limit = {
				NOT = { trait = cynical }
			}
			add_trait = zealous
		}
		if = {
			limit = {
				trait = cynical
			}
			remove_trait = cynical
		}
	}
}

# Embrace heresy?
character_event = {
	id = WoL.7060
	desc = EVTDESC_WoL_7060
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	only_playable = yes
	min_age =  16
	capable_only = yes

	trigger = {
		mercenary = no
		has_focus = focus_theology
		trait = zealous
		has_heresies = yes
		is_heretic = no
		is_priest = no
		controls_religion = no
		holy_order = no
		can_change_religion = yes
		NOT = { rightful_religious_head = ROOT }
		NOT = { has_character_flag = wol_theology_heretic }
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.5
			higher_tier_than = DUKE
		}
		modifier = {
			factor = 0.5
			higher_tier_than = KING
		}
	}
	
	immediate = {
		set_character_flag = wol_theology_heretic
	}
	
	option = {
		name = EVTOPTA_WoL_7060  # Settle firmly into orthodoxy
		ai_chance = {
			factor = 40
		}
		piety = 30
	}
	option = {
		name = EVTOPTB_WoL_7060  # Take middle ground
		ai_chance = {
			factor = 50
		}
		remove_trait = zealous
	}
	option = {
		name = EVTOPTC_WoL_7060  # Become heretic
		ai_chance = {
			factor = 10
		}
		piety = 100
		if = {
			limit = { ai = no }
			religion_authority = { modifier = ruler_converted_from }
			become_heretic = yes
			religion_authority = { modifier = ruler_converted_to }
			hidden_tooltip = {
				any_courtier = {
					limit = {
						is_adult = no
						is_ruler = no
						dynasty = ROOT
					}
					religion = ROOT
				}
			}
			set_character_flag = converted_religion
		}
		if = {
			limit = { ai = yes }
			character_event = { id = WoL.7061 }
		}
		if = {
			limit = {
				NOT = { has_character_modifier = religious_studies }
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
			}
			add_character_modifier = {
				name = religious_studies
				duration = -1
			}
			set_character_flag = religious_studies_timer
		}
		if = {
			limit = {
				has_character_modifier = religious_studies
				NOT = { has_character_modifier = religious_philosopher }
				NOT = { trait = theologian }
				had_character_flag = { flag = religious_studies_timer days = 1800 }
			}
			clr_character_flag = religious_studies_timer
			remove_character_modifier = religious_studies
			add_character_modifier = {
				name = religious_philosopher
				duration = -1
			}
		}
	}
}

# Bounce event
character_event = {
	id = WoL.7061
	desc = EVTDESC_WoL_7060
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		religion_authority = { modifier = ruler_converted_from }
		heresy_character_effect = yes
	}
	
	option = {
		name = OK
		religion_authority = { modifier = ruler_converted_to }
		hidden_tooltip = {
			any_courtier = {
				limit = {
					is_adult = no
					is_ruler = no
					dynasty = ROOT
				}
				religion = ROOT
			}
		}
		set_character_flag = converted_religion
	}
}

# Embrace theologian lifestyle?
character_event = {
	id = WoL.7070
	desc = EVTDESC_WoL_7070
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	only_playable = yes
	min_age =  16
	capable_only = yes

	trigger = {
		has_focus = focus_theology
		NOT = { lifestyle_traits = 1 }
		has_character_modifier = religious_philosopher
		NOT = { has_character_flag = wol_theology_lifestyle_question }
	}
	
	immediate = {
		set_character_flag = wol_theology_lifestyle_question
	}
	
	option = {
		name = EVTOPTA_WoL_7070  # Become theologian
		ai_chance = {
			factor = 100
		}
		trigger = {
			NOT = { trait = cynical }
		}
		remove_character_modifier = religious_philosopher
		add_trait = theologian
		if = {
			limit = { has_nickname = no }
			random_list = {
				10 = {
					give_nickname = nick_the_pious
				}
				10 = {
					give_nickname = nick_the_holy
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { religion_group = christian }
					}
					give_nickname = nick_the_apostle
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { religion_group = christian }
					}
					give_nickname = nick_the_confessor
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { religion_group = christian }
					}
					give_nickname = nick_the_blessed
				}
			}
		}
	}
	option = {
		name = EVTOPTB_WoL_7070  # Become cynical theologian
		ai_chance = {
			factor = 100
		}
		trigger = {
			trait = cynical
		}
		remove_character_modifier = religious_philosopher
		add_trait = theologian
		if = {
			limit = { has_nickname = no }
			random_list = {
				10 = {
					give_nickname = nick_the_scholar
				}
				10 = {
					give_nickname = nick_the_wise
				}
			}
		}
	}
	option = {
		name = EVTOPTC_WoL_7070  # There are other paths in life
		ai_chance = {
			factor = 0
		}
		if = {
			limit = { has_nickname = no }
			random_list = {
				10 = {
					give_nickname = nick_the_scholar
				}
				10 = {
					give_nickname = nick_the_wise
				}
			}
		}
	}
}

# Lose Stressed/Depressed
character_event = {
	id = WoL.7080
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	only_playable = yes
	capable_only = yes
	
	desc = {
		text = EVTDESC_WoL_7080
		trigger = {
			NOR = {
				is_pagan_religion = yes
				religion_group = muslim
				has_dharmic_religion_trigger = yes
			}
		}
	}
	desc = {
		text = EVTDESC_WoL_7080_PAGAN
		trigger = { is_pagan_religion = yes }
	}
	desc = {
		text = EVTDESC_WoL_7080_MUSLIM
		trigger = { religion_group = muslim }
	}
	desc = {
		text = EVTDESC_WoL_7080_INDIAN
		trigger = { has_dharmic_religion_trigger = yes }
	}

	trigger = {
		has_focus = focus_theology
		is_adult = yes
		OR = {
			trait = stressed
			trait = depressed
		}
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 0.25
			trait = cynical
		}
		modifier = {
			factor = 2.0
			trait = zealous
		}
	}
	
	option = {
		name = EVTOPTA_WoL_7080
		if = {
			limit = { trait = stressed }
			remove_trait = stressed
		}
		if = {
			limit = { trait = depressed }
			remove_trait = depressed
		}
	}
}

# Meditation/Prayer in Seclusion - Go into hiding for a week.
# Lose Drunkard, Gluttonous and Lustful and possible gain Temperate and Chaste (depending on religion).
# Tiny Chance of restored eyesight or cured illness.
character_event = {
	id = WoL.7090
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	only_playable = yes
	capable_only = yes
	prisoner = no
	
	desc = EVTDESC_WoL_7090

	trigger = {
		has_focus = focus_theology
		is_adult = yes
		NOT = { is_inaccessible_trigger = yes }
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 0.25
			trait = cynical
		}
		modifier = {
			factor = 2.0
			trait = zealous
		}
	}
	
	option = {
		name = EVTOPTA_WoL_7090
		add_trait = in_hiding
		add_character_modifier = {
			name = do_not_disturb
			days = 30
			hidden = yes
		}
		set_character_flag = in_religious_seclusion
		character_event = { id = WoL.7092 days = 7 random = 14 }
	}
	
	option = {
		name = EVTOPTB_WoL_7090
	}
}

# Hidden event - clear out the hiding status no matter what.
character_event = {
	id = WoL.7092
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		remove_do_not_disturb_effect = yes
		clr_character_flag = in_religious_seclusion
		end_inaccessibility_effect = yes #removes in_hiding or in_seclusion
		
		character_event = { id = WoL.7091 }
	}
}

character_event = {
	id = WoL.7091
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	capable_only = yes
	prisoner = no
	
	desc = {
		text = EVTDESC_WoL_7091
		trigger = {
			NOR = {
				trait = lunatic
				is_pagan_religion = yes
				has_dharmic_religion_trigger = yes
			}
		}
	}
	desc = {
		text = EVTDESC_WoL_7091_PAGAN
		trigger = {
			NOT = {
				trait = lunatic				
			}
			is_pagan_religion = yes
		}
	}
	desc = {
		text = EVTDESC_WoL_7091_INDIAN
		trigger = {
			NOT = {
				trait = lunatic				
			}
			has_dharmic_religion_trigger = yes
		}
	}
	desc = {
		text = EVTDESC_WoL_7091_LUNATIC
		trigger = {
			trait = lunatic
		}
	}

	trigger = {
		NOT = { trait = on_pilgrimage }
		NOT = { trait = on_hajj }
	}
	
	option = {
		name = EVTOPT_WoL_7091_DRUNKARD
		ai_chance = {
			factor = 100
		}
		trigger = {
			trait = drunkard
		}
		remove_trait = drunkard
		
		if = {
			limit = {
				NOT = { trait = temperate }
				NOT = { trait = gluttonous }
			}
			random = {
				chance = 20
				add_trait = temperate
				character_event = { id = 38276 } # Notify Temperate
			}
		}
		if = {
			limit = {
				NOT = { trait = diligent }
				NOT = { trait = slothful }
			}
			random = {
				chance = 10
				add_trait = diligent
				character_event = { id = 38256 } # Notify Diligent
			}
		}
	}
	option = {
		name = EVTOPT_WoL_7091_GLUTTON
		ai_chance = {
			factor = 100
		}
		trigger = {
			trait = gluttonous
		}
		remove_trait = gluttonous
		if = {
			limit = { NOT = { trait = temperate } }
			random = {
				chance = 20
				add_trait = temperate
				character_event = { id = 38276 } # Notify Temperate
			}
		}
		if = {
			limit = {
				NOT = { trait = diligent }
				NOT = { trait = slothful }
			}
			random = {
				chance = 10
				add_trait = diligent
				character_event = { id = 38256 } # Notify Diligent
			}
		}
	}
	option = {
		name = EVTOPT_WoL_7091_SLOTHFUL
		ai_chance = {
			factor = 100
		}
		trigger = {
			trait = slothful
		}
		remove_trait = slothful
		if = {
			limit = {
				NOT = { trait = temperate }
				NOT = { trait = gluttonous }
			}
			random = {
				chance = 20
				add_trait = temperate
				character_event = { id = 38276 } # Notify Temperate
			}
		}
		if = {
			limit = { NOT = { trait = diligent } }
			random = {
				chance = 10
				add_trait = diligent
				character_event = { id = 38256 } # Notify Diligent
			}
		}
	}
	option = {
		name = EVTOPT_WoL_7091_LUSTFUL
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				trait = hedonist
			}
		}
		trigger = {
			trait = lustful
			religion_group = christian
		}
		remove_trait = lustful
		piety = 100
		random = {
			chance = 10
			add_trait = chaste
			character_event = { id = 38274 } # Notify Chaste
		}
		if = {
			limit = {
				NOT = { trait = temperate }
				NOT = { trait = gluttonous }
			}
			random = {
				chance = 20
				add_trait = temperate
				character_event = { id = 38276 } # Notify Temperate
			}
		}
		if = {
			limit = {
				NOT = { trait = diligent }
				NOT = { trait = slothful }
			}
			random = {
				chance = 10
				add_trait = diligent
				character_event = { id = 38256 } # Notify Diligent
			}
		}
	}
	option = {
		name = EVTOPT_WoL_7091_BLIND
		trigger = {
			trait = blinded
			NOT = {
				has_game_rule = {
					name = supernatural_events
					value = off
				}
			}
			random = 90
		}
		ai_chance = {
			factor = 1000
		}
		remove_trait = blinded
	}
	
	option = {
		name = EVTOPT_WoL_7091_POX
		trigger = {
			trait = syphilitic
			random = 75
		}
		ai_chance = {
			factor = 1000
		}
		remove_trait = syphilitic
	}
	
	option = {
		name = EVTOPT_WoL_7091_LUNATIC
		trigger = {
			trait = lunatic
			NOT = { trait = possessed }
		}
		ai_chance = {
			factor = 100
		}
		
		random = {
			chance = 50
			remove_trait = lunatic
			character_event = { id = 38309 } # Notify Lunatic lost
		}
		
		random = {
			chance = 50
			add_trait = possessed
			character_event = { id = 38315 } # Notify Possessed
		}
	}
	
	option = {
		name = EVTOPT_WoL_7091_LEPER
		trigger = {
			trait = leper
			NOT = {
				has_game_rule = {
					name = supernatural_events
					value = off
				}
			}
			random = 90
		}
		ai_chance = {
			factor = 1000
		}
		remove_trait = leper
	}
	
	option = {
		name = EVTOPT_WoL_7091_CHASTE
		trigger = {
			trait = chaste
			NOR = {
				religion_group = christian
				has_dharmic_religion_trigger = yes
			}
		}
		ai_chance = {
			factor = 100
		}
		remove_trait = chaste
		
		piety = 50
		random = {
			chance = 50
			add_trait = lustful
			character_event = { id = 38272 } # Notify Lustful
		}
	}
	
	option = {
		name = EVTOPT_WoL_7091
		ai_chance = {
			factor = 1
		}
		piety = 100
		if = {
			limit = {
				NOT = { trait = temperate }
				NOT = { trait = gluttonous }
			}
			random = {
				chance = 20
				add_trait = temperate
				character_event = { id = 38276 } # Notify Temperate
			}
		}
		if = {
			limit = {
				NOT = { trait = diligent }
				NOT = { trait = slothful }
			}
			random = {
				chance = 10
				add_trait = diligent
				character_event = { id = 38256 } # Notify Diligent
			}
		}
	}
}
