
namespace = GoPagan

#reserved: GoPagan.200 to GoPagan.299

#######################################
# ZOROASTRIAN EVENTS
# Written by Zeress
#######################################

# Help in fighting the local bandits
character_event = {
	id = GoPagan.200
	desc = "EVTDESC_GoPagan_200"
	picture = "GFX_evt_bandits"
	
	only_playable = yes
	religion_group = zoroastrian_group
	min_age = 16
	capable_only = yes
	only_men = yes
	prisoner = no
	war = no
	is_sick = no
	
	trigger = {
		#is_ill = no
		any_demesne_province = {
			OR = {
				has_province_modifier = highway_robber_band
				has_province_modifier = smugglers_ring
				has_province_modifier = thieves_guild
				revolt_risk = 3
			}
		}
		NOT = { is_inaccessible_trigger = yes }
	}
	
	mean_time_to_happen = {
		months = 36	
		modifier = {
			factor = 0.8
			trait = diligent
		}
		modifier = {
			factor = 0.6
			realm_learning = 30
		}
	}
	
	option = {
		name = "EVTOPTA_GoPagan_200" #Hunt them down yourself
		piety = 10
		random = {
			chance = 15
			add_trait = wounded
		}
	}
	option = {
		name = "EVTOPTB_GoPagan_200" #Send a squad of guards
		trigger = {
			scaled_wealth = 0.15
		}
		scaled_wealth = -0.15
		prestige = 20
	}
	option = {
		name = "EVTOPTC_GoPagan_200" #Let the locals handle it
		prestige = -10
		piety = -10
	}
}

# Rebuild a local mosque?
character_event = {
	id = GoPagan.201
	desc = "EVTDESC_GoPagan_201"
	picture = "GFX_evt_burning_house_muslim"
	
	only_rulers = yes
	religion_group = zoroastrian_group
	min_age = 16
	capable_only = yes
	prisoner = no
	war = no

	trigger = {
		OR = {
			religion = zoroastrian
			religion = mazdaki
			religion = zurvanist
		}
		any_demesne_province = {
			religion_group = muslim
		}
		NOR = {
			has_character_modifier = zoroastrian_tolerance
			trait = cruel
		}
	}
	mean_time_to_happen = {
		months = 300	
		modifier = {
			factor = 0.8
			trait = kind
		}
		modifier = {
			factor = 0.7
			trait = charitable
		}
	}
	
	option = {
		name = "EVTOPTA_GoPagan_201" #Help them
		scaled_wealth = -0.5
		piety = 20
		add_character_modifier = {
			name = zoroastrian_tolerance
			duration = 365
		}
		hidden_tooltip = {
			any_realm_character = {
				limit = {
					NOT = { character = ROOT }
				}
				if = {
					limit = { religion_group = muslim }
					opinion = {
						who = ROOT
						modifier = opinion_tolerant_muslims
						months = 24
					}
				}
				if = {
					limit = { religion_group = zoroastrian_group }
					opinion = {
						who = ROOT
						modifier = opinion_tolerant
						months = 24
					}
				}
			}
		}
	}
	option = {
		name = "EVTOPTB_GoPagan_201" #Ignore their plight
		random = {
			chance = 20
			add_trait = cruel
		}
	}
}

# Sedreh Pushi ritual - child's event
character_event = {
	id = GoPagan.202
	desc = "EVTDESC_GoPagan_202"
	picture = "GFX_evt_child_bully"
	
	religion_group = zoroastrian_group
	min_age = 7
	max_age = 15
	capable_only = yes
	prisoner = no

	trigger = {
		OR = {
			religion = zoroastrian
			religion = mazdaki
			religion = zurvanist
		}
		father = {
			is_alive = yes
			NOT = { trait = incapable }
			NOT = { is_inaccessible_trigger = yes }
			prisoner = no
			war = no
		}
		NOT = { has_character_flag = had_sedreh_pushi }
		NOT = { is_inaccessible_trigger = yes }
	}
	
	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 0.5
			age = 11
		}
		modifier = {
			factor = 0.5
			age = 12
		}
		modifier = {
			factor = 0.5
			age = 13
		}
		modifier = {
			factor = 0.1
			age = 14
		}
	}
	
	option = {
		name = "EVTOPTA_GoPagan_202" #Ask my father for advice
		set_character_flag = had_sedreh_pushi
		hidden_tooltip = {
			if = {
				limit = { 
					father = {
						is_alive = yes
						any_child = {
							character = ROOT
							mother = { 
								OR = {
									is_alive = no
									NOT = { higher_tier_than = PREVPREV } 
								}
							}
						}
					}
				}
			father = { character_event = { id = GoPagan.203 days = 3 } }			
			}
			if = {
				limit = { 
					mother = { 
						is_alive = yes
						any_child = {
							character = ROOT
							father = { 
								OR = {
									is_alive = no
									lower_tier_than = PREVPREV 
								}
							}
						}
					}
				}
				mother = { character_event = { id = GoPagan.203 days = 3 } }			
			}
		}
	}
}

# Sedreh Pushi ritual - father's event
character_event = {
	id = GoPagan.203
	desc = "EVTDESC_GoPagan_203"
	picture = "GFX_evt_guardian"
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA_GoPagan_203" # Talk to him about Asha  righteousness
		trigger = {
			OR = {
				trait = just
				trait = kind
			}
		}
		FROM = { piety = 10 }
		FROM = { change_intrigue = -1 }
		FROM = { change_learning = 2 }
	}
	option = {
		name = "EVTOPTB_GoPagan_203" # Talk to him about Khshatr  divine power.
		trigger = {
			OR = {
				trait = brave
				is_strong_trigger = yes
			}
		}
		FROM = { prestige = 20 }
		FROM = { change_intrigue = -1 }
		FROM = { change_martial = 1 }
	}
	option = {
		name = "EVTOPTC_GoPagan_203" # Talk to him about  Armaiti  devotion.
		trigger = {
			OR = {
				trait = zealous
				piety = 400
			}
		}
		FROM = { piety = 30 }
		FROM = { change_intrigue = -1 }
		FROM = { change_diplomacy = 1 }
	}
	option = {
		name = "EVTOPTD_GoPagan_203" # Talk to him about Vohu Manah  holy spirit.
		trigger = {
			OR = {
				trait = diligent
				piety = 800
			}
		}
		FROM = { piety = 10	prestige = 10 }
		FROM = { change_intrigue = -1 }
		FROM = { change_stewardship = 1 }
	}
	option = {
		name = "EVTOPTE_GoPagan_203" # I have nothing to teach him.
		random_list = {
			50 = { FROM = { change_learning = 1 } }
			50 = { FROM = { change_learning = -1 } }
		}
	}
}

### Rebuilding Persepolis

# Rebuild Persepolis Phase 1 - Laying the foundation
character_event = {
	id = GoPagan.205 #formerly 1000182065
	desc = "EVTDESC_GoPagan_205"
	picture = "GFX_persepolis_ruin"

	is_triggered_only = yes
	
	option = {
		name = "EVTOPTC_GoPagan_205" # Make it the greatest city there ever was!
		add_character_modifier = {
			name = is_rebuilding_persepolis
			duration = -1
			hidden = yes
			inherit = yes
		}
	}
}

# Rebuild Persepolis Phase 2 - Add Esfahan bonus modifier ~8 years
province_event = {
	id = GoPagan.206 #formerly 1000182066
	title = "EVTNAME_GoPagan_206"
	desc = "EVTDESC_GoPagan_206"
	picture = "GFX_persepolis_built"

	has_global_flag = rebuilding_persepolis
	
	trigger = {
		province_id = 646 # Esfahan
		NOT = { has_global_flag = persepolis_rebuilt }
		had_province_flag = { flag = reb_pers_1 days = 2555 }
		NOT = { has_province_flag = reb_pers_2 }
	}

	immediate = {
		set_province_flag = reb_pers_2
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA_GoPagan_206" #Library
		add_province_modifier = { name = persepolis_library duration = -1 }
	}
	option = {
		name = "EVTOPTB_GoPagan_206" #Irrigation system
		add_province_modifier = { name = persepolis_irrigation duration = -1 }
	}
	option = {
		name = "EVTOPTC_GoPagan_206" #Gate of all nations
		add_province_modifier = { name = persepolis_gate duration = -1 }
	}
}

# Rebuild Persepolis Phase 3
province_event = {
	id = GoPagan.207 #formerly 1000182067
	title = "EVTNAME_GoPagan_207"
	desc = "EVTDESC_GoPagan_207"
	picture = "GFX_persepolis_built"
	
	has_global_flag = rebuilding_persepolis
	
	trigger = {
		province_id = 646 # Esfahan
		NOT = { has_global_flag = persepolis_rebuilt }
		had_province_flag = { flag = reb_pers_2 days = 638 }		
	}

	mean_time_to_happen = {
		days = 99
	}
	
	immediate = {
		owner = { remove_character_modifier = is_rebuilding_persepolis }
		clr_global_flag = rebuilding_persepolis
		set_global_flag = persepolis_rebuilt
		clr_province_flag = reb_pers_1
		clr_province_flag = reb_pers_2
	}

	option = {
		name = "EVTOPTA_GoPagan_207"
		owner = {
			prestige = 500
			646 = {
				build_holding = {
				   title = b_new_persepolis
				   type = temple
				   holder = PREV
				}
			}
		}
		hidden_tooltip = {
			owner = {
				set_character_flag = event_1000182067
				narrative_event = { id = GoPagan.210 days = 7 }
			}
		}
	}
}

