#############################################
#
# On Hajj Event Series
#
# Event ID 86000-86999 is reserved
#
#############################################

#############################
# Start Event
#############################
letter_event = {
	id = 86000
	desc = "EVTDESC86000"
	border = GFX_event_letter_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86000"
		piety = 5
		set_character_flag = preparing_hajj
		hidden_tooltip = {
			add_character_modifier = {
				name = do_not_disturb
				days = 12
				hidden = yes
			}
			character_event = { id = 86100 days = 12 }
		}	
	}
}


###########################################
# Preparation..  random events that can happen. one will
###########################################

#Invite a courtier to come.
character_event = {
	id = 86001
	desc = "EVTDESC86001"
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion

	prisoner = no
	religion_group = muslim
	has_character_flag = preparing_hajj
	
	trigger = {
		any_courtier = {
			is_female = no
			age = 20
			prisoner = no
			NOT = { health_traits = 1 }
			NOT = { trait = on_hajj }
			NOT = { trait = hajjaj }
			NOT = { is_inaccessible_trigger = yes }
			religion_group = muslim
			is_not_busy_trigger = yes
		}
		NOT = {
			any_child = {
				is_adult = yes
				is_female = no
				prisoner = no
				NOT = { health_traits = 1 }
				NOT = { trait = on_hajj }
				NOT = { trait = hajjaj }
				host = { character = ROOT }
				NOT = { trait = cynical }
				is_ruler = no
				religion_group = muslim
				is_not_busy_trigger = yes
			}
			has_character_flag = hajj_company
		}
	}
	
	mean_time_to_happen = {
		days = 24
	}	

	immediate = {	
		random_courtier = {
			limit = {
				is_female = no
				age = 20
				prisoner = no
				NOT = { health_traits = 1 }
				religion_group = muslim
				NOT = { trait = on_hajj }
				NOT = { trait = hajjaj }
				NOT = { is_inaccessible_trigger = yes }
				is_not_busy_trigger = yes
			}
			save_event_target_as = invite_to_hajj
		}
		set_character_flag = hajj_company
	}
	
	option = {
		name = "EVTOPTA86001"
		ai_chance = {
			factor = 10
			modifier = {
				factor = 20
				trait = gregarious
			}
			modifier = {
				factor = 20
				trait = charitable
			}
			modifier = {
				factor = 0
				trait = greedy
			}
		}
		scaled_wealth = -0.05
		event_target:invite_to_hajj = {
			add_trait = on_hajj
			opinion = { 
				modifier = opinion_bring_on_hajj
				who = ROOT
			}
			reverse_opinion = { 
				modifier = opinion_bring_on_hajj
				who = ROOT
			}			
			hidden_tooltip = {
				character_event = { id = 86100 days = 3 }
			}
		}
	}
	option = {
		name = "EVTOPTB86001"
		trigger = { NOT = { trait = charitable } }
		piety = -5	
	}
}


# older liege, berate him to come on hajj.
character_event = {
	id = 86010
	desc = "EVTDESC86010"
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = preparing_hajj
	
	trigger = {
		NOT = { has_character_flag = hajj_company }
		liege = {
			war = no
			#is_female = no
			age = 40
			religion_group = muslim
			NOT = { health_traits = 1 }
			NOT = { trait = on_hajj }
			NOT = { trait = hajjaj }
			NOT = { has_character_flag = preparing_hajj }
			NOT = {	has_character_flag = ramadan }
			NOT = {	has_character_flag = asked_on_hajj }
			is_not_busy_trigger = yes
		}
	}
	
	mean_time_to_happen = {
		days = 24
	}	

	immediate = {
		set_character_flag = hajj_company
	}
	
	option = {
		name = "EVTOPTA86010"
		ai_chance = {
			factor = 10
			modifier = {
				factor = 5
				trait = gregarious
			}
			modifier = {
				factor = 5
				trait = zealous
			}
		}		
		liege = {
			letter_event = { id = 86011 days = 1 random = 2 tooltip = EVTTOOLTIP86011 }
			set_character_flag = asked_on_hajj
		}	
	}
	option = {
		name = "EVTOPTB86010"
		piety = -5		
	}
}

#liege gets event asking him to come.
letter_event = {
	id = 86011
	desc = "EVTDESC86011"
	border = GFX_event_letter_frame_religion
	
	prisoner = no
	war = no
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = on_hajj }
		NOT = { trait = hajjaj }
		NOT = { has_character_flag = preparing_hajj }
	}
	
	option = {
		name = "EVTOPTA86011"
		ai_chance = {
			factor = 5
			modifier = {
				factor = 5
				age = 50
			}
			modifier = {
				factor = 20
				trait = zealous
			}
		}	
		reverse_opinion = { 
			who = FROM
			modifier = opinion_bring_on_hajj
		}		
		FROM = {
			letter_event = { id = 86012 days = 1 random = 2 tooltip = EVTTOOLTIP86012 }
		}
		hidden_tooltip = {
			character_event = { id = 86100 }
		}
		prestige = -5
		clr_character_flag = asked_on_hajj
	}
	option = {
		name = "EVTOPTB86011"
		FROM = {
			letter_event = { id = 86013 days = 1 random = 2 tooltip = EVTTOOLTIP86013 }
		}
		piety = -25
		clr_character_flag = asked_on_hajj
		reverse_opinion = { 
			modifier = opinion_declined_hajj
			who = FROM
		}		
	}
}

