###########################################
#                                         #
# ZE Ambition Events                      #
# ID ZE.6000-ZE.6999                      #
#                                         #
###########################################

#Written by Markus Olsen

namespace = ZE

#Liege recieves vassals request for council position
character_event = {
	id = ZE.6001
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6001

	is_triggered_only = yes

	trigger = {
		FROM = {
			OR = {
				has_ambition = obj_become_chancellor
				has_ambition = obj_become_marshal
				has_ambition = obj_become_treasurer
				has_ambition = obj_become_spymaster
				has_ambition = obj_become_spiritual
			}
		}
	}

	immediate = {
		FROM = { save_event_target_as = aspiring_councillor }
		ROOT = { save_event_target_as = target_liege }
	}
	
	option = {
		name = EVTOPTA_ZE_6001 #I'll see what I can do
		ai_chance = {
			factor = 30
			modifier = {
				factor = 3
				OR = {
					opinion = { who = FROM value = 75 }
					is_friend = FROM
				}
			}
			modifier = {
				factor = 0
				is_rival = FROM
			}
		}
		hidden_tooltip = {
			FROM = { 
				set_character_flag = council_membership_requested
			}
		}
		FROM = { 
			character_event = { id = ZE.6004 days = 1 tooltip = EVTTOOLTIPZE_6004 } 
		}
	}

	option = {
		name = EVTOPTB_ZE_6001 #We don't need you
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				OR = {
					opinion = { who = FROM value = 75 }
					is_friend = FROM
				}
			}
			modifier = {
				factor = 3
				is_rival = FROM
			}
			modifier = {
				factor = 0
				diplomacy = 15
			}
		}
		FROM = { 
			set_character_flag = council_membership_denied
			opinion = {
				modifier = opinion_very_disappointed
				who = ROOT
				years = 5
			}
			character_event = { id = ZE.6005 days = 1 tooltip = EVTTOOLTIPZE_6005 } 
		}
	}

	option = {
		name = EVTOPTC_ZE_6001 #I would not bother you with such petty assignments
		trigger = {
			diplomacy = 15
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				OR = {
					opinion = { who = FROM value = 75 }
					is_friend = FROM
				}
			}
			modifier = {
				factor = 3
				is_rival = FROM
			}
		}
		FROM = { 
			set_character_flag = council_membership_denied
			opinion = {
				modifier = opinion_flattered
				who = ROOT
				years = 2
			}
			character_event = { id = ZE.6006 days = 1 tooltip = EVTTOOLTIPZE_6006 } 
		}
		tooltip_info = diplomacy
	}
}

#Vassal may ask for council seat again
character_event = {
	id = ZE.6002
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6002

	is_triggered_only = yes
	
	prisoner = no

	trigger = {
		OR = {
			has_ambition = obj_become_chancellor
			has_ambition = obj_become_marshal
			has_ambition = obj_become_treasurer
			has_ambition = obj_become_spymaster
			has_ambition = obj_become_spiritual
		}
		is_councillor = no
		has_character_flag = council_membership_requested
		NOR = { 
			trait = incapable
			is_inaccessible_trigger = yes
			has_character_flag = council_membership_denied
		}
		liege = {
			NOR = {
				in_revolt = yes
				primary_title = { has_law = council_privileges_1 }
				has_opinion_modifier = { who = ROOT modifier = requested_council_position }
				has_opinion_modifier = { who = ROOT modifier = opinion_refused_council }						
			}
		}
	}

	immediate = {
		liege = {
			if = { 
				limit = {
					OR = {
						AND = {
							NOT = { job_chancellor = { always = yes } }
							ROOT = { has_ambition = obj_become_chancellor }
						}
						AND = {
							NOT = { job_marshal = { always = yes } }
							ROOT = { has_ambition = obj_become_marshal }
						}
						AND = {
							NOT = { job_treasurer = { always = yes } }
							ROOT = { has_ambition = obj_become_treasurer }
						}
						AND = {
							NOT = { job_spymaster = { always = yes } }
							ROOT = { has_ambition = obj_become_spymaster }
						}
						AND = {
							NOT = { job_spiritual = { always = yes } }
							ROOT = { has_ambition = obj_become_spiritual }
						}
					}
				}
				break = yes
			}
			if = {
				limit = { ROOT = { has_ambition = obj_become_chancellor } }
				job_chancellor = { save_event_target_as = councillor_target }
				break = yes
			}
			if = {
				limit = { ROOT = { has_ambition = obj_become_marshal } }
				job_marshal = { save_event_target_as = councillor_target }
				break = yes
			}
			if = {
				limit = { ROOT = { has_ambition = obj_become_treasurer } }
				job_treasurer = { save_event_target_as = councillor_target }
				break = yes
			}
			if = {
				limit = { ROOT = { has_ambition = obj_become_spymaster } }
				job_spymaster = { save_event_target_as = councillor_target }
				break = yes
			}
			if = {
				limit = { ROOT = { has_ambition = obj_become_spiritual } }
				job_spiritual = { save_event_target_as = councillor_target }
				break = yes
			}
		}
	}

	option = {
		name = EVTOPTA_ZE_6002
		ai_chance = {
			factor = 100
		}
		liege = { character_event = { id = ZE.6003 days = 3 tooltip = EVTTOOLTIPZE_6003} }
	}

	option = {
		name = EVTOPTB_ZE_6002
		ai_chance = {
			factor = 0
		}
	}
}

