﻿add_namespace = ryukyu

country_event = {
	id = ryukyu.1
	title = ryukyu.1.t
	desc = ryukyu.1.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = no
	hidden = yes
	trigger = {
		RYU = { has_full_control_of_state = 526 }
		RYU = { has_country_flag = RYU_Civil_War }
	}
	mean_time_to_happen = {days = 3 }
	
	immediate = {
		RYU = { clr_country_flag = RYU_Civil_War }
		RYU = { country_event = { id = ryukyu.41 } }
		SAT = { country_event = { id = ryukyu.42 } }
		if = {
			limit = { RYU = { has_country_flag = RYU_ENG_support } }
			ENG = { country_event = { id = ryukyu.45 } }
		}
		if = {
			limit = { RYU = { has_country_flag = RYU_USA_support } }
			USA = { country_event = { id = ryukyu.45 } }
		}
		if = {
			limit = { RYU = { has_country_flag = RYU_FRA_support } }
			FRA = { country_event = { id = ryukyu.45 } }
		}
		
		news_event = { id = ryukyu.46 days = 5 }
		QNG = { country_event = { id = ryukyu.30 } }
	}
}

country_event = {
	id = ryukyu.2
	title = ryukyu.2.t
	desc = ryukyu.2.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = no
	hidden = yes
	trigger = {
		SAT = { has_full_control_of_state = 526 }
		RYU = { has_country_flag = RYU_Civil_War }
	}
	mean_time_to_happen = {days = 3 }
	
	immediate = { 
		RYU = { clr_country_flag = RYU_Civil_War }
		RYU = { country_event = { id = ryukyu.51 } }
		SAT = { country_event = { id = ryukyu.52 } }
		if = {
			limit = { RYU = { has_country_flag = RYU_ENG_support } }
			ENG = { country_event = { id = ryukyu.55 } }
		}
		if = {
			limit = { RYU = { has_country_flag = RYU_USA_support } }
			USA = { country_event = { id = ryukyu.55 } }
		}
		if = {
			limit = { RYU = { has_country_flag = RYU_FRA_support } }
			FRA = { country_event = { id = ryukyu.55 } }
		}
		
	}
}


country_event = {
	id = ryukyu.3
	title = ryukyu.3.t
	desc = ryukyu.3.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = yes

	option = {
		name = ryukyu.3.a
		ai_chance = { factor = 100 }
		hidden_effect = { set_technology = { gw_artillery = 1 } }
		add_equipment_to_stockpile = {
			type = cannon_equipment_0
			amount = 50
			producer = FRA
		}
		add_tech_bonus = {
			bonus = 0.15
			uses = 1
			technology = horse_artillery
		}
		add_equipment_to_stockpile = {
			type = horse_artillery_equipment_0
			amount = 50
			producer = FRA
		}
	}
}
	
#Bernard Bettelheim Goofball
country_event = {
	id = ryukyu.4
	title = ryukyu.4.t
	desc = ryukyu.4.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.4.a
		ai_chance = { factor = 90 }
		trigger = {
			NOT = { has_global_flag = eoanb_gamerule_eastereggs_enabled }
		}
		add_political_power = 25
		ENG = { country_event = { id = ryukyu.5 days = 12} }
		hidden_effect = { RYU = { country_event = { id = ryukyu.22 days = 254 } } }
	}
	option = {
		name = ryukyu.4.b
		ai_chance = { factor = 10 }
		trigger = {
			NOT = { has_global_flag = eoanb_gamerule_eastereggs_enabled }
		}
		add_political_power = -55
		add_stability = -0.10
		ENG = { country_event = { id = ryukyu.7 days = 12 } }
		FRA = { country_event = { id = ryukyu.13 days = 12 } }
		USA = { country_event = { id = ryukyu.14 days = 12 } }
		custom_effect_tooltip = RYU_bernard_bettelheim_convert_protestant
	}
	
	option = {
		name = ryukyu.4.a
		ai_chance = { factor = 20 }
		trigger = {
			has_global_flag = eoanb_gamerule_eastereggs_enabled
		}
		add_political_power = 25
		ENG = { country_event = { id = ryukyu.5 days = 12} }
		hidden_effect = { RYU = { country_event = { id = ryukyu.22 days = 254 } } }
	}
	option = {
		name = ryukyu.4.b
		ai_chance = { factor = 80 }
		trigger = {
			has_global_flag = eoanb_gamerule_eastereggs_enabled
		}
		add_political_power = -55
		add_stability = -0.10
		ENG = { country_event = { id = ryukyu.7 days = 12 } }
		FRA = { country_event = { id = ryukyu.13 days = 12 } }
		USA = { country_event = { id = ryukyu.14 days = 12 } }
		custom_effect_tooltip = RYU_bernard_bettelheim_convert_protestant
	}
	
}

