
namespace = Plus

#reserved: Plus.700 to Plus.729

#######################################
# JEWISH EVENTS
#######################################

# Jewish community grows
character_event = {
	id = Plus.700 #formerly 1000182984
	desc = "EVTDESC_Plus_700"
	picture = GFX_evt_market
	
	only_rulers = yes
	war = no

	trigger = {
		any_demesne_province = {
			any_province_holding = {
				has_building = ct_jewish_community_1
			}
			OR = {
				ROOT = { ai = yes }
				NOT = { any_province_holding = { has_building = ct_jewish_community_3 } }
			}
			NOT = { has_province_modifier = brm_revolt }
			OR = {
				AND = {
					OR = {
						has_province_modifier = province_prosperity_1
						has_province_modifier = province_prosperity_2
					}
					NOT = { has_dlc = "Reapers" }
				}
				has_dlc = "Reapers"
			}
		}
		OR = {
			is_patrician = yes
			NOT = { tier = baron }
			NOT = { 
				liege = { 
					has_character_flag = pogrom 
					has_character_modifier = expelled_jews_timer
				}
			}
		}
		NOR = { 
			has_character_flag = pogrom 
			has_character_modifier = expelled_jews_timer
		}
	}

	mean_time_to_happen = {
		months = 1200
		modifier = {
			factor = 2
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = zealous
		}
		modifier = {
			factor = 1.5
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = cruel
		}
		modifier = {
			factor = 1.5
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = arbitrary
		}
		modifier = {
			factor = 0.75
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = just
		}
		modifier = {
			factor = 0.75
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = charitable
		}
		modifier = {
			factor = 2
			tier = baron is_patrician = no
			liege = { trait = zealous }
		}
		modifier = {
			factor = 1.5
			tier = baron is_patrician = no
			liege = { trait = cruel }
		}
		modifier = {
			factor = 1.5
			tier = baron is_patrician = no
			liege = { trait = arbitrary }
		}
		modifier = {
			factor = 0.75
			tier = baron is_patrician = no
			liege = { trait = just }
		}
		modifier = {
			factor = 0.75
			tier = baron is_patrician = no
			liege = { trait = charitable }
		}
		modifier = {
			factor = 1.5
			any_demesne_province = {
				any_province_holding = {
					has_building = ct_jewish_community_2
				}
			}
		}
		modifier = {
			factor = 1.5
			any_demesne_province = {
				any_province_holding = {
					has_building = ct_jewish_community_3
				}
			}
		}
		modifier = {
			factor = 0.66
			OR = {
				AND = {
					any_demesne_province = {
						any_province_holding = {
							has_building = ct_jewish_community_1
						}
						has_province_modifier = province_prosperity_2
					}
					NOT = { has_dlc = "Reapers" }
				}
				AND = {
					any_demesne_province = {
						any_province_holding = {
							has_building = ct_jewish_community_1
						}
					}
					has_dlc = "Reapers"
				}
			}
		}
	}

	option = {
		name = "EXCELLENT"
		random_demesne_title = {
			limit = {
				tier = baron
				has_building = ct_jewish_community_1
				OR = {
					ROOT = { ai = yes }
					NOT = { has_building = ct_jewish_community_3 }
				}
				location = {
					NOT = { has_province_modifier = brm_revolt }
					OR = {
						has_province_modifier = province_prosperity_1
						has_province_modifier = province_prosperity_2
						has_dlc = "Reapers"
					}
				}
			}
			hidden_tooltip = {
				if = {
					limit = { has_building = ct_jewish_community_3 }
					hidden_tooltip = {
						change_variable = { which = "global_jewish_refugees" value = 1 }
					}
				}
			}
			if = {
				limit = {
					NOT = { has_building = ct_jewish_community_3 }
					has_building = ct_jewish_community_2
				}
				add_building = ct_jewish_community_3
				ROOT = {
					if = {
						limit = {
							tier = baron
							NOT = { demesne_size = 2 }
						}
						liege = {
							letter_event = { id = Plus.702 days = 3 }
						}
					}
				}
			}
			if = {
				limit = {
					NOT = { has_building = ct_jewish_community_3 }
					NOT = { has_building = ct_jewish_community_2 }
					has_building = ct_jewish_community_1
				}
				add_building = ct_jewish_community_2
				ROOT = {
					if = {
						limit = {
							tier = baron
							NOT = { demesne_size = 2 }
						}
						liege = {
							letter_event = { id = Plus.701 days = 3 }
						}
					}
				}
			}
		}
	}
}

# Liege informed that jewish community has grown
letter_event = {
	id = Plus.701
	desc = "EVTDESC_Plus_701"

	is_triggered_only = yes

	ai = no

	option = {
		name = "EXCELLENT"
		FROM = {
			capital_holding = {
				tooltip = { add_building = ct_jewish_community_2 }
			}
		}
	}
}

