﻿rus_conversion_decision = {
    #picture = "gfx/interface/illustrations/decisions/decision_realm.dds"
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}
    #major = yes
	decision_group_type = major 
	cooldown = { days = 3650 }


	desc = rus_conversion_decision_desc
	selection_tooltip = rus_conversion_decision_tooltip

    is_shown = {
		is_landed = yes
	    any_held_title = {
            tier = tier_county
            empire = title:e_russia	
		}
		NOR = { 
			faith = { religion_tag = christianity_religion }
			faith = { religion_tag = islam_religion }
			faith = { religion_tag = judaism_religion }
		 }
		 is_ai = no
    }

	is_valid = {
		#Must be independent.
		is_independent_ruler = yes
		#Must have a primary title within title:e_russia
		primary_title.empire = title:e_russia
		#Should have a decent prestige level.
		OR = {
			prestige_level >= high_prestige_level
			piety_level >= 3
		}
		#Must hold a Russian kingdom/empire title
		highest_held_title_tier >= tier_kingdom
    }

	cost = {
		prestige = 500
		piety = 250
	}

	is_valid_showing_failures_only = {
		is_available_at_peace_adult = yes
	}
	ai_will_do = 0
	ai_check_interval = 0

    effect = {
		custom_tooltip = rus_conversion_decision_custom_tooltip
		trigger_event = { id = rus_conversion_decision.0010 }
    }
}

