namespace = flavor

# Chain letter - First Generation
letter_event = {
	id = flavor.5000
	desc = "EVTDESCFLAVOR5000"
	
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		wealth = 5
	}
	
	mean_time_to_happen = {
		months = 2400
	}
	
	option = {
		name = "EVTOPTAFLAVOR5000"
		clr_character_flag = flag_received_chain_letter
		set_character_flag = flag_received_chain_letter
		wealth = -5
		any_dynasty_member = {
			limit = {
				NOT = { character = ROOT }
				is_close_relative = ROOT
			}
			letter_event = { id = flavor.5001 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		any_friend = {
			limit = {
				NOT = {
					AND = {
						dynasty = ROOT
						is_close_relative = ROOT
					}
				}
			}
			letter_event = { id = flavor.5001 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		any_lover = {
			limit = {
				NOT = {
					AND = {
						dynasty = ROOT
						is_close_relative = ROOT
					}
				}
				NOT = { any_friend = { character = ROOT } }
			}
			letter_event = { id = flavor.5001 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				has_character_flag = flag_received_chain_letter
			}
			modifier = {
				factor = 0.25
				trait = close_minded
			}
			modifier = {
				factor = 4
				trait = open_minded
			}
			modifier = {
				factor = 0.5
				trait = skeptical
			}
			modifier = {
				factor = 2
				trait = spiritual
			}
			modifier = {
				factor = 0.1
				trait = genius
			}
			modifier = {
				factor = 0.25
				trait = quick
			}
			modifier = {
				factor = 4
				trait = slow
			}
			modifier = {
				factor = 10
				trait = imbecile
			}
		}
	}
	option = {
		name = "EVTOPTBFLAVOR5000"
		ai_chance = { factor = 50 }
	}
}
# Second Generation
letter_event = {
	id = flavor.5001
	desc = "EVTDESCFLAVOR5000"
	is_triggered_only = yes
	
	trigger = {
		age = 16
		NOT = { trait = incapable }
		prisoner = no
	}
	
	option = {
		trigger = { wealth = 5 }
		name = "EVTOPTAFLAVOR5000"
		clr_character_flag = flag_received_chain_letter
		set_character_flag = flag_received_chain_letter
		wealth = -5
		any_dynasty_member = {
			limit = {
				NOT = { character = ROOT }
				NOT = { character = FROM }
				is_close_relative = ROOT
			}
			letter_event = { id = flavor.5002 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		any_friend = {
			limit = {
				NOT = { character = FROM }
				NOT = {
					AND = {
						dynasty = ROOT
						is_close_relative = ROOT
					}
				}
			}
			letter_event = { id = flavor.5002 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		any_lover = {
			limit = {
				NOT = { character = FROM }
				NOT = {
					AND = {
						dynasty = ROOT
						is_close_relative = ROOT
					}
				}
				NOT = { any_friend = { character = ROOT } }
			}
			letter_event = { id = flavor.5002 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				has_character_flag = flag_received_chain_letter
			}
			modifier = {
				factor = 0.25
				trait = close_minded
			}
			modifier = {
				factor = 4
				trait = open_minded
			}
			modifier = {
				factor = 0.5
				trait = skeptical
			}
			modifier = {
				factor = 2
				trait = spiritual
			}
			modifier = {
				factor = 0.1
				trait = genius
			}
			modifier = {
				factor = 0.25
				trait = quick
			}
			modifier = {
				factor = 4
				trait = slow
			}
			modifier = {
				factor = 10
				trait = imbecile
			}
		}
	}
	option = {
		name = "EVTOPTBFLAVOR5000"
		ai_chance = { factor = 50 }
	}
}
# Later generations
letter_event = {
	id = flavor.5002
	desc = "EVTDESCFLAVOR5000"
	show_from_from = yes
	is_triggered_only = yes
	
	trigger = {
		age = 16
		NOT = { trait = incapable }
		prisoner = no
	}
	
	option = {
		trigger = { wealth = 5 }
		name = "EVTOPTAFLAVOR5000"
		clr_character_flag = flag_received_chain_letter
		set_character_flag = flag_received_chain_letter
		wealth = -5
		FROMFROM = {
			wealth = 5
			opinion = { who = ROOT modifier = opinion_satisfied months = 24 }
			hidden_tooltip = { character_event = { id = flavor.5003 } }
		}
		any_dynasty_member = {
			limit = {
				NOT = { character = ROOT }
				NOT = { character = FROM }
				NOT = { character = FROMFROM }
				is_close_relative = ROOT
			}
			letter_event = { id = flavor.5002 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		any_friend = {
			limit = {
				NOT = { character = FROM }
				NOT = { character = FROMFROM }
				NOT = {
					AND = {
						dynasty = ROOT
						is_close_relative = ROOT
					}
				}
			}
			letter_event = { id = flavor.5002 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		any_lover = {
			limit = {
				NOT = { character = FROM }
				NOT = { character = FROMFROM }
				NOT = {
					AND = {
						dynasty = ROOT
						is_close_relative = ROOT
					}
				}
				NOT = { any_friend = { character = ROOT } }
			}
			letter_event = { id = flavor.5002 tooltip = "EVTTOOLTIPFLAVOR5001" days = 10 random = 5 }
			opinion = { who = ROOT modifier = opinion_irritated months = 24 }
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				has_character_flag = flag_received_chain_letter
			}
			modifier = {
				factor = 0.25
				trait = close_minded
			}
			modifier = {
				factor = 4
				trait = open_minded
			}
			modifier = {
				factor = 0.5
				trait = skeptical
			}
			modifier = {
				factor = 2
				trait = spiritual
			}
			modifier = {
				factor = 0.1
				trait = genius
			}
			modifier = {
				factor = 0.25
				trait = quick
			}
			modifier = {
				factor = 4
				trait = slow
			}
			modifier = {
				factor = 10
				trait = imbecile
			}
		}
	}
	option = {
		name = "EVTOPTBFLAVOR5000"
		ai_chance = { factor = 50 }
	}
}

# Getting your money back
character_event = {
	id = flavor.5003
	desc = "EVTDESCFLAVOR5003"
	notification = yes
	is_triggered_only = yes
	
	immediate = {
		clr_character_flag = flag_received_chain_letter
	}
	option = { }
}

# Ambushing passenger ships
character_event = {
	id = flavor.5100
	desc = "EVTDESCFLAVOR5100"
	picture = GFX_evt_space
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	trigger = {
		religion_group = outlaw_group
		FROM = {
			any_province_character = {
				at_location = ROOT
				is_adult = yes
				NOT = { trait = incapable }
				prisoner = no
				is_military_officer_trigger = no
				yearly_income = 10
			}
		}
	}
	
	option = {
		trigger = {
			FROM = {
				any_province_character = {
					at_location = ROOT
					is_adult = yes
					NOT = { trait = incapable }
					prisoner = no
					is_military_officer_trigger = no
					yearly_income = 50
				}
			}
		}
		name = "EVTOPTAFLAVOR5100"
		FROM = {
			random_province_character = {
				limit = {
					at_location = ROOT
					is_adult = yes
					NOT = { trait = incapable }
					prisoner = no
					is_military_officer_trigger = no
					yearly_income = 50
				}
				random_list = {
					75 = { character_event = { id = flavor.5110 tooltip = "EVTTOOLTIPFLAVOR5110" } }
					25 = { character_event = { id = flavor.5120 tooltip = "EVTTOOLTIPFLAVOR5120" } }
				}
			}
		}
		ai_chance = { factor = 25 }
	}
	option = {
		trigger = {
			FROM = {
				any_province_character = {
					at_location = ROOT
					is_adult = yes
					NOT = { trait = incapable }
					prisoner = no
					is_military_officer_trigger = no
					yearly_income = 25
					NOT = { yearly_income = 50 }
				}
			}
		}
		name = "EVTOPTBFLAVOR5100"
		FROM = {
			random_province_character = {
				limit = {
					at_location = ROOT
					is_adult = yes
					NOT = { trait = incapable }
					prisoner = no
					is_military_officer_trigger = no
					yearly_income = 25
					NOT = { yearly_income = 50 }
				}
				random_list = {
					50 = { character_event = { id = flavor.5110 tooltip = "EVTTOOLTIPFLAVOR5110" } }
					50 = { character_event = { id = flavor.5120 tooltip = "EVTTOOLTIPFLAVOR5120" } }
				}
			}
		}
		ai_chance = { factor = 25 }
	}
	option = {
		trigger = {
			FROM = {
				any_province_character = {
					at_location = ROOT
					is_adult = yes
					NOT = { trait = incapable }
					prisoner = no
					is_military_officer_trigger = no
					yearly_income = 10
					NOT = { yearly_income = 25 }
				}
			}
		}
		name = "EVTOPTCFLAVOR5100"
		FROM = {
			random_province_character = {
				limit = {
					at_location = ROOT
					is_adult = yes
					NOT = { trait = incapable }
					prisoner = no
					is_military_officer_trigger = no
					yearly_income = 10
					NOT = { yearly_income = 25 }
				}
				random_list = {
					25 = { character_event = { id = flavor.5110 tooltip = "EVTTOOLTIPFLAVOR5110" } }
					75 = { character_event = { id = flavor.5120 tooltip = "EVTTOOLTIPFLAVOR5120" } }
				}
			}
		}
		ai_chance = { factor = 25 }
	}
	option = {
		name = "EVTOPTDFLAVOR5100"
		prestige = -50
		ai_chance = {
			factor = 25
			modifier = {
				factor = 0.5
				trait = brave
			}
			modifier = {
				factor = 2
				trait = craven
			}
		}
	}
}

# Repelled a pirate attack!
character_event = {
	id = flavor.5110
	desc = "EVTDESCFLAVOR5110"
	picture = GFX_evt_battle
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTAFLAVOR5110"
		prestige = 50
		FROM = { character_event = { id = flavor.5115 tooltip = "EVTTOOLTIPFLAVOR5115" } }
	}
}

# Your attack was a failure!
character_event = {
	id = flavor.5115
	desc = "EVTDESCFLAVOR5115"
	picture = GFX_evt_battle
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		if = {
			limit = {
				trait = maimed
				NOT = { trait = wounded }
			}
			random = {
				chance = 50
				add_trait = wounded
			}
		}
		if = {
			limit = {
				trait = wounded
				NOT = { trait = maimed }
				NOT = { trait = cybernetic_limb }
			}
			random = {
				chance = 25
				remove_trait = wounded
				add_trait = maimed
			}
		}
		if = {
			limit = {
				NOT = { trait = wounded }
				NOT = { trait = maimed }
				NOT = { trait = full_cybernetic_conversion }
			}
			random = {
				chance = 25
				add_trait = wounded
			}
		}
	}
}

# Boarded by pirates!
character_event = {
	id = flavor.5120
	desc = "EVTDESCFLAVOR5120"
	picture = GFX_evt_thrown_into_the_dungeon
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTAFLAVOR5120"
		prestige = -50
		FROM = { character_event = { id = flavor.5130 tooltip = "EVTTOOLTIPFLAVOR5130" } }
	}
}

# You've boarded a civiiian ship and captured a VIP
character_event = {
	id = flavor.5130
	desc = "EVTDESCFLAVOR5130"
	picture = GFX_evt_battle
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTAFLAVOR5130" # Take their valuables and let them go
		prestige = 50
		piety = 50
		FROM = {
			tooltip = { transfer_scaled_wealth = { to = ROOT value = 1.0 } }
			hidden_tooltip = { character_event = { id = flavor.5140 } }
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 4
				trait = friendly
			}
			modifier = {
				factor = 0.5
				trait = cold
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 100 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 90 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 80 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 70 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 30 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 10 }
			}
		}
	}
	option = {
		name = "EVTOPTBFLAVOR5130" # Take their valuables and take them as a prisoner
		prestige = 50
		FROM = {
			tooltip = {
				transfer_scaled_wealth = { to = ROOT value = 1.0 }
				imprison = ROOT
			}
			hidden_tooltip = { character_event = { id = flavor.5150 } }
		}
		ai_chance = {
			factor = 50
		}
	}
	option = {
		name = "EVTOPTCFLAVOR5140" # Take their valuables and kill them
		prestige = 50
		piety = -50
		FROM = {
			tooltip = {
				transfer_scaled_wealth = { to = ROOT value = 1.0 }
				death = { death_reason = death_murder killer = ROOT }
			}
			hidden_tooltip = { character_event = { id = flavor.5160 } }
		}
		if = {
			limit = { trait = friendly }
			remove_trait = friendly
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = cold
			}
			modifier = {
				factor = 0
				trait = friendly
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -9 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -19 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -29 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -39 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -49 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -59 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -69 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -79 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -89 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -99 } }
			}
		}
	}
}

# The pirates take your valuables, but let you go
character_event = {
	id = flavor.5140
	desc = "EVTDESCFLAVOR5140"
	picture = GFX_evt_space
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		transfer_scaled_wealth = { who = FROM value = 1.0 }
	}
}

