add_namespace = asiageneraldiplomatic


#Switzerland Offers Treaty of Friendship
country_event = {
	id = asiageneraldiplomatic.1
	title = asiageneraldiplomatic.1.t
	desc = asiageneraldiplomatic.1.d
	picture = GFX_report_event_second_opium_war_6

	is_triggered_only = yes
	
	#Yes
	option = {
		name = asiageneraldiplomatic.1.a
		ai_chance = { factor = 80 }
		hidden_effect = {
			SWI = { 
				country_event = {
					id = asiageneraldiplomatic.2
					days = 1
				}
			}
		}
	}
	
	#No
	option = {
		name = asiageneraldiplomatic.1.b
		ai_chance = { factor = 20 }
		hidden_effect = {
			SWI = { 
				country_event = {
					id = asiageneraldiplomatic.3
					days = 1
				}
			}
		}
	}
}

# ACCEPTED
country_event = {
	id = asiageneraldiplomatic.2
	title = asiageneraldiplomatic.2.t
	desc = asiageneraldiplomatic.2.d
	picture = GFX_report_event_second_opium_war_6

	is_triggered_only = yes
	
	
	option = {
		name = asiageneraldiplomatic.2.a
		ai_chance = { factor = 100 }
		if = {
			limit = {
				FROM = { tag = JAP }
			}
			add_opinion_modifier = { target = JAP modifier = medium_increase }
			reverse_add_opinion_modifier = { target = JAP modifier = medium_increase }
		}
		else = {
			add_opinion_modifier = { target = TSH modifier = medium_increase }
			reverse_add_opinion_modifier = { target = TSH modifier = medium_increase }
		}
	}
}

# REJECTED
country_event = {
	id = asiageneraldiplomatic.3
	title = asiageneraldiplomatic.3.t
	desc = asiageneraldiplomatic.3.d
	picture = GFX_report_event_second_opium_war_6

	is_triggered_only = yes
	
	
	option = {
		name = asiageneraldiplomatic.3.a
		ai_chance = { factor = 100 }
		if = {
			limit = {
				FROM = { tag = JAP }
			}
			add_opinion_modifier = { target = JAP modifier = small_decrease }
			reverse_add_opinion_modifier = { target = JAP modifier = small_decrease }
		}
		else = {
			add_opinion_modifier = { target = TSH modifier = small_decrease }
			reverse_add_opinion_modifier = { target = TSH modifier = small_decrease }
		}
	}
}

# Denmark demands trading privileges 
country_event = {
	id = asiageneraldiplomatic.4
	title = asiageneraldiplomatic.4.t
	desc = asiageneraldiplomatic.4.d
	picture = GFX_report_event_second_opium_war_6
	
	is_triggered_only = yes
	
	#Yes
	option = {
		name = asiageneraldiplomatic.4.a
		ai_chance = { factor = 80 }
		add_opinion_modifier = { target = DEN modifier = medium_increase }
		reverse_add_opinion_modifier = { target = DEN modifier = medium_increase }
		DEN = { 
			country_event = {
				id = asiageneraldiplomatic.5
				days = 1
			}
		}
	}
	
	#No
	option = {
		name = asiageneraldiplomatic.4.b
		ai_chance = {
			factor = 20
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		add_opinion_modifier = { target = DEN modifier = small_decrease }
		reverse_add_opinion_modifier = { target = DEN modifier = small_decrease }
		DEN = { 
			country_event = {
				id = asiageneraldiplomatic.6
				days = 1
			}
		}
	}
}

#DEN - The Chinese Accept!
country_event = {
	id = asiageneraldiplomatic.5
	title = asiageneraldiplomatic.5.t
	desc = asiageneraldiplomatic.5.d
	picture = GFX_report_event_second_opium_war_6
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.5.a
		ai_chance = { factor = 100 }
		add_political_power = 15
		if = {
			limit = {
				NOT = { has_idea = DEN_idea_foreign_trade_treaty }
			}
			add_timed_idea = { idea = DEN_idea_foreign_trade_treaty days = 365 }
		}
		else = {
			modify_timed_idea = { idea = DEN_idea_foreign_trade_treaty days = 365 }
		}
	}
}

