########################################
# General Flavor Events for Japan and Daimyos
#
# written by Sara Wendel-rtqvist
########################################
# Reworked and given alternative effects for Mandate of Heaven / 1.20 by Drikus Kuiper.
########################################

namespace = flavor_jap
normal_or_historical_nations = yes

# Onin War
country_event = {
	id = flavor_jap.1
	title = "flavor_jap.EVTNAME1"
	desc = "flavor_jap.EVTDESC1"
	picture = BATTLE_eventPicture

	fire_only_once = yes
	
	trigger = {
		has_reform = daimyo
		any_country = {
			offensive_war_with = ROOT
			has_reform = daimyo
			is_in_war = {
				defender_leader = ROOT
				attacker_leader = THIS
			}
		}
	}

	immediate = {
		hidden_effect = {
			save_event_target_as = onin_defensive_war_leader
			random_country = {
				limit = {
					offensive_war_with = ROOT
					has_reform = daimyo
					is_in_war = {
						defender_leader = ROOT
						attacker_leader = THIS
					}
				}
				save_event_target_as = onin_offensive_war_leader
			}
			every_country = {
				limit = {
					NOT = { tag = ROOT }
					OR = {
						has_reform = daimyo
						has_reform = shogunate
					}
				}
				country_event = { id = flavor_jap.56 }
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "flavor_jap.EVTOPTA1"
		custom_tooltip = shogunate_mechanic_explanation
		add_country_modifier = {
			name = jap_sengoku_jidai
			duration = 10950
		}
	}
}

# Onin War
country_event = {
	id = flavor_jap.56
	title = "flavor_jap.EVTNAME1"
	desc = {
	    trigger = { 
	    	any_known_country = {
				defensive_war_with = ROOT
				has_reform = daimyo
				is_in_war = {
					defender_leader = THIS
					attacker_leader = ROOT
				}
			}
	    }
	    desc = "flavor_jap.EVTDESC1B"
	}
	desc = {
	    trigger = { has_reform = daimyo }
	    desc = "flavor_jap.EVTDESC56"
	}
	desc = {
	    trigger = { has_reform = shogunate }
	    desc = "flavor_jap.EVTDESC56B"
	}
	picture = BATTLE_eventPicture

	is_triggered_only = yes
	
	option = {
		name = "flavor_jap.EVTOPTA1"
		trigger = {
			has_reform = daimyo
		}
		custom_tooltip = shogunate_mechanic_explanation
		add_country_modifier = {
			name = jap_sengoku_jidai
			duration = 10950
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB56"
		trigger = {
			has_reform = shogunate
		}
		custom_tooltip = shogunate_mechanic_explanation
		add_country_modifier = {
			name = jap_sengoku_jidai
			duration = 10950
		}
		add_legitimacy = -20
	}
}

# Ikko-ikkis rising!
country_event = {
	id = flavor_jap.2
	title = "flavor_jap.EVTNAME2"
	desc = "flavor_jap.EVTDESC2"
	picture = ANGRY_MOB_eventPicture
	
	trigger = {
		culture_group = japanese_g
		NOT = { has_dlc = "Mandate of Heaven" }
		NOT = { tag = JAP }
		NOT = {
			has_country_modifier = ikko_ikkis_timer
		}
		NOT = { has_spawned_rebels = ikko_ikki_rebels }
		NOT = { stability = 1 }
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	immediate = {
		hidden_effect = {
			add_country_modifier = {
				name = ikko_ikkis_timer
				duration = 730
				hidden = yes
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
				}
				set_province_flag = ikko_ikki_flag1
			}
			if = {
				limit = {
					num_of_cities = 8
				}
				random_owned_province = {
					limit = {
						culture_group = japanese_g
						NOT = { has_province_flag = ikko_ikki_flag1 }
					}
					set_province_flag = ikko_ikki_flag2
				}
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA2"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				is_at_war = yes
			}
			modifier = {
				factor = 1.5
				manpower_percentage = 0.9
			}
		}
		random_owned_province = {
			limit = {
				has_province_flag = ikko_ikki_flag1
			}
			spawn_rebels = {
				type = ikko_ikki_rebels
				size = 1
			}
			clr_province_flag = ikko_ikki_flag1
		}
		random_owned_province = {
			limit = {
				has_province_flag = ikko_ikki_flag2
			}
			spawn_rebels = {
				type = ikko_ikki_rebels
				size = 1
			}
			clr_province_flag = ikko_ikki_flag2
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTB2"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				NOT = { manpower_percentage = 0.33 }
			}
			modifier = {
				factor = 1.5
				NOT = { manpower_percentage = 0.2 }
			}
		}
		random_owned_province = {
			limit = {
				has_province_flag = ikko_ikki_flag1
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
			add_devastation = 5
			clr_province_flag = ikko_ikki_flag1
		}
		random_owned_province = {
			limit = {
				has_province_flag = ikko_ikki_flag2
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
			add_devastation = 5
			clr_province_flag = ikko_ikki_flag2
		}
		add_prestige = -10
	}
}

# Ikko-ikkis spreading!
country_event = {
	id = flavor_jap.3
	title = "flavor_jap.EVTNAME3"
	desc = "flavor_jap.EVTDESC3"
	picture = ANGRY_MOB_eventPicture
	
	trigger = {
		culture_group = japanese_g
		NOT = { has_dlc = "Mandate of Heaven" }
		any_neighbor_country = {
			has_spawned_rebels = ikko_ikki_rebels
		}
		NOT = {
			has_country_modifier = ikko_ikkis_timer
		}
		NOT = { has_spawned_rebels = ikko_ikki_rebels }
		NOT = { stability = 1 }
	}
	
	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 2
			stability = 0
		}
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					culture_group = japanese_g
				}
				set_province_flag = ikko_ikki_flag1
			}
			add_country_modifier = {
				name = ikko_ikkis_timer
				duration = 730
				hidden = yes
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA3"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				is_at_war = yes
			}
			modifier = {
				factor = 1.5
				manpower_percentage = 0.9
			}
		}
		random_owned_province = {
			limit = {
				has_province_flag = ikko_ikki_flag1
			}
			spawn_rebels = {
				type = ikko_ikki_rebels
				size = 1
			}
			clr_province_flag = ikko_ikki_flag1
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB2"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				NOT = { manpower_percentage = 0.33 }
			}
			modifier = {
				factor = 1.5
				NOT = { manpower_percentage = 0.2 }
			}
		}
		random_owned_province = {
			limit = {
				has_province_flag = ikko_ikki_flag1
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
			add_devastation = 5
			clr_province_flag = ikko_ikki_flag1
		}
		add_prestige = -10
	}
}

# Wokou
country_event = {
	id = flavor_jap.4
	title = "flavor_jap.EVTNAME4"
	desc = "flavor_jap.EVTDESC4"
	picture = NAVAL_MILITARY_eventPicture
	
	trigger = {
		culture_group = japanese_g
		NOT = { has_country_flag = jap_wokou }
		NOT = { has_dlc = "Mandate of Heaven" }
		OR = {
			exists = KOR
			exists = MNG
		}
		KOR = {
			is_free_or_tributary_trigger = yes
			NOT = {
				overlord_of = ROOT
			}
			NOT = {
				alliance_with = ROOT
			}
		}
		MNG = {
			is_subject = no
			NOT = {
				overlord_of = ROOT
			}
			NOT = {
				alliance_with = ROOT
			}
		}
		num_of_ports = 1
		NOT = {
			has_country_modifier = jap_wokou
		}
	}
	
	mean_time_to_happen = {
		months = 400
	}

	immediate = {
		hidden_effect = {
			set_country_flag = jap_wokou
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					has_port = yes
				}
				set_province_flag = wokou_event_flag
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					has_port = yes
					NOT = { has_province_flag = wokou_event_flag }
				}
				set_province_flag = wokou_event_flag
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					has_port = yes
					NOT = { has_province_flag = wokou_event_flag }
				}
				set_province_flag = wokou_event_flag
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA4" # Fund the pirates
		add_years_of_income = -0.5
		add_prestige = -15
		add_country_modifier = { 
			name = jap_wokou 
			duration = 7300 
		}
		if = {
			limit = {
				exists = KOR
			}
			KOR = {
				add_opinion = {
					who = ROOT
					modifier = opinion_displeased
				}
			}
		}
		if = {
			limit = { exists = MNG }
			MNG = {
				add_opinion = {
					who = ROOT
					modifier = opinion_displeased
				}
			}
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB4" # Crack down on piracy
		add_prestige = 25
		if = {
			limit = { exists = KOR }
			KOR = {
				add_opinion = {
					who = ROOT
					modifier = opinion_pleased
				}
			}
		}
		if = {
			limit = { exists = MNG }
			MNG = {
				add_opinion = {
					who = ROOT
					modifier = opinion_pleased
				}
			}
		}
		every_owned_province = {
			limit = {
				has_province_flag = wokou_event_flag
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
			clr_province_flag = wokou_event_flag
		}
	}
}

# Question about Sakoku
country_event = {
	id = flavor_jap.5
	title = "flavor_jap.EVTNAME5"
	desc = "flavor_jap.EVTDESC5"
	picture = SHIP_SAILING_eventPicture
	
	trigger = {
		has_country_modifier = sakoku_law
		is_subject = no
		had_country_flag = { 
			flag = sakoku_law
			days = 7300
		}
		NOT = { has_country_flag = jap_sakoku }
		NOT = {
			has_country_modifier = jap_follow_sakoku
		}
		NOT = {
			has_country_modifier = jap_question_sakoku
		}
	}
	
	mean_time_to_happen = {
		months = 600
	}
	
	option = {
		name = "flavor_jap.EVTOPTA5" # Keep following the Sakoku
		ai_chance = {
			factor = 100
		}
		add_country_modifier = {
			name = jap_follow_sakoku
			duration = 3650
		}
		set_country_flag = jap_sakoku
	}
	option = {
		name = "flavor_jap.EVTOPTB5" # Reject Sakoku law
		ai_chance = {
			factor = 0
		}
		add_country_modifier = {
			name = jap_question_sakoku
			duration = 3650
		}
		add_stability = -1
		remove_country_modifier = sakoku_law
		set_country_flag = jap_sakoku
		every_subject_country = {
			limit = {
				has_country_modifier = sakoku_law
			}
			remove_country_modifier = sakoku_law
		}
	}
}