adopt_a_new_faith_for_russia_decision = {
	ai_check_interval = 36

	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}
	decision_group_type = major 
	sort_order = -20
	#major = yes

	is_shown = {
		is_independent_ruler = yes
		is_ai = yes	
		OR = {
			culture = { has_cultural_pillar = heritage_east_slavic }
			culture = { has_cultural_pillar = heritage_north_germanic }
		}
		#Must have a primary title within title:e_russia
		primary_title.empire = title:e_russia
		#Must not follow a reformed faith
		NOT = { 
			religion = {
				any_faith = {
					count = all
					NOT = { has_doctrine = unreformed_faith_doctrine }
				}
			}
		}
		#Slavic Paganism must not have been reformed.
		religion:slavic_religion = {
			any_faith = {
				count = all
				has_doctrine = unreformed_faith_doctrine
			}
		}
	}

	is_valid = {
		is_independent_ruler = yes
		highest_held_title_tier >= tier_kingdom
		realm_size >= 20
	}

	is_valid_showing_failures_only = {
		is_imprisoned = no
		is_available_adult = yes
		is_capable_adult = yes
	}

	ai_potential = { always = yes }

	widget = {
		gui = "decision_view_widget_generic_multichoice_with_effects"
		controller = decision_option_list_controller
		decision_to_second_step_button = "CHOOSE_RUSSIAN_FAITH"
		show_from_start = yes

		# Orthodox
		item = {
			value = rus_choose_orthodox
			is_valid = {
				NOT = { faith = faith:orthodox } 					
				custom_tooltip = {
				text = rus_conversion_tooltip
					OR = {
						# Independent East Slavic duke or above follows this faith
						any_independent_ruler = {
							culture = { has_cultural_pillar = heritage_east_slavic }
							highest_held_title_tier >= tier_duchy
							in_diplomatic_range = root
							faith = faith:orthodox
						}
						# Empire in range follows this faith
						any_independent_ruler = {
							highest_held_title_tier >= tier_empire
							in_diplomatic_range = root
							faith = faith:orthodox
						}
						# A neighboring kingdom or above of sufficient size follows this faith
						any_neighboring_top_liege_realm_owner = {
							highest_held_title_tier >= tier_kingdom
							faith = faith:orthodox
							sub_realm_size >= 15
						}
					}					
				}
			}
			current_description = rus_choose_orthodox_desc
			localization = rus_choose_orthodox_name
			icon = "gfx/interface/icons/faith/orthodox.dds"
			ai_chance = {
				value = 20
				if = {
					limit = {
						any_sub_realm_county = {
							faith = faith:orthodox
						}
					}
					add = 20
				}
				if = {
					limit = {
						any_independent_ruler = {
							culture = { has_cultural_pillar = heritage_east_slavic }
							faith = faith:orthodox
						}
					}
					add = 20
				}
			}
		}
		# Islam
		item = {
			value = rus_choose_muslim
			is_valid = {
				NOT = { faith = faith:ashari }
				custom_tooltip = {
					text = rus_conversion_tooltip
						OR = {
							# Independent East Slavic duke or above follows this faith
							any_independent_ruler = {
								culture = { has_cultural_pillar = heritage_east_slavic }
								highest_held_title_tier >= tier_duchy
								in_diplomatic_range = root
								faith = faith:ashari
							}
							# Empire in range follows this faith
							any_independent_ruler = {
								highest_held_title_tier >= tier_empire
								in_diplomatic_range = root
								faith = faith:ashari
							}
							# A neighboring kingdom or above of sufficient size follows this faith
							any_neighboring_top_liege_realm_owner = {
								highest_held_title_tier >= tier_kingdom
								faith = faith:ashari
								sub_realm_size >= 15
							}
						}					
					}
			}
			current_description = rus_choose_muslim_desc
			localization = rus_choose_muslim_name
			icon = "gfx/interface/icons/faith/ashari.dds"

			ai_chance = {
				value = 5
				if = {
					limit = {
						has_trait = trait:lifestyle_reveler
					}
					add = -10
				}
				if = {
					limit = {
						has_trait = trait:drunkard
					}
					add = -10
				}
				if = {
					limit = {
						any_sub_realm_county = {
							faith = faith:ashari
						}
					}
					add = 20
				}
				if = {
					limit = {
						any_independent_ruler = {
							culture = { has_cultural_pillar = heritage_east_slavic }
							faith = faith:ashari
						}
					}
					add = 20
				}
			}
		}
		# Kuzarism
		item = {
			value = rus_choose_jewish
			is_valid = {
				NOT = { faith = faith:kabarism }
				custom_tooltip = {
					text = rus_conversion_tooltip
						OR = {
							# Independent East Slavic duke or above follows this faith
							any_independent_ruler = {
								culture = { has_cultural_pillar = heritage_east_slavic }
								highest_held_title_tier >= tier_duchy
								in_diplomatic_range = root
								faith = faith:kabarism
							}
							# Empire in range follows this faith
							any_independent_ruler = {
								highest_held_title_tier >= tier_empire
								in_diplomatic_range = root
								faith = faith:kabarism
							}
							# A neighboring kingdom or above of sufficient size follows this faith
							any_neighboring_top_liege_realm_owner = {
								highest_held_title_tier >= tier_kingdom
								faith = faith:kabarism
								sub_realm_size >= 15
							}
						}					
					}
			}
			current_description = rus_choose_jewish_desc
			localization = rus_choose_jewish_name
			icon = "gfx/interface/icons/faith/kabarism.dds"
			ai_chance = {
				value = 5
				if = {
					limit = {
						has_trait = trait:lifestyle_reveler
					}
					add = -10
				}
				if = {
					limit = {
						has_trait = trait:drunkard
					}
					add = -10
				}
				if = {
					limit = {
						any_sub_realm_county = {
							faith = faith:kabarism
						}
					}
					add = 10
				}
				if = {
					limit = {
						any_independent_ruler = {
							culture = { has_cultural_pillar = heritage_east_slavic }
							faith = faith:kabarism
						}
					}
					add = 10
				}
			}
		}
		# Catholic
		item = {
			value = rus_choose_catholic
			is_valid = {
				NOT = { faith = faith:catholic }
				custom_tooltip = {
					text = rus_conversion_tooltip
						OR = {
							# Independent East Slavic duke or above follows this faith
							any_independent_ruler = {
								culture = { has_cultural_pillar = heritage_east_slavic }
								highest_held_title_tier >= tier_duchy
								in_diplomatic_range = root
								faith = faith:catholic
							}
							# Empire in range follows this faith
							any_independent_ruler = {
								highest_held_title_tier >= tier_empire
								in_diplomatic_range = root
								faith = faith:catholic
							}
							# A neighboring kingdom or above of sufficient size follows this faith
							any_neighboring_top_liege_realm_owner = {
								highest_held_title_tier >= tier_kingdom
								faith = faith:catholic
								sub_realm_size >= 15
							}
						}					
					}
			}
			current_description = rus_choose_catholic_desc
			localization = rus_choose_catholic_name
			icon = "gfx/interface/icons/faith/catholic.dds"
			ai_chance = {
				value = 10
				if = {
					limit = {
						any_sub_realm_county = {
							faith = faith:catholic
						}
					}
					add = 20
				}
				if = {
					limit = {
						any_independent_ruler = {
							culture = { has_cultural_pillar = heritage_east_slavic }
							faith = faith:catholic
						}
					}
					add = 30
				}
			}
		}
		# Dynamic
		item = {
			value = rus_choose_dynamic
			is_valid = {
				custom_tooltip = {
					text = rus_conversion_tooltip
					OR = {
						any_empire = {
							exists = holder
							holder = {
								# has to be a reformed faith
								religion = {
									any_faith = { NOT = { has_doctrine = unreformed_faith_doctrine } }
								}
								# But not one of the other options
								NOR = {
									faith = faith:catholic
									faith = faith:orthodox
									faith = faith:ashari
									faith = faith:kabarism
								}
								in_diplomatic_range = root
							}
						}
						any_independent_ruler = {
							culture = { has_cultural_pillar = heritage_east_slavic }
							highest_held_title_tier >= tier_duchy
							religion = {
								any_faith = { NOT = { has_doctrine = unreformed_faith_doctrine } }
							}
							NOR = {
								faith = faith:catholic
								faith = faith:orthodox
								faith = faith:ashari
								faith = faith:kabarism
							}
						}
						any_neighboring_top_liege_realm_owner = {
							highest_held_title_tier >= tier_kingdom
							sub_realm_size >= 15
							religion = {
								any_faith = { NOT = { has_doctrine = unreformed_faith_doctrine } }
							}
							NOR = {
								faith = faith:catholic
								faith = faith:orthodox
								faith = faith:ashari
								faith = faith:kabarism
							}
						}							
					}
				}
			}
			current_description = rus_choose_dynamic_desc
			localization = rus_choose_dynamic_name
			icon = "gfx/interface/icons/faith/manichean.dds"
			ai_chance = {
				value = 15
			}
		}
	}
	effect = {
		root = { save_scope_as = converter }

		if = {
			limit = { scope:rus_choose_orthodox = yes }	
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:orthodox }
			}
			show_as_tooltip = { set_character_faith = faith:orthodox }
			hidden_effect = {
				set_character_faith_with_conversion = faith:orthodox
			}
			faith:orthodox = {
				change_fervor = {
					value = 10
					desc = fervor_gain_russian_fervor
				}
			}
			trigger_event = {
				id = rus_conversion_decision.08
				days = { 5 30 }
			}			
			#Notify Byzantine Emperor
			title:e_byzantium.holder = {
				trigger_event = {
					id = rus_conversion_decision.12
					days = { 3 30 }
				}
			}
		}
		else_if = {
			limit = { scope:rus_choose_muslim = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:ashari }
			}
			show_as_tooltip = { set_character_faith = faith:ashari }
			hidden_effect = {
				set_character_faith_with_conversion = faith:ashari }

			faith:ashari = {
				change_fervor = {
					value = 10
					desc = fervor_gain_russian_fervor
				}
			}
			#Muslim trade
			trigger_event = {
				id = rus_conversion_decision.13
				days = { 30 60 }
			}
		}
		else_if = {
			limit = { scope:rus_choose_jewish = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:kabarism }
			}
			show_as_tooltip = { set_character_faith = faith:kabarism }
			hidden_effect = {
				set_character_faith_with_conversion = faith:kabarism
			}
			faith:kabarism = {
				change_fervor = {
					value = 10
					desc = fervor_gain_russian_fervor
				}
			}
			trigger_event = {
				id = rus_conversion_decision.09
				days = { 30 60 }
			}
			#Jewish Settlement
			trigger_event = {
				id = rus_conversion_decision.09
				days = { 30 60 }
			}
		}
		else_if = {
			limit = { scope:rus_choose_catholic = yes  }
			
			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = faith:catholic }
			}
			show_as_tooltip = { set_character_faith = faith:catholic }
			hidden_effect = {
				set_character_faith_with_conversion = faith:catholic
			}
			faith:catholic = {
				change_fervor = {
					value = 10
					desc = fervor_gain_russian_fervor
				}
			}
			trigger_event = {
				id = rus_conversion_decision.010
				days = { 30 60 }
			}
			#Catholic Gifts
			trigger_event = {
				id = rus_conversion_decision.11
				days = { 30 60 }
			}
		}
		else_if = {
			limit = { scope:rus_choose_dynamic = yes  }
			ordered_ruler = {
				limit = {
					religion = {
						any_faith = { NOT = { has_doctrine = unreformed_faith_doctrine } }
					}
					# But not one of the other options
					NOR = {
						faith = faith:catholic
						faith = faith:orthodox
						faith = faith:ashari
						faith = faith:kabarism
					}
					OR = {
						highest_held_title_tier >= tier_empire
						culture = { has_cultural_pillar = heritage_east_slavic }
					}
					in_diplomatic_range = root
				}
				order_by = highest_held_title_tier
				faith = { save_scope_as = dynamic_faith }
			}

			if = {
				limit = {
					capital_county.faith = faith
				}
				capital_county = { set_county_faith = scope:dynamic_faith }
			}
			show_as_tooltip = { set_character_faith = scope:dynamic_faith }

			hidden_effect = {
				set_character_faith_with_conversion = scope:dynamic_faith
			}
			scope:dynamic_faith = {
				change_fervor = {
					value = 10
					desc = fervor_gain_russian_fervor
				}
			}
			trigger_event = {
				id = rus_conversion_decision.010
				days = { 30 60 }
			}
		}
		#Influx of Religious Settlers Modifier
		capital_county = {
			add_county_modifier = {
				modifier = religious_settler_influx
				years = 20
				}
			}
		#Notify rulers in the region and give them a chance to follow.
		every_independent_ruler = {
			limit = {
				culture = { has_cultural_pillar = heritage_east_slavic }
				OR = {
					capital_province = { geographical_region = custom_brus_kievian_rus }
					primary_title.empire = title:e_russia
				}
			}
			trigger_event = {
				id = rus_conversion_decision.07
				days = { 15 360 }
			}
		}
	}
	
	cost = {
		piety = {
			value = 250
		}
	}

	ai_will_do = {
		base = 5	
		modifier = {
			add = -15
			has_trait = zealous
		}
		modifier = {
			add = -5
			has_trait = craven
		}
		modifier = {
			add = -5
			has_trait = stubborn
		}
		modifier = {
			add = 10
			has_focus = learning_theology_focus
		}
		modifier = {
			add = 10
			has_trait = ambitious
		}
		modifier = {
			add = 10
			realm_size >= 40
		}
	}

}

