###########################################
# Flavor Events for Byzantine Missions
#
# Scripted by Henrik Lohmander
###########################################

namespace = flavor_byz
normal_or_historical_nations = yes

#Sack of Venice
country_event = {
	id = flavor_byz.1
	title = flavor_byz.1.t
	desc = flavor_byz.1.d
	picture = WOUNDED_SOLDIERS_eventPicture
	
	is_triggered_only = yes
	major = yes
	major_trigger = {
		byz_is_in_middle_east_or_europe = yes
	}
	
	goto = 112
	
	option = {
		name = flavor_byz.1.a
		
		ai_chance = {
			factor = 1
		}
		
		112 = {
			custom_tooltip = BYZ_this_province_will_lose_development
			
			custom_tooltip = " "
			
			hidden_effect = {
				export_to_variable = {
					which = BYZ_amount_of_dev
					value = trigger_value:development
				}
				multiply_variable = {
					which = BYZ_amount_of_dev
					value = 0.75
				}
				while = {
					limit = {
						check_variable = {
							which = BYZ_amount_of_dev
							value = 1
						}
						OR = {
							base_tax = 2
							base_production = 2
							base_manpower = 2
						}
					}
					random_list = {
						1 = {
							trigger = {
								base_tax = 2
							}
							add_base_tax = -1
							ROOT = { add_treasury = 75 }
						}
						1 = {
							trigger = {
								base_production = 2
							}
							add_base_production = -1
							ROOT = { add_treasury = 75 }
						}
						1 = {
							trigger = {
								base_manpower = 2
							}
							add_base_manpower = -1
							ROOT = { add_treasury = 75 }
						}
					}
					change_variable = {
						which = BYZ_amount_of_dev
						value = -1
					}
				}
				set_variable = {
					which = BYZ_amount_of_dev
					value = 0
				}
			}
			
			add_permanent_province_modifier = {
				name = BYZ_chastening_of_venice
				duration = -1
			}
		}
		capital_scope = {
			add_province_modifier = {
				name = "byzantine_treasures_returned"
				duration = 7300
			}
		}
	}
	
	option = {
		name = flavor_byz.1.b
		
		ai_chance = {
			factor = 0
		}
		
		if = {
			limit = {
				has_dlc = "Domination"
			}
			add_country_modifier = { 
				name = BYZ_may_construct_galleass
				duration = -1
			}
			custom_tooltip = BYZ_may_only_build_in_112
			hidden_effect = {
				112 = {
					add_province_modifier = {
						name = BYZ_local_galleass
						duration = -1
					}
				}
			}
		}
		else = {
			112 = {
				add_province_modifier = {
					name = BYZ_arsenal
					duration = -1
				}
			}
		}
	}

}

# The Patriarch of Constantinople declares the Great Schism mended
# by Veronica Pazos
country_event = {
	id = flavor_byz.2
	title = flavor_byz.2.t
	desc = flavor_byz.2.d
	picture = RELIGION_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = flavor_byz.2.a
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				ai_attitude = {
					who = BYZ
					attitude = attitude_rivalry
				}
			}
			modifier = {
				factor = 0
				ai_attitude = {
					who = BYZ
					attitude = attitude_hostile
				}
			}
			modifier = {
				factor = 0
				ai_attitude = {
					who = BYZ
					attitude = attitude_outraged
				}
			}
		}
		change_religion = orthodox
		capital_scope = {
			if = {
				limit = {
					NOT = { religion = orthodox }
				}
				change_religion = orthodox
			}
		}
		add_stability = -1
		add_prestige = -30
	}
	option = {
		name = flavor_byz.2.b
		ai_chance = {
			factor = 1
		}
		add_stability = -3
	}
}

namespace = MEE_Byzantine_Events

country_event = {
	id = MEE_Byzantine_Events.1
	title = MEE_Byzantine_Events.1.t
	desc = MEE_Byzantine_Events.1.d
	picture = SEJM_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.1.a
		
		ai_chance = {
			factor = 1
		}
		
		add_country_modifier = {
			name = MEE_strong_example_against_the_serbian_aristocrats
			duration = 10950
		}
		
		add_mil_power = 100
	}
	
	option = {
		name = MEE_Byzantine_Events.1.b
		
		ai_chance = {
			factor = 1
		}
		
		add_country_modifier = {
			name = MEE_amiable_treatment
			duration = 9125
		}
		
		add_dip_power = 100
	}
}

