#######################################
#
# ANCIENT RELIGIONS
# - Revival of the Hellenic religion
#
# Event ID hellenic.0 - hellenic.109 reserved
#
#######################################

# Written by Jon Severinsson
# and Adam Chevalier

namespace = hellenic

#######################################
#
# - A Philosopher Joins the Court
# 		hellenic.0 - hellenic.35
#
#######################################

# Philosopher approaches the Emperor as the realm crumbles
# [on_yearly_pulse]
character_event = {
	id = hellenic.0
	desc = hellenic.0.desc
	picture = GFX_evt_emissary_byzantine
	border = GFX_event_normal_frame_religion

	min_age = 16
	capable_only = yes
	prisoner = no
	has_dlc = "The Old Gods"

	is_triggered_only = yes

	trigger = {
		any_realm_province = {
			province_id = 541
		}

		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
			has_landed_title = e_latin_empire
		}

		NOR = {
			realm_size = 230 						# empire is in big trouble, like at the alexiad start date
			has_character_flag = ancrel_philosopher # hasn't had the event already
			religion_group = pagan_group 			# is still christian
			any_courtier = {
				has_character_flag = ancrel_special_priest # don't already have the priest in your court
			}
		}

		OR = {
			has_game_rule = {
				name = acr_ai_revival
				value = on
			}
			ai = no
		}
	}

	immediate = {
		set_character_flag = ancrel_philosopher
	}

	weight_multiplier = {
		days = 360
		modifier = {
			factor = 0.1
			has_game_rule = {
				name = acr_ai_revival
				value = reduced
			}
			ai = yes
		}
		modifier = {
			factor = 2
			NOT = { religion_authority = 0.5 }
		}
		modifier = {
			factor = 10
			has_global_flag = ancrel_debug
			ai = no
		}
		modifier = {
			factor = 2
			war = yes
		}
		modifier = {
			factor = 5
			is_primary_war_defender = yes
		}
	}

	option = { # allow the philosopher to enter the court
		name = hellenic.0.a
		custom_tooltip = {
			text = hellenic.0.a.tt
			create_character = {
				random_traits = no
				dynasty = none
				religion = ROOT
				culture = greek
				female = no
				age = 31
				attributes = {
					martial = 4
					diplomacy = 8
					stewardship = 6
					intrigue = 8
					learning = 12
				}
				health = 6
				fertility = 0.5
				trait = mastermind_theologian
				trait = proud
				trait = cynical
				trait = scholar
				trait = temperate
				trait = genius
				trait = gregarious
				trait = stoic # most popular school throughout history
			}
			new_character = {
				opinion = {
					modifier = opinion_patron
					who = ROOT
					years = 20
				}
				if = {
					limit = { has_global_flag = is_cybrixkhan_immersion_save }
					give_nickname = nick_VIET_plethon
					add_character_modifier = {
						name = VIET_is_plethon_modifier
						duration = -1
					}
				}
				else = { give_nickname = nick_the_stammerer_greek }
				set_character_flag = ancrel_special_priest
			}
		}
	}

	option = { # deny the request
		name = hellenic.0.b
		custom_tooltip = { text = hellenic.0.b.tt }
	}
}

# seek the Emperor's support to become Hypatos Philosophon (philosopher)
character_event = {
	id = hellenic.1
	hide_window = yes

	min_age = 16
	capable_only = yes
	prisoner = no

	is_triggered_only = yes

	trigger = {
		had_character_flag = { flag = ancrel_special_priest days = 1825 }
		is_inaccessible_trigger = no
		NOR = {
			has_character_flag = ancrel_request_support
			has_minor_title = title_hypatos_philosophon
		}
		liege = {
			is_inaccessible_or_incapable_trigger = no
			OR = {
				has_landed_title = e_byzantium
				has_landed_title = e_roman_empire
				has_landed_title = e_latin_empire
			}
		}
	}

	immediate = {
		set_character_flag = ancrel_request_support
		liege = { character_event = { id = hellenic.2 days = 0 } }
	}

	weight_multiplier = {
		days = 7
		modifier = {
			factor = 5
			had_character_flag = { flag = ancrel_special_priest days = 2000 }
		}		
	}
}

# the philosopher seeks the Emperor's support to become Hypatos Philosophon (emperor)
character_event = {
	id = hellenic.2
	desc = hellenic.2.desc
	picture = GFX_evt_emissary_byzantine
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { # support the philosopher's bid for the office of Hypatos Philosophon
		name = hellenic.2.a

		FROM = {
			set_special_character_title = title_hypatos_philosophon
			prestige = 100
			opinion = {
				modifier = ancrel_honored_me
				who = ROOT
				years = 5
			}
			set_character_flag = ancrel_hypatos
		}
	}

	option = { # stay out of it, ending the chain
		name = hellenic.2.b
		FROM = {
			prestige = -100
			opinion = {
				modifier = ancrel_dissapointed
				who = ROOT
				years = 5
			}

			set_character_flag = ancrel_block_philosopher
		}
	}
}

