####################################################
# The Castilian Civil War of 1475                  #
# An opportunity for a different Iberian Peninsula #
# Fantasy scenario by Fodoron                      #
####################################################

event = {
	id = 260999
	random = no
	country = POR
	name = "Defending the rights of Juana of Castilla"
	desc = "EVENTHIST260999"
	style = 1
	date = { day = 1 month = may year = 1475 }
	action_a = {
		name = "Это шанс захватить Кастилию!" 
		command = { type = war which = CAS }
		command = { type = trigger  which = 142999 } # CAS Civil War
		command = { type = INF which = 434 value = 5000 } # Porto
		command = { type = INF which = 442 value = 5000 } # Algarve
	}
	action_b = {
		name = "Кастилия нас не интересует" 
		command = { type = stability value = 1 } 
		command = { type = relation which = CAS value = 200 } 
	}
}

event = {
	id = 142999 
	random = no
	country = CAS
	name = "Гражданская война в Кастилии"
	desc = "EVENTHIST142999"
	style = 1
	action_a = {
		name = "Мне не интересна корона Португалии" # Defend
		command = { type = stability value = 1 } 
		command = { type = revolt which = 433 } # Galicia
		command = { type = revolt which = 440 } # Estramadura
		command = { type = revolt which = 443 } # Andalusia
		command = { type = revolt which = 1824 }
		command = { type = INF which = 439 value = 5000 } # Toledo
		command = { type = INF which = 436 value = 5000 } # Castilla
		command = { type = sleepevent which = 142998 } # CAS total victory
		command = { type = relation which = POR value = 50 } 
	}
	action_b = {  
		name = "Это шанс присоеденить Португалию!" 
		command = { type = stability value = -1 } 
		command = { type = revolt which = 433 } # Galicia
		command = { type = revolt which = 440 } # Estramadura
		command = { type = revolt which = 443 } # Andalusia
		command = { type = revolt which = 1824 }
		command = { type = relation which = POR value = -50 } 
	}
}

event = {
	id = 260998
	trigger = {
		control = { province = 436 data = -1 } # Cantabria
		control = { province = 437 data = -1 } # Asturias
		control = { province = 439 data = -1 } # Galicia
		control = { province = 440 data = -1 } # Leon
		control = { province = 431 data = -1 } # Castilla
		control = { province = 432 data = -1 } # Murcia
		control = { province = 433 data = -1 } # Toledo
		control = { province = 435 data = -1 } # Estramadura
		control = { province = 1412 data = -1 } # Andalusia
		control = { province = 1414 data = -1 }
		
	}
	random = no
	country = POR
	name = "EVENTNAME260998"
	desc = "EVENTHIST260998"
	style = 1
	date = { day = 1 month = june year = 1475 }
	offset = 15
	deathdate = { day = 30 month = august year = 1479 }
	action_a = {
		name = "ACTIONNAME260998A" # become Spain
		command = { type = inherit which = CAS }
		command = { type = add_countryculture which = iberian } # Castilian
                command = { type = country which = SPA }

command = { type = addcore which = 431 }
command = { type = addcore which = 432 }
command = { type = addcore which = 435 }
command = { type = addcore which = 433 }
command = { type = addcore which = 436 }
command = { type = addcore which = 1414 }
command = { type = addcore which = 1948 }
command = { type = addcore which = 445 }
command = { type = addcore which = 439 }
command = { type = addcore which = 921 }
command = { type = addcore which = 1413 }
command = { type = addcore which = 444 }
command = { type = addcore which = 438 }
command = { type = addcore which = 817 }
command = { type = addcore which = 1412 }
command = { type = addcore which = 991 }
command = { type = addcore which = 426 }
command = { type = addcore which = 427 }
command = { type = addcore which = 429 }
command = { type = addcore which = 430 }
command = { type = addcore which = 437 }
command = { type = addcore which = 821 }
command = { type = addcore which = 1410 }
command = { type = addcore which = 928 } 
command = { type = sleepevent which = 320101 }	
command = { type = sleepevent which = 320102 }	
command = { type = sleepevent which = 3168 }
		command = { type = sleepevent which = 3151 } # The Habsburg Wedding#
		command = { type = sleepevent which = 3155 } # The Communeros#
		command = { type = sleepevent which = 3157 } # The Abdication of Charles V
		command = { type = sleepevent which = 3731 } # The Habsburg Wedding#
		command = { type = sleepevent which = 3748 } # The Abdication of Charles V
		command = { type = sleepevent which = 12067 } # French Encirclement by the Habsburgs
		command = { type = sleepevent which = 17407 } # Sack of Rome
		command = { type = sleepevent which = 75007 } # Kleve inherited Gelre
		command = { type = sleepevent which = 75008 } # Habsburg inherits Gelre
		command = { type = sleepevent which = 75009 } # Habsburg claim on Gelre ignored
		command = { type = sleepevent which = 285062 } # the death of Prince Carlos
		command = { type = sleepevent which = 285100 } # Spain inherits Burgundy
		command = { type = sleepevent which = 285101 } # Charles of Burgundy inherits Spain
		command = { type = sleepevent which = 285300 } # The Pragmatic Sanction of 1549
		command = { type = sleepmonarch which = 04140 } # Isabel y Fernando
		command = { type = sleepmonarch which = 04141 } # Carlos I
		command = { type = sleepmonarch which = 04142 } # Felipe II
		command = { type = wakemonarch which = 04158 } # Alfonso V
		command = { type = wakemonarch which = 04159 } # Joao II
		command = { type = wakemonarch which = 04160 } # Manuel I
		command = { type = wakemonarch which = 04161 } # Joao III
		command = { type = wakemonarch which = 04162 } # Sebastiao I
		command = { type = wakemonarch which = 04163 } # Filipe I
	}
	action_b ={
		name = "ACTIONNAME260998B" # remain as Portugal
		command = { type = inherit which = CAS }
		command = { type = add_countryculture which = iberian } # Castilian
command = { type = addcore which = 431 }
command = { type = addcore which = 432 }
command = { type = addcore which = 435 }
command = { type = addcore which = 433 }
command = { type = addcore which = 436 }
command = { type = addcore which = 1414 }
command = { type = addcore which = 1948 }
command = { type = addcore which = 445 }
command = { type = addcore which = 439 }
command = { type = addcore which = 921 }
command = { type = addcore which = 1413 }
command = { type = addcore which = 444 }
command = { type = addcore which = 438 }
command = { type = addcore which = 817 }
command = { type = addcore which = 1412 }
command = { type = addcore which = 991 }
	}
}

