decisions = {
	
	i_am_orthodoxy = {     #making Empire religiously stable
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			ai = yes
			has_landed_title = k_orthodox
			religion = orthodox
			NOT = {         
				e_byzantium = {
					holder_scope = {
						capital_scope = {
							has_province_modifier = byzantium_orthodox
			            }
		            }
                }
			} 
		}
		allow = {  
			e_byzantium = {
				has_holder = yes
				holder_scope = {
					religion = orthodox
					has_landed_title = c_byzantion
					capital_scope = { province_id = 496 }
				}
			}
		}
		effect = {
			piety = 100
			prestige = 100
			religion_authority = {
				modifier = orthodoxy_lives_on
	        }
			e_byzantium = {
				holder_scope = {
					capital_scope = {
						add_province_modifier = {
							name = byzantium_orthodox
				            duration = 3650
			            }
		            }
                }
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	restore_the_themata = {
		is_high_prio = yes
		ai_check_interval = 12

		potential = {
			has_global_flag = collapse_of_themata_system    
			has_landed_title = e_byzantium
			OR = {
				religion = chalcedonian
				religion = orthodox
				religion = bogomilist
				religion = monothelite
				religion = iconoclast
				religion_group = hellenic_pagan_group
			}
		}
		allow = {
			war = no
			has_regent = no
			independent = yes
			e_byzantium = {
				NOT = { has_law = crown_authority_0 }
			}
			completely_controls = d_anatolia
			completely_controls = d_charsianon
			completely_controls = d_paphlagonia 
			completely_controls = d_armeniacon
		}
		effect = {
			clr_global_flag = collapse_of_themata_system
			set_character_flag = centralize_without_penalties
			if = {
				limit = { trait = weak_basileus }
				add_trait = strong_basileus
			}
			if = {
				limit = {
					e_byzantium = { has_law = crown_authority_3 }
			    }
				e_byzantium = { add_law = crown_authority_4 }
			}
			if = {
				limit = {
					e_byzantium = { has_law = crown_authority_2 }
			    }
				e_byzantium = { add_law = crown_authority_3 }
			}
			if = {
				limit = {
					OR = {
						e_byzantium = { has_law = crown_authority_1 }
						e_byzantium = { has_law = crown_authority_0 }
					}
			    }
				e_byzantium = { add_law = crown_authority_2 }
			}
			prestige = 500
			give_nickname = nick_the_liberator
			clr_character_flag = centralize_without_penalties
		}
		ai_will_do = {
			factor = 1
		}
	}
  
	claim_the_imperial_throne = {
		is_high_prio = yes
		ai_check_interval = 12

		potential = {
			independent = no
			higher_real_tier_than = COUNT
			is_feudal = yes
			mercenary = no
			holy_order = no
			liege = {
				real_tier = EMPEROR
				has_imperial_government_trigger = yes
				primary_title = {
					temporary = no
					ROOT = { NOT = { has_strong_claim = PREV } }
				}
			}
		}
		allow = {
			war = no
			has_regent = no
			prestige = 1000
			piety = 100
			wealth = 0
			OR = {
				trait = proud
				trait = ambitious
				trait = brave
			}
			NOR = {
				trait = humble
				trait = content
				trait = craven
			}
			liege = {
				war = no
				religion = ROOT
			}
		}
		effect = {
			prestige = -1000
			liege = {
				primary_title = { add_claim = ROOT }
				hidden_tooltip = {
					character_event = { id = Plus.1308 }
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				always = yes
			}
			modifier = {
				factor = 5
				liege = { trait = uncrowned }
			}
			modifier = {
				factor = 0.2
				liege = { trait = strong_basileus }
				NOT = { trait = ambitious }
			}
			modifier = {
				factor = 0.5
				liege = { NOT = { culture = ROOT } }
			}
			modifier = {
				factor = 0
				NOT = { prestige = 1250 }
			}
			modifier = {
				factor = 0
				NOR = {
					martial = 12
					diplomacy = 12
					intrigue = 12
					is_smart_trigger = yes
					trait = born_in_the_purple
					trait = lunatic
					trait = possessed
				}
			}
			modifier = {
				factor = 0
				OR = {
					is_ill = yes
					trait = stressed
					trait = depressed
					is_weak_trigger = yes
					is_dumb_trigger = yes
					liege = { NOT = { culture_group = ROOT } }
				}
			}
		}
	}

	request_byzantine_coronation = {
		is_high_prio = yes

		potential = {  
			has_landed_title = e_byzantium
			e_byzantium = { is_primary_holder_title = yes }
			NOR = {
				trait = strong_basileus
				trait = weak_basileus
			}
			OR = {
				religion = orthodox
				religion = chalcedonian
			}
			is_nomadic = no
			d_pentarch_constantinople = {
				has_holder = yes
				holder_scope = {
					religion = ROOT
					NOT = { character = ROOT }
					OR = {
						NOT = { has_character_flag = refused_to_coronate }
						had_character_flag = { flag = refused_to_coronate days = 1095 }
					}
				}
			}
			NOT = { has_character_flag = during_the_coronation }
		}
		allow = {
			war = no
			has_regent = no
			piety = 25
			scaled_wealth = 1.0
			is_adult = yes
		}
		effect = {
			set_character_flag = during_the_coronation
			d_pentarch_constantinople = {
				holder_scope = { 
					character_event = { id = Plus.1321 }
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	lower_imperial_decadence = {
		is_high_prio = yes
		
		potential = {
			tier = EMPEROR
			is_ironman = no
			OR = {
				has_character_modifier = imperial_decadence_1
				has_character_modifier = imperial_decadence_2
				has_character_modifier = imperial_decadence_3
				has_character_modifier = imperial_decadence_4
				has_character_modifier = imperial_decadence_5
				has_character_modifier = imperial_decadence_6
				has_character_modifier = imperial_decadence_7
				has_character_modifier = imperial_decadence_8
			}
		}
		allow = {
			war = no
			has_regent = no
			ruled_years = 5
			prestige = 1000
			piety = 100
			NOT = { trait = uncrowned }
			custom_tooltip = {
				text = NOT_RECENTLY_LOWER_DECADENCE
				hidden_tooltip = {
					NOT = { has_character_modifier = lower_imperial_decadence_timer }
				}
			}
		}
		effect = {
			prestige = -1000
			piety = -100
			if = {
				limit = {
					has_character_flag = lowered_decadence_once
					trait = weak_basileus
				}
				add_trait = strong_basileus
				hidden_tooltip = {
					narrative_event = { id = Plus.1338 }
				}
			}
			if = {
				limit = {
					NOT = { has_character_flag = lowered_decadence_once }
					trait = weak_basileus
				}
				set_character_flag = lowered_decadence_once
			}
			ROOT = {
				custom_tooltip = { text = IMPERIAL_DECADENCE_MINUS_1TO5 }
				hidden_tooltip = {
					random_list = {
						10 = {
							modifier = {
								factor = 4
								OR = {
									has_character_modifier = imperial_decadence_1
									has_character_modifier = imperial_decadence_2
								}
							}
							primary_title = { change_variable = { which = "imperial_decadence" value = -1 } }
						}
						15 = {
							modifier = {
								factor = 4
								OR = {
									has_character_modifier = imperial_decadence_1
									has_character_modifier = imperial_decadence_2
									has_character_modifier = imperial_decadence_3
								}
							}
							primary_title = { change_variable = { which = "imperial_decadence" value = -2 } }
						}
						20 = {
							modifier = {
								factor = 4
								OR = {
									has_character_modifier = imperial_decadence_3
									has_character_modifier = imperial_decadence_4
									has_character_modifier = imperial_decadence_5
									has_character_modifier = imperial_decadence_6
								}
							}
							primary_title = { change_variable = { which = "imperial_decadence" value = -3 } }
						}
						15 = {
							modifier = {
								factor = 4
								OR = {
									has_character_modifier = imperial_decadence_6
									has_character_modifier = imperial_decadence_7
									has_character_modifier = imperial_decadence_8
								}
							}
							primary_title = { change_variable = { which = "imperial_decadence" value = -4 } }
						}
						10 = {
							modifier = {
								factor = 4
								OR = {
									has_character_modifier = imperial_decadence_7
									has_character_modifier = imperial_decadence_8
								}
							}
							primary_title = { change_variable = { which = "imperial_decadence" value = -5 } }
						}
					}
					character_event = { id = Plus.1852 } # change the decadence modifier
				}
			}
			hidden_tooltip = { character_event = { id = PlusFaction.200 days = 1 } } #recalculate faction moods
			hidden_tooltip = {
				any_vassal = {
					limit = {
						OR = {
							trait = just
							trait = honest
							trait = trusting
						}
						NOT = {
							trait = greedy
							trait = deceitful
							trait = paranoid
						}
					}
					opinion = { who = ROOT modifier = opinion_lowered_decadence_pos multiplier = 2 months = 60 }
				}
				any_vassal = {
					limit = {
						NOT = {
							trait = just
							trait = honest
							trait = trusting
						}
						OR = {
							trait = greedy
							trait = deceitful
							trait = paranoid
						}
					}
					opinion = { who = ROOT modifier = opinion_lowered_decadence_neg multiplier = 2 months = 60 }
				}
				any_vassal = {
					limit = {
						OR = {
							trait = just
							trait = honest
							trait = trusting
						}
						OR = {
							trait = greedy
							trait = deceitful
							trait = paranoid
						}
					}
					opinion = { who = ROOT modifier = opinion_lowered_decadence_neg months = 60 }
				}
				add_character_modifier = {
					name = lower_imperial_decadence_timer
					duration = 1095
					hidden = yes
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	prove_strong_basileus = {
		is_high_prio = yes
		
		potential = {
			has_landed_title = e_byzantium
			e_byzantium = { is_primary_holder_title = yes }
			trait = weak_basileus
		}
		allow = {
			war = no
			has_regent = no
			completely_controls = c_byzantion
			ruled_years = 5
			prestige = 2500
			piety = 500
			custom_tooltip = {
				text = NO_VASSALS_DISLIKE
				hidden_tooltip = {
					NOT = {
						any_vassal = {
							higher_tier_than = COUNT
							NOT = { opinion = { who = ROOT value = 0 } }
						}
					}
				}
			}
			custom_tooltip = {
				text = IMPERIAL_DEC_UNDER_10
				hidden_tooltip = {
					NOR = {
						has_character_modifier = imperial_decadence_1
						has_character_modifier = imperial_decadence_2
						has_character_modifier = imperial_decadence_3
						has_character_modifier = imperial_decadence_4
						has_character_modifier = imperial_decadence_5
						has_character_modifier = imperial_decadence_6
						has_character_modifier = imperial_decadence_7
						has_character_modifier = imperial_decadence_8
					}
				}
			}
		}
		effect = {
			add_trait = strong_basileus
			hidden_tooltip = {
				narrative_event = { id = Plus.1338 }
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	byz_suppress_paulicians = {
		is_high_prio = yes
		ai_check_interval = 12
		
		potential = {
			has_landed_title = e_byzantium
			OR = {
				religion = orthodox
				religion = chalcedonian
			}
			any_realm_province = { religion = paulician }
			has_global_flag = sergius_tychus
			NOT = { has_global_flag = paulician_supress }
		}
		allow = {
			war = no
			has_regent = no
			piety = 100
			OR = {
				NOT = { trait = just }
				trait = zealous
			}
		}
		effect = {
			piety = -100
			set_global_flag = paulician_supress
			if = {
				limit = { trait = just }
				remove_trait = just
			}
			if = {
				limit = { trait = charitable }
				remove_trait = charitable
			}
			religion_head = {
				opinion = { who = ROOT modifier = opinion_pleased multiplier = 2 years = 10 }
			}
			custom_tooltip = {
				text = suppress_paulicians_tooltip
				hidden_tooltip = {
					any_realm_province = {
						limit = { religion = paulician }
						ROOT = { scaled_wealth = 0.2 }
						add_province_modifier = {
							name = paulician_suppression
							duration = 3650
						}
					}
					any_courtier = {
						limit = {
							is_ruler = no
							is_adult = yes
							prisoner = no
							religion = paulician
						}
						banish = yes
					}
					character_event = { id = Plus.2106 }
				}
			}
			any_realm_province = {
				limit = {
					religion = paulician
					any_neighbor_province = { religion = ROOT }
				}
				random = {
					chance = 25
					religion = ROOT
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					trait = kind
					trait = cynical
				}
			}
			modifier = {
				factor = 5
				trait = zealous
			}
			modifier = {
				factor = 2
				trait = wroth
			}
			modifier = {
				factor = 2
				trait = greedy
			}
		}
	}	
}