# Rangaku
country_event = {
	id = flavor_jap.6
	title = "flavor_jap.EVTNAME6"
	desc = "flavor_jap.EVTDESC6"
	picture = SHIP_SAILING_eventPicture
	
	trigger = {
		culture_group = japanese_g
		has_country_modifier = sakoku_law
		NOT = { has_dlc = "Mandate of Heaven" }
		has_country_flag = sakoku_law
		has_country_flag = ned_dejima_allowed
		exists = NED
		NOT = { has_country_flag = jap_rangaku }
		NOT = {
			has_ruler_modifier = jap_rangaku
		}
		NOT = {
			has_ruler_modifier = jap_closed
		}
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_jap.EVTOPTA6" # Open our provinces to the Dutch
		add_ruler_modifier = { 
			name = jap_rangaku
		}
		set_country_flag = jap_rangaku
	}
	option = {
		name = "flavor_jap.EVTOPTB6" # Keep our provinces closed
		add_ruler_modifier = { 
			name = jap_closed
		}
		set_country_flag = jap_rangaku
	}
}

# Nanban Boeki
country_event = {
	id = flavor_jap.7
	title = "flavor_jap.EVTNAME7"
	desc = "flavor_jap.EVTDESC7"
	picture = SHIP_SAILING_eventPicture
	
	trigger = {
		NOT = {
			has_dlc = "Mandate of Heaven"
		}
		culture_group = japanese_g
		NOT = { tag = RYU }
		has_global_flag = japan_has_encountered_the_west
		NOT = { has_global_flag = japan_is_closed }
		NOT = { has_institution = global_trade }
		NOT = { has_country_modifier = sakoku_law }
		NOT = { has_country_flag = sakoku_law }
		NOT = { has_country_flag = western_trade_flag }
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_jap.EVTOPTA7" # Welcome the new traders
		add_country_modifier = { 
			name = western_trade 
			duration = -1 
		}
		set_country_flag = western_trade_flag
	}
}

