establish_native_reserve = {
	category = influence

	alert_index = 6
	alert_tooltip = establish_native_reserve_alert_tooltip

	require_acceptance = yes

	is_visible = {
		can_create_subject_type = {
			subject = FROM
			subject_type = native_reserve
		}
	}

	is_allowed = {
		can_create_subject_type = {
			subject = FROM
			subject_type = native_reserve
		}
		is_at_war = no
		FROM = {
			is_at_war = no
		}
	}

	on_accept = {
		if = {
			limit = {
				can_create_subject_type = {
					subject = FROM
					subject_type = native_reserve
				}
				is_at_war = no
				FROM = {
					is_at_war = no
				}
			}
			create_subject = {
				subject = FROM
				subject_type = native_reserve
				keep_liberty_desire = yes
			}
		}
	}

	on_decline = {
		if = {
			limit = {
				can_create_subject_type = {
					subject = FROM
					subject_type = native_reserve
				}
				is_at_war = no
				FROM = {
					is_at_war = no
				}
			}
			FROM = {
				clr_country_flag = declined_establish_native_reserve_@ROOT
				set_country_flag = declined_establish_native_reserve_@ROOT
			}
			add_opinion = {
				who = FROM
				modifier = declined_establish_native_reserve_opinion
			}
		}
	}

	ai_acceptance = {
		add_entry = {
			name = FROM_ATTITUDE_TOWARDS_ROOT
			limit = {
				NOT = { overlord_of = FROM }
				FROM = {
					OR = {
						ai_attitude = { who = ROOT attitude = attitude_allied }
						ai_attitude = { who = ROOT attitude = attitude_friendly }
						ai_attitude = { who = ROOT attitude = attitude_threatened }
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
		}
		add_entry = {
			name = FROM_ATTITUDE_TOWARDS_ROOT
			limit = {
				NOT = { overlord_of = FROM }
				FROM = {
					ai_attitude = { who = ROOT attitude = attitude_neutral }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 20
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = FROM_ATTITUDE_TOWARDS_ROOT
			limit = {
				NOT = { overlord_of = FROM }
				FROM = {
					OR = {
						ai_attitude = { who = ROOT attitude = attitude_hostile }
						ai_attitude = { who = ROOT attitude = attitude_outraged }
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = FROM_HAS_MARRIAGE_WITH_ROOT
			limit = {
				marriage_with = FROM
			}
			export_to_variable = {
				which = ai_value
				value = 5
			}
		}
		add_entry = {
			name = TRUST
			limit = {
				FROM = {
					trust = {
						who = ROOT
						value = 50
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = trust
				who = FROM
				with = ROOT
			}
			subtract_variable = { which = ai_value value = 50 }
			divide_variable = { which = ai_value value = 5 }
		}
		add_entry = {
			name = TRUST
			limit = {
				FROM = {
					trust = {
						who = ROOT
						value = 30
					}
					NOT = {
						trust = {
							who = ROOT
							value = 50
						}
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = trust
				who = FROM
				with = ROOT
			}
			subtract_variable = { which = ai_value value = 50 }
			multiply_variable = { which = ai_value value = 2 }
		}
		add_entry = {
			name = TRUST
			limit = {
				FROM = {
					NOT = {
						trust = {
							who = ROOT
							value = 30
						}
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = 2000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = MODIFIER_DIPLO_SKILL
			export_to_variable = {
				which = ai_value
				value = modifier:diplomatic_reputation
			}
			multiply_variable = { which = ai_value value = 3 }
		}
		add_entry = {
			name = FROM_IS_MERCHANT_REPUBLIC
			limit = {
				FROM = {
					has_reform = merchants_reform
				}
			}
			export_to_variable = {
				which = ai_value
				value = 30
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = ROOT_IS_MERCHANT_REPUBLIC
			limit = {
				NOT = { overlord_of = FROM }
				has_reform = merchants_reform
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = ROOT_FROM_MILITARY_POWER_COMPARED
			limit = {
				variable_arithmetic_trigger = {
					export_to_variable = {
						which = our_mil_tech
						value = trigger_value:mil_tech
					}
					export_to_variable = {
						which = their_mil_tech
						value = trigger_value:mil_tech
						who = FROM
					}
					export_to_variable = {
						which = our_army_size
						value = trigger_value:army_size
					}
					export_to_variable = {
						which = their_army_size
						value = trigger_value:army_size
						who = FROM
					}
					export_to_variable = {
						which = military_power
						value = 0
					}
					divide_variable = { which = our_army_size value = 10 }
					divide_variable = { which = their_army_size value = -10 }
					change_variable = { which = our_army_size which = their_army_size }
					multiply_variable = { which = their_mil_tech value = -1 }
					change_variable = { which = our_mil_tech which = their_mil_tech }
					multiply_variable = { which = our_mil_tech value = 3 }
					change_variable = { which = military_power which = our_army_size }
					change_variable = { which = military_power which = our_mil_tech }

					NOT = { check_variable = { which = military_power value = -39 } }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 40
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = ROOT_FROM_MILITARY_POWER_COMPARED
			limit = {
				variable_arithmetic_trigger = {
					export_to_variable = {
						which = our_mil_tech
						value = trigger_value:mil_tech
					}
					export_to_variable = {
						which = their_mil_tech
						value = trigger_value:mil_tech
						who = FROM
					}
					export_to_variable = {
						which = our_army_size
						value = trigger_value:army_size
					}
					export_to_variable = {
						which = their_army_size
						value = trigger_value:army_size
						who = FROM
					}
					export_to_variable = {
						which = military_power
						value = 0
					}
					divide_variable = { which = our_army_size value = 10 }
					divide_variable = { which = their_army_size value = -10 }
					change_variable = { which = our_army_size which = their_army_size }
					multiply_variable = { which = their_mil_tech value = -1 }
					change_variable = { which = our_mil_tech which = their_mil_tech }
					multiply_variable = { which = our_mil_tech value = 3 }
					change_variable = { which = military_power which = our_army_size }
					change_variable = { which = military_power which = our_mil_tech }

					check_variable = { which = military_power value = -39 }
					NOT = { check_variable = { which = military_power value = 30 } }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 0
			}
			export_to_variable = {
				which = our_mil_tech
				value = trigger_value:mil_tech
			}
			export_to_variable = {
				which = their_mil_tech
				value = trigger_value:mil_tech
				who = FROM
			}
			export_to_variable = {
				which = our_army_size
				value = trigger_value:army_size
			}
			export_to_variable = {
				which = their_army_size
				value = trigger_value:army_size
				who = FROM
			}
			divide_variable = { which = our_army_size value = 10 }
			divide_variable = { which = their_army_size value = -10 }
			change_variable = { which = our_army_size which = their_army_size }
			multiply_variable = { which = their_mil_tech value = -1 }
			change_variable = { which = our_mil_tech which = their_mil_tech }
			multiply_variable = { which = our_mil_tech value = 3 }
			change_variable = { which = ai_value which = our_army_size }
			change_variable = { which = ai_value which = our_mil_tech }
		}
		add_entry = {
			name = ROOT_FROM_MILITARY_POWER_COMPARED
			limit = {
				variable_arithmetic_trigger = {
					export_to_variable = {
						which = our_mil_tech
						value = trigger_value:mil_tech
					}
					export_to_variable = {
						which = their_mil_tech
						value = trigger_value:mil_tech
						who = FROM
					}
					export_to_variable = {
						which = our_army_size
						value = trigger_value:army_size
					}
					export_to_variable = {
						which = their_army_size
						value = trigger_value:army_size
						who = FROM
					}
					export_to_variable = {
						which = military_power
						value = 0
					}
					divide_variable = { which = our_army_size value = 10 }
					divide_variable = { which = their_army_size value = -10 }
					change_variable = { which = our_army_size which = their_army_size }
					multiply_variable = { which = their_mil_tech value = -1 }
					change_variable = { which = our_mil_tech which = their_mil_tech }
					multiply_variable = { which = our_mil_tech value = 3 }
					change_variable = { which = military_power which = our_army_size }
					change_variable = { which = military_power which = our_mil_tech }
					check_variable = { which = military_power value = 30 }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 30
			}
		}
		add_entry = {
			name = FROM_HAS_SUBJECTS
			limit = {
				FROM = {
					num_of_subjects = 1
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = ROOT_OWNS_FROM_CORE_PROVINCES
			limit = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					is_core = FROM
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = FROM_DEVELOPMENT
			export_to_variable = {
				which = ai_value
				value = trigger_value:total_development
				who = FROM
			}
			#subtract_variable = { which = ai_value value = 1 }
			divide_variable = { which = ai_value value = -2 }
		}
		add_entry = {
			name = ROOT_FROM_ARE_ALLIED
			limit = {
				alliance_with = FROM
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
		}
		add_entry = {
			name = FROM_ROOT_ARE_RIVALS
			limit = {
				OR = {
					is_rival = FROM
					is_enemy = FROM
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			divide_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = ROOT_FROM_ARE_HISTORICAL_FRIENDS
			limit = {
				FROM = {
					historical_friend_with = ROOT
				}
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
		}
		add_entry = {
			name = FROM_AI_PERSONALITY
			limit = {
				FROM = {
					personality = ai_militarist
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = FROM_IS_EMPIRE_RANK
			limit = {
				FROM = {
					government_rank = 3
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = FROM_IS_KINGDOM_RANK
			limit = {
				FROM = {
					government_rank = 2
					NOT = { government_rank = 3 }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 100
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = OPINION
			export_to_variable = {
				which = ai_value
				value = opinion
				who = FROM
				with = ROOT
			}
			divide_variable = { which = ai_value value = 4 }
		}
	}

	ai_will_do = {
		OR = {
			tag = CAN
			tag = USA
			tag = FRA
			is_former_colonial_nation = yes
		}
		NOT = { calc_true_if = { all_subject_country = { is_subject_of_type = native_reserve } amount = 5 } }
		FROM = {
			NOT = { total_development = 200 }
			capital_scope = {
				continent = north_america
			}
			OR = {
				NOT = { has_country_flag = declined_establish_native_reserve_@ROOT }
				had_country_flag = { flag = declined_establish_native_reserve_@ROOT days = 1825 }
			}
			NOT = {
				any_owned_province = {
					OR = {
						is_core = ROOT
						is_permanent_claim = ROOT
					}
				}
			}
		}
	}
}

ask_to_become_native_reserve = {
	category = influence

	alert_index = 6
	alert_tooltip = ask_to_become_native_reserve_alert_tooltip

	require_acceptance = yes

	is_visible = {
		FROM = {
			can_create_subject_type = {
				subject = ROOT
				subject_type = native_reserve
			}
		}
	}

	is_allowed = {
		FROM = {
			can_create_subject_type = {
				subject = ROOT
				subject_type = native_reserve
			}
		}
		is_at_war = no
		FROM = {
			is_at_war = no
		}
	}

	on_accept = {
		if = {
			limit = {
				FROM = {
					can_create_subject_type = {
						subject = ROOT
						subject_type = native_reserve
					}
				}
				is_at_war = no
				FROM = {
					is_at_war = no
				}
			}
			FROM = {
				create_subject = {
					subject = ROOT
					subject_type = native_reserve
					keep_liberty_desire = yes
				}
			}
		}
	}

	on_decline = {
		if = {
			limit = {
				FROM = {
					can_create_subject_type = {
						subject = ROOT
						subject_type = native_reserve
					}
				}
				is_at_war = no
				FROM = {
					is_at_war = no
				}
			}
			clr_country_flag = declined_establish_native_reserve_@FROM
			set_country_flag = declined_establish_native_reserve_@FROM
			add_opinion = {
				who = FROM
				modifier = declined_ask_for_native_reserve_opinion
			}
		}
	}

	ai_acceptance = {
		add_entry = {
			name = FROM_ATTITUDE_TOWARDS_ROOT
			limit = {
				FROM = {
					OR = {
						ai_attitude = { who = ROOT attitude = attitude_allied }
						ai_attitude = { who = ROOT attitude = attitude_friendly }
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
		}
		add_entry = {
			name = FROM_ATTITUDE_TOWARDS_ROOT
			limit = {
				FROM = {
					ai_attitude = { who = ROOT attitude = attitude_protective }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 20
			}
		}
		add_entry = {
			name = FROM_ATTITUDE_TOWARDS_ROOT
			limit = {
				FROM = {
					ai_attitude = { who = ROOT attitude = attitude_neutral }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = FROM_ATTITUDE_TOWARDS_ROOT
			limit = {
				FROM = {
					OR = {
						ai_attitude = { who = ROOT attitude = attitude_hostile }
						ai_attitude = { who = ROOT attitude = attitude_rivalry }
						ai_attitude = { who = ROOT attitude = attitude_outraged }
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = MODIFIER_DIPLO_SKILL
			export_to_variable = {
				which = ai_value
				value = modifier:diplomatic_reputation
			}
			multiply_variable = { which = ai_value value = 5 }
		}
		add_entry = {
			name = ROOT_FROM_MILITARY_POWER_COMPARED
			limit = {
				variable_arithmetic_trigger = {
					export_to_variable = {
						which = our_mil_tech
						value = trigger_value:mil_tech
						who = FROM
					}
					export_to_variable = {
						which = their_mil_tech
						value = trigger_value:mil_tech
					}
					export_to_variable = {
						which = our_army_size
						value = trigger_value:army_size
						who = FROM
					}
					export_to_variable = {
						which = their_army_size
						value = trigger_value:army_size
					}
					export_to_variable = {
						which = military_power
						value = 0
					}
					divide_variable = { which = our_army_size value = 10 }
					divide_variable = { which = their_army_size value = -10 }
					change_variable = { which = our_army_size which = their_army_size }
					multiply_variable = { which = their_mil_tech value = -1 }
					change_variable = { which = our_mil_tech which = their_mil_tech }
					multiply_variable = { which = our_mil_tech value = 3 }
					change_variable = { which = military_power which = our_army_size }
					change_variable = { which = military_power which = our_mil_tech }

					NOT = { check_variable = { which = military_power value = -39 } }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 40
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = ROOT_FROM_MILITARY_POWER_COMPARED
			limit = {
				variable_arithmetic_trigger = {
					export_to_variable = {
						which = our_mil_tech
						value = trigger_value:mil_tech
						who = FROM
					}
					export_to_variable = {
						which = their_mil_tech
						value = trigger_value:mil_tech
					}
					export_to_variable = {
						which = our_army_size
						value = trigger_value:army_size
						who = FROM
					}
					export_to_variable = {
						which = their_army_size
						value = trigger_value:army_size
					}
					export_to_variable = {
						which = military_power
						value = 0
					}
					divide_variable = { which = our_army_size value = 10 }
					divide_variable = { which = their_army_size value = -10 }
					change_variable = { which = our_army_size which = their_army_size }
					multiply_variable = { which = their_mil_tech value = -1 }
					change_variable = { which = our_mil_tech which = their_mil_tech }
					multiply_variable = { which = our_mil_tech value = 3 }
					change_variable = { which = military_power which = our_army_size }
					change_variable = { which = military_power which = our_mil_tech }

					check_variable = { which = military_power value = -39 }
					NOT = { check_variable = { which = military_power value = 30 } }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 0
			}
			export_to_variable = {
				which = our_mil_tech
				value = trigger_value:mil_tech
				who = FROM
			}
			export_to_variable = {
				which = their_mil_tech
				value = trigger_value:mil_tech
			}
			export_to_variable = {
				which = our_army_size
				value = trigger_value:army_size
				who = FROM
			}
			export_to_variable = {
				which = their_army_size
				value = trigger_value:army_size
			}
			divide_variable = { which = our_army_size value = 10 }
			divide_variable = { which = their_army_size value = -10 }
			change_variable = { which = our_army_size which = their_army_size }
			multiply_variable = { which = their_mil_tech value = -1 }
			change_variable = { which = our_mil_tech which = their_mil_tech }
			multiply_variable = { which = our_mil_tech value = 3 }
			change_variable = { which = ai_value which = our_army_size }
			change_variable = { which = ai_value which = our_mil_tech }
		}
		add_entry = {
			name = ROOT_FROM_MILITARY_POWER_COMPARED
			limit = {
				variable_arithmetic_trigger = {
					export_to_variable = {
						which = our_mil_tech
						value = trigger_value:mil_tech
						who = FROM
					}
					export_to_variable = {
						which = their_mil_tech
						value = trigger_value:mil_tech
					}
					export_to_variable = {
						which = our_army_size
						value = trigger_value:army_size
						who = FROM
					}
					export_to_variable = {
						which = their_army_size
						value = trigger_value:army_size
					}
					export_to_variable = {
						which = military_power
						value = 0
					}
					divide_variable = { which = our_army_size value = 10 }
					divide_variable = { which = their_army_size value = -10 }
					change_variable = { which = our_army_size which = their_army_size }
					multiply_variable = { which = their_mil_tech value = -1 }
					change_variable = { which = our_mil_tech which = their_mil_tech }
					multiply_variable = { which = our_mil_tech value = 3 }
					change_variable = { which = military_power which = our_army_size }
					change_variable = { which = military_power which = our_mil_tech }
					check_variable = { which = military_power value = 30 }
				}
			}
			export_to_variable = {
				which = ai_value
				value = 30
			}
		}
		add_entry = {
			name = ROOT_DEVELOPMENT
			export_to_variable = {
				which = ai_value
				value = trigger_value:total_development
				who = FROM
			}
			#subtract_variable = { which = ai_value value = 1 }
			divide_variable = { which = ai_value value = -3 }
		}
		add_entry = {
			name = ROOT_OWNS_FROM_CORE_PROVINCES
			limit = {
				any_owned_province = {
					is_core = FROM
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = ROOT_FROM_ARE_ALLIED
			limit = {
				alliance_with = FROM
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
		}
		add_entry = {
			name = FROM_ROOT_ARE_RIVALS
			limit = {
				OR = {
					is_rival = FROM
					is_enemy = FROM
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			divide_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = FROM_HAS_MARRIAGE_WITH_ROOT
			limit = {
				marriage_with = FROM
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
		}
		add_entry = {
			name = OPINION
			export_to_variable = {
				which = ai_value
				value = opinion
				who = FROM
				with = ROOT
			}
			divide_variable = { which = ai_value value = 4 }
		}
		add_entry = {
			name = ROOT_FROM_ARE_HISTORICAL_FRIENDS
			limit = {
				FROM = {
					historical_friend_with = ROOT
				}
			}
			export_to_variable = {
				which = ai_value
				value = 10
			}
		}
		add_entry = {
			name = FROM_AI_PERSONALITY
			limit = {
				FROM = {
					personality = ai_militarist
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = ROOT_TOO_HIGH_DEVELOPMENT
			limit = {
				total_development = 200
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = STATEGIC_VALUE
			limit = {
				ai = yes
				FROM = { ai = yes }
				OR = {
					FROM = {
						OR = {
							AND = {
								NOT = { tag = CAN }
								NOT = { tag = USA }
								NOT = { tag = FRA }
								is_former_colonial_nation = no
							}
							calc_true_if = { all_subject_country = { is_subject_of_type = native_reserve } amount = 5 }
						}
					}
					capital_scope = {
						NOT = { continent = north_america }
					}
					any_owned_province = {
						OR = {
							is_core = FROM
							is_permanent_claim = FROM
						}
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
		add_entry = {
			name = STATEGIC_VALUE
			limit = {
				ai = no
				FROM = { ai = yes }
				any_owned_province = {
					OR = {
						is_core = FROM
						is_permanent_claim = FROM
					}
				}
			}
			export_to_variable = {
				which = ai_value
				value = 1000
			}
			multiply_variable = { which = ai_value value = -1 }
		}
	}

	ai_will_do = {
		NOT = { personality = ai_militarist }
		NOT = { government_rank = 2 }
		OR = {
			NOT = { has_country_flag = declined_establish_native_reserve_@FROM }
			had_country_flag = { flag = declined_establish_native_reserve_@FROM days = 1825 }
		}
		NOT = { total_development = 150 }
		OR = {
			ai_attitude = { who = FROM attitude = attitude_allied }
			ai_attitude = { who = FROM attitude = attitude_friendly }
			ai_attitude = { who = FROM attitude = attitude_threatened }
		}
		has_opinion = {
			who = FROM
			value = 100
		}
		FROM = {
			NOT = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 1
					is_core = ROOT
				}
			}
		}
	}
}

cancel_native_reserve = {
	category = influence

	require_acceptance = no

	is_visible = {
		FROM = {
			is_subject_of = ROOT
			is_subject_of_type = native_reserve
		}
	}

	is_allowed = {
		hidden_trigger = {
			FROM = {
				is_subject_of = ROOT
				is_subject_of_type = native_reserve
			}
		}
		NOT = { truce_with = FROM }
		prestige = 0
	}

	on_accept = {
		if = {
			limit = {
				FROM = {
					is_subject_of = ROOT
					is_subject_of_type = native_reserve
				}
				NOT = { truce_with = FROM }
				prestige = 0
			}
			FROM = {
				if = {
					limit = {
						NOT = { liberty_desire = 50 }
					}
					add_opinion = {
						who = ROOT
						modifier = vassal_abandoned
					}
				}
				grant_independence = yes
				add_truce_with = ROOT
			}
			add_truce_with = FROM
			add_prestige = -25
		}
	}

	ai_will_do = {
		FROM = {
			liberty_desire = 100
			years_in_vassalage_under = {
				who = ROOT
				years = 25
				all_subject_country = yes
			}
		}
	}
}