#Ryukyu complains about Benard, Britain has low chance to get into Ryukyu
country_event = {
	id = ryukyu.5
	title = ryukyu.5.t
	desc = ryukyu.5.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.5.a 
		ai_chance = { factor = 100 }
		add_political_power = -10
	}
	
	#option = {
	#	name = ryukyu.5.b 
	#	ai_chance = { factor = 10 }
	#	add_political_power = -100
	#	hidden_effect = {
	#		RYU = { country_event = { id = ryukyu.6 } }
	#	}
	#}
	
}

country_event = {
	id = ryukyu.6
	title = ryukyu.6.t
	desc = ryukyu.6.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.6.a 
		ai_chance = { factor = 100 }
		custom_effect_tooltip = RYU_ENG_dockyard_forign_help_tooltip
		set_country_flag = RYU_dockyard_forign_help
		set_country_flag = RYU_ENG_dockyard_forign_help
		hidden_effect = { SAT = { country_event = { id = ryukyu.12 days = 3 } } }
	}
	
}

#Ryukyu asks to increase missionary work, Britain has high chance to get into Ryukyu
country_event = {
	id = ryukyu.7
	title = ryukyu.7.t
	desc = ryukyu.7.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.7.a 
		ai_chance = { factor = 100 }
		add_political_power = 25
		RYU = { country_event = { id = ryukyu.8 days = 12 } }
	}
	
}

country_event = {
	id = ryukyu.8
	title = ryukyu.8.t
	desc = ryukyu.8.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.8.a 
		ai_chance = { factor = 100 }
		custom_effect_tooltip = RYU_ENG_dockyard_forign_help_tooltip
		set_country_flag = RYU_dockyard_forign_help
		set_country_flag = RYU_ENG_dockyard_forign_help
		hidden_effect = { SAT = { country_event = { id = ryukyu.12 days = 3 } } }
		hidden_effect = { RYU = { country_event = { id = ryukyu.21 days = 230 } } }
	}
	
}

country_event = {
	id = ryukyu.9
	title = ryukyu.9.t
	desc = ryukyu.9.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	trigger = {
		has_country_flag = RYU_Sho_Coup_Flag
	}
	
	option = {
		name = ryukyu.9.a 
		ai_chance = { factor = 100 }
		RYU = { country_event = { id = ryukyu.11 days = 12 } }
	}
	
	option = {
		name = ryukyu.9.b 
		ai_chance = { factor = 0 }
		RYU = { country_event = { id = ryukyu.10 days = 12 } }
	}
	
}

country_event = {
	id = ryukyu.10
	title = ryukyu.10.t
	desc = ryukyu.10.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.10.a 
		ai_chance = { factor = 100 }
		custom_effect_tooltip = RYU_bernard_bettelheim_7a_tooltip
	}
}

country_event = {
	id = ryukyu.11
	title = ryukyu.11.t
	desc = ryukyu.11.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.11.a 
		ai_chance = { factor = 100 }
		add_equipment_to_stockpile = {
			type = uniform_equipment_1
			amount = 100
			producer = ENG
		}
		add_equipment_to_stockpile = {
			type = infantry_equipment_rifle_1
			amount = 100
			producer = ENG
		}
	}
}

country_event = {
	id = ryukyu.12
	title = ryukyu.12.t
	desc = ryukyu.12.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.12.a 
		ai_chance = { factor = 100 }
	}
	
}

country_event = {
	id = ryukyu.13
	title = ryukyu.13.t
	desc = ryukyu.13.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.13.a 
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = ryukyu.14
	title = ryukyu.14.t
	desc = ryukyu.14.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.14.a 
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = ryukyu.15
	title = ryukyu.15.t
	desc = ryukyu.15.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.15.a 
		ai_chance = { factor = 100 }
		create_production_license = {
			target = RYU
			equipment = {
				type = uniform_equipment_2
			}
			cost_factor = 0
		}
		RYU = { country_event = { id = ryukyu.17 days = 12 } }
	}
}

