#######################################
#
# Hippodrome Events
#
# Event ID LoR.400 - LoR.799 reserved
#
#######################################

# Written by Henrik Eklund

namespace = LoR

### Foul Play

# Approached Sabotage
narrative_event = {
	id = LoR.400
	title = EVTNAMELoR.400
	desc = EVTDESCLoR.400
	picture = GFX_evt_emissary_byzantine

	is_triggered_only = yes # on_five_year_pulse, random_events, lor_byzantine_events

	ai = no
	min_age = 16
	max_age = 60
	only_capable = yes
	prisoner = no
	in_command = no
	has_dlc = "Legacy of Rome"

	trigger = {
		capital_scope = {
			province_id = c_constantinopolis
		}

		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		OR = {
			religion_group = christian
			religion_openly_hellenic_or_reformed_trigger = yes
		}

		NOT = { has_global_flag = hippodrome_scheme }
		is_inaccessible_trigger = no
	}

	option = { # Agree
		name = EVTOPTALoR.400

		narrative_event = {
			id = LoR.401
			days = 32
			tooltip = EVTTOOLTIPLoR.401
		}

		set_global_flag = hippodrome_scheme
		set_global_flag = hippodrome_scheme_ongoing
	}

	option = { # Refuse
		name = EVTOPTBLoR.400

		custom_tooltip = { text = hippodrome_refuse }

		set_global_flag = hippodrome_scheme
	}
}

# Sabotage
narrative_event = {
	id = LoR.401
	title = EVTNAMELoR.401
	desc = EVTDESCLoR.401
	picture = GFX_evt_shadowy_cabal

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.401

		change_martial = 1

		custom_tooltip = {
			text = hippodrome_tooltip

			random_list = {
				40 = { narrative_event = { id = LoR.402 } }
				40 = { narrative_event = { id = LoR.403 } }
				20 = { narrative_event = { id = LoR.404 } }
			}
		}
	}
}

# Sabotage Win
narrative_event = {
	id = LoR.402
	title = EVTNAMELoR.402
	desc = EVTDESCLoR.402
	picture = GFX_evt_hippodrome_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.402

		prestige = 100
		wealth = 25

		narrative_event = {
			id = LoR.405
			days = 280
			random = 50
			tooltip = EVTTOOLTIPLoR.405
		}
	}
}

# Sabotage Lose
narrative_event = {
	id = LoR.403
	title = EVTNAMELoR.403
	desc = EVTDESCLoR.403
	picture = GFX_evt_hippodrome_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.403

		prestige = -50

		narrative_event = {
			id = LoR.405
			days = 280
			random = 50
			tooltip = EVTTOOLTIPLoR.405
		}
	}
}

# Sabotage Riots
narrative_event = {
	id = LoR.404
	title = EVTNAMELoR.404
	desc = EVTDESCLoR.404
	picture = GFX_evt_hippodrome_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.404

		narrative_event = {
			id = LoR.417
			tooltip = EVTTOOLTIPLoR.417
		}

		narrative_event = {
			id = LoR.405
			days = 280
			random = 50
		}
	}
}

# Approached Poison
narrative_event = {
	id = LoR.405
	title = EVTNAMELoR.405
	desc = EVTDESCLoR.405
	picture = GFX_evt_emissary_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = { # Agree
		name = EVTOPTALoR.405

		narrative_event = {
			id = LoR.406
			days = 32
			tooltip = EVTTOOLTIPLoR.406
		}
	}

	option = { # Refuse
		name = EVTOPTBLoR.405

		custom_tooltip = { text = hippodrome_refuse_second }
	}
}

# Poison
narrative_event = {
	id = LoR.406
	title = EVTNAMELoR.406
	desc = EVTDESCLoR.406
	picture = GFX_evt_shadowy_cabal

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.406

		change_intrigue = 1

		custom_tooltip = {
			text = hippodrome_tooltip

			random_list = {
				35 = { narrative_event = { id = LoR.407 } }
				35 = { narrative_event = { id = LoR.408 } }
				30 = { narrative_event = { id = LoR.409 } }
			}
		}
	}
}

