###Compra de California###
country_event = {
	
	id = 112935
	title = "EVTNAME112935" #The Treaty of Guadalupe Hidalgo
	desc = "EVTDESC112935"
	picture = "treaty"

	is_triggered_only = yes

	option = {
		name = "We agree to their proposal."
		set_country_flag = treaty_of_guadalupe_hidalgo
		prestige = -25
		treasury = 1000000
		all_core = {
			limit = {
				OR = {
					region = TEX_132
					region = TEX_132
					region = MEX_103
					region = MEX_95
					region = MEX_97
					region = MEX_85
					region = MEX_100
					region = USA_111
					region = USA_106
					region = USA_126
					region = USA_129
				}
			}
			remove_core = MEX
		}
		any_owned = {
			limit = {
					is_core = USA
			}
			secede_province = USA
		}
		ai_chance = {
			factor = 10
		}
	}

	option = {
		name = "We refuse!"
		USA = { 
			war = {
				target = MEX
				attacker_goal = {
					casus_belli = Mexican-American_War  }
			call_ally = no
			} }
		ai_chance = {
			factor = 90
		}
	}
}
#Options of the warMEX
country_event = {
	
	id = 7703040
	title = "EVTNAME44825" #proposal of the war
	desc = "EVTDESC44825"
	picture = "treaty"

	is_triggered_only = yes

	option = {
		name = "We have no other option."
		USA = { country_event = 7703041 }
	}
}

#Options of the war
country_event = {
	
	id = 7703041
	title = "EVTNAME44825" #proposal of the war
	desc = "EVTDESC44825"
	picture = "treaty"

	is_triggered_only = yes

	option = {
		name = "Annex the North of Mexico."
		MEX = { country_event = 44825 }
		ai_chance = {
			factor = 100
		}
	}
	option = {
		name = "Annex all of Mexico."
		set_country_flag = annexation_of_mexico
		all_core = {
			limit = {
				OR = {
					region = TEX_132
					region = MEX_103
					region = MEX_95
					region = MEX_97
					region = MEX_85
					region = MEX_100
					region = USA_111
					region = USA_106
					region = USA_126
					region = USA_129
				}
			}
			remove_core = MEX
		}
		war_exhaustion = 30
		inherit = MEX
		MEX = { all_core = { limit = { owned_by = THIS } add_core = THIS } }
		badboy = 55
           any_owned = {
                limit = { owned_by = THIS }
                any_pop = {
                    limit = {
                        OR = {
                            has_pop_culture = mexican
                            has_pop_culture = mayan
                        }
                }
            militancy = 9
        }
	}
           any_owned = {
                limit = { owned_by = THIS }
                any_pop = {
                    limit = {
                        OR = {
                            has_pop_culture = dixie
                        }
                }
            consciousness = 6
        }
	}
}
}
#Treaty of Guadalupe Hidalgo - MEX
country_event = {
	
	id = 44825
	title = "EVTNAME44825" #The Treaty of Guadalupe Hidalgo
	desc = "EVTDESC44825"
	picture = "treaty"

	is_triggered_only = yes

	option = {
		name = "We agree to their proposal."
		set_country_flag = treaty_of_guadalupe_hidalgo
		prestige = -25
		treasury = 100000
		random_owned = {
			limit = {
				owner = { war_with = USA }
			}
			owner = { end_war = USA }
			any_country = {
				limit = {
					war_with = THIS
					alliance_with = USA
				}
				end_war = THIS
			}
		}
		all_core = {
			limit = {
				OR = {
					region = TEX_132
					region = MEX_103
					region = MEX_95
					region = MEX_97
					region = MEX_85
					region = MEX_100
					region = USA_111
					region = USA_106
					region = USA_126
					region = USA_129
				}
			}
			remove_core = MEX
		}
		102 = { add_core = MEX }
		104 = { add_core = MEX }
		any_owned = {
			limit = {
					is_core = USA
			}
			secede_province = USA
		}
		USA = { country_event = 44826 }
		ai_chance = {
			factor = 100
		}
	}
}