country_event = {
	id = ryukyu.16
	title = ryukyu.16.t
	desc = ryukyu.16.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.16.a 
		ai_chance = { factor = 100 }
		create_production_license = {
			target = RYU
			equipment = {
				type = infantry_equipment_rifle_1
			}
			cost_factor = 0
		}
		RYU = { country_event = { id = ryukyu.18 days = 12 } }	
	}
}

country_event = {
	id = ryukyu.17
	title = ryukyu.17.t
	desc = ryukyu.17.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			RYU = {
				set_technology = {
					tech_infantry_colonial_marines = 1
				}
			}
		}
	}
	
	option = {
		name = ryukyu.17.a 
		ai_chance = { factor = 100 }
		set_country_flag = RYU_USA_support
		create_field_marshal = {
			name = "Matthew Calbraith Perry"
			#picture = ""
			traits = { offensive_doctrine career_officer }
			skill = 4
			attack_skill = 3
			defense_skill = 2
			planning_skill = 2
			logistics_skill = 4
		}
		hidden_effect = {
			division_template = {
				name = "US Marines"
				priority = 2
				division_names_group = RYU_SHO_MARINES_01
				regiments = {
					early_marine = { x = 0 y = 0 }
					early_marine = { x = 1 y = 0 }
				}
			}
			set_division_template_lock = {
				division_template = "US Marines"
				is_locked = yes
			}
		}
		526 ={
			create_unit = {
				division = "name = \"US Marines\" division_template = \"US Marines\" start_equipment_factor = 1 start_experience_factor = 2" 
				owner = RYU
				prioritize_location = 11932
			}
		}
		add_equipment_to_stockpile = {
			type = uniform_equipment_2
			amount = 1000
			producer = USA
		}
		
		
		hidden_effect = {
			SAT = { country_event = { id = ryukyu.26 days = 3 } }
		}
	}
}

country_event = {
	id = ryukyu.18
	title = ryukyu.18.t
	desc = ryukyu.18.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.18.a 
		ai_chance = { factor = 100 }
		set_country_flag = RYU_FRA_support
		if = {
			limit = {
				FRA = {
					has_tech = rifle_equipment1
				}
			}
			add_equipment_to_stockpile = {
				type = infantry_equipment_rifle_1
				amount = 1000
				producer = FRA
			}
		}
		
		
		hidden_effect = {
			SAT = { country_event = { id = ryukyu.28 days = 3 } }
		}
	}
}

country_event = {
	id = ryukyu.19
	title = ryukyu.19.t
	desc = ryukyu.19.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.19.a 
		ai_chance = { factor = 100 }
		ENG = {
			create_production_license = {
				target = RYU
				equipment = {
					type = ship_hull_corvette_1
				}
				cost_factor = 0
			}
		}
		RYU = { country_event = { id = ryukyu.20 days = 12 } }	
	}
}

country_event = {
	id = ryukyu.20
	title = ryukyu.20.t
	desc = ryukyu.20.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			RYU = {
				create_equipment_variant = {
					name = "Corvette Class"
					type = ship_hull_corvette_0
					name_group = GER_CA_HISTORICAL
					parent_version = 0
					modules = {
						fixed_ship_battery_slot = ship_cannon_battery_0
						fixed_ship_fire_control_system_slot = fire_control_system_0
						fixed_ship_engine_slot = ship_engine_sail_2
						fixed_ship_armor_slot = ship_armor_screen_hardwood_0
						mid_1_custom_slot = ship_cannon_battery_0
						front_1_custom_slot = ship_cannon_battery_0
					}
					
				}
			}
		}
	}
	
	option = {
		name = ryukyu.20.a 
		ai_chance = { factor = 100 }
		set_country_flag = RYU_ENG_support
		create_navy_leader = {
			name = "William Abbot"
			#picture = ""
			traits = { superior_tactician }
			skill = 3
		}
		navy_experience = 50
		
		
		hidden_effect = {
			SAT = { country_event = { id = ryukyu.28 days = 3 } }
		}
		hidden_effect = {
			load_oob = "RYU_coup_1857_mtg"
		}
	}
}

