namespace = mpo_interactions_events

# # # OFFER CONFEDERATION # # #

#Handles effects of offer confederation and assigns events
mpo_interactions_events.0001 = {
	hidden = yes

	trigger = {
		scope:actor = {
			is_ruler = yes
			is_landed = yes
		}
		scope:recipient = {
			is_ruler = yes
			is_landed = yes
		}
	}

	immediate = {
		#Confederation doesn't exist and actor is becoming liege
		if = {
			limit = {
				scope:actor = {
					is_confederation_member = no
				}
			}
			scope:actor = {
				#create culturally-named duchy title if you both have same culture
				if = {
					limit = {
						culture = {	
							this = scope:recipient.culture
						}
						NOT = {
							any_confederation = {
								has_variable = confederation_culture
								var:confederation_culture = scope:actor.culture
							}
						}
					}
					create_confederation = {
						name = CONFEDERATION_CULTURE_NAME
					}
					scope:new_confederation = {
						set_variable = {
							name = confederation_culture
							value = scope:actor.culture
						}
						
					}
				}
				#Duchy title fallback
				else = {
					#You two are in the same duchy, name it after that
					if = {
						limit = {
							exists = scope:recipient.capital_county
							capital_county.duchy = {
								any_de_jure_county = {
									this = scope:recipient.capital_county
								}
							}
						}
						capital_county = {
							duchy = {
								save_scope_as = capital_duchy
							}
						}
					}
					#You are a duke, name it after your duchy
					else_if = {
						limit = {
							primary_title = {
								tier = tier_duchy
								any_de_jure_county = {
									holder = scope:recipient
								}
							}
						}
						primary_title = {
							save_scope_as = capital_duchy
						}
					}
					#Name after your capital duchy
					else = {
						capital_county = {
							duchy = {
								save_scope_as = capital_duchy
							}
						}
					}
					create_confederation = {
						name = CONFEDERATION_DUCHY_NAME
					}
				}
				scope:recipient = {
					save_scope_as = other_confederate
				}
				trigger_event = {
					id = mpo_interactions_events.0002
					days = 1
				}
			}
			scope:new_confederation = {
				add_confederation_member = scope:recipient
			}
		}
		#Confederation already exists
		else = {
			scope:actor.confederation = {
				add_confederation_member = scope:recipient
			}
			#letter event
			scope:actor = {
				trigger_event = {
					id = mpo_interactions_events.0003
					days = 1
				}
			}
		}
		#Vassal event
		scope:actor = {
			save_scope_as = other_confederate
		}
		scope:recipient = {
			trigger_event = {
				id = mpo_interactions_events.0002
				days = 1
			}
		}
	}
}

#Confederation event
mpo_interactions_events.0002 = {
	type = character_event
	theme = vassal
	title = mpo_interactions_events.0002.t
	desc = {
		desc = mpo_interactions_events.0002.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:new_confederation
				}
				desc = mpo_interactions_events.0002.desc_new
			}
			desc = mpo_interactions_events.0002.desc_joining
		}
	} 
	override_background = {
		reference = bp1_bonfire
	}
	override_effect_2d = {
		reference = smoke
	}
	left_portrait = {
		character = root
		animation = marshal_dagger
		camera = camera_event_very_left
	}
	right_portrait = {
		character = scope:other_confederate
		animation = marshal_dagger
		camera = camera_event_very_right
	}
	immediate = {
		confederation = {
			save_scope_as = confederation
		}
		if = {
			limit = {
				exists = scope:new_confederation
			}
			custom_tooltip = new_confederation_created_tt
		}
		else = {
			custom_tooltip = joined_confederation_tt
		}
		custom_tooltip = confederation_defensive_wars_tt
		custom_tooltip = unlock_leave_confederation_interaction_tt
		show_as_tooltip = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add_character_modifier = {
					modifier = mpo_confederation_member_modifier
					years = 5
				}
				capital_county ?= {
					change_county_fertility = major_county_fertility_level_gain
				}
			}
		}
		custom_tooltip = confederation_raiding_attacking_tt
		if = {
			limit = {
				government_has_flag = government_is_nomadic
			}
			custom_tooltip = confederation_restrictions_warning_tt
		}
		else = {
			custom_tooltip = confederation_restrictions_tribe_warning_tt
		}
		if = {
			limit = {
				government_has_flag = government_is_nomadic
			}
			custom_tooltip = confederation_migrating_leaving_warning_tt
		}
	}
	#Accept
	option = {
		name = mpo_interactions_events.0002.a
	}
}