#DEN - The Chinese Decline!
country_event = {
	id = asiageneraldiplomatic.6
	title = asiageneraldiplomatic.6.t
	desc = asiageneraldiplomatic.6.d
	picture = GFX_report_event_second_opium_war_6
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.6.a
		ai_chance = { factor = 100 }
		add_political_power = -15
	}
}

#Belgium Offers Treaty of Friendship
country_event = {
	id = asiageneraldiplomatic.7
	title = asiageneraldiplomatic.7.t
	desc = asiageneraldiplomatic.7.d
	picture = GFX_report_event_second_opium_war_6

	is_triggered_only = yes
	
	#Yes
	option = {
		name = asiageneraldiplomatic.7.a
		ai_chance = { factor = 80 }
		hidden_effect = {
			BEL = { 
				country_event = {
					id = asiageneraldiplomatic.8
					days = 1
				}
			}
		}
	}
	
	#No
	option = {
		name = asiageneraldiplomatic.7.b
		ai_chance = { factor = 20 }
		hidden_effect = {
			BEL = { 
				country_event = {
					id = asiageneraldiplomatic.9
					days = 1
				}
			}
		}
	}
}

# ACCEPTED
country_event = {
	id = asiageneraldiplomatic.8
	title = asiageneraldiplomatic.8.t
	desc = asiageneraldiplomatic.8.d
	picture = GFX_report_event_second_opium_war_6

	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.8.a
		ai_chance = { factor = 100 }
		if = {
			limit = {
				FROM = { tag = JAP }
			}
			add_opinion_modifier = { target = JAP modifier = medium_increase }
			reverse_add_opinion_modifier = { target = JAP modifier = medium_increase }
		}
		else = {
			add_opinion_modifier = { target = TSH modifier = medium_increase }
			reverse_add_opinion_modifier = { target = TSH modifier = medium_increase }
		}
	}
}

# REJECTED
country_event = {
	id = asiageneraldiplomatic.9
	title = asiageneraldiplomatic.9.t
	desc = asiageneraldiplomatic.9.d
	picture = GFX_report_event_second_opium_war_6

	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.9.a
		ai_chance = { factor = 100 }
		if = {
			limit = {
				FROM = { tag = JAP }
			}
			add_opinion_modifier = { target = JAP modifier = medium_decrease }
			reverse_add_opinion_modifier = { target = JAP modifier = medium_decrease }
		}
		else = {
			add_opinion_modifier = { target = TSH modifier = medium_decrease }
			reverse_add_opinion_modifier = { target = TSH modifier = medium_decrease }
		}
	}
}

#China gets offer to buy Macau
country_event = {
	id = asiageneraldiplomatic.10
	title = asiageneraldiplomatic.10.t
	desc = asiageneraldiplomatic.10.d
	
	is_triggered_only = yes
	
	#Yes
	option = {
		name = asiageneraldiplomatic.10.a
		ai_chance = { factor = 80 }
		POR = { country_event = { id = asiageneraldiplomatic.11 days = 1 } }
		add_timed_idea = { idea = eoanb_idea_macau_payment_giver days = 180 }
		transfer_state = 729
	}
	
	#No
	option = {
		name = asiageneraldiplomatic.10.b
		ai_chance = { factor = 20 }
		POR = { country_event = { id = asiageneraldiplomatic.12 days = 1 } }
	}
	
}

#POR is notified China accepted
country_event = {
	id = asiageneraldiplomatic.11
	title = asiageneraldiplomatic.11.t
	desc = asiageneraldiplomatic.11.d
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.11.a
		ai_chance = { factor = 100 }
		add_timed_idea = { idea = eoanb_idea_macau_payment_receiver days = 180 }
	}
	
}

#POR is notified China refused
country_event = {
	id = asiageneraldiplomatic.12
	title = asiageneraldiplomatic.12.t
	desc = asiageneraldiplomatic.12.d
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.12.a
		ai_chance = { factor = 100 }
	}
	
}