# The pirates take your valuables and throw you in the brig
character_event = {
	id = flavor.5150
	desc = "EVTDESCFLAVOR5150"
	picture = GFX_evt_thrown_into_the_dungeon
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		transfer_scaled_wealth = { who = FROM value = 1.0 }
		imprison = FROM
	}
}

# The pirates take your valuables and then throw you out the airlock
character_event = {
	id = flavor.5160
	desc = "EVTDESCFLAVOR5160"
	picture = GFX_evt_death
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTAFLAVOR5160"
		transfer_scaled_wealth = { to = ROOT value = 1.0 }
		death = { death_reason = death_murder killer = ROOT }
		hidden_tooltip = {
			father = { character_event = { id = flavor.5161 } }
			mother = { character_event = { id = flavor.5161 } }
			any_sibling = { character_event = { id = flavor.5162 } }
			any_child = { character_event = { id = flavor.5163 } }
			any_lover = { character_event = { id = flavor.5164 } }
			any_friend = { character_event = { id = flavor.5165 } }
			spouse = { character_event = { id = flavor.5166 } }
		}
	}
}
character_event = {
	id = flavor.5161
	desc = "EVTDESCFLAVOR5165"
	picture = GFX_evt_death
	border = GFX_evt_normal_frame_war
	show_from_from = yes
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		opinion = { who = FROMFROM modifier = opinion_killed_my_child }
	}
}
character_event = {
	id = flavor.5162
	desc = "EVTDESCFLAVOR5165"
	picture = GFX_evt_death
	border = GFX_evt_normal_frame_war
	show_from_from = yes
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		opinion = { who = FROMFROM modifier = opinion_killed_my_sibling }
	}
}
character_event = {
	id = flavor.5163
	desc = "EVTDESCFLAVOR5165"
	picture = GFX_evt_death
	border = GFX_evt_normal_frame_war
	show_from_from = yes
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		opinion = { who = FROMFROM modifier = opinion_killed_my_parent }
	}
}
character_event = {
	id = flavor.5164
	desc = "EVTDESCFLAVOR5165"
	picture = GFX_evt_death
	border = GFX_evt_normal_frame_war
	show_from_from = yes
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		opinion = { who = FROMFROM modifier = opinion_killed_my_lover }
	}
}
character_event = {
	id = flavor.5165
	desc = "EVTDESCFLAVOR5165"
	picture = GFX_evt_death
	border = GFX_evt_normal_frame_war
	show_from_from = yes
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		opinion = { who = FROMFROM modifier = opinion_killed_my_friend }
	}
}
character_event = {
	id = flavor.5166
	desc = "EVTDESCFLAVOR5165"
	picture = GFX_evt_death
	border = GFX_evt_normal_frame_war
	show_from_from = yes
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		opinion = { who = FROMFROM modifier = opinion_killed_my_spouse }
	}
}