# Liege informed that jewish community has grown
letter_event = {
	id = Plus.702
	desc = "EVTDESC_Plus_701"

	is_triggered_only = yes

	ai = no

	option = {
		name = "EXCELLENT"
		FROM = {
			capital_holding = {
				tooltip = { add_building = ct_jewish_community_3 }
			}
		}
	}
}

# Jewish courtier
character_event = {
	id = Plus.703 #formerly 1000182987
	picture = GFX_evt_emissary
	desc = "EVTDESC_Plus_703"
	
	only_rulers = yes
	war = no

	trigger = {
		any_demesne_province = {
			any_province_holding = {
				has_building = ct_jewish_community_1
			}			
		}
		OR = {
			NOT = { tier = baron }
			NOT = { 
				liege = { 					
					has_character_flag = pogrom 
					has_character_modifier = expelled_jews_timer 
				} 
			}
		}
		NOR = { 					
			has_character_flag = pogrom 
			has_character_modifier = expelled_jews_timer 
		}
	}

	mean_time_to_happen = {
		months = 1000
		modifier = {
			factor = 2
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = zealous
		}
		modifier = {
			factor = 1.5
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = cruel
		}
		modifier = {
			factor = 1.5
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = arbitrary
		}
		modifier = {
			factor = 0.75
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = just
		}
		modifier = {
			factor = 0.75
			OR = { higher_tier_than = baron is_patrician = yes }
			trait = charitable
		}
		modifier = {
			factor = 2
			tier = baron is_patrician = no
			liege = { trait = zealous }
		}
		modifier = {
			factor = 1.5
			tier = baron is_patrician = no
			liege = { trait = cruel }
		}
		modifier = {
			factor = 1.5
			tier = baron is_patrician = no
			liege = { trait = arbitrary }
		}
		modifier = {
			factor = 0.75
			tier = baron is_patrician = no
			liege = { trait = just }
		}
		modifier = {
			factor = 0.75
			tier = baron is_patrician = no
			liege = { trait = charitable }
		}
		modifier = {
			factor = 0.66
			any_demesne_province = {
				any_province_holding = {
					has_building = ct_jewish_community_2
				}
			}
		}
		modifier = {
			factor = 0.66
			any_demesne_province = {
				any_province_holding = {
					has_building = ct_jewish_community_3
				}
			}
		}
	}

	option = {
		name = "OK"
		if = {
			limit = {
				OR = {
					culture = levantine_arabic
					culture = bedouin_arabic
					culture = egyptian_arabic
					culture_group = altaic
					culture_group = iranian
					culture_group = east_african
				}
			}
			create_character = {
				random_traits = yes
				dynasty = random
				religion = jewish
				culture = mizrahim
				female = no
			}
			new_character = {
				set_character_flag = jewish_advisor
				random = {
					chance = 50
					create_character = {
						random_traits = yes
						dynasty = random
						religion = jewish
						culture = mizrahim
						female = yes
					}
					new_character = {
						set_character_flag = jewish_advisor
						add_spouse = PREV
					}
				}
			}
		}
		if = {
			limit = {
				OR = {
					culture = andalusian_arabic
					culture = maghreb_arabic
					culture = sicilian_arabic
					culture_group = west_african
				}
			}
			create_character = {
				random_traits = yes
				dynasty = random
				religion = jewish
				culture = sephardi
				female = no
			}
			new_character = {
				set_character_flag = jewish_advisor
				random = {
					chance = 50
					create_character = {
						random_traits = yes
						dynasty = random
						religion = jewish
						culture = sephardi
						female = yes
					}
					new_character = {
						set_character_flag = jewish_advisor
						add_spouse = PREV
					}
				}
			}
		}
		if = {
			limit = {
				NOR = {
					culture_group = arabic
					culture_group = altaic
					culture_group = iranian
					culture_group = east_african
					culture_group = west_african
				}
			}
			create_character = {
				random_traits = yes
				dynasty = random
				religion = jewish
				culture = ashkenazi
				female = no
			}
			new_character = {
				set_character_flag = jewish_advisor
				random = {
					chance = 50
					create_character = {
						random_traits = yes
						dynasty = random
						religion = jewish
						culture = ashkenazi
						female = yes
					}
					new_character = {
						set_character_flag = jewish_advisor
						add_spouse = PREV
					}
				}
			}
		}
		hidden_tooltip = {
			if = {
				limit = { tier = baron }
				liege = {
					ROOT = {
						any_courtier = {
							limit = { has_character_flag = jewish_advisor }
							clr_character_flag = jewish_advisor
							banish = PREVPREV
						}
					}
				}
			}
			any_courtier = {
				limit = { has_character_flag = jewish_advisor }
				clr_character_flag = jewish_advisor
			}
		}
	}
}