#Liege recieves vassals demand for council position
character_event = {
	id = ZE.6003
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy

	#we have a councillor in mind
	desc = {
		text = EVTDESCA_ZE_6003
		trigger = {
			event_target:councillor_target = {
				always = yes
			}
		}
	}

	#there is an open spot
	desc = {
		text = EVTDESCB_ZE_6003
		trigger = {
			NOT = {
				event_target:councillor_target = {
					always = yes
				}
			}
		}
	}

	is_triggered_only = yes

	trigger = {
		prisoner = no
		is_adult = yes
		NOR = { 
			trait = incapable
			is_inaccessible_trigger = yes
			in_revolt = yes
			reverse_has_opinion_modifier = { who = FROM modifier = requested_council_position }
			reverse_has_opinion_modifier = { who = FROM modifier = opinion_refused_council }
		}
	}

	#We fire the current councillor and replace with new
	option = {
		name = EVTOPTA_ZE_6003
		trigger = {
			NOT = {
				primary_title = { has_law = council_privileges_1 }
			}
			event_target:councillor_target = {
				always = yes
			}
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0.25
				event_target:councillor_target = {
					has_job_title = job_chancellor
					attribute_diff = { attribute = diplomacy character = event_target:aspiring_councillor value = 1 }
				}
			}
			modifier = {
				factor = 0.25
				event_target:councillor_target = {
					has_job_title = job_marshal
					attribute_diff = { attribute = martial character = event_target:aspiring_councillor value = 1 }
				}
			}
			modifier = {
				factor = 0.25
				event_target:councillor_target = {
					has_job_title = job_treasurer
					attribute_diff = { attribute = stewardship character = event_target:aspiring_councillor value = 1 }
				}
			}
			modifier = {
				factor = 0.25
				event_target:councillor_target = {
					has_job_title = job_spymaster
					attribute_diff = { attribute = intrigue character = event_target:aspiring_councillor value = 1 }
				}
			}
			modifier = {
				factor = 0.25
				event_target:councillor_target = {
					has_job_title = job_spiritual
					attribute_diff = { attribute = learning character = event_target:aspiring_councillor value = 1 }
				}
			}
			modifier = {
				factor = 0.1
				event_target:councillor_target = { among_most_powerful_vassals = 5 }
				event_target:aspiring_councillor = { NOT = { among_most_powerful_vassals = 5 } }
			}
			modifier = {
				factor = 3
				OR = {
					opinion = { who = FROM value = 75 }
					is_friend = FROM
				}
			}
			modifier = {
				factor = 0
				is_rival = FROM
			}
		}
		event_target:councillor_target = {
			opinion = {
				modifier = opinion_fired_from_council
				who = ROOT
				years = 5
			}
			if = {
				limit = {
					has_job_title = job_chancellor
				}
				remove_title = job_chancellor
				event_target:aspiring_councillor = {
					clr_character_flag = council_membership_requested
					give_job_title = job_chancellor
				}
			}
			if = {
				limit = {
					has_job_title = job_treasurer
				}
				remove_title = job_treasurer
				event_target:aspiring_councillor = {
					clr_character_flag = council_membership_requested
					give_job_title = job_treasurer
				}
			}
			if = {
				limit = {
					has_job_title = job_spiritual
				}
				remove_title = job_spiritual
				event_target:aspiring_councillor = {
					clr_character_flag = council_membership_requested
					give_job_title = job_spiritual
				}
			}
			if = {
				limit = {
					has_job_title = job_spymaster
				}
				remove_title = job_spymaster
				event_target:aspiring_councillor = {
					clr_character_flag = council_membership_requested
					give_job_title = job_spymaster
				}
			}
			if = {
				limit = {
					has_job_title = job_marshal
				}
				remove_title = job_marshal
				event_target:aspiring_councillor = {
					clr_character_flag = council_membership_requested
					give_job_title = job_marshal
				}
			}
		}
	}

	#We have an open spot and approve the request
	option = {
		name = EVTOPTB_ZE_6003
		trigger = {
			NOT = {
				event_target:councillor_target = {
					always = yes
				}
			}
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 3
				OR = {
					opinion = { who = FROM value = 75 }
					is_friend = FROM
				}
			}
			modifier = {
				factor = 0
				is_rival = FROM
			}
		}
		if = {
			limit = { 
				NOT = { job_chancellor = { always = yes } }
				FROM = { can_hold_title = job_chancellor } 
			}
			event_target:aspiring_councillor = {
				clr_character_flag = council_membership_requested
				give_job_title = job_chancellor
				break = yes
			}
		}
		if = {
			limit = {
				NOT = { job_treasurer = { always = yes } } 
				FROM = { can_hold_title = job_treasurer } 
			}
			event_target:aspiring_councillor = {
				clr_character_flag = council_membership_requested
				give_job_title = job_treasurer
				break = yes
			}
		}
		if = {
			limit = {
				NOT = { job_spiritual = { always = yes } } 
				FROM = { can_hold_title = job_spiritual } 
			}
			event_target:aspiring_councillor = {
				clr_character_flag = council_membership_requested
				give_job_title = job_spiritual
				break = yes
			}
		}
		if = {
			limit = {
				NOT = { job_spymaster = { always = yes } }
				FROM = { can_hold_title = job_spymaster }
			}
			event_target:aspiring_councillor = {
				clr_character_flag = council_membership_requested
				give_job_title = job_spymaster
				break = yes
			}
		}
		if = {
			limit = {
				NOT = { job_marshal = { always = yes } }
				FROM = { can_hold_title = job_marshal } 
			}
			event_target:aspiring_councillor = {
				clr_character_flag = council_membership_requested
				give_job_title = job_marshal
				break = yes
			}
		}
	}

	#We decline the request
	option = {
		name = EVTOPTC_ZE_6003
		ai_chance = {
			factor = 70
			modifier = {
				factor = 0
				OR = {
					opinion = { who = FROM value = 75 }
					is_friend = FROM
				}
			}
			modifier = {
				factor = 3
				is_rival = FROM
			}
			modifier = {
				factor = 0
				intrigue = 15
				event_target:councillor_target = { always = yes }
			}
			modifier = {
				factor = 0.5
				event_target:aspiring_councillor = { among_most_powerful_vassals = 5 }
				NOT = { event_target:councillor_target = { among_most_powerful_vassals = 5 } }
			}
		}
		FROM = { 
			set_character_flag = council_membership_denied
			opinion = {
				modifier = opinion_very_disappointed
				who = ROOT
				years = 5
			}
			character_event = { id = ZE.6005 days = 1 } 
		}
	}

	#We play them against each other
	option = {
		name = EVTOPTD_ZE_6003
		trigger = {
			event_target:councillor_target = {
				always = yes
			}
			intrigue = 15
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				OR = {
					opinion = { who = FROM value = 75 }
					is_friend = FROM
				}
			}
			modifier = {
				factor = 3
				NOT = { opinion = { who = FROM value = -50 } }
			}
		}
		tooltip_info = intrigue
		event_target:aspiring_councillor = {
			set_character_flag = council_membership_denied
			character_event = { id = ZE.6007 days = 1 tooltip = EVTTOOLTIPZE_6007} 
		}
	}
}