# priest vassal is upset that the philosopher wants to implement a Platonic curriculum (philosopher)
character_event = {
	id = hellenic.3
	hide_window = yes

	min_age = 16
	capable_only = yes
	prisoner = no
	has_character_flag = ancrel_special_priest

	trigger = {
		had_character_flag = { flag = ancrel_hypatos days = 365 }
		NOR = { 
			is_inaccessible_trigger = yes
			has_character_flag = ancrel_new_curriculum
		}
		liege = {
			is_inaccessible_or_incapable_trigger = no
			OR = {
				has_landed_title = e_byzantium
				has_landed_title = e_roman_empire
				has_landed_title = e_latin_empire
			}
		}
	}

	mean_time_to_happen = {
		days = 7
	}

	immediate = {
		set_character_flag = ancrel_new_curriculum
		liege = {
			random_vassal = {
				limit = { is_theocracy = yes }

				character_event = { id = hellenic.4 days = 0}
			}
		}
	}
}

# platonic curriculum (priest)
character_event = {
	id = hellenic.4
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		liege = {
			character_event = { id = hellenic.5 days = 0 }
		}
	}
}

# platonic curriculum (emperor)
character_event = {
	id = hellenic.5
	desc = hellenic.5.desc
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { # support your hypatos
		name = hellenic.5.a
		piety = -100
		add_character_modifier = { name = acr_shielded_heretic duration = 1825 }
		capital_scope = {
			add_province_modifier = { name = ancrel_platonic_curriculum duration = 1825 }
		}

		FROMFROM = {
			add_friend = ROOT
			set_character_flag = ancrel_hypatos_support
		}

	}

	option = { # demand the hypatos make a public profession of faith
		name = hellenic.5.b
		piety = 100
		add_character_modifier = { name = acr_sided_with_church duration = 1825 }

		FROMFROM = {
			piety = -200
			prestige = -200
			set_character_flag = ancrel_block_philosopher
		}
	}
}

# philosopher has a research project (philosopher)
character_event = {
	id = hellenic.6
	hide_window = yes

	prisoner = no
	has_character_flag = ancrel_special_priest

	is_triggered_only = yes

	trigger = {
		NOR = { 
			is_inaccessible_trigger = yes
			has_character_flag = ancrel_block_philosopher
		}
		liege = {
			is_inaccessible_or_incapable_trigger = no
			religion_openly_in_hellenic_subgroup_trigger = no
			OR = {
				has_landed_title = e_byzantium
				has_landed_title = e_roman_empire
				has_landed_title = e_latin_empire
			}
		}
	}

	weight_multiplier = {
		days = 7
		modifier = {
			factor = 5
			NOT = {
				has_character_flag = ancrel_research_project
			}
		}
	}

	immediate = {
		liege = {
			character_event = { id = hellenic.7 }
		}
	}
}

# philosopher has a research project (emperor)
character_event = {
	id = hellenic.7
	desc = hellenic.7.desc
	picture = GFX_evt_scientist
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = { # support the research project
		name = hellenic.7.a
		scaled_wealth = -0.05
		FROM = {
			set_character_flag = ancrel_research_project
			set_character_flag = do_not_disturb
		}
		custom_tooltip = {
			text = hellenic.7.a.tt
			hidden_tooltip = {
				random_list = {
					25 = { # military tech
						modifier = {
							factor = 0.2
							has_character_flag = ancrel_military_research
						}
						character_event = { id = hellenic.8 days = 120 }
					}
					25 = { # economy tech
						modifier = {
							factor = 0.2
							has_character_flag = ancrel_economy_research
						}
						character_event = { id = hellenic.9 days = 120 }
					}
					25 = { # culture tech
						modifier = {
							factor = 0.2
							has_character_flag = ancrel_culture_research
						}
						character_event = { id = hellenic.10 days = 120 }
					}
				}
			}
		}
	}

	option = { # do not support the project
		name = hellenic.7.b
	}
}

# research project (military)
character_event = {
	id = hellenic.8
	desc = hellenic.8.desc
	picture = GFX_evt_scientist
	border = GFX_event_normal_frame_war

	show_from_from = yes
	
	is_triggered_only = yes

	option = {
		name = ancrel.fantastic
		military_techpoints = 50
		FROMFROM = {
			clr_character_flag = do_not_disturb
			set_character_flag = ancrel_military_research
		}
	}
}

# research project (economic)
character_event = {
	id = hellenic.9
	desc = hellenic.9.desc
	picture = GFX_evt_scientist
	border = GFX_event_normal_frame_economy

	show_from_from = yes

	is_triggered_only = yes

	option = {
		name = ancrel.fantastic
		economy_techpoints = 50
		FROMFROM = {
			clr_character_flag = do_not_disturb
			set_character_flag = ancrel_economy_research
		}
	}
}