# Esfahan owned by someone else before Persepolis is rebuilt
province_event = {
	id = GoPagan.208
	
	hide_window = yes
	
	has_global_flag = rebuilding_persepolis
	
	trigger = {
		province_id = 646 # Esfahan
		NOT = { has_global_flag = persepolis_rebuilt }
		owner = {
			NOT = { has_character_modifier = is_rebuilding_persepolis }
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		clr_global_flag = rebuilding_persepolis
		clr_province_flag = reb_pers_1
		clr_province_flag = reb_pers_2
		remove_province_modifier = persepolis_library
		remove_province_modifier = persepolis_irrigation
		remove_province_modifier = persepolis_gate
		any_character = {
			limit = { has_character_modifier = is_rebuilding_persepolis }
			remove_character_modifier = is_rebuilding_persepolis
		}
	}
}

# News spread about New Persepolis
narrative_event = {
	id = GoPagan.210 #formerly 1000182068
	title = "EVTNAME_GoPagan_210"
	desc = "EVTDESC_GoPagan_210"
	picture = "GFX_persepolis_built"
	border = "GFX_event_narrative_frame_religion"
	
	major = yes
	only_rulers = yes
	is_triggered_only = yes
	
	option = {
		name = "EXCELLENT"
		trigger = {
			has_character_flag = event_1000182067
		}
		clr_character_flag = event_1000182067
	}
	
	option = {
		name = "EVTOPTA_GoPagan_210"
		trigger = {
			NOT = { has_character_flag = event_1000182067 }
		}
	}
}

# Expand Zhayedan
narrative_event = {
	id = GoPagan.216 #formerly 1000182158
	title = "EVTNAME_GoPagan_216"
	desc = "EVTDESC_GoPagan_216"
	picture = "GFX_evt_zhayedan"
	border = "GFX_event_narrative_frame_religion"
	
	major = yes
	only_rulers = yes
	is_triggered_only = yes
	
	option = {
		name = "EXCELLENT"
		trigger = {
			has_character_flag = event_1000182158
		}
		clr_character_flag = event_11000182158
	}
	
	option = {
		name = "EVTOPTA_GoPagan_210"
		trigger = {
			NOT = { has_character_flag = event_1000182158 }
		}
	}
}

# Great Sacrifice event
character_event = {
	id = GoPagan.220 #formerly 1000182159
	title = "EVTNAME_GoPagan_220"
	desc = "EVTDESC_GoPagan_220"
	picture = "GFX_evt_sacrifice"
	
	is_triggered_only = yes
	hide_from = yes	
	
	option = {
		name = "EVTOPTA_GoPagan_220" #To Mithra (War)
		scaled_wealth = -0.3
		piety = -30
		add_character_modifier = {
			name = zoroastrian_sacrifice_mithra
			duration = 730
		}
	}
	option = {
		name = "EVTOPTB_GoPagan_220" #To Parendi (Riches)
		scaled_wealth = -0.3
		piety = -30
		add_character_modifier = {
			name = zoroastrian_sacrifice_parendi
			duration = 730
		}
	}
	option = {
		name = "EVTOPTC_GoPagan_220" #To Chisti (Wisdom)
		scaled_wealth = -0.3
		piety = -30
		capital_scope = {
			add_province_modifier = {
				name = zoroastrian_sacrifice_chisti
				duration = 730
			}
		}
	}
	option = {
		name = "EVTOPTD_GoPagan_220" #To none of them
		trigger = {
			ai = no
		}
		hidden_tooltip = {
			clr_character_flag = made_sacrifice_1
		}
	}
}

# Cleansing Ritual event
character_event = {
	id = GoPagan.225 #formerly 1000182160
	title = "EVTNAME_GoPagan_225"
	desc = "EVTDESC_GoPagan_225"
	picture = "GFX_evt_sacrifice"
	
	is_triggered_only = yes
	hide_from = yes	
	
	option = {
		name = "EVTOPTA_GoPagan_225"
		piety = 25
		add_character_modifier = {
			name = zoroastrian_cleansing
			duration = 365
		}
	}
}

#######################################
# MANICHAEAN EVENTS
#######################################

# Choosing a Shekhinah
character_event = {
	id = GoPagan.226
	title = EVTNAME_GoPagan_226
	desc = EVTDESC_GoPagan_226
	picture = GFX_evt_knight_kneeling
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_GoPagan_226
		add_character_modifier = {
			name = patron_reason
			duration = -1
		}
	}
	option = {
		name = EVTOPTB_GoPagan_226
		add_character_modifier = {
			name = patron_mind
			duration = -1
		}
	}
	option = {
		name = EVTOPTC_GoPagan_226
		add_character_modifier = {
			name = patron_intelligence
			duration = -1
		}
	}
	option = {
		trigger = { ai = yes }
		name = EVTOPTB_GoPagan_227
		add_character_modifier = {
			name = patron_mani_understanding
			duration = -1
		}
	}
	option = {
		trigger = { ai = yes }
		name = EVTOPTA_GoPagan_227
		add_character_modifier = {
			name = patron_thought
			duration = -1
		}
	}
	option = {
		trigger = { ai = no }
		name = EVTOPTD_GoPagan_226
		character_event = { id = GoPagan.227 tooltip = CONSIDER_OTHER_OPTIONS }
	}
}

character_event = {
	id = GoPagan.227
	title = EVTNAME_GoPagan_226
	desc = EVTDESC_GoPagan_226
	picture = GFX_evt_knight_kneeling
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTB_GoPagan_227
		add_character_modifier = {
			name = patron_mani_understanding
			duration = -1
		}
	}
	option = {
		name = EVTOPTA_GoPagan_227
		add_character_modifier = {
			name = patron_thought
			duration = -1
		}
	}
	option = {
		name = EVTOPTD_GoPagan_226
		character_event = { id = GoPagan.226 tooltip = CONSIDER_OTHER_OPTIONS }
	}
}

# Manichean leader restored
narrative_event = {
	id = GoPagan.228
	title = EVTNAME_GoPagan_228
	desc = EVTDESC_GoPagan_228
	picture = GFX_evt_zoroaster
	border = GFX_event_narrative_frame_religion

	major = yes
	show_ROOT = yes
	hide_from = yes
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				any_realm_lord = {
					in_revolt = no
					pf_war_trait_trigger = no
					religion = manichean
					capital_holding = { is_holy_site = ROOT }
					prisoner = no
					NOT = { trait = incapable }
				}
			}
			random_realm_lord = {
				limit = {
					in_revolt = no
					pf_war_trait_trigger = no
					religion = manichean
					capital_holding = { is_holy_site = ROOT }
					prisoner = no
					NOT = { trait = incapable }
				}
				d_manichean = { grant_title = PREV }
				set_defacto_liege = ROOT
				pf_liege_change_effect = yes
				save_event_target_as = new_manichean_leader
				break = yes
			}
		}
		if = {
			limit = {
				any_realm_lord = {
					in_revolt = no
					pf_war_trait_trigger = no
					religion = manichean
					capital_holding = { holding_type = temple }
					prisoner = no
					NOT = { trait = incapable }
					NOT = { trait = bad_priest_zoroastrian }
				}
			}
			random_realm_lord = {
				limit = {
					in_revolt = no
					pf_war_trait_trigger = no
					religion = manichean
					capital_holding = { holding_type = temple }
					prisoner = no
					NOT = { trait = incapable }
					NOT = { trait = bad_priest_zoroastrian }
				}
				d_manichean = { grant_title = PREV }
				set_defacto_liege = ROOT
				save_event_target_as = new_manichean_leader
				ROOT = {
					random_realm_title = {
						limit = { is_holy_site = ROOT }
						gain_title = PREVPREV
					}
				}
				break = yes
			}
		}
		create_random_priest = {
			random_traits = yes
			dynasty = random
			religion = manichean
			culture = ROOT
			age = 40
			health = 7
			trait = quick
			trait = zealous
			trait = scholar
			trait = mastermind_theologian
			attributes = {
				learning = 5
				diplomacy = 5
				martial = 2
				stewardship = 5
				intrigue = 5
			}
		}
		new_character = {
			d_manichean = { grant_title = PREV }
			set_defacto_liege = ROOT
			save_event_target_as = new_manichean_leader
			ROOT = {
				random_realm_title = {
					limit = { is_holy_site = ROOT }
					gain_title = PREVPREV
				}
			}
		}
	}	
	
	option = {
		name = EVTOPTA_GoPagan_228
		trigger = {
			NOT = { religion = manichean }
		}
		event_target:new_manichean_leader = { }
	}
	option = {
		name = EVTOPTB_GoPagan_228
		trigger = { religion = manichean }
		event_target:new_manichean_leader = { }
	}
}