country_event = {
	id = ryukyu.21
	title = ryukyu.21.t
	desc = ryukyu.21.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.21.a 
		ai_chance = { factor = 40 }
		trigger = {
			NOT = { has_global_flag = eoanb_gamerule_eastereggs_enabled }
		}
		set_country_flag = Oceania_ryukyuan_satsuma_loyalty_renewed_flag
		SAT = { country_event = { id = ryukyu.24 days = 2 } }
		add_ideas = RYU_foreigner_discrimination_laws
		custom_effect_tooltip = RYU_bernard_bettelheim_5a_tooltip
	}
	option = {
		name = ryukyu.21.b 
		ai_chance = { factor = 60 }
		trigger = {
			NOT = { has_global_flag = eoanb_gamerule_eastereggs_enabled }
		}
		set_country_flag = Oceania_ryukyuan_satsuma_loyalty_broken_flag
		ENG = { country_event = { id = ryukyu.9 days = 30 } }
		SAT = { country_event = { id = ryukyu.23 days = 2 } }
		custom_effect_tooltip = RYU_bernard_bettelheim_5b_tooltip
		
	}
	
	option = {
		name = ryukyu.21.a 
		ai_chance = { factor = 0 }
		trigger = {
			has_global_flag = eoanb_gamerule_eastereggs_enabled
		}
		set_country_flag = Oceania_ryukyuan_satsuma_loyalty_renewed_flag
		SAT = { country_event = { id = ryukyu.24 days = 2 } }
		add_ideas = RYU_foreigner_discrimination_laws
		custom_effect_tooltip = RYU_bernard_bettelheim_5a_tooltip
	}
	option = {
		name = ryukyu.21.b 
		ai_chance = { factor = 100 }
		trigger = {
			has_global_flag = eoanb_gamerule_eastereggs_enabled
		}
		set_country_flag = Oceania_ryukyuan_satsuma_loyalty_broken_flag
		ENG = { country_event = { id = ryukyu.9 days = 30 } }
		SAT = { country_event = { id = ryukyu.23 days = 2 } }
		custom_effect_tooltip = RYU_bernard_bettelheim_5b_tooltip
		
	}
	
}

country_event = {
	id = ryukyu.22
	title = ryukyu.22.t
	desc = ryukyu.22.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.22.a 
		ai_chance = { factor = 100 }
		set_country_flag = Oceania_ryukyuan_satsuma_loyalty_renewed_flag
		SAT = { country_event = { id = ryukyu.24 days = 2 } }
		add_ideas = RYU_foreigner_discrimination_laws
		custom_effect_tooltip = RYU_satsuma_anti_western_policy_tooltip
	}
}

country_event = {
	id = ryukyu.23
	title = ryukyu.23.t
	desc = ryukyu.23.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.23.a 
		ai_chance = { factor = 100 }
		RYU = { retire_country_leader = yes }
		hidden_effect = {
			RYU = {
				create_country_leader = {
					name = "Sanshikan Council"
					desc = "POLITICS_SANSHIKAN_COUNCIL_DESC"
					picture = "gfx/leaders/RYU/Portrait_RYU_Sanshikan_Council"
					expire = "2100.1.1"
					ideology = absolutism
					traits = {
						
					}
				}
			}
		}
		custom_effect_tooltip = RYU_sanshikan_council_in_power_tooltip
		RYU = { country_event = { id = ryukyu.25 days = 2 } }
	}
}

country_event = {
	id = ryukyu.24
	title = ryukyu.24.t
	desc = ryukyu.24.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.24.a 
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = ryukyu.25
	title = ryukyu.25.t
	desc = ryukyu.25.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.25.a 
		ai_chance = { factor = 100 }
		custom_effect_tooltip = RYU_sanshikan_council_in_power_tooltip
		add_ideas = RYU_foreigner_discrimination_laws
		set_country_flag = RYU_Sho_Coup_Flag
		custom_effect_tooltip = RYU_bernard_bettelheim_8a_tooltip
	}
	
	option = {
		name = ryukyu.25.b 
		ai_chance = { factor = 100 }
		custom_effect_tooltip = RYU_sanshikan_council_in_power_tooltip
		add_ideas = RYU_foreigner_discrimination_laws
		custom_effect_tooltip = RYU_bernard_bettelheim_5a_tooltip
	}
}