# Jewish refugees wish to settle in your holding
character_event = {
	id = Plus.704 #formerly 1000182988
	desc = "EVTDESC_Plus_704"
	picture = GFX_evt_emissary
	
	only_rulers = yes
	war = no

	trigger = {
		OR = {
			higher_tier_than = baron
			is_patrician = yes
		}
		OR = {
			religion_group = christian
			religion_group = muslim
			is_pagan_religion = yes
		}
		check_variable = { which = "global_jewish_refugees" value = 0.5 }
		OR = {
			any_demesne_province = {
				any_province_holding = {
					has_building = ct_wall_1
					NOT = { has_building = ct_jewish_community_3 }
				}
			}
			any_vassal = {
				tier = baron
				is_patrician = no
				any_demesne_province = {
					any_province_holding = {
						has_building = ct_wall_1
						NOT = { has_building = ct_jewish_community_3 }
					}
				}
			}
		}
		NOT = {
			any_liege = {			
				has_character_flag = pogrom 
				has_character_modifier = expelled_jews_timer 
			}
		}
		NOR = {
			has_character_flag = jews_not_welcome
			has_character_flag = pogrom
			has_character_modifier = expelled_jews_timer
		}
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 2
			liege = { trait = zealous }
		}
		modifier = {
			factor = 1.5
			liege = { trait = cruel }
		}
		modifier = {
			factor = 1.5
			liege = { trait = arbitrary }
		}
		modifier = {
			factor = 0.75
			liege = { trait = just }
		}
		modifier = {
			factor = 0.75
			liege = { trait = charitable }
		}
		modifier = {
			factor = 0.75
			religion_group = muslim
		}
		modifier = {
			factor = 1.5
			is_pagan_religion = yes
		}
		modifier = {
			factor = 2.0
			OR = {
				religion = orthodox
				religion = chalcedonian
			}
		}
		modifier = {
			factor = 10.0
			OR = {
				culture_group = north_germanic
				culture_group = celtic
				culture_group = finno_ugric
				culture_group = west_african
			}
		}
		modifier = {
			factor = 5.0
			OR = {
				culture_group = byzantine
				culture_group = baltic
				culture_group = south_slavic
				culture_group = east_african
			}
		}
		modifier = {
			factor = 2.0
			OR = {
				culture_group = west_germanic
				culture_group = altaic
				culture_group = east_slavic
				culture_group = magyar
			}
		}
		modifier = {
			factor = 3.0
			tier = count
		}
		modifier = {
			factor = 2.0
			tier = duke
		}
		modifier = {
			factor = 0.75
			tier = emperor
		}
		modifier = {
			factor = 0.66
			OR = {
				any_demesne_province = {
					any_province_holding = {
						has_building = ct_jewish_community_1
					}
				}
				any_vassal = {
					tier = baron
					is_patrician = no
					any_demesne_province = {
						any_province_holding = {
							has_building = ct_jewish_community_1
						}
					}
				}
			}
		}
	}

	immediate = {
		hidden_tooltip = {
			change_variable = { which = "global_jewish_refugees" value = -1 }
		}
	}

	option = {
		name = "EVTOPTA_Plus_704" #They are welcome
		ai_chance = {
			factor = 75
			modifier = {
				factor = 0.66
				religion_group = christian
			}
			modifier = {
				factor = 0.1
				trait = zealous
			}
			modifier = {
				factor = 0.5
				trait = cruel
			}
			modifier = {
				factor = 1.5
				trait = kind
			}
			modifier = {
				factor = 2.0
				trait = charitable
			}
		}
		if = {
			limit = { trait = zealous }
			remove_trait = zealous
		}
		if = {
			limit = {
				any_demesne_title = {
					tier = baron
					has_building = ct_wall_1
					NOT = { has_building = ct_jewish_community_3 }
				}
			}
			random_demesne_title = {
				limit = {
					tier = baron
					has_building = ct_wall_1
					NOT = { has_building = ct_jewish_community_3 }
				}
				if = {
					limit = {
						NOT = { has_building = ct_jewish_community_3 }
						has_building = ct_jewish_community_2
					}
					add_building = ct_jewish_community_3
				}
				if = {
					limit = {
						NOT = { has_building = ct_jewish_community_3 }
						NOT = { has_building = ct_jewish_community_2 }
						has_building = ct_jewish_community_1
					}
					add_building = ct_jewish_community_2
				}
				if = {
					limit = {
						NOT = { has_building = ct_jewish_community_3 }
						NOT = { has_building = ct_jewish_community_2 }
						NOT = { has_building = ct_jewish_community_1 }
					}
					add_building = ct_jewish_community_1
				}
			}
		}
		if = {
			limit = {
				NOT = {
					any_demesne_title = {
						tier = baron
						has_building = ct_wall_1
						NOT = { has_building = ct_jewish_community_3 }
					}
				}
			}
			random_vassal = {
				limit = {
					tier = baron
					is_patrician = no
					any_demesne_title = {
						tier = baron
						has_building = ct_wall_1
						NOT = { has_building = ct_jewish_community_3 }
					}
				}
				random_demesne_title = {
					limit = {
						tier = baron
						has_building = ct_wall_1
						NOT = { has_building = ct_jewish_community_3 }
					}
					if = {
						limit = {
							NOT = { has_building = ct_jewish_community_3 }
							has_building = ct_jewish_community_2
						}
						add_building = ct_jewish_community_3
					}
					if = {
						limit = {
							NOT = { has_building = ct_jewish_community_3 }
							NOT = { has_building = ct_jewish_community_2 }
							has_building = ct_jewish_community_1
						}
						add_building = ct_jewish_community_2
					}
					if = {
						limit = {
							NOT = { has_building = ct_jewish_community_3 }
							NOT = { has_building = ct_jewish_community_2 }
							NOT = { has_building = ct_jewish_community_1 }
						}
						add_building = ct_jewish_community_1
					}
				}
			}
		}
		any_vassal = {
			limit = {
				NOT = { trait = charitable }
				NOT = { trait = just }
				NOT = { trait = kind }
				NOT = { trait = zealous }
				is_republic = no
			}
			opinion = {
				who = ROOT
				modifier = opinion_settled_jews
				years = 10
			}
		}
		any_vassal = {
			limit = {
				NOT = { trait = charitable }
				NOT = { trait = just }
				NOT = { trait = kind }
				trait = zealous
				is_republic = no
			}
			opinion = {
				who = ROOT
				modifier = opinion_settled_jews
				years = 10
				multiplier = 2
			}
		}
		if = {
			limit = { any_vassal = { leads_faction = faction_tradition } }
			custom_tooltip = { text = TRADITIONFACTIONMOODMINUS }
			hidden_tooltip = {
				random_vassal = { limit = { leads_faction = faction_tradition } set_variable = { which = "faction_mood_decrease" value = 2 } }
			}
		}
		if = {
			limit = { any_vassal = { leads_faction = faction_prosperity } }
			custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS }
			hidden_tooltip = {
				random_vassal = { limit = { leads_faction = faction_prosperity } set_variable = { which = "faction_mood_increase" value = 2 } }
			}
		}
		hidden_tooltip = { character_event = { id = PlusFaction.200 days = 1 } }
	}
	option = {
		name = "EVTOPTB_Plus_704" #Tell them to move on
		ai_chance = {
			factor = 25
		}
		prestige = 10
		set_character_flag = jews_not_welcome
		hidden_tooltip = {
			random = {
				chance = 75
				change_variable = { which = "global_jewish_refugees" value = 1 }
			}
		}
		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 }
			}
		}
	}
}