#our liege is coming..
letter_event = {
	id = 86012
	desc = "EVTDESC86012"
	border = GFX_event_letter_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86012"
		reverse_opinion = { 
			modifier = opinion_bring_on_hajj
			who = FROM
		}
		prestige = 25		
	}
}

#our liege is NOT coming..
letter_event = {
	id = 86013
	desc = "EVTDESC86013"
	border = GFX_event_letter_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86013"
		reverse_opinion = { 
			who = FROM
			modifier = opinion_attepmt_hajj
		}
		prestige = -10
	}
}

# our liege gives us advice.
character_event = {
	id = 86015
	desc = "EVTDESC86015"
	picture = GFX_evt_bandits
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = preparing_hajj
	
	trigger = {
		liege = {
			trait = hajjaj
			is_female = no
			age = 20
		}
		NOT = {	at_location = 719 }  #no danger when near mecca already :)
		NOT = { has_character_flag = hajj_company }
	}
	
	mean_time_to_happen = {
		days = 24
	}	
	
	immediate = {
		set_character_flag = hajj_company
	}
	
	option = {
		name = "EVTOPTA86015"
		scaled_wealth = -0.20
		set_character_flag = hajj_bring_guards
			
	}
	
	option = {
		name = "EVTOPTB86015"
		prestige = -10
		set_character_flag = hajj_travel_lightly
	
	}
}


#adult son wants to go with you.
character_event = {
	id = 86020
	desc = "EVTDESC86020"
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion

	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = preparing_hajj
	
	trigger = {
		NOT = { has_character_flag = hajj_company }
		any_child = {
			is_adult = yes
			is_female = no
			prisoner = no
			NOT = { health_traits = 1 }
			NOT = { trait = on_hajj }
			NOT = { trait = hajjaj }
			host = { character = ROOT }
			NOT = { trait = cynical }
			is_ruler = no
			religion_group = muslim
			is_not_busy_trigger = yes
		}
	}
	
	mean_time_to_happen = {
		days = 24
	}
	
	immediate = {
		set_character_flag = hajj_company
		random_child = {
			limit = {
				is_adult = yes
				is_female = no
				prisoner = no
				NOT = { health_traits = 1 }
				NOT = { trait = on_hajj }
				NOT = { trait = hajjaj }
				host = { character = ROOT }
				NOT = { trait = cynical }
				is_ruler = no
				religion_group = muslim
				is_not_busy_trigger = yes
			}
			save_event_target_as = target_child
		}
	}
	
	option = {
		name = "EVTOPTA86020"
		scaled_wealth = -0.1
		event_target:target_child = {
			add_trait = on_hajj
			opinion = { 
				modifier = opinion_bring_on_hajj
				who = ROOT
			}
			reverse_opinion = { 
				modifier = opinion_bring_on_hajj
				who = ROOT
			}			
			hidden_tooltip = {
				character_event = { id = 86100 days = 3 }
			}
		}		
	}
	
	option = {
		name = "EVTOPTB86020"
		event_target:target_child = {
			opinion = { 
				modifier = opinion_refused_hajj
				who = ROOT
			}
		}
	}
}

##########################################################################
# Hajj Starting!
##########################################################################
character_event = {
	id = 86100
	desc = "EVTDESC86100"
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
	}
	
	option = {
		name = "EVTOPTA86100"
		clr_character_flag = preparing_hajj
		add_trait = on_hajj
		if = {
			limit = { ai = no }
			chronicle = {
				entry = CHRONICLE_WENT_ON_HAJJ
				picture = GFX_evt_kaaba
			}
		}
		hidden_tooltip = {
			character_event = { id = 86300 days = 30 }
		}
		hidden_tooltip = {
			if = {
				limit = {
					location = {
						distance = {
							where = 719	#Mecca
							value = 400	#kind of far..
						}
					}
				}
				random_list = {
					10 = {  character_event = { id = 86101 days = 2 random = 8 } }
					10 = {  character_event = { id = 86105 days = 2 random = 8 } }
					10 = {  character_event = { id = 86110 days = 2 random = 8 } }
					10 = {  character_event = { id = 86810 days = 2 random = 8 } }
					10 = {  character_event = { id = 86815 days = 2 random = 8 } }
					10 = {  character_event = { id = 86820 days = 2 random = 8 } }
				}
			}
	
			random_list = {
				10 = {  character_event = { id = 86150 days = 10 random = 10 } }
				10 = {  character_event = { id = 86160 days = 10 random = 10 } }
				10 = {  character_event = { id = 86170 days = 10 random = 10 } }
				10 = {  character_event = { id = 86180 days = 10 random = 10 } }
				10 = {  character_event = { id = 86825 days = 10 random = 10 } }
				10 = {  character_event = { id = 86830 days = 10 random = 10 } }
				10 = {  character_event = { id = 86835 days = 10 random = 10 } }
				10 = {  character_event = { id = 86840 days = 10 random = 10 } }
				10 = {  character_event = { id = 86845 days = 10 random = 10 } }
			}
		}
	}
}

