###############################################

# Offer to pay own ransom
character_event = {
	id = 50900
	desc = EVTDESC50900
	picture = GFX_evt_emissary

	is_triggered_only = yes # on_yearly_pulse, random_events

	prisoner = yes
	min_age = 14
	only_capable = yes

	trigger = {
		is_ruler = no
		wealth >= 25

		NOR = {
			has_character_flag = asked_for_release
			has_character_flag = tortured

			host = {
				OR = {
					is_liege_of = ROOT

					reverse_has_opinion_modifier = {
						name = declined_ransom
						who = ROOT
					}
				}
			}

			liege = {
				is_parent_of = ROOT
				higher_real_tier_than = BARON
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 100
			health_traits >= 1
		}

		mult_modifier = {
			factor = 2
			wealth >= 50
		}

		mult_modifier = {
			factor = 2
			wealth >= 75
		}

		mult_modifier = {
			factor = 2
			wealth >= 100
		}

		mult_modifier = {
			factor = 2
			wealth >= 200
		}
	}

	option = {
		name = EVTOPTA50900

		set_character_flag = asked_for_release

		host = {
			character_event = { id = 50901 }
		}
	}
}

# Liege responds
character_event = {
	id = 50901
	desc = EVTDESC50901
	picture = GFX_evt_emissary

	is_triggered_only = yes

	option = {
		name = EVTOPTA50901

		wealth = 25

		FROM = {
			show_scope_change = no

			wealth = -25
			imprison = no
		}
	}

	option = {
		name = EVTOPTB50901

		FROM = {
			show_scope_change = no

			opinion = {
				name = declined_ransom
				who = ROOT
				years = 10
			}
		}
	}
}