# Vassal informed that liege wants jews expelled
character_event = {
	id = Plus.705 #formerly 1000182989
	desc = "EVTDESC_Plus_705"
	picture = "GFX_evt_burning_house"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_705" #Bow to his demands
		ai_chance = {
			factor = 100
		}
		any_demesne_title = {
			limit = {
				tier = BARON 
				has_building = ct_jewish_community_3
			}
			remove_building = ct_jewish_community_3
			FROM = { piety = -30 wealth = 150 }
			hidden_tooltip = {
				change_variable = { which = "global_jewish_refugees" value = 2 }
			}
		}
		any_demesne_title = {
			limit = {
				tier = BARON 
				NOT = { has_building = ct_jewish_community_3 }
				has_building = ct_jewish_community_2
			}
			remove_building = ct_jewish_community_2
			FROM = { piety = -20 wealth = 100 }
			hidden_tooltip = {
				change_variable = { which = "global_jewish_refugees" value = 2 }
			}
		}
		any_demesne_title = {
			limit = {
				tier = BARON 
				NOT = { has_building = ct_jewish_community_3 }
				NOT = { has_building = ct_jewish_community_2 }
				has_building = ct_jewish_community_1
			}
			remove_building = ct_jewish_community_1
			FROM = { piety = -10 wealth = 50 }
			hidden_tooltip = {
				change_variable = { which = "global_jewish_refugees" value = 2 }
			}
		}
		any_courtier = {
			limit = { religion_group = jewish_group }
			banish = yes
		}
		any_realm_lord = {
			limit = {
				tier = baron
				any_liege = { character = ROOT }
				any_demesne_title = { has_building = ct_jewish_community_1 }
			}
			any_demesne_title = {
				limit = { has_building = ct_jewish_community_3 }
				remove_building = ct_jewish_community_3
				FROM = { piety = -30 wealth = 150 }
				hidden_tooltip = {
					change_variable = { which = "global_jewish_refugees" value = 2 }
				}
			}
			any_demesne_title = {
				limit = {
					NOT = { has_building = ct_jewish_community_3 }
					has_building = ct_jewish_community_2
				}
				remove_building = ct_jewish_community_2
				FROM = { piety = -20 wealth = 100 }
				hidden_tooltip = {
					change_variable = { which = "global_jewish_refugees" value = 2 }
				}
			}
			any_demesne_title = {
				limit = {
					NOT = { has_building = ct_jewish_community_3 }
					NOT = { has_building = ct_jewish_community_2 }
					has_building = ct_jewish_community_1
				}
				remove_building = ct_jewish_community_1
				FROM = { piety = -10 wealth = 50 }
				hidden_tooltip = {
					change_variable = { which = "global_jewish_refugees" value = 2 }
				}
			}
			any_courtier = {
				limit = { religion_group = jewish_group }
				banish = yes
			}
		}
	}
	option = {
		name = "EVTOPTB_Plus_705" #Never!
		ai_chance = {
			factor = 0
		}
		FROM = {
			reverse_war = {
				target = ROOT
				casus_belli = overthrow_ruler
			}
		}
	}
}