#Bandits!
character_event = {
	id = 86101
	desc = "EVTDESC86101"
	picture = GFX_evt_bandits
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	only_rulers = yes
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86101" #attempt avoid
		trigger = {
			has_character_flag = hajj_travel_lightly
		}
		random = {
			chance = 20
			character_event = { id = 86102 tooltip = EVTTOOLTIP86102 }
			
		}
	}
	option = {
		name = "EVTOPTA86101"
		trigger = {
			NOT = { has_character_flag = hajj_travel_lightly }
		}
		random = {
			chance = 50
			character_event = { id = 86102 tooltip = EVTTOOLTIP86102 }
		}
	}	
	option = {
		name = "EVTOPTB86101"
		trigger = {
			NOT = { has_character_flag = hajj_bring_guards }
		}
		character_event = { id = 86102  tooltip = EVTTOOLTIP86102}
		prestige = 10

	}
	option = {
		name = "EVTOPTB86101"
		trigger = {
			has_character_flag = hajj_bring_guards
		}
		prestige = 10
		random = {
			chance = 5
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}		
	}
}

#Bandits catch us
character_event = {
	id = 86102
	desc = "EVTDESC86102"
	picture = GFX_evt_bandits
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86102"
		trigger = {
			martial = 14
			has_character_flag = hajj_bring_guards
		}
		prestige = 10
		random = {
			chance = 10
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}
	}
	option = {
		name = "EVTOPTA86102"
		tooltip_info = martial
		trigger = {
			martial = 14
			NOT = { has_character_flag = hajj_bring_guards }
		}
		prestige = 30
		random = {
			chance = 25
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}		
	}
	option = {
		name = "EVTOPTB86102"
		trigger = {
			NOT = { martial = 14 }
			has_character_flag = hajj_bring_guards
		}
		prestige = 10
		random = {
			chance = 25
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}		
	}
	
	option = {
		name = "EVTOPTB86102" #fight	
		trigger = {
			NOT = { martial = 14 }
			NOT = { has_character_flag = hajj_bring_guards }
		}
		random = {
			chance = 50
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}		
	}	
	option = {
		name = "EVTOPTC86102"
		trigger = {
			scaled_wealth = 0.5
		}
		scaled_wealth = -0.5
		prestige = -10
	}
}

#Seasick on a ship
character_event = {
	id = 86105
	desc = "EVTDESC86105"
	picture = GFX_evt_kraken
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86105"
		piety = 5
	}
}

#Christian pirates
character_event = {
	id = 86110
	desc = "EVTDESC86110"
	picture = GFX_evt_kraken
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	only_rulers = yes
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86110"
		prestige = -25
	}
	option = {
		name = "EVTOPTB86110"
		piety = 25
		random = {
			chance = 33
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}
	}
}

#Bandits have attacked a fellow on hajj
character_event = {
	id = 86150
	desc = "EVTDESC86150"
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	only_rulers = yes
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86150"
		piety = -20
	}
	option = {
		name = "EVTOPTB86150"
		piety = 5
		random = {
			chance = 33
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}		
		on_hajj = {
			limit = {
				prisoner = no
				NOT = { has_character_flag = hajj_bring_guards }
			}
			opinion = { 
				modifier = opinion_hajj_saved_from_bandit
				who = ROOT
			}
			hidden_tooltip = { character_event = { id = 86151 } }
		}
	}	
}

#Saved from bandits by fellow pilgrims
character_event = {
	id = 86151
	desc = "EVTDESC86151"
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86151"
		reverse_opinion = { 
			modifier = opinion_hajj_saving_on_hajj
			who = FROM
		}
	}
}

#Encountering a rival on the hajj.
character_event = {
	id = 86160
	desc = "EVTDESC86160"
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
		on_hajj = {
			is_rival = ROOT
			prisoner = no
			NOT = { has_character_flag = hajj_arrived_in_mecca }
		}
	}
	
	immediate = {
		random_playable_ruler = {
			limit = {
				is_rival = ROOT
				prisoner = no
				trait = on_hajj
				NOT = { has_character_flag = hajj_arrived_in_mecca }
			}
			set_character_flag = hajj_rival
		}
	}
	
	option = {
		name = "EVTOPTA86160" #Attack him!
		piety = -10
		on_hajj = {
			limit = {
				prisoner = no
				has_character_flag = hajj_rival
			}
			opinion = { 
				modifier = opinion_hajj_attempt_murder
				who = ROOT
			}
			character_event = { id = 86161 tooltip = "EVTTOOLTIP86161" } 
		}
	}
	
	option = {
		name = "EVTOPTB86160" #Attempt befriend
		on_hajj = {
			limit = {
				prisoner = no
				has_character_flag = hajj_rival
			}
			character_event = { id = 86165 tooltip = "EVTTOOLTIP86165" } 
		}
	}
	option = {
		name = "EVTOPTC86160"
		prestige = -10
	}
}