#Liege will think about council position
character_event = {
	id = ZE.6004
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6004

	is_triggered_only = yes

	trigger = {
		OR = {
			has_ambition = obj_become_chancellor
			has_ambition = obj_become_marshal
			has_ambition = obj_become_treasurer
			has_ambition = obj_become_spymaster
			has_ambition = obj_become_spiritual
		}
	}
	
	#alright
	option = {
		name = EVTOPTA_ZE_6004
		hidden_tooltip = {
			character_event = { id = ZE.6002 days = 90 } 
		}
	}
}

#Liege declined council request
character_event = {
	id = ZE.6005
	picture = GFX_evt_bad_news
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6005

	is_triggered_only = yes

	trigger = { 
		OR = {
			has_ambition = obj_become_chancellor
			has_ambition = obj_become_marshal
			has_ambition = obj_become_treasurer
			has_ambition = obj_become_spymaster
			has_ambition = obj_become_spiritual
		}
	}
	#oh 
	option = {
		name = EVTOPTA_ZE_6005
		opinion = {
			who = FROM
			modifier = opinion_refused_council
		}
	}
}

#Liege explains we are too good for the council
character_event = {
	id = ZE.6006
	picture = GFX_evt_religious_exultation
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6006

	is_triggered_only = yes

	trigger = { 
		OR = {
			has_ambition = obj_become_chancellor
			has_ambition = obj_become_marshal
			has_ambition = obj_become_treasurer
			has_ambition = obj_become_spymaster
			has_ambition = obj_become_spiritual
		}
	}
	#blush
	option = {
		name = EVTOPTA_ZE_6006
		opinion = {
			who = FROM
			modifier = opinion_flattered
			months = 12
		}
	}
}

#Liege tells me another councillor has been slandering me
character_event = {
	id = ZE.6007
	picture = GFX_evt_whispers
	border = GFX_event_normal_frame_intrigue
	desc = EVTDESC_ZE_6007

	is_triggered_only = yes

	trigger = { 
		OR = {
			has_ambition = obj_become_chancellor
			has_ambition = obj_become_marshal
			has_ambition = obj_become_treasurer
			has_ambition = obj_become_spymaster
			has_ambition = obj_become_spiritual
		}
	}
	#you gain a rival
	option = {
		name = EVTOPTA_ZE_6007
		add_rival = event_target:councillor_target
	}
}


#Checking for land_for_son ambition
character_event = {
	id = ZE.6010
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		always = no
		is_heir = no
		NOT = { trait = incapable }
		OR = {
			father = { has_ambition = obj_land_for_son }
			mother = { has_ambition = obj_land_for_son }
		}
	}

	immediate = {
		father = {
			if = { 
				limit = { has_ambition = obj_land_for_son } 
				set_character_flag = land_for_son_successful
				opinion = {
					modifier = opinion_ambition_fulfilled
					who = FROMFROM
					years = 5
				}
			}
		}
		mother = { 
			if = { 
				limit = { has_ambition = obj_land_for_son } 
				set_character_flag = land_for_son_successful
				opinion = {
					modifier = opinion_ambition_fulfilled
					who = FROMFROM
					years = 5
				}
			}
		}
	}
}