# The Fast Begins
# Events similar to Ramadan but the feast happens before the fast, instead of after
# and Yom Kippur only lasts 25h, however for sanity reasons the events will be spread
# over a similar period as Ramadan and generally structured like Ramadan
character_event = {
	id = Plus.706
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_706"
	picture = "GFX_evt_bishop"
	border =  "GFX_event_normal_frame_religion"

	only_rulers = yes
	min_age = 16
	prisoner = no
	capable_only = yes
	has_character_flag = planning_yom_kippur

	trigger = {
		war = no
		month = 8
		NOT = { month = 10 } # Yom Kippur happens typically in September or October however preperations must happen before
		is_not_busy_trigger = yes
		NOT = { is_inaccessible_trigger = yes }
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA706"
		clr_character_flag = planning_yom_kippur
		set_character_flag = yom_kippur
		add_character_modifier = {
			name = observed_yom_kippur
			duration = 1900
			hidden = no
		}	
		hidden_tooltip = {
			add_character_modifier = {
				name = do_not_disturb
				days = 36
				hidden = yes
			}
			character_event = { id = Plus.708 days = 21 }				# Feast Begins
			character_event = { id = Plus.709 days = 19 }				# Gift for Wife
			character_event = { id = Plus.707 days = 35 }				# Yom Kippur is over
			random_list = {
				10 = { character_event = { id = Plus.710 days = 3 } }	# Release Prisoners
				10 = { character_event = { id = Plus.711 days = 3 } }	# Alms to the Poor
				10 = { character_event = { id = Plus.712 days = 3 } }	# Prayers
				4 = { character_event = { id = Plus.713 days = 3 } }	# Gain Temperate
				4 = { character_event = { id = Plus.714 days = 3 } }	# Gain Charitable
			}
			random_list = {
				10 = { character_event = { id = Plus.710 days = 10 } }	# Release Prisoners
				10 = { character_event = { id = Plus.711 days = 10 } }	# Alms to the Poor
				10 = { character_event = { id = Plus.712 days = 10 } }	# Prayers
				4 = { character_event = { id = Plus.713 days = 10 } }	# Gain Temperate
				4 = { character_event = { id = Plus.714 days = 10 } }	# Gain Charitable
			}
			random_list = {
				10 = { character_event = { id = Plus.710 days = 17	} }	# Release Prisoners
				10 = { character_event = { id = Plus.711 days = 17 } }	# Alms to the Poor
				10 = { character_event = { id = Plus.712 days = 17 } }	# Prayers
				4 = { character_event = { id = Plus.713 days = 17 } }	# Gain Temperate
				4 = { character_event = { id = Plus.714 days = 17 } }	# Gain Charitable
			}
		}
	}
}

# Yom Kippur Ends
character_event = {
	id = Plus.707
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_707"
	picture = "GFX_evt_bishop"
	border =  "GFX_event_normal_frame_religion"

	is_triggered_only = yes

	trigger = { has_character_flag = yom_kippur }

	option = {
		name = "EVTOPTA88522" # Until Next Year
		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 = 1 } }
				character_event = { id = PlusFaction.200 days = 1 } #recalculate faction moods
			}
		}
		hidden_tooltip = {
			remove_do_not_disturb_effect = yes
			clr_character_flag = yom_kippur
			clr_character_flag = yom_kippur_prisoners
			clr_character_flag = yom_kippur_charity
			clr_character_flag = yom_kippur_prayers
			clr_character_flag = yom_kippur_gluttonous
			clr_character_flag = yom_kippur_lustful_hedonist
			clr_character_flag = yom_kippur_greedy
			clr_character_flag = yom_kippur_cynical
		}
	}
}