#We have had an ambush
character_event = {
	id = 86161
	desc = "EVTDESC86161"
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86161"
		tooltip_info = martial
		trigger = {
			martial = FROM 
		}
		random_list = {
			80 = {
				FROM = { character_event = { id = 86162 tooltip = EVTTOOLTIP86162 } }
			}
			20 = {
				add_trait = wounded
				hidden_tooltip = { character_event = { id = 38280 } }
				hidden_tooltip = { FROM = { character_event = { id = 86163 } } }
			}
		}
	}
	option = {
		name = "EVTOPTB86161"
		trigger = {
			NOT = { martial = FROM }
		}
		random_list = {
			30 = {
				FROM = { character_event = { id = 86162 tooltip = EVTTOOLTIP86162 } }
			}
			60 = {
				add_trait = wounded
				hidden_tooltip = { character_event = { id = 38280 } }
				hidden_tooltip = { FROM = { character_event = { id = 86163 } } }
			}
			10 = {
				add_maimed_trait_effect = yes
				hidden_tooltip = { FROM = { character_event = { id = 86163 } } }
			}
		}		
	}
	
	option = {
		name = "EVTOPTC86161"
		trigger = {
			OR = {
				trait = paranoid
				trait = ambitious
				has_character_flag = hajj_bring_guards
			}
		}
		prestige = -5
		hidden_tooltip = {
			FROM = { character_event = { id = 86164 }  }
		}
	}

}

#We hurt
character_event = {
	id = 86162
	desc = "EVTDESC86162"
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86162"
		add_trait = wounded
	}
}

#Success!
character_event = {
	id = 86163
	desc = "EVTDESC86163"
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86163"
		prestige = 5
	}
}

#They got away
character_event = {
	id = 86164
	desc = "EVTDESC86164"
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86164"
		prestige = -5
	}
}

#Another hajj is attempting to befriend us.
character_event = {
	id = 86165
	desc = "EVTDESC86165"
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86165"
		FROM = { character_event = { id = 86166 tooltip = EVTTOOLTIP86166 } }
		reverse_opinion = { 
			who = FROM
			modifier = opinion_hajj_rivalry_mended
		}
	}
	option = {
		name = "EVTOPTB86165"
		FROM = { letter_event = { id = 86167 tooltip = EVTTOOLTIP86167 } }
	}
}

#Breaking bread together
character_event = {
	id = 86166
	desc = "EVTDESC86166"
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86166"
		reverse_opinion = { 
			who = FROM
			modifier = opinion_hajj_rivalry_mended
		}
	}
}

#Does not want to reconciliate
letter_event = {
	id = 86167
	desc = "EVTDESC86167"
	border = GFX_event_letter_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA86167"
		prestige = -5
	}
}

#Lose glutton and drunkard...
character_event = {
	id = 86170
	desc = "EVTDESC86170"
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86170"
		trigger = {
			OR = {
				trait = drunkard
				trait = gluttonous
			}
		}
		if = {
			limit = {
				trait = gluttonous
			}
			remove_trait = gluttonous
		}
		if = {
			limit = {
				trait = drunkard
			}
			remove_trait = drunkard
		}
	}
	
	option = {
		name = "EVTOPTB86170"
		trigger = {
			NOT = { trait = drunkard }
			NOT = { trait = gluttonous }
		}	
		piety = 20
	}
}
	
#Lost in the desert
character_event = {
	id = 86180
	desc = "EVTDESC86180"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86180"
		health = -1
		prestige = 25
	}
	
	option = {
		name = "EVTOPTB86180"
		random = {
			chance = 33
			add_trait = trusting
			hidden_tooltip = {
				character_event = {
					id = 38250 #Notify Trusting
				}
			}
		}		
		
	}
}

##########################################################################
# The Hadiths on Hajj.
##########################################################################
character_event = {
	id = 86300
	desc = "EVTDESC86300"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		hidden_tooltip = {
			character_event = { id = 86500 days = 10 }
		}
	}
	
	option = {
		name = "EVTOPTA86300"
		custom_tooltip = {
			text = TOOLTIP_LISTEN_TO_HADITH
			hidden_tooltip = {
				random_list = {
					10 = {  character_event = { id = 86320 } }
					10 = {  character_event = { id = 86330 } }
					10 = {  character_event = { id = 86340 } }
					10 = {  character_event = { id = 86350 } }
					10 = {  character_event = { id = 86360 } }
					10 = {  character_event = { id = 86380 } }
					10 = {  character_event = { id = 86390 } }
					10 = {  character_event = { id = 86400 } }
					10 = {  character_event = { id = 86410 } }
				}
			}		
		}
		scaled_wealth = -0.1
	}
	option = {
		name = "EVTOPTB86300"
		piety = -10
	}
}

#Hadith - Greed
character_event = {
	id = 86320
	desc = "EVTDESC86320"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86320"
		tooltip_info = greedy
		trigger = {
			trait = greedy
		}
		remove_trait = greedy		
	}
	option = {
		name = "EVTOPTB86320"
		trigger = {
			NOT = { trait = greedy }
		}
		scaled_wealth = 0.1
	}
}		

#Hadith - Protect from laziness, cowardice etc
character_event = {
	id = 86330
	desc = "EVTDESC86330"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86330"
		tooltip_info = slothful
		trigger = {
			trait = slothful
		}
		remove_trait = slothful			
	}

	option = {
		name = "EVTOPTB86330"
		trigger = {
			NOT = { trait = slothful }
		}
		prestige = 25
	}
}		

#Hadith - Envy
character_event = {
	id = 86340
	desc = "EVTDESC86340"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86340"
		tooltip_info = envious
		trigger = {
			trait = envious
		}
		remove_trait = envious				
	}
	option = {
		name = "EVTOPTB86340"
		trigger = {
			NOT = { trait = envious }
		}	
		piety = 15	
	}	
}		

