#######################################
#
# 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
	
	ai = no
	min_age = 16
	max_age = 60
	capable_only = yes
	only_playable = yes
	prisoner = no
	
	trigger = {
		has_dlc = "Legacy of Rome"
		has_landed_title = e_nilfgaard
		NOT = { has_global_flag = hippodrome_scheme }
		age = 16
		NOT = { age = 60 }
		in_command = no
		NOT = { is_inaccessible_trigger = yes }
	}
	
	mean_time_to_happen = {
		months = 780
	}
	
	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
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTALoR.401
		change_martial = 1
		custom_tooltip = {
			text = hippodrome_tooltip
			hidden_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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTALoR.404
		narrative_event = { id = LoR.417 tooltip = EVTTOOLTIPLoR.417 }
		hidden_tooltip = {
			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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTALoR.406
		change_intrigue = 1
		custom_tooltip = {
			text = hippodrome_tooltip
			hidden_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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTALoR.409
		narrative_event = { id = LoR.417 tooltip = EVTTOOLTIPLoR.417 }
		hidden_tooltip = {
			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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTALoR.413
		prestige = 100
		if = {
			limit = { 
				NOT = { can_have_more_leadership_traits = no }
				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
	
	hide_from = yes
	
	is_triggered_only = 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
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTALoR.415
		prestige = 100
		piety = -50
		if = {
			limit = { 
				NOT = { can_have_more_leadership_traits = no }
				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
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTALoR.416
		piety = 100
		if = {
			limit = { 
				NOT = { can_have_more_leadership_traits = no }
				NOT = { trait = cavalry_leader }
			}
			add_trait = cavalry_leader
		}
		clr_global_flag = hippodrome_scheme_ongoing
		create_character = {
			random_traits = no
			dynasty = NONE
			female = no
			age = 57
			trait = dwarf
			trait = ugly
			trait = quick
			trait = deceitful
			trait = craven
			trait = flamboyant_schemer
		}
		new_character = {
			prisoner = yes
		}
	}
}

# Riots
narrative_event = {
	id = LoR.417
	title = EVTNAMELoR.417
	desc = EVTDESCLoR.417
	picture = GFX_evt_riots_byzantine
	
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTALoR.417
		custom_tooltip = { 
			text = hippodrome_riots
			hidden_tooltip = {
				capital_scope = {
					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
							troops = {
								light_infantry = { 750 750 }
							}
						}
					}
				}
			}
		}
	}
}

### Random Hippodrome Events

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

	ai = no
	min_age = 16
	capable_only = yes
	only_playable = yes
	prisoner = no
	
	trigger = {
		has_dlc = "Legacy of Rome"
		age = 16
		in_command = no
		has_landed_title = e_nilfgaard
		NOT = { has_global_flag = hippodrome_scheme_ongoing }
		NOT = { is_inaccessible_trigger = yes }
	}
	
	mean_time_to_happen = {
		months = 230
	}
	
	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
	}
}