country_event = {
	id = MEE_Byzantine_Events.2
	title = MEE_Byzantine_Events.2.t
	desc = MEE_Byzantine_Events.2.d
	picture = {
		picture = CONSTANTINOPLE_eventPicture
		trigger = {
			has_dlc = "King of Kings"
		}
	}
	picture = {
		picture = CITY_VIEW_eventPicture
		trigger = {
			not = { has_dlc = "King of Kings" }
		}
	}
	
	is_triggered_only = yes 
	
	major = yes
	major_trigger = {
		OR = {
			culture_group = byzantine
			capital_scope = {
				region = italy_region
			}
		}
	}
	
	goto = 123
	
	immediate = {
		hidden_effect = {
			pick_best_provinces = {
				3 = yes
				scale = higher_development_than
				global_trigger = "
					country_or_non_sovereign_subject_holds = ROOT 
					OR = {
						area = apulia_area
						area = calabria_area
						area = sicily_area
						area = western_sicily_area
					}
					NOT = { province_id = 123 }
					NOT = { province_id = 122 }
				"
				scope = every_province
				event_target_name = "Byz_griko_target"
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.2.a
		
		ai_chance = {
			factor = 1
		}
		
		123 = {
			change_culture = griko
			add_base_tax = 1
			add_base_production = 1
		}
		122 = {
			change_culture = griko
			add_base_tax = 1
			add_base_production = 1
		}
		
		event_target:Byz_griko_target_1 = {
			change_culture = griko
		}
		
		event_target:Byz_griko_target_2 = {
			change_culture = griko
		}
		
		event_target:Byz_griko_target_3 = {
			change_culture = griko
		}
		
		add_years_of_trade_income = {
			years = 1
			custom_tooltip = BYZ_add_1_years_of_trade_income
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.3
	title = MEE_Byzantine_Events.3.t 
	desc = MEE_Byzantine_Events.3.d
	picture = LAND_MILITARY_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.3.a
		
		ai_chance = {
			factor = 1
		}
		
		create_general_with_pips = {
			name = "Tyllios"
			tradition = 80
			add_fire = 1
			add_shock = 1
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.3.b
		
		ai_chance = {
			factor = 1
		}
		
		create_general_with_pips = {
			name = "Tyllios"
			tradition = 80
			add_shock = 2
			add_manuever = 1
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.3.c
		
		ai_chance = {
			factor = 1
		}
		
		create_general_with_pips = {
			tradition = 80
			name = "Tyllios"
			add_siege = 1
			add_manuever = 1
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.3.e
		
		ai_chance = {
			factor = 1
		}
		
		create_general_with_pips = {
			tradition = 80
			name = "Tyllios"
			add_fire = 1
			add_manuever = 2
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.4
	title = MEE_Byzantine_Events.4.t 
	desc = MEE_Byzantine_Events.4.d
	picture = POPE_PREACHING_eventPicture
	
	major = yes
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.4.a
		
		ai_chance = {
			factor = 1
		}
		
		custom_tooltip = BYZ_unlock_justinians_empire_decision 
		set_country_flag = BYZ_justinians_empire_decision_flag
		
		custom_tooltip = " "
		
		add_permanent_power_projection = {
			type = byz_permanent_power_projection
			amount = 5
		}
		
		if = {
			limit = {
				has_dlc = "Rights of Man"
			}
			custom_tooltip = " "
			set_country_flag = BYZ_double_conqueror_chance_flag
			custom_tooltip = BYZ_double_conquer_chance
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.5
	title = MEE_Byzantine_Events.5.t 
	desc = MEE_Byzantine_Events.5.d
	picture = UNIVERSITY_eventPicture
	
	mean_time_to_happen = { months = 60 }
	
	fire_only_once = yes
	
	trigger = {
		mission_completed = BYZ_justinians_ambition
		owns = 118
		not = { 118 = { is_capital_of = root } }
	}
	
	goto = 118
	
	option = {
		name = MEE_Byzantine_Events.5.a
		ai_chance = {
			factor = 1
		}
		
		capital_scope = {
			add_province_modifier = {
				name = BYZ_secondary_capital
				duration = -1
			}
		}
		if = {
			limit = {
				not = { 118 = { is_capital_of = root } }
			}
			118 = {
				add_base_tax = 1
				add_base_production = 1
				add_base_manpower = 4 
				custom_tooltip = " "
				move_capital_effect = yes
				add_province_triggered_modifier = BYZ_heart_of_the_empire
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.5.b
		
		ai_chance = {
			factor = 1
		}
		
		118 = {
			add_province_modifier = {
				name = BYZ_secondary_capital
				duration = -1
			}
		}
		
		capital_scope = {
			add_base_tax = 2
			add_base_production = 2
			add_base_manpower = 2
			
			custom_tooltip = " "
			
			add_province_triggered_modifier = BYZ_illustrious_court
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.6
	title = MEE_Byzantine_Events.6.t
	desc = MEE_Byzantine_Events.6.d
	picture = ORTHODOX_eventPicture
	
	is_triggered_only = yes 
	major = yes
	
	option = {
		name = MEE_Byzantine_Events.6.a
		
		ai_chance = {
			factor = 1
		}
		
		add_country_modifier = {
			name = BYZ_reversal_of_downfall
			duration = 10950 
		}
		
		add_power_projection_mission = {
			amount = 25
		}
	}
}

province_event = {
	id = MEE_Byzantine_Events.7
	title = MEE_Byzantine_Events.7.t
	desc = MEE_Byzantine_Events.7.d
	picture = FARMING_eventPicture
	
	trigger = {
		owner = {
			culture_group = byzantine
			has_country_flag = BYZ_conversions
		}
		culture_group = turko_semitic 
		BYZ_eligible_province_for_culture_conversion = yes
	}
	
	goto = ROOT
	
	mean_time_to_happen = {
		months = 240
		modifier = {
			factor = 3
			NOT = {
				OR = {
					area = aydin_area
					area = hudavendigar_area
				}
			}
		}
		modifier = {
			factor = 0.25
			owner = {
				has_country_flag = BYZ_culture_conversion_will_be_faster_flag
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.7.a
		
		ai_chance = {
			factor = 1
		}
		
		BYZ_convert_to_greek_culture = yes
	}
}

country_event = {
	id = MEE_Byzantine_Events.8
	title = MEE_Byzantine_Events.8.t
	desc = MEE_Byzantine_Events.8.d
	picture = RELIGIOUS_CONVERSION_eventPicture
	
	is_triggered_only = yes 
	major = yes
	
	option = {
		name = MEE_Byzantine_Events.8.a
		
		ai_chance = {
			factor = 1
		}
		
		add_accepted_culture_or_dip_power = { culture = turkish dip_reward = yes }
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_every_turkish_province
		tooltip = {
			add_nationalism = -10
		}
		hidden_effect = {
			every_owned_province = {
				limit = {
					culture = turkish
				}
				add_nationalism = -10 
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.8.b
		
		ai_chance = {
			factor = 1
		}
		
		set_country_flag = BYZ_culture_conversion_will_be_faster_flag
		custom_tooltip = BYZ_culture_conversion_will_be_faster
	}
	
	option = {
		name = MEE_Byzantine_Events.8.c
		
		ai_chance = {
			factor = 1
		}
		
		custom_tooltip = BYZ_every_turkish_province
		tooltip = {
			add_province_modifier = {
				name = BYZ_janissary_recruitment
				duration = 9125
			}
		}
		
		hidden_effect = {
			every_owned_province = {
				limit = {
					culture = turkish
				}
				add_province_modifier = {
					name = BYZ_janissary_recruitment
					duration = 9125
				}
			}
		}
		
		custom_tooltip = BYZ_unlock_janissary_mercenary_company
		set_country_flag = BYZ_janissary_merc_company
	}
}

country_event = {
	id = MEE_Byzantine_Events.9
	title = MEE_Byzantine_Events.9.t
	desc = MEE_Byzantine_Events.9.d
	picture = RELIGIOUS_TURMOIL_eventPicture
	
	is_triggered_only = yes 
	major = yes
	
	goto = 385
	
	option = {
		name = MEE_Byzantine_Events.9.a
		
		ai_chance = {
			factor = 1
		}
		
		add_adm_power = 100
		
		custom_tooltip = " "
		385 = {
			if = {
				limit = {
					NOT = { has_tax_building_trigger = yes }
				}
				add_building = cathedral
			}
			else = {
				add_or_upgrade_tax_building = yes
			}
		}
		if = {
			limit = {
				has_dlc = "Leviathan"
			}
			custom_tooltip = " "
			custom_tooltip = BYZ_kaaba_but_only_gives_prestige_and_half_of_religious_unity
			set_country_flag = BYZ_may_use_kaaba
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.9.b
		
		ai_chance = {
			factor = 1
		}
		
		add_dip_power = 100
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_relations
		hidden_effect = {
			every_country = {
				limit = {
					religion_group = muslim
				}
				add_opinion = {
					who = ROOT 
					modifier = BYZ_spared_masjid
				}
			}
		}
		
		custom_tooltip = " "
		
		385 = {
			add_province_modifier = {
				name = BYZ_masjid_local_pilgrimages
				duration = -1
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.10
	title = MEE_Byzantine_Events.10.t
	desc = MEE_Byzantine_Events.10.d
	picture = HARBOUR_eventPicture
	
	is_triggered_only = yes 
	major = yes
	
	goto = 330
	
	option = {
		name = MEE_Byzantine_Events.10.a
		
		ai_chance = {
			factor = 1
		}
		
		330 = {
			set_center_level_2_center_of_trade = yes
		}
		
		custom_tooltip = " "
		
		add_country_modifier = {
			name = BYZ_offshoots_defeated
			duration = -1
		}
		
		add_power_projection_mission = { amount = 25 }
	}
}

country_event = {
	id = MEE_Byzantine_Events.11
	title = MEE_Byzantine_Events.11.t
	desc = MEE_Byzantine_Events.11.d
	picture = FORT_eventPicture
	
	is_triggered_only = yes 
	
	goto = 4701 #more important than losing in 145
	
	option = {
		name = MEE_Byzantine_Events.11.a
		
		ai_chance = {
			factor = 1
		}
		
		if = {
			limit = {
				145 = {
					owned_by = ROOT
					has_building = fort_15th
				}
			}
			145 = {
				remove_building = fort_15th
			}
		}
		if = {
			limit = {
				4701 = {
					owned_by = ROOT
					NOT = { has_fort_building_trigger = yes }
				}
			}
			4701 = {
				add_building = fort_15th
			}
		}
		
		custom_tooltip = " "
		
		set_country_flag = BYZ_unlock_decision_to_upgrade_hexamilion_wall_flag
		custom_tooltip = BYZ_unlock_decision_to_upgrade_hexamilion_wall
	}
	
	option = {
		name = MEE_Byzantine_Events.11.b
		
		ai_chance = {
			factor = 0
		}
		
		set_country_flag = BYZ_upgrading_theodosian_walls_will_be_25_cheaper
		custom_tooltip = BYZ_upgrading_theodosian_walls_will_be_25_cheaper
	}
}

country_event = {
	id = MEE_Byzantine_Events.12
	title = MEE_Byzantine_Events.12.t
	desc = MEE_Byzantine_Events.12.d
	picture = FORT_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.12.a
		
		ai_chance = {
			factor = 1
		}
		
		trigger = {
			exists = SER
		}
		
		custom_tooltip = BYZ_we_will_ask_for_serbian_help
		SER = {
			country_event = { id = MEE_Byzantine_Events.15 days = 30 random = 60 }
		}
		
		custom_tooltip = BYZ_maximize
	}
	
	option = {
		name = MEE_Byzantine_Events.12.b
		
		ai_chance = {
			factor = 1
		}
		goto = 151
		
		151 = {
			add_base_tax = -2
			add_province_modifier = {
				name = BYZ_theodosian_wall_1
				duration = -1
			}
		}
		
		custom_tooltip = BYZ_if_it_is_being_upgraded
		if = {
			limit = {
				has_country_flag = BYZ_upgrading_theodosian
			}
			if = {
				limit = {
					has_country_flag = BYZ_upgrading_theodosian_walls_will_be_25_cheaper
				}
				add_treasury = 75
			}
			else = {
				add_treasury = 100
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.12.c
		
		ai_chance = {
			factor = 1
		}
		
		add_prestige_or_monarch_power = { amount = 20 }
	}
}

country_event = {
	id = MEE_Byzantine_Events.13
	title = MEE_Byzantine_Events.13.t
	desc = MEE_Byzantine_Events.13.d
	picture = FORT_eventPicture
	
	is_triggered_only = yes 
	#hidden = yes
	goto = 4701
	
	option = {
		name = MEE_Byzantine_Events.13.a
		
		ai_chance = {
			factor = 1
		}
		
		if = {
			limit = {
				4701 = {
					owned_by = ROOT
				}
			}
			custom_tooltip = BYZ_upgrade_complete
		}
		
		hidden_effect = {
			BYZ_upgrade_hexamilion_if_possible = yes
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.14
	title = MEE_Byzantine_Events.14.t
	desc = MEE_Byzantine_Events.14.d
	picture = FORT_eventPicture
	
	is_triggered_only = yes 
	#hidden = yes
	goto = 151
	
	option = {
		name = MEE_Byzantine_Events.14.a
		
		ai_chance = {
			factor = 1
		}
		
		if = {
			limit = {
				151 = {
					owned_by = ROOT
				}
			}
			custom_tooltip = BYZ_upgrade_complete
		}
		hidden_effect = {
			BYZ_upgrade_theodosian_if_possible = yes
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.15
	title = MEE_Byzantine_Events.15.t
	desc = MEE_Byzantine_Events.15.d
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes 
	major = yes
	major_trigger = { tag = FROM }
	
	option = {
		name = MEE_Byzantine_Events.15.a
		
		ai_chance = {
			factor = 0.5
			
			modifier = {
				factor = 4
				ai_attitude = {
					who = FROM
					attitude = attitude_friendly
				}
			}
			modifier = {
				factor = 4
				ai_attitude = {
					who = FROM
					attitude = attitude_allied
				}
			}
			
			modifier = {
				factor = 2
				has_opinion = {
					who = FROM
					value = 125
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					who = FROM
					value = 150
				}
			}
		}
		
		add_treasury = -250
		FROM = {
			add_treasury = 250
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.15.b
		
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				has_opinion = {
					who = FROM
					value = 150
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					who = FROM
					value = 100
				}
			}
			modifier = {
				factor = 2
				has_opinion = {
					who = FROM
					value = 75
				}
			}
		}
	
		add_treasury = -150
		FROM = {
			add_treasury = 150
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.15.c
		
		ai_chance = {
			factor = 1
			
			modifier = {
				factor = 2
				has_opinion = {
					who = FROM
					value = 50
				}
			}
			
			modifier = {
				factor = 2
				has_opinion = {
					who = FROM
					value = 25
				}
			}
		}
		
		add_treasury = -50
		FROM = {
			add_treasury = 50
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.15.e
		
		ai_chance = {
			factor = 0.5
			
			modifier = {
				factor = 0
				NOT = {
					OR = {
						ai_attitude = {
							who = FROM
							attitude = attitude_hostile
						}
						ai_attitude = {
							who = FROM
							attitude = attitude_rivalry
						}
						ai_attitude = {
							who = FROM
							attitude = attitude_outraged
						}
					}
				}
			}
			
			modifier = {
				factor = 3
				NOT = {
					has_opinion = {
						who = FROM
						value = 0
					}
				}
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.16
	title = MEE_Byzantine_Events.16.t
	desc = MEE_Byzantine_Events.16.d
	picture = RELIGION_eventPicture
	
	is_triggered_only = yes 
	major = yes
	major_trigger = {
		religion = orthodox 
	}
	
	option = {
		name = MEE_Byzantine_Events.16.a
		
		ai_chance = {
			factor = 1
		}
		
		set_global_flag = BYZ_buff_clerical_ministers_for_orthodox
		set_country_flag = BYZ_buff_clerical_ministers_for_byz
		custom_tooltip = BYZ_every_orthodox_country_clerical_buff
		
		custom_tooltip = " "
		
		add_patriarch_authority = 0.25
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_countries_will_like_us_more
		hidden_effect = {
			every_country = {
				limit = {
					religion = ROOT
				}
				add_opinion = {
					who = ROOT
					modifier = BYZ_orthodox_confraternity
				}
			}
		}
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_diplo_annexing_orthodox_countries
		set_country_flag = BYZ_diplo_annexing_orthodox_countries
	}
}

country_event = {
	id = MEE_Byzantine_Events.17
	title = MEE_Byzantine_Events.17.t
	desc = MEE_Byzantine_Events.17.d
	picture = RELIGION_eventPicture
	
	is_triggered_only = yes 
	major = yes
	
	goto = 151 #arguably most important seat
	
	option = {
		name = MEE_Byzantine_Events.17.a
		
		ai_chance = {
			factor = 1
		}
		
		hidden_effect = {
			151 = { add_province_triggered_modifier = BYZ_seat_of_a_patriarch }
			2313 = { add_province_triggered_modifier = BYZ_seat_of_a_patriarch }
			379 = { add_province_triggered_modifier = BYZ_seat_of_a_patriarch }
			358 = { add_province_triggered_modifier = BYZ_seat_of_a_patriarch }
			118 = { add_province_triggered_modifier = BYZ_seat_of_a_patriarch }
		}
		tooltip = {
			151 = { add_province_triggered_modifier = BYZ_seat_of_a_patriarch }
			custom_tooltip = BYZ_other_provinces_will_also_receive_this_modifier
		}
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_enable_the_hold_ecumenical_council_decision
		set_country_flag = BYZ_ecumenical_decision_flag
	}
}

country_event = {
	id = MEE_Byzantine_Events.18 
	title = MEE_Byzantine_Events.18.t #ecumenical council
	desc = MEE_Byzantine_Events.18.d
	picture = RELIGION_eventPicture
	
	is_triggered_only = yes 
	
	goto = byz_council_prov
	
	immediate = {
		hidden_effect = {
			capital_scope = {
				save_event_target_as = byz_council_prov
			}
			random_owned_province = {
				limit = {
					religion = orthodox
				}
				save_event_target_as = byz_council_prov
			}
			random_owned_province = {
				limit = {
					religion = orthodox
					development = 15
				}
				save_event_target_as = byz_council_prov
			}
			random_owned_province = {
				limit = {
					religion = orthodox
					development = 25
				}
				save_event_target_as = byz_council_prov
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.18.a
		
		ai_chance = {
			factor = 1
		}
		
		add_dip_power = 50
		add_adm_power = 50
		
		custom_tooltip = " "
		
		add_country_modifier = {
			name = BYZ_invoke_piety
			duration = 9125
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.18.b
		
		ai_chance = {
			factor = 1
		}
		
		add_stability_or_adm_power = yes
		
		custom_tooltip = " "
		
		add_country_modifier = {
			name = BYZ_resolve_disputes
			duration = 9125
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.18.c
		
		ai_chance = {
			factor = 1
		}
		
		add_patriarch_authority = 0.1
		
		custom_tooltip = " "
		
		add_country_modifier = {
			name = BYZ_support_patriarch
			duration = 7300
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.19 
	title = MEE_Byzantine_Events.19.t #the notaras family
	desc = MEE_Byzantine_Events.19.d
	picture = TRADEGOODS_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.19.a
		
		ai_chance = {
			factor = 1
		}
		
		define_admiral = {
			shock = 2
			fire = 3
			manuever = 2
			siege = 0
			name = "Loukas Notaras"
		}
		
		custom_tooltip = " "
		
		add_navy_tradition = 20
	}
	
	option = {
		name = MEE_Byzantine_Events.19.b
		
		ai_chance = {
			factor = 1
		}
		
		add_years_of_trade_income = {
			years = 2
			custom_tooltip = BYZ_add_2_years_of_trade_income
		}
		
		custom_tooltip = " "
		
		define_advisor = {
			type = trader
			name = "Notaras" #Can I somehow make it generate a random name?
			skill = 3
			culture = ROOT
			religion = ROOT
			cost_multiplier = 0.4 #so its slightly better than events
		}
	}
}

# country_event = {
	# id = MEE_Byzantine_Events.20 
	# title = MEE_Byzantine_Events.20.t #Future of the Kommerkion
	# desc = MEE_Byzantine_Events.20.d
	# picture = GOOD_WITH_MONARCH_eventPicture
	
	# is_triggered_only = yes 
	
	# option = {
		# name = MEE_Byzantine_Events.20.a #set it up
		
		# ai_chance = {
			# factor = 1
		# }
		
		
	# }
	
	# option = {
		# name = MEE_Byzantine_Events.20.b #abolish it
		
		# ai_chance = {
			# factor = 1
		# }
		
		
	# }
# }


country_event = {
	id = MEE_Byzantine_Events.21 
	title = MEE_Byzantine_Events.21.t #Byzantine Merchants Regain Prominence
	desc = MEE_Byzantine_Events.21.d
	picture = TRADEGOODS_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.21.a
		
		ai_chance = {
			factor = 1
		}
		
		custom_tooltip = BYZ_buff_private_trade_fleet
		set_country_flag = BYZ_private_trade_fleet_buff
	}
	
	option = {
		name = MEE_Byzantine_Events.21.b
		
		ai_chance = {
			factor = 1
		}
		
		custom_tooltip = BYZ_buff_burgher_loans
		set_country_flag = BYZ_buff_burgher_loans_flag #I know this one doesn't end in _buff. 
	}
	
	option = {
		name = MEE_Byzantine_Events.21.c
		
		ai_chance = {
			factor = 1
		}
		
		custom_tooltip = BYZ_buff_free_enterprise
		set_country_flag = BYZ_free_enterprise_buff
	}
}

country_event = {
	id = MEE_Byzantine_Events.22 
	title = MEE_Byzantine_Events.22.t #Royal Purple Map
	desc = MEE_Byzantine_Events.22.d
	picture = GREAT_BUILDING_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.22.a #keep our color
		
		ai_chance = {
			factor = 1
		}
		
		
	}
	
	option = {
		name = MEE_Byzantine_Events.22.b #roman empire color
		
		ai_chance = {
			factor = 0
		}
		
		custom_tooltip = BYZ_we_will_adopt_color_of_roman_empire
		change_country_color = { color = { 167 10 100 } }
	}
	
	# option = {
		# name = MEE_Byzantine_Events.22.c #angevin empire color
		
		# ai_chance = {
			# factor = 0
		# }
		
		# change_country_color = { color = { 110 0 140 } }
	# }
	
	# option = {
		# name = MEE_Byzantine_Events.22.e #malaya color
		
		# ai_chance = {
			# factor = 0
		# }
		
		# change_country_color = { color = { 80 10 165 } }
	# }
}

province_event = {
	id = MEE_Byzantine_Events.23 
	title = MEE_Byzantine_Events.23.t
	desc = MEE_Byzantine_Events.23.d
	picture = TRADEGOODS_eventPicture
	
	is_triggered_only = yes 
	
	goto = root
	
	option = {
		name = MEE_Byzantine_Events.23.a
		
		ai_chance = {
			factor = 1
		}
		
		if = {
			limit = {
				has_province_flag = BYZ_may_convert_to_dyes
			}
			change_trade_goods = dyes
			clr_province_flag = BYZ_may_convert_to_dyes
		}
		else_if = {
			limit = {
				has_province_flag = BYZ_may_convert_to_silk
			}
			change_trade_goods = silk
			clr_province_flag = BYZ_may_convert_to_silk
		}
		else_if = {
			limit = {
				has_province_flag = BYZ_may_convert_to_glass
			}
			change_trade_goods = glass
			clr_province_flag = BYZ_may_convert_to_glass
		}
		else = {
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.23.b
		
		ai_chance = {
			factor = 0
		}
		
		#custom_tooltip = BYZ_nothing_will_occur
		add_base_tax = 1
		add_base_production = 1
		add_base_manpower = 1 
	}
}

country_event = {
	id = MEE_Byzantine_Events.24 
	title = MEE_Byzantine_Events.24.t #Mosaicists
	desc = MEE_Byzantine_Events.24.d
	picture = PAINTER_ARTIST_eventPicture
	
	is_triggered_only = yes 
	immediate = {
		hidden_effect = {
			save_event_target_as = byz_event_from_recipient
			#Should select the most powerful ally, most powerful player ally if possible
			random_ally = {
				save_event_target_as = byz_mosaicists_ally
			}
			every_ally = {
				limit = {
					total_development = event_target:byz_mosaicists_ally
				}
				save_event_target_as = byz_mosaicists_ally
			}
			random_ally = {
				limit = {
					ai = no #player
					was_player = yes
				}
				save_event_target_as = byz_mosaicists_ally
			}
			every_ally = {
				limit = {
					ai = no #player
					was_player = yes
					total_development = event_target:byz_mosaicists_ally
				}
				save_event_target_as = byz_mosaicists_ally
			}
			#Select most powerful country, preferably most powerful player country, from Europe or Middle East
			
			random_known_country = {
				limit = {
					byz_is_in_middle_east_or_europe = yes
					NOT = { tag = ROOT }
					if = {
						limit = {
							has_saved_event_target = byz_mosaicists_ally
						}
						NOT = { tag = event_target:byz_mosaicists_ally }
					}
				}
				save_event_target_as = byz_mosaicists_powerful
			}
			every_known_country = {
				limit = {
					byz_is_in_middle_east_or_europe = yes
					NOT = { tag = ROOT }
					if = {
						limit = {
							has_saved_event_target = byz_mosaicists_ally
						}
						NOT = { tag = event_target:byz_mosaicists_ally }
					}
					total_development = event_target:byz_mosaicists_powerful
				}
				save_event_target_as = byz_mosaicists_powerful
			}
			
			#Select a wealthy country that isn't also the most powerful country in the desired area
			
			random_known_country = {
				limit = {
					byz_is_in_middle_east_or_europe = yes
					NOT = { tag = ROOT }
					if = {
						limit = {
							has_saved_event_target = byz_mosaicists_ally
						}
						NOT = { tag = event_target:byz_mosaicists_ally }
					}
					if = {
						limit = {
							has_saved_event_target = byz_mosaicists_powerful
						}
						NOT = { tag = event_target:byz_mosaicists_powerful }
					}
				}
				save_event_target_as = byz_mosaicists_wealthy
			}
			every_known_country = {
				limit = {
					byz_is_in_middle_east_or_europe = yes
					NOT = { tag = ROOT }
					if = {
						limit = {
							has_saved_event_target = byz_mosaicists_ally
						}
						NOT = { tag = event_target:byz_mosaicists_ally }
					}
					if = {
						limit = {
							has_saved_event_target = byz_mosaicists_powerful
						}
						NOT = { tag = event_target:byz_mosaicists_powerful }
					}
					monthly_income = event_target:byz_mosaicists_wealthy
				}
				save_event_target_as = byz_mosaicists_wealthy
			}
			
			BYZ_if_saved_export_variable = {
				name = byz_mosaicists_ally
			}
			BYZ_if_saved_export_variable = {
				name = byz_mosaicists_powerful
			}
			BYZ_if_saved_export_variable = {
				name = byz_mosaicists_wealthy
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.24.a
		
		ai_chance = {
			factor = 1
		}
		
		trigger = {
			has_saved_event_target = byz_mosaicists_ally
		}
		
		add_country_modifier = {
			name = BYZ_supporting_allies
			duration = 3650
		}
		
		event_target:byz_mosaicists_ally = {
			BYZ_offer_mosaicists = yes
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.24.b
		
		ai_chance = {
			factor = 1
		}
		
		trigger = {
			has_saved_event_target = byz_mosaicists_powerful
		}
		
		add_prestige_or_monarch_power = { amount = 15 }
		
		custom_tooltip = " "
		
		event_target:byz_mosaicists_powerful = {
			BYZ_offer_mosaicists = yes
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.24.c
		
		ai_chance = {
			factor = 1
		}
		
		trigger = {
			has_saved_event_target = byz_mosaicists_wealthy
		}
		
		add_dip_power = 25
		
		custom_tooltip = " "
		
		event_target:byz_mosaicists_wealthy = {
			BYZ_offer_mosaicists = yes
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.24.e
		
		ai_chance = {
			factor = 0.01 #relatively low
		}
		
		if = {
			limit = {
				has_dlc = "Leviathan"
			}
			add_country_modifier = {
				name = BYZ_mosaicists_Leviathan_self
				duration = 3650
			}
		}
		else = {
			add_country_modifier = {
				name = BYZ_mosaicists_self
				duration = 3650
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.25 
	title = MEE_Byzantine_Events.25.t #Byzantine Offer
	desc = MEE_Byzantine_Events.25.d
	picture = ECONOMY_eventPicture
	
	is_triggered_only = yes 
	major = yes
	major_trigger = {
		tag = event_target:byz_event_from_recipient
	}
	
	option = {
		name = MEE_Byzantine_Events.25.a
		
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				NOT = {
					years_of_income = 0.2
					has_opinion = {
						who = FROM 
						value = 50
					}
				}
			}
		}
		
		custom_tooltip = BYZ_payment
		hidden_effect = {
			while = {
				limit = {
					check_variable = {
						which = byz_yearly_income
						value = 100
					}
				}
				subtract_variable = {
					which = byz_yearly_income
					value = 100
				}
				FROM = {
					add_treasury = 100
				}
				add_treasury = -100
			}
			while = {
				limit = {
					check_variable = {
						which = byz_yearly_income
						value = 1
					}
				}
				subtract_variable = {
					which = byz_yearly_income
					value = 1
				}
				FROM = {
					add_treasury = 1
				}
				add_treasury = -1
			}
			while = {
				limit = {
					check_variable = {
						which = byz_yearly_income
						value = 0.01
					}
				}
				subtract_variable = {
					which = byz_yearly_income
					value = 0.01
				}
				FROM = {
					add_treasury = 0.01
				}
				add_treasury = -0.01
			}
		}
		
		custom_tooltip = " "
		
		if = {
			limit = {
				has_dlc = "Leviathan"
			}
			add_country_modifier = {
				name = BYZ_mosaicists_Leviathan
				duration = 3650
			}
		}
		else = {
			add_country_modifier = {
				name = BYZ_mosaicists
				duration = 3650
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.25.b
		
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					years_of_income = 0.2
					has_opinion = {
						who = FROM 
						value = 50
					}
				}
			}
		}
		
		add_prestige_or_monarch_power = { amount = 10 }
		
		FROM = {
			if = {
				limit = {
					has_dlc = "Leviathan"
				}
				add_country_modifier = {
					name = BYZ_mosaicists_Leviathan_self
					duration = 3650
				}
			}
			else = {
				add_country_modifier = {
					name = BYZ_mosaicists_self
					duration = 3650
				}
			}
		}
	}
	
	after = {
		hidden_effect = {
			if = {
				limit = {
					has_saved_event_target = byz_mosaicists_ally
				}
				event_target:byz_mosaicists_ally = {
					set_variable = {
						which = byz_yearly_income
						value = 0
					}
				}
			}
			if = {
				limit = {
					has_saved_event_target = byz_mosaicists_powerful
				}
				event_target:byz_mosaicists_powerful = {
					set_variable = {
						which = byz_yearly_income
						value = 0
					}
				}
			}
			if = {
				limit = {
					has_saved_event_target = byz_mosaicists_wealthy
				}
				event_target:byz_mosaicists_wealthy = {
					set_variable = {
						which = byz_yearly_income
						value = 0
					}
				}
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.26 
	title = MEE_Byzantine_Events.26.t #Price change for silk
	desc = MEE_Byzantine_Events.26.d
	picture = TRADEGOODS_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.26.a
		
		ai_chance = {
			factor = 1
		}
		
		change_price = {
			trade_goods = silk
			key = BYZ_growing_demand
			value = 0.2
			duration = -1
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.27 
	title = MEE_Byzantine_Events.27.t #theme system
	desc = MEE_Byzantine_Events.27.d
	picture = BATTLE_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.27.a
		
		ai_chance = {
			factor = 1
		}
		
		custom_tooltip = BYZ_unlock_theme_system_reform
		hidden_effect = {
			unlock_government_reform = {
				government_reform = theme_system_reform
			}
		}
		
		if = {
			limit = {
				NOT = { reform_level = 5 }
			}
			change_government_reform_progress = 100
		}
		else = {
			custom_tooltip = BYZ_enact_theme_system_reform
			hidden_effect = {
				add_government_reform = theme_system_reform
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.27.b
		
		ai_chance = {
			factor = 0
		}
		
		trigger = {
			reform_level = 5
		}
		change_government_reform_progress = 50
		hidden_effect = {
			unlock_government_reform = {
				government_reform = theme_system_reform
			}
		}
		
		custom_tooltip = BYZ_unlock_theme_system_reform
	}
}

country_event = {
	id = MEE_Byzantine_Events.28 
	title = MEE_Byzantine_Events.28.t #Handle Branching Missions
	desc = MEE_Byzantine_Events.28.d
	picture = COURT_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.28.a
		
		ai_chance = {
			factor = 100
		}
		
		trigger = {
			OR = {
				has_country_flag = BYZ_decentralized
				has_country_flag = BYZ_centralized
			}
		}
		select_current_missions = { key = BYZ }
	}
	
	option = {
		name = MEE_Byzantine_Events.28.b
		
		ai_chance = {
			factor = 0
		}
		
		trigger = {
			NOT = { has_country_flag = BYZ_decentralized }
		}
		
		clr_country_flag = BYZ_centralized
		set_country_flag = BYZ_decentralized
		swap_non_generic_missions = yes
		custom_tooltip = BYZ_preview_decentralized
	}
	
	option = {
		name = MEE_Byzantine_Events.28.c
		
		ai_chance = {
			factor = 0
		}
		
		trigger = {
			NOT = { has_country_flag = BYZ_centralized }
		}
		
		clr_country_flag = BYZ_decentralized
		set_country_flag = BYZ_centralized
		swap_non_generic_missions = yes
		custom_tooltip = BYZ_preview_centralized
	}
	
	option = {
		name = MEE_Byzantine_Events.28.e
		
		ai_chance = {
			factor = 0
		}
		
		trigger = {
		}
		
		custom_tooltip = BYZ_nothing_will_occur
	}

	#AI section
	option = {
		trigger = {
			ai = yes
		}
		random_list = {
			1 = { set_country_flag = BYZ_centralized clr_country_flag = BYZ_decentralized }
			1 = { set_country_flag = BYZ_decentralized clr_country_flag = BYZ_centralized }
		}
		swap_non_generic_missions = yes
		select_current_missions = { key = BYZ }
		ai_chance = {
			factor = 100
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.29 
	title = MEE_Byzantine_Events.29.t
	desc = MEE_Byzantine_Events.29.d
	picture = LAND_MILITARY_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.29.a
		
		ai_chance = {
			factor = 100
		}
		
		custom_tooltip = BYZ_upgrade_the_reliance_on_the_pronoiar
		hidden_effect = {
			remove_country_modifier = BYZ_reliance_on_the_pronoiar
			add_country_modifier = {
				name = BYZ_reliance_on_the_pronoiar_2
				duration = -1
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.29.b
		
		ai_chance = {
			factor = 100
		}
		
		custom_tooltip = BYZ_pronoia_subject_no_longer_reduces_forcelimit
		set_country_flag = BYZ_no_pronoia_forcelimit_penalty
	}
	
	option = {
		name = MEE_Byzantine_Events.29.c
		
		ai_chance = {
			factor = 100
		}
		
		custom_tooltip = BYZ_pronoia_extra_forcelimit
		set_country_flag = BYZ_extra_forcelimit_for_pronoiars_flag
	}
}

country_event = {
	id = MEE_Byzantine_Events.30 
	title = MEE_Byzantine_Events.30.t
	desc = MEE_Byzantine_Events.30.d
	picture = LAND_MILITARY_eventPicture
	
	is_triggered_only = yes 
	
	option = {
		name = MEE_Byzantine_Events.30.a
		
		ai_chance = {
			factor = 100
		}
		
		custom_tooltip = BYZ_pronoiars_will_be_hereditary_by_default
		set_country_flag = BYZ_hereditary_pronoiars
	}
	
	option = {
		name = MEE_Byzantine_Events.30.b
		
		ai_chance = {
			factor = 100
		}
		
		custom_tooltip = BYZ_inheriting_pronoia_will_now_give_5_crownland
		set_country_flag = BYZ_inheriting_pronoia_crownland_flag
	}
	
	option = {
		name = MEE_Byzantine_Events.30.c
		
		ai_chance = {
			factor = 100
		}
		
		custom_tooltip = BYZ_pronoia_subjects_get_3_yearly_army_tradition
		set_country_flag = BYZ_pronoia_subjects_get_3_yearly_army_tradition_flag
	}
	
	option = {
		name = MEE_Byzantine_Events.30.e
		
		ai_chance = {
			factor = 100
		}
		
		custom_tooltip = BYZ_pronoia_will_get_5_discipline
		set_country_flag = BYZ_pronoia_will_get_5_discipline_flag
	}
}

country_event = {
	id = MEE_Byzantine_Events.31 
	title = MEE_Byzantine_Events.31.t #rumelihasari 
	desc = MEE_Byzantine_Events.31.d
	picture = FORT_eventPicture
	
	mean_time_to_happen = {
		months = 12
	}
	
	goto = 316
	
	fire_only_once = yes 
	
	trigger = {
		tag = TUR 
		has_dlc = "King of Kings"
		is_year = 1450
		not = { is_year = 1460 }	#After that Byz should be either dead, or has won against the Ottomans already
		151 = {
			owned_by = BYZ
		}
		316 = {
			owned_by = ROOT
		}
		BYZ = {
			NOT = { war_with = ROOT }
			NOT = {
				has_won_war_against = {
					who = PREV
					max_years_since = 100
				}
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.31.a
		
		ai_chance = {
			factor = 100
		}
		
		add_treasury = -100
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_it_will_take_a_year
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_benefits_of_the_castle
		
		tooltip = {
			316 = {
				add_province_modifier = {
					name = BYZ_rumelihasari_castle
					duration = 9125
				}
			}
			151 = {
				add_province_modifier = {
					name = BYZ_enemy_fortifications
					duration = 1825
				}
			}
		}
		
		hidden_effect = {
			country_event = { id = MEE_Byzantine_Events.32 days = 365 }
			BYZ = {
				country_event = { id = MEE_Byzantine_Events.33 days = 30 random = 60 }
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.31.b
		
		ai_chance = {
			factor = 0
		}
		
		
	}
}

country_event = {
	id = MEE_Byzantine_Events.32 
	title = MEE_Byzantine_Events.32.t
	desc = MEE_Byzantine_Events.32.d
	picture = FORT_eventPicture

	is_triggered_only = yes
	major = yes
	major_trigger = {
		OR = {
			tag = BYZ
			owns = 151
		}
	}
	
	trigger = {
		151 = {
			owned_by = BYZ
		}
		316 = {
			owned_by = ROOT
		}
	}
	
	goto = 316
	
	option = {
		name = MEE_Byzantine_Events.32.a
		
		ai_chance = {
			factor = 100
		}
		
		316 = {
			if = {
				limit = {
					owned_by = ROOT
				}
				add_province_modifier = {
					name = BYZ_rumelihasari_castle
					duration = 9125
				}
			}
		}
		151 = {
			if = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_province_modifier = {
					name = BYZ_enemy_fortifications
					duration = 1825
				}
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.33 
	title = MEE_Byzantine_Events.33.t
	desc = MEE_Byzantine_Events.33.d
	picture = STREET_SPEECH_eventPicture

	is_triggered_only = yes
	
	goto = 316
	
	trigger = {
		151 = {
			owned_by = ROOT
		}
		316 = {
			owned_by = FROM
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.33.a
		
		ai_chance = {
			factor = 100
		}
		
		reduce_stability_or_adm_power = yes
	
		custom_tooltip = " "
		
		custom_tooltip = BYZ_it_will_be_finished_soon
		tooltip = {
			316 = {
				add_province_modifier = {
					name = BYZ_rumelihasari_castle
					duration = 9125
				}
			}
			151 = {
				add_province_modifier = {
					name = BYZ_enemy_fortifications
					duration = 1825
				}
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.34
	title = MEE_Byzantine_Events.34.t #ottomans ceases tribute for orhan
	desc = MEE_Byzantine_Events.34.d
	picture = BANKRUPTCY_eventPicture
	
	mean_time_to_happen = {
		months = 12
	}
	
	fire_only_once = yes 
	
	trigger = {
		tag = BYZ
		exists = TUR
		is_year = 1448
	}
	
	option = {
		name = MEE_Byzantine_Events.34.a
		
		ai_chance = {
			factor = 66
		}
		
		custom_tooltip = BYZ_we_will_demand_the_tribute
		TUR = { country_event = { id = MEE_Byzantine_Events.35 days = 10 } }
	}
	
	option = {
		name = MEE_Byzantine_Events.34.b
		
		ai_chance = {
			factor = 33
		}
		
		custom_tooltip = BYZ_orhan_will_remain_in_constantinople
		set_country_flag = BYZ_orhan_in_constantinople
		add_dip_power = 50
	}
}

country_event = {
	id = MEE_Byzantine_Events.35
	title = MEE_Byzantine_Events.35.t 
	desc = MEE_Byzantine_Events.35.d
	picture = BAD_WITH_MONARCH_eventPicture
	
	is_triggered_only = yes
	major = yes
	major_trigger = {
		tag = BYZ
	}
	trigger = { exists = BYZ }

	option = {
		name = MEE_Byzantine_Events.35.a
		
		ai_chance = {
			factor = 66
		}
		
		custom_tooltip = BYZ_might_release
		BYZ = { country_event = { id = MEE_Byzantine_Events.36 days = 30 } }
	}
	
	option = {
		name = MEE_Byzantine_Events.35.b
		
		ai_chance = {
			factor = 33
		}
		
		add_treasury = -100 
		BYZ = { add_treasury = 100 }
	}
}

country_event = {
	id = MEE_Byzantine_Events.36
	title = MEE_Byzantine_Events.36.t 
	desc = MEE_Byzantine_Events.36.d
	picture = BORDER_TENSION_eventPicture
	
	is_triggered_only = yes
	major = yes
	major_trigger = {
		tag = TUR
	}
	trigger = { exists = TUR }

	option = {
		name = MEE_Byzantine_Events.36.a
		
		ai_chance = {
			factor = 66
		}
		
		add_yearly_manpower = -1
		TUR = {
			capital_scope = {
				spawn_rebels = {
					type = pretender_rebels
					size = 3
					leader = "Orhan Celebi"
				}
			}
		}
		
		hidden_effect = {
			if = {
				limit = {
					TUR = { ai = no }
				}
				TUR = { 
					declare_war_with_cb = {
						who = ROOT
						casus_belli = cb_conquest
						war_goal_province = 151
					}
				}
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.36.b
		
		ai_chance = {
			factor = 33
		}
		
		custom_tooltip = BYZ_orhan_will_remain_in_constantinople
		set_country_flag = BYZ_orhan_in_constantinople
	}
}

country_event = {
	id = MEE_Byzantine_Events.37
	title = MEE_Byzantine_Events.37.t #orhan's retinue
	desc = MEE_Byzantine_Events.37.d
	picture = COUNTRY_COLLAPSE_eventPicture
	
	mean_time_to_happen = {
		months = 12
	}
	
	fire_only_once = yes  
	
	trigger = {
		has_country_flag = BYZ_orhan_in_constantinople
		tag = BYZ
		war_with = TUR
		owns = 151 
	}
	
	option = {
		name = MEE_Byzantine_Events.37.a
		
		ai_chance = {
			factor = 50
		}
		
		goto = 151
		
		151 = {
			add_province_modifier = {
				name = BYZ_turkish_retinue
				duration = 3650
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.37.b
		
		ai_chance = {
			factor = 50
		}
		
		add_yearly_manpower = 1
	}
	
	after = {
		clr_country_flag = BYZ_orhan_in_constantinople
	}
}

country_event = {
	id = MEE_Byzantine_Events.38
	title = MEE_Byzantine_Events.38.t #constantinople outgrows its walls
	desc = MEE_Byzantine_Events.38.d
	picture = {
		picture = CONSTANTINOPLE_eventPicture
		trigger = {
			has_dlc = "King of Kings"
		}
	}
	picture = {
		picture = CITY_VIEW_eventPicture
		trigger = {
			not = { has_dlc = "King of Kings" }
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	fire_only_once = yes  
	goto = 151 
	trigger = {
		tag = BYZ
		owns = 151 
		151 = {
			development = 40
			num_of_buildings_in_province = 5
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.38.a
		
		ai_chance = {
			factor = 50
		}

		add_prestige_or_monarch_power = { amount = 40 }
		
		custom_tooltip = " "
		
		add_country_modifier = {
			name = BYZ_constantinople_outgrows_limits
			duration = 5475
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.39
	title = MEE_Byzantine_Events.39.t #campaign into thessaly
	desc = MEE_Byzantine_Events.39.d
	picture = BORDER_TENSION_eventPicture
	
	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 0.1
			is_year = 1449
		}
	}
	
	fire_only_once = yes  
	
	trigger = {
		tag = BYZ
		is_year = 1446
		OR = {
			has_ruler = "000000000"
			has_heir = "000000000"
		}
		NOT = { is_year = 1450 }
		exists = TUR 
	}
	
	option = {
		name = MEE_Byzantine_Events.39.a
		
		ai_chance = {
			factor = 75
		}

		add_mil_power = -150
		
		custom_tooltip = " "
		
		if = {
			limit = {
				has_ruler = "000000000"
			}
			change_mil = 1
			define_ruler_to_general = {
				fire = 3
				shock = 3
				manuever = 4
				siege = 1
			}
			set_ruler_flag = civil_war_exempt
		}
		else = {
			change_heir_mil = 1
			define_heir_to_general = {
				fire = 3
				shock = 3
				manuever = 4
				siege = 1
			}
			set_heir_flag = civil_war_exempt
		}
		
		custom_tooltip = " "
		
		add_country_modifier = {
			name = BYZ_experience_assaulting_thessaly
			duration = 3650
		}
		
		custom_tooltip = BYZ_ottomans_may_mount_punitive_expedition
		tooltip = {
			TUR = {
				add_mil_power = -25
				morea_area = {
					limit = {
						owned_by = BYZ 
					}
					add_province_modifier = {
						name = BYZ_ottoman_expedition
						duration = 7300
					}
				}
			}
		}
		
		hidden_effect = {
			TUR = {
				country_event = { id = MEE_Byzantine_Events.40 days = 30 }
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.39.b
		
		ai_chance = {
			factor = 25
		}

		if = {
			limit = {
				has_ruler = "000000000"
			}
			change_mil = 1
			set_ruler_flag = civil_war_exempt
		}
		else = {
			change_heir_mil = 1
			set_heir_flag = civil_war_exempt
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.40
	title = MEE_Byzantine_Events.40.t #punitive expedition
	desc = MEE_Byzantine_Events.40.d
	picture = BATTLE_eventPicture
	
	is_triggered_only = yes
	major = yes
	major_trigger = {
		tag = BYZ 
	}
	option = {
		name = MEE_Byzantine_Events.40.a
		
		ai_chance = {
			factor = 75
		}

		add_mil_power = -25
		morea_area = {
			limit = {
				owned_by = BYZ 
			}
			add_province_modifier = {
				name = BYZ_ottoman_expedition
				duration = 7300
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.40.b
		
		ai_chance = {
			factor = 25
		}

		
	}
}

country_event = {
	id = MEE_Byzantine_Events.41
	title = MEE_Byzantine_Events.41.t #evade taxes
	desc = MEE_Byzantine_Events.41.d
	picture = ECONOMY_eventPicture
	
	mean_time_to_happen = {
		months = 60
	}
	
	fire_only_once = yes  
	
	trigger = {
		tag = BYZ
		has_estate_privilege = estate_burghers_exkousseiai_for_latins
	}
	
	option = {
		name = MEE_Byzantine_Events.41.a
		
		ai_chance = {
			factor = 25
		}

		add_years_of_income = 2
		
		custom_tooltip = " "
		
		add_estate_loyalty = { #no need for check. this privilege requires a burgher-only privilege.
			estate = estate_burghers
			loyalty = -20
		}
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_kommerkion_will_give_5_less_loyalty
		set_country_flag = BYZ_kommerkion_will_give_5_less_loyalty_flag
	}
	
	option = {
		name = MEE_Byzantine_Events.41.b
		
		ai_chance = {
			factor = 25
		}

		custom_tooltip = BYZ_kommerkion_will_give_5_less_trade_eff
		set_country_flag = BYZ_kommerkion_will_give_5_less_trade_eff_flag
	}
	
	option = {
		name = MEE_Byzantine_Events.41.c
		
		ai_chance = {
			factor = 25
		}

		add_years_of_income = -2
		
		custom_tooltip = " "
		remove_estate_privilege = estate_burghers_exkousseiai_for_latins
	}
}

country_event = {
	id = MEE_Byzantine_Events.42
	title = MEE_Byzantine_Events.42.t #demetrios claims the throne
	desc = MEE_Byzantine_Events.42.d
	picture = BAD_WITH_MONARCH_eventPicture
	
	is_triggered_only = yes #on action
	trigger = {
		NOT = { is_year = 1460 }
		has_ruler = "000000000"
	}
	
	option = {
		name = MEE_Byzantine_Events.42.a
		
		ai_chance = {
			factor = 25
		}

		add_ruler_modifier = {
			name = BYZ_demetrios_claims_the_throne
			duration = -1
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.43
	title = MEE_Byzantine_Events.43.t # Ottoman troops haul ships
	desc = MEE_Byzantine_Events.43.d
	picture = HARBOUR_eventPicture
	
	mean_time_to_happen = {
		months = 12
	}
	
	fire_only_once = yes
	major = yes
	major_trigger = {
		OR = {
			tag = TUR
			war_with = ROOT
		}
	}
	
	goto = 316
	
	trigger = {
		tag = BYZ
		151 = {
			owned_by = BYZ
			sieged_by = ROOT
		}
		316 = {
			owned_by = ROOT 
			controlled_by = ROOT
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.43.a
		
		ai_chance = {
			factor = 25
		}

		316 = {
			galley = ROOT
			galley = ROOT
			galley = ROOT
			galley = ROOT
			galley = ROOT
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.44
	title = MEE_Byzantine_Events.44.t #Walls of Constantinople
	desc = MEE_Byzantine_Events.44.d
	picture = FORT_eventPicture
	
	fire_only_once = yes
	
	goto = 151
	
	trigger = {
		tag = TUR
		151 = {
			owned_by = BYZ 
			sieged_by = ROOT
		}
		has_country_flag = tur_pierces_through_constantinople
	}
	major = yes
	major_trigger = {
		OR = {
			tag = BYZ
			war_with = ROOT
		}
	}
	immediate = {
		hidden_effect = {
			clr_country_flag = tur_pierces_through_constantinople
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.44.a
		
		ai_chance = {
			factor = 25
		}

		151 = {
			change_siege = 1
			add_province_modifier = {
				name = BYZ_piercing_the_theodosian_walls
				duration = 730
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.45
	title = MEE_Byzantine_Events.45.t #Fall of Constantinople
	desc = MEE_Byzantine_Events.45.d
	picture = SIEGE_PRAGUE_CASTLE_eventPicture
	
	fire_only_once = yes
	trigger = {
		tag = TUR 
		151 = {
			owned_by = BYZ
			controlled_by = ROOT
		}
		
		NOT = { exists = MOE }
	}
	
	option = {
		name = MEE_Byzantine_Events.45.a
		
		ai_chance = {
			factor = 90
			modifier = {
				factor = 0
				BYZ = { ai = no }
			}
		}

		add_prestige_or_monarch_power = { amount = 10 }
	}
	
	option = {
		name = MEE_Byzantine_Events.45.b
		
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				BYZ = { ai = yes }
			}
		}

		BYZ = {
			country_event = { id = MEE_Byzantine_Events.46 }
		}
		
		custom_tooltip = BYZ_if_byz_accepts
		tooltip = {
			BYZ = {
				change_tag = MOE
				set_country_flag = has_byz_missions
				define_ruler = {
					name = "000000"
					dynasty = "000000"
					adm = 2
					dip = 1
					mil = 1
					age = 30
					claim = 95
				}
				if = {
					limit = {
						thrace_area = { country_or_non_sovereign_subject_holds = BYZ }
					}
					thrace_area = {
						limit = {
							country_or_non_sovereign_subject_holds = BYZ 
						}
						cede_province = ROOT
					}
				}
				TUR = {
					white_peace = ROOT
					vassalize = ROOT
				}
				add_liberty_desire = -25
				add_truce_with = TUR
				TUR = { add_truce_with = BYZ }
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.46
	title = MEE_Byzantine_Events.46.t #Ottomans Advance on Morea
	desc = MEE_Byzantine_Events.46.d
	picture = SIEGE_eventPicture
	
	is_triggered_only = yes

	option = {
		name = MEE_Byzantine_Events.46.a
		
		ai_chance = {
			factor = 100
		}

		if = {
			limit = {
				NOT = { exists = MOE }
			}
			change_tag = MOE
			set_country_flag = has_byz_missions
			define_ruler = {
				name = "000000"
				dynasty = "000000"
				adm = 2
				dip = 1
				mil = 1
				age = 30
				claim = 95
			}
			if = {
				limit = {
					thrace_area = { country_or_non_sovereign_subject_holds = ROOT }
				}
				thrace_area = {
					limit = {
						country_or_non_sovereign_subject_holds = ROOT 
					}
					cede_province = TUR
				}
			}
			TUR = {
				white_peace = ROOT
				vassalize = ROOT
				remove_historical_rival = root
			}
			add_liberty_desire = -25
			add_truce_with = TUR
			remove_historical_rival = TUR
			TUR = { add_truce_with = root }
			set_country_flag = BYZ_accepted_ottoman_threat
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.46.b
		
		ai_chance = {
			factor = 0
		}

		FROM = {
			add_prestige_or_monarch_power = { amount = 10 }
		}
		
		custom_tooltip = " "
		
		add_country_modifier = {
			name = BYZ_fight_until_the_last_man
			duration = 3650
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.47
	title = MEE_Byzantine_Events.47.t #Unionist Revolt
	desc = MEE_Byzantine_Events.47.d
	picture = RELIGIOUS_TURMOIL_eventPicture
	
	mean_time_to_happen = {
		months = 240
		modifier = {
			factor = 0.5
			is_year = 1460
		}
		modifier = {
			factor = 0.5
			num_of_cities = 15 #no longer in danger
		}
		modifier = {
			factor = 0.5
			num_of_cities = 30 #definitely no longer in danger
		}
	}
	
	trigger = {
		has_estate_privilege = estate_church_union_of_the_churches
		# any_owned_province = { 
			# religion = orthodox
		# }
		or = {
			is_at_war = no
			total_development = 100
		}
	}
	
	goto = byz_revolt
	
	immediate = {
		hidden_effect = {
			capital_scope = {
				save_event_target_as = byz_revolt
			}
			random_list = {
				50 = {
				}
				50 = {
					random_owned_province = {
						limit = {
							religion = orthodox
						}
						save_event_target_as = byz_revolt
					}
				}
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.47.a
		
		ai_chance = {
			factor = 1
		}

		event_target:byz_revolt = {
			if = {
				limit = {
					ROOT = { total_development = 300 }
				}
				orthodox_rebels = 3
			}
			else_if = {
				limit = {
					ROOT = { total_development = 150 }
				}
				orthodox_rebels = 2
			}
			else = {
				orthodox_rebels = 1
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.48
	title = MEE_Byzantine_Events.48.t #We mend the schism
	desc = MEE_Byzantine_Events.48.d
	picture = RELIGIOUS_CONVERSION_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = MEE_Byzantine_Events.48.a
		
		ai_chance = {
			factor = 1
		}

		if = {
			limit = {
				religion = orthodox
			}
			add_patriarch_authority = 0.2
		
			custom_tooltip = " "
		}
		
		add_country_modifier = {
			name = "conversion_of_rome"
			duration = 7300
		}
		
		custom_tooltip = " "
		
		define_advisor = {
			type = theologian
			skill = 3
			culture = umbrian
			religion = ROOT
			cost_multiplier = 0.25
		}
		
		if = {
			limit = {
				religion = orthodox
			}
			custom_tooltip = " "
		
			custom_tooltip = BYZ_every_catholic
			hidden_effect = {
				every_country = {
					limit = { 
						religion = catholic 
						knows_country = BYZ
					}
					country_event = { id = flavor_byz.2 }
				}
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.49
	title = MEE_Byzantine_Events.49.t #Impending doom
	desc = MEE_Byzantine_Events.49.d
	picture = REFORM_eventPicture
	
	fire_only_once = yes 
	
	trigger = {
		tag = BYZ
		war_with = TUR
		owns = 151
	}
	
	mean_time_to_happen = { months = 6 }
	
	option = {
		name = MEE_Byzantine_Events.49.a
		
		ai_chance = {
			factor = 1
		}
		
		add_stability_or_adm_power = yes
	}
	
	option = {
		name = MEE_Byzantine_Events.49.b
		
		ai_chance = {
			factor = 1
		}
		
		add_country_modifier = {
			name = BYZ_to_walls
			duration = 1825
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.49.c
		
		ai_chance = {
			factor = 1
		}
		
		add_country_modifier = {
			name = BYZ_onto_the_fields
			duration = 1825
		}
	}
	
	after = {
		country_event = { id = MEE_Byzantine_Events.50 days = 45 random = 45 }
	}
}

country_event = {
	id = MEE_Byzantine_Events.50
	title = MEE_Byzantine_Events.50.t #Giovanni Gustiniani
	desc = MEE_Byzantine_Events.50.d
	picture = MILITARY_CAMP_eventPicture
	
	is_triggered_only = yes
	
	trigger = { 
		has_estate_privilege = estate_church_union_of_the_churches
	}

	option = {
		name = MEE_Byzantine_Events.50.a
		
		ai_chance = {
			factor = 1
		}
		
		define_general = {
			name = "0000000000000000"
			fire = 2
			shock = 2
			manuever = 3
			siege = 0
		} 
		
		add_yearly_manpower = 1
		add_yearly_sailors = 1
	}
}	

country_event = {
	id = MEE_Byzantine_Events.51
	title = MEE_Byzantine_Events.51.t #Confirm the Union of Florence
	desc = MEE_Byzantine_Events.51.d
	picture = ORTHODOX_eventPicture
	
	fire_only_once = yes 
	
	trigger = {
		tag = BYZ
		has_estate_privilege = estate_church_union_of_the_churches
	}
	
	major = yes
	major_trigger = {
		OR = {
			religion = catholic
			religion = orthodox
		}
	}
	
	mean_time_to_happen = { months = 3 }
	
	option = {
		name = MEE_Byzantine_Events.51.a
		
		ai_chance = {
			factor = 80
		}
		
		custom_tooltip = BYZ_open_to_the_west
	}
	
	option = {
		name = MEE_Byzantine_Events.51.b
		
		ai_chance = {
			factor = 20
		}
		
		remove_estate_privilege = estate_church_union_of_the_churches
		
		if = {
			limit = {
				has_estate = estate_church
			}
			custom_tooltip = " "
			add_estate_loyalty = {
				estate = estate_church
				loyalty = 25
			}
		}
		
		custom_tooltip = " "
		
		add_country_modifier = {
			name = BYZ_denied_the_westerners
			duration = 7300
		}
		
		custom_tooltip = BYZ_lose_opinion_with_all_catholics
		hidden_effect = {
			every_known_country = {
				limit = {
					religion = catholic
				}
				add_opinion = {
					who = ROOT
					modifier = BYZ_refused_union
				}
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.52
	title = MEE_Byzantine_Events.52.t #Papal Assertiveness
	desc = MEE_Byzantine_Events.52.d
	picture = ORTHODOX_eventPicture
	
	fire_only_once = yes 
	
	trigger = {
		tag = BYZ
		exists = TUR
		TUR = { ai = yes }
		has_estate_privilege = estate_church_union_of_the_churches
		is_in_war = {
			defender_leader = root
			attacker_leader = TUR
		}
	}
	
	mean_time_to_happen = { months = 12 }
	
	option = {
		name = MEE_Byzantine_Events.52.a
		
		ai_chance = {
			factor = 95
		}
	
	}
	
	option = {
		name = MEE_Byzantine_Events.52.b
		
		ai_chance = {
			factor = 5
		}
		
		change_religion = catholic
		change_tag = LAE
		if = {
			limit = { ironman = yes }
			custom_tooltip = BYZ_no_longer_eligible_for_byz_achievements
			set_country_flag = byz_dishonoring_justinian
		}
		set_country_flag = BYZ_gave_in_to_papal_pressure
		set_country_flag = has_byz_missions
		hidden_effect = {
			save_event_target_as = byz_latin_empire
		}
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_conversion_to_orthodox
		
		custom_tooltip = " "
		
		PAP = {
			country_event = { id = MEE_Byzantine_Events.53 days = 3 }
		}
		
		custom_tooltip = " "
		
		custom_tooltip = BYZ_organize_a_crusade
		
		PAP = {
			country_event = { id = MEE_Byzantine_Events.54 days = 30 }
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.53
	title = MEE_Byzantine_Events.53.t
	desc = MEE_Byzantine_Events.53.d
	picture = POPE_PREACHING_eventPicture
	
	is_triggered_only = yes
	
	major = yes
	major_trigger = {
		OR = {
			religion = catholic
			religion = orthodox
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.53.a
		
		ai_chance = {
			factor = 95
		}
	
		custom_tooltip = BYZ_every_catholic_country
		tooltip = {
			add_country_modifier = {
				name = BYZ_unity_with_constantinople
				duration = 9125
			}
		}
		hidden_effect = {
			every_known_country = {
				limit = {
					religion = catholic
				}
				add_country_modifier = {
					name = BYZ_unity_with_constantinople
					duration = 9125
				}
			}
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.54
	title = MEE_Byzantine_Events.54.t
	desc = MEE_Byzantine_Events.54.d
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = MEE_Byzantine_Events.54.a
		
		ai_chance = {
			factor = 100
		}
	
		join_all_defensive_wars_of = FROM
		every_known_country = {
			limit = {
				religion = catholic
				NOT = { is_subject = yes }
				NOT = { alliance_with = TUR }
				OR = {
					is_rival = TUR
					is_enemy = TUR
					BYZ_historical_interest_against_ottomans = yes
				}
			}
			country_event = { id = MEE_Byzantine_Events.55 days = 15 random = 15 }
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.54.b
		
		ai_chance = {
			factor = 0
		}
	
		add_country_modifier = {
			name = BYZ_betrayed_the_catholics_in_byzantium
			duration = -1
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.55
	title = MEE_Byzantine_Events.55.t
	desc = MEE_Byzantine_Events.55.d
	picture = DIPLOMACY_eventPicture
	
	is_triggered_only = yes
	
	major = yes
	major_trigger = {
		OR = {
			AND = {
				religion = catholic
				NOT = { is_subject = yes }
				NOT = { alliance_with = TUR }
				OR = {
					is_rival = TUR
					is_enemy = TUR
					BYZ_historical_interest_against_ottomans = yes
				}
			}
			war_with = event_target:byz_latin_empire
			tag = PAP
			tag = event_target:byz_latin_empire
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.55.a
		
		ai_chance = {
			factor = 20
			modifier = {
				factor = 0
				ai_attitude = {
					who = event_target:byz_latin_empire
					attitude = attitude_rivalry
				}
			}
			modifier = {
				factor = 0
				ai_attitude = {
					who = event_target:byz_latin_empire
					attitude = attitude_hostile
				}
			}
			modifier = {
				factor = 0
				ai_attitude = {
					who = event_target:byz_latin_empire
					attitude = attitude_outraged
				}
			}
		}
	
		join_all_defensive_wars_of = event_target:byz_latin_empire
	}
	
	option = {
		name = MEE_Byzantine_Events.55.b
		
		ai_chance = {
			factor = 10
		}
	
		
	}
}

country_event = {
	id = MEE_Byzantine_Events.56
	title = MEE_Byzantine_Events.56.t # What is a Pronoia Subject
	desc = MEE_Byzantine_Events.56.d
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_country_flag = has_had_BYZ_56 }
	}
	immediate = {
		set_country_flag = has_had_BYZ_56
	}
	major = yes
	
	option = {
		name = MEE_Byzantine_Events.56.a
		
		ai_chance = {
			factor = 10
		}
	
		custom_tooltip = BYZ_pronoia_subject_explanation
	}
}

country_event = {
	id = MEE_Byzantine_Events.57
	title = MEE_Byzantine_Events.57.t # Western Support
	desc = MEE_Byzantine_Events.57.d
	picture = MILITARY_CAMP_eventPicture
	
	trigger = {
		has_estate_privilege = estate_church_union_of_the_churches
		war_with = TUR
		NOT = { is_year = 1460 }
	}
	
	mean_time_to_happen = {
		months = 30
	}
	
	immediate = {
		hidden_effect = {
			random_list = {
				1 = {
					set_country_flag = BYZ_get_monetary_support
				}
				1 = {
					set_country_flag = BYZ_get_manpower_support
				}
				1 = { }
			}
		}
	}
	
	option = {
		name = MEE_Byzantine_Events.57.a
		
		ai_chance = {
			factor = 10
		}
		
		highlight = yes
		trigger = {
			has_estate_privilege = estate_church_union_of_the_churches
		}
	
		if = {
			limit = {
				has_country_flag = BYZ_get_monetary_support
			}
			add_years_of_income = 0.5
		}
		else_if = {
			limit = {
				has_country_flag = BYZ_get_manpower_support
			}
			add_yearly_manpower = 0.5
		}
		else = {
			add_mil_power = 25
		}
	}
}

country_event = {
	id = MEE_Byzantine_Events.58
	title = none
	desc = none
	picture = none
	
	hidden = yes
	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			random_ally = {
				save_event_target_as = byzantium_temp_target
			}
			every_ally = {
				limit = {
					total_development = event_target:byzantium_temp_target
				}
				save_event_target_as = byzantium_temp_target
			}
			define_advisor = {
				type = army_organiser
				cost_multiplier = 0.4
				skill = 2
				culture = event_target:byzantium_temp_target
				religion = event_target:byzantium_temp_target
			}
		}
	}
	
	option = {
		ai_chance = {
			factor = 10
		}
		
	}
}