#Hadith - Truth
character_event = {
	id = 86350
	desc = "EVTDESC86350"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86350"
		tooltip_info = deceitful
		trigger = {
			trait = deceitful
		}
		remove_trait = deceitful				
		
		
	}

	option = {
		name = "EVTOPTB86350"
		trigger = {
			NOT = { trait = deceitful }
		}	
		change_diplomacy = 1		
	}
}

#Hadith - Cowardice
character_event = {
	id = 86360
	desc = "EVTDESC86360"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86360"
		tooltip_info = craven
		trigger = {
			trait = craven
		}
		remove_trait = craven		
	}
	option = {
		name = "EVTOPTB86360"
		trigger = {
			NOT = { trait = craven }
		}	
		change_martial = 1		
	}
}

#Hadith - Unjust
character_event = {
	id = 86380
	desc = "EVTDESC86380"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86380"
		tooltip_info = arbitrary
		trigger = {
			trait = arbitrary
		}
		remove_trait = arbitrary				
	}
	option = {
		name = "EVTOPTB86380"
		trigger = {
			NOT = { trait = arbitrary }
		}
		change_diplomacy = 1			
	}	
}

#Hadith - Next world
character_event = {
	id = 86390
	desc = "EVTDESC86390"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86390"
		tooltip_info = hedonist
		trigger = {
			trait = hedonist
		}
		remove_trait = hedonist		
	}
	option = {
		name = "EVTOPTB86390"
		trigger = {
			NOT = { trait = hedonist }
		}
		change_stewardship = 1
	}
}

#Hadith - Cynical
character_event = {
	id = 86400
	desc = "EVTDESC86400"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86400"
		tooltip_info = cynical
		trigger = {
			trait = cynical
		}
		remove_trait = cynical
	}
	
	option = {
		name = "EVTOPTB86400"
		trigger = {
			NOT = { trait = cynical }
		}
		change_diplomacy = 1
	}
}

#Hadith - Wroth
character_event = {
	id = 86410
	desc = "EVTDESC86410"
	picture = GFX_evt_council
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86410"
		tooltip_info = wroth
		trigger = {
			trait = wroth
		}
		remove_trait = wroth
	}

	option = {
		name = "EVTOPTB86410"
		trigger = {
			NOT = { trait = wroth }
		}
		change_stewardship = 1
	}
}		


##########################################################################
# Arrival at Mecca
##########################################################################				

#Hidden gateway event				
character_event = {
	id = 86500
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = hajj_arrived_in_mecca
		random_list = {
			50 = {  character_event = { id = 86510 } }
			50 = {  character_event = { id = 86520 } }
		}
	}
}

#Wudu
character_event = {
	id = 86510
	desc = "EVTDESC86510"
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_religion
	
	hide_from = yes
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	
	
	option = {
		name = "EVTOPTA86510"
		on_hajj = {
			limit = {
				prisoner = no
				has_character_flag = hajj_arrived_in_mecca
			}
			character_event = { id = 86511 tooltip = EVTTOOLTIP86511 }
			
			opinion = { 
				who = ROOT
				modifier = opinion_helped_wudu
			}
		
		}
		piety = 10
		hidden_tooltip = {
			character_event = { id = 86550 days = 2 }
		}
	}	
}

#Impurity in water
character_event = {
	id = 86511
	desc = "EVTDESC86511"
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes
	
	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86511"
		piety = 10
		reverse_opinion = { 
			who = FROM
			modifier = opinion_helped_wudu
		}		
	}
}

#Ihram
character_event = {
	id = 86520
	desc = "EVTDESC86520"
	picture = GFX_evt_kaaba
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86520"
		piety = 10
		hidden_tooltip = {
			character_event = { id = 86550 days = 2 }
		}		
	}
}

#Tawaf
character_event = {
	id = 86550
	desc = "EVTDESC86550"
	picture = GFX_evt_kaaba
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	immediate = {
		
	}	
	option = {
		name = "EVTOPTA86550"
		trigger = { NOT = { trait = humble } }
		if = {
			limit = {
				trait = proud
			}
			add_trait = ambitious
		}
		random = {
			chance = 33
			add_trait = proud
			hidden_tooltip = { character_event = {	id = 38261 } }
		}
		piety = 25
		hidden_tooltip = {
			character_event = { id = 86551 days = 1 }
		}	
		
		
	}
	option = {
		name = "EVTOPTB86550"
		trigger = { NOT = { trait = proud } }
		random = {
			chance = 33
			add_trait = humble
			hidden_tooltip = { character_event = {	id = 38260 } }
		}
		piety = 25
		
		hidden_tooltip = {
			character_event = { id = 86551 days = 1 }
		}	
	}	
}


#Hidden gateway event				
character_event = {
	id = 86551
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		random_list = {
			10 = {  character_event = { id = 86600  days = 1} }
			10 = {  character_event = { id = 86610  days = 1 } }
			10 = {  character_event = { id = 86620  days = 1 } }
			10 = {  character_event = { id = 86630  days = 1 } }
		
		}
		if = {
			limit = {
				location = {
					distance = {
						where = 719	#Mecca
						value = 400	#kind of far..
					}
				}
			}
			character_event = { id = 86800  days = 30 random = 25 }
		}
		if = {
			limit = {
				location = {
					NOT = {
						distance = {
							where = 719	#Mecca
							value = 400	#kind of far..
						}
					}
				}
			}
			character_event = { id = 86800  days = 10 random = 25 }
		}
	}
}