# Poison Win
narrative_event = {
	id = LoR.407
	title = EVTNAMELoR.407
	desc = EVTDESCLoR.407
	picture = GFX_evt_hippodrome_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.407

		prestige = 100
		wealth = 25

		narrative_event = {
			id = LoR.410
			days = 280
			random = 50
			tooltip = EVTTOOLTIPLoR.405
		}
	}
}

# Poison Lose
narrative_event = {
	id = LoR.408
	title = EVTNAMELoR.408
	desc = EVTDESCLoR.408
	picture = GFX_evt_hippodrome_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.408

		prestige = -50

		narrative_event = {
			id = LoR.410
			days = 280
			random = 50
			tooltip = EVTTOOLTIPLoR.405
		}
	}
}

# Poison Riots
narrative_event = {
	id = LoR.409
	title = EVTNAMELoR.409
	desc = EVTDESCLoR.409
	picture = GFX_evt_hippodrome_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.409

		narrative_event = {
			id = LoR.417
			tooltip = EVTTOOLTIPLoR.417
		}

		narrative_event = {
			id = LoR.405
			days = 280
			random = 50
		}
	}
}

# Approached Weapon
narrative_event = {
	id = LoR.410
	title = EVTNAMELoR.410
	desc = EVTDESCLoR.410
	picture = GFX_evt_garden

	is_triggered_only = yes
	hide_from = yes

	option = { # Agree
		name = EVTOPTALoR.410

		narrative_event = {
			id = LoR.411
			days = 32
			tooltip = EVTTOOLTIPLoR.406
		}
	}

	option = { # Refuse
		name = EVTOPTBLoR.410

		custom_tooltip = { text = hippodrome_refuse_second }
	}
}

# Weapon
narrative_event = {
	id = LoR.411
	title = EVTNAMELoR.411
	desc = EVTDESCLoR.411
	picture = GFX_evt_market_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.411

		change_martial = 1

		narrative_event = {
			id = LoR.412
			tooltip = hippodrome_tooltip
		}
	}
}

# Weapon Race
narrative_event = {
	id = LoR.412
	title = EVTNAMELoR.412
	desc = EVTDESCLoR.412
	picture = GFX_evt_hippodrome_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = { # Give Chase
		name = EVTOPTALoR.412

		narrative_event = {
			id = LoR.414
			tooltip = EVTTOOLTIPLoR.414
		}
	}

	option = { # Stay
		name = EVTOPTBLoR.412

		narrative_event = {
			id = LoR.413
			tooltip = EVTTOOLTIPLoR.413
		}
	}
}

# Stay
narrative_event = {
	id = LoR.413
	title = EVTNAMELoR.413
	desc = EVTDESCLoR.413
	picture = GFX_evt_battle_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.413

		prestige = 100

		if = {
			limit = {
				can_have_more_leadership_traits = yes
				NOT = { trait = cavalry_leader }
			}

			add_trait = cavalry_leader
		}

		clr_global_flag = hippodrome_scheme_ongoing
	}
}

# The Chase
narrative_event = {
	id = LoR.414
	title = EVTNAMELoR.414
	desc = EVTDESCLoR.414
	picture = GFX_evt_hagia_sofia

	is_triggered_only = yes
	hide_from = yes

	option = { # Kill
		name = EVTOPTALoR.414

		narrative_event = {
			id = LoR.415
			tooltip = EVTTOOLTIPLoR.415
		}
	}

	option = { # Spare
		name = EVTOPTBLoR.414

		narrative_event = {
			id = LoR.416
			tooltip = EVTTOOLTIPLoR.416
		}
	}
}

# Killed
narrative_event = {
	id = LoR.415
	title = EVTNAMELoR.415
	desc = EVTDESCLoR.415
	picture = GFX_evt_market_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.415

		prestige = 100
		piety = -50

		if = {
			limit = {
				can_have_more_leadership_traits = yes
				NOT = { trait = cavalry_leader }
			}

			add_trait = cavalry_leader
		}

		clr_global_flag = hippodrome_scheme_ongoing
	}
}