# research project (cultural)
character_event = {
	id = hellenic.10
	desc = hellenic.10.desc
	picture = GFX_evt_scientist
	border = GFX_event_normal_frame_religion

	show_from_from = yes

	is_triggered_only = yes

	option = {
		name = ancrel.fantastic
		culture_techpoints = 50
		FROMFROM = {
			clr_character_flag = do_not_disturb
			set_character_flag = ancrel_culture_research
		}
	}
}

# philosopher proposes a chronicle (philosopher)
character_event = {
	id = hellenic.11
	hide_window = yes

	has_character_flag = ancrel_special_priest
	prisoner = yes

	is_triggered_only = yes

	trigger = {
		NOR = {
			has_character_flag = ancrel_chronicle
			is_inaccessible_trigger = yes
		}
		liege = {
			is_inaccessible_or_incapable_trigger = no
			OR = {
				has_landed_title = e_byzantium
				has_landed_title = e_roman_empire
				has_landed_title = e_latin_empire
			}
			NOT = {
				has_character_modifier = ancrel_imperial_chronicle
			}
		}
	}

	immediate = {
		liege = {
			character_event = {	id = hellenic.12 }
		}
	}
}

# philosopher proposes a chronicle (emperor)
character_event = {
	id = hellenic.12
	desc = hellenic.12.desc
	picture = GFX_evt_library
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = { # authorize the chronicle
		name = hellenic.12.a
		scaled_wealth = 0.1
		character_event = { id = hellenic.13 days = 90 tooltip = hellenic.13.tt }
		FROM = {
			set_character_flag = do_not_disturb
			set_character_flag = ancrel_chronicle
		}
	}
}

# philosopher completes chronicle (emperor)
character_event = {
	id = hellenic.13
	desc = hellenic.13.desc
	picture = GFX_evt_library
	border = GFX_event_normal_frame_diplomacy
	show_from_from = yes

	is_triggered_only = yes

	option = {
		name = hellenic.13.a
		add_character_modifier = { name = ancrel_imperial_chronicle duration = -1 }
		FROMFROM = {
			clr_character_flag = do_not_disturb
		}
	}
}

# philosopher offers to reorder the beaurocracy (philosopher)
character_event = {
	id = hellenic.14
	hide_window = yes

	has_character_flag = ancrel_special_priest
	prisoner = no

	is_triggered_only = yes

	trigger = {
		NOR = {
			has_character_flag = ancrel_court
			is_inaccessible_trigger = yes
			has_character_flag = ancrel_block_philosopher
		}
		liege = {
			is_inaccessible_or_incapable_trigger = no
			OR = {
				has_landed_title = e_byzantium
				has_landed_title = e_roman_empire
				has_landed_title = e_latin_empire
			}
			NOT = {
				has_character_modifier = ancrel_streamlined_court
			}
		}
	}

	immediate = {
		liege = {
			character_event = { id = hellenic.15 days = 0 }
		}
	}
}

# philosopher offers to reorder the beaurocracy (emperor)
character_event = {
	id = hellenic.15
	desc = hellenic.15.desc
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes

	option = { # exert your influence to back the philosopher's plans
		name = hellenic.15.a
		prestige = -200
		character_event = { id = hellenic.16 days = 90 tooltip = hellenic.16.tt }
		FROM = {
			set_character_flag = do_not_disturb
			set_character_flag = ancrel_court
		}
	}

	option = { # conserve your influence
		name = hellenic.15.b
	}
}

# philosopher finishes reordering the beaurocracy (emperor)
character_event = {
	id = hellenic.16
	desc = hellenic.16.desc
	picture = GFX_evt_council
	border = GFX_event_normal_frame_economy
	show_from_from = yes

	is_triggered_only = yes

	option = {
		name = hellenic.16.a
		add_character_modifier = { name = ancrel_streamlined_court duration = -1 }
		FROMFROM = {
			clr_character_flag = do_not_disturb
		}
	}
}

# philosopher has sage advice about a rivalry (philosopher)
character_event = {
	id = hellenic.17
	hide_window = yes

	has_character_flag = ancrel_special_priest
	prisoner = no

	is_triggered_only = yes

	trigger = {
		NOR = {
			is_inaccessible_trigger = yes
			has_character_flag = ancrel_block_philosopher
		}
		liege = {
			is_inaccessible_or_incapable_trigger = no
			OR = {
				has_landed_title = e_byzantium
				has_landed_title = e_roman_empire
				has_landed_title = e_latin_empire
			}
			num_of_rivals = 1
		}
	}

	immediate = {
		set_character_flag = ancrel_sage_advice
		liege = {
			random_rival = {
				character_event = { id = hellenic.18 }
			}
		}
	}

	weight_multiplier = {
		days = 60
		modifier = {
			factor = 3
			NOT = {
				has_character_flag = ancrel_sage_advice
			}
		}
	}
}