# Sa'i
character_event = {
	id = 86600
	desc = "EVTDESC86600"
	picture = GFX_evt_kaaba
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86600"
		set_character_flag = on_home_from_hajj
		clr_character_flag = hajj_arrived_in_mecca
		
		if = {
			limit = {
				NOT  = { has_character_flag = gained_hajj_health }
			}
			health = 1
			set_character_flag = gained_hajj_health #NoHax
			break = yes
		}
		if = {
			limit = {
				has_character_flag = gained_hajj_health
			}
			piety = 25
		}
	}
}
	
# Wuquf at Mount Ararat
character_event = {
	id = 86610
	desc = "EVTDESC86610"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86610"
		set_character_flag = on_home_from_hajj
		clr_character_flag = hajj_arrived_in_mecca
		piety = 50
	}
}
	
# Ramy al-Jamarat  (Stoning the Devil)
character_event = {
	id = 86620
	desc = "EVTDESC86620"
	picture = GFX_evt_kaaba
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86620"
		set_character_flag = on_home_from_hajj
		clr_character_flag = hajj_arrived_in_mecca
		if = {
			limit = { trait = possessed }
			remove_possessed_effect = yes
		}
		if = {
			limit = { trait = lunatic }
			remove_trait = lunatic
		}
		if = {
			limit = { trait = stressed }
			remove_trait = stressed
		}	
		if = {
			limit = { trait = depressed }
			remove_trait = depressed
		}	
		piety = 15		
	}
}
	
#Eid al-Adha
character_event = {
	id = 86630
	desc = "EVTDESC86630"
	picture = GFX_evt_kaaba
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	option = {
		name = "EVTOPTA86630"
		set_character_flag = on_home_from_hajj
		clr_character_flag = hajj_arrived_in_mecca

		scaled_wealth = -0.1
		prestige = 25
	}
	option = {
		name = "EVTOPTB86630"
		set_character_flag = on_home_from_hajj
		clr_character_flag = hajj_arrived_in_mecca
		scaled_wealth = -0.05
		piety = 10
	}	
}

##########################################################################
# Random things that can happen on the way home..
##########################################################################

#Dangerous bandits have cornered us..
character_event = {
	id = 86700
	desc = "EVTDESC86700"
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = on_home_from_hajj
	
	trigger = {
		trait = on_hajj
		NOT = { has_character_flag = hajj_bring_guards }
		NOT = { has_character_flag = hajj_home_event }
	}
	
	mean_time_to_happen = {
		days = 60
	}	
	
	immediate = {
		set_character_flag = hajj_home_event
	}

	option = {
		name = "EVTOPTA86700"
		prestige = 10
		random = {
			chance = 33
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}		
		
	}
	option = {
		name = "EVTOPTB86700"
		ai_chance = {
			factor = 0
		}
		add_trait = craven
	}
}

#Discover
character_event = {
	id = 86701
	desc = "EVTDESC86701"
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = on_home_from_hajj
	
	trigger = {
		trait = on_hajj
		has_character_flag = hajj_bring_guards
		NOT = { has_character_flag = hajj_home_event }
	}
	
	mean_time_to_happen = {
		days = 60
	}	
	
	immediate = {
		set_character_flag = hajj_home_event
	}

	option = {
		name = "EVTOPTA86701"
		scaled_wealth = 0.05
	}
}

#Encounter a poor village
character_event = {
	id = 86720
	desc = "EVTDESC86720"
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = on_home_from_hajj
	
	trigger = {
		trait = on_hajj
		NOT = { has_character_flag = hajj_home_event }
	}
	
	mean_time_to_happen = {
		days = 60
	}	
	
	immediate = {
		set_character_flag = hajj_home_event
	}

	option = {
		name = "EVTOPTA86720"
		scaled_wealth = -0.10
		piety = 10
	}
	option = {
		name = "EVTOPTB86720"
		piety = -10
		on_hajj = {
			opinion = { 
				who = ROOT
				modifier = opinion_hajj_not_helpin
			}
		}
	}
}

##########################################################################
# We are now home, and have been on our hajj.
##########################################################################
character_event = {
	id = 86800
	desc = "EVTDESC86800"
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		clr_character_flag = on_home_from_hajj
		clr_character_flag = hajj_company
	}
	option = {
		name = "EVTOPTA86800"
		if = {
			limit = { any_vassal = { leads_faction = faction_tradition } }
			custom_tooltip = { text = TRADITIONFACTIONMOODPLUS }
			hidden_tooltip = {
				random_vassal = { limit = { leads_faction = faction_tradition } set_variable = { which = "faction_mood_increase" value = 2 } }
				character_event = { id = PlusFaction.200 days = 1 } #recalculate faction moods
			}
		}
		remove_trait = on_hajj
		add_trait = hajjaj
		hidden_tooltip = { change_variable = { which = "lifestyle_learning" value = 1 } }
	}
}

