﻿###########################
# General Events
###########################

add_namespace = ecuper_war

# Ecuadorian attack on peru border
country_event = { 
	id = ecuper_war.1
	title = ecuper_war.1.t
	desc = ecuper_war.1.d
	picture = GFX_report_event_generic_ruins
	
	is_triggered_only = yes
	
	option = {
		name = ecuper_war.1.a
		ai_chance = { 
		factor = 99 
		modifier = {
			factor = 0
			ECU = { is_in_faction = yes }
		}
		}
		declare_war_on = {
         target = ECU
         type = take_state_focus
		 generator = { 949 }
         }
		 hidden_effect = { PRU = { set_country_flag = ecuadorian_peruvian_war } }
	}
	option = {
		name = ecuper_war.1.b
		ai_chance = { factor = 1 }
		add_stability = -0.1
	}
}

# PRU win (HIDDEN)
news_event = {
	id = ecuper_war.2
	hidden = yes
	
	fire_only_once = yes
	
	trigger = {
		PRU = { 
		 AND = {
		 has_country_flag = ecuadorian_peruvian_war
		 has_war_with = ECU
		  OR = { 
		  controls_state = 924
		  controls_state = 305
		  }
		 }
		}
		
	}
	
	immediate = {
		ECU = { white_peace = {
                tag = PRU
                message = "After many loses the Ecuadorian government has decided to surrender the disputed territories in the Amazonas."
       } }
	   PRU = { transfer_state = 949 }
	   PRU = { clr_country_flag = ecuadorian_peruvian_war }
	}
	
	option = {
		name = ecuper_war.2.a
	}
}

# ECU win (HIDDEN)
news_event = {
	id = ecuper_war.3
	hidden = yes
	
	fire_only_once = yes
	
	trigger = {
		PRU = { 
		AND = {
		 has_country_flag = ecuadorian_peruvian_war
		 has_war_with = ECU
		 }
		}
		ECU = { controls_state = 490 }
		
	}
	
	immediate = {
		PRU = { white_peace = {
                tag = ECU
                message = "After many loses the Peruvian government has decided to surrender the territory around Piura."
       } }
	   ECU = { transfer_state = 490 }
	   PRU = { clr_country_flag = ecuadorian_peruvian_war }
	}
	
	option = {
		name = ecuper_war.3.a
	}
}



