#
# HoI - Nationalist Spain Events
#
#		written by Henrik Fhraeus
#

#########################################################################
#  Spanish Civil War - Fascist Nation
#########################################################################
event = {
	id = 3001
	random = no
	country = SPA

	trigger = {
		event = 3100
		#event = 3107
	}

	name = "EVT_3001_NAME"
	desc = "EVT_3001_DESC"
	style = 0
	picture = "SPA_fascist"

	date = { day = 17 month = july year = 1936 }
#	date = { day = 11 month = january year = 1936 }
#	offset = 3
#	deathdate = { day = 30 month = december year = 1999 }

	action_a = {
		name = "OK" # Anarchism and Communism must fall!

		command = { type = set_domestic which = democratic value = 2 }
		command = { type = set_domestic which = political_left value = 3 }

		command = { type = headofstate which = 10001 }
		command = { type = headofgovernment which = 10002 }
		command = { type = foreignminister which = 10003 }
		command = { type = armamentminister which = 10004 }
		command = { type = ministerofsecurity which = 10005 }
		command = { type = ministerofintelligence which = 10006 }
		command = { type = chiefofstaff which = 10007 }
		command = { type = chiefofarmy which = 10008 }
		command = { type = chiefofnavy which = 10009 }
		command = { type = chiefofair which = 10010 }

		command = { type = sleepminister which = 10279 } #Jos Sanjurjo as HoS
		command = { type = sleepminister which = 10281 } #Jos Sanjurjo as HoG
		command = { type = sleepminister which = 10188 } #Jos Sanjurjo as CoS
		command = { type = sleepminister which = 10211 } #Jos Sanjurjo as CoA
		command = { type = sleepleader which = 3460 }	#Sanjurjo

		command = { type = supplies value = 5000 }
		command = { type = oilpool value = 25000 }
		command = { type = metalpool value = 25000 }
		command = { type = energypool value = 50000 }
		command = { type = rarematerialspool value = 25000 }

		#command = { type = trigger which = 2023 } # German intervention
		#command = { type = trigger which = 2623 } # Soviet intervention
		#command = { type = trigger which = 2801 } # French intervention
		#command = { type = trigger which = 2901 } # Italian intervention
		#command = { type = trigger which = 3400 } # UK intervention

		command = { type = add_division which = "1a Milicia Falangista" value = militia when = 0 }
		command = { type = add_division which = "2a Milicia Falangista" value = militia when = 0 }
		command = { type = add_division which = "Brigadas Navarras" value = militia when = 0 }
		command = { type = add_corps which = "Tropas de frica" value = land when = 3422 where = 347 } #Seville
		command = { type = add_division which = "Regulares Marroques" value = infantry when = 0 }
		command = { type = add_division value = militia }
		command = { type = add_division value = militia }
		command = { type = add_division value = militia }
		command = { type = add_division value = militia }
		command = { type = add_division value = militia }
		command = { type = convoy which = 334 value = 347 when = 16 } #Supplies to Seville
		command = { type = add_division value = transport when = 0 }
		command = { type = add_division value = transport when = 0 }
		command = { type = manpowerpool value = 500 }
	}
}