country_event = {

	id = 44826
	title = "EVTNAME44826" #Mexico Agrees
	desc = "EVTDESC44826"
	news = yes
	news_title = "EVTNAME44825"
	news_desc_long = "EVTDESC44826_NEWS_LONG"
	news_desc_medium = "EVTDESC44826_NEWS_MEDIUM"
	news_desc_short = "EVTDESC44826_NEWS_SHORT"
	picture = "treaty"

	is_triggered_only = yes

	option = {
		name = "A wise move."
		prestige = 20
		treasury = -10000
		diplomatic_influence = {
			who = FROM
			value = 400
		}
		102 = { add_core = MEX }
		104 = { add_core = MEX }
		relation = {
			who = FROM
			value = 200
		}
	}
}
#Gadsden purcharse
country_event = {
	
	id = 448300
	title = "EVTNAME448300" #The Treaty of Guadalupe Hidalgo
	desc = "EVTDESC448300"
	picture = "treaty"

	is_triggered_only = yes

	option = {
		name = "We agree to their proposal."
		set_country_flag = treaty_of_la_mesilla
		prestige = -25
		treasury = 100000

		102 = { remove_core = MEX }
		104 = { remove_core = MEX }
		102 = { add_core = USA }
		104 = { add_core = USA }
		any_owned = {
			limit = {
					is_core = USA
			}
			secede_province = USA
		}
		USA = { country_event = 448301 }
		ai_chance = {
			factor = 100
		}
	}

	option = {
		name = "We refuse!"
		war_exhaustion = 20
		USA = { country_event = 448303 }

		102 = { add_core = USA }
		104 = { add_core = USA }
		ai_chance = {
			factor = 0
		}
	}
}
country_event = {

	id = 448301
	title = "EVTNAME44826" #Mexico Agrees
	desc = "EVTDESC44826"
	news = yes
	news_title = "EVTNAME44825"
	news_desc_long = "EVTDESC44826_NEWS_LONG"
	news_desc_medium = "EVTDESC44826_NEWS_MEDIUM"
	news_desc_short = "EVTDESC44826_NEWS_SHORT"
	picture = "treaty"

	is_triggered_only = yes

	option = {
		name = "A wise move."
		prestige = 20
		treasury = -100000
		relation = {
			who = FROM
			value = 200
		}
		set_country_flag = mesilla_is_ours
	}
}
country_event = {

	id = 448302
	title = "EVTNAME44826" #Mexico Agrees
	desc = "EVTDESC44826"
	news = yes
	news_title = "EVTNAME44825"
	news_desc_long = "EVTDESC44826_NEWS_LONG"
	news_desc_medium = "EVTDESC44826_NEWS_MEDIUM"
	news_desc_short = "EVTDESC44826_NEWS_SHORT"
	picture = "treaty"

	trigger = { USA = { owns = 102 
				owns = 104 
				NOT = { has_country_flag = mesilla_is_ours } } }
				
				fire_only_once = yes
			

	option = {
		name = "A wise move."
		102 = { remove_core = MEX add_core = USA }
		104 = { remove_core = MEX add_core = USA }
	}
}
country_event = {
	
	id = 448303
	title = "EVTNAME112935" #The Treaty of Guadalupe Hidalgo
	desc = "EVTDESC112935"
	picture = "treaty"

	is_triggered_only = yes

	option = {
		name = "T refuse!"
		USA = { 
			war = {
				target = MEX
				attacker_goal = {
					casus_belli = acquire_all_cores_usa
					country = USA }
			call_ally = no
			} }
		ai_chance = {
			factor = 90
		}
	}
}
#Mexican resistance
country_event = {
	
	id = 8203041
	title = "Mexican resistance" #proposal of the war
	desc = "The Mexican population that is under our control is now actively trying to keep their identity alive, refusing our culture."
	picture = "treaty"

		
	fire_only_once = yes 
	
	trigger = { 
	has_country_flag = annexation_of_mexico }

	option = {
		name = "We will make them like us."
		set_country_flag = mexican_questionn
            any_owned = {
                limit = { is_core = MEX }
                add_province_modifier = {
                    name = mexican_resistance
                    duration = 22000
                }
            }
		ai_chance = {
			factor = 100
		}
	}
}