#######################
# written by Aetherum #
#######################

country_decisions = {
	
	moscovian_nation = {
		major = yes
		potential = {
		    NOT = { is_year = 1825 }
			NOT = { exists = MOS }
			NOT = { tag = RUS }
			NOT = { tag = POL }
			NOT = { tag = PAP }
			NOT = { tag = HLR }
			NOT = { tag = PLC }
			primary_culture = russian
		}
		provinces_to_highlight = {
				province_id = 295			
		}
		allow = {
			is_free_or_tributary_trigger = yes
			is_nomad = no
			is_at_war = no
			owns = 295
		}
		effect = {
			change_tag = MOS
			swap_non_generic_missions = yes
			add_country_modifier = {
				name = "centralization_modifier"
				duration = 7300
			}
			295 = {
				move_capital_effect = yes
			}
			add_prestige = 25
			if = {
				limit = { has_custom_ideas = no }
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	kingdom_jerusalem = {
		major = yes
		potential = {
			NOT = { exists = KOJ }
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			religion = catholic
			NOT = { government = republic }
			OR = {
				owns = 379
				AND = {
					ai = no
					tag = KNI
				}
				AND = {
					ai = no
					tag = CYP
				}
				AND = {
					ai = no
					tag = PRO
				}
			}
		}
		provinces_to_highlight = {
		    OR = {
			province_id = 379 #Jerusalem
			province_id = 2151
			province_id = 4466
			province_id = 1854
			}
			NOT = { owned_by = ROOT }
		}
		allow = {
			is_at_war = no
			owns_core_province = 379 #Jerusalem
			owns_core_province = 2151
			owns_core_province = 4466
			owns_core_province = 1854
		}
		effect = {
			add_prestige = 25
			every_province = {
				limit = {
					OR = {
						province_id = 2151
						province_id = 4466 
						province_id = 1854
					}
				}
				add_core = KOJ
			}
			if = {
				limit = {
					NOT = { tag = KNI }
					NOT = { tag = CYP }
					NOT = { tag = PRO }
				}
				release = KOJ
				KOJ = { change_primary_culture = ROOT }
				KOJ = { change_religion = ROOT }
				KOJ = {
				add_trust = {
				who = ROOT
                value = 100
                mutual = yes
				}
			    add_opinion = {
				who = ROOT
				modifier = new_friend
			    }
		        }
		        add_opinion = {
				who = KOJ
				modifier = new_friend
			    }
				add_trust = {
				who = KOJ
                value = 100
                mutual = yes
				}
			}
			if = {
				limit = {
					OR = {
						tag = KNI
						tag = CYP
						tag = PRO
					}
				}
				change_tag = KOJ
				if = {
					limit = { has_custom_ideas = no }
					country_event = { id = ideagroups.1 } #Swap Ideas
				}
			}
			KOJ = {
				set_capital = 2151
				if = {
					limit = {
						NOT = { government = monarchy }
					}
					change_government = monarchy
					add_government_reform = feudalism_reform
				}
				if = {
					limit = {
						NOT = { government_rank = 2 }
					}
					set_government_rank = 2
				}
				set_country_flag = formed_jerusalem
			}
		}
		ai_will_do = {
			factor = 0
		}
	}
	
}