# The Army of Light founded
narrative_event = {
	id = GoPagan.229
	title = EVTNAME_GoPagan_229
	desc = EVTDESC_GoPagan_229
	picture = GFX_evt_crusaders
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	major = yes
	hide_from = yes
	
	option = {
		name = EVTOPTA_GoPagan_229
		trigger = {
			religion = manichean
		}
	}
	option = {
		name = I_SEE
		trigger = {
			NOT = { religion = manichean }
		}
	}
}

# Ping event when donating money to the Army of Light
character_event = {
	id = GoPagan.230
	
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		wealth = 300
		FROM = {
			letter_event = {
				id = GoPagan.231
			}
		}
		opinion = {
			who = FROM
			modifier = opinion_generous_donation
		}
	}
}

# Notification event when donating money to the Army of Light
letter_event = {
	id = GoPagan.231
	desc = EVTDESC_GoPagan_231
	border = GFX_event_letter_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EXCELLENT
	}
}

# Ping event when expelling the Army of Light
character_event = {
	id = GoPagan.232
	
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		any_title_under = {
			limit = {
				tier = BARON
				location = {
					owner = {
						OR = {
							character = FROM
							is_liege_or_above = FROM
						}
					}
				}
			}
			usurp_title = FROM
		}
		if = {
			limit = { is_liege_or_above = FROM }
			set_defacto_liege = THIS
		}
		FROM = {
			letter_event = {
				id = GoPagan.233
			}
		}
		opinion = {
			who = FROM
			modifier = opinion_expelled_from_realm
		}
	}
}

# Notification event when expelling the Army of Light
letter_event = {
	id = GoPagan.233
	desc = EVTDESC_GoPagan_233
	border = GFX_event_letter_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		remove_character_modifier = donated_to_holy_order
	}
	
	option = {
		name = EVTOPTB_SOA_1061
	}
}

# Muslim caliph orders the murder of Manicheans in Baghdad
character_event = {
	id = GoPagan.234
	desc = EVTDESC_GoPagan_234
	picture = GFX_evt_bishop_byzantine
	border = GFX_event_normal_frame_religion
	
	only_playable = yes
	religion_group = muslim
	min_age = 16
	capable_only = yes
	prisoner = no
	war = no

	trigger = {
		year = 900
		is_title_active = d_manichean
		d_manichean = { has_holder = yes }
		controls_religion = yes
		OR = {
			has_landed_title = c_baghdad
			any_realm_lord = { has_landed_title = c_baghdad }
		}
		OR = {
			trait = cruel
			trait = decadent
			trait = wroth
			trait = greedy
			trait = lunatic
			trait = possessed
		}
		NOR = {
			trait = sympathy_zoroastrianism
			has_character_flag = refused_manichean_murder
			has_global_flag = manichean_leader_murdered
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = EVTOPTA_GoPagan_234
		ai_chance = { factor = 100 }
		set_global_flag = manichean_leader_murdered
		piety = 250
		if = {
			limit = { trait = decadent }
			remove_trait = decadent
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = {
				NOT = { trait = kind }
				NOT = { trait = cruel }
			}
			random = {
				chance = 50
				add_trait = cruel
			}
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		693 = {
			if = { limit = { religion = manichean } }
			religion = ROOT
		}
		d_manichean = {
			holder_scope = { save_event_target_as = manichean_leader }
		}
		tooltip = {
			d_manichean = {
				holder_scope = {
					death = {
						death_reason = death_murder
						killer = ROOT
					}
					religion_authority = {
						modifier = death_of_leader
						years = 30
					}
				}
			}
		}
		hidden_tooltip = {
			narrative_event = { id = GoPagan.235 }
		}
	}
	option = {
		name = EVTOPTB_GoPagan_234
		ai_chance = { factor = 0 }
		set_character_flag = refused_manichean_murder
		if = {
			limit = { trait = zealous }
			remove_trait = zealous
		}
		piety = -250
	}
}

# Notification of the murder of the Manichean leader
narrative_event = {
	id = GoPagan.235
	title = EVTNAME_GoPagan_235
	desc = EVTDESC_GoPagan_235
	picture = GFX_evt_bishop_byzantine
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	major = yes
	
	major_trigger = {
		OR = {
			character = FROM
			same_realm = FROM
			has_landed_title = d_manichean
			religion = manichean
			capital_scope = {
				NOT = {
					distance = {
						where = 693 # Baghdad
						value = 600	# Same part of the world
					}
				}
			}
		}
	}
	
	option = {
		name = EVTOPTA_GoPagan_235
		trigger = { has_landed_title = d_manichean }
		d_manichean = { hidden_tooltip = { unsafe_destroy_landed_title = THIS } }
		activate_title = { title = d_manichean status = no }
		religion_authority = {
			modifier = death_of_leader
			years = 30
		}
		death = {
			death_reason = death_murder
			killer = FROM
		}
	}
	option = {
		name = EVTOPTA_GoPagan_235
		trigger = {
			NOT = { has_landed_title = d_manichean }
			religion = manichean
		}
	}
	option = {
		name = EVTOPTB_GoPagan_235
		trigger = {
			NOR = {
				has_landed_title = d_manichean
				religion = manichean
			}
			religion_group = muslim
		}
	}
	option = {
		name = I_SEE
		trigger = {
			NOR = {
				has_landed_title = d_manichean
				religion = manichean
				religion_group = muslim
			}
		}
	}
}

# Battle Events
character_event = {
	id = GoPagan.236
	desc = EVTDESC_GoPagan_236
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	religion = manichean
	
	option = {
		name = EVTOPTA_GoPagan_236
		piety = 50
		religion_authority = {
			modifier = light_victory
			years = 5
		}
	}
}

character_event = {
	id = GoPagan.237
	desc = EVTDESC_GoPagan_237
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	religion = manichean
	
	option = {
		name = EVTOPTA_GoPagan_237
		piety = -50
		religion_authority = {
			modifier = dark_victory
			years = 5
		}
	}
}

### BEMA FEAST EVENTS

# Invite vassals to festival
character_event = {
	id = GoPagan.238
	desc = EVTDESC_GoPagan_238
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion
	
	hide_from = yes
	
	only_rulers = yes
	min_age = 16
	has_character_flag = planning_bema_feast
	only_capable = yes
	prisoner = no
	war = no
	
	trigger = {
		NOT = { month = 6 }
		month = 3
		NOT = { has_character_modifier = do_not_disturb }
		NOT = { is_inaccessible_trigger = yes }
	}
	
	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = EVTOPTA_GoPagan_238
		clr_character_flag = planning_bema_feast
		set_character_flag = holding_bema_feast
		any_vassal = {
			limit = {
				prisoner = no
				war = no
				NOT = { trait = incapable }
				religion = manichean
				is_adult = yes
				NOT = { has_character_modifier = do_not_disturb }
			}
			letter_event = {
				id = GoPagan.239
				tooltip = EVTTOOLTIP1_RoI_1000
			}
		}
		hidden_tooltip = { 
			character_event = { id = GoPagan.241 days = 12 } # Begin Feast
			character_event = { id = GoPagan.246 days = 4 }  # Fast
			add_character_modifier = {
				name = do_not_disturb
				days = 25
				hidden = yes
			}
		}
		if = {
			limit = { is_inaccessible_trigger = yes	}
			end_inaccessibility_effect = yes
			add_character_modifier = {
				name = went_out_of_hiding_timer
				duration = 180
				hidden = yes
			}
			hidden_tooltip = { character_event = { id = CM.6400 } } # Notify plotters and family
		}
	}
}

# Vassal receives invitation
letter_event = {
	id = GoPagan.239
	desc = EVTDESC_GoPagan_239
	border = GFX_event_letter_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_GoPagan_239 #Travel to the feast
		ai_chance = {
			factor = 2
			modifier  = {
				factor = 0.1
				ai = yes
				is_inaccessible_trigger = yes
			}
			modifier  = {
				factor = 2
				opinion = { who = from value = -30 }
			}
			modifier  = {
				factor = 5
				opinion = { who = from value = -15 }
			}
			modifier  = {
				factor = 5
				opinion = { who = from value = 0 }
			}
		}
		set_character_flag = attending_bema_feast
		hidden_tooltip = {
			character_event = { id = GoPagan.242 days = 12 } # Hidden - arrives at feast
			character_event = { id = GoPagan.245 days = 25 } # Safety event for clearing all flags
			add_character_modifier = {
				name = do_not_disturb
				days = 25
				hidden = yes
			}
		}
		if = {
			limit = { is_inaccessible_trigger = yes	}
			end_inaccessibility_effect = yes
			add_character_modifier = {
				name = went_out_of_hiding_timer
				duration = 180
				hidden = yes
			}
			hidden_tooltip = { character_event = { id = CM.6400 } } # Notify plotters and family
		}
	}
	option = {
		name = EVTOPTB_GoPagan_239 #Refuse invitation
		ai_chance = {
			factor = 1
			modifier  = {
				factor = 0
				opinion = { who = FROM value = 25 }
				NOT = { is_inaccessible_trigger = yes }
			}
		}
		FROM = {
			letter_event = { id = GoPagan.240 days = 1 random = 2 tooltip = EVTTOOLTIP1_RoI_2001 }
		}
	}
}

