# Peru's quest for independence
country_event = {

	id = 1029
	
	trigger = {
		NOT = { exists = PEU }
		NOT = { has_country_flag = peruvian_nationalism }
		PEU = {
			NOT = {
				OR = {
					is_core = 804		# Puno
					is_core = 805		# Arequipa
					is_core = 806		# Nazca
					is_core = 807		# Huamanga
					is_core = 808		# Cuzco
					is_core = 809		# Lima
					is_core = 810		# Huancavelica
					is_core = 811		# Tarma
					is_core = 812		# Chanchan
					is_core = 813		# Cajamarca
					is_core = 814		# Huanuco
					is_core = 815		# Maynas
					is_core = 817		# Cuenca
					is_core = 818		# Canelos
					is_core = 819		# Guayaquil
					is_core = 820		# Quito
				}
			}
		}		
		OR = {
			owns = 808		# Cuzco
			owns = 809		# Lima
			owns = 813		# Cajamarca
		}
		year = 1750
	}
	
	mean_time_to_happen = {
		months = 480

		modifier = {
			factor = 0.9
			NOT = { centralization_decentralization = 0 }
		}
		modifier = {
			factor = 0.9
			NOT = { centralization_decentralization = -2 }
		}
		modifier = {
			factor = 0.9
			NOT = { centralization_decentralization = -4 }
		}
		modifier = {
			factor = 1.1
			centralization_decentralization = 1
		}
		modifier = {
			factor = 1.1
			centralization_decentralization = 3
		}
		modifier = {
			factor = 1.1
			centralization_decentralization = 5
		}
		modifier = {
			factor = 0.9
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 1.1
			stability = 1
		}
		modifier = {
			factor = 1.1
			stability = 2
		}
		modifier = {
			factor = 1.1
			stability = 3
		}		
		modifier = {
			factor = 0.9
			year = 1760
		}
		modifier = {
			factor = 0.8
			year = 1780
		}
	}
	
	title = "EVTNAME1029"
	desc = "EVTDESC1029"
	
	option = {
		name = "EVTOPTA1029"
		set_country_flag = peruvian_nationalism
		PEU = {
			add_core = 804		# Puno
			add_core = 805		# Arequipa
			add_core = 806		# Nazca
			add_core = 807		# Huamanga
			add_core = 808		# Cuzco
			add_core = 809		# Lima
			add_core = 810		# Huancavelica
			add_core = 811		# Tarma
			add_core = 812		# Chanchan
			add_core = 813		# Cajamarca
			add_core = 814		# Huanuco
			add_core = 815		# Maynas
			add_core = 817		# Cuenca
			add_core = 818		# Canelos
			add_core = 819		# Guayaquil
			add_core = 820		# Quito
		}
		colonists = -1
		random_owned = {
			limit = { is_overseas = yes }
			colonial_rebels = 1
		}
	}
}


# Colonial assembly
province_event = {

	id = 1040
	
	trigger = {
		is_core =  PEU
		revolt_risk = 3
		NOT = { exists = PEU }
		owner = {
			has_country_flag = peruvian_nationalism
		}
		NOT = { has_province_modifier = loyalist_stronghold }
	}
	
	mean_time_to_happen = {
		months = 60

		modifier = {
			factor = 0.9
			owner = { NOT = { stability = -1 } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { stability = -2 } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { advisor = statesman } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { ADM = 4 } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { DIP = 4 } }
		}
		modifier = {
			factor = 1.1
			owner = { ADM = 8 }
		}
		modifier = {
			factor = 1.1
			owner = { DIP = 8 }
		}
		modifier = {
			factor = 1.1
			owner = { advisor = statesman }
		}
		#for the domino effect..
		modifier = {
			factor = 1.25
			NOT = { exists = VNZ }
		}
		modifier = {
			factor = 1.25
			NOT = { exists = CAM }
		}
		modifier = {
			factor = 1.25
			NOT = { exists = QUE }
		}
		modifier = {
			factor = 1.25
			NOT = { exists = PEU }
		}		
		modifier = {
			factor = 1.25
			NOT = { exists = PRG }
		}
		modifier = {
			factor = 1.25
			NOT = { exists = MEX }
		}		
		modifier = {
			factor = 1.25
			NOT = { exists = LOU }
		}		
		modifier = {
			factor = 1.25
			NOT = { exists = LAP }
		}		
		modifier = {
			factor = 1.25
			NOT = { exists = HAT }
		}		
		modifier = {
			factor = 1.25
			NOT = { exists = COL }
		}		
		modifier = {
			factor = 1.25
			NOT = { exists = CHL }
		}	
		modifier = {
			factor = 1.25
			NOT = { exists = CAN }
		}			
		modifier = {
			factor = 1.25
			NOT = { exists = BRZ }
		}		
		modifier = {
			factor = 2.0
			NOT = { exists = USA }
		}		
	}
	
	title = "EVTNAME1023"
	desc = "EVTDESC1023"
	
	option = {
		name = "EVTOPTA1023"		# Attempt to find a diplomatic solution
		ai_chance = { 
			factor = 1 
			modifier = {
				factor = 0
				has_country_modifier = diplomatic_negotiation
			}
		}		
		owner = {
			clr_country_flag = peruvian_nationalism
			add_country_modifier = {
				name = "diplomatic_negotiation"
				duration = 300
			}
		}
	}
		
	option = {
		name = "EVTOPTB1023"		# The days of diplomacy are over
		ai_chance = { factor = 100 }
		
		owner = { stability = -1 }
		add_province_modifier = {
			name = "colonial_tensions"
			duration = 300
		}
	}
}