# Pirates ambush a freighter
character_event = {
	id = flavor.5200
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		FROM = {
			has_trade_post = yes
			NOT = { trade_post_owner = { character = ROOT } }
		}
	}
	
	immediate = {
		FROM = { trade_post_owner = { character_event = { id = flavor.5201 } } }
	}
}
character_event = {
	id = flavor.5201
	desc = "EVTDESCFLAVOR5201"
	picture = GFX_evt_space
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		tooltip = { scaled_wealth_transfer = { to = FROM value = 0.1 } }
		hidden_tooltip = { FROM = { character_event = { id = flavor.5202 } } }
	}
}
character_event = {
	id = flavor.5202
	desc = "EVTDESCFLAVOR5202"
	picture = GFX_evt_space
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		FROM = {
			scaled_wealth_transfer = { to = ROOT value = 0.1 }
			opinion = { who = ROOT modifier = opinion_looted }
		}
	}
}
# Stealing prototype weaponry
character_event = {
	id = flavor.5300
	desc = "EVTDESCLFAVOR5300"
	picture = GFX_evt_space
	border = GFX_evt_normal_frame_war
	is_triggered_only = yes
	
	trigger = { FROM = { has_higher_tech_than = ROOT } }
	
	option = {
		name = "EVTOPTCONFIRM"
		military_techpoints = 10
	}
}