#Chinese Slave Workers (Macau)
country_event = {
	id = asiageneraldiplomatic.13
	title = asiageneraldiplomatic.13.t
	desc = asiageneraldiplomatic.13.d
	
	is_triggered_only = yes
	
	#Ask Portugal to stop it
	option = {
		name = asiageneraldiplomatic.13.a
		ai_chance = { factor = 80 }
		POR = { country_event = { id = asiageneraldiplomatic.14 days = 1 } }
	}
	
	#What can we do?
	option = {
		name = asiageneraldiplomatic.13.b
		ai_chance = { factor = 20 }
	}
	
}

#POR is asked to stop Macau Slave Trade
country_event = {
	id = asiageneraldiplomatic.14
	title = asiageneraldiplomatic.14.t
	desc = asiageneraldiplomatic.14.d
	
	is_triggered_only = yes
	
	#Fine, we will
	option = {
		name = asiageneraldiplomatic.14.a
		ai_chance = { factor = 30 }
		729 = { remove_dynamic_modifier = { modifier = dynmod_POR_macau_slaves }  }
		QNG = { country_event = { id = asiageneraldiplomatic.15 days = 1 } }
	}
	
	#Why would we listen to China?
	option = {
		name = asiageneraldiplomatic.14.b
		ai_chance = { factor = 70 }
		QNG = { country_event = { id = asiageneraldiplomatic.16 days = 1 } }
	}
	
}

#China is notified POR accepted
country_event = {
	id = asiageneraldiplomatic.15
	title = asiageneraldiplomatic.15.t
	desc = asiageneraldiplomatic.15.d
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.15.a
		ai_chance = { factor = 100 }
		add_opinion_modifier = { target = POR modifier = eoanb_om_POR_stopped_macau_slave }
	}
	
}

#China is notified POR refused
country_event = {
	id = asiageneraldiplomatic.16
	title = asiageneraldiplomatic.16.t
	desc = asiageneraldiplomatic.16.d
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.16.a
		ai_chance = { factor = 100 }
		add_opinion_modifier = { target = POR modifier = eoanb_om_POR_continued_macau_slave }
	}
	
}

#Peru: Chinese Slave Workers arrive
country_event = {
	id = asiageneraldiplomatic.17
	title = asiageneraldiplomatic.17.t
	desc = asiageneraldiplomatic.17.d
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.17.a
		ai_chance = { factor = 100 }
		random_owned_controlled_state = {
			add_manpower = 500
		}
		random_owned_controlled_state = {
			add_manpower = 500
		}
		random_owned_controlled_state = {
			add_manpower = 500
		}
	}
	
}

#DomRep & Spanish-Owned Cuba/Puerto-Rico: Released Chinese Slave Workers arrive to retire
country_event = {
	id = asiageneraldiplomatic.18
	title = asiageneraldiplomatic.18.t
	desc = asiageneraldiplomatic.18.d
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.18.a
		ai_chance = { factor = 100 }
		trigger = { TAG = DOM }
		random_owned_controlled_state = {
			add_manpower = 200
		}
	}
	
	option = {
		name = asiageneraldiplomatic.18.b
		ai_chance = { factor = 100 }
		trigger = { TAG = SPR }
		random_owned_controlled_state = {
			prioritize = { 315 686 1350 }
			add_manpower = 150
		}
		random_owned_controlled_state = {
			prioritize = { 315 686 1350 }
			add_manpower = 150
		}
		random_owned_controlled_state = {
			prioritize = { 315 686 1350 }
			add_manpower = 150
		}
	}
	
}

country_event = {
	id = asiageneraldiplomatic.19
	title = asiageneraldiplomatic.19.t
	desc = asiageneraldiplomatic.19.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = yes

	option = {
		name = asiageneraldiplomatic.19.a
		ai_chance = { factor = 100 }
		add_political_power = 25
	}
}

