####################################
# Romania AI events 32100 - 32199 by Lothos
####################################
################
# Minister of Security Section 32100 - 32109
#############################################
event = { # Cesare Vaida-Voievod takes power
	id = 32100
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 22100 # Cesare Vaida-Voievod
		NOT = { InCabinet = 22100 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = ministerofsecurity which = 22100 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of Staff Section 32110 - 32119
#############################################
event = { # Victor Antonescu takes power
	id = 32110
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 22127 # Victor Antonescu
		NOT = { InCabinet = 22127 }
		OR = {
			atwar = no
			NOT = { minister = 22124 } # Florea Tenescu
			AND = {
				atwar = yes
				NOT = { manpower = 50 }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = chiefofstaff which = 22127 }
		command = { type = dissent value = -1 }
	}
}
event = { # Florea Tenescu takes power
	id = 32111
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 22124 # Florea Tenescu
		NOT = { InCabinet = 22124 }
		atwar = yes
		manpower = 50
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = chiefofstaff which = 22124 }
		command = { type = dissent value = -1 }
	}
}
################
# Head of Intelligence Section 32120 - 32129
#############################################
################
# Chief of the Army Section 32130 - 32131
#############################################
event = { # Gheorghe Tatarescu takes power
	id = 32130
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 22138 # Gheorghe Tatarescu
		NOT = { InCabinet = 22138 }
		OR = {
			atwar = no
			AND = {
				atwar = yes
				NOT = { minister = 22136 } # Gheorghe Mihail
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = chiefofarmy which = 22138 }
		command = { type = dissent value = -1 }
	}
}
event = { # Gheorghe Mihail takes power
	id = 32131
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		minister = 22136 # Gheorghe Mihail
		NOT = { InCabinet = 22136 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = chiefofarmy which = 22136 }
		command = { type = dissent value = -1 }
	}
}
################
# Armament Minister Section 32140 - 32149
#############################################
event = { # Gheorghe Potopeanu takes power
	id = 32140
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 22093 # Gheorghe Potopeanu
		NOT = { InCabinet = 22093 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = armamentminister which = 22093 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of Air Minister Section 32050 - 32059
#############################################
event = { # Dante Vizante takes power
	id = 32150
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 22010 # Dante Vizante
		NOT = { InCabinet = 22010 }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = chiefofair which = 22010 }
		command = { type = dissent value = -1 }
	}
}




#############################################
# Regular AI Events 32160 - 32199
# Invasion Flags
#	ROMInvadeYUG	= Invade Yugoslavia
#############################################
################
# Romania exp forces to Germany
#############################################
event = {
	id = 32160
	random = no 
	country = ROM
	
	trigger = {
		ai = yes
		ai = GER
		alliance = { country = GER country = ROM }
		OR = {
			AND = {
				war = { country = GER country = SOV }
				war = { country = ROM country = SOV }
			}
			AND = {
				war = { country = GER country = YUG }
				war = { country = ROM country = YUG }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 0 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = ai which = "switch/EXP_Russia.ai" }
		command = { type = ai which = "Air_Ground.ai" }
	}
}
################
# Romania sends more exp forces to Germany
#############################################
event = {
	id = 32161
	random = no 
	country = ROM
	
	trigger = {
		ai = yes
		ai = GER
		alliance = { country = GER country = ROM }
		war = { country = GER country = SOV }
		war = { country = ROM country = SOV }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 0 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = ai which = "switch/EXP_90.ai" }
		command = { type = ai which = "Air_Ground.ai" }
	}
}
################
# Romania joins Germany because of Baklan Campaign
#############################################
event = {
	id = 32162
	random = no 
	country = ROM
	
	trigger = {
		ai = yes
		ai = GER
		atwar = no
		NOT = { alliance = { country = ROM country = SOV } }
		NOT = { alliance = { country = ROM country = ENG } }
		NOT = { alliance = { country = ROM country = ITA } }
		NOT = { alliance = { country = ROM country = GER } }
		NOT = { alliance = { country = ROM country = TUR } }
		OR = {
			war = { country = GER country = SOV }
			war = { country = GER country = YUG }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = alliance which = GER }
	}
}
################
# Romania invades Yugoslavia
#############################################
event = {
	id = 32163
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		ai = GER
		exists = YUG
		flag = InvYugoslavia
		NOT = { war = { country = GER country = SOV } }
		NOT = { war = { country = ROM country = SOV } }
		NOT = { war = { country = ROM country = GER } }		
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = local_setflag which = ROMInvadeYUG }
		command = { type = ai which = "switch/ROM_Invade_YUG_Buildup.ai" }
	}
}
event = {
	id = 32164
	random = no 
	country = ROM
	
	trigger = {
		ai = yes
		local_flag = ROMInvadeYUG
		NOT = { flag = InvYugoslavia }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = war which = YUG }
		command = { type = local_clrflag which = ROMInvadeYUG }
		command = { type = ai which = "switch/ROM_Invade_Release.ai" }
	}
}
################
# Shift Production
#############################################
#event = {
#	id = 32165
#	random = no 
#	country = ROM
#	
#	trigger = {
#		ai = yes
#		OR = {
#			atwar = yes
#			atwar = GER
#			atwar = SOV
#			atwar = POL
#			atwar = BUL
#			atwar = YUG
#			atwar = HUN
#			NOT = { ai = YUG }
#			NOT = { ai = BUL }
#			NOT = { ai = HUN }
#			NOT = { ai = POL }
#			year = 1939
#		}
#	}
#
#	name = "AI_EVENT"
#	style = 0	
#	
#	date = { day = 1 month = january year = 1936 }
#	offset = 1
#	deathdate = { day = 29 month = december year = 1999 }
#
#	action_a = {
#		command = { type = ai which = "switch/max_factor_050.ai" }
#	}
#}
#
################
# Bessarabia skript by Pang Bingxun
#############################################