# philosopher has sage advice about a rivalry (rival)
character_event = {
	id = hellenic.18
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		FROM = {
			liege = {
				character_event = { id = hellenic.19 days = 0 }
			}
		}
	}
}

# philosopher has sage advice about a rivalry (emperor)
character_event = {
	id = hellenic.19
	desc = hellenic.19.desc
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy
	show_from_from = yes

	is_triggered_only = yes

	option = { # take the hypatos' advice
		name = hellenic.19.a

		custom_tooltip = {
			text = hellenic.20.tt
			hidden_tooltip = {
				FROM = {
					character_event = { id = hellenic.20 days = 0 }
				}
			}
		}

		FROMFROM = {
			opinion = {
				modifier = ancrel_pleased
				who = ROOT
				years = 1
			}
		}
	}

	option = { # ignore the hypatos' advice
		name = hellenic.19.b
		FROMFROM = {
			opinion = {
				modifier = ancrel_dissapointed
				who = ROOT
				years = 1
			}
		}
	}
}

# emperor comes to a rival with words of wisdom (rival)
character_event = {
	id = hellenic.20
	desc = hellenic.20.desc
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = { # listen to FROM's words and end the rivalry
		name = hellenic.20.a
		custom_tooltip = {
			text = hellenic.21.tt
			hidden_tooltip = {
				FROM = {
					character_event = { id = hellenic.21 days = 0 }
				}
			}
		}
	}

	option = { # PEACE IS FOR SISSIES!
		name = hellenic.20.b
		custom_tooltip = {
			text = hellenic.22.tt
			hidden_tooltip = {
				FROM = {
					character_event = { id = hellenic.22 days = 0 }
				}
			}
		}
	}
}

# rival accepts overture of peace! (emperor)
character_event = {
	id = hellenic.21
	desc = hellenic.21.desc
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = {
		name = ancrel.fantastic

		remove_rival = FROM
	}
}

# rival rejects overture of peace! (emperor)
character_event = {
	id = hellenic.22
	desc = hellenic.22.desc
	picture = GFX_evt_rival_rulers
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = {
		name = ancrel.bummer
	}
}

# a priest vassal wants you to banish the philospher (philosopher)
character_event = {
	id = hellenic.23
	hide_window = yes

	is_triggered_only = yes

	has_character_flag = ancrel_hypatos_support
	prisoner = no

	trigger = {
		# curriculum has been in place for a couple years
		had_character_flag = { flag = ancrel_hypatos_support days = 1095 }
		NOR = {
			has_character_flag = ancrel_angry_priest
			has_character_flag = ancrel_block_philosopher
		}
		liege = {
			is_inaccessible_or_incapable_trigger = no
			religion_openly_in_hellenic_subgroup_trigger = no
			OR = {
				has_landed_title = e_byzantium
				has_landed_title = e_roman_empire
				has_landed_title = e_latin_empire
			}
		}
	}

	immediate = {
		set_character_flag = ancrel_angry_priest
		liege = {
			random_vassal = {
				limit = { is_theocracy = yes }
				character_event = { id = hellenic.24 days = 0 }
			}
		}
	}
}

# a priest vassal wants you to banish the philosopher (priest)
character_event = {
	id = hellenic.24
	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		liege = {
			character_event = { id = hellenic.25 days = 0 }
		}
	}
}

# a priest vassal wants you to banish the philosopher (emperor)
character_event = {
	id = hellenic.25
	desc = hellenic.25.desc
	picture = GFX_evt_hagia_sofia
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { # banish to a life as a monk
		name = hellenic.25.a

		add_character_modifier = { name = acr_sided_with_church days = 1825 }
		piety = 500
		FROMFROM = {
			banish_to_monastery_effect = yes
			clr_character_flag = ancrel_special_priest
			clr_character_flag = ancrel_hypatos_support
			set_character_flag = ancrel_block_philosopher
		}
	}

	option = { # imprison
		name = hellenic.25.b

		add_character_modifier = { name = acr_sided_with_church days = 1825 }
		piety = 250
		FROMFROM = {
			imprison = ROOT
			clr_character_flag = ancrel_special_priest
			clr_character_flag = ancrel_hypatos_support
			set_character_flag = ancrel_block_philosopher
		}
	}

	option = { # confront
		name = hellenic.25.c
		custom_tooltip = {
			text = hellenic.26.tt
			hidden_tooltip = {
				character_event = { id = hellenic.26 days = 0 }
			}
		}
	}

	option = { # blow it off
		name = hellenic.25.d

		piety = -250
		add_character_modifier = { name = acr_shielded_heretic duration = 1825 }
		FROMFROM = {
			set_character_flag = ancrel_ignored_concerns
		}
	}
}