# Hold Feast
character_event = {
	id = Plus.708
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_708"
	picture = "GFX_evt_feast"
	border =  "GFX_event_normal_frame_religion"

	is_triggered_only = yes

	trigger = {
		num_of_vassals = 1
		scaled_wealth = 0.3
		has_character_flag = yom_kippur
	}

	option = {
		name = "EVTOPTA706"
		scaled_wealth = -0.3
		any_vassal = {
			limit = {
				prisoner = no
				war = no
				has_regent = no
				is_not_busy_trigger = yes
			}
			letter_event = {
				id = Plus.719
				tooltip = "EVTTOOLTIP72011"
			}
		}
		character_event = { id = Plus.717 days = 3 tooltip = "EVTTOOLTIP_PLUS_717" }
	}
	option = {
		name = "EVTOPTB88510"
	}
}

# Gift for Wife
character_event = {
	id = Plus.709
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_709"
	picture = "GFX_evt_marriage"
	border =  "GFX_event_normal_frame_religion"
	
	is_married = yes
	only_men = yes
	has_character_flag = yom_kippur

	is_triggered_only = yes

	trigger = {
		NOT = {
			any_spouse = { is_main_spouse = no }
		}
	}

	option = {
		name = "EVTOPTA88515"
		scaled_wealth = -0.25
		spouse = {
			opinion = {
				modifier = opinion_happy
				who = ROOT
				years = 1
			}
		}
	}
	option = {
		name = "EVTOPTB88515"
		spouse = {
			opinion = {
				modifier = spouse_ignores_me
				who = ROOT
				years = 1
			}
		}
	}
}

# Release prisoners
character_event = {
	id = Plus.710
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC88501"
	picture = "GFX_evt_into_the_dungeon"
	border =  "GFX_event_normal_frame_religion"
	
	is_triggered_only = yes

	only_rulers = yes
	min_age = 16
	prisoner = no
	capable_only = yes
	has_character_flag = yom_kippur

	trigger = {
		num_of_prisoners = 1
		NOT = { has_character_flag = yom_kippur_prisoners }
	}

	option = {
		name = "EVTOPTA88501"
		set_character_flag = yom_kippur_prisoners
		any_courtier = {
			limit = { prisoner = yes }
			imprison = no
		}

		piety = 5
	}
	option = {
		name = "EVTOPTB88501"
		set_character_flag = yom_kippur_prisoners
		piety = -5
	}
}

# Charity for the People
character_event = {
	id = Plus.711
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_711"
	picture = "GFX_evt_market"
	border =  "GFX_event_normal_frame_religion"
	
	is_triggered_only = yes

	only_rulers = yes
	min_age = 16
	prisoner = no
	capable_only = yes
	has_character_flag = yom_kippur

	trigger = {
		scaled_wealth = 0.20
		NOT = { has_character_flag = yom_kippur_charity }
	}

	option = {
		name = "EVTOPTA88502"
		scaled_wealth = -0.20
		set_character_flag = yom_kippur_charity
		piety = 5
	}
	option = {
		name = "EVTOPTB88502"
		set_character_flag = yom_kippur_charity
		piety = -5
	}
}

# Prayers
character_event = {
	id = Plus.712
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_712"
	picture = "GFX_evt_monk"
	border =  "GFX_event_normal_frame_religion"
	
	is_triggered_only = yes

	only_rulers = yes
	min_age = 16
	prisoner = no
	capable_only = yes
	has_character_flag = yom_kippur

	trigger = {
		NOT = { has_character_flag = yom_kippur_prayers }
	}

	option = {
		name = "EVTOPTA712"
		set_character_flag = yom_kippur_prayers
		piety = 5
	}
	option = {
		name = "EVTOPTB88503"
		set_character_flag = yom_kippur_prayers
		piety = -5
	}
}

# Gain Temperate
character_event = {
	id = Plus.713
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_713"
	picture = "GFX_evt_monk"
	border =  "GFX_event_normal_frame_religion"
	
	is_triggered_only = yes

	only_rulers = yes
	min_age = 16
	prisoner = no
	capable_only = yes
	has_character_flag = yom_kippur
	
	trigger = {
		NOR = {
			trait = gluttonous
			trait = temperate
		}
	}

	option = {
		name = "EVTOPTA88506"
		add_trait = temperate
		piety = 5
	}
}