event = {
	id = 32166
	random = no 
	country = GER
	persistent = yes
	
	trigger = { # Control over Ismail to romania
		OR = {
			AND = {
				ai = GER
				control = { province = 435 data = GER }
				alliance= { country = ROM country = GER }
			}
			AND = {
				ai = SLO
				control = { province = 435 data = SLO }
				alliance= { country = ROM country = SLO }
			}
			AND = {
				ai = BUL
				control = { province = 435 data = BUL }
				alliance= { country = ROM country = BUL }
			}
			AND = {
				ai = HUN
				control = { province = 435 data = HUN }
				alliance= { country = ROM country = HUN }
			}
			AND = {
				ai = YUG
				control = { province = 435 data = YUG }
				alliance= { country = ROM country = YUG }
			}
			AND = {
				ai = CRO
				control = { province = 435 data = CRO }
				alliance= { country = ROM country = CRO }
			}
			AND = {
				ai = ITA
				control = { province = 435 data = ITA }
				alliance= { country = ROM country = ITA }
			}
			AND = {
				ai = VIC
				control = { province = 435 data = VIC }
				alliance= { country = ROM country = VIC }
			}
			AND = {
				ai = SPA
				control = { province = 435 data = SPA }
				alliance= { country = ROM country = SPA }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = control which = ROM value = 435 }
	}
}

event = {
	id = 32167
	random = no 
	country = GER
	persistent = yes
	
	trigger = { # Control over Chisinev to romania
		OR = {
			AND = {
				ai = GER
				control = { province = 434 data = GER }
				alliance= { country = ROM country = GER }
			}
			AND = {
				ai = SLO
				control = { province = 434 data = SLO }
				alliance= { country = ROM country = SLO }
			}
			AND = {
				ai = BUL
				control = { province = 434 data = BUL }
				alliance= { country = ROM country = BUL }
			}
			AND = {
				ai = HUN
				control = { province = 434 data = HUN }
				alliance= { country = ROM country = HUN }
			}
			AND = {
				ai = YUG
				control = { province = 434 data = YUG }
				alliance= { country = ROM country = YUG }
			}
			AND = {
				ai = CRO
				control = { province = 434 data = CRO }
				alliance= { country = ROM country = CRO }
			}
			AND = {
				ai = ITA
				control = { province = 434 data = ITA }
				alliance= { country = ROM country = ITA }
			}
			AND = {
				ai = VIC
				control = { province = 434 data = VIC }
				alliance= { country = ROM country = VIC }
			}
			AND = {
				ai = SPA
				control = { province = 434 data = SPA }
				alliance= { country = ROM country = SPA }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = control which = ROM value = 434 }
	}
}

event = {
	id = 32168
	random = no 
	country = GER
	persistent = yes
	
	trigger = { # Control over Beltsy to romania
		OR = {
			AND = {
				ai = GER
				control = { province = 230 data = GER }
				alliance= { country = ROM country = GER }
			}
			AND = {
				ai = SLO
				control = { province = 230 data = SLO }
				alliance= { country = ROM country = SLO }
			}
			AND = {
				ai = BUL
				control = { province = 230 data = BUL }
				alliance= { country = ROM country = BUL }
			}
			AND = {
				ai = HUN
				control = { province = 230 data = HUN }
				alliance= { country = ROM country = HUN }
			}
			AND = {
				ai = YUG
				control = { province = 230 data = YUG }
				alliance= { country = ROM country = YUG }
			}
			AND = {
				ai = CRO
				control = { province = 230 data = CRO }
				alliance= { country = ROM country = CRO }
			}
			AND = {
				ai = ITA
				control = { province = 230 data = ITA }
				alliance= { country = ROM country = ITA }
			}
			AND = {
				ai = VIC
				control = { province = 230 data = VIC }
				alliance= { country = ROM country = VIC }
			}
			AND = {
				ai = SPA
				control = { province = 230 data = SPA }
				alliance= { country = ROM country = SPA }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = control which = ROM value = 230 }
	}
}

################
# Reinforcements balance events by Pang Bingxun
#############################################

event = { 
	id = 32169
	random = no 
	country = ROM
	persistent = yes

	trigger = {
		ai = yes
		NOT = { local_flag = reinforcement_020 }
		NOT = { manpower = 1 }
	}

	name = "AI_EVENT"
	style = 0
	
	date = { day = 1 month = january year = 1939 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = ai which = "switch/reinforcement_020.ai" }
		command = { type = local_setflag which = reinforcement_020 }
		command = { type = local_clrflag which = reinforcement_050 }
	}
}

event = { 
	id = 32170
	random = no 
	country = ROM
	persistent = yes

	trigger = {
		ai = yes
		NOT = { local_flag = reinforcement_050 }
		manpower = 3
	}

	name = "AI_EVENT"
	style = 0
	
	date = { day = 1 month = january year = 1939 }
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = ai which = "switch/reinforcement_050.ai" }
		command = { type = local_clrflag which = reinforcement_020 }
		command = { type = local_setflag which = reinforcement_050 }
	}
}