# If vassal refuses to come to the feast
letter_event = {
	id = GoPagan.240
	desc = EVTDESC_GoPagan_240
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_GoPagan_240 
		opinion = {
			modifier = opinion_dislike
			who = FROM
			years = 2
		}
	}
}

# Festival begins
character_event = {
	id = GoPagan.241
	desc = EVTDESC_GoPagan_241
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	prisoner = no
	
	only_capable = yes
	
	option = {
		name = EXCELLENT
		hidden_tooltip = {
			character_event = { id = GoPagan.243 days = 10 } # End festival
			character_event = { id = GoPagan.245 days = 20 } # Clearing all flags and modifiers after feast
			character_event = { id = GoPagan.247 days = 3 } # Singing of Hymns
			character_event = { id = GoPagan.250 days = 5 } # Feast
			character_event = { id = GoPagan.251 days = 7 } # Sermon
			any_courtier = {
				limit = {
					prisoner = no
					is_adult = yes
					is_ruler = no
					NOT = { trait = incapable }
					religion = manichean
				}
				set_character_flag = attending_bema_feast
				character_event = { id = GoPagan.247 days = 3 } 
				character_event = { id = GoPagan.250 days = 5 } 
				character_event = { id = GoPagan.251 days = 7 } 
				character_event = { id = GoPagan.245 days = 20 } # Clearing all flags and modifiers after feast
			}
		}
	}
}

# Vassal arrives at festival
character_event = {
	id = GoPagan.242
	desc = EVTDESC_GoPagan_242
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	trigger = {
		FROM = {
			NOT = { trait = incapable }
			prisoner = no
		}
	}
	
	option = {
		name = EXCELLENT
		hidden_tooltip = {
			character_event = { id = GoPagan.247 days = 3 } # Singing of Hymns
			character_event = { id = GoPagan.250 days = 5 } # Feast
			character_event = { id = GoPagan.251 days = 7 } # Picture Book
		}
	}
}

# Festival is over - host
character_event = {
	id = GoPagan.243
	desc = EVTDESC_GoPagan_243
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EXCELLENT
		prestige = 50
		piety = 50
		add_character_modifier = {
			name = held_bema_feast_timer
			duration = 1825
			hidden = yes
		}
		remove_character_modifier = do_not_disturb
		clr_character_flag = holding_bema_feast
		hidden_tooltip = {
			any_vassal = {
				limit = { has_character_flag = attending_bema_feast }
				character_event = { id = GoPagan.244 }
			}
			any_courtier = {
				limit = {
					is_ruler = no
					has_character_flag = attending_bema_feast
				}
				character_event = { id = GoPagan.244 }
			}
		}
	}
}

# Festival is over - guest
character_event = {
	id = GoPagan.244
	desc = EVTDESC_GoPagan_243
	picture = GFX_evt_girl_with_cat
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EXCELLENT
		opinion = {
			modifier = opinion_enjoyed_feast
			who = FROM
			years = 2
		}
		clr_character_flag = attending_bema_feast
		remove_character_modifier = do_not_disturb
	}
}

# Clear all character flags and modifiers - safety catch
character_event = {
	id = GoPagan.245

	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		clr_character_flag = attending_bema_feast
		clr_character_flag = holding_bema_feast
	}
}

# Ruler begins the ritual fast
character_event = {
	id = GoPagan.246
	desc = EVTDESC_GoPagan_246
	picture = GFX_evt_garden
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	option = {
		name = EVTOPTA_GoPagan_246
		piety = 20
		prestige = 20
		random_list = {
			30 = { health = -1 } 
			30 = { add_trait = temperate } 
			40 = {} # No event
		}
	}
	option = {
		name = EVTOPTB_GoPagan_246
		piety = 5
		random_list = {
			10 = { health = -1 } 
			10 = { add_trait = temperate } 
			80 = {} # No event
		}
	}
	option = {
		name = EVTOPTC_GoPagan_246
		piety = -20
		random_list = {
			30 = { add_trait = gluttonous } 
			70 = {} # No event
		}
	}
}

# Singing of Hymns
character_event = {
	id = GoPagan.247
	title = EVTNAME_GoPagan_247
	desc = EVTDESC_GoPagan_247
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	prisoner = no
	
	only_capable = yes
	
	option = {
		name = EVTOPTA_GoPagan_247
		piety = 10
		hidden_tooltip = {
			random_list = {
				10 = {
					modifier = {
						factor = 10
						trait = shy
					}
					modifier = {
						factor = 0
						OR = {
							diplomacy = 8
							trait = poet
							trait = gregarious
							trait = zealous
						}
					}
					custom_tooltip = { text = CANNOT_SING }
					if = {
						limit = { NOT = { trait = shy } }
						random = {
							chance = 30
							add_trait = shy
						}
					}
					prestige = -50
				}
				10 = {
					modifier = {
						factor = 2
						trait = poet
					}
					modifier = {
						factor = 0
						OR = {
							trait = zealous
							trait = cynical
						}
					}
					custom_tooltip = { text = TOUCHED_BY_BEAUTY }
					add_trait = zealous
				}
				100 = {} # No event
			}
		}
	}
}

# Feast
character_event = {
	id = GoPagan.250
	title = EVTNAME_GoPagan_250
	desc = EVTDESC_GoPagan_250
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	prisoner = no
	
	only_capable = yes
	
	option = {
		name = EVTOPTA_GoPagan_250
		piety = 20
	}
}

# Read the Arzhang
character_event = {
	id = GoPagan.251
	title = EVTNAME_GoPagan_251
	desc = EVTDESC_GoPagan_251
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	prisoner = no
	
	only_capable = yes
	
	option = { 
		name = EVTOPTA_GoPagan_251
		random_list = {
			5 = {
				modifier = {
					factor = 0
					OR = {
						trait = humble
						trait = proud
					}
				}
				add_trait = humble
			}
			5 = {
				modifier = {
					factor = 0
					OR = {
						trait = humble
						trait = proud
					}
				}
				add_trait = proud
			}
			5 = {
				modifier = {
					factor = 0
					OR = {
						trait = zealous
						trait = cynical
					}
				}
				add_trait = cynical
			}
			10 = {
				modifier = {
					factor = 0
					OR = {
						trait = zealous
						trait = cynical
					}
				}
				add_trait = zealous
			}
			10 = {
				modifier = {
					factor = 0.5
					trait = cynical
				}
				modifier = {
					factor = 2
					trait = zealous
				}
				change_learning = 1
			}
			30 = {
				piety = 20
			}
			100 = {
				# No effect
			}
		}
	}
}

#######################################
# MAZDAKI EVENTS
#######################################

# Babak and Banu 's Rebellion
province_event = {
	id = GoPagan.255

	hide_window = yes

	trigger = {
		province_id = 658 #Hamadan
		year = 815
		kingdom = { culture = persian }
		owner = {
			top_liege = {
				has_landed_title = d_sunni
				NOT = { culture = persian }
			}
		}
		e_placeholder = { had_title_flag = { flag = startup days = 730 } }
		NOR = {
			year = 850
			has_global_flag = babak_and_banu
		}
	}
	
	mean_time_to_happen = {
		days = 100
	}
		
	immediate = {
		set_global_flag = babak_and_banu
		if = {
			limit = { has_province_modifier = cultural_unrest }
			remove_province_modifier = cultural_unrest
		}
		save_event_target_as = revolt_location
		owner = { top_liege = { save_event_target_as = revolt_top_liege } }
		kingdom = { save_event_target_as = revolt_kingdom }
		create_character = {
			random_traits = yes
			dynasty = 100639 #Khorramdin
			name = "Babak"
			religion = mazdaki
			culture = persian
			female = no
			age = 24
			health = 7
			attributes = {
				martial = 15
				learning = 7
				diplomacy = 12
			}
			trait = just
			trait = brave
			trait = gregarious
			trait = ambitious
			trait = zealous
			trait = skilled_tactician
			trait = unyielding_leader
			trait = holy_warrior
			trait = mountain_terrain_leader
			trait = peasant_leader
		}
		new_character = {
			save_event_target_as = nationalist_revolt_leader
			set_character_flag = nationalist_rebel
			set_character_flag = began_revolt
			prestige = 200
			wealth = 100
			opinion = {
				who = event_target:revolt_top_liege
				modifier = opinion_evil_tyrant
			}
			character_event = { id = GoPagan.256 }
		}
	}
}