# Temporarily removed
# unite_russia_decision = {
# 	ai_check_interval = 120
# 	desc = unite_russia_decision_desc
# 	selection_tooltip = unite_russia_decision_tooltip
# 	#ai_goal = yes
# 	picture = {
# 		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
# 	}
# 	decision_group_type = major 


# 	is_shown = {
# 			culture = { has_cultural_pillar = heritage_east_slavic }
# 			highest_held_title_tier >= tier_kingdom

# 		NOT = {
# 			is_target_in_global_variable_list = {
# 				name = unavailable_unique_decisions
# 				target = flag:unite_russia_decision
# 			}
# 		}
# 	}

# 	is_valid = {
# 		completely_controls_region = custom_br_russia
# 		prestige_level >= high_prestige_level
# 	}

# 	effect = {
# 		save_scope_as = russia_uniter

# 		show_as_tooltip = { unite_russia_decision_effects = yes } 

# 		#Events
# 		trigger_event = brus_unite_russia.1

# 		#Can only happen once
# 		add_to_global_variable_list = {
# 			name = unavailable_unique_decisions
# 			target = flag:unite_russia_decision
# 		}
# 	}
# 	cost = { 
# 		prestige = { value = 1000 }
# 		gold = { value = 150 } 
	
# 	}
# 	ai_potential = {
# 		always = yes
# 	}