######################################################
#Random Events when NOT on hajj or is hajjaj
######################################################
character_event = {
	id = 86900
	desc = "EVTDESC86900"
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	only_men = yes
	min_age = 35
	capable_only = yes
	only_rulers = yes
	prisoner = no
	religion_group = muslim
	
	trigger = {
		job_spiritual = {
			learning = 11
			age = 30
			trait = hajjaj
		}
		NOR = {
			religion = druze
			trait = hajjaj
			trait = mujahid
			trait = on_hajj
			trait = cynical
			has_character_flag = preparing_hajj
			has_character_flag = opinion_hajj_promised
			has_character_flag = opinion_jihad_promised
			any_war = {
				OR = {
					AND = {
						defender = { religion_group = christian }
						attacker = { character = ROOT }
					}
					AND = {
						attacker = { religion_group = christian }
						defender = { character = ROOT }
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 240
		modifier = {
			factor = 0.8
			piety = 100
		}
		modifier = {
			factor = 0.8
			trait = faqih
		}
	}
	option = {
		name = "EVTOPTA86900"
		set_character_flag = promise_hajj
		job_spiritual = {
			opinion = { 
				who = ROOT
				modifier = opinion_hajj_promised
				years = 5
			}
		}
	}
	
	option = {
		name = "EVTOPTB86900"
		trigger = {
			any_independent_ruler = {
				religion_group = christian
				any_realm_province = {
					religion_group = muslim
				}
			}
		}
		set_character_flag = promise_jihad
		job_spiritual = {
			opinion = { 
				who = ROOT
				modifier = opinion_jihad_promised
				years = 5
			}
		}		
	}	
	option = {
		name = "EVTOPTC86900"
		piety = -10
		add_trait = cynical
	}
}

#Remind on promised hajj
character_event = {
	id = 86901
	desc = "EVTDESC86901"
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	only_men = yes
	min_age = 30
	capable_only = yes
	only_rulers = yes
	prisoner = no
	religion_group = muslim
	war = no
	has_character_flag = promise_hajj
	
	trigger = {
		NOT = { any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes } }
		prisoner = no		
		job_spiritual = { learning = 1 }
		NOR = {
			religion = druze
			trait = hajjaj
			trait = mujahid
			trait = on_hajj
			has_character_flag = preparing_hajj
		}
	}
	
	mean_time_to_happen = {
		months = 60
	}
	
	option = {
		name = "EVTOPTA86901"
		piety = -25
	}
}

#Remind on promised jihad!
character_event = {
	id = 86902
	desc = "EVTDESC86902"
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	only_men = yes
	min_age = 30
	capable_only = yes
	only_rulers = yes
	prisoner = no
	religion_group = muslim
	war = no
	has_character_flag = promise_jihad
	
	trigger = {
		NOT = { trait = mujahid }
		job_spiritual = { learning = 1 }
		
		any_independent_ruler = {
			religion_group = christian
			any_realm_province = {
				religion_group = muslim
			}
		}
	
	}

	mean_time_to_happen = {
		months = 60
	}
	
	option = {
		name = "EVTOPTA86902"
		piety = -25
	}
}

#hidden clear up event.
character_event = {
	id = 86903
	
	only_men = yes
	min_age = 30
	capable_only = yes
	only_rulers = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = promise_jihad
	war = yes
	
	trigger = {
		any_war = { 
			any_attacker = {
				is_primary_war_attacker = yes
				character = ROOT
			}
			any_defender = {
				is_primary_war_defender = yes
				religion_group = christian 
			}
		}
	}
	
	hide_window = yes
	mean_time_to_happen = {
		days = 1
	}	
	immediate = {
		clr_character_flag = promise_jihad
	}
}

#############################
# Additional flavour events # 
#############################

### Far Journey 

# Shipwrecked
character_event = {
	id = 86810
	desc = "EVTDESC86810"
	picture = GFX_evt_kraken
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = { # Shares food
		name = "EVTOPTA86810"
		character_event = { id = 86811 tooltip = EVTTOOLTIP86811 }
	}
	option = { # Does not share
		name = "EVTOPTB86810"
		character_event = { id = 86812 tooltip = EVTTOOLTIP86812 }
	}
}

# Shipwrecked: Shared Food
character_event = {
	id = 86811
	desc = "EVTDESC86811"
	picture = GFX_evt_kraken
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86811"
		piety = 25
		health = -1
	}
}

# Shipwrecked: Did NOT Share Food
character_event = {
	id = 86812
	desc = "EVTDESC86812"
	picture = GFX_evt_kraken
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86812"
		piety = -25
	}
}

# Mutiny
character_event = {
	id = 86815
	desc = "EVTDESC86815"
	picture = GFX_evt_kraken
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86815"
		character_event = { id = 86816 tooltip = EVTTOOLTIP86816 }
		random = {
			chance = 33
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}
	}
	option = {
		name = "EVTOPTB86815"
		character_event = { id = 86817 tooltip = EVTTOOLTIP86817 }
	}
}

# Mutiny: Fights Crew
character_event = {
	id = 86816
	desc = "EVTDESC86816"
	picture = GFX_evt_melee_arabic
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86816"
		prestige = 15
	}
}

# Mutiny: Sneaks Off Ship
character_event = {
	id = 86817
	desc = "EVTDESC86817"
	picture = GFX_evt_kraken
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86817"
		prestige = -15
	}
}

# Caravan
character_event = {
	id = 86820
	desc = "EVTDESC86820"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86820"
		prestige = 10
	}
}

### Closer to Mecca