character_event = {
	id = GoPagan.256
	
	is_triggered_only = yes
	hide_window = yes
	
	immediate = {
		event_target:revolt_kingdom = {
			create_title = {
				tier = KING
				landless = yes
				temporary = yes
				culture = ROOT
				holder = ROOT
				base_title = THIS
				copy_title_laws = yes
				name = "Khorramdin Rebellion"
			}
		}
		event_target:revolt_location = {
			ROOT = {
				hidden_tooltip = {
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						leader = THIS
						scaled_by_biggest_garrison = 2.4
						troops = {
							archers = { 6 6 }
							light_cavalry = { 3 3 }
							knights = { 1 1 }
							light_infantry = { 7 7 }
							heavy_infantry = { 3 3 }
						}
						cannot_inherit = yes
						attrition = 0.25
						maintenance_multiplier = 0
						earmark = nationalist_rebels_1
					}
				}
			}
		}
		create_character = {
			random_traits = yes
			dynasty = none
			name = "Banu"
			religion = ROOT
			culture = ROOT
			female = yes
			age = 19
			attributes = {
				martial = 15
				learning = 7
			}
			trait = just
			trait = brave
			trait = skilled_tactician
			trait = mountain_terrain_leader
			trait = peasant_leader
			trait = martial_lady_tengri
		}
		event_target:revolt_location = {
			new_character = {
				ROOT = {
					add_spouse = PREV
					add_lover = PREV
				}
				set_character_flag = special_marshal
				spawn_unit = {
					province = PREV
					home = PREV
					owner = ROOT
					leader = THIS
					scaled_by_biggest_garrison = 2.4
					troops = {
						archers = { 6 6 }
						light_cavalry = { 3 3 }
						knights = { 1 1 }
						light_infantry = { 7 7 }
						heavy_infantry = { 3 3 }
					}
					disband_on_peace = yes
					attrition = 0.25
					maintenance_multiplier = 0
					earmark = nationalist_rebels
				}
			}
		}		
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 24
			attributes = {
				martial = 7
			}
			trait = peasant_leader
			trait = tough_soldier
		}
		event_target:revolt_location = {
			new_character = {
				opinion = { who = ROOT modifier = opinion_loyal_servant years = 20 }
				spawn_unit = {
					province = PREV
					home = PREV
					owner = ROOT
					leader = THIS
					scaled_by_biggest_garrison = 2.0
					troops = {
						archers = { 6 6 }
						light_cavalry = { 3 3 }
						knights = { 1 1 }
						light_infantry = { 7 7 }
						heavy_infantry = { 3 3 }
					}
					disband_on_peace = yes
					attrition = 0.25
					maintenance_multiplier = 0
					earmark = nationalist_rebels
				}
			}
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 24
			attributes = {
				martial = 7
			}
			trait = peasant_leader
			trait = tough_soldier
		}
		event_target:revolt_location = {
			new_character = {
				opinion = { who = ROOT modifier = opinion_loyal_servant years = 20 }
				spawn_unit = {
					province = PREV
					home = PREV
					owner = ROOT
					leader = THIS
					scaled_by_biggest_garrison = 2.0
					troops = {
						archers = { 6 6 }
						light_cavalry = { 3 3 }
						knights = { 1 1 }
						light_infantry = { 7 7 }
						heavy_infantry = { 3 3 }
					}
					disband_on_peace = yes
					attrition = 0.25
					maintenance_multiplier = 0
					earmark = nationalist_rebels
				}
			}
		}		
		event_target:revolt_location = {
			event_target:revolt_top_liege = {
				set_character_flag = has_current_revolt
				reverse_war = {
					target = ROOT
					casus_belli = liberation_revolt
					thirdparty_title = PREV # The county...
					tier = KING # ... but really the de jure kingdom
				}
			}
		}
		hidden_tooltip = {
			event_target:revolt_top_liege = {
				narrative_event = { id = GoPagan.257 }
				any_realm_lord = {
					limit = {
						higher_tier_than = BARON
						culture = ROOT
						religion = ROOT
						capital_scope = { kingdom = { title = event_target:revolt_kingdom } }
						NOR = {
							character = PREV
							has_truce = PREV
							has_non_aggression_pact_with = PREV
							prisoner = yes
							trait = incapable
							is_adult = no
							reverse_has_opinion_modifier = { who = ROOT modifier = refused_revolt_call }
							any_liege = { pf_war_flag_trigger = yes }
							pf_war_trait_trigger = yes
							any_liege = {
								culture = ROOT
								religion = ROOT
								capital_scope = { kingdom = { title = event_target:revolt_kingdom } }
								NOR = {
									character = PREVPREV
									has_truce = PREVPREV
									has_non_aggression_pact_with = PREVPREV
									prisoner = yes
									trait = incapable
									is_adult = no
									reverse_has_opinion_modifier = { who = ROOT modifier = refused_revolt_call }
									pf_war_trait_trigger = yes
								}
							}
						}
					}
					character_event = { id = TOG.1043 } #Ask to join the war
				}
			}
		}
	}
}

# Caliph informed of the rebellion
narrative_event = {
	id = GoPagan.257
	title = EVTNAME_GoPagan_257
	desc = EVTDESC_GoPagan_257
	picture = GFX_evt_moors
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	major = yes
	
	major_trigger = {
		OR = {
			has_landed_title = d_sunni
			same_realm = ROOT
			religion_group = zoroastrian_group
			culture = persian
			capital_scope = {
				NOT = {
					distance = {
						where = 658 # Hamadan
						value = 600	# Same part of the world
					}
				}
			}
		}
	}
	
	option = {
		name = EVTOPTA_GoPagan_257
		trigger = {
			has_landed_title = d_sunni
		}
	}
	option = {
		name = EVTOPTB_GoPagan_257
		trigger = {
			NOT = { has_landed_title = d_sunni }
			culture = persian
		}
	}
	option = {
		name = I_SEE
		trigger = {
			NOT = { has_landed_title = d_sunni }
			NOT = { culture = persian }
		}
	}
}

# Mazdaki priesthood created
narrative_event = {
	id = GoPagan.258
	title = EVTNAME_GoPagan_258
	desc = EVTDESC_GoPagan_258
	picture = GFX_evt_zoroaster
	border = GFX_event_narrative_frame_religion

	major = yes
	show_ROOT = yes
	hide_from = yes
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				any_realm_lord = {
					religion = mazdaki
					capital_holding = { is_holy_site = ROOT }
					prisoner = no
					NOT = { trait = incapable }
				}
			}
			random_realm_lord = {
				limit = {
					in_revolt = no
					pf_war_trait_trigger = no
					religion = mazdaki
					capital_holding = { is_holy_site = ROOT }
					prisoner = no
					NOT = { trait = incapable }
				}
				d_mazdaki = { grant_title = PREV }
				set_defacto_liege = ROOT
				pf_liege_change_effect = yes
				save_event_target_as = new_mazdaki_leader
				break = yes
			}
		}
		if = {
			limit = {
				any_realm_lord = {
					religion = mazdaki
					capital_holding = { holding_type = temple }
					prisoner = no
					NOT = { trait = incapable }
					NOT = { trait = bad_priest_zoroastrian }
				}
			}
			random_realm_lord = {
				limit = {
					in_revolt = no
					pf_war_trait_trigger = no
					religion = mazdaki
					capital_holding = { holding_type = temple }
					prisoner = no
					NOT = { trait = incapable }
					NOT = { trait = bad_priest_zoroastrian }
				}
				d_mazdaki = { grant_title = PREV }
				set_defacto_liege = ROOT
				pf_liege_change_effect = yes
				save_event_target_as = new_mazdaki_leader
				ROOT = {
					random_realm_title = {
						limit = { is_holy_site = ROOT }
						gain_title = PREVPREV
					}
				}
				break = yes
			}
		}
		create_random_priest = {
			random_traits = yes
			dynasty = random
			religion = mazdaki
			culture = ROOT
			age = 40
			health = 7
			trait = quick
			trait = zealous
			trait = scholar
			trait = mastermind_theologian
			attributes = {
				learning = 5
				diplomacy = 5
				martial = 2
				stewardship = 5
				intrigue = 5
			}
		}
		new_character = {
			d_mazdaki = { grant_title = PREV }
			set_defacto_liege = ROOT
			save_event_target_as = new_mazdaki_leader
			ROOT = {
				random_realm_title = {
					limit = { is_holy_site = ROOT }
					gain_title = PREVPREV
				}
			}
		}
	}	
	
	option = {
		name = I_SEE
		trigger = {
			NOT = { religion = mazdaki }
		}
		event_target:new_mazdaki_leader = { }
	}
	option = {
		name = EVTOPTA_GoPagan_258
		trigger = { religion = mazdaki }
		event_target:new_mazdaki_leader = { }
	}
}

# Mazdaki Power chosen
character_event = {
	id = GoPagan.259
	desc = EVTDESC_GoPagan_259
	picture = GFX_evt_knight_kneeling
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_GoPagan_259
		add_character_modifier = {
			name = patron_discernment
			duration = -1
		}
	}
	option = {
		name = EVTOPTB_GoPagan_259
		add_character_modifier = {
			name = patron_understanding
			duration = -1
		}
	}
	option = {
		name = EVTOPTC_GoPagan_259
		add_character_modifier = {
			name = patron_preservation
			duration = -1
		}
	}
	option = {
		name = EVTOPTD_GoPagan_259
		add_character_modifier = {
			name = patron_joy
			duration = -1
		}
	}
}

#######################################
# YAZIDI EVENTS
#######################################

### PEACOCK FEAST EVENTS

