namespace = byz_chariot_race_events

country_event = { #1 The quadrennial Chariot Race
	id = byz_chariot_race_events.1
	title = "byz_chariot_race_events.1.t"
	desc = "byz_chariot_race_events.1.d"
	picture = CONSTANTINOPLE_eventPicture

	trigger = {
		has_global_flag = constantinople_restored
		tag = BYZ
		OR = {
			AND = { #Constantinople is capital
				capital = 151
				151 = {
					OR = {
						AND = {
							has_dlc = "Leviathan" #Added because apparently the below returns as true if Leviathan is not installed.
							has_great_project = {
								type = hippodrome_of_constantinople
								#tier = 1
							}
						}
						has_province_modifier = byz_hippodrome_restored
					}
				}
			}
			AND = { #Rome is capital
				capital = 118
				118 = {
					OR = {
						AND = {
							has_dlc = "Leviathan" #Added because apparently the below returns as true if Leviathan is not installed.
							has_great_project = {
								type = circus_maximus
								#tier = 1
							}
						}
						151 = {	has_province_modifier = byz_hippodrome_restored } #Because I don't want to construct something in Rome for non-Leviathan users.
					}
				}
			}
		}
		OR = {
			NOT = { has_country_flag = byz_had_recent_chariot_race }
			had_country_flag = { flag = byz_had_recent_chariot_race days = 1460 }
		}
	}
	
	immediate = {
		hidden_effect = {
			set_country_flag = byz_had_recent_chariot_race
		}
	}
	
	mean_time_to_happen = {
		months = 2
	}
	
	option = { #Let the races begin!
		name = "byz_chariot_race_events.1.a"
		ai_chance = { factor = 1 }
		
		add_years_of_income = -0.1
		add_legitimacy = 5
		byz_chariot_race_effect = yes
	}
}

country_event = { #2 Favourite Candidate wins
	id = byz_chariot_race_events.2
	title = "byz_chariot_race_events.2.t"
	desc = "byz_chariot_race_events.2.d"
	picture = CHARIOT_RACES_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.2.a"
		ai_chance = { factor = 1 }
		if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 3
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 3
						}
						is_capital = yes
					}
				}
			}
			add_country_modifier = {
				name = "byz_favourite_candidate_chariot_race_3"
				duration = 1460
			}
		}
		else_if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 2
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 2
						}
						is_capital = yes
					}
				}
			}
			add_country_modifier = {
				name = "byz_favourite_candidate_chariot_race_2"
				duration = 1460
			}
		}
		else = {
			add_country_modifier = {
				name = "byz_favourite_candidate_chariot_race"
				duration = 1460
			}
		}
	}
}

country_event = { #3 Chariot Riots!
	id = byz_chariot_race_events.3
	title = "byz_chariot_race_events.3.t"
	desc = "byz_chariot_race_events.3.d"
	picture = ANGRY_MOB_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.3.a"
		ai_chance = { factor = 1 }
		
		151 = {
			spawn_rebels = {
				type = anti_tax_rebels
				size = 1
			}
		}
	}
	
	option = { #Pacify them
		name = "byz_chariot_race_events.3.b"
		ai_chance = { factor = 1 }
		
		add_yearly_manpower = -0.66 #Cut from 1.5 because 1.30 adjusted rebel sizes.
	}
}

country_event = { #4 Chariot Riots!
	id = byz_chariot_race_events.4
	title = "byz_chariot_race_events.4.t"
	desc = "byz_chariot_race_events.4.d"
	picture = ANGRY_MOB_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.4.a"
		ai_chance = { factor = 1 }
		
		151 = {
			spawn_rebels = {
				type = pretender_rebels
				size = 3
			}
		}
	}
	
	option = { #Pacify them
		name = "byz_chariot_race_events.4.b"
		ai_chance = { factor = 1 }
		
		add_yearly_manpower = -1.0 #Cut from 2.5 because 1.30 adjusted rebel sizes drastically.
	}
}

country_event = { #5 Tourist Revenue
	id = byz_chariot_race_events.5
	title = "byz_chariot_race_events.5.t"
	desc = "byz_chariot_race_events.5.d"
	picture = ECONOMY_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.5.a"
		ai_chance = { factor = 1 }
		if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 3
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 3
						}
						is_capital = yes
					}
				}
			}
			add_country_modifier = {
				name = "byz_tourist_revenue_chariot_race"
				duration = 1460
			}
			add_years_of_income = 0.25
		}
		else_if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 2
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 2
						}
						is_capital = yes
					}
				}
			}
			add_years_of_income = 0.25
		}
		if = { #If Constantinople is capital
			limit = {
				151 = { is_capital = yes }
			}
			151 = {
				add_base_tax = 1
			}
		}
		else = { #If not, it's in Rome.
			118 = {
				add_base_tax = 1
			}
		}
	}
}

country_event = { #6 Team Dresses Production Boom
	id = byz_chariot_race_events.6
	title = "byz_chariot_race_events.6.t"
	desc = "byz_chariot_race_events.6.d"
	picture = COURT_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.6.a"
		ai_chance = { factor = 1 }
		
		if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 3
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 3
						}
						is_capital = yes
					}
				}
			}
			add_country_modifier = {
				name = "byz_production_boom_chariot_race"
				duration = 1460
			}
			add_years_of_income = 0.25
		}
		else_if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 2
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 2
						}
						is_capital = yes
					}
				}
			}
			add_years_of_income = 0.25
		}
		if = { #If Constantinople is capital
			limit = {
				151 = { is_capital = yes }
			}
			151 = {
				add_base_production = 1
			}
		}
		else = { #If not, it's in Rome.
			118 = {
				add_base_production = 1
			}
		}
	}
}