# confront the philosopher (emperor)
character_event = {
	id = hellenic.26
	desc = hellenic.26.desc
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = hellenic.26.a
		custom_tooltip = {
			text = hellenic.27.tt
			hidden_tooltip = {
				long_character_event = { id = hellenic.27 days = 0 }
			}
		}
	}
}

# philosopher confesses to secretly being a pagan (emperor)
long_character_event = {
	id = hellenic.27
	desc = hellenic.27.desc
	picture = GFX_evt_heretic
	border = GFX_event_long_frame_religion

	is_triggered_only = yes

	immediate = {
		FROMFROMFROMFROM = {
			set_secret_religion = hellenic_pagan
			set_character_flag = confessed_secret_religion_to_@ROOT
		}
	}

	option = { # force the philosopher to renounce paganism, sending him to a monastery
		name = hellenic.27.a
		add_character_modifier = { name = acr_sided_with_church days = 1825 }
		piety = 250
		FROMFROMFROMFROM = {
			banish_to_monastery_effect = yes
			clr_character_flag = ancrel_special_priest
			clr_character_flag = ancrel_hypatos_support
			set_character_flag = ancrel_block_philosopher
		}
	}

	option = { # imprison the philosopher
		name = hellenic.27.b
		add_character_modifier = { name = acr_sided_with_church days = 1825 }
		piety = 125
		FROMFROMFROMFROM = {
			imprison = ROOT
			clr_character_flag = ancrel_special_priest
			clr_character_flag = ancrel_hypatos_support
			set_character_flag = ancrel_block_philosopher
		}
	}

	option = { # give the (pagan) philosopher asylum
		name = hellenic.27.c
		piety = -500
		add_character_modifier = { name = acr_shielded_heretic days = 1825 }
		add_trait = sympathy_pagans
		FROMFROMFROMFROM = {
			set_character_flag = ancrel_given_asylum
			#secret pagan
		}
	}
}

# philosopher proposes a return to the old ways (philosopher)
character_event = {
	id = hellenic.28
	hide_window = yes

	has_character_flag = ancrel_angry_priest
	prisoner = no

	trigger = {
		OR = {
			had_character_flag = { flag = ancrel_given_asylum days = 60 }
			had_character_flag = { flag = ancrel_ignored_concerns days = 60 }
		}
		NOR = {
			has_character_flag = ancrel_propose_old_ways
			has_character_flag = ancrel_block_philosopher
			is_inaccessible_trigger = yes
		}
		liege = {
			is_inaccessible_or_incapable_trigger = no
			religion_openly_in_hellenic_subgroup_trigger = no
			OR = {
				has_landed_title = e_byzantium
				has_landed_title = e_roman_empire
				has_landed_title = e_latin_empire
			}
		}
	}

	immediate = {
		set_character_flag = ancrel_propose_old_ways
		liege = {
			long_character_event = { id = hellenic.29 days = 0 }
		}
	}

	mean_time_to_happen = {
		days = 20
	}
}

# philosopher proposes a return to the old ways (emperor)
long_character_event = {
	id = hellenic.29
	desc = hellenic.29.desc
	picture = GFX_evt_throne_room_byzantine
	border = GFX_event_long_frame_religion

	is_triggered_only = yes

	immediate = {
		FROM = {
			set_secret_religion = hellenic_pagan
			set_character_flag = confessed_secret_religion_to_@ROOT
		}
	}

	option = { # take him up on the offer
		name = hellenic.29.a

		religion = hellenic_pagan
		add_trait = sympathy_christendom
		FROM = {
			religion = hellenic_pagan
			add_trait = sympathy_christendom
		}
	}

	option = { # i tolerate your faith, but i cannot follow it
		trigger = {
			FROM = {
				has_character_flag = ancrel_given_asylum
			}
		}
		name = hellenic.29.b
	}

	option = { # agree, but go about it stealthily
		name = hellenic.29.c
		tooltip_info = intrigue
		trigger = {
			intrigue = 10
		}

		set_secret_religion = hellenic_pagan
	}

	option = { # imprison him, if you ignored the priests before
		trigger = {
			FROM = {
				has_character_flag = ancrel_ignored_concerns
			}
		}
		name = hellenic.29.d

		FROM = {
			set_character_flag = ancrel_block_philosopher
			imprison = ROOT
		}
	}
}

# TODO: recall a banished philosopher

#######################################
#
# - Myrmidons
#
#######################################