# Invite vassals to festival
character_event = {
	id = GoPagan.260
	desc = EVTDESC_GoPagan_260
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	only_rulers = yes
	min_age = 16
	has_character_flag = planning_peacock_feast
	only_capable = yes
	prisoner = no
	war = no
	
	trigger = {
		NOT = { month = 5 }
		month = 10
		NOT = { has_character_modifier = do_not_disturb }
		NOT = { is_inaccessible_trigger = yes }
	}
	
	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = EVTOPTA_GoPagan_260
		clr_character_flag = planning_peacock_feast
		set_character_flag = holding_peacock_feast
		any_vassal = {
			limit = {
				religion = yazidi
				prisoner = no
				NOT = { trait = incapable }
				NOT = { has_character_modifier = do_not_disturb }
				war = no
				is_adult = yes
			}
			letter_event = { id = GoPagan.261 tooltip = EVTTOOLTIP1_RoI_1000 } #send out invitations
		}
		hidden_tooltip = {
			character_event = { id = GoPagan.264 days = 12 } # start the feast
			add_character_modifier = {
				name = do_not_disturb
				days = 85
				hidden = yes
			}
		}
		if = {
			limit = { is_inaccessible_trigger = yes	}
			end_inaccessibility_effect = yes
			add_character_modifier = {
				name = went_out_of_hiding_timer
				duration = 180
				hidden = yes
			}
			hidden_tooltip = { character_event = { id = CM.6400 } } # Notify plotters and family
		}
	}
}

# Vassal receives invitation
letter_event = {
	id = GoPagan.261
	desc = EVTDESC_GoPagan_261
	border = GFX_event_letter_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_TOG_701 #Travel to the feast
		set_character_flag = attending_peacock_feast
		hidden_tooltip = {
			character_event = { id = GoPagan.263 days = 12 } #Arrives at the feast
			add_character_modifier = {
				name = do_not_disturb
				days = 45
				hidden = yes
			}
		}
		if = {
			limit = { is_inaccessible_trigger = yes	}
			end_inaccessibility_effect = yes
			add_character_modifier = {
				name = went_out_of_hiding_timer
				duration = 180
				hidden = yes
			}
			hidden_tooltip = { character_event = { id = CM.6400 } } # Notify plotters and family
		}
	}
}

# Vassal arrives at festival
character_event = {
	id = GoPagan.263
	desc = EVTDESC_GoPagan_263
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	trigger = {
		liege = { has_character_flag = holding_peacock_feast }
	}		
	
	option = {
		name = EVTOPTA_GoPagan_263
		hidden_tooltip = {
			character_event = { id = GoPagan.265 days = 5 } #Presentation of the Senjaq
			character_event = { id = GoPagan.270 days = 10 } #Veneration of the Senjaq
			character_event = { id = GoPagan.271 days = 15 } #Taxes on the Pious
			character_event = { id = GoPagan.272 days = 20 } #Sermon
			character_event = { id = GoPagan.273 days = 30 } #End festival
		}
	}
}

# Festival begins
character_event = {
	id = GoPagan.264
	desc = EVTDESC_GoPagan_264
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	has_character_flag = holding_peacock_feast
	
	option = {
		name = EVTOPTA_GoPagan_263
		hidden_tooltip = {
			character_event = { id = GoPagan.265 days = 5 } #Presentation of the Senjaq
			character_event = { id = GoPagan.270 days = 10 } #Veneration of the Senjaq
			character_event = { id = GoPagan.271 days = 15 } #Taxes on the Pious
			character_event = { id = GoPagan.272 days = 20 } #Sermon
			character_event = { id = GoPagan.273 days = 30 } #End festival
		}
	}
}

# Presentation of the Senjaq
character_event = {
	id = GoPagan.265
	title = EVTNAME_GoPagan_265
	desc = EVTDESC_GoPagan_265
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	trigger = {
		OR = {
			has_character_flag = holding_peacock_feast
			liege = { has_character_flag = holding_peacock_feast }
		}
	}
	
	option = {
		name = EVTOPTA_GoPagan_265
		trigger = { is_female = no }
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 2
				is_strong_trigger = yes
			}
			modifier = {
				factor = 3
				trait = zealous
			}
			modifier = {
				factor = 0.1
				is_ill = yes
			}
			modifier = {
				factor = 0.5
				age = 50
			}
		}
		piety = 30
		hidden_tooltip = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						NOR = {
							age = 50
							is_weak_trigger = yes
							trait = infirm
							health_traits = 1
						}
					}
					character_event = { id = GoPagan.266 tooltip = SENJAQ_DROPPED }  # Drop the senjaq
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = possessed
							NOT = { trait = zealous }
						}
					}
					character_event = { id = GoPagan.267 tooltip = SENJAQ_POSSESSED } # Character becomes possessed
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = cynical
							trait = zealous
						}
					}
					character_event = { id = GoPagan.268 tooltip = SENJAQ_ZEALOUS } # Character becomes zealous
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							is_strong_trigger = yes
							trait = slothful
							health_traits = 1
							is_ill = yes
						}
					}
					character_event = { id = GoPagan.269 tooltip = SENJAQ_STRONGER } # Character becomes stronger
				}
				300 = {} # No event
			}
		}
	}
	option = {
		name = EVTOPTB_GoPagan_265
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				trait = craven
			}
			modifier = {
				factor = 2
				is_weak_trigger = yes
			}
			modifier = {
				factor = 3
				trait = cynical
			}
			modifier = {
				factor = 4
				NOT = { piety = 100 }
			}
		}
		piety = 10
	}
}

# Weak or old character drops the senjaq
character_event = {
	id = GoPagan.266
	desc = EVTDESC_GoPagan_266
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_GoPagan_266
		prestige = -100
		piety = -50
	}
}

# Character becomes possessed by senjaq
character_event = {
	id = GoPagan.267
	desc = EVTDESC_GoPagan_267
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_GoPagan_267
		add_trait = possessed
	}
}

# Character becomes zealous
character_event = {
	id = GoPagan.268
	desc = EVTDESC_GoPagan_268
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_GoPagan_268
		add_trait = zealous
	}
}

# Character becomes stronger
character_event = {
	id = GoPagan.269
	desc = EVTDESC_GoPagan_269
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_GoPagan_269
		if = {
			limit = {
				is_weak_trigger = no
				is_strong_trigger = no
			}
			add_trait = robust
		}
		if = {
			limit = { is_weak_trigger = yes }
			remove_trait = weak
			remove_trait = feeble
		}
	}
}

# Veneration of the Senjaq
character_event = {
	id = GoPagan.270
	title = EVTNAME_GoPagan_270
	desc = EVTDESC_GoPagan_270
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	trigger = {
		OR = {
			has_character_flag = holding_peacock_feast
			liege = { has_character_flag = holding_peacock_feast }
		}
	}
	
	option = {
		name = EVTOPTA_GoPagan_270
		piety = 10
		random_list = {
			30 = {
				modifier = {
					factor = 0
					OR = {
						trait = humble
						trait = proud
					}
				}
				add_trait = humble
			}
			30 = {
				modifier = {
					factor = 0
					OR = {
						trait = temperate
						trait = gluttonous
					}
				}
				add_trait = temperate
			}
			20 = {
				prestige = 25
			}
			40 = {
			}
		}
	}
}

# Donation of Money
character_event = {
	id = GoPagan.271
	title = EVTNAME_GoPagan_271
	desc = EVTDESC_GoPagan_271
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	trigger = {
		controls_religion = no
		OR = {
			has_character_flag = holding_peacock_feast
			liege = { has_character_flag = holding_peacock_feast }
		}
	}
	
	option = { # GIVE A LOT
		name = EVTOPTA_GoPagan_271
		trigger = {
			NOT = { trait = greedy }
			NOT = { trait = cynical }
		}
		piety = 50
		if = {
			limit = { religion_head = { always = yes } }
			religion_head = {
				ROOT = { transfer_scaled_wealth = { to = PREV value = 0.25 } }
			}
		}
		if = {
			limit = { NOT = { religion_head = { always = yes } } }
			scaled_wealth = -0.25
		}
		add_trait = charitable
	}
	option = { # GIVE SOME
		name = EVTOPTB_GoPagan_271
		piety = 10
		if = {
			limit = { religion_head = { always = yes } }
			religion_head = {
				ROOT = { transfer_scaled_wealth = { to = PREV value = 0.05 } }
			}
		}
		if = {
			limit = { NOT = { religion_head = { always = yes } } }
			scaled_wealth = -0.05
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
	}
	option = { # BUGGER THAT
		name = EVTOPTC_GoPagan_271
		trigger = {
			NOT = { trait = charitable }
			NOT = { trait = zealous }
		}
		piety = -25
		if = {
			limit = {
				NOT = { trait = greedy }
			}
			random = {
				chance = 25
				add_trait = greedy
			}
		}
		if = {
			limit = {
				NOT = { trait = cynical }
			}
			random = {
				chance = 25
				add_trait = cynical
			}
		}
	}
}

# Sermon - host and guests
character_event = {
	id = GoPagan.272
	desc = EVTDESC_GoPagan_272
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	trigger = {
		OR = {
			has_character_flag = holding_peacock_feast
			liege = { has_character_flag = holding_peacock_feast }
		}
	}
	
	option = {
		name = EVTOPTA_GoPagan_272
	}
}

# Festival ends
character_event = {
	id = GoPagan.273
	desc = EVTDESC_GoPagan_273
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			has_character_flag = holding_peacock_feast
			liege = { has_character_flag = holding_peacock_feast }
		}
	}
	
	option = {
		name = EVTOPTA_GoPagan_273
		trigger = { has_character_flag = holding_peacock_feast }
		set_character_flag = held_recent_feast
		clr_character_flag = holding_peacock_feast
		hidden_tooltip = { remove_character_modifier = do_not_disturb }
	}
	option = {
		name = EVTOPTA_GoPagan_273
		trigger = { NOT = { has_character_flag = holding_peacock_feast } }
		clr_character_flag = attending_peacock_feast
		hidden_tooltip = { remove_character_modifier = do_not_disturb }
		liege = {
			reverse_opinion = {
				modifier = opinion_enjoyed_feast
				who = ROOT
				years = 2
			}
		}
	}
}