#Confederation acceptance letter event
mpo_interactions_events.0003 = {
	type = letter_event
	sender = scope:recipient
	opening = {
		desc = mpo_interactions_events.0003.opening
	}
	desc = mpo_interactions_events.0003.desc

	immediate = {
		confederation = {
			save_scope_as = confederation
		}
		custom_tooltip = recipient_joined_confederation_tt
	}
	
	#Accept
	option = {
		name = mpo_interactions_events.0003.a
	}
}

#Confderation rejection letter event
mpo_interactions_events.0004 = {
	type = letter_event
	sender = scope:recipient
	opening = {
		desc = mpo_interactions_events.0004.opening
	}
	desc = {
		desc = mpo_interactions_events.0004.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:asking_to_join
				}
				desc = mpo_interactions_events.0004.desc_join
			}
			desc = mpo_interactions_events.0004.desc_offer
		}
	}

	#Accept
	option = {
		name = mpo_interactions_events.0004.a
	}
}

# # # TEACH COMMANDER TRAITS # # #

# Ward's Martial Drill - Success Event
mpo_interactions_events.0101 = {
	type = character_event
	title = mpo_interactions_events.0101.t
	desc = {
		desc = mpo_interactions_events.0101.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = { scope:target_trait = trait:logistician }
				desc = mpo_interactions_events.0101.desc_logistician
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:military_engineer }
				desc = mpo_interactions_events.0101.desc_military_engineer
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:aggressive_attacker }
				desc = mpo_interactions_events.0101.desc_aggressive_attacker
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:unyielding_defender }
				desc = mpo_interactions_events.0101.desc_unyielding_defender
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:forder }
				desc = mpo_interactions_events.0101.desc_forder
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:flexible_leader }
				desc = mpo_interactions_events.0101.desc_flexible_leader
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:desert_warrior }
				desc = mpo_interactions_events.0101.desc_desert_warrior
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:jungle_stalker }
				desc = mpo_interactions_events.0101.desc_jungle_stalker
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:reaver }
				desc = mpo_interactions_events.0101.desc_reaver
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:reckless }
				desc = mpo_interactions_events.0101.desc_reckless
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:holy_warrior }
				desc = mpo_interactions_events.0101.desc_holy_warrior
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:open_terrain_expert }
				desc = mpo_interactions_events.0101.desc_open_terrain_expert
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:rough_terrain_expert}
				desc = mpo_interactions_events.0101.desc_rough_terrain_expert
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:forest_fighter }
				desc = mpo_interactions_events.0101.desc_forest_fighter
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:cautious_leader }
				desc = mpo_interactions_events.0101.desc_cautious_leader
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:organizer }
				desc = mpo_interactions_events.0101.desc_organizer
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:winter_soldier }
				desc = mpo_interactions_events.0101.desc_winter_soldier
			}
		}
	}
	theme = martial
	override_background = {
		trigger = { scope:target_trait = trait:open_terrain_expert }
		reference = wilderness_steppe
	}
	override_background = {
		trigger = { scope:target_trait = trait:rough_terrain_expert }
		reference = wilderness_mountains
	}
	override_background = {
		trigger = { scope:target_trait = trait:jungle_stalker }
		reference = wilderness_jungle
	}
	override_background = {
		trigger = { scope:target_trait = trait:winter_soldier }
		reference = ep2_hunt_snowy_forest
	}
	override_background = {
		trigger = { scope:target_trait = trait:desert_warrior }
		reference = wilderness_desert
	}
	override_background = {
		trigger = { scope:target_trait = trait:forest_fighter }
		reference = wilderness_forest
	}
	override_background = {
		trigger = {
			OR = {
				scope:target_trait = trait:reckless
				scope:target_trait = trait:forder
			}
		}
		reference = ep2_travel_bridge
	}
	override_background = {
		reference = army_camp
	}
	widget = {
		is_shown = {
			location = { has_winter_trigger = yes }
			scope:target_trait = trait:winter_soldier
		}
		gui = "event_window_widget_vfx_snow"
		container = "foreground_shader_vfx_container"
	}
	
	left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:recipient
		animation = wooden_sword_coup_degrace
	}

	trigger = {
		exists = scope:target_trait
	}

	immediate = {
	}

	option = { 
		name = mpo_interactions_events.0101.a
		flavor = mpo_interactions_events.0101.a.flavor
		add_opinion = {
			target = scope:recipient
			modifier = pleased_opinion
			opinion = 20
		}
		scope:recipient = {
			add_trait = scope:target_trait
			add_opinion = {
				target = root
				modifier = admiration_opinion
				opinion = 20
			}
		}
		if = {
			limit = {
				scope:recipient = {
					any_parent = {
						NOT = { this = root }
						is_ai = no
					}
				}
			}
			scope:recipient = {
				every_parent = {
					limit = {
						NOT = { this = root }
					 	is_ai = no
					}
					send_interface_message = {
						type = event_childhood_good_text
						title = guardian_influenced_commander
						desc = guardian_influenced_commander_desc
						left_icon = scope:recipient
						right_icon = scope:actor
					}
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
		}
	}
}

# Ward's Martial Drill - Failure Event
mpo_interactions_events.0102 = {
	type = character_event
	title = mpo_interactions_events.0102.t
	desc = {
		desc = mpo_interactions_events.0102.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = { scope:target_trait = trait:logistician }
				desc = mpo_interactions_events.0102.desc_logistician
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:military_engineer }
				desc = mpo_interactions_events.0102.desc_military_engineer
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:aggressive_attacker }
				desc = mpo_interactions_events.0102.desc_aggressive_attacker
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:unyielding_defender }
				desc = mpo_interactions_events.0102.desc_unyielding_defender
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:forder }
				desc = mpo_interactions_events.0102.desc_forder
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:flexible_leader }
				desc = mpo_interactions_events.0102.desc_flexible_leader
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:desert_warrior }
				desc = mpo_interactions_events.0102.desc_desert_warrior
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:jungle_stalker }
				desc = mpo_interactions_events.0102.desc_jungle_stalker
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:reaver }
				desc = mpo_interactions_events.0102.desc_reaver
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:reckless }
				desc = mpo_interactions_events.0102.desc_reckless
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:holy_warrior }
				desc = mpo_interactions_events.0102.desc_holy_warrior
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:open_terrain_expert }
				desc = mpo_interactions_events.0102.desc_open_terrain_expert
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:rough_terrain_expert}
				desc = mpo_interactions_events.0102.desc_rough_terrain_expert
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:forest_fighter }
				desc = mpo_interactions_events.0102.desc_forest_fighter
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:cautious_leader }
				desc = mpo_interactions_events.0102.desc_cautious_leader
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:organizer }
				desc = mpo_interactions_events.0102.desc_organizer
			}
			triggered_desc = {
				trigger = { scope:target_trait = trait:winter_soldier }
				desc = mpo_interactions_events.0102.desc_winter_soldier
			}
		}
	}
	theme = martial
	override_background = {
		trigger = { scope:target_trait = trait:open_terrain_expert }
		reference = wilderness_steppe
	}
	override_background = {
		trigger = { scope:target_trait = trait:rough_terrain_expert }
		reference = wilderness_mountains
	}
	override_background = {
		trigger = { scope:target_trait = trait:jungle_stalker }
		reference = wilderness_jungle
	}
	override_background = {
		trigger = { scope:target_trait = trait:winter_soldier }
		reference = ep2_hunt_snowy_forest
	}
	override_background = {
		trigger = { scope:target_trait = trait:desert_warrior }
		reference = wilderness_desert
	}
	override_background = {
		trigger = { scope:target_trait = trait:forest_fighter }
		reference = wilderness_forest
	}
	override_background = {
		trigger = { scope:target_trait = trait:reckless }
		reference = ep2_travel_bridge
	}
	override_background = {
		reference = army_camp
	}

	widget = {
		is_shown = {
			location = { has_winter_trigger = yes }
			scope:target_trait = trait:winter_soldier
		}
		gui = "event_window_widget_vfx_snow"
		container = "foreground_shader_vfx_container"
	}

	left_portrait = {
		character = root
		animation = menacing_wooden_sword
	}
	right_portrait = {
		character = scope:recipient
		animation = wooden_sword_yield_start
	}

	option = { 
		name = mpo_interactions_events.0102.a
		flavor = mpo_interactions_events.0102.a.flavor
		scope:recipient = {
			add_opinion = {
				target = root
				modifier = confused_opinion
				opinion = -20
			}
		}
		add_opinion = {
			target = scope:recipient
			modifier = disappointed_opinion
			opinion = -20
		}
		if = {
			limit = {
				scope:recipient = {
					any_parent = {
						NOT = { this = root }
						is_ai = no
					}
				}
			}
			scope:recipient = {
				every_parent = {
					limit = {
						NOT = { this = root }
					 	is_ai = no
					}
					send_interface_message = {
						type = event_childhood_bad_text
						title = guardian_influenced_commander_fail
						desc = guardian_influenced_commander_fail_desc
						left_icon = scope:recipient
						right_icon = scope:actor
					}
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
		}
	}

	#force it
	option = { 
		name = mpo_interactions_events.0102.b
		flavor = mpo_interactions_events.0102.b.flavor
		add_dread = 5
		add_prestige = medium_prestige_loss
		scope:recipient = {
			add_trait = scope:target_trait
			add_opinion = {
				target = root
				modifier = confused_opinion
				opinion = -40
			}
			add_stress = medium_stress_impact_gain
		}
		if = {
			limit = {
				scope:recipient = {
					any_parent = {
						NOT = { this = root }
						is_ai = no
					}
				}
			}
			scope:recipient = {
				every_parent = {
					limit = {
						NOT = { this = root }
					 	is_ai = no
					}
					send_interface_message = {
						type = event_childhood_good_text
						title = guardian_influenced_commander
						desc = guardian_influenced_commander_desc
						left_icon = scope:recipient
						right_icon = scope:actor
					}
				}
			}
		}
		stress_impact = {
			base = medium_stress_impact_gain
		}

		ai_chance = {
			base = 0 #ai shouldn't inflate the trait count, so no access to forcing it through
		}
	}
}

#Blood brother acceptance event for actor
mpo_interactions_events.0006 = {
	type = character_event
	theme = alliance
	title = mpo_interactions_events.0006.t
	desc = {
		desc = mpo_interactions_events.0006.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = {
					culture = {
						has_cultural_pillar = heritage_mongolic
					}
				}
				desc = mpo_interactions_events.0006.desc_anda
			}
			desc = mpo_interactions_events.0006.desc_no_anda
		}
		desc = mpo_interactions_events.0006.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:shared_foe
				}
				desc = mpo_interactions_events.0006.desc_shared_foe
			}
			triggered_desc = {
				trigger = {
					always = scope:memories_together
				}
				desc = mpo_interactions_events.0006.desc_memories
			}
			triggered_desc = {
				trigger = {
					always = scope:war_allies
				}
				desc = mpo_interactions_events.0006.desc_war_allies
			}
			desc = mpo_interactions_events.0006.desc_outro
		}
	}
	override_background = {
		trigger = {
			government_has_flag = government_is_nomadic
		}
		reference = mpo_campfire_steppe
	}
	override_background = {
		trigger = {
			NOT = { government_has_flag = government_is_nomadic }
			location = {
				OR = {
					terrain = desert
					terrain = drylands
					terrain = oasis
					terrain = floodplains
					terrain = desert_mountains
				}
			}
		}
		reference = ce1_legendary_oasis
	}
	override_background = {
		trigger = {
			#NOT = { government_has_flag = government_is_nomadic }
			location = {
				NOR = {
					terrain = desert
					terrain = drylands
					terrain = oasis
					terrain = floodplains
					terrain = desert_mountains
				}
				NAND = {
					location_has_harsh_winter_trigger = yes
					OR = {
						current_month >= 11
						current_month <= 4
					}
				}
			}		
		}
		reference = ce1_legendary_spring
	}
	override_background = {
		trigger = {
			#NOT = { government_has_flag = government_is_nomadic }
			location = {
				NOR = {
					terrain = desert
					terrain = drylands
					terrain = oasis
					terrain = floodplains
					terrain = desert_mountains
				}
				location_has_harsh_winter_trigger = yes
				OR = {
					current_month >= 11
					current_month <= 4
				}
			}
		}
		reference = sitting_room
	}

	left_portrait = {
		character = root
		animation = hunting_knife_start
	}
	right_portrait = {
		character = scope:blood_bro
		animation = celebrate_dagger
	}
	lower_right_portrait = scope:shared_foe

	#Show the right tooltip based on who this is
	immediate = {
		if = {
			limit = {
				this = scope:actor
			}
			mpo_blood_brother_tooltip_actor_effect = yes
		}
		else = {
			mpo_blood_brother_tooltip_recipient_effect = yes
		}
		if = {
			limit = {
				scope:blood_bro = {
					mpo_blood_brother_august_trigger = { OTHER_BROTHER = root }
				}
			}
			scope:blood_bro = {
				add_character_flag = august_blood_brother
			}
		}
		if = {
			limit = {
				scope:blood_bro = {
					mpo_blood_brother_warrior_trigger = { OTHER_BROTHER = root }
				}
			}
			scope:blood_bro = {
				add_character_flag = warrior_blood_brother
			}
		}
		if = {
			limit = {
				scope:blood_bro = {
					mpo_blood_brother_clever_trigger = yes
				}
			}
			scope:blood_bro = {
				add_character_flag = clever_blood_brother
			}
		}
		if = {
			limit = {
				scope:blood_bro = {
					mpo_blood_brother_loving_trigger = yes
				}
			}
			scope:blood_bro = {
				add_character_flag = loving_blood_brother
			}
		}
	}
	#My blood brother will help me destroy our common foe
	option = {
		trigger = {
			exists = scope:shared_foe
		}
		name = mpo_interactions_events.0006.a
		flavor = mpo_interactions_events.0006.a.flavor
		add_internal_flag = special
		add_character_modifier = blood_brother_foe_modifier
		custom_tooltip = blood_brother_foe_modifier_cb_reduction
		custom_tooltip = blood_brother_modifier_lasts_tt
		set_variable = {
			name = blood_brother_foe
			value = scope:shared_foe
		}

		stress_impact = {
			vengeful = miniscule_stress_impact_loss
			sadistic = miniscule_stress_impact_loss
			wrathful = miniscule_stress_impact_loss
			compassionate = miniscule_stress_impact_gain
			forgiving = miniscule_stress_impact_gain
			content = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 150
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_compassion = -1
			}
			modifier = {
				add = -50
				OR = {
					has_trait = compassionate
					has_trait = forgiving
					has_trait = content
				}
			}
		}
	}
	#My blood brother is higher-ranked and influential
	option = {
		trigger = {
			scope:blood_bro = {
				has_character_flag = august_blood_brother
			}
		}
		name = mpo_interactions_events.0006.b
		add_internal_flag = special
		if = {
			limit = {
				government_has_flag = government_is_nomadic
			}
			add_character_modifier = {
				modifier = blood_brother_august_nomadic_modifier
			}
		}
		else = {
			add_character_modifier = {
				modifier = blood_brother_august_modifier
			}
		}
		custom_tooltip = blood_brother_modifier_lasts_tt

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
				ai_energy = 1
			}
		}
	}
	#My blood brother is a powerful defender and dread warrior
	option = {
		trigger = {
			scope:blood_bro = {
				has_character_flag = warrior_blood_brother
			}
		}
		name = mpo_interactions_events.0006.c
		add_internal_flag = special
		
		add_character_modifier = {
			modifier = blood_brother_warrior_modifier
		}
		custom_tooltip = blood_brother_modifier_lasts_tt

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_zeal = 1
			}
		}
	}
	#My blood brother is clever and intelligent
	option = {
		trigger = {
			scope:blood_bro = {
				has_character_flag = clever_blood_brother
			}
		}
		name = mpo_interactions_events.0006.d
		add_internal_flag = special
		if = {
			limit = {
				government_has_flag = government_is_nomadic
			}
			add_character_modifier = {
				modifier = blood_brother_clever_nomadic_modifier
			}
		}
		else = {
			add_character_modifier = {
				modifier = blood_brother_clever_modifier
			}
		}
		
		custom_tooltip = blood_brother_modifier_lasts_tt

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_sociability = 1
			}
		}
	}
	#My blood brother is loving and beloved
	option = {
		trigger = {
			scope:blood_bro = {
				has_character_flag = loving_blood_brother
			}
		}
		name = mpo_interactions_events.0006.e
		add_internal_flag = special

		add_character_modifier = {
			modifier = blood_brother_loving_modifier
		}
		custom_tooltip = blood_brother_modifier_lasts_tt

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1
				ai_energy = -1
			}
		}
	}
	#My blood brother is just some guy, but he cool
	option = {
		trigger = {
			scope:blood_bro = {
				NOR = {
					has_character_flag = warrior_blood_brother
					has_character_flag = august_blood_brother
					has_character_flag = loving_blood_brother
					has_character_flag = clever_blood_brother
				}
			}
		}
		name = mpo_interactions_events.0006.f

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -1
				ai_vengefulness = -1
			}
		}
	}
	after = {
		scope:blood_bro = {
			remove_character_flag = warrior_blood_brother
			remove_character_flag = august_blood_brother
			remove_character_flag = loving_blood_brother
			remove_character_flag = clever_blood_brother
		}
	}
}

