########################################
# Flavor Events for Wallachia
#
# Scripted by Sara Wendel-rtqvist
########################################

namespace = flavor_wal
normal_or_historical_nations = yes

# Vlad the Impaler!
country_event = {
	id = flavor_wal.1
	title = "flavor_wal.EVTNAME1"
	desc = "flavor_wal.EVTDESC1"
	picture = IMPALED_SOLDIERS_eventPicture
	
	fire_only_once = yes
	
	is_triggered_only = yes # To avoid Vlad trying to usurp his father
	
	trigger = {
		tag = WAL
		NOT = { is_year = 1477 }
	}
	
	option = {
		name = "flavor_wal.EVTOPTA1"
		define_ruler = {
			name = "Vlad Tepes"
			dynasty = "00000000"
			adm = 1
			dip = 0
			mil = 5
			age = 23
		}
		define_ruler_to_general = {
			fire = 3
			shock = 4
			manuever = 4
			siege = 0
		}
		if = {
			limit = {
				has_states_general_mechanic = yes
			}
			change_statists_vs_orangists = 1
		}
		if = {
			limit = {
				has_dlc = "Rights of Man" 
			}
			hidden_effect = { add_ruler_personality = cruel_personality }
		}
		add_adm_power = 50
		TUR = {
			add_opinion = {
				who = ROOT
				modifier = opinion_displeased
				years = 50
			}
		}
	}
	option = {
		name = "flavor_wal.EVTOPTB1"
		ai_chance = {
			factor = 0
		}
		random_owned_province = {
			limit = { is_in_capital_area = yes }
			spawn_rebels = {
				type = pretender_rebels
				size = 1
				culture = romanian
				leader = "Vlad Tepes"
				leader_dynasty = "Draculesti"
			}
		}
		TUR = {
			add_opinion = {
				who = ROOT
				modifier = opinion_good_relations
				years = 50
			}
		}
	}
}

# The Impalement of the Sultan (alt history)
# By Daniel Tolman

country_event = {
	id = flavor_wal.2
	title = "flavor_wal.EVTNAME2"
	desc = {
		trigger = {
			has_regency = no
			TUR = {
				has_regency = no
				has_heir = yes
			}
		}
		desc = "flavor_wal.EVTDESC2"
	}
	desc = {
		trigger = {
			has_regency = no
			TUR = {
				has_regency = no
				has_heir = no
			}
		}
		desc = "flavor_wal.EVTDESC2B"
	}
	desc = {
		trigger = {
			has_regency = yes
			TUR = {
				has_regency = no
				has_heir = yes
			}
		}
		desc = "flavor_wal.EVTDESC2C"
	}
	desc = {
		trigger = {
			has_regency = no
			TUR = {
				has_regency = yes
				has_heir = no
			}
		}
		desc = "flavor_wal.EVTDESC2D"
	}
	desc = {
		trigger = {
			has_regency = no
			TUR = {
				has_regency = yes
				has_heir = yes
			}
		}
		desc = "flavor_wal.EVTDESC2E"
	}
	desc = {
		trigger = {
			has_regency = yes
			TUR = {
				has_regency = yes
				has_heir = yes
			}
		}
		desc = "flavor_wal.EVTDESC2F"
	}
	desc = {
		trigger = {
			has_regency = yes
			TUR = {
				has_regency = no
				has_heir = no
			}
		}
		desc = "flavor_wal.EVTDESC2G"
	}
	desc = {
		trigger = {
			has_regency = yes
			TUR = {
				has_regency = yes
				has_heir = no
			}
		}
		desc = "flavor_wal.EVTDESC2H"
	}
	picture = IMPALED_SOLDIERS_eventPicture
	
	fire_only_once = yes
	
	is_triggered_only = yes
	
	option = {
		name = "flavor_wal.EVTOPTA2"
		TUR = {
			tooltip = {
				if = {
					limit = {
						has_regency = no
					}
					kill_ruler = yes
				}
				if = {
					limit = {
						has_heir = yes
					}
					kill_heir = {}
				}
				if = {
					limit = {
						has_consort = yes
					}
					remove_consort = yes
				}
				capital_scope = {
					add_devastation = 20
				}
				add_opinion = {
					who = ROOT
					modifier = sultan_impaled_opinion
				}
			}
			every_rival_country = {
				limit = {
					NOT = {
						tag = PAP
					}
				}
				add_opinion = {
					who = ROOT
					modifier = impaled_the_sultan_opinion
				}
			}
			hidden_effect = {
				country_event = {
					id = flavor_wal.3
					days = 1
				}
			}
		}
		PAP = {
			add_opinion = {
				who = ROOT
				modifier = impaled_the_sultan_opinion
			}
		}
	}
}

# For Ottomans
country_event = {
	id = flavor_wal.3
	title = "flavor_wal.EVTNAME3"
	desc = "flavor_wal.EVTDESC3"
	picture = IMPALED_SOLDIERS_eventPicture
	
	fire_only_once = yes
	
	is_triggered_only = yes
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "flavor_wal.EVTOPTA3"
		if = {
			limit = {
				has_consort = yes
			}
			remove_consort = yes
		}
		if = {
			limit = {
				has_regency = no
			}
			kill_ruler = yes
		}
		if = {
			limit = {
				has_heir = yes
			}
			kill_heir = { allow_new_heir = no }
		}		
		capital_scope = {
			add_devastation = 20
		}
		add_opinion = {
			who = FROM
			modifier = sultan_impaled_opinion
		}
	}
}
