##############################################################################
# Groogy got bored a weekend again and made bunch of stuff 
#
# Range ZE.15000 - ZE.15999
# New Horse Chancellor Events
#    ZE.15000 - ZE.15010
##############################################################################

## Written by Henrik "Groogy" Hansson

namespace = ZE

### Horse Chancellor
character_event = {
	id = ZE.15000
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_courier

	desc = {
		trigger = {
			has_dlc = "Horse Lords"
			is_nomadic = yes
		}

		text = EVTDESC6317
		picture = GFX_evt_horse_friend
	}
	desc = {
		trigger = {
			NAND = {
				has_dlc = "Horse Lords"
				is_nomadic = yes
			}
		}

		text = EVTDESC6317
		picture = GFX_evt_courier
	}
	
	min_age = 16
	prisoner = no
	only_capable = yes
	only_playable = yes
	
	trigger = {
		always = no
		has_dlc = "Zeus"
		NOT = {
			has_game_rule = {
				name = supernatural_events
				value = off
			}
		}
		trait = lunatic
		any_voter = {
			has_job_title = job_chancellor
			NOT = { race = horse }
			OR = {
				ai = no
				liege = { ai = no }
				has_game_rule = {
					name = supernatural_events
					value = unrestricted
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 420
	}
	
	option = {
		name = EVTOPTA6317
		tooltip_info = lunatic
		job_chancellor = {
			opinion = {
				modifier = opinion_fired_from_council
				who = ROOT
				years = 5
			}
			hidden_tooltip = {
				character_event = { id = 6318 }
			}
			remove_title = job_chancellor
		}
		any_courtier = {
			limit = {
				race = horse
			}
			give_job_title = job_chancellor
			break = yes
		}

		tooltip = {
			create_character = {
				name = "Glitterhoof"
				age = 16
				religion = ROOT
				culture = horse
				race = horse
				dynasty = NONE
				trait = horse
				trait = imbecile
				trait = stubborn
				trait = fair
				trait = strong
			}
		}

		hidden_tooltip = {
			random_list = {
				50 = {
					create_character = {
						name = "Glitterhoof"
						age = 16
						religion = ROOT
						culture = horse
						race = horse
						dynasty = NONE
						trait = horse
						trait = imbecile
						trait = stubborn
						trait = fair
						trait = strong
					}
				}
				50 = {
					create_character = {
						name = "Glitterhoof"
						female = yes
						age = 16
						religion = ROOT
						culture = horse
						race = horse
						dynasty = NONE
						trait = horse
						trait = imbecile
						trait = stubborn
						trait = fair
						trait = strong
					}
				}
			}
		}
		new_character = {
			give_job_title = job_chancellor
			opinion = {
				modifier = opinion_my_master
				who = ROOT
				years = 100
			}
			reverse_opinion = {
				modifier = opinion_my_horse
				who = ROOT
				years = 100
			}

			hidden_tooltip = {
				if = { 
					limit = { ROOT = { trait = immortal } }
					character_event = { id = ZE.15001 days = 10 } #todo
				}
			}
		}
	}
}

character_event = {
	id = ZE.15001
	hide_window = yes

	is_triggered_only = yes

	option = {
		FROM = { character_event = { id = ZE.15002 } }
	}
}
	

character_event = {
	id = ZE.15002
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_courier

	desc = {
		trigger = {
			has_dlc = "Horse Lords"
			is_nomadic = yes
		}

		text = EVTDESCZE15002
		picture = GFX_evt_horse_friend
	}
	desc = {
		trigger = {
			NAND = {
				has_dlc = "Horse Lords"
				is_nomadic = yes
			}
		}

		text = EVTDESCZE15002
		picture = GFX_evt_courier
	}
	
	is_triggered_only = yes
	
	trigger = {
		trait = lunatic
		trait = immortal
	}

	option = {
		name = EVTOPTAZE15002
		
		FROM = { add_trait = immortal }
	}

	option = {
		name = EVTOPTBZE15002
	}
}