# }

# Rus Invasion decision for the player
rus_control_player = {
	#picture = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds"
	#major = yes

	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds"
	}
	decision_group_type = major 
	
	desc = rus_control_player_desc
	selection_tooltip = rus_control_player_tooltip
	ai_check_interval = 0

	is_shown = {
		is_landed = yes
		is_ai = no
		
		is_independent_ruler = yes
		current_date <= 1066.1.1

		#Must either be East Slavic or Norseman in Rus region
		OR = {
			AND = { 
				culture = { has_cultural_pillar = heritage_east_slavic }
				primary_title.empire = title:e_russia
			}
			AND = { 
				culture = { has_cultural_pillar = heritage_north_germanic }
				primary_title.empire = title:e_russia
			}
		}
		#You can only do it once.
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_launched_rus_invasion
			}
		}
	}	
	is_valid = {
		highest_held_title_tier >= tier_kingdom
		prestige_level >= 2

		#Must already control a big enough chunk of the region
		custom_tooltip = {
			text = brus_tencounty
			any_county_in_region = {
				region = ghw_region_russia
				count >= 10
				OR = {
					holder = root
					holder = {
						root = top_liege
					}
				}
			}	
		}
	}
	is_valid_showing_failures_only = {
		is_available_adult = yes
		is_at_war = no
	}

	effect = {
		#Make sure AI doesn't do it now.
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_launched_rus_invasion
			}
		}
		custom_tooltip = {
			text = brus_invasion_cbtt
			add_character_flag = undertaking_rus_invasion
		}

		add_prestige = 300
		trigger_event = rus_invasion.10
		#Spawn some event troops, but not if they're Rurik/Dyre who start with a lot of event troops already.
		if = {
			limit = {
				NOR = {
					root = character:40605
					root = character:6811
				}
			}
			spawn_army = {
			name = event_troop_default_name
			men_at_arms = {
				type = druzhina
				stacks = 10
			}
			location = root.capital_province
			uses_supply = yes
			inheritable = no
			}	
		}
	}

	cost = {
		#Charge a reasonable lump of prestige.
		prestige = 500
		gold = 100
	}

}
# Rus invasion dynamic for the AI
launch_rus_invasion = {

	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds"
	}
	decision_group_type = major 

	desc = launch_rus_invasion_desc
	selection_tooltip = launch_rus_invasion_tooltip

	ai_potential = { always = yes }
	ai_check_interval = 4
	ai_will_do = {
		base = 100
	}

	is_shown = {
		is_ai = yes
		is_independent_ruler = yes
		current_date <= 1066.1.1
		#As long as the other rules aren't set, we'll assume it's dynamic. This allows it to be compatible with old savegames.
		NOR = {
			has_game_rule = rus_launch_off
			has_game_rule = rus_launch_immediate
		}
		#Cannot be a settled people.
		government_has_flag = government_is_tribal

		#Must either be East Slavic or Norseman in Rus region
		OR = {
			AND = { 
				culture = { has_cultural_pillar = heritage_east_slavic }
				primary_title.empire = title:e_russia
			}
			AND = { 
				culture = { has_cultural_pillar = heritage_north_germanic }
				primary_title.empire = title:e_russia
			}
		}
		#You can only do it once.
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_launched_rus_invasion
			}
		}
	}

	is_valid = {
		#Has to be a kingdom so that the subjugation demands work
		highest_held_title_tier >= tier_kingdom
		#Must already control a big enough chunk of the region
		prestige_level >= 2
		any_county_in_region = {
				region = ghw_region_russia
				count >= 10
				OR = {
					holder = root
					holder = {
						root = top_liege
					}
				}
			}	
	}
	is_valid_showing_failures_only = {
		is_available_adult = yes
	}

	effect = {
		custom_tooltip = launch_rus_invasion_flavor_effect
		#Health boost to reduce chances of an anti-climactic end
		add_character_modifier = { modifier = aging_gracefully_modifier }
		add_trait = conqueror
		add_character_modifier = { 
			modifier = brus_rallied_vassals 
			years = 20
		}
		#The subjugation demand and war events
		start_wars_for_rus_effect = yes
		add_character_flag = undertaking_rus_invasion
		#Give them the invasion troops
		spawn_army = {
			name = event_troop_default_name
			men_at_arms = {
				type = druzhina
				stacks = 30
			}
			men_at_arms = {
				type = light_footmen
				stacks = 30
			}	
			location = root.capital_province
			uses_supply = no
			inheritable = yes
		}
		# Extra troops if the event happens later in the game
		if = {
			limit = { current_date >= 900.1.1 }
			spawn_army = {
				name = event_troop_default_name
				levies = 1500
				location = root.capital_province
				uses_supply = no
				inheritable = yes
			}
		}
		if = {
			limit = { current_date >= 950.1.1 }
			spawn_army = {
				name = event_troop_default_name
				levies = 2000
				location = root.capital_province
				uses_supply = no
				inheritable = yes
			}
		}
		# Make sure it doesn't happen again
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_launched_rus_invasion
			}
		}
		#Notify players in the vicinity
		every_player = {
			limit = {
				capital_province = {
					OR = {
						geographical_region = world_europe_east
						geographical_region = world_europe_north
						geographical_region = world_steppe_west
						geographical_region = world_steppe_east
					}
				}
				NOT = { this = scope:rus_conqueror }
			}
			trigger_event = { 
				id = rus_invasion.8
				days = { 3 30 } 
			}
		}
	}

	cost = {
		# Scale costs with how much territory they have in the region already
		prestige = {
			value = 800 # This will be 500 by default because it requires 10 provinces
				every_county_in_region = {
					region = ghw_region_russia
					limit = {
						OR = {
							holder = root
							holder = {
								root = top_liege
							}
						}
					}
					subtract = {
						value = 30
					}
				}
		}
		gold = 75
	}
}