# The feast is cancelled due to war
character_event = {
	id = GoPagan.274
	desc = EVTDESC72112
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	only_rulers = yes
	war = yes

	trigger = {
		OR = {
			has_character_flag = holding_peacock_feast
			has_character_flag = planning_peacock_feast
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = EVTOPTA72112
		if = {
			limit = { has_character_flag = planning_peacock_feast }
			clr_character_flag = planning_peacock_feast
			scaled_wealth = 0.25
		}
		hidden_tooltip = {
			clr_character_flag = holding_peacock_feast
			set_character_flag = held_recent_feast
			remove_character_modifier = do_not_disturb
		}
		any_vassal = {
			limit = { has_character_flag = attending_peacock_feast }
			letter_event = {
				id = GoPagan.275
				tooltip = EVTTOOLTIP72113
			}
			hidden_tooltip = {
				remove_character_modifier = do_not_disturb
				clr_character_flag = attending_peacock_feast
			}
		}
	}
}

# Feast cancelled: notify invited vassals
letter_event = {
	id = GoPagan.275
	desc = EVTDESC72113
	border = GFX_event_letter_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA72113
	}
}

# The feast is cancelled due to death of liege
character_event = {
	id = GoPagan.276
	
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		OR = {
			has_character_flag = holding_peacock_feast
			has_character_flag = planning_peacock_feast
		}
	}

	immediate = {
		if = {
			limit = { has_character_flag = planning_peacock_feast }
			clr_character_flag = planning_peacock_feast
			scaled_wealth = 0.25
		}
		hidden_tooltip = {
			clr_character_flag = holding_peacock_feast
			remove_character_modifier = do_not_disturb
		}
		any_vassal = {
			limit = { has_character_flag = attending_peacock_feast }
			character_event = { id = GoPagan.277 }
			hidden_tooltip = {
				remove_character_modifier = do_not_disturb
				clr_character_flag = attending_peacock_feast
			}
		}
	}
}

# Feast cancelled: notify invited vassals
character_event = {
	id = GoPagan.277
	desc = EVTDESC_GoPagan_277
	picture = GFX_evt_death
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_GoPagan_277
	}
}

### KOASASA EVENTS

# Yazidi youth is believed to be a koasasa
narrative_event = {
	id = GoPagan.278
	title = EVTNAME_GoPagan_278
	picture = GFX_evt_imam
	border = GFX_event_narrative_frame_religion
	
	desc = {
		text = EVTDESC_GoPagan_278_taus
		trigger = { ROOT = { trait = koasasa_taus } }
	}
	desc = {
		text = EVTDESC_GoPagan_278_israfel
		trigger = { ROOT = { trait = koasasa_israfel } }
	}
	desc = {
		text = EVTDESC_GoPagan_278_azrael
		trigger = { ROOT = { trait = koasasa_azrael } }
	}
	desc = {
		text = EVTDESC_GoPagan_278_mihael
		trigger = { ROOT = { trait = koasasa_mihael } }
	}
	desc = {
		text = EVTDESC_GoPagan_278_dardael
		trigger = { ROOT = { trait = koasasa_dardael } }
	}
	desc = {
		text = EVTDESC_GoPagan_278_samael
		trigger = { ROOT = { trait = koasasa_samael } }
	}
	desc = {
		text = EVTDESC_GoPagan_278_nurael
		trigger = { ROOT = { trait = koasasa_nurael } }
	}
	
	major = yes
	hide_from = yes
	show_ROOT = yes
	
	religion = yazidi
	only_men = yes
	capable_only = yes
	min_age = 15
	max_age = 19
	prisoner = no
	
	trigger = {
		is_reincarnated = no
		calc_true_if = {
			amount = 2
			trait = possessed
			is_smart_trigger = yes
			trait = fair
			martial = 15
			martial = 20
			diplomacy = 15
			stewardship = 15
			intrigue = 15
			learning = 15
		}
		NOR = {
			trait = cynical
			trait = inbred
			is_dumb_trigger = yes
			is_weak_trigger = yes
			trait = clubfooted
			trait = harelip
			trait = hunchback
			trait = lisp
			trait = stutter
			trait = ugly
			trait = dwarf
		}
		OR = {
			NOT = { koasasa_taus = { is_alive = yes } }
			NOT = { koasasa_israfel = { is_alive = yes } }
			NOT = { koasasa_azrael = { is_alive = yes } }
			NOT = { koasasa_mihael = { is_alive = yes } }
			NOT = { koasasa_dardael = { is_alive = yes } }
			NOT = { koasasa_samael = { is_alive = yes } }
			NOT = { koasasa_nurael = { is_alive = yes } }
		}
	}
	
	major_trigger = {
		religion = yazidi
		same_realm = ROOT	
	}
	
	mean_time_to_happen = {
		months = 1200
		modifier = {
			factor = 0.5
			ai = no
		}
		modifier = {
			factor = 1.25
			NOR = {
				martial = 15
				diplomacy = 15
				stewardship = 15
				intrigue = 15
				learning = 15
			}
		}
		modifier = {
			factor = 0.75
			trait = zealous
		}
		modifier = {
			factor = 0.5
			trait = possessed
		}
		modifier = {
			factor = 0.5
			NOT = { koasasa_taus = { is_alive = yes } }
			NOT = { koasasa_israfel = { is_alive = yes } }
			NOT = { koasasa_azrael = { is_alive = yes } }
			NOT = { koasasa_mihael = { is_alive = yes } }
			NOT = { koasasa_dardael = { is_alive = yes } }
			NOT = { koasasa_samael = { is_alive = yes } }
			NOT = { koasasa_nurael = { is_alive = yes } }
		}
		modifier = {
			factor = 0.5
			calc_true_if = {
				amount = 3
				trait = possessed
				is_smart_trigger = yes
				trait = fair
				martial = 15
				martial = 20
				diplomacy = 15
				stewardship = 15
				intrigue = 15
				learning = 15
			}
		}
		modifier = {
			factor = 0.25
			calc_true_if = {
				amount = 4
				trait = possessed
				is_smart_trigger = yes
				trait = fair
				martial = 15
				martial = 20
				diplomacy = 15
				stewardship = 15
				intrigue = 15
				learning = 15
			}
		}
	}
	
	immediate = {
		ROOT = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						koasasa_taus = { is_alive = yes }
					}
					add_trait = koasasa_taus
				}
				10 = {
					modifier = {
						factor = 0
						koasasa_israfel = { is_alive = yes }
					}
					add_trait = koasasa_israfel
				}
				10 = {
					modifier = {
						factor = 0
						koasasa_azrael = { is_alive = yes }
					}
					add_trait = koasasa_azrael
				}
				10 = {
					modifier = {
						factor = 0
						koasasa_mihael = { is_alive = yes }
					}
					add_trait = koasasa_mihael
				}
				10 = {
					modifier = {
						factor = 0
						koasasa_dardael = { is_alive = yes }
					}
					add_trait = koasasa_dardael
				}
				10 = {
					modifier = {
						factor = 0
						koasasa_samael = { is_alive = yes }
					}
					add_trait = koasasa_samael
				}
				10 = {
					modifier = {
						factor = 0
						koasasa_nurael = { is_alive = yes }
					}
					add_trait = koasasa_nurael
				}
			}
		}			
	}
	
	option = {
		name = EVTOPTA_GoPagan_278
		trigger = { character = ROOT }
		piety = 250
	}
	option = {
		name = EVTOPTB_GoPagan_278
		trigger = { NOT = { character = ROOT } }
	}
}

### YAZIDI PILGRIMAGE EVENTS

# Preparing for the pilgrimage
character_event = {
	id = GoPagan.279
	desc = EVTDESC_GoPagan_279
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5016 #I will start making travel plans
		set_character_flag = pilgrimage_to_lalish
		hidden_tooltip = {
			character_event = { id = GoPagan.280 days = 15 }
			add_character_modifier = {
				name = do_not_disturb
				days = 15
				hidden = yes
			}
		}
		if = {
			limit = { ai = no }
			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_LALISH
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}
}