# Spared
narrative_event = {
	id = LoR.416
	title = EVTNAMELoR.416
	desc = EVTDESCLoR.416
	picture = GFX_evt_market_byzantine

	is_triggered_only = yes
	hide_from = yes

	immediate = {
		create_character = {
			name = "Anaximandros"
			random_traits = no
			dynasty = none
			female = no
			age = 57
			religion = ROOT
			culture = greek
			add_trait = dwarf
			add_trait = ugly
			add_trait = quick
			add_trait = deceitful
			add_trait = craven
			add_trait = flamboyant_schemer
		}

		save_event_target_as = anaximandros
	}

	option = {
		name = EVTOPTALoR.416

		piety = 100

		if = {
			limit = {
				can_have_more_leadership_traits = yes
				NOT = { trait = cavalry_leader }
			}

			add_trait = cavalry_leader
		}

		clr_global_flag = hippodrome_scheme_ongoing
		reverse_imprison = event_target:anaximandros
	}
}

# Riots
narrative_event = {
	id = LoR.417
	title = EVTNAMELoR.417
	desc = EVTDESCLoR.417
	picture = GFX_evt_riots_byzantine

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTALoR.417

		custom_tooltip = {
			text = hippodrome_riots

			c_constantinopolis = {
				location = {
					create_random_soldier = {
						random_traits = yes
						dynasty = random
						religion = ROOT
						culture = ROOT
						female = no
						age = 30
						employer = e_rebels
					}

					new_character = {
						spawn_unit = {
							province = PREV
							home = PREV
							leader = THIS

							troops = {
								light_infantry = { 750 750 }
							}
						}
					}
				}
			}
		}
	}
}

### Random Hippodrome Events

# Hippodrome Race
character_event = {
	id = LoR.500
	desc = EVTDESCLoR.500
	picture = GFX_evt_hippodrome_byzantine

	is_triggered_only = yes # on_five_year_pulse, random_events, lor_byzantine_events

	ai = no
	min_age = 16
	only_capable = yes
	prisoner = no
	in_command = no
	has_dlc = "Legacy of Rome"

	trigger = {
		OR = {
			has_landed_title = e_byzantium
			has_landed_title = e_roman_empire
		}

		OR = {
			religion_group = christian
			religion_openly_hellenic_or_reformed_trigger = yes
		}

		NOT = { has_global_flag = hippodrome_scheme_ongoing }
		is_inaccessible_trigger = no
	}

	option = { # Support Blue Team
		name = EVTOPTALoR.500

		wealth = -25

		random_list = {
			50 = {
				character_event = {
					id = LoR.501
					days = 8
					tooltip = EVTTOOLTIPLoR.501
				}
			}

			50 = {
				character_event = {
					id = LoR.502
					days = 8
					tooltip = EVTTOOLTIPLoR.502
				}
			}
		}
	}

	option = { # Support Green Team
		name = EVTOPTBLoR.500

		wealth = -25

		random_list = {
			50 = {
				character_event = {
					id = LoR.503
					days = 8
					tooltip = EVTTOOLTIPLoR.503
				}
			}

			50 = {
				character_event = {
					id = LoR.504
					days = 8
					tooltip = EVTTOOLTIPLoR.504
				}
			}
		}
	}

	option = {
		name = EVTOPTCLoR.500

		custom_tooltip = { text = hippodrome_nobet }
	}
}

# Blue Victorious (With Your Support)
character_event = {
	id = LoR.501
	desc = EVTDESCLoR.501
	picture = GFX_evt_hippodrome_byzantine

	hide_from = yes
	is_triggered_only = yes

	option = {
		name = EVTOPTALoR.501

		wealth = 50
		prestige = 50
	}
}

# Blue Loses (With Your Support)
character_event = {
	id = LoR.502
	desc = EVTDESCLoR.502
	picture = GFX_evt_hippodrome_byzantine

	hide_from = yes
	is_triggered_only = yes

	option = {
		name = EVTOPTALoR.502

		prestige = -25
	}
}

# Green Victorious (With Your Support)
character_event = {
	id = LoR.503
	desc = EVTDESCLoR.503
	picture = GFX_evt_hippodrome_byzantine

	hide_from = yes
	is_triggered_only = yes

	option = {
		name = EVTOPTALoR.503

		wealth = 50
		prestige = 50
	}
}

# Green Loses (With Your Support)
character_event = {
	id = LoR.504
	desc = EVTDESCLoR.504
	picture = GFX_evt_hippodrome_byzantine

	hide_from = yes
	is_triggered_only = yes

	option = {
		name = EVTOPTALoR.504

		prestige = -25
	}
}