alternative_capital_of_the_rus_decision = {
	# picture = "gfx/interface/illustrations/decisions/fp1_decision_raise_runestone.dds"
	# major = yes

	picture = {
		reference = "gfx/interface/illustrations/decisions/fp1_decision_raise_runestone.dds"
	}
	decision_group_type = major 

	ai_check_interval = 120

	desc = found_capital_of_the_rus_decision_desc
	selection_tooltip = found_capital_of_the_rus_decision_tooltip

	is_shown = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Standard filter checks.
		is_landed = yes
		exists = dynasty

		#Must not have the vanilla version available
		NOR = {
			culture = { has_cultural_pillar = heritage_north_germanic }
			has_culture = culture:norman
			has_character_modifier = embraced_local_traditions_modifier
			AND = {
				exists = dynasty
				dynasty = {
					has_dynasty_modifier = settled_norse_dynasty_modifier
				}
			}
		}
		#Must be in the current de jure title:e_russia: since this decision involves title:e_russia very intimately, we don't want a custom region.
		any_held_title = {
			tier = tier_county
			empire = title:e_russia
		}

		#Aaaaaaand it's already happened in 1066, albeit with less gameplay benefits.
		NOT = { game_start_date >= 1066.09.15 }
		#Year is before 1100, just to keep this from getting weird if no one manages it early.
		current_date < 1100.1.1
		#Not repeatable.
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_founded_capital_of_rus
			}
		}
	}

	is_valid = {
		#Must be independent.
		is_independent_ruler = yes
		#Has to be around to organise the construction.
		is_imprisoned = no
		#Must have a capital within title:e_russia, as we'll use this as a fallback.
		capital_county.empire = title:e_russia
		#Should have a decent prestige level.
		OR = {
			prestige_level >= very_high_prestige_level
			AND = {
				prestige_level >= high_prestige_level
				completely_controls = title:c_kiev
			}
		}
		#Repeat the time limit concern just so that the player knows it's a thing.
		custom_description = {
			text = found_capital_of_the_rus_decision_before_last_date
			current_date <= 1100.1.1
		}
	}

	is_valid_showing_failures_only = {
		is_available_at_peace_adult = yes
	}

	effect = {
		save_scope_as = founder
		#Nab scope:founder's capital for the initial tooltip; this may be changed in the actual event.
		scope:founder.capital_county = { save_scope_as = new_rus_capital }
		show_as_tooltip = { found_capital_of_rus_scripted_effect = yes }
		trigger_event = { id = rus_invasion.7 }
		#Notifying other players is done in scope:founder's event, as scope:founder may change the circumstances of the decision with their option choice.
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_founded_capital_of_rus
			}
		}
	}

	cost = {
		gold = 100
		prestige = 500
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 10

		# Weight up for traits.
		modifier = {
			add = 25
			has_trait = ambitious
		}
		modifier = {
			add = 25
			has_trait = arrogant
		}
		modifier = {
			add = 25
			has_trait = architect
		}
		modifier = {
			add = 25
			has_trait = administrator
		}

		# Weight up for game year.
		modifier = {
			add = 25
			current_year >= 920
		}
		modifier = {
			add = 25
			current_year >= 980
		}
	}
}