country_event = {
	id = ryukyu.26
	title = ryukyu.26.t
	desc = ryukyu.26.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.26.a 
		ai_chance = { factor = 40 }
		trigger = {
			NOT = { has_global_flag = eoanb_gamerule_eastereggs_enabled }
		}
		RYU = { country_event = { id = ryukyu.27 days = 3 } }
		add_ai_strategy = {
			type = prepare_for_war
			id = RYU
			value = 10
		}
	}
	
	option = {
		name = ryukyu.26.a 
		ai_chance = { factor = 100 }
		trigger = {
			has_global_flag = eoanb_gamerule_eastereggs_enabled
		}
		RYU = { country_event = { id = ryukyu.27 days = 3 } }
		add_ai_strategy = {
			type = prepare_for_war
			id = RYU
			value = 10
		}
	}
	
	option = {
		name = ryukyu.26.b 
		ai_chance = { factor = 100 }
		trigger = {
			command_power > 24
			NOT = { has_global_flag = eoanb_gamerule_eastereggs_enabled }
		}
		RYU = { country_event = { id = ryukyu.27 days = 3 } }
		add_command_power = -25
		set_country_flag = SAT_sent_divisions_to_ryukyu_1
		1054 = {
			add_manpower = -500
		}
		add_ai_strategy = {
			type = prepare_for_war
			id = RYU
			value = 50
		}
	}
}

country_event = {
	id = ryukyu.27
	title = ryukyu.27.t
	desc = ryukyu.27.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.27.a 
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = ryukyu.28
	title = ryukyu.28.t
	desc = ryukyu.28.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.28.a 
		ai_chance = { factor = 40 }
		trigger = {
			NOT = { has_global_flag = eoanb_gamerule_eastereggs_enabled }
		}
		RYU = { country_event = { id = ryukyu.29 days = 3 } }
		add_ai_strategy = {
			type = prepare_for_war
			id = RYU
			value = 10
		}
	}
	
	option = {
		name = ryukyu.28.a 
		ai_chance = { factor = 100 }
		trigger = {
			has_global_flag = eoanb_gamerule_eastereggs_enabled
		}
		RYU = { country_event = { id = ryukyu.29 days = 3 } }
		add_ai_strategy = {
			type = prepare_for_war
			id = RYU
			value = 10
		}
	}
	
	option = {
		name = ryukyu.28.b 
		ai_chance = { factor = 100 }
		trigger = {
			command_power > 24
			NOT = { has_global_flag = eoanb_gamerule_eastereggs_enabled }
		}
		RYU = { country_event = { id = ryukyu.29 days = 3 } }
		add_command_power = -25
		set_country_flag = SAT_sent_divisions_to_ryukyu_2
		1054 = {
			add_manpower = -500
		}
		add_ai_strategy = {
			type = prepare_for_war
			id = RYU
			value = 50
		}
	}
}

country_event = {
	id = ryukyu.29
	title = ryukyu.29.t
	desc = ryukyu.29.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.29.a 
		ai_chance = { factor = 100 }
	}
}
# china guarantee
country_event = {
	id = ryukyu.30
	title = ryukyu.41.t
	desc = ryukyu.41.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.41.a 
		ai_chance = { factor = 100 }
		diplomatic_relation = {
			country = RYU
			relation = guarantee
			active = yes
		}
	}
}

country_event = {
	id = ryukyu.31
	title = ryukyu.31.t
	desc = ryukyu.31.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.31.a 
		ai_chance = { factor = 100 }
		SAT = { 
			country_event = { id = ryukyu.32 } 
			clear_variable = most_favoured_country
		}
		set_country_flag = RYU_Civil_War
		clear_variable = most_favoured_country 
		add_state_claim = 1190
		hidden_effect = {
			QNG = { country_event = { id = ryukyu.34 days = 5 } }
			RYU = { set_variable = { rival_country = SAT.id } }
		}
		hidden_effect = {
			division_template = {
				name = "Shō Loyalists"
				priority = 1
				division_names_group = RYU_SHO_LOYALISTS_01
				regiments = {
					feudal_infantry = { x = 0 y = 0 }
				}
			}
			526 ={
				create_unit = {
					division = "name = \"Shō Loyalists\" division_template = \"Shō Loyalists\" start_equipment_factor = 1 start_experience_factor = 0.5" 
					owner = RYU
					prioritize_location = 11932
				}
				create_unit = {
					division = "name = \"Shō Loyalists\" division_template = \"Shō Loyalists\" start_equipment_factor = 1 start_experience_factor = 0.5" 
					owner = RYU
					prioritize_location = 11932
				}
			}
		}
	}
}