# You're in dire need of a hit of spice
character_event = {
	id = flavor.5400
	desc = "EVTDESCFLAVOR5400"
	picture = GFX_evt_illness
	
	min_age = 18
	only_capable = yes
	
	trigger = {
		trait = spice_addict
		NOT = { has_character_modifier = on_spice }
		NOT = { has_character_modifier = spice_withdrawal }
	}
	
	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 0.5
			trait = neurotic
		}
		modifier = {
			factor = 2
			trait = confident
		}
		modifier = {
			factor = 0.5
			trait = stressed
		}
		modifier = {
			factor = 0.5
			trait = depressed
		}
	}
	
	option = {
		name = "EVTOPTCONFIRM"
		add_character_modifier = { name = spice_withdrawal duration = 3650 }
	}
}

# You'd like to buy spice
character_event = {
	id = flavor.5500
	desc = "EVTDESCFLAVOR5500"
	picture = GFX_evt_criminal
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		location = { trade_post_owner = { character_event = { id = flavor.5510 tooltip = "EVTTOOLTIPFLAVOR5510" } } }
	}
	option = {
		trigger = { NOT = { trait = spice_addict } }
		name = "EVTOPTNEVERMIND"
		clr_character_flag = flag_buying_spice
		ai_chance = { factor = 0 }
	}
}