end_rota_decision = {
	ai_check_interval = 60
	desc = end_rota_decision_desc
	selection_tooltip = end_rota_decision_tooltip

	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}
	decision_group_type = major 



	is_shown = {
		game_start_date >= 1066.1.1
		culture = { has_cultural_pillar = heritage_east_slavic }

		OR = {
			capital_province = { geographical_region = custom_brus_kievian_rus }
			primary_title.empire = title:e_russia
		}
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:end_rota_decision
			}
		}
	}

	is_valid = {
		completely_controls_region = custom_brus_kievian_rus
		highest_held_title_tier >= tier_kingdom
	}

	effect = {
		#Events
		trigger_event = brus_unite_russia.2

		show_as_tooltip = { end_rota_effect = yes } 

		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:end_rota_decision
		}
	}
	cost = { 
		prestige = { value = 500 }
	}
	ai_potential = {
		is_independent_ruler = yes
	}
	ai_will_do = {
		base = 100
	}

}

adopt_rus_ways_decision = {
	ai_check_interval = 36
	desc = adopt_rus_ways_desc
	selection_tooltip = adopt_rus_ways_decision_tooltip

	picture = {
		reference = "gfx/interface/illustrations/decisions/fp3/harmonious.dds"
	}

	is_shown = {
		culture = { 
			has_cultural_pillar = heritage_east_slavic 
			NOT = { this = culture:russian }
		}

		OR = {
			capital_province = { geographical_region = custom_brus_kievian_rus }
			primary_title.empire = title:e_russia
		}
		any_county_in_region = {
			count >= 5
			region = custom_brus_kievian_rus
			culture = culture:russian
		}
	}

	is_valid = {
		OR = {
			is_independent_ruler = yes
			custom_tooltip = {
				text = brus_rus_liege_tt
				top_liege = { has_culture = culture:russian }
			}
		}
		custom_tooltip = {
			text = brus_adopt_rus_req
			OR = {
				any_neighboring_county = {
					culture = culture:russian
				}
				any_neighboring_top_liege_realm_owner = {
					has_culture = culture:russian
				}
				any_sub_realm_county = {
					culture = culture:russian
				}
			}
		}
	}

	effect = {
		root.capital_county = {
			set_county_culture = culture:russian
		}
		convert_family_culture_and_notify_vassals_effect = {
			CONVERTER = root
			OLD_CULTURE = root.culture
			NEW_CULTURE = culture:russian
		}
	}

	cost = { 
		prestige = medium_prestige_value
	}
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 10
		modifier = {
			add = 5
			has_trait = gregarious
		}
		modifier = {
			add = 15
			any_sub_realm_county = { culture = culture:russian }
		}
		modifier = {
			add = 25
			top_liege = { has_culture = culture:russian }
		}
		modifier = {
			add = 10
			any_ally = { has_culture = culture:russian }
		}
		modifier = {
			add = -10
			has_trait = stubborn
		}
	}
}