#########################################
# Low upgrades and reinforcements early
#########################################

event = {
	id = 32171
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = Upgrading_000 }
		atwar = no
		NOT = { year = 1939 }
	}

	name = "AI_EVENT"
	style = 0
	
	date = { day = 0 month = january year = 1936}
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = ai which = "switch/Upgrading_000.ai" }
		command = { type = local_setflag which = Upgrading_000 }
		command = { type = local_clrflag which = Upgrading_035 }
	}
}

event = {
	id = 32172
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = Upgrading_035 }
		OR = {
			atwar = yes
			year = 1939
		}
	}

	name = "AI_EVENT"
	style = 0
	
	date = { day = 0 month = january year = 1936}
	offset = 1
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		command = { type = ai which = "switch/Upgrading_035.ai" }
		command = { type = local_clrflag which = Upgrading_000 }
		command = { type = local_setflag which = Upgrading_035 }
	}
}

event = {
	id = 32173
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = reinforcement_000 }
		atwar = no
		NOT = { year = 1939 }
		OR = {
			NOT = { year = 1938 }
			NOT = { month = 4 } # may
		}
	}

	name = "AI_EVENT"
	style = 0
	
	date = { day = 0 month = january year = 1936}
	offset = 1
	deathdate = { day = 29 month = december year = 1938 }

	action_a = {
		command = { type = ai which = "switch/reinforcement_000.ai" }
		command = { type = local_setflag which = reinforcement_000 }
		command = { type = local_clrflag which = reinforcement_050 }
	}
}

event = {
	id = 32174
	random = no 
	country = ROM
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = reinforcement_050 }
		OR = {
			atwar = yes
			year = 1939
			AND = {
				year = 1938
				month = 4 # may
			}				
		}
	}

	name = "AI_EVENT"
	style = 0
	
	date = { day = 0 month = january year = 1936}
	offset = 1
	deathdate = { day = 29 month = december year = 1938 }

	action_a = {
		command = { type = ai which = "switch/reinforcement_050.ai" }
		command = { type = local_clrflag which = reinforcement_000 }
		command = { type = local_setflag which = reinforcement_050 }
	}
}