country_event = {
	id = ryukyu.32
	title = ryukyu.32.t
	desc = ryukyu.32.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.32.a 
		ai_chance = { factor = 100 }
		TSH = { country_event = { id = ryukyu.33 } }
		hidden_effect = {
			hidden_effect = { SAT = { set_variable = { rival_country = RYU.id } } }
			add_state_claim = 526
			set_province_controller = 10124
			set_province_controller = 1123
			division_template = {
				name = "Sanshikan Loyalists"
				priority = 1
				division_names_group = RYU_SATSUMA_LOYALISTS_01
				regiments = {
					feudal_infantry = { x = 0 y = 0 }
				}
			}
			if = {
				limit = {
					has_country_flag = SAT_sent_divisions_to_ryukyu_1
				}
				526 ={
					create_unit = {
						division = "name = \"Sanshikan Loyalists\" division_template = \"Sanshikan Loyalists\" start_equipment_factor = 1 start_experience_factor = 0.5" 
						owner = SAT
						prioritize_location = 10124
					}
				}
			}
			if = {
				limit = {
					has_country_flag = SAT_sent_divisions_to_ryukyu_2
				}
				526 ={
					create_unit = {
						division = "name = \"Sanshikan Loyalists\" division_template = \"Sanshikan Loyalists\" start_equipment_factor = 1 start_experience_factor = 0.5" 
						owner = SAT
						prioritize_location = 10124
					}
				}
			}
			526 ={
				create_unit = {
					division = "name = \"Sanshikan Loyalists\" division_template = \"Sanshikan Loyalists\" start_equipment_factor = 1 start_experience_factor = 0.3" 
					owner = SAT
					prioritize_location = 10124
				}
				create_unit = {
					division = "name = \"Sanshikan Loyalists\" division_template = \"Sanshikan Loyalists\" start_equipment_factor = 1 start_experience_factor = 0.3" 
					owner = SAT
					prioritize_location = 10124
				}
			}
		}
		declare_war_on = {
			target = RYU
			type = puppet_wargoal_focus
		}
	}
}

country_event = {
	id = ryukyu.33
	title = ryukyu.33.t
	desc = ryukyu.33.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.33.a 
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = ryukyu.34
	title = ryukyu.34.t
	desc = ryukyu.34.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.34.a 
		ai_chance = { factor = 100 }
		RYU = { country_event = { id = ryukyu.35 days = 5 } }
		
	}
}

country_event = {
	id = ryukyu.35
	title = ryukyu.35.t
	desc = ryukyu.35.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.35.a 
		ai_chance = { factor = 100 }
		#hidden_effect = { add_ideas = Oceania_xiang_ling }
		custom_effect_tooltip = available_political_advisor
		#show_ideas_tooltip = Oceania_xiang_ling
	}
}

country_event = {
	id = ryukyu.41
	title = ryukyu.41.t
	desc = ryukyu.41.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.41.a 
		ai_chance = { factor = 100 }
		remove_ideas = RYU_the_veil_of_independance
		every_country = {
			limit = {
				has_war_with = RYU
			}
			white_peace = RYU 
		}
		
		hidden_effect = {
			RYU = { remove_from_array = { national_religion_array = global.shinto } }
			set_truce = {
				target = SAT
				days = 3600
			}
			set_truce = {
				target = TSH
				days = 3600
			}
		}
	}
}

country_event = {
	id = ryukyu.42
	title = ryukyu.42.t
	desc = ryukyu.42.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.42.a 
		ai_chance = { factor = 100 }
		TSH = { country_event = { id = ryukyu.43 days = 1 } }
	}
}

country_event = {
	id = ryukyu.43
	title = ryukyu.43.t
	desc = ryukyu.43.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.43.a 
		ai_chance = { factor = 100 }
		add_state_claim = 526
		SAT = { country_event = { id = ryukyu.44 days = 1 } }
	}
}

country_event = {
	id = ryukyu.44
	title = ryukyu.44.t
	desc = ryukyu.44.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.44.a 
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = ryukyu.45
	title = ryukyu.45.t
	desc = ryukyu.45.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.45.a 
		ai_chance = { factor = 100 }
		diplomatic_relation = {
			country = RYU
			relation = guarantee
			active = yes
		}
	}
}


