republic_liberation2 = {
	name = CB_NAME_INVASION
	war_name = CB_NAME_INVASION
	sprite = 1
	truce_days = 3650
	hostile_against_others = yes
	is_permanent = yes
	can_ask_to_join_war = yes
	check_de_jure_tier = KING 

	can_call_vassals = yes

	allowed_to_target_tributaries = no
	allowed_to_target_suzerains = no
	can_use_gui = {
		ROOT = {
			prestige = 500
		}
	}
	
	on_add = {
		ROOT = { prestige = -500 }
	}

	can_use = {
		ROOT = {
			and = {
				trait = peasant_leader
	
			}
			NOT = { is_liege_or_above = FROM }
			NOT = { is_vassal_or_below = FROM }
			NOT = { same_liege = FROM }
			mercenary = no
		}
		FROM = {
			OR = {
				is_republic = NO
			}
			}
	}
	

can_use_title = {
# The attacker needs at least one county in the target duchy, or a border
any_direct_de_jure_vassal_title = {
OR = {
holder_scope = {
OR = {
character = ROOT
is_liege_or_above = ROOT
}
}
location = {
any_neighbor_province = {
AND = {

owner = {
OR = {
character = ROOT
is_liege_or_above = ROOT
}
}
}
}
}
}
} }
	

	on_success = {
		ROOT = {prestige = 500}
		ROOT = {add_trait = peasant_leader}
		
		any_attacker = {
			limit = { NOT = { character = ROOT } }
			hidden_tooltip = { participation_scaled_prestige = 200 }
		add_trait = peasant_leader
		}
		
		FROM = {
			prestige = -1000
		}
		hidden_tooltip = {
			ROOT = {
				occupy_minors_of_occupied_settlements = FROM
				gain_all_occupied_titles = { who = FROM type = invasion }
				
				if = {
					limit = {
						has_nickname = no
					}
					random_list = {
						10 = { give_nickname = "the Tribune" }
					}
				}
			}
		}
	}
	
	on_success_title = {
		custom_tooltip = {
			hidden_tooltip = {
				ROOT = {
					gain_settlements_under_title = {
						title = PREV
						enemy = FROM
					}
						
				}
			}
		}
	}

	on_fail = {
		FROM = {
			prestige = 100
			
			
		}
		any_defender = {
			limit = { character = FROM }
			participation_scaled_prestige = 100
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 100 }
		}
		ROOT = {
			prestige = -200
		}
	}

	on_reverse_demand = {
		ROOT = {
			prestige = -1000
			transfer_scaled_wealth = {
				to = FROM
				value = 4.0
			}
		}
		FROM = {
			prestige = 200
			
			}}
	attacker_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	attacker_ai_defeat_worth = {
		factor = 100
	}
	
	defender_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	defender_ai_defeat_worth = {
		factor = 100
	}}
			

	