# Gain Charitable
character_event = {
	id = Plus.714
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_714"
	picture = "GFX_evt_monk"
	border =  "GFX_event_normal_frame_religion"
	
	is_triggered_only = yes
	
	only_rulers = yes
	min_age = 16
	prisoner = no
	capable_only = yes
	has_character_flag = yom_kippur
	
	trigger = {
		NOR = {
			trait = greedy
			trait = charitable
		}
	}

	option = {
		name = "EVTOPTA88507"
		add_trait = charitable
		piety = 5
	}
}

# War interrupts Fast
character_event = {
	id = Plus.715
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC88508"
	picture = "GFX_evt_moors"
	border =  "GFX_event_normal_frame_religion"

	only_rulers = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	religion_group = jewish_group
	has_character_flag = yom_kippur
	war = yes
	
	trigger = {
	}
	
	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA88508"
		character_event = { id = Plus.707 days = 1 }
	}
}

# Vassal Refuses Invitation
letter_event = {
	id = Plus.716
	desc = "EVTDESC_Plus_716"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA88512"
	}
}

# Host is told about Feast
character_event = {
	id = Plus.717
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_717"
	picture = "GFX_evt_feast"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_4153"
		any_vassal = {
			limit = { has_character_flag = attending_yom_kippur_feast }
			opinion = {
				modifier = opinion_impressed
				who = ROOT
				years = 1
			}
		}
	}
}

# Vassal is told about Feast
character_event = {
	id = Plus.718
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_718"
	picture = "GFX_evt_feast"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_4153"
		clr_character_flag = attending_yom_kippur_feast
	}
}

# Vassal Invited
letter_event = {
	id = Plus.719
	desc = "EVTDESC_Plus_719"

	is_triggered_only = yes

	trigger = { NOT = { is_inaccessible_trigger = yes } }
	
	option = {
		name = "EVTOPTA88511" # I am honored to accept
		ai_chance = {
			factor = 1
			modifier  = {
				factor = 0.1
				ai = yes
				is_inaccessible_trigger = yes
			}
			modifier = {
				factor = 2
				opinion = { who = from value = -40 }
			}
			modifier  = {
				factor = 2
				opinion = { who = from value = -20 }
			}
		}
		character_event = { id = Plus.718 days = 4 tooltip = "EVTTOOLTIP_PLUS_718" }
		hidden_tooltip = {
			add_character_modifier = {
				name = do_not_disturb
				days = 5
				hidden = yes
			}
		}
		set_character_flag = attending_yom_kippur_feast
		end_inaccessibility_effect = yes
	}
	option = {
		name = "EVTOPTB88511" # No I have other plans
		ai_chance = {
			factor = 1
			modifier  = {
				factor = 0
				opinion = { who = from value = 0 }
				NOT = { is_inaccessible_trigger = yes }
			}
			modifier  = {
				factor = 2
				NOT = { opinion = { who = from value = -60 } }
			}
			modifier  = {
				factor = 2
				NOT = { opinion = { who = from value = -80 } }
			}
		}
		FROM = {
			letter_event = { id = Plus.716 days = 1 tooltip = "EVTTOOLTIP88512" } # Invited Rejected
			opinion = {
				modifier = opinion_disappointed
				who = ROOT
				years = 1
			}
		}
	}
}

# Gluttonous Sin
character_event = {
	id = Plus.720
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC88517"
	picture = "GFX_evt_lunatic"
	border =  "GFX_event_normal_frame_religion"
	
	min_age = 16
	capable_only = yes
	prisoner = no
	religion_group = jewish_group
	has_character_flag = yom_kippur

	trigger = {
		trait = gluttonous
		NOT = { has_character_flag = yom_kippur_gluttonous }
	}

	mean_time_to_happen = {
		days = 45
	}

	option = {
		name = "EVTOPTA88517"
		set_character_flag = yom_kippur_gluttonous
		piety = -5
	}
}

# Lustful/Hedonist Sin
character_event = {
	id = Plus.721
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC88518"
	picture = "GFX_evt_jugglers"
	border =  "GFX_event_normal_frame_religion"
	
	min_age = 16	
	capable_only = yes
	prisoner = no
	religion_group = jewish_group
	has_character_flag = yom_kippur

	trigger = {
		OR = {
			trait = lustful
			trait = hedonist
		}
		NOT = { has_character_flag = yom_kippur_lustful_hedonist }
	}

	mean_time_to_happen = {
		days = 45
	}

	option = {
		name = "EVTOPTA88518"
		set_character_flag = yom_kippur_lustful_hedonist
		piety = -5
	}
}

# Drunkard Sin
character_event = {
	id = Plus.722
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_722"
	picture = "GFX_evt_drunk"
	border =  "GFX_event_normal_frame_religion"
	
	min_age = 16
	capable_only = yes
	prisoner = no
	religion_group = jewish_group
	has_character_flag = yom_kippur

	trigger = {
		trait = drunkard
		NOT = { has_character_flag = yom_kippur_drunkard }
	}

	mean_time_to_happen = {
		days = 45
	}

	option = {
		name = "EVTOPTA88519"
		piety = -5
		set_character_flag = yom_kippur_drunkard
	}
}