# Pledge Tribute - Accepted
mpo_interactions_events.0010 = {
	type = letter_event
	sender = scope:recipient
	opening = {
		desc = mpo_interactions_events.0010.opening
	}
	desc = mpo_interactions_events.0010.desc

	#Nice
	option = {
		name = mpo_interactions_events.0010.a
		break_subject_contract_and_establish_tributary_effect = { SUZERAIN = scope:recipient TRIBUTARY = scope:actor }
	}
}

# Pledge Tribute - Denied
mpo_interactions_events.0011 = {
	type = letter_event
	sender = scope:recipient
	opening = {
		desc = mpo_interactions_events.0011.opening
	}
	desc = mpo_interactions_events.0011.desc

	#Ay
	option = {
		name = mpo_interactions_events.0011.a
		scope:recipient = {
			add_opinion = {
				target = scope:actor
				modifier = annoyed_opinion
				opinion = -15
			}
		}
	}
}

# Herd Gift Sent
mpo_interactions_events.0020 = {
	type = letter_event
	opening = {
		desc = char_interaction.0030.opening # Positive greeting
	}
	desc = mpo_interactions_events.0020.desc
		
	sender = scope:actor

	option = {
		name = mpo_interactions_events.0020.a

		show_as_tooltip = {
			scope:actor = {
				pay_herd = {
					target = scope:recipient
					value = domicile.herd_gift_value
				}
			}
			scope:recipient = {
				add_opinion = {
					target = scope:actor
					modifier = sent_herd_opinion
					opinion = 20
				}
			}
		}
	}
}

#Confederation acceptance letter event
mpo_interactions_events.0030 = {
	type = letter_event
	sender = scope:recipient
	opening = {
		desc = mpo_interactions_events.0030.opening
	}
	desc = mpo_interactions_events.0030.desc

	immediate = {
		scope:recipient.confederation = {
			save_scope_as = confederation
		}
		scope:confederation = {
			add_confederation_member = scope:actor
		}
	}
	
	#Accept
	option = {
		name = mpo_interactions_events.0030.a
	}
}