# Thessalonike is solidly Hellenic, and the Myrmidons are formed!
# (Pope)
# [on_yearly_pulse]
character_event = {
	id = hellenic.50
	hide_window = yes

	is_triggered_only = yes
	
	religion = catholic

	trigger = {
		controls_religion = yes # papas catholicos
		499 = { religion_openly_hellenic_or_reformed_trigger = yes }
		497 = { religion_openly_hellenic_or_reformed_trigger = yes }
		495 = { religion_openly_hellenic_or_reformed_trigger = yes }
		d_myrmidons = { has_holder = no	}
	}

	immediate = {
		set_global_flag = myrmidons_founded
		activate_title = { title = d_myrmidons status = yes }
		hidden_tooltip = {
			create_character = {
				random_traits = yes
				religion = hellenic_pagan
				culture = greek
				dynasty = random
				female = no
				age = 29
				trait = skilled_tactician
				trait = zealous
			}
			new_character = {
				wealth = 100
				prestige = 100
				piety = 50
				d_myrmidons = {
					grant_title = PREV
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = no
					age = 16
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = no
					age = 18
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = no
					age = 18
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = no
					age = 20
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = no
					age = 25
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = no
					age = 26
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = no
					age = 28
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = yes
					age = 16
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hellenic_pagan
					culture = greek
					female = yes
					age = 17
				}	
				any_playable_ruler = {
					limit = { ai = no }

					narrative_event = { id = hellenic.51 }
				}
			}
		}
	}
}

narrative_event = {
	id = hellenic.51
	title = hellenic.51.title
	desc = hellenic.51.desc
	picture = GFX_evt_battle_hellenic_pagan

	is_triggered_only = yes

	option = {
		name = hellenic.51.a
		trigger = { religion_openly_hellenic_or_reformed_trigger = no }
	}

	option = {
		name = hellenic.51.b
		trigger = { religion_openly_hellenic_or_reformed_trigger = yes }
	}
}

#######################################
#
# - Courtier Studies the Classics
#
#######################################

# Studied the classics
character_event = {
	id = hellenic.100
	desc = OK
	picture = GFX_evt_library
	border = GFX_event_normal_frame_religion

	min_age = 16
	max_age = 30
	capable_only = yes
	prisoner = no
	only_men = yes
	has_dlc = "The Old Gods"

	trigger = {
		learning = 6
		is_landed = no
		true_religion_in_hellenic_subgroup_trigger = no
		OR = {
			culture = roman
			culture = italian
			culture = croatian
			culture = serbian
			culture_group = byzantine
		}
		NOT = { has_character_flag = flag_studied_the_classics }
		OR = {
			has_game_rule = {
				name = acr_ai_revival
				value = on
			}
			any_liege = { ai = no }
		}
	}

	mean_time_to_happen = {
		years = 6
		
		#Increase MTTH by 10% every 50 years
		modifier = {
			factor = 1.1
			year = 916
		}
		modifier = {
			factor = 1.1
			year = 966
		}
		modifier = {
			factor = 1.1
			year = 1016
		}
		modifier = {
			factor = 1.1
			year = 1066
		}
		modifier = {
			factor = 1.1
			year = 1116
		}
		modifier = {
			factor = 1.1
			year = 1166
		}
		modifier = {
			factor = 1.25
			trait = content
		}
		modifier = {
			factor = 1.25
			trait = craven
		}
		modifier = {
			factor = 1.25
			trait = slothful
		}
		modifier = {
			factor = 0.8
			learning = 12
		}
		modifier = {
			factor = 0.8
			has_focus = focus_scholarship
		}
		modifier = {
			factor = 0.8
			OR = {
				trait = mastermind_theologian
				trait = scholarly_theologian
				trait = scholar
				trait = mystic
			}
		}
		modifier = {
			factor = 0.8
			OR = {
				trait = zealous
				trait = cynical
			}
		}
		modifier = { # croats and serbs should get it much less
			factor = 5
			culture_group = south_slavic
		}
		modifier = {
			factor = 10
			has_game_rule = {
				name = acr_ai_revival
				value = reduced
			}
		}
	}

	immediate = {
		set_character_flag = flag_studied_the_classics
	}

	option = { # convert
		name = OK
		ai_chance = {
			factor = 15
			modifier = {
				factor = 5
				host = {
					ai = no # Make it 50% chances for the player
					NOT = { has_character_flag = flag_courtier_studied_the_classics }
				}
			}
			modifier = {
				factor = 0.25
				trait = zealous
			}
			modifier = {
				factor = 1.25
				trait = cynical
			}
			modifier = {
				factor = 0.8
				OR = {
					trait = mastermind_theologian
					trait = scholarly_theologian
				}
			}
			modifier = {
				factor = 1.25
				trait = mystic
			}
			modifier = {
				factor = 0.8
				trait = content
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 0.8
				religion_authority = 0.6
			}
			modifier = {
				factor = 1.2
				OR = {
					religion_group = christian
					religion_group = muslim
				}
			}
			modifier = {
				factor = 0.1
				religion_group = jewish_group
			}
			modifier = { # Zeus who?
				factor = 0.1
				religion_group = indian_group
			}
			modifier = {
				factor = 1.5
				religion_group = pagan_group
				NOT = { religion_authority = 0.35 }
			}
		}
		if = {
			limit = { religion_group = christian }
			add_trait = sympathy_christendom
		}
		if = {
			limit = { religion_group = muslim }
			add_trait = sympathy_islam
		}
		if = {
			limit = { religion_group = zoroastrian_group }
			add_trait = sympathy_zoroastrianism
		}
		if = {
			limit = { religion_group = indian_group }
			add_trait = sympathy_indian
		}
		if = {
			limit = { religion_group = jewish_group }
			add_trait = sympathy_judaism
		}

		religion = hellenic_pagan
		
		if = {
			limit = { trait = cynical }
			remove_trait = cynical
		}
		if = {
			limit = { trait = zealous }
			remove_trait = zealous
		}

		hidden_tooltip = {
			host = {
				if = {
					limit = { NOT = { religion = ROOT } }
					character_event = { id = hellenic.101 }
				}
			}
		}
	}

	option = {
		name = OK
		ai_chance = { 
			factor = 85
		}
		piety = 50
	}
}