# Western Wrecked Ship (William Adams)
country_event = {
	id = flavor_jap.8
	title = "flavor_jap.EVTNAME8"
	desc = "flavor_jap.EVTDESC8"
	picture = SHIP_SAILING_eventPicture
	
	trigger = {
		culture_group = japanese_g
		OR = {
			has_country_modifier = western_trade
			is_incident_active = incident_nanban
			is_incident_happened = incident_nanban
		}
		had_country_flag = { flag = western_trade_flag days = 90 }
		has_regency = no
		NOT = { has_country_flag = william_adams }
		num_of_ports = 1
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	immediate = {
		set_country_flag = william_adams
	}
	
	option = {
		name = "flavor_jap.EVTOPTA8" # Do nothing
		add_stability_or_adm_power = yes
	}
	option = {
		name = "flavor_jap.EVTOPTB8" # Help the foreign shipwreckers
		add_stability = -1
		add_ruler_modifier = { 
			name = jap_western_wrecked_ship
		}
	}
	option = {
		name = "flavor_jap.EVTOPTC8" # Bring the foreigner to me
		add_prestige = -10
		define_advisor = {
			name = "William Adams"
			culture = english
			religion = protestant
			type = trader
			discount = yes
			skill = 2
		}
	}
}

# Kirishitan
country_event = {
	id = flavor_jap.9
	title = "flavor_jap.EVTNAME9"
	desc = "flavor_jap.EVTDESC9"
	picture = RELIGION_eventPicture
	
	trigger = {
		culture_group = japanese_g
		NOT = { has_dlc = "Mandate of Heaven" }
		NOT = { religion = catholic }
		any_owned_province = {
			culture_group = japanese_g
			religion = catholic
			can_spawn_rebels = catholic_rebels
		}
		has_country_flag = western_trade_flag
	}
	
	mean_time_to_happen = {
		months = 300
	}
	
	immediate = {
		hidden_effect = {
			if = {
				limit = { NOT = { has_country_flag = kirishitan_have_appeared } }
				set_country_flag = kirishitan_have_appeared
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					religion = catholic
					can_spawn_rebels = catholic_rebels
				}
				set_province_flag = jap_kirishitan_flag
			}
			if = {
				limit = {
					num_of_cities = 8
				}
				random_owned_province = {
					limit = {
						culture_group = japanese_g
						religion = catholic
						can_spawn_rebels = catholic_rebels
						NOT = { has_province_flag = jap_kirishitan_flag }
					}
					set_province_flag = jap_kirishitan_flag
				}
			}
			if = {
				limit = {
					num_of_cities = 15
				}
				random_owned_province = {
					limit = {
						culture_group = japanese_g
						religion = catholic
						can_spawn_rebels = catholic_rebels
						NOT = { has_province_flag = jap_kirishitan_flag }
					}
					set_province_flag = jap_kirishitan_flag
				}
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA9" # Stop the missionaries!
		every_owned_province = {
			limit = {
				has_province_flag = jap_kirishitan_flag
			}
			spawn_rebels = { 
				type = catholic_rebels 
				size = 2 
			}
			clr_province_flag = jap_kirishitan_flag
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB9" # Let them spread their faith
		add_prestige = -25
		add_stability = -1
		every_owned_province = {
			limit = {
				has_province_flag = jap_kirishitan_flag
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
			clr_province_flag = jap_kirishitan_flag
		}
	}
}

# Attempted Coup!
country_event = {
	id = flavor_jap.10
	title = "flavor_jap.EVTNAME10"
	desc = "flavor_jap.EVTDESC10"
	picture = ASSASSINATION_eventPicture

	is_triggered_only = yes
	
	trigger = {
		culture_group = japanese_g
		OR = {
			has_reform = daimyo
			has_reform = indep_daimyo
		}
		num_of_owned_provinces_with = {
			value = 5
			culture_group = japanese_g
		}
		has_leaders = {
			value = 1
			type = general
			include_monarch = no
			include_heir = no
		}
	}
	
	mean_time_to_happen = {
		days = 1
		modifier = {
			factor = 2
			NOT = { stability = 1 }
		}
	}
	
	option = { # There shall be no mercy for this dishonorable act!
		name = "flavor_jap.EVTOPTA10"
		add_prestige = 10
		kill_leader = {
			type = general
		}
	}
}

# Jokamachi or Castle towns
country_event = {
	id = flavor_jap.11
	title = "flavor_jap.EVTNAME11"
	desc = "flavor_jap.EVTDESC11"
	picture = CITY_DEVELOPMENT_eventPicture
	
	trigger = {
		NOT = { has_dlc = "Mandate of Heaven" }
		NOT = { has_country_flag = jap_jokamachi_flag }
		culture_group = japanese_g
		MIL = 4
		any_owned_province = {
			NOT = { has_province_modifier = japanese_jokamachi }
		}
	}
	
	mean_time_to_happen = {
		months = 600
		modifier = {
			factor = 0.5
			any_neighbor_country = {
				any_owned_province = {
					has_province_modifier = japanese_jokamachi
				}
			}
		}
	}
	
	immediate = {
		hidden_effect = {
			set_country_flag = jap_jokamachi_flag
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA11" # Fund Jokamachi
		ai_chance = { factor = 80 }
		random_owned_province = {
			limit = {
				is_capital = yes
				NOT = { has_province_modifier = japanese_jokamachi }
			}
			add_province_modifier = {
				name = "japanese_jokamachi"
				duration = -1
			}
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB11" # Don't fund Jokamachi
		ai_chance = { factor = 20 }
		add_mil_power = 100
	}
}

# Rise of urban culture
country_event = {
	id = flavor_jap.12
	title = "flavor_jap.EVTNAME12"
	desc = "flavor_jap.EVTDESC12"
	picture = THEATRE_eventPicture
	
	trigger = {
		culture_group = japanese_g
		dip = 4
		has_regency = no
		NOT = {
			has_country_modifier = jap_culture
			has_country_flag = jap_culture_flag
		}
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 400
	}
	
	option = {
		name = "flavor_jap.EVTOPTA12"
		add_years_of_income = -0.5
		add_country_modifier = { 
			name = jap_culture
			duration = 7300
		}
		hidden_effect = {
			set_country_flag = jap_culture_flag
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB12"
		add_prestige = -10
		hidden_effect = {
			set_country_flag = jap_culture_flag
		}
	}
}

# Terakoya
country_event = {
	id = flavor_jap.13
	title = "flavor_jap.EVTNAME13"
	desc = "flavor_jap.EVTDESC13"
	picture = UNIVERSITY_eventPicture
	
	trigger = {
		culture_group = japanese_g
		has_country_flag = jap_genroku
		has_regency = no
		NOT = {
			has_country_modifier = jap_terakoya
			has_country_flag = jap_terakoya_country_flag
		}
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 400
		modifier = {
			factor = 0.5
			stability = 1
		}
	}
	
	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					culture_group = japanese_g
				}
				set_province_flag = jap_terakoya_flag1
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					NOT = {
						has_province_flag = jap_terakoya_flag1
					}
				}
				set_province_flag = jap_terakoya_flag2
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA13" # Establish Terakoya
		add_years_of_income = -0.5
		add_country_modifier = {
			name = jap_terakoya
			duration = 7300
		}
		hidden_effect = {
			random_owned_province = {
				limit = {
					has_province_flag = jap_terakoya_flag1
				}
				clr_province_flag = jap_terakoya_flag1
			}
			random_owned_province = {
				limit = {
					has_province_flag = jap_terakoya_flag2
				}
				clr_province_flag = jap_terakoya_flag2
			}
			set_country_flag = jap_terakoya_country_flag
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB13"
		random_owned_province = {
			limit = {
				has_province_flag = jap_terakoya_flag1
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
			clr_province_flag = jap_terakoya_flag1
		}
		random_owned_province = {
			limit = {
				has_province_flag = jap_terakoya_flag2
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
			clr_province_flag = jap_terakoya_flag2
		}
			set_country_flag = jap_terakoya_country_flag
	}
}

# Military Developments
country_event = {
	id = flavor_jap.14
	title = "flavor_jap.EVTNAME14"
	desc = "flavor_jap.EVTDESC14"
	picture = LAND_MILITARY_eventPicture
	
	trigger = {
		culture_group = japanese_g
		adm = 4
		has_regency = no
		NOT = {
			has_country_flag = jap_military_developments
		}
		has_country_modifier = western_trade
	}
	
	mean_time_to_happen = {
		months = 200
	}

	immediate = {
		set_country_flag = jap_military_developments
	}
	
	option = {
		name = "flavor_jap.EVTOPTA14"
		add_years_of_income = -0.5
		add_country_modifier = {
			name = jap_military_developments
			duration = 7300
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB14"
		add_prestige = 25
	}
}

# Allow organisation of Za
country_event = {
	id = flavor_jap.15
	title = "flavor_jap.EVTNAME15"
	desc = "flavor_jap.EVTDESC15"
	picture = MERCHANTS_TALKING_eventPicture
	
	trigger = {
		culture_group = japanese_g
		NOT = { has_dlc = "Mandate of Heaven" }
		NOT = { has_country_flag = had_organization_of_za }
		OR = {
			mercantilism = 15
			trade_efficiency = 0.2
		}
		NOT = {
			has_country_modifier = jap_za
		}
	}
	
	immediate = {
		set_country_flag = had_organization_of_za
	}
	
	mean_time_to_happen = {
		months = 400
		modifier = {
			factor = 0.5
			mercantilism = 20
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA15" # Allow organization of za
		add_country_modifier = { 
			name = jap_za
			duration = -1
		}
		set_country_flag = jap_za_flag
	}
	option = {
		name = "flavor_jap.EVTOPTB15" # Disallow it
		add_mercantilism = 3

	}
}

# Free trade (Rakuichi, elimination of za)
country_event = {
	id = flavor_jap.16
	title = "flavor_jap.EVTNAME16"
	desc = "flavor_jap.EVTDESC16"
	picture = MERCHANTS_TALKING_eventPicture
	
	trigger = {
		culture_group = japanese_g
		has_country_modifier = jap_za
		had_country_flag = { flag = jap_za_flag days = 1825 }
	}
	
	mean_time_to_happen = {
		months = 600
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					has_port = yes
				}
				set_province_flag = jap_monopolistic_za_province
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					has_port = yes
					NOT = { has_province_flag = jap_monopolistic_za_province }
				}
				set_province_flag = jap_monopolistic_za_province
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					has_port = yes
					NOT = { has_province_flag = jap_monopolistic_za_province }
				}
				set_province_flag = jap_monopolistic_za_province
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					has_port = yes
					NOT = { has_province_flag = jap_monopolistic_za_province }
				}
				set_province_flag = jap_monopolistic_za_province
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					has_port = yes
					NOT = { has_province_flag = jap_monopolistic_za_province }
				}
				set_province_flag = jap_monopolistic_za_province
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA16" # Declare Free Trade
		remove_country_modifier = jap_za
		add_mercantilism = 2
	}
	option = {
		name = "flavor_jap.EVTOPTB16" # Keep it as it is
		remove_country_modifier = jap_za
		add_country_modifier = { 
			name = jap_za_monopoly 
			duration = -1
		}
		every_owned_province = {
			limit = {
				has_province_flag = jap_monopolistic_za_province
			}
			add_province_modifier = {
				name = jap_za_monopoly_province
				duration = -1
			}
			clr_province_flag = jap_monopolistic_za_province
		}
	}
}

# Higashiyama culture
country_event = {
	id = flavor_jap.17
	title = "flavor_jap.EVTNAME17"
	desc = "flavor_jap.EVTDESC17"
	picture = THEATRE_eventPicture
	
	trigger = {
		culture_group = japanese_g
		OR = {
			adm = 4
			dip = 4
		}
		NOT = {
			has_country_flag = jap_higashiyama_culture_flag
		}
	}
	
	mean_time_to_happen = {
		months = 600
	}
	
	option = {
		name = "flavor_jap.EVTOPTA17" # Encourage
		add_years_of_income = -0.5
		add_country_modifier = { 
			name = jap_higashiyama_culture
			duration = 3650
		}
		set_country_flag = jap_higashiyama_culture_flag
		if = {
			limit = {
				adm = 4
				NOT = {
					dip = 4
				}
			}
			add_adm_power = -30
		}
		if = {
			limit = {
				dip = 4
				NOT = {
					adm = 4
				}
			}
			add_dip_power = -30
		}
		if = {
			limit = {
				dip = 4
				adm = 4
			}
			add_mil_power = -30
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB17"
		add_prestige = -5
		set_country_flag = jap_higashiyama_culture_flag
	}
}

# Build Ginkakuji (Silver Pavillion)
country_event = {
	id = flavor_jap.18
	title = "flavor_jap.EVTNAME18"
	desc = "flavor_jap.EVTDESC18"
	picture = IMPORTANT_STATUE_eventPicture
	
	trigger = {
		culture_group = japanese_g
		any_owned_province = {
			NOT = { has_building = temple }
			NOT = { has_building = cathedral }
			num_free_building_slots = 1
			region = japan_region
		}
		NOT = { has_country_flag = jap_ginkakuji }
		has_country_flag = jap_higashiyama_culture_flag
	}
	
	mean_time_to_happen = {
		months = 300
	}
	
	option = {
		name = "flavor_jap.EVTOPTA18"
		add_treasury = -30
		random_owned_province = {
			limit = {
				num_free_building_slots = 1
				NOT = { has_building = temple }
				NOT = { has_building = cathedral }
				region = japan_region
			}
			add_building = temple
		}
		set_country_flag = jap_ginkakuji
	}
	option = {
		name = "flavor_jap.EVTOPTB18"
		add_prestige = 5
		set_country_flag = jap_ginkakuji
	}
}

# Sekisho
country_event = {
	id = flavor_jap.19
	title = "flavor_jap.EVTNAME19"
	desc = "flavor_jap.EVTDESC19"
	picture = ANGRY_MOB_eventPicture
	
	trigger = {
		culture_group = japanese_g
		has_regency = no
		NOT = {
			has_country_modifier = jap_sekisho
			has_country_flag = jap_sekisho
		}
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 600
		modifier = {
			factor = 0.8
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.8
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.8
			NOT = { stability = -2 }
		}
	}

	immediate = {
		random_owned_province = {
			limit = {
				culture_group = japanese_g
			}
			set_province_flag = jap_sekisho
		}
		random_owned_province = {
			limit = {
				culture_group = japanese_g
				NOT = { has_province_flag = jap_sekisho }
			}
			set_province_flag = jap_sekisho
		}
		random_owned_province = {
			limit = {
				culture_group = japanese_g
				NOT = { has_province_flag = jap_sekisho }
			}
			set_province_flag = jap_sekisho
		}
		hidden_effect = {
			set_country_flag = jap_sekisho
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA19"
		add_years_of_income = -1
		add_country_modifier = { 
			name = jap_sekisho
			duration = 7300
		}
		hidden_effect = {
			every_owned_province = {
				limit = {
					has_province_flag = jap_sekisho
				}
				clr_province_flag = jap_sekisho
			}
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB19"
		every_owned_province = {
			limit = {
				has_province_flag = jap_sekisho
			}
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
			clr_province_flag = jap_sekisho
		}
	}
}

# Buke Shohatto
country_event = {
	id = flavor_jap.20
	title = "flavor_jap.EVTNAME20"
	desc = "flavor_jap.EVTDESC20"
	picture = REFORM_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		culture_group = japanese_g
		OR = {
			tag = JAP
			has_reform = shogunate
		}
		any_known_country = {
			vassal_of = ROOT
			has_reform = daimyo
			NOT = {
				has_country_modifier = jap_buke_shohatto
			}
		}
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 400
	}
	
	option = {
		name = "flavor_jap.EVTOPTA20" # Implement Buke Shohatto for the whole of Japan
		add_years_of_income = -0.5
		add_country_modifier = {
			name = jap_buke_shohatto
			duration = 7300
		}
		hidden_effect = {
			every_known_country = {
				limit = {
					vassal_of = ROOT
					has_reform = daimyo
					culture_group = japanese_g
				}
				country_event = {
					id = flavor_jap.21
				}
			}
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB20"
		add_prestige = -10
	}
}

# Daimyo: Buke Shohatto 
country_event = {
	id = flavor_jap.21
	title = "flavor_jap.EVTNAME20"
	desc = "flavor_jap.EVTDESC21"
	picture = REFORM_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "flavor_jap.EVTOPTA21"
		add_prestige = -10
		add_country_modifier = {
			name = jap_buke_shohatto
			duration = 7300
		}
		add_opinion = {
			who = FROM
			modifier = opinion_mildly_displeased
		}
	}
}

# Gokaido
country_event = {
	id = flavor_jap.22
	title = "flavor_jap.EVTNAME22"
	desc = "flavor_jap.EVTDESC22"
	picture = REFORM_eventPicture
	
	trigger = {
		culture_group = japanese_g
		OR = {
			tag = JAP
			has_reform = shogunate
		}
		NOT = {
			has_country_modifier = jap_gokaido
			has_country_flag = jap_gokaido
		}
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 400
	}

	immediate = {
		hidden_effect = {
			set_country_flag = jap_gokaido
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA22" # Establish the Gokaido
		add_years_of_income = -0.5
		add_country_modifier = { 
			name = jap_gokaido 
			duration = 3650 
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB22"
		add_prestige = -5
	}
}

# Kyoho Reforms
country_event = {
	id = flavor_jap.23
	title = "flavor_jap.EVTNAME23"
	desc = "flavor_jap.EVTDESC23"
	picture = REFORM_eventPicture
	
	trigger = {
		culture_group = japanese_g
		OR = {
			has_country_flag = jap_confucian_influence
			is_incident_happened = incident_neo_confucianism
		}
		current_age = age_of_revolutions
		has_regency = no
		NOT = {
			has_ruler_modifier = jap_trade_reform
		}
		NOT = {
			has_ruler_modifier = jap_military_reform
		}
		NOT = {
			has_ruler_modifier = jap_economic_reform
		}
		NOT = {
			has_country_flag = jap_kyoho_reforms
		}
	}
	
	mean_time_to_happen = {
		months = 400
		modifier = {
			factor = 0.9
			stability = 1
		}
		modifier = {
			factor = 0.9
			stability = 2
		}
		modifier = {
			factor = 0.9
			stability = 3
		}
	}

	immediate = {
		set_country_flag = jap_kyoho_reforms
	}
	
	option = {
		name = "flavor_jap.EVTOPTA23" # Reform the Trade
		add_mercantilism = 5
		add_ruler_modifier = { 
			name = jap_trade_reform
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB23" # Reform the Military
		add_army_tradition = 20
		add_navy_tradition = 20
		add_ruler_modifier = { 
			name = jap_military_reform
		}
	}
	option = {
		name = "flavor_jap.EVTOPTC23" # Reform the Economy
		random_owned_province = {
			limit = {
				is_capital = yes
			}
			add_base_tax = 2
		}
		add_ruler_modifier = { 
			name = jap_economic_reform
		}
	}
}

# Genroku-era culture
country_event = {
	id = flavor_jap.24
	title = "flavor_jap.EVTNAME24"
	desc = "flavor_jap.EVTDESC24"
	picture = COURT_eventPicture
	
	trigger = {
		culture_group = japanese_g
		OR = {
			tag = JAP
			has_reform = shogunate
		}
		has_country_flag = jap_higashiyama_culture_flag
		NOT = {
			has_country_modifier = jap_genroku
			has_country_flag = jap_genroku
		}
		NOT = {
			num_of_loans = 1
		}
		stability = 1
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 800
	}
	
	option = {
		name = "flavor_jap.EVTOPTA24" # Start the era of Genroku!
		add_stability_or_adm_power = yes
		add_country_modifier = { 
			name = jap_genroku
			duration = 7300
		}
		set_country_flag = jap_genroku
	}
}

# Confucianism
country_event = {
	id = flavor_jap.25
	title = "flavor_jap.EVTNAME25"
	desc = "flavor_jap.EVTDESC25"
	picture = RELIGION_eventPicture
	
	trigger = {
		culture_group = japanese_g
		NOT = { has_country_flag = jap_confucian_influence }
		NOT = { has_dlc = "Mandate of Heaven" }
	}
	
	mean_time_to_happen = {
		months = 400
		modifier = {
			factor = 0.75
			stability = 2
		}
	}

	immediate = {
		hidden_effect = {
			random_list = {
				10 = {
					set_country_flag = confucian_advisor_artist
				}
				10 = {
					set_country_flag = confucian_advisor_mint
				}
				10 = {
					set_country_flag = confucian_advisor_scientist
				}
				10 = {
					set_country_flag = confucian_advisor_philosopher
				}
				10 = {
					set_country_flag = confucian_advisor_treasurer
				}
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA25"
		set_country_flag = jap_confucian_influence
		if = {
			limit = {
				monthly_income = 25
			}
			trigger_switch = {
				on_trigger = has_country_flag
				confucian_advisor_artist = {
					define_advisor = {
						type = artist
						skill = 3
						religion = confucianism
						discount = yes
					}
					clr_country_flag = confucian_advisor_artist
				}
				confucian_advisor_mint = {
					define_advisor = {
						type = master_of_mint
						skill = 3
						religion = confucianism
						discount = yes
					}
					clr_country_flag = confucian_advisor_mint
				}
				confucian_advisor_scientist = {
					define_advisor = {
						type = natural_scientist
						religion = confucianism
						skill = 3
						discount = yes
					}
					clr_country_flag = confucian_advisor_scientist
				}
				confucian_advisor_philosopher = {
					define_advisor = {
						type = philosopher
						religion = confucianism
						skill = 3
						discount = yes
					}
					clr_country_flag = confucian_advisor_philosopher
				}
				confucian_advisor_treasurer = {
					define_advisor = {
						type = treasurer
						religion = confucianism
						skill = 3
						discount = yes
					}
					clr_country_flag = confucian_advisor_treasurer
				}
			}
		}
		if = {
			limit = {
				NOT = { monthly_income = 25 }
			}
			trigger_switch = {
				on_trigger = has_country_flag
				confucian_advisor_artist = {
					define_advisor = {
						type = artist
						religion = confucianism
						skill = 2
						discount = yes
					}
					clr_country_flag = confucian_advisor_artist
				}
				confucian_advisor_mint = {
					define_advisor = {
						type = master_of_mint
						religion = confucianism
						skill = 2
						discount = yes
					}
					clr_country_flag = confucian_advisor_mint
				}
				confucian_advisor_scientist = {
					define_advisor = {
						type = natural_scientist
						religion = confucianism
						skill = 2
						discount = yes
					}
					clr_country_flag = confucian_advisor_scientist
				}
				confucian_advisor_philosopher = {
					define_advisor = {
						type = philosopher
						religion = confucianism
						skill = 2
						discount = yes
					}
					clr_country_flag = confucian_advisor_philosopher
				}
				confucian_advisor_treasurer = {
					define_advisor = {
						type = treasurer
						religion = confucianism
						skill = 2
						discount = yes
					}
					clr_country_flag = confucian_advisor_treasurer
				}
			}
		}
	}
}

# Confucian ideas on the rise
country_event = {
	id = flavor_jap.26
	title = "flavor_jap.EVTNAME26"
	desc = "flavor_jap.EVTDESC26"
	picture = RELIGION_eventPicture

	trigger = {
		culture_group = japanese_g
		has_country_flag = jap_confucian_influence
	}
	
	mean_time_to_happen = {
		months = 800
		modifier = {
			factor = 0.75
			stability = 2
		}
	}

	immediate = {
		hidden_effect = {
			random_list = {
				10 = {
					set_country_flag = confucian_advisor_artist
				}
				10 = {
					set_country_flag = confucian_advisor_mint
				}
				10 = {
					set_country_flag = confucian_advisor_scientist
				}
				10 = {
					set_country_flag = confucian_advisor_philosopher
				}
				10 = {
					set_country_flag = confucian_advisor_treasurer
				}
			}
		}
	}

	option = {
		name = "flavor_jap.EVTOPTA25"
		if = {
			limit = {
				monthly_income = 25
			}
			trigger_switch = {
				on_trigger = has_country_flag
				confucian_advisor_artist = {
					define_advisor = {
						type = artist
						skill = 3
						religion = confucianism
						discount = yes
					}
					clr_country_flag = confucian_advisor_artist
				}
				confucian_advisor_mint = {
					define_advisor = {
						type = master_of_mint
						religion = confucianism
						skill = 3
						discount = yes
					}
					clr_country_flag = confucian_advisor_mint
				}
				confucian_advisor_scientist = {
					define_advisor = {
						type = natural_scientist
						religion = confucianism
						skill = 3
						discount = yes
					}
					clr_country_flag = confucian_advisor_scientist
				}
				confucian_advisor_philosopher = {
					define_advisor = {
						type = philosopher
						religion = confucianism
						skill = 3
						discount = yes
					}
					clr_country_flag = confucian_advisor_philosopher
				}
				confucian_advisor_treasurer = {
					define_advisor = {
						type = treasurer
						religion = confucianism
						skill = 3
						discount = yes
					}
					clr_country_flag = confucian_advisor_treasurer
				}
			}
		}
		if = {
			limit = {
				NOT = { monthly_income = 25 }
			}
			trigger_switch = {
				on_trigger = has_country_flag
				confucian_advisor_artist = {
					define_advisor = {
						type = artist
						skill = 2
						religion = confucianism
						discount = yes
					}
					clr_country_flag = confucian_advisor_artist
				}
				confucian_advisor_mint = {
					define_advisor = {
						type = master_of_mint
						religion = confucianism
						skill = 2
						discount = yes
					}
					clr_country_flag = confucian_advisor_mint
				}
				confucian_advisor_scientist = {
					define_advisor = {
						type = natural_scientist
						skill = 2
						religion = confucianism
						discount = yes
					}
					clr_country_flag = confucian_advisor_scientist
				}
				confucian_advisor_philosopher = {
					define_advisor = {
						type = philosopher
						religion = confucianism
						skill = 2
						discount = yes
					}
					clr_country_flag = confucian_advisor_philosopher
				}
				confucian_advisor_treasurer = {
					define_advisor = {
						type = treasurer
						religion = confucianism
						skill = 2
						discount = yes
					}
					clr_country_flag = confucian_advisor_treasurer
				}
			}
		}
	}
}

# Kokugaku
country_event = {
	id = flavor_jap.27
	title = "flavor_jap.EVTNAME27"
	desc = "flavor_jap.EVTDESC27"
	picture = COURT_eventPicture
	
	trigger = {
		culture_group = japanese_g
		has_country_flag = jap_confucian_influence
		NOT = {
			has_country_modifier = jap_kokugaku
		}
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 400
	}
	
	option = {
		name = "flavor_jap.EVTOPTA27"
		add_country_modifier = { 
			name = jap_kokugaku 
			duration = -1 
		} 
	}
}

# Oie Sodo
country_event = {
	id = flavor_jap.28
	title = "flavor_jap.EVTNAME28"
	desc = "flavor_jap.EVTDESC28"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		NOT = { has_country_flag = jap_oie_sodo }
		culture_group = japanese_g
		is_lesser_in_union = no
		has_heir = yes
		heir_age = 15
		has_regency = no
		NOT = {
			prestige = 40
		}
		NOT = {
			legitimacy = 50
		}
		current_age = age_of_absolutism
	}
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			set_country_flag = jap_oie_sodo
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA28" # Follow the noble's advice
		kill_heir = {}
		add_legitimacy = 20
	}
	option = {
		name = "flavor_jap.EVTOPTB28" # Refuse to comply to their demands
		add_legitimacy = -10
		random_owned_province = {
			limit = {
				culture_group = japanese_g
			}
			spawn_rebels = {
				type = noble_rebels
				size = 2
			}
		}
	}
}

# Sankin Kotai
country_event = {
	id = flavor_jap.29
	title = "flavor_jap.EVTNAME29"
	desc = "flavor_jap.EVTDESC29"
	picture = COURT_eventPicture
	
	trigger = {
		NOT = { has_dlc = "Mandate of Heaven" }
		culture_group = japanese_g
		OR = {
			has_reform = shogunate
			tag = JAP
		}
		any_known_country = {
			vassal_of = ROOT
			culture_group = japanese_g
			NOT = {
				has_country_modifier = sankin_kotai_daimyo
			}
		}
		NOT = { has_country_flag = jap_sankin_kotai }
		has_country_flag = jap_genroku
		OR = {
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 400
	}

	immediate = {
		hidden_effect = {
			set_country_flag = jap_sankin_kotai
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA29"
		random_owned_province = {
			limit = {
				is_capital = yes
			}
			add_base_tax = 2
		}
		add_country_modifier = { 
			name = sankin_kotai_modifier
			duration = 3650 
		}
		custom_tooltip = "sankin_kotai_TT_A"
		hidden_effect = {
			every_known_country = {
				limit = {
					vassal_of = ROOT
					culture_group = japanese_g
				}
				country_event = {
					id = flavor_jap.30
				}
			}
		}
	}
	option = {
		name = "flavor_jap.EVTOPTB29"
		add_prestige = -5
		custom_tooltip = "sankin_kotai_TT_B"
		hidden_effect = {
			every_known_country = {
				limit = {
					vassal_of = ROOT
					culture_group = japanese_g
				}
				add_opinion = {
					who = ROOT
					modifier = opinion_pleased
				}
			}
		}
	}
}

# Daimyo: Sankin Kotai
country_event = {
	id = flavor_jap.30
	title = "flavor_jap.EVTNAME29"
	desc = "flavor_jap.EVTDESC30"
	picture = COURT_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "flavor_jap.EVTOPTA30"
		add_country_modifier = { 
			name = sankin_kotai_daimyo
			duration = 3650 
		}
		add_opinion = {
			who = FROM
			modifier = opinion_mildly_displeased
		}
	}
}

### From JapanEvents and ShogunEvents ###

# Unruly Samurai
country_event = {
	id = flavor_jap.31
	title = "flavor_jap.EVTNAME31"
	desc = "flavor_jap.EVTDESC31"
	picture = BATTLE_eventPicture
	
	trigger = {
		culture_group = japanese_g
		is_at_war = no
	}
	
	mean_time_to_happen = {
		months = 500
		modifier = {
			factor = 0.8
			NOT = {
				stability = -1
			}
		}
		modifier = {
			factor = 0.8
			NOT = {
				stability = -2
			}
		}
		modifier = {
			factor = 1.5
			stability = 0
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA31"
		add_country_modifier = {
			name = jap_unruly_samurai
			duration = 3650
		}
		add_army_tradition = 10
	}
	
	option = {
		name = "flavor_jap.EVTOPTB31"
		add_army_tradition = -10
		add_prestige = 10
	}
}

# Sword Hunt - episode 1: The Bad Hunt(er)
country_event = {
	id = flavor_jap.32
	title = "flavor_jap.EVTNAME32"
	desc = "flavor_jap.EVTDESC32"
	picture = ANGRY_MOB_eventPicture
	
	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
		has_country_modifier = sword_hunter
		NOT = { has_country_flag = sword_hunter_flag }
		OR = {
			legitimacy = 75
			prestige = 75
			stability = 2
		}
	}
	
	mean_time_to_happen = {	
		months = 1
	}
	
	immediate = { set_country_flag = sword_hunter_flag }
	
	option = {
		name = "flavor_jap.EVTOPTA32"
		random_owned_province = {
			limit = {
				culture_group = japanese_g
			}
			spawn_rebels = {
				type = anti_tax_rebels
				size = 2
			}
		}
	}
}

#  Sword Hunt - episode 2: Captured Prey
country_event = {
	id = flavor_jap.33
	title = "flavor_jap.EVTNAME33"
	desc = "flavor_jap.EVTDESC33"
	picture = ANGRY_MOB_eventPicture
	
	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
		has_country_modifier = sword_hunter
		NOT = { has_country_flag = sword_hunter_flag }
	}
	mean_time_to_happen = {	
		months = 10
	}
	
	immediate = { set_country_flag = sword_hunter_flag }
	
	option = {
		name = "flavor_jap.EVTOPTA33"
		add_prestige = 25
	}
}

# Sword Hunt - episode 3: Disrupted Hunt
country_event = {
	id = flavor_jap.34
	title = "flavor_jap.EVTNAME34"
	desc = "flavor_jap.EVTDESC34"
	picture = ANGRY_MOB_eventPicture
	
	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
		has_country_flag = sword_hunter_flag
	}
	
	mean_time_to_happen = {
		months = 10
	}
	
	option = {
		name = "flavor_jap.EVTOPTA34"
		add_stability = -1
		remove_country_modifier = sword_hunter
		clr_country_flag = sword_hunter_flag
	}
}

# Province converts to Catholicism
province_event = {
	id = flavor_jap.35
	title = "flavor_jap.EVTNAME35"
	desc = "flavor_jap.EVTDESC35"
	picture = RELIGION_eventPicture

	trigger = {
		NOT = { has_dlc = "Mandate of Heaven" }
		owner = {
			culture_group = japanese_g
			has_country_modifier = western_trade
		}
		is_reformation_center = no
		NOT = { religion = catholic }
	}

	is_mtth_scaled_to_size = 1

	mean_time_to_happen = {
		months = 400
		modifier = {
			factor = 2
			is_capital = yes
		}
		modifier = {
			factor = 0.8
			any_neighbor_province = {
				religion = catholic
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA35"
		change_religion = catholic
	}
}

# Ninja strike
country_event = {
	id = flavor_jap.36
	title = "flavor_jap.EVTNAME36"
	desc = "flavor_jap.EVTDESC36"
	picture = ASSASSINATION_eventPicture
	
	trigger = {
		has_reform = daimyo
		has_country_modifier = ninjas
		culture_group = japanese_g
		any_neighbor_country = {
			has_country_modifier = ninjas
		}
	}
	
	mean_time_to_happen = {
		months = 36
	}
	
	option = {
		name = "flavor_jap.EVTOPTA36"
		add_years_of_income = -0.3
		every_neighbor_country = {
			limit = { has_country_modifier = ninjas	}
			add_opinion = { who = ROOT modifier = opinion_ninja_attack }
		}
		random_list = {
			50 = { 
				add_prestige = 10
				every_neighbor_country = {
					limit = { has_country_modifier = ninjas	}
					country_event = { id = flavor_jap.37 } 
				}
			}
			50 = { 
				add_prestige = -10
				every_neighbor_country = {
					limit = { has_country_modifier = ninjas	}
					country_event = { id = flavor_jap.38 } 
				} 
			}
		}
		
	}
	option = {
		name = "flavor_jap.EVTOPTB36"
		add_prestige = -5
		every_neighbor_country = {
			limit = { has_country_modifier = ninjas	}
			add_opinion = { who = ROOT modifier = opinion_grateful }
		}
	}
}

# Ninja strike succeeds
country_event = {
	id = flavor_jap.37
	title = "flavor_jap.EVTNAME36"
	desc = "flavor_jap.EVTDESC37"
	picture = ASSASSINATION_eventPicture
	
	is_triggered_only = yes

	option = {
		name = "flavor_jap.EVTOPTA37"
		remove_country_modifier = ninjas
		add_opinion = { who = FROM modifier = opinion_ninja_attack }
		add_casus_belli = {
			target = FROM
			type = cb_spy_discovered
			months = 12
		}
	}
}

# Ninja strike fails
country_event = {
	id = flavor_jap.38
	title = "flavor_jap.EVTNAME36"
	desc = "flavor_jap.EVTDESC38"
	picture = ASSASSINATION_eventPicture
	
	is_triggered_only = yes

	option = {
		name = "flavor_jap.EVTOPTA38"
		add_prestige = 20
		add_opinion = { who = FROM modifier = opinion_irritated }
		add_casus_belli = {
			target = FROM
			type = cb_spy_discovered
			months = 12
		}
	}
}

# Way of the Tea
country_event = {
	id = flavor_jap.39
	title = "flavor_jap.EVTNAME39"
	desc = "flavor_jap.EVTDESC39"
	picture = COURT_eventPicture
	
	trigger = {
		culture_group = japanese_g
		has_country_modifier = "way_of_tea" 
		NOT = { has_country_flag = new_tea_province }
		NOT = { has_country_flag = rejected_tea_province }
	}

	mean_time_to_happen = {
		months = 1
	}
	
	option = {
		name = "flavor_jap.EVTOPTA39"
		ai_chance = { factor = 100 }
		random_owned_province = {
			limit = {
				is_core = ROOT
				NOT = { trade_goods = gold }
				NOT = { trade_goods = copper }
				NOT = { trade_goods = iron }
				NOT = { trade_goods = chinaware }
				NOT = { trade_goods = tea }
			}
			change_trade_goods = tea
		}
		set_country_flag = new_tea_province
	}
	option = {
		name = "flavor_jap.EVTOPTB39"
		ai_chance = { factor = 0 }
		set_country_flag = rejected_tea_province
	}
}

# Tea with the Emperor
country_event = {
	id = flavor_jap.40
	title = "flavor_jap.EVTNAME40"
	desc = "flavor_jap.EVTDESC40"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_country_modifier = way_of_tea
		culture_group = japanese_g
		has_reform = daimyo
		prestige = 1
	}
	
	mean_time_to_happen = {
		days = 1
		modifier = {
			factor = 1.2
			prestige = 30
		}
		modifier = {
			factor = 1.3
			prestige = 40
		}
		modifier = {
			factor = 0.8
			NOT = {
				stability = 1
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA40"
		add_prestige = 10
	}
}

# Heirless
country_event = {
	id = flavor_jap.41
	title = "flavor_jap.EVTNAME41"
	desc = "flavor_jap.EVTDESC41"
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		culture_group = japanese_g
		has_heir = no
		has_government_attribute = heir
	}
	
	mean_time_to_happen = {
		months = 400
		modifier = {
			factor = 0.9
			NOT = {
				legitimacy = 50
			}
		}
		modifier = {
			factor = 0.9
			NOT = {
				legitimacy = 40
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA41"
		add_prestige = 5
	}
	
	option = {
		name = "flavor_jap.EVTOPTB41"
		define_heir = {
			dynasty = ROOT
			claim = 30
		}
		add_prestige = -25
	}
}

# Losing Face
country_event = {
	id = flavor_jap.42
	title = "flavor_jap.EVTNAME42"
	desc = "flavor_jap.EVTDESC42"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		culture_group = japanese_g
		NOT = {
			stability = 1
		}
	}
	
	mean_time_to_happen = {
		days = 1
		modifier = {
			factor = 1.3
			NOT = {
				stability = 0
			}
		}
		modifier = {
			factor = 1.2
			NOT = {
				stability = -1
			}
		}
		modifier = {
			factor = 0.66
			stability = 0
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA42"
		add_prestige = -20
	}
	
	option = {
		name = "flavor_jap.EVTOPTB42"
		add_stability = -1
	}
}

# Levying Additional Taxation
country_event = {
	id = flavor_jap.43
	title = "flavor_jap.EVTNAME43"
	desc = "flavor_jap.EVTDESC43"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		culture_group = japanese_g
		stability = 0
		NOT = {
			war_exhaustion = 1
		}
		is_at_war = no
	}
	
	mean_time_to_happen = {
		days = 1
		modifier = {
			factor = 1.2
			stability = 3
		}
		modifier = {
			factor = 1.1
			stability = 1
		}
	}

	option = {
		name = "flavor_jap.EVTOPTA43"
		add_years_of_income = 0.5
	}
	
	option = {
		name = "flavor_jap.EVTOPTB43"
		add_yearly_manpower = 1.5
	}
}

# Sword of The Daimyo
country_event = {
	id = flavor_jap.44
	title = "flavor_jap.EVTNAME44"
	desc = "flavor_jap.EVTDESC44"
	picture = COURT_eventPicture
	
	trigger = {
		overextension_percentage = 0.04
		stability = 1
		has_reform = daimyo
		culture_group = japanese_g
	}
	
	mean_time_to_happen = {
		months = 400
		modifier = {
			factor = 0.8
			overextension_percentage = 0.06
		}
		modifier = {
			factor = 0.8
			overextension_percentage = 0.08
		}
		modifier = {
			factor = 0.8
			stability = 3
		}
		modifier = {
			factor = 1.5
			NOT = {
				legitimacy = 50
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA44"
		custom_tooltip = "daimyo_displeased_TT"
		hidden_effect = {
			every_known_country = {
				limit = {
					has_reform = daimyo
					culture_group = japanese_g
				}
				add_opinion = { 
					modifier = opinion_angry
					who = ROOT
				}
			}
		}
		add_prestige = 25
	}
	
	option = {
		name = "flavor_jap.EVTOPTB44"
		add_ruler_modifier = {
			name = jap_sword_of_the_daimyo
		}
	}
}

# Lacquerware for the Emperor
country_event = {
	id = flavor_jap.45
	title = "flavor_jap.EVTNAME45"
	desc = "flavor_jap.EVTDESC45"
	picture = COURT_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
		years_of_income = 0.6
		NOT = {
			any_known_country = {
				has_reform = shogunate
				war_with = ROOT
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "flavor_jap.EVTOPTA45"
		add_years_of_income = -0.5
		overlord = {
			add_opinion = {
				who = ROOT
				modifier = opinion_pleased
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTB45"
		add_prestige = -15
	}
}

#  The First Sake
country_event = {
	id = flavor_jap.46
	title = "flavor_jap.EVTNAME46"
	desc = "flavor_jap.EVTDESC46"
	picture = COURT_eventPicture
	
	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
		NOT = {
			any_known_country = {
				has_reform = shogunate
				war_with = ROOT
			}
		}
		NOT = {
			has_country_modifier = jap_first_sake
		}
		has_regency = no
		is_month = 0
		NOT = { is_month = 5 }
	}
	
	mean_time_to_happen = {
		months = 300
		modifier = {
			factor = 0.9
			stability = 1
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA46"
		add_prestige = 15
		overlord = {
			add_opinion = {
				who = ROOT
				modifier = opinion_pleased
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTB46"
		add_country_modifier = {
			name = jap_first_sake 
			duration = 7300
		}
	}
}

# Calling up Recruits
country_event = {
	id = flavor_jap.47
	title = "flavor_jap.EVTNAME47"
	desc = "flavor_jap.EVTDESC47"
	picture = LAND_MILITARY_eventPicture
	
	trigger = {
		culture_group = japanese_g
		OR = {
			legitimacy = 75
			prestige = 75
		}
		is_at_war = yes
		NOT = {
			has_country_flag = jap_recruits
		}
	}
	
	mean_time_to_happen = {
		months = 500
		modifier = {
			factor = 1.2
			war_exhaustion = 4
		}
		modifier = {
			factor = 1.2
			war_exhaustion = 6
		}
		modifier = {
			factor = 1.2
			war_exhaustion = 8
		}
	}

	immediate = {
		hidden_effect = {
			set_country_flag = jap_recruits
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA47"
		add_years_of_income = -0.25
		add_ruler_modifier = {
			name = jap_recruits
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTB47"
		add_war_exhaustion = -2
		add_prestige = -5
	}
	
	option = {
		name = "flavor_jap.EVTOPTC47"
		add_prestige = 10
	}
}

# Bushido
country_event = {
	id = flavor_jap.48
	title = "flavor_jap.EVTNAME48"
	desc = "flavor_jap.EVTDESC48"
	picture = COURT_eventPicture

	trigger = {
		tag = JAP
		years_of_income = 1.1
		has_global_flag = japan_has_encountered_the_west
		NOT = { has_country_flag = jap_bushido }
		OR = {
			current_age = age_of_reformation
			current_age = age_of_absolutism
			current_age = age_of_revolutions
		}
	}
	
	mean_time_to_happen = {
		months = 400
	}

	immediate = {
		hidden_effect = {
			set_country_flag = jap_bushido
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA48"
		add_army_tradition = -10
		add_adm_power = 150
	}
	
	option = {
		name = "flavor_jap.EVTOPTB48"
		add_years_of_income = -1
		add_army_tradition = 10
		add_mil_power = 150
	}
}

# Spreading Rumors
country_event = {
	id = flavor_jap.49
	title = "flavor_jap.EVTNAME49"
	desc = "flavor_jap.EVTDESC49"
	picture = ELECTION_REPUBLICAN_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
		NOT = {
			has_ruler_modifier = jap_gossip
		}
	}
	
	mean_time_to_happen = {
		days = 1
		modifier = {
			factor = 0.5
			spy_ideas = 1
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA49"
		add_ruler_modifier = {
			name = jap_gossip
		}
		add_dip_power = 150
		custom_tooltip = "daimyo_displeased_TT"
		hidden_effect = {
			every_known_country = {
				limit = {
					has_reform = daimyo
					culture_group = japanese_g
				}
				add_opinion = { 
					modifier = opinion_mildly_displeased
					who = ROOT 
				}
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTB49"
		add_ruler_modifier = {
			name = jap_gossip_spies
		}
	}
}

# A Son Finds His Way Home
country_event = {
	id = flavor_jap.50
	title = "flavor_jap.EVTNAME50"
	desc = "flavor_jap.EVTDESC50"
	picture = NEW_HEIR_eventPicture
	
	trigger = {
		has_reform = daimyo
		any_neighbor_country = {
			has_reform = daimyo
		} 
		culture_group = japanese_g
		NOT = { has_heir = yes }
		has_government_attribute = heir
	}
	
	mean_time_to_happen = {
		months = 600
		modifier = {
			factor = 0.8
			any_neighbor_country = {
				has_reform = daimyo
				is_rival = ROOT
			} 
		}
		modifier = {
			factor = 0.8
			any_neighbor_country = {
				has_reform = daimyo
				truce_with = ROOT
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTB50"
		add_dip_power = 50
		define_heir = {
			claim = 95
			male = yes
			name = "Motonobu"
			age = 15
			dip = 4
			dynasty = ROOT
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA50"
		add_adm_power = 50
		define_heir = {
			claim = 95
			male = yes
			name = "R^"
			age = 15
			adm = 4
			dynasty = ROOT
		}
	}
	option = {
		name = "flavor_jap.EVTOPTC50"
		add_mil_power = 30
		add_army_tradition = 5
		define_heir = {
			claim = 95
			male = yes
			name = "Motoyasu"
			age = 15
			mil = 4
			dynasty = ROOT
		}
	}
}

# Exceptional Swords
country_event = {
	id = flavor_jap.51
	title = "flavor_jap.EVTNAME51"
	desc = "flavor_jap.EVTDESC51"
	picture = MILITARY_CAMP_eventPicture

	is_triggered_only = yes

	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
	}

	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "flavor_jap.EVTOPTA51"
		add_army_tradition = 10
	}
	
	option = {
		name = "flavor_jap.EVTOPTB51"
		add_years_of_income = 1
		add_country_modifier = {
			name = japanese_downprioritized_military
			duration = 3650
		}
	}
}

# Hangings in the Han
country_event = {
	id = flavor_jap.52
	title = "flavor_jap.EVTNAME52"
	desc = "flavor_jap.EVTDESC52"
	picture = ANGRY_MOB_eventPicture
	
	is_triggered_only = yes

	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
	}

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					is_core = owner
				}
				set_province_flag = shogunate_destabilized_flag1
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					is_core = owner
					NOT = {
						has_province_flag = shogunate_destabilized_flag1
					}
				}
				set_province_flag = shogunate_destabilized_flag2
			}
			random_owned_province = {
				limit = {
					culture_group = japanese_g
					is_core = owner
					NOT = {
						has_province_flag = shogunate_destabilized_flag1
					}
					NOT = {
						has_province_flag = shogunate_destabilized_flag2
					}
				}
				set_province_flag = shogunate_destabilized_flag3
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA52"
		random_owned_province = {
			limit = {
				has_province_flag = shogunate_destabilized_flag1
			}
			clr_province_flag = shogunate_destabilized_flag1
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
		}
		random_owned_province = {
			limit = {
				has_province_flag = shogunate_destabilized_flag2
			}
			clr_province_flag = shogunate_destabilized_flag2
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
		}
		random_owned_province = {
			limit = {
				has_province_flag = shogunate_destabilized_flag3
			}
			clr_province_flag = shogunate_destabilized_flag3
			add_province_modifier = {
				name = add_unrest_5_modifier
				duration = 1825
			}
		}
		add_prestige = -10
	}
	
	option = {
		name = "flavor_jap.EVTOPTB52"
		add_stability = -1
		hidden_effect = {
			random_owned_province = {
				limit = {
					has_province_flag = shogunate_destabilized_flag1
				}
				clr_province_flag = shogunate_destabilized_flag1
			}
			random_owned_province = {
				limit = {
					has_province_flag = shogunate_destabilized_flag2
				}
				clr_province_flag = shogunate_destabilized_flag2
			}
			random_owned_province = {
				limit = {
					has_province_flag = shogunate_destabilized_flag3
				}
				clr_province_flag = shogunate_destabilized_flag3
			}
		}
	}
}

# New Generation of Samurai
country_event = {
	id = flavor_jap.53
	title = "flavor_jap.EVTNAME53"
	desc = "flavor_jap.EVTDESC53"
	picture = MILITARY_CAMP_eventPicture

	is_triggered_only = yes
	
	trigger = {
		culture_group = japanese_g
		NOT = {
			war_exhaustion = 1
		}
		NOT = {	is_at_war = yes }
	}
	
	mean_time_to_happen = {
		days = 1
		
		modifier = {
			factor = 0.66
			NOT = {
				stability =  0
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA53"
		add_adm_power = 30
	}
	
	option = {
		name = "flavor_jap.EVTOPTB53"
		add_army_tradition = 5
	}
}

# Strengthening the Shogunate
country_event = {
	id = flavor_jap.54
	title = "flavor_jap.EVTNAME54"
	desc = "flavor_jap.EVTDESC54"
	picture = LAND_MILITARY_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
		OR = {
			legitimacy = 75
			prestige = 75
		}
		army_tradition = 10
	}
	
	mean_time_to_happen = {
		days = 1
		modifier = {
			factor = 1.1
			army_tradition = 25
		}
		modifier = {
			factor = 1.1
			army_tradition = 30
		}
		modifier = {
			factor = 0.66
			NOT = {
				army_tradition = 20
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA54"
		add_adm_power = 50
	}
	
	option = {
		name = "flavor_jap.EVTOPTB54"
		add_army_tradition = 10
	}
}

# Death or Glory?
country_event = {
	id = flavor_jap.55
	title = "flavor_jap.EVTNAME55"
	desc = "flavor_jap.EVTDESC55"
	picture = ANGRY_MOB_eventPicture

	is_triggered_only = yes
	
	trigger = {
		has_reform = daimyo
		culture_group = japanese_g
	}
	
	mean_time_to_happen = {
		days = 1
		modifier = {
			factor = 1.1
			NOT = {
				stability = -1
			}
		}
		modifier = {
			factor = 1.1
			NOT = {
				stability = -2
			}
		}
	}
	
	option = {
		name = "flavor_jap.EVTOPTA55"
		add_prestige = 10
		add_corruption = 1
	}
	
	option = {
		name = "flavor_jap.EVTOPTB55"
		add_prestige = -10
		if = {
			limit = {
				corruption = 1
			}
			add_corruption = -1
		}
		if = {
			limit = {
				NOT = { corruption = 1 }
			}
			add_dip_power = 50
		}
	}
}



#Independent as Daimyo
country_event = {
	id = flavor_jap.57
	title = flavor_jap.57.t
	desc = flavor_jap.57.d
	picture = BATTLE_eventPicture
	
	trigger = {
		has_reform = daimyo
		NOT = { is_subject_of_type = daimyo_vassal }
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	option = {
		name = flavor_jap.57.a
		trigger = {
			any_country = {
				has_reform = shogunate
			}
		}
		add_government_reform = indep_daimyo
		add_legitimacy = -25
	}
	option = {
		name = flavor_jap.57.b
		trigger = {
			NOT = {
				any_country = {
					has_reform = shogunate
				}
			}
		}
		add_government_reform = indep_daimyo
	}
}


# Returning to the fold
country_event = {
	id = flavor_jap.58
	title = flavor_jap.58.t
	desc = flavor_jap.58.d
	picture = BATTLE_eventPicture
	
	
	trigger = {
		is_subject_of_type = daimyo_vassal
		NOT = { has_reform = daimyo }
		NOT = { tag = PAP } # Just no, the Pope isn't a Daimyo.
		NOT = {
			OR = {				
				AND = {
					tag = SOO
					has_government_attribute = is_pirate_republic_reform
				}
				has_country_flag = ikko_ikki_peasants_flag
			}
		}
		is_reform_available = daimyo
		NOT = { has_reform = shogunate }
		is_revolutionary = no
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	option = {
		name = flavor_jap.58.a
		if = {
			limit = { NOT = { government = monarchy } }
			change_government = monarchy
		}
		add_government_reform = daimyo
		if = {
			limit = {
				government_rank = 2
			}
			set_government_rank = 1
		}

	}
}

#The Grand Temple of Ise
country_event = {
	id = flavor_jap.59
	title = flavor_jap.59.t
	desc = flavor_jap.59.d
	picture = RELIGION_eventPicture
	
	trigger = {
		NOT = { religion = shinto }
		owns = 4359
		4359 = {
			has_province_modifier = ise_grand_shrine
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = { #Interesting.
		name = flavor_jap.59.a
		ai_chance = { factor = 1 }
		4359 = {
			remove_province_modifier = ise_grand_shrine
			add_province_modifier = {
				name = "religious_center"
				duration = -1
			}
		}
	}
	
	option = { #This is a fascinating religion, let us embrace it instead.
		ai_chance = { factor = 1 }
		name = flavor_jap.59.b
		trigger = {
			religion_group = pagan
			is_colonial_nation = no
		}
		change_religion = shinto
		if = {
			limit = { government = tribal }
			change_government = monarchy
			#set_legacy_government = despotic_monarchy
		}
	}
	option = { #Let them worship their idols.
		name = flavor_jap.59.c
		trigger = { full_idea_group = humanist_ideas }
		ai_chance = { factor = 0 }
		add_stability = -1
		4359 = {
			remove_province_modifier = ise_grand_shrine
			add_province_modifier = {
				name = "religious_center"
				duration = -1
			}
			add_base_tax = 1
			add_base_production = 1
			add_base_manpower = 1
		}
	}	
}

# Iwami Ginzan Silver Mine

province_event = {
	id = flavor_jap.60
	
	title = flavor_jap.60.t
	desc = flavor_jap.60.d

	picture = COURT_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		province_id = 4183 # Iwami
		is_year = 1526
		NOT = { trade_goods = gold }
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = { 
		name = flavor_jap.60.a
		change_trade_goods = gold
		add_base_production = 3
	}
	
}

#Sado Kinzan
province_event = {
	id = flavor_jap.61
	
	title = flavor_jap.61.t
	desc = flavor_jap.61.d

	picture = COURT_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			AND = { 
				province_id = 1024 # Echigo
				is_year = 1526
				NOT = { trade_goods = gold }
			}
			AND = {
				owner = { has_country_flag = jap_flavor_61_flag }
				province_id = 1024 # Echigo
				NOT = { trade_goods = gold }
			}
		}
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = { 
		name = flavor_jap.61.a
		change_trade_goods = gold
	}
	
}


#1.35 Event Additions by Big Boss#
country_event = {
	id = flavor_jap.62
	title = flavor_jap.62.t
	desc = flavor_jap.62.d
	picture = CITY_DEVELOPMENT_eventPicture 
	is_triggered_only = yes 
	goto = 4815
	option = {
		name = flavor_jap.62.a 
		4815 = {
			add_province_modifier = {
				name = jap_shishi_no_machi_lion_city_modifier
				duration = -1 
			}
			center_of_trade = 2 
		}
	}
}

country_event = {
	id = flavor_jap.63
	title = flavor_jap.63.t
	desc = flavor_jap.63.d
	picture = IMPORTANT_STATUE_eventPicture 
	is_triggered_only = yes 
	
	option = {
		name = flavor_jap.63.a 
		add_country_modifier = {
			name = jap_period_tranquility_modifier
			duration = 9125
		}
	}
}

country_event = {
	id = flavor_jap.64
	title = flavor_jap.64.t
	desc = flavor_jap.64.d
	picture = SHOGUNATE_AUTHORITY_INCIDENT_eventPicture 
	is_triggered_only = yes 
	
	option = {
		name = flavor_jap.64.a 
		
		set_emperor_of_china = ROOT 
		add_country_modifier = {
			name = jap_era_tranquil_sun_modifier
			duration = -1 
		}
	}
	
	option = {
		name = flavor_jap.64.b 
		
		add_country_modifier = {
			name = jap_scramble_for_china_modifier
			duration = 7300 
		}
	}
}	

country_event = {
	id = flavor_jap.65
	title = flavor_jap.65.t
	desc = flavor_jap.65.d
	picture =SHOGUNATE_AUTHORITY_INCIDENT_eventPicture
	is_triggered_only = yes 

	option = {
		name = flavor_jap.65.a 
		
		define_ruler = {
			dynasty = "'YT"
			change_adm = 3
			change_dip = 3
			change_mil = 3
			change_original_dynasty = yes
		}
		add_government_reform = japanese_divine_empire 
	}
}

country_event = {
	id = flavor_jap.66
	title = flavor_jap.66.t
	desc = flavor_jap.66.d
	picture = SENGOKU_eventPicture
	is_triggered_only = yes 
	
	option = {
		name = flavor_jap.66.a 
		trigger = { ai = yes }
		add_army_tradition = 10 
		set_country_flag = jap_mushashi_5_books_flag
		add_country_modifier = {
			name = jap_mushashi_5_books_modifier
			duration = -1 
		}
		swap_non_generic_missions = yes 
	}
	
	option = {
		name = flavor_jap.66.b 
		trigger = { ai = yes }
		add_navy_tradition = 20 
		set_country_flag = jap_domineering_naval_focus_flag
		add_country_modifier = {
			name = jap_domineering_naval_focus_modifier
			duration = -1 
		}
		swap_non_generic_missions = yes 
	}

	option = {
		name = flavor_jap.66.c
		trigger = { ai = no }
		enable_branching_mission_review_without_ai = { key = JAP }
	}
}

# Of Spice and Herbs
country_event = {
	id = flavor_jap.67
	title = flavor_jap.67.t
	desc = flavor_jap.67.d 
	picture = TRADE_GOODS_eventPicture
	fire_only_once = yes 
	trigger = {
		tag = JAP 
		any_owned_province = {
			OR = {
				trade_goods = spices
				trade_goods = cloves
			}
		}
		any_owned_province = {
			trade_goods = tea
		}
	}
	
	mean_time_to_happen = { months = 48 } 
	option = {
		name = flavor_jap.67.a 
		
		custom_tooltip = JAP_OF_SPICE_AND_HERBS_SPICE_TT
		hidden_effect = {
			every_province = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
					OR = {
						trade_goods = spices
						trade_goods = cloves 
					}
				}
				add_province_modifier = {
					name = japan_increased_demand_of_spice
					duration = 9125
				}
			}
		}
	}
	
	option = {
		name = flavor_jap.67.b 
		
		
		custom_tooltip = JAP_OF_SPICE_AND_HERBS_TEA_TT
		hidden_effect = {
			every_province = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
					trade_goods = tea
				}
				add_province_modifier = {
					name = japan_increased_demand_of_tea
					duration = 9125
				}
			}
		}
	}
}

# The First Geisha
country_event = {
	id = flavor_jap.68
	title = flavor_jap.68.t
	desc = flavor_jap.68.d 
	picture = CULTURE_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = JAP
		is_year = 1500
		is_at_war = no
	}
	
	mean_time_to_happen = {
		months = 600
	}
	
	option = {
		name = flavor_jap.68.a 
		
		define_advisor = {
			name = "Kikuya"
			type = artist
			skill = 3
			cost_multiplier = 0.25
			female = yes
		}
	}
}

# Poetry and Songs of the Edo Period
country_event = {
	id = flavor_jap.69
	title = flavor_jap.69.t 
	desc = flavor_jap.69.d 
	picture = {
		trigger = {
			has_dlc = "Mandate of Heaven"
		}
		picture = NEO_CONFUCIANISM_INCIDENT_eventPicture
	}
	picture = {
		trigger = {
			NOT = { has_dlc = "Mandate of Heaven" }
		}
		picture = CULTURE_eventPicture
	}
	
	fire_only_once = yes
	
	trigger = {
		tag = JAP
		is_year = 1520
		NOT = { is_year = 1750 }
		owns_or_non_sovereign_subject_of = 1015
	}
	
	mean_time_to_happen = {
		months = 600
	}
	
	option = {
		name = flavor_jap.69.a 
		
		add_dip_power = 50
		define_advisor = {
			name = "Matsuo Basho"
			type = artist
			skill = 3
			cost_multiplier = 0.5
			female = yes
		}
	}
}

# Way of Chonindo
country_event = {
	id = flavor_jap.70
	title = flavor_jap.70.t 
	desc = flavor_jap.70.d 
	picture = {
		trigger = {
			has_dlc = "Mandate of Heaven"
		}
		picture = SHOGUNATE_AUTHORITY_INCIDENT_eventPicture
	}
	picture = {
		trigger = {
			NOT = { has_dlc = "Mandate of Heaven" }
		}
		picture = CULTURE_eventPicture
	}
	
	fire_only_once = yes
	
	trigger = {
		tag = JAP
		stability = 1
		is_at_war = no
	}
	
	mean_time_to_happen = {
		months = 600
	}
	
	option = {
		name = flavor_jap.70.a 
		
		add_stability_or_adm_power = yes
		if = {
			limit = {
				has_dlc = "Rule Britannia"
			}
			change_innovativeness = 5
		}
		else = {
			add_dip_power = 50
		}
	}
}

country_event = {
	id = flavor_jap.71
	title = flavor_jap.71.t
	desc = flavor_jap.71.d
	picture = COUNTRY_COLLAPSE_eventPicture
	goto = 1028
	fire_only_once = yes
	
	trigger = {
		tag = JAP
		is_year = 1657
		NOT = { is_year = 1680 }
		owns = 1028
	}
	
	mean_time_to_happen = {
		months = 6
	}
	
	option = {
		name = flavor_jap.71.a
		
		1028 = {
			add_devastation = 75
			if = {
				limit = {
					base_tax = 3
				}
				add_base_tax = -2
			}
			else = {
				set_base_tax = 1
			}
			if = {
				limit = {
					base_production = 3
				}
				add_base_production = -2
			}
			else = {
				set_base_production = 1
			}
			if = {
				limit = {
					base_manpower = 3
				}
				add_base_manpower = -2
			}
			else = {
				set_base_manpower = 1
			}
		}
	}
}

country_event = { #Kanda Matsuri Festivals in [Root.Capital.GetName]
	id = flavor_jap.72
	title = flavor_jap.72.t 
	desc = flavor_jap.72.d 
	picture = CULTURE_eventPicture
	
	fire_only_once = yes 
	goto = capital_scope_event_target 
	trigger = {
		tag = JAP 
		religion = shinto 
		stability = 1 
		NOT = { num_of_loans = 1 }
	}
	
	mean_time_to_happen = {
		months = 120 
	}
	
	goto = capital
	immediate = {
		hidden_effect = { 
			capital_scope = { save_event_target_as = capital }
		}
	}

	option = {
		name = flavor_jap.72.a 
		
		if = {
			limit = {
				capital_scope = { 
					is_prosperous = no 
				}
			}
			capital_scope = {
				add_prosperity = 100 
			}
		}
		add_splendor = 50 
		add_army_tradition = 10  
		add_legitimacy = 5 
	}
}

country_event = { #Onna Musha and the Edo Period
	id = flavor_jap.73
	title = flavor_jap.73.t 
	desc = flavor_jap.73.d 
	picture = wihgfx_FEMALE_SIEGE_eventPicture
	
	fire_only_once = yes 
	
	trigger = {
		tag = JAP 
		NOT = { current_age = age_of_revolutions }
	}
	
	mean_time_to_happen = {
		months = 120 
	}
	option = {
		name = flavor_jap.73.a 
		
		custom_tooltip = jap_hire_female_generals
		hidden_effect = {
			add_country_modifier =  {
				name = jap_onna_musha_modifier
				duration = -1 
			}
		}
		define_general = {
			name = "Ohori Tsuruhime"
			female = yes 
			fire = 4 
			shock = 6 
			manuever = 4
			siege = 2
			trait = cruel_tactician_personality
		}
	}
	
	option = {
		name = flavor_jap.73.b 
		
		add_prestige_or_monarch_power = { amount = 20 }
		add_legitimacy = 10 
		add_devotion = 10
		add_republican_tradition = 5 
		change_ruler_stat = {
			type = dip
			amount = 1
		}
	}
}