adopt_lestvitsa_ai_decision = {
	ai_check_interval = 24
	desc = adopt_lestvitsa_ai_decision_desc
	selection_tooltip = adopt_lestvitsa_ai_decision_tooltip

	picture = {
		reference = "gfx/interface/illustrations/decisions/fp3/harmonious.dds"
	}

	is_shown = {
		is_ai = yes
		culture = { 
			has_cultural_tradition = tradition_brus_rurikid 
		}

		OR = {
			capital_province = { geographical_region = custom_brus_kievian_rus }
			primary_title.empire = title:e_russia
		}

		primary_title = {
			tier >= tier_kingdom
		}

	}

	is_valid = {
		# Any dynasty member duke or above is already using it
		any_dynasty_member = {
			this.primary_title = {
				tier >= tier_duchy
				has_title_law = brus_lestvitsa_succession_law
			}
		}
		# Current kingdom title doesn't have it
		primary_title = {
			tier >= tier_kingdom
			NOT = { has_title_law = brus_lestvitsa_succession_law }
		}
	}

	effect = {
		every_held_title = {
			limit = {
				tier = prev.primary_title.tier
				tier = tier_kingdom
				NOT = { has_title_law = brus_lestvitsa_succession_law }
			}
			add_title_law = brus_lestvitsa_succession_law
		}
	}

	cost = { 
		
	}
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}