# Host is notified of conversion
character_event = {
	id = hellenic.101
	desc = hellenic.101.desc
	picture = GFX_evt_roman_temple
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_from = yes
	
	immediate = {
		set_character_flag = flag_courtier_studied_the_classics
	}

	option = {
		name = hellenic.101.a
		trigger = {
			FROM = { is_child_of = ROOT }
		}
		piety = -10
	}
	option = {
		name = hellenic.101.b
		trigger = {
			FROM = { NOT = { is_child_of = ROOT } }
		}
		piety = -10
	}
	option = {
		name = hellenic.101.c
		trigger = {
			OR = {
				trait = arbitrary
				trait = scholar
				trait = mystic
				trait = lunatic
				trait = possessed
		    }
		}
		if = {
			limit = { religion_group = christian }
			add_trait = sympathy_christendom
		}
		if = {
			limit = { religion_group = muslim }
			add_trait = sympathy_islam
		}
		if = {
			limit = { religion_group = zoroastrian_group }
			add_trait = sympathy_zoroastrianism
		}
		if = {
			limit = { religion_group = indian_group }
			add_trait = sympathy_indian
		}
		if = {
			limit = { religion_group = jewish_group }
			add_trait = sympathy_judaism
		}
		set_secret_religion = FROM
	}
}

#######################################
#
# - Journey to the Mani Penninsula
#
#######################################

# 32 page thread on the forum deserves an event ;-)

# Rumors on Mani Penninsula
# Only happens once in a lifetime
character_event = {
	id = hellenic.105
	desc = hellenic.105.desc
	picture = GFX_evt_Whispering_in_ear
	border = GFX_event_normal_frame_religion

	min_age = 16
	capable_only = yes
	only_rulers = yes
	only_independent = yes
	prisoner = no
	has_dlc = "The Old Gods"
	war = no
	
	trigger = {
		completely_controls = c_monemvasia
		
		NOT = { religion_group = pagan_group }
		OR = {
			culture = roman
			culture = italian
			culture_group = byzantine
			culture = sicilian_greek # SWMH
			culture_group = italian_group # SWMH
			culture = greco_arabic # RomanIslam
		}
		NOT = { has_character_flag = flag_mani_penninsula }
		NOT = { has_global_flag = hellenic_reformation }
		OR = {
			has_game_rule = {
				name = acr_ai_revival
				value = on
			}
			ai = no
		}
	}
	
	mean_time_to_happen = {
		months = 400
		modifier = {
			factor = 2.0
			trait = cynical
		}
		modifier = {
			factor = 2.0
			trait = zealous
		}
		modifier = {
			factor = 0.7
			trait = sympathy_pagans
		}
		modifier = {
			factor = 0.5
			has_landed_title = c_monemvasia
		}
		modifier = {
			factor = 0.5
			NOT = { year = 800 }
		}
		modifier = {
			factor = 0.8
			NOT = { year = 900 }
		}
		modifier = {
			factor = 1.2
			year = 1000
		}
		modifier = {
			factor = 1.5
			year = 1100
		}
		modifier = {
			factor = 10
			has_game_rule = {
				name = acr_ai_revival
				value = reduced
			}
			ai = yes
		}
	}
	
	immediate = {
		set_character_flag = flag_mani_penninsula
	}
	
	option = {
		name = hellenic.105.a
		ai_chance = {
			factor = 50
		}
		custom_tooltip = {
			text = travel_penninsula
			hidden_tooltip = {
				character_event = { id = hellenic.106 days = 15 }
			}
		}
	}
	option = {
		name = hellenic.105.b
		ai_chance = {
			factor = 50
		}
		custom_tooltip = {
			text = ignore_rumors
		}
	}
}