#########################################################################
#  Spanish Civil War - German Intervention
#########################################################################
event = {
	id = 3002
	random = no
	country = SPA

	# Triggered by GER 2023

	name = "EVT_3002_NAME"
	desc = "EVT_3002_DESC"
	style = 0
	picture = "SCW_German Intervention"

	action_a = {
		name = "OK" # Great!
		command = { type = supplies value = 3000 }
		command = { type = oilpool value = 200 } 
		command = { type = add_corps which = "Legin Cndor" value = air when = 3493 where = 334 } 
		command = { type = add_division which = "Bombarderos Legin Cndor" value = tactical_bomber when = 2 }
		command = { type = add_division which = "Cazas Legin Cndor" value = interceptor when = 1 }
		command = { type = add_corps which = "Legin Cndor" value = land when = 3466 where = 333 } 
		command = { type = add_division which = "Blindada Legin Cndor" value = armor when = 1 }
		command = { type = transport_pool which = SPA value = 25 }
		command = { type = gain_tech which = 1020 } #36 inf
		command = { type = gain_tech which = 9020 } #Flying circus doc
		command = { type = steal_tech which = GER }
		command = { type = steal_tech which = GER }
	}
}
#########################################################################
#  Spanish Civil War - Italian Intervention
#########################################################################
event = {
	id = 3003
	random = no
	country = SPA

	# Triggered by ITA 2901

	name = "EVT_3003_NAME"
	desc = "EVT_3003_DESC"
	style = 0
	picture = "SCW_Italian Intervention"

	action_a = {
		name = "OK" # Great!
		command = { type = manpowerpool value = 10 }
		command = { type = supplies value = 3000 }
		command = { type = oilpool value = 200 } 
		command = { type = add_division value = destroyer when = 0 }
		command = { type = add_division value = submarine when = 1 }
		command = { type = add_corps which = "Corpo Truppe Voluntario" value = land when = 3427 where = 333 }
		command = { type = add_division which = "Littorio" value = light_armor when = 0 }
		command = { type = add_division which = "Dio lo Vuole" value = infantry when = 1 }
		command = { type = add_division which = "Fiamme Nere" value = infantry when = 1 }
		command = { type = add_division which = "Penne Nere" value = infantry when = 1 }
		command = { type = add_corps which = "Aviacin Legionaria" value = air when = 1 where = 334 } 
		command = { type = add_division which = "Bombarderos Aviacin Legionaria" value = naval_bomber when = 0 }
		command = { type = add_division which = "Cazas Aviacin Legionaria" value = interceptor when = 0 }
		command = { type = transport_pool which = SPA value = 25 }
		command = { type = gain_tech which = 2320 } #Early field arty
		command = { type = steal_tech which = ITA }
#		command = { type = province_keypoints which = -1 value = 1 }
#		command = { type = province_keypoints which = -1 value = 1 }
	}
}
#########################################################################
#  Spanish Civil War - Victory!!!
#########################################################################
event = {
	id = 3004
	random = no
	country = SPA

	trigger = {
		owned = { province = 341 data = SPA }
		NOT = { 
			exists = SPR 
			event = 3108 
		}
	}

	name = "EVT_3004_NAME"
	desc = "EVT_3004_DESC"
	style = 0
	picture = "SPA_Victory"
	date = { day = 18 month = july year = 1936 }
	offset = 5
	deathdate = { day = 30 month = december year = 1999 }

	action_a = {
		name = "OK" # Great!
		command = { type = capital which = 341 }
		command = { type = set_domestic which = democratic value = 3 } 
		command = { type = set_domestic which = political_left value = 4 }
		command = { type = headofstate which = 10032 }
		command = { type = headofgovernment which = 10046 }
		command = { type = foreignminister which = 10057 }
		command = { type = armamentminister which = 10090 }
		command = { type = ministerofsecurity which = 10129 }
		command = { type = ministerofintelligence which = 10162 }
		command = { type = chiefofstaff which = 10183 }
		command = { type = chiefofarmy which = 10206 }
		command = { type = chiefofnavy which = 10230 }

#		command = { type = sleepevent which = 2155 }
#		command = { type = sleepevent which = 2156 }
		command = { type = belligerence which = SPA value = -10 }
		command = { type = remove_division which = "Bombarderos Legin Cndor" value = SPA }
		command = { type = remove_division which = "Cazas Legin Cndor" value = SPA }
		command = { type = remove_division which = "Blindada Legin Cndor" value = SPA }
		command = { type = remove_division which = "Littorio" value = SPA }
		command = { type = remove_division which = "Dio lo Vuole" value = SPA }
		command = { type = remove_division which = "Fiamme Nere" value = SPA }
		command = { type = remove_division which = "Penne Nere" value = SPA }
		command = { type = remove_division which = "Bombarderos Aviacin Legionaria" value = SPA }
		command = { type = remove_division which = "Cazas Aviacin Legionaria" value = SPA }

		# New commands removing any surviving "Soviet" Units SPA recive through Anneks of SPR 
		command = { type = remove_division which = "Carros Soviticos" value = SPA }
		command = { type = remove_division which = "Brigadas Internacionales" value = SPA }
		command = { type = remove_division which = "Cazas soviticos" value = SPA }
		command = { type = remove_division which = "Katiuskas soviticos" value = SPA }
		# New commands removing the communist and anarchist militias if SPA gets them, when they anneks SPR.
		command = { type = remove_division which = "Milicias POUM" value = SPA }
		command = { type = remove_division which = "Milicias CNT" value = SPA }
		# Remove GER & ITA logistic support
		command = { type = transport_pool which = SPA value = -50 }

		command = { type = sleepleader which = 3413 } # Annibale Bergonzoli ITA
		command = { type = sleepleader which = 3416 } # Cavalcanti - seems to be spanish
		command = { type = sleepleader which = 3427 } # Gastone Gambara ITA
		command = { type = sleepleader which = 3455 } # Mario Roatta ITA
		command = { type = sleepleader which = 3466 } # Hellmuth Volkmann GER
		command = { type = sleepleader which = 3492 } # Rudolf von Moreau GER
		command = { type = sleepleader which = 3493 } # von Richthofen GER
		command = { type = sleepleader which = 3494 } # Sperrle GER
		command = { type = sleepleader which = 3497 } # Eoin O'Duffy IRE
		command = { type = sleepminister which = 10269 } # Rudolf von Moreau GER

		command = { type = sleepevent which = 3108 } # Repuplican SCW win event
		command = { type = sleepevent which = 2662 } # USSR SCW Victory event
		command = { type = sleepevent which = 2803 } # France SCW Victory event
		command = { type = sleepevent which = 3901 } # UK SCW Victory event
	}
}

#########################################################################
#  Germany pressures Franco over Gibraltar
#########################################################################
event = {
	id = 3005
	random = no
	country = SPA

	#triggered by GER 2036 

	name = "Germany pressures Spain over Gibraltar"
	desc = "After the victory over the soviet union axis forces turned their focus to the allies. Gibralter has to be taken with consent of Franco or without it."
	style = 0

	action_a = {
		name = "This is our chance to free gibraltar!"
		ai_chance = 90
		command = { type = alliance which = GER }
		command = { type = relation which = GER value = 50 } # Undo effects of pressure
	}
	action_b = {
		name = "Spain will not give in to pressure!"
		ai_chance = 10
		command = { type = trigger which = 2037 } # GER
	}
}