# Setting out for Lalish (also selects events for road)
character_event = {
	id = GoPagan.280
	desc = EVTDESC_GoPagan_280
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SoA_5022 #My journey begins!
		clr_character_flag = preparing_yazidi_pilgrimage
		hidden_tooltip = {
			add_trait = on_pilgrimage
			set_character_flag = good_pilgrimage
			narrative_event = { id = GoPagan.281 days = 30 }
		}
		hidden_tooltip = {
			if = {
				limit = {
					location = {
						distance = {
							where = 697	# Mosul
							value = 600	# Even Longer journey
						}
					}
				}
				random_list = {
					10 = {  character_event = { id = SoA.5026 days = 5 random = 4 } } # List for even longer journeys only
					10 = {  character_event = { id = SoA.5027 days = 5 random = 4 } }
					10 = {  narrative_event = { id = SoA.5028 days = 5 random = 4 } }
					10 = {  character_event = { id = SoA.5029 days = 5 random = 4 } }
					10 = {  character_event = { id = SoA.5030 days = 5 random = 4 } }
				}
			}
			
			if = {
				limit = {
					location = {
						distance = {
							where = 697	# Mosul
							value = 400	# Longer journey
						}
					}
				}
				random_list = {
					10 = {  character_event = { id = SoA.5026 days = 10 random = 5 } } # List for longer journeys only
					10 = {  character_event = { id = SoA.5027 days = 10 random = 5 } }
					10 = {  narrative_event = { id = SoA.5028 days = 10 random = 5 } }
					10 = {  character_event = { id = SoA.5029 days = 10 random = 5 } }
					10 = {  character_event = { id = SoA.5030 days = 10 random = 5 } }
				}
			}
	
			random_list = {
				10 = {  character_event = { id = SoA.5031 days = 16 random = 6 } } # List that is always checked
				10 = {  character_event = { id = SoA.5032 days = 16 random = 6 } }
				10 = {  narrative_event = { id = SoA.5033 days = 16 random = 6 } }
				10 = {  character_event = { id = SoA.5034 days = 16 random = 6 } }
				10 = {  character_event = { id = SoA.5035 days = 16 random = 6 } }
				10 = {  character_event = { id = SoA.5036 days = 16 random = 6 } }
				10 = {  character_event = { id = SoA.5037 days = 16 random = 6 } }
				10 = {  character_event = { id = SoA.5038 days = 16 random = 6 } }
				10 = {  character_event = { id = SoA.5039 days = 16 random = 6 } }
			}
		}
	}
}

# Arrived at Lalish (also selects events while in the city)
narrative_event = {
	id = GoPagan.281
	title = EVTNAME_GoPagan_281
	desc = EVTDESC_GoPagan_281
	picture = GFX_evt_yazidi
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		random_list = {
			10 = {
				if = {
					limit = { NOT = { trait = cynical } }
					character_event = { id = SoA.5056 }   # Stimulated to learning
				}
				if = {
					limit = { trait = cynical }
					random_list = {
						20 = { character_event = { id = SoA.5057 } }  # Strong religious experience
						10 = { character_event = { id = SoA.5058 } }  # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } }  # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } }  # Generally impressed
					}
				}
			}
			10 = {
				if = {
					limit = {
						OR = {
							trait = mastermind_theologian
							trait = scholarly_theologian
						}
					}
					character_event = { id = SoA.5059 }  # Mastermind theologian impresses everyone
				}
				if = {
					limit = {
						NOT = { trait = mastermind_theologian }
						NOT = { trait = scholarly_theologian }
					}
					random_list = {
						20 = { character_event = { id = SoA.5057 } }  # Strong religious experience
						10 = { character_event = { id = SoA.5058 } }  # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } }  # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } }  # Generally impressed
					}
				}
			}
			10 = {
				if = {
					limit = { trait = lustful }
					character_event = { id = SoA.5062 }    # Lustful tourist having fun
				}
				if = {
					limit = { NOT = { trait = lustful }	}
					random_list = {
						20 = { character_event = { id = SoA.5057 } }  # Strong religious experience
						10 = { character_event = { id = SoA.5058 } }  # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } }  # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } }  # Generally impressed
					}
				}
			}
			10 = {
				if = {
					limit = { trait = homosexual }
					character_event = { id = SoA.5063 }    # Freedom
				}
				if = {
					limit = { NOT = { trait = homosexual } }
					random_list = {
						20 = {  character_event = { id = SoA.5057 } }  # Strong religious experience
						10 = {  character_event = { id = SoA.5058 } }  # Disappointed in the place
						20 = {  character_event = { id = SoA.5060 } }  # Learns things of the world - cosmopolitan
						20 = {  character_event = { id = SoA.5061 } }  # Generally impressed
					}
				}
			}
			10 = {                  # Monks cure pilgrim of disease - attributed to God's hand?
				if = {
					limit = {
						OR = {
							trait = ill
							trait = pneumonic
							trait = syphilitic
						}
					}
					narrative_event = { id = SoA.5064 }
				}
				if = {
					limit = {
						NOR = {
							trait = ill
							trait = pneumonic
							trait = syphilitic							
						}
					}
					random_list = {
						20 = {  character_event = { id = SoA.5057 } }  # Strong religious experience
						10 = {  character_event = { id = SoA.5058 } }  # Disappointed in the place
						20 = {  character_event = { id = SoA.5060 } }  # Learns things of the world - cosmopolitan
						20 = {  character_event = { id = SoA.5061 } }  # Generally impressed
					}
				}
			}
			10 = {
				if = {
					limit = {
						OR = {
							trait = lunatic
							trait = possessed
						}
					}
					character_event = { id = SoA.5065 }  # Lunatic/possessed decides (s)he is God
				}
				if = {
					limit = {
						NOR = {
							trait = lunatic
							trait = possessed							
						}
					}
					random_list = {
						20 = {  character_event = { id = SoA.5057 } }  # Strong religious experience
						10 = {  character_event = { id = SoA.5058 } }  # Disappointed in the place
						20 = {  character_event = { id = SoA.5060 } }  # Learns things of the world - cosmopolitan
						20 = {  character_event = { id = SoA.5061 } }  # Generally impressed
					}
				}
			}
			10 = {
				if = {
					limit = {
						OR = {
							trait = drunkard
							trait = hedonist
						}
					}
					character_event = { id = SoA.5066 }  # Drunkard/hedonist event
				}
				if = {
					limit = {
						NOR = {
							trait = drunkard
							trait = hedonist
						}
					}
					random_list = {
						20 = {  character_event = { id = SoA.5057 } }  # Strong religious experience
						10 = {  character_event = { id = SoA.5058 } }  # Disappointed in the place
						20 = {  character_event = { id = SoA.5060 } }  # Learns things of the world - cosmopolitan
						20 = {  character_event = { id = SoA.5061 } }  # Generally impressed
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTA_GoPagan_281
		if = {
			limit = { trait = decadent }
			remove_trait = decadent
		}	
	}
}

# Good pilgrimage
character_event = {
	id = GoPagan.282
	desc = EVTDESC_SoA_5091
	picture = GFX_evt_castle_construction
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SoA_5091 #A great experience!
		clr_character_flag = pilgrimage_to_lalish
		clr_character_flag = good_pilgrimage
		add_trait = yazidi_pilgrim
		hidden_tooltip = { remove_trait = on_pilgrimage }
		hidden_tooltip = { change_variable = { which = "lifestyle_learning" value = 1 } }
		piety = 30
	}
}

# Disappointing pilgrimage
character_event = {
	id = GoPagan.283
	desc = EVTDESC_SoA_5092
	picture = GFX_evt_castle_construction
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SoA_5092 #I won't tell my family what really happened out there
		clr_character_flag = pilgrimage_to_lalish
		clr_character_flag = bad_pilgrimage
		add_trait = yazidi_pilgrim
		hidden_tooltip = { remove_trait = on_pilgrimage }
		hidden_tooltip = { change_variable = { which = "lifestyle_learning" value = 1 } }
		piety = -10
		if = {
			limit = { NOT = { trait = cynical } }
			random = {
				chance = 20
				add_trait = cynical
			}
		}
	}
}

# Abominable pilgrimage - very unusual outcome
character_event = {
	id = GoPagan.284
	desc = EVTDESC_SoA_5093
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SoA_5093
		clr_character_flag = pilgrimage_to_lalish
		clr_character_flag = abominable_pilgrimage
		add_trait = yazidi_pilgrim
		hidden_tooltip = { remove_trait = on_pilgrimage }
		hidden_tooltip = { change_variable = { which = "lifestyle_learning" value = 1 } }
		piety = -100
		if = {
			limit = { NOT = { trait = cynical } }
			random = {
				chance = 50
				add_trait = cynical
			}
		}
	}
}

### YAZIDI HERESY DECLARATION

# Yazidi ruler declares his faith no longer a heresy
narrative_event = {
	id = GoPagan.285
	title = EVTNAME_GoPagan_285
	desc = EVTDESC_GoPagan_285
	picture = GFX_evt_zoroaster
	
	is_triggered_only = yes
	major = yes
	show_ROOT = yes
	hide_from = yes
	
	option = {
		name = EVTOPTA_GoPagan_285
		trigger = { religion = yazidi }
	}
	option = {
		name = EVTOPTB_GoPagan_285
		trigger = { religion_group = muslim }
	}
	option = {
		name = I_SEE
		trigger = {
			NOR = {
				religion = yazidi
				religion_group = muslim
			}
		}
	}
}

