﻿####################
# Council Interaction Events
# by Sean Hughes
# council_interaction.0001-0021
####################

namespace = council_interaction

# Inform liege that we are accepting their offer for a council position.
council_interaction.0001 = {
	type = letter_event
	opening = council_interaction.0000.opening
	desc = {
		desc = council_interaction.0001.desc
		desc = council_interaction.0001.desc.accept
	}
	sender = scope:recipient
	
	immediate = {
		scope:recipient = {
			save_scope_as = sender
		}
		root = {
			save_scope_as = receiver
		}
	}

	option = {
		name = council_interaction.0001.a
	}
}

# Inform liege that we are turning down their offer for a council position.
council_interaction.0002 = {
	type = letter_event
	opening = council_interaction.0000.opening
	desc = {
		desc = council_interaction.0001.desc
		desc = council_interaction.0002.desc.refuse
	}
	sender = {
		character = scope:recipient
		animation = dismissal
	}

	immediate = {
		scope:recipient = {
			save_scope_as = sender
		}
		root = {
			save_scope_as = receiver
		}
	}

	option = {
		name = council_interaction.0002.a
	}
}

# Inform liege that we have resigned from the council.
council_interaction.0011 = {
	type = letter_event
	opening = council_interaction.0000.opening
	desc = council_interaction.0011.desc
	sender = {
		character = scope:councillor
		animation = stress
	}

	immediate = {
		scope:councillor = {
			save_scope_as = sender
		}
		root = {
			save_scope_as = receiver
		}
	}

	option = {
		name = council_interaction.0011.a
	}
}

# The on_action only fires for the liege, so we need to redirect our event to the (former) councillor.
council_interaction.0020 = {
	hidden = yes

	immediate = {
		root = {
			save_scope_as = council_owner
			save_scope_as = sender
		}

		scope:councillor = {
			save_scope_as = receiver
			trigger_event = council_interaction.0021
		}
	}
}

# We were fired from the council by our liege!
council_interaction.0021 = {
	type = letter_event
	opening = council_interaction.0000.opening
	desc = council_interaction.0021.desc
	sender = {
		character = scope:council_owner
		animation = dismissal
	}

	option = {
		name = council_interaction.0021.a
	}
}