character_event = {
	id = flavor.5510
	desc = "EVTDESCFLAVOR5510"
	picutre = GFX_evt_criminal
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		wealth = 50
		FROM = {
			opinion = { who = ROOT modifier = opinion_sold_me_spice }
			character_event = { id = flavor.5520 tooltip = "EVTTOOLTIPFLAVOR5520" }
		}
	}
}

character_event = {
	id = flavor.5520
	desc = "EVTDESCFLAVOR5520"
	picture = GFX_evt_illness
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		clr_character_flag = flag_buying_spice
		wealth = 50
		if = {
			limit = { has_character_modifier = spice_withdrawal }
			remove_character_modifier = spice_withdrawal
		}
		if = {
			limit = { trait = stressed }
			remove_trait = stressed
		}
		add_character_modifier = { name = on_spice duration = 365 }
		if = {
			limit = {
				NOT = { trait = spice_addict }
				trait = confident
			}
			random = {
				chance = 20
				character_event = { id = flavor.5550 tooltip = "EVTTOOLTIPFLAVOR5550" }
			}
		}
		if = {
			limit = {
				NOT = { trait = spice_addict }
				NOT = { trait = confident }
				NOT = { trait = neurotic }
			}
			random = {
				chance = 50
				character_event = { id = flavor.5550 tooltip = "EVTTOOLTIPFLAVOR5550" }
			}
		}
		if = {
			limit = {
				NOT = { trait = spice_addict }
				trait = neurotic
			}
			random = {
				chance = 80
				character_event = { id = flavor.5550 tooltip = "EVTTOOLTIPFLAVOR5550" }
			}
		}
	}
}

# You have become addicted to Spice!
character_event = {
	id = flavor.5550
	desc = "EVTDESCFLAVOR5550"
	picture = GFX_evt_illness
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		if = {
			limit = { trait = former_spice_addict }
			remove_trait = former_spice_addict
		}
		add_trait = spice_addict
		hidden_tooltip = {
			father = { character_event = { id = flavor.5560 } }
			mother = { character_event = { id = flavor.5560 } }
			any_sibling = { character_event = { id = flavor.5560 } }
			any_lover = { character_event = { id = flavor.5560 } }
			any_friend = { character_event = { id = flavor.5560 } }
			any_vassal = { character_event = { id = flavor.5570 } }
			liege = { character_event = { id = flavor.5580 } }
			log = "[Root.GetBestName] is now addicted to Spice."
		}
	}
}

character_event = {
	id = flavor.5560
	desc = "EVTDESCFLAVOR5560"
	picture = GFX_evt_illness
	is_triggered_only = yes
	
	option = { name = "EVTOPTCONFIRM" }
}