news_event = {
	id = ryukyu.46
	title = ryukyu.46.t
	desc = ryukyu.46.d
	picture = GFX_report_event_soviet_finnish_pact
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.46.a 
		ai_chance = { factor = 100 }
		trigger = {
			TAG = RYU
		}
		hidden_effect = { RYU = { add_to_array = { national_religion_array = global.protestant } } }
		
		swap_ideas = {
			remove_idea = border_control
			add_idea = open_borders
		}
		#swap_ideas = {
		#	remove_idea = no_constitution
		#	add_idea = limited_constitution
		#}
		custom_effect_tooltip = RYU_amami_demilitarized_zone_set
		hidden_effect = { 
			if = {
				limit = { RYU = { is_subject_of = SAT } }
				SAT = {
					set_autonomy = {
						target = RYU
						autonomy_state = autonomy_free
						end_wars = no
						end_civil_wars = no
					}
				}
			}
			else_if = {
				limit = { RYU = { is_subject_of = TSH } }
				TSH = {
					set_autonomy = {
						target = RYU
						autonomy_state = autonomy_free
						end_wars = no
						end_civil_wars = no
					}
				}
			}
			1190 = { set_demilitarized_zone = yes }
			add_ideas = RYU_ryukyu_treaty
			set_rule = {
				can_create_factions = no
				can_join_factions = no
				can_not_declare_war = yes
				can_force_government = no
				can_boost_other_ideologies = no
			}
			#swap_ideas = {
			#	remove_idea = religion_shinto
			#	add_idea = religion_protestant
			#}
			RYU = { country_event = { id = RYU_sho_coup_aftermath.1 days = 1080 } }
			remove_ideas = RYU_major_maritime_commerce_hub
			add_ideas = RYU_major_maritime_commerce_hub_independance
			remove_opinion_modifier = { target = SAT modifier = RYU_satsuma_vassal }
			remove_opinion_modifier = { target = TSH modifier = RYU_satsuma_vassal }			
		}
		remove_ideas = RYU_foreigner_discrimination_laws
	}
	option = {
		name = ryukyu.46.b 
		ai_chance = { factor = 100 }
		trigger = {
			TAG = QNG
		}
		hidden_effect = {
			QNG = {
				diplomatic_relation = {
					country = RYU
					relation = docking_rights
					active = yes
				}
			}
		}
		custom_effect_tooltip = RYU_amami_demilitarized_zone_set
		RYU = { country_event = { id = ryukyu.47 days = 6 } }
	}
	option = {
		name = ryukyu.46.c 
		ai_chance = { factor = 100 }
		trigger = {
			TAG = TSH
		}
		custom_effect_tooltip = RYU_amami_demilitarized_zone_set
		hidden_effect = {
			remove_opinion_modifier = { target = RYU modifier = RYU_satsuma_vassal }
		}
	}
	option = {
		name = ryukyu.46.e 
		ai_chance = { factor = 100 }
		trigger = {
			TAG = SAT
		}
		custom_effect_tooltip = RYU_amami_demilitarized_zone_set
		remove_ideas = SAT_the_prestige_of_ryukyu
		hidden_effect = {
			remove_opinion_modifier = { target = RYU modifier = RYU_satsuma_vassal }
		}
	}
	option = {
		name = ryukyu.46.f
		ai_chance = { factor = 100 }
		trigger = {
			OR = {
				AND = {
					TAG = ENG
					RYU = { has_country_flag = RYU_ENG_support }
				}
				AND = {
					TAG = USA
					RYU = { has_country_flag = RYU_USA_support }
				}
				AND = {
					TAG = FRA
					RYU = { has_country_flag = RYU_FRA_support }
				}
			}
		}
		custom_effect_tooltip = RYU_amami_demilitarized_zone_set
		add_political_power = 150
		if = {
			limit = {
				TAG = ENG
			}
			hidden_effect = {
				ENG = {
					diplomatic_relation = {
						country = RYU
						relation = docking_rights
						active = yes
					}
				}
			}
			RYU = { country_event = { id = ryukyu.48 days = 12 } }
		}
		if = {
			limit = {
				TAG = USA
			}
			hidden_effect = {
				USA = {
					diplomatic_relation = {
						country = RYU
						relation = docking_rights
						active = yes
					}
				}
			}
			RYU = { country_event = { id = ryukyu.49 days = 8 } }
		}
		if = {
			limit = {
				TAG = FRA
			}
			hidden_effect = {
				FRA = {
					diplomatic_relation = {
						country = RYU
						relation = docking_rights
						active = yes
					}
				}
			}
			RYU = { country_event = { id = ryukyu.50 days = 10 } }
		}
	}
	option = {
		name = ryukyu.46.g
		ai_chance = { factor = 100 }
		trigger = {
			NOT = { TAG = RYU }
			NOT = { TAG = QNG }
			NOT = { TAG = TSH }
			NOT = { TAG = SAT }
			NOT = { TAG = USA }
			NOT = { TAG = ENG }
			NOT = { TAG = FRA }
		}
	}
	
	option = {
		name = ryukyu.46.g
		ai_chance = { factor = 100 }
		trigger = {
			OR = {
				AND = {
					TAG = ENG
					RYU = { NOT = { has_country_flag = RYU_ENG_support } }
				}
				AND = {
					TAG = USA
					RYU = { NOT = { has_country_flag = RYU_USA_support } }
				}
				AND = {
					TAG = FRA
					RYU = { NOT = { has_country_flag = RYU_FRA_support } }
				}
			}
		}
	}
}

