#####################################################################
#
# VIETmisc #10000-10999 reserved
#
# 10000-10099 Fraticelli
#
#####################################################################

namespace = VIETmisc

#################################################
# FRATICELLI
#################################################


# Choose a Fraticelli Branch - fired from on_actions
narrative_event = {
	id = VIETmisc.10000
	title = VIETmisc.10000.name
	desc = VIETmisc.10000.desc
	picture = GFX_evt_monastery_monks

	min_age = 16
	religion = fraticelli
	capable_only = yes
	prisoner = no
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_character_modifier = VIET_fraticelli_relaxati }
		NOT = { has_character_modifier = VIET_fraticelli_zelanti }
	}
	
	option = { #relaxati
		name = "VIETmisc.10000.a"
		custom_tooltip = { text = relaxati_explaination }
		add_character_modifier = {
			name = VIET_fraticelli_relaxati
			duration = -1
		}
	}
	option = { #zelanti
		name = "VIETmisc.10000.b"
		custom_tooltip = { text = zelanti_explaination }
		add_character_modifier = {
			name = VIET_fraticelli_zelanti
			duration = -1
		}
	}
}


# Switch to relaxati
narrative_event = {
	id = VIETmisc.10001
	title = VIETmisc.10001.name
	desc = VIETmisc.10001.desc
	picture = GFX_evt_heretic
	
	is_triggered_only = yes
	
	option = { #relaxati
		name = "VIETmisc.10001.a"
		remove_character_modifier = VIET_fraticelli_zelanti
		add_character_modifier = {
			name = VIET_fraticelli_relaxati
			duration = -1
		}
	}
}


# Switch to zelanti
narrative_event = {
	id = VIETmisc.10002
	title = VIETmisc.10002.name
	desc = VIETmisc.10002.desc
	picture = GFX_evt_heretic
	
	is_triggered_only = yes
	
	option = { #zelanti
		name = "VIETmisc.10002.a"
		remove_character_modifier = VIET_fraticelli_relaxati
		add_character_modifier = {
			name = VIET_fraticelli_zelanti
			duration = -1
		}
	}
}


# Clean out zelanti and relaxati modifiers if no longer Fraticelli or a ruler - fired from on_actions
character_event = {
	id = VIETmisc.10003
	#desc = VIETmisc.10003.desc

	hide_window = yes
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			NOT = { religion = fraticelli }
			is_ruler = no
		}
		OR = {
			has_character_modifier = VIET_fraticelli_relaxati
			has_character_modifier = VIET_fraticelli_zelanti
		}
	}
	
	immediate = {
		remove_character_modifier = VIET_fraticelli_relaxati
		remove_character_modifier = VIET_fraticelli_zelanti
	}
}


# Fraticelli clergy loses bad traits
character_event = {
	id = VIETmisc.10004
	#desc = VIETmisc.10004.desc #not needed in hidden event

	hide_window = yes

	min_age = 16
	capable_only = yes
	prisoner = no
	only_men = yes
	religion = fraticelli
	ai = yes

	trigger = {
		OR = {
			trait = monk
			trait = nun
			is_theocracy = yes
		}
		OR = {
			trait = gluttonous
			trait = greedy
		}
	}
	
	mean_time_to_happen = {
		months = 250
		modifier = {
			factor = 0.95
			trait = charitable
		}
		modifier = {
			factor = 0.95
			trait = temperate
		}
		modifier = {
			factor = 0.75
			trait = zealous
		}
		modifier = {
			factor = 0.95
			trait = kind
		}
		modifier = {
			factor = 1.1
			trait = cynical
		}
		modifier = {
			factor = 1.1
			trait = slothful
		}
		modifier = {
			factor = 1.1
			trait = arbitrary
		}
		modifier = {
			factor = 1.1
			trait = cruel
		}
		modifier = {
			factor = 1.1
			AND = {
				trait = gluttonous
				trait = greedy
			}
		}
	}
	
	immediate = {
		if = {
			limit = {
				trait = greedy
			}
			remove_trait = greedy
		}
		if = {
			limit = {
				trait = gluttonous
			}
			remove_trait = gluttonous
		}
	}
}