character_event = {
	id = flavor.5570
	desc = "EVTDESCFLAVOR5560"
	picture = GFX_evt_scandal
	is_triggered_only = yes
	
	option = { name = "EVTOPTCONFIRM" }
}

character_event = {
	id = flavor.5580
	desc = "EVTDESCFLAVOR5560"
	notification = yes
	is_triggered_only = yes
	
	option = { name = "EVTOPTCONFIRM" }
}

# Spice rehabilitation is hard and painful
character_event = {
	id = flavor.5600
	desc = "EVTDESCFLAVOR5600"
	picture = GFX_evt_illness
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
		wealth = -250
		add_character_modifier = { name = spice_rehab duration = -1 }
		clr_character_flag = flag_entering_rehab
	}
	option = {
		name = "EVTOPTNEVERMIND"
		clr_character_flag = flag_entering_rehab
		ai_chance = { factor = 0 }
	}
}
character_event = {
	id = flavor.5605
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		target = {
			limit = { has_opinion_modifier = { who = ROOT modifier = opinion_asking_for_rehab } }
			character_event = { id = flavor.5606 }
		}
	}
}
character_event = {
	id = flavor.5606
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		remove_trait = target
		remove_opinion = { who = FROM modifier = opinion_asking_for_rehab }
		FROM = { letter_event = { id = 5607 } }
	}
}
letter_event = {
	id = flavor.5607
	desc = "EVTDESCFLAVOR5607"
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTACCEPT"
		clr_character_flag = flag_entering_rehab
		add_character_modifier = { name = spice_rehab duration = -1 }
		prestige = -100
		FROM = {
			opinion = { who = ROOT modifier = opinion_on_rehab_for_me }
			hidden_tooltip = { letter_event = { id = flavor.5608 } }
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 100 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 90 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 80 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 70 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 50 }
				trait = friendly
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 30 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 10 }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -9 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -19 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -29 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -39 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -49 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -59 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -69 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -79 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -89 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -99 } }
			}
			modifier = {
				factor = 0.5
				trait = stressed
			}
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.5
				trait = craven
			}
			modifier = {
				factor = 2
				trait = humble
			}
			modifier = {
				factor = 0.5
				trait = proud
			}
			modifier = {
				factor = 2
				trait = disciplined
			}
			modifier = {
				factor = 0.5
				trait = carefree
			}
			modifier = {
				factor = 2
				trait = friendly
			}
			modifier = {
				factor = 0.5
				trait = cold
			}
		}
	}
	option = {
		name = "EVTOPTREFUSE"
		clr_character_flag = flag_entering_rehab
		FROM = {
			opinion = { who = ROOT modifier = opinion_refused_rehab }
			hidden_tooltip = { letter_event = { id = flavor.5609 } }
		}
		ai_chance = { factor = 50 }
	}
}
letter_event = {
	id = flavor.5608
	desc = "EVTDESCFLAVOR5608"
	is_triggered_only = yes
	
	option = { name = "EVTOPTCONFIRM" }
}
letter_event = {
	id = flavor.5609
	desc = "EVTDESCFLAVOR5609"
	is_triggered_only = yes
	
	option = { name = "EVTOPTCONFIRM" }
}
character_event = {
	id = flavor.5610
	desc = "EVTDESCFLAVOR5610"
	picture = GFX_evt_illness
	
	min_age = 18
	only_capable = yes
	
	trigger = {
		has_character_modifier = spice_rehab
		has_character_modifier = spice_withdrawal
	}
	
	mean_time_to_happen = {
		months = 36
	}
	
	option = {
		trigger = { NOT = { trait = stressed } }
		name = "EVTOPTAFLAVOR5610"
		add_trait = stressed
		prestige = 5
		ai_chance = {
			factor = 75
		}
	}
	option = {
		name = "EVTOPTBFLAVOR5610"
		health = -1
		prestige = 5
		ai_chance = {
			factor = 75
		}
	}
	option = {
		trigger = {
			prisoner = no
			wealth = 50
			location = {
				trade_post_owner = {
					NOT = { character = ROOT }
					NOT = { war_with = ROOT }
					any_trade_post = {
						location = { province_id = PREVPREVPREV }
						has_building = tr_spice_1
					}
				}
			}
		}
		name = "EVTOPTCFLAVOR5610"
		remove_character_modifier = spice_rehab
		location = { trade_post_owner = { character_event = { id = flavor.5510 tooltip = "EVTTOOLTIPFLAVOR5510" } } }
		any_realm_character = {
			limit = { has_opinion_modifier = { who = ROOT modifier = opinion_on_rehab_for_me } }
			remove_opinion = { who = ROOT modifier = opinion_on_rehab_for_me }
			opinion = { who = ROOT modifier = opinion_broke_rehab }
			hidden_tooltip = { character_event = { id = flavor.5615 } }
		}
		any_dynasty_member = {
			limit = {
				has_opinion_modifier = { who = ROOT modifier = opinion_on_rehab_for_me }
				NOT = { same_realm = ROOT }
			}
			remove_opinion = { who = ROOT modifier = opinion_on_rehab_for_me }
			opinion = { who = ROOT modifier = opinion_broke_rehab }
			hidden_tooltip = { character_event = { id = flavor.5615 } }
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = neurotic
			}
			modifier = {
				factor = 2
				trait = carefree
			}
			modifier = {
				factor = 0.5
				trait = confident
			}
			modifier = {
				factor = 0.5
				trait = disciplined
			}
			modifier = {
				factor = 2
				trait = stressed
			}
			modifier = {
				factor = 0.25
				any_realm_character = {
					has_opinion_modifier = { who = ROOT modifier = opinion_on_rehab_for_me }
					reverse_opinion = { who = ROOT value = 0 }
				}
			}
			modifier = {
				factor = 0.25
				any_dynasty_member = {
					has_opinion_modifier = { who = ROOT modifier = opinion_on_rehab_for_me }
					reverse_opinion = { who = ROOT value = 0 }
				}
			}
		}
	}
}
character_event = {
	id = flavor.5615
	desc = "EVTDESCFLAVOR5615"
	picture = GFX_evt_quarrel
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTCONFIRM"
	}
}