#Asking liege to give land to son
character_event = {
	id = ZE.6012
	picture = GFX_evt_son_asking_father
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6012

	is_triggered_only = yes

	immediate = { 
		random_demesne_title = {
			limit = {
				tier = COUNT
				can_be_given_away = yes
				is_contested = no
				location = { is_capital = no }
			}
			save_event_target_as = requested_province
		}
		FROM = {
			random_child = {
				limit = {
					is_alive = yes
					is_female = no
					is_landed = no
					is_adult = yes
					prisoner = no
					NOR = {
						any_heir_title = { always = yes }
						trait = bastard
						trait = disinherited
						trait = incapable
						is_ascetic_trigger = yes
						trait = desert_father
						trait = eunuch
						age = 50
					}
					liege = { character = PREVPREV }
				}
				save_event_target_as = chosen_son
			}
		}
	}

	option = {
		name = EVTOPTA_ZE_6012
		ai_chance = {
			factor = 20
		}
		wealth = 200
		event_target:chosen_son = {
			grant_title = event_target:requested_province
		}
		FROM = {
			character_event = { id = ZE.6013 }
		}
	}

	option = {
		name = EVTOPTB_ZE_6012
		ai_chance = {
			factor = 80
		}
		FROM = {
			character_event = { id = ZE.6014 }
		}
	}

	option = {
		trigger = {
			NOT = {
				FROM = {
					owes_favor_to = ROOT
				}
			}
		}
		name = EVTOPTC_ZE_6012
		ai_chance = {
			factor = 20
		}
		event_target:chosen_son = {
			grant_title = event_target:requested_province
		}
		add_favor = FROM
		hidden_tooltip = {
			FROM = {
				character_event = { id = ZE.6015 }
			}
		}
	}
}

#Land granted from request
character_event = {
	id = ZE.6013
	picture = GFX_evt_son_asking_father
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6013

	is_triggered_only = yes

	option = {
		name = EVTOPTA_ZE_6013
	}
}

#denied land
character_event = {
	id = ZE.6014
	picture = GFX_evt_recieve_letter
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6014

	is_triggered_only = yes

	option = {
		name = EVTOPTA_ZE_6014
	}
}

#got land! but now owes favor
character_event = {
	id = ZE.6015
	picture = GFX_evt_recieve_letter
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6015

	is_triggered_only = yes

	option = {
		name = EVTOPTA_ZE_6015
	}
}


###########################################################################################################
# CHANGE COUNCIL POSITION																				  #
###########################################################################################################
#Targeted decision to change job on councillor, ping target
character_event = {
	id = ZE.6020
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { has_job_title = job_chancellor }
			set_character_flag = is_chancellor
			}
		if = {
			limit = { has_job_title = job_marshal }
			set_character_flag = is_marshal
		}
		if = {
			limit = { has_job_title = job_treasurer }
			set_character_flag = is_treasurer
		}
		if = {
			limit = { has_job_title = job_spymaster }
			set_character_flag = is_spymaster
		}
		if = {
			limit = { has_job_title = job_spiritual }
			set_character_flag = is_spiritual
		}
		if = {
			limit = { has_minor_title = title_councilmember_king }
			set_character_flag = is_councilmember_king
		}
		if = {
			limit = { has_minor_title = title_councilmember_emperor }
			set_character_flag = is_councilmember_emperor
		}
		save_event_target_as = moving_councillor
		set_character_flag = is_moving_councillor
		liege = { character_event = { id = ZE.6021 } }
	}
}