# Oasis
character_event = {
	id = 86825
	desc = "EVTDESC86825"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86825"
		trigger = {
			NOT = {
				OR = {
					AND = {
						trait = depressed
						random = 75
					}
					AND = {
						trait = stressed
						random = 50
					}
					random = 33
				}
			}
		}
		character_event = { id = 86826 tooltip = EVTTOOLTIP86826 }
	}
	option = {
		name = "EVTOPTB86825"
		trigger = {
			OR = {
				AND = {
					trait = depressed
					random = 75
				}
				AND = {
					trait = stressed
					random = 50
				}
				random = 33
			}
		}
		character_event = { id = 86827 tooltip = EVTTOOLTIP86827 }
	}
}

# Oasis: Has Faith
character_event = {
	id = 86826
	desc = "EVTDESC86826"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86826"
		piety = 15
	}
}

# Oasis: Gives In To Despair
character_event = {
	id = 86827
	desc = "EVTDESC86827"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86827"
		piety = -15
	}
}

# Desert Mirage
character_event = {
	id = 86830
	desc = "EVTDESC86830"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86830"
		if = {
			limit = { NOT = { trait = depressed } }
			random = {
				chance = 5
				add_trait = depressed
				hidden_tooltip = { character_event = { id = 38288 } } #Notify depressed
			}
		}
	}
	option = {
		name = "EVTOPTB86830"
		if = {
			limit = { NOT = { trait = possessed } }
			random = {
				chance = 5
				add_trait = possessed
				hidden_tooltip = { character_event = { id = 38315 } } #Notify possessed
			}
		}
	}
}

# Camels
character_event = {
	id = 86835
	desc = "EVTDESC86835"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86835"
		piety = 25
		health = -1
	}
	option = {
		name = "EVTOPTB86835"
		piety = -25
	}
}

# Baggage Train
character_event = {
	id = 86840
	desc = "EVTDESC86840"
	picture = GFX_evt_carriage_arabic
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86840"
		piety = 10
	}
}

# Hashshashin
character_event = {
	id = 86845
	desc = "EVTDESC86845"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	has_global_flag = assassins_founded
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
		NOT = { has_global_flag = assassins_scatter }
		NOT = { has_global_flag = assassins_destroyed }
	}
	
	option = {
		name = "EVTOPTA86845"
		character_event = { id = 86846 tooltip = EVTTOOLTIP86846 }
		random = {
			chance = 33
			add_trait = wounded
			hidden_tooltip = { character_event = { id = 38280 } }
		}
		set_character_flag = saved_assassin
	}
	option = {
		name = "EVTOPTB86845"
		piety = -10
	}
}

# Hashshashin: Intervenes
character_event = {
	id = 86846
	desc = "EVTDESC86846"
	picture = GFX_evt_melee_arabic
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86846"
		piety = 10
	}
}

### On The Way Home

# Pilgrim Remains
character_event = {
	id = 86850
	desc = "EVTDESC86850"
	picture = GFX_evt_pale_rider
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = on_home_from_hajj
	
	trigger = {
		trait = on_hajj
		NOT = { has_character_flag = hajj_home_event }
	}
	
	mean_time_to_happen = {
		days = 60
	}	
	
	immediate = {
		set_character_flag = hajj_home_event
	}
	
	option = {
		name = "EVTOPTA86850"
		piety = 10
	}
}

# Sandstorm
character_event = {
	id = 86855
	desc = "EVTDESC86855"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = on_home_from_hajj
	
	trigger = {
		trait = on_hajj
		NOT = { has_character_flag = hajj_home_event }
	}
	
	mean_time_to_happen = {
		days = 60
	}	
	
	immediate = {
		set_character_flag = hajj_home_event
	}
	
	option = {
		name = "EVTOPTA86855"
		piety = 10
	}
}

# Stranded Pilgrims
character_event = {
	id = 86860
	desc = "EVTDESC86860"
	picture = GFX_evt_desert
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = on_home_from_hajj
	
	trigger = {
		trait = on_hajj
		NOT = { has_character_flag = hajj_home_event }
	}
	
	mean_time_to_happen = {
		days = 60
	}	
	
	immediate = {
		set_character_flag = hajj_home_event
	}
	
	option = {
		name = "EVTOPTA86860"
		piety = 15
		scaled_wealth = -0.15
	}
	option = {
		name = "EVTOPTB86860"
		piety = -15
	}
}

# Hashshashins: Ambushed
character_event = {
	id = 86865
	desc = "EVTDESC86865"
	picture = GFX_evt_melee_arabic
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	only_capable = yes
	prisoner = no
	religion_group = muslim
	has_character_flag = on_home_from_hajj
	
	trigger = {
		has_character_flag = saved_assassin
		trait = on_hajj
		NOT = { has_character_flag = hajj_home_event }
	}
	
	mean_time_to_happen = {
		days = 15
	}
	
	immediate = {
		set_character_flag = hajj_home_event
	}
	
	option = {
		name = "EVTOPTA86865"
		character_event = { id = 86866 tooltip = EVTTOOLTIP86866 }
	}
}

# Hashshashins: Saved
character_event = {
	id = 86866
	desc = "EVTDESC86866"
	picture = GFX_evt_melee_arabic
	border = GFX_event_normal_frame_religion
	
	prisoner = no
	
	is_triggered_only = yes

	trigger = {
		trait = on_hajj
	}
	
	option = {
		name = "EVTOPTA86866"
		prestige = 20
	}
}