# Ascetic becomes wandering hermit
character_event = {
	id = VIETmisc.10005
	desc = VIETmisc.10005.desc
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion

	only_rulers = yes

	trigger = {
		OR = {
			religion = fraticelli
			religion = insular # Monasticism and radical asceticism were prominent
			religion = pelagianism
			religion_group = indian_group # Jain nudists, Buddhist monks, etc.
			has_character_modifier = jain_naked_ascetic
			has_character_modifier = hindu_ascetic
			has_character_modifier = buddhist_ascetic
			is_ascetic_trigger = yes
		}
		NOT = {
			any_courtier = {
				trait = wandering_hermit
			}
		}
		any_courtier = {
			is_adult = yes
			OR = {
				religion = fraticelli
				religion = insular # Monasticism and radical asceticism were prominent
				religion = pelagianism
				religion_group = indian_group # Jain nudists, Buddhist monks, etc.
				has_character_modifier = jain_naked_ascetic
				has_character_modifier = hindu_ascetic
				has_character_modifier = buddhist_ascetic
				is_ascetic_trigger = yes
			}
			learning = 8
			OR = {
				trait = monk
				trait = nun
			}
			OR = {
				trait = zealous
				trait = temperate
				trait = charitable
				trait = diligent
				trait = scholar
				trait = gregarious
			}
			NOT = { trait = wandering_hermit }
			NOT = { trait = greedy }
			NOT = { trait = gluttonous }
			NOT = { trait = slothful }
		}
	}
	
	mean_time_to_happen = {
		months = 777
		modifier = {
			factor = 1.1
			trait = cynical
		}
		modifier = {
			factor = 0.9
			trait = zealous
		}
		modifier = {
			factor = 1.1
			trait = greedy
		}
		modifier = {
			factor = 0.9
			trait = charitable
		}
		modifier = {
			factor = 1.1
			trait = gluttonous
		}
		modifier = {
			factor = 0.9
			trait = temperate
		}
		modifier = {
			factor = 1.1
			trait = slothful
		}
		modifier = {
			factor = 0.9
			trait = diligent
		}
		modifier = {
			factor = 1.1
			trait = shy
		}
		modifier = {
			factor = 0.9
			trait = gregarious
		}
		modifier = {
			factor = 1.1
			trait = proud
		}
		modifier = {
			factor = 0.9
			trait = humble
		}
	}
	
	option = { #ok
		name = "VIETmisc.10005.a"
		random_courtier = {
			limit = {
				learning = 8
				is_adult = yes
				OR = {
					religion = fraticelli
					religion = insular # Monasticism and radical asceticism were prominent
					religion = pelagianism
					religion_group = indian_group # Jain nudists, Buddhist monks, etc.
					has_character_modifier = jain_naked_ascetic
					has_character_modifier = hindu_ascetic
					has_character_modifier = buddhist_ascetic
					is_ascetic_trigger = yes
				}
				OR = {
					trait = monk
					trait = nun
				}
				OR = {
					trait = zealous
					trait = temperate
					trait = charitable
					trait = diligent
					trait = scholar
					trait = gregarious
				}
				NOT = { trait = wandering_hermit }
				NOT = { trait = greedy }
				NOT = { trait = gluttonous }
				NOT = { trait = slothful }
			}
			add_trait = wandering_hermit
			# character_event = { id = 0 tooltip = "" }
		}
	}
}


# Become Secular Franciscan
narrative_event = {
	id = VIETmisc.10006
	title = VIETmisc.10006.name
	desc = VIETmisc.10006.desc
	picture = GFX_evt_monastery_monks
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = { #ok
		name = "VIETmisc.10006.a"
		add_trait = secular_franciscan
	}
}

#VIETmisc.10050-10053 Taken