#Targeted decision pick new council job event, brace yourself
character_event = {
	id = ZE.6021
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6021
	
	is_triggered_only = yes

	immediate = { #first, we set a char modifier and check what job the councillor has now
		
		add_character_modifier = {
			name = councillors_changed_jobs
			duration = 365
			hidden = yes
		}
		
		#Check how many options we display

		if = {
			limit = {
				event_target:moving_councillor = {
					can_be_chancellor_trigger = yes
					NOT = { has_character_flag = is_chancellor }
				}
				OR = {
					NOT = {
						job_chancellor = {
							always = yes
						}
					}
					job_chancellor = {
						OR = {
							can_swap_job_title = event_target:moving_councillor
							AND = {
								can_be_council_advisor_trigger = yes
								event_target:moving_councillor = { has_character_flag = is_councilmember_king }
							}
							AND = {
								can_be_council_advisor_trigger = yes
								event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
							}
						}
					}
				}
			}
			set_character_flag = option_1_displayed 
		}
		if = {
			limit = {
				event_target:moving_councillor = {
					can_be_marshal_trigger = yes
					NOT = { has_character_flag = is_marshal }
				}
				OR = {
					NOT = {
						job_marshal = {
							always = yes
						}
					}
					job_marshal = {
						OR = {
							can_swap_job_title = event_target:moving_councillor
							AND = {
								event_target:moving_councillor = { has_character_flag = is_councilmember_king }
								can_be_council_advisor_trigger = yes
							}
							AND = {
								event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
								can_be_council_advisor_trigger = yes
							}
						}
					}
				}
			}
			set_character_flag = option_2_displayed 
		}
		if = {
			limit = {
				event_target:moving_councillor = { 
					can_be_treasurer_trigger = yes
					NOT = { has_character_flag = is_treasurer }
				}
				OR = {
					NOT = {
						job_treasurer = {
							always = yes
						}
					}
					job_treasurer = {
						OR = {
							can_swap_job_title = event_target:moving_councillor
							AND = {
								can_be_council_advisor_trigger = yes
								event_target:moving_councillor = { has_character_flag = is_councilmember_king }
							}
							AND = {
								can_be_council_advisor_trigger = yes
								event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
							}
						}
					}
				}
			}
			set_character_flag = option_3_displayed 
		}
		if = {
			limit = {
				event_target:moving_councillor = {
					can_be_spymaster_trigger = yes
					NOT = { has_character_flag = is_spymaster }
				}
				OR = {
					NOT = {
						job_spymaster = {
							always = yes
						}
					}
					job_spymaster = {
						OR = {
							can_swap_job_title = event_target:moving_councillor
							AND = {
								can_be_council_advisor_trigger = yes
								event_target:moving_councillor = { has_character_flag = is_councilmember_king }
							}
							AND = {
								can_be_council_advisor_trigger = yes
								event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
							}
						}
					}
				}
			}
			set_character_flag = option_4_displayed
		}
		if = {
			limit = {
				event_target:moving_councillor = { 
					can_be_spiritual_trigger = yes
					NOT = { has_character_flag = is_spiritual }
				}
				OR = {
					NOT = {
						job_spiritual = {
							always = yes
						}
					}
					job_spiritual = {
						OR = {
							AND = {
								can_swap_job_title = event_target:moving_councillor
								NAND = {
									liege = { religion_group = muslim } 
									religion = ROOT
								}
							}
							AND = {
								event_target:moving_councillor = { has_character_flag = is_councilmember_king }
								can_be_council_advisor_trigger = yes
							}
							AND = {
								event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
								can_be_council_advisor_trigger = yes
							}
						}
					}
				}
			}
			set_character_flag = option_5_displayed 
		}
		if = {
			limit = {
				event_target:moving_councillor = {
					can_be_council_advisor_trigger = yes
					NOR = {
						has_character_flag = is_councilmember_king
						has_character_flag = is_councilmember_emperor
					}
				}
				ROOT = {
					OR = {
						any_realm_character = {
							has_minor_title = title_councilmember_king
							OR = {
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_chancellor
									}
									can_be_chancellor_trigger = yes
								}
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_marshal
									}
									can_be_marshal_trigger = yes
								}
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_treasurer
									}
									can_be_treasurer_trigger = yes
								}
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_spymaster
									}
									can_be_spymaster_trigger = yes
								}
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_spiritual
									}
									can_be_spiritual_trigger = yes
								}
							}
						}
						any_realm_character = {
							has_minor_title = title_councilmember_emperor
							OR = {
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_chancellor
									}
									can_be_chancellor_trigger = yes
								}
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_marshal
									}
									can_be_marshal_trigger = yes
								}
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_treasurer
									}
									can_be_treasurer_trigger = yes
								}
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_spymaster
									}
									can_be_spymaster_trigger = yes
								}
								AND = {
									event_target:moving_councillor = {
										has_character_flag = is_spiritual
									}
									can_be_spiritual_trigger = yes
								}
							}
						}
					}
				}
			}
			ROOT = { set_character_flag = option_6_displayed }
			if = {
				limit = {
					any_realm_character = {
						has_minor_title = title_councilmember_king
						liege = { character = ROOT }
						OR = {
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_chancellor
								}
								can_be_chancellor_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_marshal
								}
								can_be_marshal_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_treasurer
								}
								can_be_treasurer_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_spymaster
								}
								can_be_spymaster_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_spiritual
								}
								can_be_spiritual_trigger = yes
							}
						}
					}
				}
				random_realm_character = {
					limit = {
						has_minor_title = title_councilmember_king
						liege = { character = ROOT }
						OR = {
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_chancellor
								}
								can_be_chancellor_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_marshal
								}
								can_be_marshal_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_treasurer
								}
								can_be_treasurer_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_spymaster
								}
								can_be_spymaster_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_spiritual
								}
								can_be_spiritual_trigger = yes
							}
						}
					}
					save_event_target_as = advisor_target
					ROOT = { set_character_flag = option_6_king }
					break = yes
				}
			}
			if = {
				limit = {
					any_realm_character = {
						has_minor_title = title_councilmember_emperor
						liege = { character = ROOT }
						OR = {
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_chancellor
								}
								can_be_chancellor_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_marshal
								}
								can_be_marshal_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_treasurer
								}
								can_be_treasurer_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_spymaster
								}
								can_be_spymaster_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_spiritual
								}
								can_be_spiritual_trigger = yes
							}
						}
					}
				}
				random_realm_character = {
					limit = {
						has_minor_title = title_councilmember_emperor
						liege = { character = ROOT }
						OR = {
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_chancellor
								}
								can_be_chancellor_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_marshal
								}
								can_be_marshal_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_treasurer
								}
								can_be_treasurer_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_spymaster
								}
								can_be_spymaster_trigger = yes
							}
							AND = {
								event_target:moving_councillor = {
									has_character_flag = is_spiritual
								}
								can_be_spiritual_trigger = yes
							}
						}
					}
					save_event_target_as = advisor_target
					ROOT = { set_character_flag = option_6_emperor }
					break = yes
				}
			}
		}
	}

	option = { #is chancellor a possible swap
		name = EVTOPTA_ZE_6021
		trigger = {
			has_character_flag = option_1_displayed
		}
		if = {
			limit = {
				NOT = {
					job_chancellor = {
						always = yes
					}
				}
			}
			event_target:moving_councillor = {
				if = {
					limit = {
						has_character_flag = is_marshal
					}
					remove_title = job_marshal
					clr_character_flag = is_marshal
				}
				if = {
					limit = {
						has_character_flag = is_treasurer
					}
					remove_title = job_treasurer
					clr_character_flag = is_treasurer
				}
				if = {
					limit = {
						has_character_flag = is_spymaster
					}
					remove_title = job_spymaster
					clr_character_flag = is_spymaster
				}
				if = {
					limit = {
						has_character_flag = is_spiritual
					}
					remove_title = job_spiritual
					clr_character_flag = is_spiritual
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_king
					}
					remove_title = title_councilmember_king
					clr_character_flag = is_councilmember_king
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_emperor
					}
					remove_title = title_councilmember_emperor
					clr_character_flag = is_councilmember_emperor
				}
				give_job_title = job_chancellor
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
			break = yes
		}
		job_chancellor = {
			set_character_flag = is_moving_councillor
			remove_title = job_chancellor
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_marshal }
				}
				give_job_title = job_marshal
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_treasurer }
				}
				give_job_title = job_treasurer
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spymaster }
				}
				give_job_title = job_spymaster
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spiritual }
				}
				give_job_title = job_spiritual
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_king }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_king }
				give_minor_title = title_councilmember_king
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_emperor }
				give_minor_title = title_councilmember_emperor
			}
		}
		event_target:moving_councillor = {
			give_job_title = job_chancellor
			clr_character_flag = is_chancellor
			clr_character_flag = is_marshal
			clr_character_flag = is_treasurer
			clr_character_flag = is_spymaster
			clr_character_flag = is_spiritual
			clr_character_flag = is_councilmember_king
			clr_character_flag = is_councilmember_emperor
		}
		ROOT = {
			clr_character_flag = option_1_displayed
			clr_character_flag = option_2_displayed
			clr_character_flag = option_3_displayed
			clr_character_flag = option_4_displayed
			clr_character_flag = option_5_displayed
			clr_character_flag = option_6_displayed
			clr_character_flag = option_6_king
			clr_character_flag = option_6_emperor
		}
	}

	option = { #is marshal a possible swap
		name = EVTOPTB_ZE_6021
		trigger = {
			has_character_flag = option_2_displayed
		}
		if = {
			limit = {
				NOT = {
					job_marshal = {
						always = yes
					}
				}
			}
			event_target:moving_councillor = {
				if = {
					limit = {
						has_character_flag = is_chancellor
					}
					remove_title = job_chancellor
					clr_character_flag = is_chancellor
				}
				if = {
					limit = {
						has_character_flag = is_treasurer
					}
					remove_title = job_treasurer
					clr_character_flag = is_treasurer
				}
				if = {
					limit = {
						has_character_flag = is_spymaster
					}
					remove_title = job_spymaster
					clr_character_flag = is_spymaster
				}
				if = {
					limit = {
						has_character_flag = is_spiritual
					}
					remove_title = job_spiritual
					clr_character_flag = is_spiritual
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_king
					}
					remove_title = title_councilmember_king
					clr_character_flag = is_councilmember_king
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_emperor
					}
					remove_title = title_councilmember_emperor
					clr_character_flag = is_councilmember_emperor
				}
				give_job_title = job_marshal
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
			break = yes
		}
		job_marshal = {
			set_character_flag = is_moving_councillor
			remove_title = job_marshal
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_chancellor }
				}
				give_job_title = job_chancellor
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_treasurer }
				}
				give_job_title = job_treasurer
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spymaster }
				}
				give_job_title = job_spymaster
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spiritual }
				}
				give_job_title = job_spiritual
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_king }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_king }
				give_minor_title = title_councilmember_king
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_emperor }
				give_minor_title = title_councilmember_emperor
			}
		}
		event_target:moving_councillor = {
			give_job_title = job_marshal
			clr_character_flag = is_chancellor
			clr_character_flag = is_marshal
			clr_character_flag = is_treasurer
			clr_character_flag = is_spymaster
			clr_character_flag = is_spiritual
			clr_character_flag = is_councilmember_king
			clr_character_flag = is_councilmember_emperor
		}
		ROOT = {
			clr_character_flag = option_1_displayed
			clr_character_flag = option_2_displayed
			clr_character_flag = option_3_displayed
			clr_character_flag = option_4_displayed
			clr_character_flag = option_5_displayed
			clr_character_flag = option_6_displayed
			clr_character_flag = option_6_king
			clr_character_flag = option_6_emperor
		}
	}

	option = { #is treasurer a possible swap
		name = EVTOPTC_ZE_6021
		trigger = {
			has_character_flag = option_3_displayed
		}
		if = {
			limit = {
				NOT = {
					job_treasurer = {
						always = yes
					}
				}
			}
			event_target:moving_councillor = {
				if = {
					limit = {
						has_character_flag = is_chancellor
					}
					remove_title = job_chancellor
					clr_character_flag = is_chancellor
				}
				if = {
					limit = {
						has_character_flag = is_marshal
					}
					remove_title = job_marshal
					clr_character_flag = is_marshal
				}
				if = {
					limit = {
						has_character_flag = is_spymaster
					}
					remove_title = job_spymaster
					clr_character_flag = is_spymaster
				}
				if = {
					limit = {
						has_character_flag = is_spiritual
					}
					remove_title = job_spiritual
					clr_character_flag = is_spiritual
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_king
					}
					remove_title = title_councilmember_king
					clr_character_flag = is_councilmember_king
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_emperor
					}
					remove_title = title_councilmember_emperor
					clr_character_flag = is_councilmember_emperor
				}
				give_job_title = job_treasurer
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
			break = yes
		}
		job_treasurer = {
			set_character_flag = is_moving_councillor
			remove_title = job_treasurer
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_chancellor }
				}
				give_job_title = job_chancellor
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_marshal }
				}
				give_job_title = job_marshal
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spymaster }
				}
				give_job_title = job_spymaster
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spiritual }
				}
				give_job_title = job_spiritual
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_king }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_king }
				give_minor_title = title_councilmember_king
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_emperor }
				give_minor_title = title_councilmember_emperor
			}
		}
		event_target:moving_councillor = {
			give_job_title = job_treasurer
			clr_character_flag = is_chancellor
			clr_character_flag = is_marshal
			clr_character_flag = is_treasurer
			clr_character_flag = is_spymaster
			clr_character_flag = is_spiritual
			clr_character_flag = is_councilmember_king
			clr_character_flag = is_councilmember_emperor
		}
		ROOT = {
			clr_character_flag = option_1_displayed
			clr_character_flag = option_2_displayed
			clr_character_flag = option_3_displayed
			clr_character_flag = option_4_displayed
			clr_character_flag = option_5_displayed
			clr_character_flag = option_6_displayed
			clr_character_flag = option_6_king
			clr_character_flag = option_6_emperor
		}
	}

	option = {
		name = EVTOPTX_ZE_6021
		trigger = {
			OR = {
				has_character_flag = option_4_displayed
				has_character_flag = option_5_displayed
				has_character_flag = option_6_displayed
			}
		}
		hidden_tooltip = {
			character_event = { id = ZE.6022 }
		}
	}

	option = {
		name = NEVERMIND
		trigger = {
			NAND = {
				has_character_flag = option_4_displayed
				has_character_flag = option_5_displayed
				has_character_flag = option_6_displayed
			}
		}
		hidden_tooltip = {
			event_target:moving_councillor = {
				clr_character_flag = is_chancellor
				clr_character_flag = is_marshal
				clr_character_flag = is_treasurer
				clr_character_flag = is_spymaster
				clr_character_flag = is_spiritual
				clr_character_flag = is_councilmember_king
				clr_character_flag = is_councilmember_emperor
				clr_character_flag = is_moving_councillor
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
		}
	}
}