# Greedy Sin
character_event = {
	id = Plus.723
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_723"
	picture = "GFX_evt_lunatic"
	border =  "GFX_event_normal_frame_religion"
	
	min_age = 16
	capable_only = yes
	prisoner = no
	religion_group = jewish_group
	has_character_flag = yom_kippur

	trigger = {
		trait = greedy
		NOR = {
			has_character_flag = yom_kippur_greedy
			trait = just
		}
	}

	mean_time_to_happen = {
		days = 45
	}

	option = {
		name = "EVTOPTA88520"
		piety = -5
		wealth = 5
		set_character_flag = yom_kippur_greedy
	}
}

# Cynical Sin
character_event = {
	id = Plus.724
	title = "YOM_KIPPUR_TITLE"
	desc = "EVTDESC_Plus_724"
	picture = "GFX_evt_lunatic"
	border =  "GFX_event_normal_frame_religion"
	
	min_age = 16
	capable_only = yes
	prisoner = no
	religion_group = jewish_group
	has_character_flag = yom_kippur

	trigger = {
		trait = cynical
		NOT = { has_character_flag = yom_kippur_cynical }
	}

	mean_time_to_happen = {
		days = 45
	}

	option = {
		name = "EVTOPTA88521"
		piety = -5
		set_character_flag = yom_kippur_cynical
	}
}

# Province holder informed that jewish community has turned into a minority
character_event = {
	id = Plus.725
	desc = "EVTDESC_Plus_725"
	picture = "GFX_evt_bishop"

	is_triggered_only = yes
	hide_from = yes
	
	option = {
		name = "EVTOPTAPlus_725" # Leave them be
		ai_chance = {
			factor = 25
			
			modifier = {
				factor = 3
				trait = slothful
			}
			modifier = {
				factor = 0.5
				trait = zealous
			}
		}
		
		piety = -10
		FROM = { # Origin Province
			random_province_holding = {
				limit = { is_republic = yes } # Must be built in a city
				random_list = {
					50 = { add_building = ct_jewish_community_1 }
					25 = { add_building = ct_jewish_community_2 }
					15 = { add_building = ct_jewish_community_3 }
					10 = {  # The Jews find a new home
						custom_tooltip = { text = ctt_the_jews_leave }
						hidden_tooltip = {
							random_list = {
								55 = { change_variable = { which = "global_jewish_refugees" value = 1 } }
								30 = { change_variable = { which = "global_jewish_refugees" value = 2 } }
								15 = { change_variable = { which = "global_jewish_refugees" value = 3 } }
							}
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTBPlus_725" # Ease their concerns
		trigger = {
			OR = {
				trait = sympathy_judaism
				trait = kind
				trait = charitable
			}
		}
		ai_chance = {
			factor = 50
		}

		FROM = { # Origin Province
			random_province_holding = {
				limit = { is_republic = yes } # Must be built in a city
				random_list = {
					55 = { add_building = ct_jewish_community_1 }
					30 = { add_building = ct_jewish_community_2 }
					15 = { add_building = ct_jewish_community_3 }
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTCPlus_725" # Threaten the rest out
		ai_chance = {
			factor = 25

			modifier = {
				factor = 3
				trait = zealous
			}
		}
		custom_tooltip = { text = ctt_the_jews_leave }
		piety = 10
		hidden_tooltip = {
			random_list = {
				55 = { change_variable = { which = "global_jewish_refugees" value = 1 } }
				30 = { change_variable = { which = "global_jewish_refugees" value = 2 } }
				15 = { change_variable = { which = "global_jewish_refugees" value = 3 } }
			}
		}
	}
}

province_event = {
	id = Plus.726 # Bounce

	is_triggered_only = yes
	hide_window = yes

	trigger = {
		FROM = { religion_group = jewish_group } # FROM = Old Religion
		NOT = { religion_group = jewish_group } # Make sure it didn't just convert to a heresy but entirely out of the Jewish group
	}
	
	immediate = {
		if = { # Make sure there actually is a city to place a community into
			limit = { any_province_holding = { is_republic = yes } }
			owner = { character_event = { id = Plus.725 } }
		}
		else = { # There's no city for them to go to, so they just leave
			random_list = {
				55 = { change_variable = { which = "global_jewish_refugees" value = 1 } }
				30 = { change_variable = { which = "global_jewish_refugees" value = 2 } }
				15 = { change_variable = { which = "global_jewish_refugees" value = 3 } }
			}			
		}
	}
}