country_event = {
	id = asiageneraldiplomatic.20
	title = asiageneraldiplomatic.20.t
	desc = asiageneraldiplomatic.20.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = yes

	option = {
		name = asiageneraldiplomatic.20.a
		ai_chance = { factor = 100 }
		add_political_power = 25
	}
}

country_event = {
	id = asiageneraldiplomatic.21
	title = asiageneraldiplomatic.21.t
	desc = asiageneraldiplomatic.21.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = yes

	option = {
		name = asiageneraldiplomatic.21.a
		ai_chance = { factor = 100 }
		add_political_power = 25
	}
}

country_event = {
	id = asiageneraldiplomatic.22
	title = asiageneraldiplomatic.22.t
	desc = asiageneraldiplomatic.22.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = yes

	option = {
		name = asiageneraldiplomatic.22.a
		ai_chance = { factor = 100 }
		add_political_power = 25
	}
}


country_event = {
	id = asiageneraldiplomatic.23
	title = asiageneraldiplomatic.23.t
	desc = asiageneraldiplomatic.23.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = yes

	option = {
		name = asiageneraldiplomatic.23.a
		ai_chance = { factor = 100 }
		FROM = { country_event = asiageneraldiplomatic.24 }
		add_political_power = 50
		trigger = {
			NOT = { TAG = HOL }
		}
		if = {
			limit = {
				has_tech = rifle_equipment1
				NOT = { has_tech = rifle_equipment2 }
			}
			create_production_license = {
				target = FROM 
				equipment = {
					type = infantry_equipment_rifle_1
					
				}
				cost_factor = 0
			}
		}
		if = {
			limit = {
				has_tech = rifle_equipment2
				NOT = { has_tech = rifle_equipment3 }
			}
			create_production_license = {
				target = FROM 
				equipment = {
					type = infantry_equipment_rifle_2
				}
				cost_factor = 0
			}
		}
		if = {
			limit = {
				has_tech = rifle_equipment3
			}
			create_production_license = {
				target = FROM 
				equipment = {
					type = infantry_equipment_rifle_3
				}
				cost_factor = 0
			}
		}
	}
	
	option = {
		name = asiageneraldiplomatic.23.b
		ai_chance = { factor = 100 }
		trigger = {
			TAG = HOL
		}
		FROM = { country_event = asiageneraldiplomatic.24 }
		add_political_power = 50
		if = {
			limit = {
				has_tech = rifle_equipment1
				NOT = { has_tech = rifle_equipment2 }
			}
			create_production_license = {
				target = FROM 
				equipment = {
					type = infantry_equipment_rifle_1
					
				}
				cost_factor = 0
			}
		}
		if = {
			limit = {
				has_tech = rifle_equipment2
				NOT = { has_tech = rifle_equipment3 }
			}
			create_production_license = {
				target = FROM 
				equipment = {
					type = infantry_equipment_rifle_2
				}
				cost_factor = 0
			}
		}
		if = {
			limit = {
				has_tech = rifle_equipment3
			}
			create_production_license = {
				target = FROM 
				equipment = {
					type = infantry_equipment_rifle_3
				}
				cost_factor = 0
			}
		}
	}
}

country_event = {
	id = asiageneraldiplomatic.24
	title = asiageneraldiplomatic.24.t
	desc = asiageneraldiplomatic.24.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = yes

	option = {
		name = asiageneraldiplomatic.24.a
		ai_chance = { factor = 100 }
		army_experience = 5
	}
}

country_event = {
	id = asiageneraldiplomatic.25
	title = asiageneraldiplomatic.25.t
	desc = asiageneraldiplomatic.25.d
	picture = GFX_report_event_merchant_ship_01
	
	is_triggered_only = yes
	
	option = {
		name = asiageneraldiplomatic.25.a
		ai_chance = { factor = 100 }
		add_political_power = 35
		add_equipment_to_stockpile = { type = convoy_1 amount = 10 producer = RYU }
		custom_effect_tooltip = RYU_prosperity_mechanic_add_5
		add_to_variable = {
			var = ryu_prosperity_mechanic
			value = 5
		}
	}
}