character_event = {
	id = ZE.6022
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_ZE_6021
	
	is_triggered_only = yes

	option = { #is spymaster a possible swap
		name = EVTOPTD_ZE_6021
		trigger = {
			has_character_flag = option_4_displayed
		}
		if = {
			limit = {
				NOT = {
					job_spymaster = {
						always = yes
					}
				}
			}
			event_target:moving_councillor = {
				if = {
					limit = {
						has_character_flag = is_chancellor
					}
					remove_title = job_chancellor
					clr_character_flag = is_chancellor
				}
				if = {
					limit = {
						has_character_flag = is_marshal
					}
					remove_title = job_marshal
					clr_character_flag = is_marshal
				}
				if = {
					limit = {
						has_character_flag = is_treasurer
					}
					remove_title = job_treasurer
					clr_character_flag = is_treasurer
				}
				if = {
					limit = {
						has_character_flag = is_spiritual
					}
					remove_title = job_spiritual
					clr_character_flag = is_spiritual
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_king
					}
					remove_title = title_councilmember_king
					clr_character_flag = is_councilmember_king
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_emperor
					}
					remove_title = title_councilmember_emperor
					clr_character_flag = is_councilmember_emperor
				}
				give_job_title = job_spymaster
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
			break = yes
		}
		job_spymaster = {
			set_character_flag = is_moving_councillor
			remove_title = job_spymaster
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_chancellor }
				}
				give_job_title = job_chancellor
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_marshal }
				}
				give_job_title = job_marshal
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_treasurer }
				}
				give_job_title = job_treasurer
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spiritual }
				}
				give_job_title = job_spiritual
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_king }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_king }
				give_minor_title = title_councilmember_king
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_emperor }
				give_minor_title = title_councilmember_emperor
			}
		}
		event_target:moving_councillor = {
			give_job_title = job_spymaster
			clr_character_flag = is_chancellor
			clr_character_flag = is_marshal
			clr_character_flag = is_treasurer
			clr_character_flag = is_spymaster
			clr_character_flag = is_spiritual
			clr_character_flag = is_councilmember_king
			clr_character_flag = is_councilmember_emperor
		}
		ROOT = {
			clr_character_flag = option_1_displayed
			clr_character_flag = option_2_displayed
			clr_character_flag = option_3_displayed
			clr_character_flag = option_4_displayed
			clr_character_flag = option_5_displayed
			clr_character_flag = option_6_displayed
			clr_character_flag = option_6_king
			clr_character_flag = option_6_emperor
		}
	}

	option = { #is spiritual a possible swap
		name = EVTOPTE_ZE_6021
		trigger = {
			has_character_flag = option_5_displayed
		}
		if = {
			limit = {
				NOT = {
					job_spiritual = {
						always = yes
					}
				}
			}
			event_target:moving_councillor = {
				if = {
					limit = {
						has_character_flag = is_chancellor
					}
					remove_title = job_chancellor
					clr_character_flag = is_chancellor
				}
				if = {
					limit = {
						has_character_flag = is_marshal
					}
					remove_title = job_marshal
					clr_character_flag = is_marshal
				}
				if = {
					limit = {
						has_character_flag = is_treasurer
					}
					remove_title = job_treasurer
					clr_character_flag = is_treasurer
				}
				if = {
					limit = {
						has_character_flag = is_spymaster
					}
					remove_title = job_spymaster
					clr_character_flag = is_spymaster
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_king
					}
					remove_title = title_councilmember_king
					clr_character_flag = is_councilmember_king
				}
				if = {
					limit = {
						has_character_flag = is_councilmember_emperor
					}
					remove_title = title_councilmember_emperor
					clr_character_flag = is_councilmember_emperor
				}
				give_job_title = job_spiritual
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
			break = yes
		}
		job_spiritual = {
			set_character_flag = is_moving_councillor
			remove_title = job_spiritual
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_chancellor }
				}
				give_job_title = job_chancellor
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_marshal }
				}
				give_job_title = job_marshal
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_treasurer }
				}
				give_job_title = job_treasurer
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spymaster }
				}
				give_job_title = job_spymaster
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_king }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_king }
				give_minor_title = title_councilmember_king
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_councilmember_emperor }
				}
				event_target:moving_councillor = { remove_title = title_councilmember_emperor }
				give_minor_title = title_councilmember_emperor
			}
		}
		event_target:moving_councillor = {
			give_job_title = job_spiritual
			clr_character_flag = is_chancellor
			clr_character_flag = is_marshal
			clr_character_flag = is_treasurer
			clr_character_flag = is_spymaster
			clr_character_flag = is_spiritual
			clr_character_flag = is_councilmember_king
			clr_character_flag = is_councilmember_emperor
		}
		ROOT = {
			clr_character_flag = option_1_displayed
			clr_character_flag = option_2_displayed
			clr_character_flag = option_3_displayed
			clr_character_flag = option_4_displayed
			clr_character_flag = option_5_displayed
			clr_character_flag = option_6_displayed
			clr_character_flag = option_6_king
			clr_character_flag = option_6_emperor
		}
	}

	option = { #is being an advisor a new carreer path
		name = EVTOPTY_ZE_6021
		trigger = {
			has_character_flag = option_6_displayed
		}
		event_target:advisor_target = {
			set_character_flag = is_moving_councillor
			if = { #First check for and remove the correct advisor title
				limit = {
					has_minor_title = title_councilmember_king
				}
				remove_title = title_councilmember_king
			}
			if = {
				limit = {
					has_minor_title = title_councilmember_emperor
				}
				remove_title = title_councilmember_emperor
			}

			# Now lets see where our mover was
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_chancellor }
				}
				give_job_title = job_chancellor
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_marshal }
				}
				give_job_title = job_marshal
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_treasurer }
				}
				give_job_title = job_treasurer
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spymaster }
				}
				give_job_title = job_spymaster
			}
			if = {
				limit = { 
					event_target:moving_councillor = { has_character_flag = is_spiritual }
				}
				give_job_title = job_spiritual
			}
		}
		event_target:moving_councillor = {
			if = {
				limit = {
					ROOT = { has_character_flag = option_6_king }
				}
				give_minor_title = title_councilmember_king
				clr_character_flag = is_chancellor
				clr_character_flag = is_marshal
				clr_character_flag = is_treasurer
				clr_character_flag = is_spymaster
				clr_character_flag = is_spiritual
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
			if = {
				limit = {
					ROOT = { has_character_flag = option_6_emperor }
				}
				give_minor_title = title_councilmember_emperor
				clr_character_flag = is_chancellor
				clr_character_flag = is_marshal
				clr_character_flag = is_treasurer
				clr_character_flag = is_spymaster
				clr_character_flag = is_spiritual
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
		}
	}

	option = {
		name = NEVERMIND
		hidden_tooltip = {
			event_target:moving_councillor = {
				clr_character_flag = is_chancellor
				clr_character_flag = is_marshal
				clr_character_flag = is_treasurer
				clr_character_flag = is_spymaster
				clr_character_flag = is_spiritual
				clr_character_flag = is_councilmember_king
				clr_character_flag = is_councilmember_emperor
				clr_character_flag = is_moving_councillor
				ROOT = {
					clr_character_flag = option_1_displayed
					clr_character_flag = option_2_displayed
					clr_character_flag = option_3_displayed
					clr_character_flag = option_4_displayed
					clr_character_flag = option_5_displayed
					clr_character_flag = option_6_displayed
					clr_character_flag = option_6_king
					clr_character_flag = option_6_emperor
				}
			}
		}
	}
}