country_event = { #7 The Prasinoi Win!
	id = byz_chariot_race_events.7
	title = "byz_chariot_race_events.7.t"
	desc = "byz_chariot_race_events.7.d"
	picture = CHARIOT_RACES_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.7.a"
		ai_chance = { factor = 1 }
		
		if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 3
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 3
						}
						is_capital = yes
					}
				}
			}
			add_dip_power = 100
		}
		else_if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 2
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 2
						}
						is_capital = yes
					}
				}
			}
			add_dip_power = 75
		}
		else = {
			add_dip_power = 50
		}
		add_estate_influence_modifier = {
			estate = estate_burghers
			desc = EST_VAL_BURGHERS_PRASINOI
			influence = 10
			duration = 1460
		}
	}
}

country_event = { #8 The Venetoi Win!
	id = byz_chariot_race_events.8
	title = "byz_chariot_race_events.8.t"
	desc = "byz_chariot_race_events.8.d"
	picture = CHARIOT_RACES_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.8.a"
		ai_chance = { factor = 1 }
		
		if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 3
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 3
						}
						is_capital = yes
					}
				}
			}
			add_mil_power = 100
		}
		else_if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 2
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 2
						}
						is_capital = yes
					}
				}
			}
			add_mil_power = 75
		}
		else = {
			add_mil_power = 50
		}
		add_estate_influence_modifier = {
			estate = estate_nobles
			desc = EST_VAL_NOBLES_VENETOI
			influence = 10
			duration = 1460
		}
	}
}

country_event = { #9 The Rousioi Win!
	id = byz_chariot_race_events.9
	title = "byz_chariot_race_events.9.t"
	desc = "byz_chariot_race_events.9.d"
	picture = CHARIOT_RACES_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.9.a"
		ai_chance = { factor = 1 }
		
		if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 3
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 3
						}
						is_capital = yes
					}
				}
			}
			add_adm_power = 100
		}
		else_if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 2
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 2
						}
						is_capital = yes
					}
				}
			}
			add_adm_power = 75
		}
		else = {
			add_adm_power = 50
		}
		add_estate_influence_modifier = {
			estate = estate_church
			desc = EST_VAL_CHURCH_ROUSIOI
			influence = 10
			duration = 1460
		}
	}
}

country_event = { #10 The Leukoi Win!
	id = byz_chariot_race_events.10
	title = "byz_chariot_race_events.10.t"
	desc = "byz_chariot_race_events.10.d"
	picture = CHARIOT_RACES_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.10.a"
		ai_chance = { factor = 1 }
		
		if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 3
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 3
						}
						is_capital = yes
					}
				}
			}
			add_mil_power = 100
		}
		else_if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 2
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 2
						}
						is_capital = yes
					}
				}
			}
			add_mil_power = 75
		}
		else = {
			add_mil_power = 50
		}
		add_estate_influence_modifier = {
			estate = estate_generals
			desc = EST_VAL_STRATEGOI_LEUKOI
			influence = 10
			duration = 1460
		}
	}
}

country_event = { #11 Champion of the Chariot Races
	id = byz_chariot_race_events.11
	title = "byz_chariot_race_events.11.t"
	desc = "byz_chariot_race_events.11.d"
	picture = TOURNAMENT_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.11.a"
		ai_chance = { factor = 1 }
		
		if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 3
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 3
						}
						is_capital = yes
					}
				}
			}
			create_general = { tradition = 100 }
			add_army_professionalism = 0.02
		}
		else_if = {
			limit = {
				OR = {
					151 = { #Constantinople is capital
						has_great_project = {
							type = hippodrome_of_constantinople
							tier = 2
						}
						is_capital = yes
					}
					118 = { #Rome is capital
						has_great_project = {
							type = circus_maximus
							tier = 2
						}
						is_capital = yes
					}
				}
			}
			create_general = { tradition = 90 }
			add_army_professionalism = 0.015
		}
		else = {
			create_general = { tradition = 80 }
			add_army_professionalism = 0.01
		}
	}
}

country_event = { #12 Chariot Ran Amok
	id = byz_chariot_race_events.12
	title = "byz_chariot_race_events.12.t"
	desc = "byz_chariot_race_events.12.d"
	picture = CHARIOT_RACES_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.12.a"
		ai_chance = { factor = 1 }
		
		add_years_of_income = -0.5
	}
}

country_event = { #13 Bribed Racers
	id = byz_chariot_race_events.13
	title = "byz_chariot_race_events.13.t"
	desc = "byz_chariot_race_events.13.d"
	picture = CORRUPTION_eventPicture

	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.13.a"
		ai_chance = { factor = 1 }
		
		add_corruption = 1
	}
}

country_event = { #14 Silver Comet
	id = byz_chariot_race_events.14
	title = "byz_chariot_race_events.14.t"
	desc = "byz_chariot_race_events.14.d"
	picture = DEATH_OF_HEIR_eventPicture

	major = yes
	is_triggered_only = yes

	trigger = {
		tag = BYZ
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = { #Ok
		name = "byz_chariot_race_events.14.a"
		ai_chance = { factor = 1 }
		
		kill_ruler = yes
	}
}