# You've completed rehab
character_event = {
	id = flavor.5620
	desc = "EVTDESCFLAVOR5620"
	picture = GFX_evt_illness
	
	min_age = 18
	only_capable = yes
	
	trigger = { has_character_modifier = spice_rehab }
	
	mean_time_to_happen = {
		months = 60
	}
	
	option = {
		name = "EVTOPTCONFIRM"
		remove_character_modifier = spice_rehab
		if = {
			limit = { has_character_modifier = spice_withdrawal }
			remove_character_modifier = spice_withdrawal
		}
		if = {
			limit = { trait = stressed }
			remove_trait = stressed
		}
		remove_trait = spice_addict
		add_trait = former_spice_addict
		hidden_tooltip = {
			father = { character_event = { id = flavor.5630 } }
			mother = { character_event = { id = flavor.5630 } }
			any_sibling = { character_event = { id = flavor.5630 } }
			any_lover = { character_event = { id = flavor.5630 } }
			any_friend = { character_event = { id = flavor.5630 } }
			any_vassal = { character_event = { id = flavor.5630 } }
			liege = { character_event = { id = flavor.5640 } }
			any_realm_character = {
				limit = { has_opinion_modifier = { who = ROOT modifier = opinion_on_rehab_for_me } }
				character_event = { id = flavor.5650 }
			}
			any_dynasty_member = {
				limit = {
					has_opinion_modifier = { who = ROOT modifier = opinion_on_rehab_for_me }
					NOT = { same_realm = ROOT }
				}
				character_event = { id = flavor.5650 }
			}
			log = "[Root.GetBestName] is no longer addicted to Spice."
		}
	}
}
character_event = {
	id = flavor.5650
	desc = "EVTDESCFLAVOR5630"
	picture = GFX_evt_illness
	is_triggered_only = yes
	
	option = { name = "EVTOPTCONFIRM" }
}
character_event = {
	id = flavor.5640
	desc = "EVTDESCFLAVOR5630"
	notification = yes
	is_triggered_only = yes
	
	option = { name = "EVTOPTCONFIRM" }
}
character_event = {
	id = flavor.565
	desc = "EVTDESCFLAVOR5650"
	picture = GFX_evt_illness
	is_triggered_only = yes
	
	option = { name = "EVTOPTCONFIRM" }
}