country_event = {
	id = ryukyu.47
	title = ryukyu.47.t
	desc = ryukyu.47.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.47.a 
		ai_chance = { factor = 100 }
		hidden_effect = { add_ideas = Oceania_qing_tributary }
		set_variable = { most_favoured_country = QNG.id }
		hidden_effect = { add_ideas = RYU_zhang_zhi }
		custom_effect_tooltip = available_political_advisor
		custom_effect_tooltip = RYU_zhang_zhi
		set_country_flag = RYU_chinese_advisor
	}
}

country_event = {
	id = ryukyu.48
	title = ryukyu.48.t
	desc = ryukyu.48.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.48.a 
		ai_chance = { factor = 100 }
		swap_ideas={
			add_idea=slavery_all_but_name
			remove_idea=slavery
		}
		activate_decision = RYU_british_industrial_investment
		hidden_effect = { add_ideas = RYU_thomas_williamson }
		custom_effect_tooltip = available_political_advisor
		custom_effect_tooltip = RYU_thomas_williamson
		set_country_flag = RYU_british_advisor
	}
}

country_event = {
	id = ryukyu.49
	title = ryukyu.49.t
	desc = ryukyu.49.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.49.a 
		ai_chance = { factor = 100 }
		activate_decision = RYU_usa_industrial_investment
		#hidden_effect = { add_ideas = RYU_matthew_calbraith_perry }
		custom_effect_tooltip = available_political_advisor
		#custom_effect_tooltip = RYU_matthew_calbraith_perry
		set_country_flag = RYU_usa_advisor
	}
}

country_event = {
	id = ryukyu.50
	title = ryukyu.50.t
	desc = ryukyu.50.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.50.a 
		ai_chance = { factor = 100 }
		activate_decision = RYU_french_industrial_investment
		hidden_effect = { add_ideas = RYU_francis_rousseau }
		custom_effect_tooltip = available_political_advisor
		custom_effect_tooltip = RYU_francis_rousseau
		set_country_flag = RYU_french_advisor
	}
}

country_event = {
	id = ryukyu.51
	title = ryukyu.51.t
	desc = ryukyu.51.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.51.a 
		ai_chance = { factor = 100 }
		every_country = {
			limit = {
				has_war_with = RYU
			}
			white_peace = RYU 
		}
	}
}

country_event = {
	id = ryukyu.52
	title = ryukyu.52.t
	desc = ryukyu.52.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.52.a 
		ai_chance = { factor = 100 }
		TSH = { country_event = { id = ryukyu.53 days = 1 } }
	}
}

country_event = {
	id = ryukyu.53
	title = ryukyu.53.t
	desc = ryukyu.53.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.53.a 
		ai_chance = { factor = 100 }
		SAT = { country_event = { id = ryukyu.54 days = 1 } }
	}
}

country_event = {
	id = ryukyu.54
	title = ryukyu.54.t
	desc = ryukyu.54.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.54.a 
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = ryukyu.55
	title = ryukyu.55.t
	desc = ryukyu.55.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.55.a 
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = ryukyu.36
	title = ryukyu.36.t
	desc = ryukyu.36.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = ryukyu.36.a 
		ai_chance = { factor = 100 }
		add_political_power = 150
	}
}
