﻿#Events handling Sway ongoing

namespace = poison_opinion_ongoing




######################
#
#	FREE-STANDING EVENTS
#	1000-4999
######################


#They have different culture from their liege
poison_opinion_ongoing.1001 = {
	type = character_event
	title = poison_opinion_ongoing.1001.t
	desc = poison_opinion_ongoing.1001.desc
	theme = friendly
	left_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		scope:scheme = {
			NOT = { has_variable = had_event_poison_opinion_ongoing_1001 }
		}
		scope:target = {
			is_alive = yes
		}
		scope:target = {
			NOT = { culture = scope:target.liege.culture }
		}
		exists = location
	}

	immediate = {
		scope:scheme = {
			set_variable = {	
				name = had_event_poison_opinion_ongoing_1001
				value = yes
				days = 3650
			}
		}
		if = {
			limit = {
				exists = capital_province
			}
			capital_province = { save_scope_as = capital }
		}
		else = {
			location = { save_scope_as = capital }
		}
	}

	option = { #Blame liege's culture
		name = poison_opinion_ongoing.1001.a
		scope:target = {
			add_opinion = {
				target = scope:target.liege
				modifier = disrespect_opinion
				opinion = -10
			}
		}
		random = {
			chance = 40
			add_prestige = minor_prestige_loss
		}
		ai_chance = {
			base = 50
		}
	}

	option = { #That's unfortunate
		name = poison_opinion_ongoing.1001.b
		add_prestige = minor_prestige_gain
		ai_chance = {
			base = 10
		}
	}
}

# Spilling the Tea
poison_opinion_ongoing.1002 = {
	type = character_event
	title = poison_opinion_ongoing.1002.t
	desc = poison_opinion_ongoing.1002.desc
	theme = friendly
	left_portrait = root
	right_portrait = scope:target_spouse
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		scope:scheme = {
			NOT = { has_variable = had_event_poison_opinion_ongoing_1002 }
		}
		scope:target = {
			is_alive = yes
			is_married = yes
		}
		exists = location
	}

	immediate = {
		scope:scheme = {
			set_variable = {	
				name = had_event_poison_opinion_ongoing_1002
				value = yes
				days = 3650
			}
		}
		if = {
			limit = {
				exists = capital_province
			}
			capital_province = { save_scope_as = capital }
		}
		else = {
			location = { save_scope_as = capital }
		}
		scope:target = {
			random_spouse = {
				save_scope_as = target_spouse
			}
		}
	}

	option = { # Do go on
		trigger = {
			scope:target.liege = {
				any_secret = {
					NOT = { is_known_by = root }
				}
			}
		}
		scope:target.liege = {
			random_secret = {
				limit = {
					NOT = { is_known_by = root }
				}
				reveal_to = root
			}
		}

		name = poison_opinion_ongoing.1002.a
		scope:target = {
			add_opinion = {
				target = scope:target.liege
				modifier = disrespect_opinion
				opinion = -10
			}
		}
		scope:target_spouse = {
			add_opinion = {
				target = scope:target.liege
				modifier = disrespect_opinion
				opinion = -10
			}
		}
		scope:target.liege = {
			random_targeting_secret = {
				limit = {
					NOT = {
						is_known_by = root
					}
				}
				reveal_to = root
			}
		}
		ai_chance = {
			base = 50
		}
	}

	option = { # Took a pass at me once
		name = poison_opinion_ongoing.1002.b
		scope:target = {
			add_opinion = {
				target = scope:target.liege
				modifier = angry_opinion
				opinion = -25
			}
		}
		scope:target_spouse = {
			add_opinion = {
				target = scope:target.liege
				modifier = angry_opinion
				opinion = -25
			}
		}
		ai_chance = {
			base = 50
		}
	}
}