# Arrival in Mani Penninsula
character_event = {
	id = hellenic.106
	desc = hellenic.106.desc
	picture = GFX_evt_cave_dwellers

	is_triggered_only = yes
	
	immediate = {
		create_random_priest = {
			random_traits = no
			dynasty = none
			culture = greek
			age = 50
			trait = patient
			trait = zealous
			trait = mystic
			trait = proud
			trait = scholarly_theologian
		}
		new_character = {
			save_event_target_as = target_maniot_priest
			set_secret_religion = hellenic_pagan
		}
	}

	option = {
		name = hellenic.106.a
		ai_chance = {
			factor = 50
		}
		custom_tooltip = {
			text = listen_to_maniot
			hidden_tooltip = {
				character_event = { id = hellenic.107 days = 2 }
			}
		}
	}
	option = {
		name = hellenic.106.b
		ai_chance = {
			factor = 50
		}
		FROM = {
			if = {
				limit = {
					NOR = {
						trait = zealous
						trait = cynical
					}
				}
				add_trait = zealous 
			}
		}
		event_target:target_maniot_priest = {
			imprison = ROOT
		}
		503 = { # Monemvasia
			add_province_modifier = { 
				name = religious_tension 
				duration = 365
			}
		}
	}
}

# Listen to the oracle
character_event = {
	id = hellenic.107
	desc = hellenic.107.desc
	picture = GFX_evt_roman_temple

	is_triggered_only = yes

	immediate = {
		event_target:target_maniot_priest = {
			set_character_flag = confessed_secret_religion_to_@ROOT
		}
	}

	option = {
		name = hellenic.107.a
		ai_chance = {
			factor = 50
		}
		
		if = {
			limit = { religion_group = christian }
			add_trait = sympathy_christendom
		}
		if = {
			limit = { religion_group = muslim }
			add_trait = sympathy_islam
		}
		if = {
			limit = { religion_group = zoroastrian_group }
			add_trait = sympathy_zoroastrianism
		}
		if = {
			limit = { religion_group = indian_group }
			add_trait = sympathy_indian
		}
		if = {
			limit = { religion_group = jewish_group }
			add_trait = sympathy_judaism
		}
		
		set_secret_religion = hellenic_pagan
		
		event_target:target_maniot_priest = {
			give_job_title = job_spiritual
		}
	}
	
	option = {
		name = hellenic.107.b
		ai_chance = {
			factor = 50
		}
		add_trait = sympathy_pagans
		add_trait_partially_cynical_effect = yes
		event_target:target_maniot_priest = {
			leave_court_and_die_effect = yes
		}
	}
}

#######################################
#
# - Hellenic Legion/Sacred Band
#
#######################################

# Hellenic Legion forms
narrative_event = {
	id = hellenic.109
	title = EVTTITLEhellenic.109
	desc = hellenic.109.desc
	picture = GFX_evt_crusaders
	border = GFX_event_narrative_frame_religion
	
	major = yes
	only_playable = yes
	
	trigger = {
		religion_openly_hellenic_or_reformed_trigger = yes
		is_heretic = no
		NOT = { is_title_active = d_legio_hellenica }
		OR = {
			e_byzantium = {
				holder_scope = {
					religion_openly_hellenic_or_reformed_trigger = yes
				}
			}
			e_roman_empire = {
				holder_scope = {
					religion_openly_hellenic_or_reformed_trigger = yes
				}
			}
			541 = { # Constantinople
				owner = { religion_openly_hellenic_or_reformed_trigger = yes }
			}
			464 = { # Rome
				owner = { religion_openly_hellenic_or_reformed_trigger = yes }
			}
		}
	}
	
	mean_time_to_happen = {
		months = 4
	}
	
	immediate = {
		activate_title = { title = d_legio_hellenica status = yes }
		create_random_soldier = {
			dynasty = none
			random_traits = yes
			culture = roman
			religion = hellenic_pagan
		}
		new_character = {
			d_legio_hellenica = {
				grant_title = PREV
			}
			set_defacto_liege = THIS
			wealth = 500
		}
		
		religion_authority = {
			modifier = religious_order_formed
			years = 10
		}
	}
	option = {
		name = hellenic.109.a
	}
}

# The Sacred Band founded
narrative_event = {
	id = hellenic.36
	title = hellenic.36.title
	desc = hellenic.36.desc
	picture = GFX_evt_roman_temple
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	hide_from = yes
	
	option = {
		name = hellenic.36.a
		hidden_tooltip = {
			any_playable_ruler = {
				limit = {
					ai = no
				}
				narrative_event = { id = hellenic.37 }
			}
		}
	}
}

# The player is informed of the Sacred Band
narrative_event = {
	id = hellenic.37
	title = hellenic.37.title
	desc = hellenic.37.desc
	picture = GFX_evt_roman_temple
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	option = {
		name = hellenic.37.a
		trigger = { religion_openly_hellenic_or_reformed_trigger = yes }
	}
	
	option = {
		name = hellenic.37.b
		trigger = { religion_openly_hellenic_or_reformed_trigger = no }
	}
}