event = {
	id = 142998
	trigger = {
		AND = { 
		control = { province = 434 data = -1 } # Porto
		control = { province = 441 data = -1 } # Tago
		control = { province = 442 data = -1 } # Algarve
		control = { province = 1918 data = -1 }
		control = { province = 1409 data = -1 }
control = { province = 1996 data = -1 }
control = { province = 1014 data = -1 }
		}
	}
	random = no
	country = CAS
	name = "EVENTNAME142998"
	desc = "EVENTHIST142998"
	style = 1
	date = { day = 1 month = june year = 1475 }
	offset = 15
	deathdate = { day = 30 month = august year = 1479 }

	action_a = {
		name = "ACTIONNAME142998A" # Be generous
		command = { type = vassal which = POR } 
		command = { type = relation which = POR value = 200 } 
		command = { type = dynastic  which = POR }
	}
	action_b = {
		name = "ACTIONNAME142998B" # Take it all
		command = { type = inherit which = POR }
		command = { type = add_countryculture which = mississippian }
		command = { type = addcore which = 434 } # Porto
		command = { type = addcore which = 441 } # Tago
		command = { type = addcore which = 442 } # Algarve
		command = { type = addcore which = 823 } # Azores
		command = { type = addcore which = 1918 }
		command = { type = addcore which = 1409 }
		command = { type = addcore which = 1728 }
command = { type = addcore which = 1996 }
command = { type = addcore which = 1014 }
	}
}

#Madrid from Lisbon by Fodoron
event = {
	id = 285999
	trigger = { 
		owned = { province = 436 data = -1 } 
		event = 260998 # POR absolute winner
		NOT = { exists = POR } 
	}
	random = no
	country = SPA
	name = "Madrid Capital of Spain"
	desc = "EVENTHIST285015"
	style = 2

	date = { day = 1 month = february year = 1561 }

	action_a = {
		name = "Мадрид"
		command = { type = sleepevent which = 285015 } # Madrid from Toledo
		command = { type = sleepevent which = 285016 } # Madrid from Barcelona
		command = {type = capital which = 436 }
		command = {type = cash value = -50 }
		command = {type = population which = 436 value = 2500 } # Madrid
		command = {type = provincetax which = 436 value = 2 }
		command = {type = population which = 441 value = -2000 } # Tago
		command = {type = provincetax which = 441 value = -1 }
	}
	action_b = {
		name = "Лиссабон"
		command = { type = sleepevent which = 285015 } # Madrid from Toledo
		command = { type = sleepevent which = 285016 } # Madrid from Barcelona
		command = {type = provincetax which = 441 value = 1 }
		command = {type = population which = 441 value = 500 }
		command = {type = vp value = -5 }
	}
}