﻿namespace = festival

#######################
# ASTRAY IN THE CROWD #
#######################

festival.001 = {
	type = activity_event
	title = festival.001.t
	desc = festival.001.desc
	theme = festival_activity 

	trigger = {
		NOT = {
			any_owned_story = { story_type = story_cycle_pet_dog }
		}
	}

	left_portrait = {
		character = root
		animation = happiness
	}
	center_portrait = {
		character = scope:guest_1
		animation = admiration 
	}
	right_portrait = {
		character = scope:guest_2
		animation = laugh
	}

	cooldown = { years = 1 }

	immediate = {
		involved_activity = {
			#get guest 1
			random_attending_character = {
				limit = {
					this != root
					is_ai = yes
				}
				save_scope_as = guest_1
			}
			#get guest 2
			random_attending_character = {
				limit = {
					this != root
					this != scope:guest_1
					is_ai = yes
				}
				save_scope_as = guest_2
			}				
		}
	}

	option = {
		name = festival.001.a
		flavor = festival.001.a.tt

		scope:activity = {
			add_activity_log_entry = {
				key = adopted_a_puppy
				score = 10
				tags = { good }
				character = root
				root = {
					start_dog_story_cycle_effect = yes
					stress_impact = {
						callous = minor_stress_impact_gain
						compassionate = minor_stress_impact_loss
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = compassionate
			}
		}
	}

	option = {
		name = festival.001.b
		flavor = festival.001.b.tt
		custom_tooltip = festival.001.b.custom.tooltip

		stress_impact = {
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
	}
}

#####################
# AN INQUIRING MIND #
#####################

festival.002 = {
	type = activity_event
	title = festival.002.t
	desc = festival.002.desc
	theme = festival_activity 

	trigger = {
	}

	left_portrait = {
		character = root
		animation = thinking
	}

	right_portrait = {
		character = scope:curious_child
		animation = clutching_toy
	}

	cooldown = { years = 1 }

	immediate = {
		create_character = {
			template = peasant_child_character
			age = { 4 7 }
			location = root.location
			faith = root.faith
			culture = root.culture
			save_scope_as = curious_child
		}
	}

	option = {
		name = festival.002.a

		scope:activity = {
			add_activity_log_entry = {
				key = edified_a_child
				score = 10
				tags = { good }
				character = root
				root = {
					duel = {
						skill = diplomacy
						value = average_skill_rating
						target = scope:curious_child
						50 = {
							compare_modifier = {
								 value = scope:duel_value
								 multiplier = 3.5
								 min = -49
							}
							desc = festival.002.a.inspired_child
							send_interface_toast = {
								title = child_is_excited
								left_icon = root
								add_prestige = minor_prestige_gain
								add_stress = minor_stress_loss
							}
						}
						50 = {
							desc = festival.002.a.bored_child
							compare_modifier = {
								 value = scope:duel_value
								 multiplier = -3.5
								 min = -49
							}
							send_interface_toast = {
								title = child_is_bored
								left_icon = root
								add_prestige = minor_prestige_loss
								add_stress = minor_stress_gain
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}

	option = {
		name = festival.002.b
		flavor = festival.002.b.flavor

		trigger = {
			has_trait = sadistic
		}

		scope:activity = {
			add_activity_log_entry = {
				key = kicked_a_child
				score = 10
				tags = { neutral }
				character = root
				root = {
					send_interface_toast = {
						title = child_is_kicked
						left_icon = root
						add_prestige = minor_prestige_loss
						add_stress = medium_stress_loss
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = gregarious
			}
		}
	}

	option = {
		name = festival.002.c

		scope:activity = {
			add_activity_log_entry = {
				key = restored_a_lost_child
				score = 10
				tags = { bad }
				character = root
				root = {
					add_stress = minor_stress_loss
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					has_trait = callous
					has_trait = shy
					has_trait = reclusive
				}
			}
		}
	}

	after = {
		scope:curious_child = {
			silent_disappearance_effect = yes
		}
	}
}

########################
# DELICIOUS DELICACIES #
########################

festival.003 = {
	type = activity_event
	title = festival.003.t
	desc = festival.003.desc
	theme = festival_activity
	override_background = tavern
	trigger = {
	}

	left_portrait = {
		character = root
		animation = happiness
	}

	cooldown = { years = 1 }

	immediate = {
	}
	
	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = 0.2
		}
	}

	option = {
		name = festival.003.a

		scope:activity = {
			add_activity_log_entry = {
				key = ate_well
				score = 10
				tags = { good }
				character = root
				root = {
					stress_impact = {
						base = medium_stress_impact_loss
						gluttonous = major_stress_impact_loss
						temperate = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = gluttonous
			}
		}
	}

	option = {
		name = festival.003.b

		scope:activity = {
			add_activity_log_entry = {
				key = practiced_temperance
				score = 10
				tags = { neutral }
				character = root
				every_attending_character = {
					custom = custom.every_attending_character
					limit = { this != root }
						add_opinion = {
						target = root
						modifier = pleased_opinion
						opinion = 5
					}
				}
				root = {
					stress_impact = {
						gluttonous = medium_stress_impact_gain
						temperate = medium_stress_impact_loss
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = temperate
			}
		}
	}
}

####################
# WHISPERED WISHES #
####################

festival.004 = {
	type = activity_event
	title = festival.004.t
	desc = festival.004.desc
	theme = festival_activity
	override_background = tanabata_festival_night_japan 
	left_portrait = {
		character = root
		animation = admiration
	}

	right_portrait = {
		trigger = {
			is_married = yes
		}
		character = primary_spouse
		animation = flirtation
	}

	cooldown = { years = 1 }

	immediate = {
	}

	option = {
		name = festival.004.a
		scope:activity = {
			add_activity_log_entry = {
				key = wished_for_prosperity
				score = 10
				tags = { good }
				character = root
				root = {
					add_prestige = minor_prestige_gain
				}
				scope:activity.activity_location.county = {
					add_county_modifier = {
						modifier = prosperity_festival_in_province_modifier
						years = 5
					}
				}
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					short_term_gold < minor_gold_value
					has_trait = greedy
				}
			}
		}
	}
	option = {
		name = festival.004.b
		trigger = {
			is_married = yes
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wished_for_love_eternal
				score = 10
				tags = { good }
				character = root
				root = {
					add_piety = minor_prestige_gain
					stress_impact = {
						base = minor_stress_impact_loss
						diligent = minor_stress_impact_loss
					}
					primary_spouse = {
						add_opinion = {
							target = root 
							modifier = thankful_opinion
							opinion = 20
						}
					}
					if = {
						limit = {
							NOT = {
								any_relation = {
									type = soulmate
								}
							}
						}
						random = {
							chance = 25
							set_relation_soulmate = { reason = soulmate_festival_reason target = primary_spouse }
						}
					}
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}
	option = {
		name = festival.004.c
		scope:activity = {
			add_activity_log_entry = {
				key = wished_for_vigor
				score = 10
				tags = { good }
				character = root
				root = {
					add_prestige = minor_prestige_gain
					stress_impact = {
						base = minor_stress_impact_loss
						diligent = minor_stress_impact_loss
					}
					add_character_modifier = {
						modifier = prosperity_festival_health_modifier
						years = 3
					}
				}
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					has_trait = ambitious
					health < fine_health
				}
			}
		}
	}
	option = {
		name = festival.004.d
		trigger = {
			is_married = no
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wished_to_find_love
				score = 10
				tags = { good }
				character = root
				root = {
					stress_impact = {
						base = minor_stress_impact_gain
						shy = minor_stress_impact_gain
						lustful = minor_stress_impact_loss
					}
					add_character_modifier = {
						modifier = prosperity_festival_find_love_modifier
						years = 3
					}
				}
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = lustful
			}
		}
	}
}

######################
# A CAPTIVE AUDIENCE #
######################

festival.005 = {
	type = activity_event
	title = festival.005.t
	desc = festival.005.desc
	theme = festival_activity

	trigger = {
		exists = cp:councillor_court_chaplain
		cp:councillor_court_chaplain = {
			has_trait = zealous
		}
	}

	left_portrait = {
		character = root
		animation = interested
	}

	right_portrait = {
		character = scope:target_chaplain
		animation = prayer
	}

	cooldown = { years = 1 }

	immediate = {
		cp:councillor_court_chaplain = { save_scope_as = target_chaplain }
	}

	option = {
		name = festival.005.a

		scope:activity = {
			add_activity_log_entry = {
				key = listened_to_chaplain
				score = 10
				tags = { good }
				character = root
				root = {
					add_piety = medium_piety_gain
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = zealous
			}
		}
	}

	option = {
		name = festival.005.b

		scope:activity = {
			add_activity_log_entry = {
				key = talked_down_chaplain
				score = 10
				tags = { good }
				character = root
				root = {
					duel = {
						skill = diplomacy 
						value = high_skill_rating
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							min = 5
							desc = festival.005.b.success
							send_interface_toast = {
								type = event_toast_effect_good
								title = festival.005.b.tt.success
								left_icon = root
								add_prestige = minor_prestige_gain
							}
						}
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							min = 5
							desc = festival.005.b.failure
							send_interface_toast = {
								type = event_toast_effect_bad
								title = festival.005.b.tt.failure
								left_icon = root
								scope:target_chaplain = {
									add_opinion = {
										target = root 
										modifier = frustrated_opinion
										opinion = -20
									}
								}
							}
						}
					}
				}
			}
		}

		ai_chance = {
			base = 10
		}
	}

	option = {
		name = festival.005.c

		scope:activity = {
			add_activity_log_entry = {
				key = rousted_chaplain
				score = 10
				tags = { neutral }
				character = root
				root = {
					add_prestige = minor_prestige_gain
					add_piety = minor_piety_loss
					scope:target_chaplain = {
						add_opinion = {
							target = root 
							modifier = frustrated_opinion
							opinion = -20
						}
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = cynical
			}
		}
	}
}

#####################
# RITE OF CLEANSING #
#####################

festival.006 = {
	type = activity_event
	title = festival.006.t
	desc = festival.006.desc
	theme = festival_activity

	trigger = {
		root = scope:host
		scope:activity = {
			any_attending_character = {
				is_clergy = yes
			}
		}
	}

	left_portrait = {
		character = root
		animation = prayer
	}

	right_portrait = {
		character = scope:presiding_priest
		animation = disapproval
	}

	cooldown = { years = 1 }

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_clergy = yes
					is_ai = yes
				}
				save_scope_as = presiding_priest
			}
		}
	}

	option = {
		name = festival.006.a

		scope:activity = {
			add_activity_log_entry = {
				key = served_with_humility
				score = 10
				tags = { good }
				character = root
				root = {
					add_piety = minor_piety_gain
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = humble
			}
		}
	}

	option = {
		name = festival.006.b

		scope:activity = {
			add_activity_log_entry = {
				key = displayed_magnificence
				score = 10
				tags = { good }
				character = root
				root = {
					add_prestige = medium_prestige_gain
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					has_trait = ambitious
					has_trait = arrogant
				}
			}
		}
	}

	option = {
		name = festival.006.c

		scope:activity = {
			add_activity_log_entry = {
				key = delegated_ritual
				score = 10
				tags = { good }
				character = root
				root = {
					add_piety = minor_prestige_gain
					add_stress = minor_stress_loss
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = arrogant
			}
		}
	}
}

###################
# MOONLIT CONTEST #
###################

festival.007 = {
	type = activity_event
	title = festival.007.t
	desc = festival.007.desc
	theme = festival_activity
	override_background = moon_festival_night_japan

	left_portrait = {
		character = root
		animation = aggressive_unarmed
	}

	right_portrait = {
		character = scope:festival_opponent
		animation = aggressive_unarmed
	}

	cooldown = { years = 1 }

	immediate = {
		hidden_effect = {
			scope:activity = {
				random_attending_character = {
					limit = {
						this != root
						is_ai = yes
					}
					save_scope_as = festival_opponent
				}			
			}
		}
	}

	option = {
		name = festival.007.a

		scope:activity = {
			add_activity_log_entry = {
				key = fought_for_fortune
				score = 10
				tags = { good }
				character = root
				root = {
					duel = {
						skill = prowess
						target = scope:festival_opponent

						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							min = 5
							desc = festival.007.a.success
							send_interface_toast = {
								type = event_toast_effect_good
								title = festival.007.a.tt.success
								left_icon = root
								add_prestige = medium_prestige_gain
								add_piety = minor_piety_gain
							}
						}
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							min = 5
							desc = festival.007.a.failure
							send_interface_toast = {
								type = event_toast_effect_bad
								title = festival.007.a.tt.failure
								left_icon = root
								add_prestige = minor_prestige_loss
								add_piety = minor_piety_loss
							}
						}
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					has_trait = ambitious
					prowess > decent_skill_rating
				}
			}
		}
	}

	option = {
		name = festival.007.b
		
		scope:activity = {
			add_activity_log_entry = {
				key = fought_for_fortune
				score = 10
				tags = { good }
				character = root
				root = {
					duel = {
						skill = intrigue
						target = scope:festival_opponent

						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							min = 5
							desc = festival.007.b.success
							send_interface_toast = {
								type = event_toast_effect_good
								title = festival.007.a.tt.success
								left_icon = root
								add_prestige = medium_prestige_gain
								add_piety = minor_piety_gain
							}
						}
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							min = 5
							desc = festival.007.b.failure
							send_interface_toast = {
								type = event_toast_effect_bad
								title = festival.007.a.tt.failure
								left_icon = root
								add_prestige = medium_prestige_loss
								add_piety = minor_piety_loss
							}
						}
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					has_trait = deceitful
					intrigue >= high_skill_rating
				}
			}
		}
	}
	option = {
		name = festival.007.c

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				ai_energy < 0
			}
		}
	}
}

######################
# DANCE OF ABUNDANCE #
######################

festival.008 = {
	type = activity_event
	title = festival.008.t
	desc = festival.008.desc
	theme = festival_activity

	left_portrait = {
		character = root
		animation = happiness 
	}

	right_portrait = {
		character = scope:dancer
		animation = dancing
	}

	cooldown = { years = 1 }

	immediate = {
		create_character = {
			location = root.location
			template = beautiful_peasant_character
			faith = root.location.faith
			culture = root.location.culture
			gender_female_chance = 100
			save_scope_as = dancer
		}
	}

	option = {
		name = festival.008.a

		scope:activity = {
			add_activity_log_entry = {
				key = observed_dance
				score = 10
				tags = { good }
				character = root
				root = {
					add_piety = medium_piety_gain
				}
				every_attending_character = {
					limit = { 
						is_ai = yes
						this != root 
					}
					custom = custom.every_attending_character
					add_opinion = {
						target = root
						modifier = respected_tradition_modifier
						opinion = 10
					}
				}
			}
		}

		ai_chance = {
			base = 10
		}
	}

	option = {
		name = festival.008.b

		scope:activity = {
			add_activity_log_entry = {
				key = observed_dance
				score = 10
				tags = { good }
				character = root
				root = {
					add_stress = minor_stress_loss
					add_piety = minor_piety_gain
				}
			}
		}

		ai_chance = {
			base = 10
		}
	}

	after = {
		if = {
			limit = {
				scope:dancer = {
					NOT = { is_courtier_of = root }
				}
			}
			scope:dancer = {
				silent_disappearance_effect = yes
			}
		}
	}
}

######################
# A WISH UPON A TREE #
######################

festival.009 = {
	type = activity_event
	title = festival.009.t
	desc = festival.009.desc
	theme = festival_activity
	override_background = tanabata_festival_japan
	left_portrait = {
		character = root
		animation = survey
	}

	right_portrait = {
		character = scope:guest_with_wish
		animation = prayer
	}

	cooldown = { years = 1 }

	immediate = {
		hidden_effect = {
			scope:activity = {
				random_attending_character = {
					limit = {
						this != root
						is_ai = yes
					}
					save_scope_as = guest_with_wish
				}			
			}
		}
	}

	option = {
		name = festival.009.a

		scope:activity = {
			add_activity_log_entry = {
				key = spied_on_wishes
				score = 10
				tags = { good }
				character = root
				root = {
					add_hook = {
						type = favor_hook
						target = scope:guest_with_wish
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					ai_honor < 0
					has_trait = deceitful
				}
			}
		}
	}

	option = {
		name = festival.009.b

		root = {
			add_stress = minor_stress_loss
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					ai_honor > 0
					has_trait = just
				}
			}
		}
	}
}

###################
# PAPER BLESSINGS #
###################

festival.010 = {
	type = activity_event
	title = festival.010.t
	desc = festival.010.desc
	theme = festival_activity
	override_background = tanabata_festival_japan
	left_portrait = {
		character = root
		animation = interested
		camera = camera_activity_horse
	}

	center_portrait = {
		character = scope:guest_1
		animation = admiration
	}
	right_portrait = {
		character = scope:guest_2
		animation = betting
		camera = camera_event_center
	}

	cooldown = { years = 1 }

	immediate = {
		involved_activity = {
			#get guest 1
			random_attending_character = {
				limit = {
					this != root
					is_ai = yes
				}
				save_scope_as = guest_1
			}
			#get guest 2
			random_attending_character = {
				limit = {
					this != root
					this != scope:guest_1
					is_ai = yes
				}
				save_scope_as = guest_2
			}				
		}
	}

	option = {
		name = festival.010.a

		scope:activity = {
			add_activity_log_entry = {
				key = purchased_trinkets
				score = 10
				tags = { good }
				character = root
				root = {
					add_character_modifier = {
						modifier = strong_family_modifier
						years = 10
					}
					remove_short_term_gold = minor_gold_value
				}
			}
		}

		ai_chance = {
			base = 10
		}
	}

	option = {
		name = festival.010.b

		scope:activity = {
			add_activity_log_entry = {
				key = purchased_trinkets
				score = 10
				tags = { good }
				character = root
				root = {
					add_character_modifier = {
						modifier = good_health_modifier
						years = 5
					}
					remove_short_term_gold = minor_gold_value
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				health < fine_health
			}
		}
	}

	option = {
		name = festival.010.c
		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = humble
			}
		}
	}
}

########################
# SILENT CONTEMPLATION #
########################

festival.012 = {
	type = activity_event
	title = festival.012.t
	desc = festival.012.desc
	theme = festival_activity
	override_background = moon_festival_night_japan
	trigger = {
	}

	left_portrait = {
		character = scope:guest_1
		animation = dancing
	}
	center_portrait = {
		character = root
		animation = admiration
		camera = camera_event_center_moved_left
	}
	right_portrait = {
		character = scope:guest_2
		animation = dancing
	}

	cooldown = { years = 1 }

	immediate = {
		involved_activity = {
			#get guest 1
			random_attending_character = {
				limit = {
					this != root
					is_ai = yes
				}
				save_scope_as = guest_1
			}
			#get guest 2
			random_attending_character = {
				limit = {
					this != root
					this != scope:guest_1
					is_ai = yes
				}
				save_scope_as = guest_2
			}				
		}
	}

	option = {
		name = festival.012.a

		scope:activity = {
			add_activity_log_entry = {
				key = contemplated_crowd
				score = 10
				tags = { good }
				character = root
				root = {
					add_stress = minor_stress_loss
				}
			}
		}

		ai_chance = {
			base = 10
		}
	}

	option = {
		name = festival.012.b

		scope:activity = {
			add_activity_log_entry = {
				key = contemplated_crowd
				score = 10
				tags = { good }
				character = root
				root = {
					add_character_modifier = {
						modifier = festival_spirit_modifier
						years = 5
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = gregarious
			}
		}
	}
}

####################
# FESTIVAL OPENING #
####################

festival.014 = {
	type = activity_event
	title = festival.014.t
	desc = festival.014.desc
	
	theme = festival_activity

	left_portrait = {
		character = root
		animation = fanning
	}

	option = {
		name = festival.014.a
	}
}

#################
# STAINED HONOR #
#################

festival.016 = {
	type = activity_event
	title = festival.016.t
	desc = festival.016.desc
	theme = festival_activity

	trigger = {
		exists = house
		scope:activity = {
			any_attending_character = {
				is_physically_able_ai_adult = yes
				exists = house
				house != root.house
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				NOT = {
					is_of_major_interest_trigger = { CHARACTER = root }
				}
			}
		}
	}

	center_portrait = {
		character = root
		animation = disgust
	}

	right_portrait = {
		character = scope:clumsy_oaf
		animation = serving_tray
	}

	cooldown = { years = 1 }

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_physically_able_ai_adult = yes
					exists = house
					house != root.house
					can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
					NOT = {
						is_of_major_interest_trigger = { CHARACTER = root }
					}
				}
				save_scope_as = clumsy_oaf
			}
		}
	}

	option = {
		name = festival.016.a

		scope:activity = {
			add_activity_log_entry = {
				key = demanded_compensation_for_mishap
				score = 10
				tags = { neutral }
				character = root
				scope:clumsy_oaf = {
					pay_short_term_gold = {
						gold = medium_gold_value
						target = root
					}
					add_opinion = {
						target = root
						modifier = insulted_opinion
						opinion = -30
					}
					house = {
						change_house_relation_effect = {
							HOUSE = root.house
							VALUE = house_relation_damage_minor_value
							REASON = sake_insult
							CHAR = root
							TARGET_CHAR = scope:clumsy_oaf
							TITLE = scope:dummy_gender
						}
					}
				}
				root = {
					add_prestige = minor_prestige_gain
					add_dread = minor_dread_gain
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = vengeful
			}
			modifier = {
				add = 10
				has_trait = arrogant
			}
		}
	}
	option = {
		name = festival.016.b

		scope:activity = {
			add_activity_log_entry = {
				key = forgave_mishap
				score = 10
				tags = { good }
				character = root
				root = {
					add_prestige = minor_prestige_loss
				}
				scope:clumsy_oaf = {
					add_opinion = {
						target = root
						modifier = forgiven_opinion
						opinion = 30
					}
					progress_towards_friend_effect = {
						REASON = forgiven_blunder
						CHARACTER = root
						OPINION = 0
					}
					house = {
						change_house_relation_effect = {
							HOUSE = root.house
							VALUE = house_relation_improve_minor_value
							REASON = sake_forgiven
							CHAR = root
							TARGET_CHAR = scope:clumsy_oaf
							TITLE = scope:dummy_gender
						}
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 20
				OR = {
					has_trait = forgiving
				}
			}
			modifier = {
				add = 10
				OR = {
					has_trait = compassionate
				}
			}
		}
	}
}

########################
# MUTINOUS MARIONETTES #
########################

festival.017 = {
	type = activity_event
	title = festival.017.t
	desc = festival.017.desc
	theme = festival_activity

	trigger = {
	}

	left_portrait = {
		character = root
		animation = anger
	}

	right_portrait = {
		character = scope:puppeteer
		animation = storyteller
	}

	cooldown = { years = 1 }

	immediate = {
		create_character = {
			template = generic_peasant_character
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_soldier_female_chance
			save_scope_as = puppeteer
		}
	}

	option = {
		name = festival.017.a

		scope:activity = {
			add_activity_log_entry = {
				key = enjoyed_puppetry
				score = 10
				tags = { good }
				character = root
				root = {
					add_stress = medium_stress_loss
					add_prestige = minor_prestige_loss
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = compassionate
			}
			modifier = {
				add = 10
				has_trait = forgiving
			}
		}
	}
	option = {
		name = festival.017.b

		scope:activity = {
			add_activity_log_entry = {
				key = burned_puppets
				score = 10
				tags = { good }
				character = root
				root = {
					add_dread = minor_dread_gain
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = vengeful
			}
			modifier = {
				add = 10
				has_trait = arrogant
			}
			modifier = {
				add = 10
				OR = {
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
	}
	option = {
		name = festival.017.c

		scope:activity = {
			add_activity_log_entry = {
				key = observed_crowd
				score = 10
				tags = { good }
				character = root
				root = {
					scope:activity.activity_location.county = {
						change_county_control = 10
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = deceitful
			}
			modifier = {
				add = 10
				intrigue >= high_skill_rating
			}
		}
	}
	after = {
		scope:puppeteer ?= {
			silent_disappearance_effect = yes
		}
	}
}

######################
# TRANCE AND TRIBUTE #
######################

festival.018 = {
	type = activity_event
	title = festival.018.t
	desc = festival.018.desc
	theme = festival_activity

	trigger = {
	}

	left_portrait = {
		character = root
		animation = wedding_drunk
	}

	right_portrait = {
		character = scope:possessed_priestess
		animation = shiver
	}

	cooldown = { years = 1 }
	
	immediate = {
		create_character = {
			template = beautiful_maiden_character
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			save_scope_as = possessed_priestess
		}
	}

	option = {
		name = festival.018.a

		scope:activity = {
			add_activity_log_entry = {
				key = made_offering
				score = 10
				tags = { good }
				character = root
				root = {
					remove_short_term_gold = tiny_gold_value
					add_piety = medium_piety_gain
				}
			}
		}
		
		stress_impact = {
			base = medium_stress_impact_loss
			drunkard = medium_stress_impact_loss
			temperate = medium_stress_impact_gain
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = zealous
			}
			modifier = {
				factor = 0
				gold <= medium_gold_value
			}
		}
	}
	option = {
		name = festival.018.b

		scope:activity = {
			add_activity_log_entry = {
				key = made_offering
				score = 10
				tags = { good }
				character = root
				root = {
					add_piety = minor_piety_gain
					add_courtier = scope:possessed_priestess
					progress_towards_friend_effect = {
						CHARACTER = scope:possessed_priestess
						REASON = friend_invited_priestess
						OPINION = 30
					}
				}
			}
		}

		ai_chance = {
			base = 10
		}
	}
	option = {
		name = festival.018.c

		scope:activity = {
			add_activity_log_entry = {
				key = ejected_priestess
				score = 10
				tags = { neutral }
				character = root
				root = {
					add_piety = minor_piety_loss
					add_dread = minor_dread_gain
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					has_trait = cynical
				}
			}
		}
	}
	after = {
		if = {
			limit = { is_ai = yes }
			scope:possessed_priestess ?= {
				silent_disappearance_effect = yes
			}
		}
	}
}

###################
# DRAMA BY DECREE #
###################

festival.019 = {
	type = activity_event
	title = festival.019.t
	desc = festival.019.desc
	theme = festival_activity
	
	trigger = {
		root = scope:host
		scope:activity = {
			any_attending_character = {
				is_councillor_of = root
				is_ai = yes
			}
		}
	}

	left_portrait = {
		character = root
		animation = interested
	}

	right_portrait = {
		character = scope:event_planner
		animation = obsequious_bow
	}

	cooldown = { years = 1 }

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_councillor_of = root
					is_ai = yes
				}
				save_scope_as = play_planner
			}
		}
	}

	option = {
		name = festival.019.a

		scope:activity = {
			add_activity_log_entry = {
				key = planned_play
				score = 10
				tags = { good }
				character = root
				root = {
					dynasty = {
						add_dynasty_prestige = minor_dynasty_prestige_gain
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = ambitious
			}
		}
	}
	option = {
		name = festival.019.b
		scope:activity = {
			add_activity_log_entry = {
				key = planned_play
				score = 10
				tags = { good }
				character = root
				scope:activity.activity_location.county = {
					add_county_modifier = {
						modifier = tgp_japan_instructive_plays_county_modifier
						years = 10
					}
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}
	option = {
		name = festival.019.c

		scope:activity = {
			add_activity_log_entry = {
				key = planned_play
				score = 10
				tags = { good }
				character = root
				root = {
					add_piety = minor_piety_value
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = zealous
			}
		}
	}
}

###################
# GALLOPING GLORY #
###################

festival.020 = {
	type = activity_event
	title = festival.020.t
	desc = festival.020.desc
	theme = festival_activity
	override_background = bp3_riverside
	trigger = {
	}

	left_portrait = {
		character = root
		animation = survey
	}

	center_portrait = {
		character = scope:archer_one
		animation = horse_archer_idle
	}

	right_portrait = {
		character = scope:archer_two
		animation = horse_archer_idle
	}

	cooldown = { years = 1 }
	
	immediate = {
		create_character = {
			template = knight
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_soldier_female_chance
			save_scope_as = archer_one
		}
		create_character = {
			template = knight
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_soldier_female_chance
			save_scope_as = archer_two
		}
	}

	option = {
		name = festival.020.a

		scope:activity = {
			add_activity_log_entry = {
				key = competed_in_archery
				score = 10
				tags = { good }
				character = root
				root = {
					add_prestige = minor_prestige_value
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				prowess >= high_skill_rating
			}
		}
	}
	option = {
		name = festival.020.b

		scope:activity = {
			add_activity_log_entry = {
				key = gambled_on_archers
				score = 10
				tags = { good }
				character = root
				root = {
					add_gold = minor_gold_value
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = profligate
			}
		}
	}
	option = {
		name = festival.020.c

		scope:activity = {
			add_activity_log_entry = {
				key = gained_lucky_fan_fragment
				score = 10
				tags = { good }
				character = root
				root = {
					add_character_modifier = {
						modifier = tgp_japan_lucky_fan_fragments_modifier
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				ai_energy < 0
			}
		}
	}
	after = {
		scope:archer_one ?= {
			silent_disappearance_effect = yes
		}
		scope:archer_two ?= {
			silent_disappearance_effect = yes
		}
	}
}

######################
# INFERNAL PAGEANTRY #
######################

festival.021 = {
	type = activity_event
	title = festival.021.t
	desc = festival.021.desc
	theme = festival_activity

	trigger = {
		root = scope:host
		scope:activity = {
			any_attending_character = {
				is_clergy = yes
			}
		}
	}

	left_portrait = {
		character = root
		animation = worry
	}

	center_portrait = {
		character = scope:counterattacking_clergy
		animation = prayer
	}

	right_portrait = {
		character = scope:alarmed_character
		animation = stayback
	}

	cooldown = { years = 1 }

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_clergy = yes
					is_ai = yes
				}
				save_scope_as = counterattacking_clergy
			}
		}
		scope:activity = {
			random_attending_character = {
				limit = {
					is_ai = yes
					NOT = {
						this = scope:counterattacking_clergy
					}
				}
				save_scope_as = alarmed_character
			}
		}
	}

	option = {
		name = festival.021.a

		scope:activity = {
			add_activity_log_entry = {
				key = banished_demons
				score = 10
				tags = { good }
				character = root
				root = {
					add_character_modifier = {
						modifier = tgp_japan_banisher_of_demons_modifer
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				prowess >= high_skill_rating
			}
		}
	}
	option = {
		name = festival.021.b

		scope:activity = {
			add_activity_log_entry = {
				key = fire_drilled_people
				score = 10
				tags = { good }
				character = root
				scope:activity.activity_location.county = {
					add_county_modifier = {
						modifier = tgp_japan_fire_drilled_county_modifier
						years = 10
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				OR = {
					has_trait = paranoid
					has_trait = diligent
				}
			}
		}
	}
	option = {
		name = festival.021.c

		scope:activity = {
			add_activity_log_entry = {
				key = banned_demons
				score = 10
				tags = { good }
				character = root
				root = {
					scope:activity.activity_location.county = {
						change_county_control = 10
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = craven
			}
		}
	}
}

###################
# FESTIVAL RUMBLE #
###################

festival.022 = {
	type = activity_event
	title = festival.022.t
	desc = festival.022.desc
	theme = festival_activity

	trigger = {
		root = scope:host
	}

	left_portrait = {
		character = root
		animation = interested
	}

	center_portrait = {
		character = scope:rumbler_one
		animation = anger
	}

	right_portrait = {
		character = scope:rumbler_two
		animation = anger
	}

	cooldown = { years = 1 }
	
	immediate = {
		create_character = {
			template = knight
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_soldier_female_chance
			save_scope_as = rumbler_one
		}
		create_character = {
			template = knight
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_soldier_female_chance
			save_scope_as = rumbler_two
		}
	}

	option = {
		name = festival.022.a

		scope:activity = {
			add_activity_log_entry = {
				key = banned_brawling
				score = 10
				tags = { good }
				character = root
				root = {
					add_prestige = minor_prestige_gain
				}
				scope:activity.activity_location.county = {
					change_county_control = 10
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = paranoid
			}
		}
	}
	option = {
		name = festival.022.b

		scope:activity = {
			add_activity_log_entry = {
				key = rewarded_brawlers
				score = 10
				tags = { good }
				character = root
				root = {
					add_gold = minor_gold_loss
				}
				scope:activity.activity_location.county = {
					add_county_modifier = {
						modifier = tgp_japan_prized_generosity_county_modifier
						years = 10
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = generous
			}
		}
	}
	option = {
		name = festival.022.c

		scope:activity = {
			add_activity_log_entry = {
				key = keen_eye_for_business
				score = 10
				tags = { good }
				character = root
				root = {
					add_gold = minor_gold_value
				}
				scope:activity.activity_location.county = {
					add_county_modifier = {
						modifier = tgp_japan_taxed_entertainment_county_modifier
						years = 10
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = greedy
			}
			modifier = {
				add = 10
				gold < minor_gold_value
			}
		}
	}
	after = {
		scope:rumbler_one ?= {
			silent_disappearance_effect = yes
		}
		scope:rumbler_two ?= {
			silent_disappearance_effect = yes
		}
	}
}

########################
# PROCESSION IMPERILED #
########################

festival.023 = {
	type = activity_event
	title = festival.023.t
	desc = festival.023.desc
	theme = festival_activity

	trigger = {
		root = scope:host
	}

	left_portrait = {
		character = root
		animation = shock
	}

	right_portrait = {
		character = scope:stumbler
		animation = stunned
	}

	cooldown = { years = 1 }
	
	immediate = {
		create_character = {
			template = knight
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_soldier_female_chance
			save_scope_as = stumbler
		}
	}

	option = {
		name = festival.023.a

		scope:activity = {
			add_activity_log_entry = {
				key = saved_festival_float
				score = 10
				tags = { good }
				character = root
				root = {
					add_prestige = minor_prestige_value
					add_piety = minor_piety_value
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				prowess >= high_skill_rating
			}
		}
	}
	option = {
		name = festival.023.b

		scope:activity = {
			add_activity_log_entry = {
				key = tenderized_villager
				score = 10
				tags = { good }
				character = root
				root = {
					add_gold = minor_gold_value
					add_dread = minor_dread_gain
				}
				scope:activity.activity_location.county = {
					change_county_control = 5
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = callous
			}
			modifier = {
				add = 10
				has_trait = sadistic
			}
		}
	}
	after = {
		scope:stumbler ?= {
			silent_disappearance_effect = yes
		}
	}
}

###################
# WOODEN WARDANCE #
###################

festival.024 = {
	type = activity_event
	title = festival.024.t
	desc = festival.024.desc
	theme = festival_activity

	trigger = {
		root = scope:host
	}

	left_portrait = {
		character = root
		animation = admiration
	}

	center_portrait = {
		character = scope:wardancer_one
		animation = celebrate_spear
	}

	right_portrait = {
		character = scope:wardancer_two
		animation = celebrate_spear
	}

	cooldown = { years = 1 }

	immediate = {
		create_character = {
			template = knight
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_soldier_female_chance
			save_scope_as = wardancer_one
		}
		create_character = {
			template = knight
			dynasty = none
			location = root.location
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_soldier_female_chance
			save_scope_as = wardancer_two
		}
	}

	option = {
		name = festival.024.a

		scope:activity = {
			add_activity_log_entry = {
				key = village_draft
				score = 10
				tags = { good }
				character = root
				root = {
					add_character_modifier = {
						modifier = tgp_japan_drafted_villagers_modifier
						years = 10
					}
				}
			}
		}

		ai_chance = {
			base = 10
		}
	}
	option = {
		name = festival.024.b

		scope:activity = {
			add_activity_log_entry = {
				key = studied_martial_motions
				score = 10
				tags = { good }
				character = root
				root = {
					add_character_modifier = {
						modifier = tgp_japan_precise_insight_modifer
						years = 10
					}
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = strategist
			}
			modifier = {
				add = 10
				martial >= high_skill_rating
			}
		}
	}
	option = {
		name = festival.024.c

		scope:activity = {
			add_activity_log_entry = {
				key = paraded_troops
				score = 10
				tags = { good }
				character = root
				scope:activity.activity_location.county = {
					change_county_control = 5
				}
			}
		}

		ai_chance = {
			base = 10
			modifier = {
				add = 10
				has_trait = ambitious
			}
		}
	}
	after = {
		scope:wardancer_one ?= {
			silent_disappearance_effect = yes
		}
		scope:wardancer_two ?= {
			silent_disappearance_effect = yes
		}
	}
}

######################
# INTENT FULFILLMENT #
######################

festival.100 = {
	type = activity_event
	title = festival.100.t
	desc = festival.100.desc
	theme = festival_activity
	cooldown = { years = 1 }
	override_background = activity_witch_ritual

	left_portrait = {
		character = scope:target_character
		animation = fanning
	}

	center_portrait = {
		character = root
		animation = admiration
		camera = camera_event_center_pointing_slighty_left
	}

	right_portrait = {
		character = scope:target_character2
		animation = flirtation 
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = raise_cohesion_intent
			add = 50
		}
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					trigger_if = {
						limit = {
							exists = root.intent_target
						}
						root.intent_target = this
					}
				}	
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					NOT = { root.intent_target ?= this }
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					save_temporary_scope_as = target_one_check
				}
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						house.house_confederation ?= { this != scope:target_one_check.confederation }
					}
					is_ai = yes
					house.house_head = this
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = scope:target_character
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}
		}
		house.house_confederation ?= {
			save_scope_as = root_bloc
		}
	}

	option = {
		name = festival.100.a 

		reverse_add_opinion = {
	 		target = scope:target_character
	 		modifier = accepted_my_invitation
	 		opinion = 20
	 	}

		reverse_add_opinion = {
	 		target = scope:target_character2
	 		modifier = refused_my_invitation
	 		opinion = -20
	 	}

		scope:activity = {
			add_activity_log_entry = {
				key = festival_moon_gazed_house_log
				tags = { positive }
				character = root
				target = scope:target_character

				scope:target_character.house ?= {
					change_house_relation_effect = {
						HOUSE = root.house
						VALUE = house_relation_improve_minor_value
						REASON = moon_gazed
						CHAR = root
						TARGET_CHAR = scope:target_character
						TITLE = scope:dummy_gender
					}
				}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character
					value >= 25
				}
				opinion = {
					target = scope:target_character2
					value < 25
				}
			}
		}
	}
	option = {
		name = festival.100.b

		reverse_add_opinion = {
	 		target = scope:target_character2
	 		modifier = accepted_my_invitation
	 		opinion = 20
	 	}

		reverse_add_opinion = {
	 		target = scope:target_character
	 		modifier = refused_my_invitation
	 		opinion = -20
	 	}

		scope:activity = {
			add_activity_log_entry = {
				key = festival_moon_gazed_house_log
				tags = { positive }
				character = root
				target = scope:target_character2
				
				scope:target_character.house ?= {
					change_house_relation_effect = {
						HOUSE = root.house
						VALUE = house_relation_improve_minor_value
						REASON = moon_gazed
						CHAR = root
						TARGET_CHAR = scope:target_character
						TITLE = scope:dummy_gender
					}
				}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character2
					value >= 25
				}
				opinion = {
					target = scope:target_character
					value < 25
				}
			}
		}
	}
	option = {
		name = festival.100.c

		if = {
			limit = {
				government_has_flag = government_has_influence
			}
			change_influence = minor_influence_gain
		}

		pay_short_term_gold = {
			target = scope:target_character
			gold = minor_gold_value
		}
		reverse_add_opinion = {
	 		target = scope:target_character
	 		modifier = declined_with_decorum
	 		opinion = 10
	 	}
		pay_short_term_gold = {
			target = scope:target_character2
			gold = minor_gold_value
		}
		reverse_add_opinion = {
	 		target = scope:target_character2
	 		modifier = declined_with_decorum
	 		opinion = 10
	 	}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character
					value < 25
				}
				opinion = {
					target = scope:target_character2
					value < 25
				}
			}
		}
	}
	option = {
		name = festival.100.d

		trigger = {
			exists = house.house_confederation
		}

		add_prestige = minor_prestige_value

		house.house_confederation ?= {
			tgp_bloc_change_cohesion_effect = {
				VALUE = cohesion_gain_minor
				ICON = root
				REASON = festival
			}
		}
		scope:activity = {
			every_attending_character = {
				limit = {
					this != root
					is_ai = yes
					is_vassal_of = top_liege
					highest_held_title_tier > tier_barony
				}
				custom = all_members_of_root_confederation_in_attendance
				add_opinion = {
					target = root
					modifier = festival_gazed_at_moon_together
					opinion = 20
				}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character
					value < 0
				}
				opinion = {
					target = scope:target_character2
					value < 0
				}
			}
		}
	}
}

festival.101 = {
	type = activity_event
	title = festival.101.t
	desc = festival.101.desc
	theme = festival_activity
	cooldown = { years = 1 }

	left_portrait = {
		character = root
		animation = disgust
	}

	right_portrait = {
		character = scope:target_character
		animation = fanning_coyly
		camera = camera_event_center_pointing_forward_fov35
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
		modifier = {
			has_activity_intent = remove_from_bloc_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					root.intent_target = this
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
			}
		}
		scope:target_character.house.house_confederation ?= {
			save_scope_as = bloc
		}
	}

	option = {
		name = festival.101.a 

		reverse_add_opinion = {
	 		target = scope:target_character
	 		modifier = appreciated_discretion
	 		opinion = 20
	 	}
				
		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = appreciated_discreet_note
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
		}
	}

	option = {
		name = festival.101.b

		scope:activity = {
			add_activity_log_entry = {
				key = festival_moon_gazed_house_log
				tags = { negative }
				character = root
				target = scope:target_character
			 	scope:target_character = {
			 		if = {
			 			limit = {
			 				government_has_flag = government_has_influence
			 			}
			 			change_influence = major_influence_loss
			 		}
					else = { add_prestige = medium_prestige_loss }
				 	if = {
				 		limit = { exists = house.house_confederation }
					 	scope:activity = {
					 		every_attending_character = {
					 			limit = {
					 				this != scope:target_character
									this != root
									highest_held_title_tier > tier_barony
									OR = {
										is_independent_ruler = yes
										is_vassal_of = top_liege
									}
									is_ai = yes
									house.house_confederation ?= scope:target_character.house.house_confederation
					 			}
					 			custom = all_members_of_confederation_in_attendance
								add_opinion = {
									target = scope:target_character
									modifier = festival_odious_odor
									opinion = -25
								}
					 		}
					 	}
					}
				}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character
					value < 25
				}
			}
		}
	}
}

festival.102 = {
	type = activity_event
	title = festival.102.t
	desc = festival.102.desc
	theme = festival_activity
	cooldown = { years = 1 }

	override_background = tanabata_festival_night_japan

	left_portrait = {
		character = root
		animation = wedding_drunk
	}

	center_portrait = {
		character = scope:target_character2
		animation = storyteller
	}
	
	right_portrait = {
		character = scope:target_character
		animation = ecstasy
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
		modifier = {
			has_activity_intent = raise_cohesion_intent
			add = 50
		}
	}

	trigger = {
		drinks_alcohol_trigger = yes
		scope:activity = {
			activity_host = { drinks_alcohol_trigger = yes }
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
				}	
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						root.intent_target ?= this
					}
					is_ai = yes
					house.house_head = this
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					save_temporary_scope_as = target_one_check
				}
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						house.house_confederation ?= { this != scope:target_one_check.confederation }
					}
					is_ai = yes
					house.house_head = this
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}
		}
	}

	option = {
		name = festival.102.a 

		duel = {
			skills = { diplomacy learning }
			value = high_skill_rating
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = festival.delivered_ode
					left_icon = root
					add_prestige = minor_prestige_gain
			 		if = {
			 			limit = {
			 				government_has_flag = government_has_influence
			 			}
			 			change_influence = minor_influence_gain
			 		}
			 		if = {
			 			limit = {
			 				AND = {
			 					has_trait = lifestyle_poet
								has_trait_xp = {
									trait = lifestyle_poet
									value < 100
								}
							}
						}
						add_trait_xp = {
							trait = lifestyle_poet
							value = 20
						}
					}
					scope:activity = {
						every_attending_character = {
							limit = {
								is_ai = yes
								has_trait = lifestyle_poet
								this != root
							}
							custom = every_poet_attendee
							add_opinion = {
								target = root
								modifier = festival_impressive_poetry
								opinion = 25
							}
						}
					}
				}
			}
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = festival.poem_fell_flat
					left_icon = root
			 		scope:activity = {
						every_attending_character = {
							limit = {
								is_ai = yes
								has_trait = lifestyle_poet
								this != root
							}
							custom = every_poet_attendee
							add_opinion = {
								target = root
								modifier = festival_bad_poetry
								opinion = -15
							}
						}
					}
				}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				has_trait = lifestyle_poet
			}
		}
	}

	option = {
		name = festival.102.b

		scope:activity = {
			add_activity_log_entry = {
				key = festival_toasted_head_house_log
				tags = { positive }
				character = root
				target = scope:target_character

				root = {
					add_prestige = medium_prestige_loss
				}

				scope:target_character = {
					add_prestige = medium_prestige_gain
			 		if = {
			 			limit = {
			 				government_has_flag = government_has_influence
			 			}
			 			change_influence = minor_influence_gain
			 		}
			 		house ?= {
						change_house_relation_effect = {
							HOUSE = root.house
							VALUE = house_relation_improve_minor_value
							REASON = toasted_head
							CHAR = root
							TARGET_CHAR = scope:target_character
							TITLE = scope:dummy_gender
						}			 		
			 		}
			 	}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
		}
	}

	option = {
		name = festival.102.c

		stress_impact = {
			base = minor_stress_impact_loss
			drunkard = minor_stress_impact_gain
		}

		scope:activity = {
			every_attending_character = {
				limit = {
					is_ai = yes
					OR = {
						has_trait = temperate
						has_trait = shy
					}
				}
				custom = every_temperate_or_shy_attendee
				add_opinion = {
					target = root
					modifier = festival_mild_drinker
					opinion = 20
				}
			}
			every_attending_character = {
				limit = {
					is_ai = yes
					OR = {
						has_trait = drunkard
						has_trait = lifestyle_reveler
					}
				}
				custom = every_drunkard_or_lifestyle_reveler_attendee
				add_opinion = {
					target = root
					modifier = festival_mild_drinker_negative
					opinion = -10
				}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				has_trait = shy
			}
			modifier = {
				add = 25
				has_trait = temperate
			}
		}
	}
}

festival.103 = {
	type = activity_event
	title = festival.103.t
	desc = festival.103.desc
	theme = festival_activity
	cooldown = { years = 1 }

	left_portrait = {
		character = root
		animation = disbelief
	}

	right_portrait = {
		character = scope:target_character
		animation = fanning
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
		modifier = {
			has_activity_intent = remove_from_bloc_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
				}	
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					NOT = { root.intent_target ?= this }
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					save_temporary_scope_as = target_one_check
				}
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						house.house_confederation ?= { this != scope:target_one_check.confederation }
					}
					is_ai = yes
					house.house_head = this
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}
		}
		scope:target_character.house.house_confederation ?= {
			save_scope_as = bloc
		}
		house.house_confederation ?= {
			save_scope_as = root_bloc
		}
	}

	option = {
		name = festival.103.a
		progress_towards_friend_effect = {
			REASON = friend_defended_talents
			CHARACTER = scope:target_character
			OPINION = 30
		}

		stress_impact = {
			arrogant = minor_stress_gain
			humble = minor_stress_loss
			honest = minor_stress_gain
			deceitful = minor_stress_loss
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
		}
	}

	option = {
		name = festival.103.b

		duel = {
			skills = { diplomacy }
			target = scope:target_character
			60 = {
				desc = festival.103.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root 
					right_icon = scope:target_character
					title = festival.103.b.success.toast

					root = {
						add_prestige = medium_prestige_gain
					}
					scope:target_character = {
						add_prestige = medium_prestige_loss
						if = {
							limit = { exists = house.house_confederation }
							scope:activity = {
								every_attending_character = {
									limit = {
										this != scope:target_character
										this != root
										highest_held_title_tier > tier_barony
										OR = {
											is_independent_ruler = yes
											is_vassal_of = top_liege
										}
										is_ai = yes
										house.house_confederation ?= scope:target_character.house.house_confederation
									}
									custom = all_members_of_confederation_in_attendance
									add_opinion = {
										target = scope:target_character
										modifier = festival_boasting_exposed
										opinion = -25
									}
								}
							}
						}
					}
				}
			}
			40 = {
				desc = festival.103.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:target_character
					title = festival.103.b.failure.toast

					root = {
						add_prestige = minor_prestige_loss
					}
				}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 50
				opinion = {
					target = scope:target_character
					value < 0
				}
			}
		}
	}

	option = {
		name = festival.103.c

		trigger = {
			exists = house.house_confederation
		}

		house.house_confederation ?= {
			tgp_bloc_change_cohesion_effect = {
				VALUE = cohesion_gain_minor
				ICON = root
				REASON = festival
			}
		}

		scope:activity = {
			every_attending_character = {
				limit = {
					this != root
					highest_held_title_tier > tier_barony
					OR = {
						is_independent_ruler = yes
						is_vassal_of = top_liege
					}
					is_ai = yes
					house.house_confederation ?= root.house.house_confederation
				}
				custom = all_members_of_confederation_in_attendance
				add_opinion = {
					target = root
					modifier = festival_praised_poetic_talents
					opinion = 10
				}
			}
		}

		ai_chance = {
			base = 40
		}
	}
}

festival.104 = {
	type = activity_event
	title = festival.104.t
	desc = festival.104.desc
	theme = festival_activity
	cooldown = { years = 1 }

	left_portrait = {
		character = root
		animation = worry
	}

	center_portrait = {
		character = scope:target_character
		animation = fanning_coyly
	}

	right_portrait = {
		character = scope:target_character2
		animation = fanning_coyly
	}

	weight_multiplier = {
		base = 2
		modifier = {
			has_activity_intent = raise_cohesion_intent
			add = 50
		}
		modifier = {
			has_activity_intent = remove_from_bloc_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
				}	
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					NOT = { root.intent_target ?= this }
					count >= 3
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					save_temporary_scope_as = target_one_check
				}
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						house.house_confederation ?= { this != scope:target_one_check.confederation }
					}
					is_ai = yes
					house.house_head = this
					count >= 3
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							this = scope:target_character2
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character3
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							this = scope:target_character2
							this = scope:target_character3
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character4
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
							this = scope:target_character2
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character3
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
							this = scope:target_character2
							this = scope:target_character3
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character4
				}
			}
		}
		scope:target_character.house.house_confederation ?= {
			save_scope_as = bloc
		}
		scope:target_character2.house.house_confederation ?= {
			save_scope_as = second_bloc
		}
		house.house_confederation ?= {
			save_scope_as = root_bloc
		}
	}

	option = {
		name = festival.104.a 

		duel = {
			skills = { diplomacy }
			value = medium_skill_rating
			60 = {
				desc = festival.104.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root 
					right_icon = scope:target_character
					title = festival.104.a.success.toast
					root = {
						add_prestige = minor_prestige_gain

						reverse_add_opinion = {
					 		target = scope:target_character
					 		modifier = appreciated_independence_of_spirit
					 		opinion = 25
					 	}
						reverse_add_opinion = {
					 		target = scope:target_character2
					 		modifier = appreciated_independence_of_spirit
					 		opinion = 25
					 	}
					}
				}
			}
			40 = {
				desc = festival.104.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:target_character
					title = festival.104.a.failure.toast
					root = {
						reverse_add_opinion = {
					 		target = scope:target_character
					 		modifier = awkward_intrusion
					 		opinion = -15
					 	}
						reverse_add_opinion = {
					 		target = scope:target_character2
					 		modifier = awkward_intrusion
					 		opinion = -15
					 	}
					}					
				}
			}
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = {
		name = festival.104.b

		duel = {
			skills = { intrigue }
			value = high_skill_rating
			60 = {
				desc = festival.104.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root 
					right_icon = scope:target_character
					title = festival.104.b.success.toast
					scope:activity = {
						every_attending_character = {
							limit = {
								this != scope:target_character
								this != root
								highest_held_title_tier > tier_barony
								OR = {
									is_independent_ruler = yes
									is_vassal_of = top_liege
								}
								is_ai = yes
								house.house_confederation ?= scope:target_character.house.house_confederation
							}
							custom = all_members_of_confederation_in_attendance
							add_opinion = {
								target = scope:target_character
								modifier = festival_questionable_rumors
								opinion = -25
							}
						}
						every_attending_character = {
							limit = {
								this != scope:target_character2
								this != root
								highest_held_title_tier > tier_barony
								OR = {
									is_independent_ruler = yes
									is_vassal_of = top_liege
								}
								is_ai = yes
								house.house_confederation ?= scope:target_character2.house.house_confederation
							}
							custom = all_members_of_second_confederation_in_attendance
							add_opinion = {
								target = scope:target_character2
								modifier = festival_questionable_rumors
								opinion = -25
							}
						}
					}
				}
			}
			40 = {
				desc = festival.104.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:target_character
					title = festival.104.b.failure.toast
					
					root = {
						add_prestige = minor_prestige_loss
					}
				}
			}
		}

		stress_impact = {
			just = minor_stress_gain
			honest = minor_stress_gain
			deceitful = minor_stress_loss
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value < 25
				}
			}
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character2
					value < 25
				}
			}
		}
	}

	option = {
		name = festival.104.c

		trigger = {
			exists = house.house_confederation
		}

		house.house_confederation ?= {
			tgp_bloc_change_cohesion_effect = {
				VALUE = cohesion_gain_minor
				ICON = root
				REASON = festival
			}
		}

		stress_impact = {
			forgiving = minor_stress_gain
			vengeful = minor_stress_loss
		}

		ai_chance = {
			base = 40
		}
	}
}

festival.105 = {
	type = activity_event
	title = festival.105.t
	desc = festival.105.desc
	theme = festival_activity
	override_background = tanabata_festival_japan
	cooldown = { years = 1 }

	left_portrait = {
		character = root
		animation = thinking
	}

	center_portrait = {
		character = scope:target_character2
		animation = personality_compassionate
	}

	right_portrait = {
		character = scope:target_character3
		animation = personality_bold
	}

	lower_right_portrait = {
		character = scope:target_character
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
		modifier = {
			has_activity_intent = raise_cohesion_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
				}	
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					NOT = { root.intent_target ?= this }
					count >= 2
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					save_temporary_scope_as = target_one_check
				}
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						house.house_confederation ?= { this != scope:target_one_check.confederation }
					}
					is_ai = yes
					house.house_head = this
					count >= 2
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							this = scope:target_character2
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character3
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
							this = scope:target_character2
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character3
				}
			}
		}
		house.house_confederation ?= {
			save_scope_as = bloc
		}
	}

	option = {
		name = festival.105.a 

		duel = {
			skills = { learning }
			target = scope:target_character
			60 = {
				desc = festival.105.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root 
					right_icon = scope:target_character
					title = festival.105.a.success.toast

					root = {
						add_prestige = minor_prestige_gain
					}

					scope:activity = {
						every_attending_character = {
							limit = {
								is_ai = yes
								learning < root.learning
							}
							custom = every_attendee_with_lower_learning
							add_opinion = {
						 		target = root
						 		modifier = impressed_by_wit
						 		opinion = 30
						 	}
						}
					}
				}
			}
			40 = {
				desc = festival.105.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:target_character
					title = festival.105.a.failure.toast

					scope:activity = {
						every_attending_character = {
							limit = {
								is_ai = yes
								learning > root.learning
							}
							custom = every_attendee_with_greater_learning
							add_opinion = {
						 		target = root
						 		modifier = impressed_by_witlessness
						 		opinion = -15
						 	}
						}
					}
				}
			}
		}

		stress_impact = {
			lazy = minor_stress_gain
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				learning > high_skill_rating
			}
		}
	}

	option = {
		name = festival.105.b

		scope:target_character = {
			add_opinion = {
				target = root
				modifier = praised_my_wit
				opinion = 15
			}
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = wit_praised
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		stress_impact = {
			arrogant = minor_stress_gain
			humble = minor_stress_loss
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value > 25
				}
			}
		}
	}

	option = {
		name = festival.105.c

		trigger = {
			exists = house.house_confederation
		}

		duel = {
			skills = { diplomacy intrigue learning }
			value = medium_skill_rating
			40 = {
				desc = festival.105.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root 
					right_icon = scope:target_character
					title = festival.105.c.success.toast

					if = {
						limit = {
							government_has_flag = government_has_influence
						}
						change_influence = minor_influence_gain
					}
					house.house_confederation ?= {
						tgp_bloc_change_cohesion_effect = {
							VALUE = cohesion_gain_minor
							ICON = root
							REASON = festival
						}
					}
					scope:activity = {
						every_attending_character = {
							limit = {
								this != root
								highest_held_title_tier > tier_barony
								OR = {
									is_independent_ruler = yes
									is_vassal_of = top_liege
								}
								is_ai = yes
								house.house_confederation ?= root.house.house_confederation
							}
							custom = all_members_of_confederation_in_attendance
							add_opinion = {
								target = root
								modifier = festival_composed_riddles_together
								opinion = 30
							}
						}
					}
				}
			}
			60 = {
				desc = festival.105.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:target_character
					title = festival.105.c.failure.toast
					scope:activity = {
						every_attending_character = {
							limit = {
								this != root
								highest_held_title_tier > tier_barony
								OR = {
									is_independent_ruler = yes
									is_vassal_of = top_liege
								}
								is_ai = yes
								house.house_confederation ?= root.house.house_confederation
							}
							custom = all_members_of_confederation_in_attendance
							add_opinion = {
								target = root
								modifier = festival_composed_riddles_together_badly
								opinion = -15
							}
						}
					}
				}
			}
		}

		stress_impact = {
			lazy = minor_stress_gain
		}

		ai_chance = {
			base = 40
		}
	}
}

festival.106 = {
	type = activity_event
	title = festival.106.t
	desc = festival.106.desc
	theme = festival_activity
	cooldown = { years = 1 }
	override_background = tavern
	override_effect_2d = { reference = rain }

	left_portrait = {
		character = root
		animation = fanning
	}

	right_portrait = {
		character = scope:target_character
		animation = worry
	}

	lower_right_portrait = {
		character = scope:target_character2
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
				}	
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					NOT = { root.intent_target ?= this }
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					save_temporary_scope_as = target_one_check
				}
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						house.house_confederation ?= { this != scope:target_one_check.confederation }
					}
					is_ai = yes
					house.house_head = this
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}
		}
	}

	option = {
		name = festival.106.a 

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = appreciated_assistance
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}
		scope:target_character = {
			add_opinion = {
				target = root
				modifier = festival_offered_shelter
				opinion = 20
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
		}
	}
	option = {
		name = festival.106.b

		duel = {
			skills = { diplomacy intrigue }
			value = medium_skill_rating
			50 = {
				desc = festival.106.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root 
					right_icon = scope:target_character2
					title = festival.106.b.success.toast

					scope:target_character2 = {
						add_opinion = {
							target = root
							modifier = festival_enjoyed_talk
							opinion = 20
						}
					}
				}
			}
			50 = {
				desc = festival.106.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:target_character2
					title = festival.106.b.failure.toast

					scope:target_character2 = {
						add_opinion = {
							target = root
							modifier = festival_suspicious
							opinion = -10
						}
					}
				}
			}
		}

		if = {
			limit = {
				can_add_hook = {
					type = favor_hook
					target = scope:target_character
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:target_character
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
		}
	}

	option = {
		name = festival.106.c

		scope:target_character2.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = shared_mockery
				CHAR = root
				TARGET_CHAR = scope:target_character2
				TITLE = scope:dummy_gender
			}
		}

		scope:target_character2 = {
			add_opinion = {
				target = root
				modifier = festival_shamed_another
				opinion = 10
			}
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_damage_minor_value
				REASON = exposed_my_state
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = scope:target_character2.house
				VALUE = house_relation_damage_minor_value
				REASON = exposed_my_state
				CHAR = scope:target_character2
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		scope:target_character = {
			add_opinion = {
				target = root
				modifier = festival_shamed_me
				opinion = -30
			}
		}

		scope:target_character = {
			add_opinion = {
				target = scope:target_character2
				modifier = festival_shamed_me
				opinion = -30
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value < 25
				}
			}
		}
	}
}

festival.107 = {
	type = activity_event
	title = festival.107.t
	desc = festival.107.desc
	theme = festival_activity
	override_background = moon_festival_night_japan
	cooldown = { years = 1 }

	left_portrait = {
		character = root
		animation = flirtation_left
		camera = camera_body_right
	}

	center_portrait = {
		character = scope:target_character2
		animation = fanning_coyly
		camera = camera_body_left_slight
	}

	lower_left_portrait = {
		character = scope:target_character
	}

	lower_right_portrait = {
		character = scope:character_of_rumor
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = raise_cohesion_intent
			add = 50
		}
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOR = {
						this = root
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
					might_cheat_on_every_partner_trigger = yes
					save_temporary_scope_as = target_one_check
				}	
				any_attending_character = {
					NOR = {
						this = root
						house.house_confederation ?= root.house.house_confederation
						root.intent_target ?= this
					}
					is_ai = yes
					house.house_head = this
				}
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					might_cheat_on_every_partner_trigger = yes
					save_temporary_scope_as = target_one_check
				}
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						house.house_confederation ?= { this != scope:target_one_check.confederation }
					}
					is_ai = yes
					house.house_head = this
				}
			}
			any_attending_character = {
				NOR = {
					this = root
					house.house_confederation ?= root.house.house_confederation
					root.intent_target ?= this
				}
				is_ruler = yes
				is_ai = yes
				house.house_head = this
				any_courtier = {
					is_physically_able_ai_adult = yes
					age < define:NCharacter|FEMALE_ATTRACTION_CUTOFF_AGE # we just default to the lower of the two
					trigger_if = {
						root.intent_target ?= {
							is_male = yes
						}
						is_female = yes
					}
					trigger_else = {
						is_male = yes
					}
					is_attracted_to_gender_of = scope:target_one_check
					might_cheat_on_every_partner_trigger = yes
					has_lustful_adjacent_trait_trigger = yes
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
						might_cheat_on_every_partner_trigger = yes
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
						might_cheat_on_every_partner_trigger = yes
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}
		}
		scope:activity = {
			random_attending_character = {
				limit = {
					NOR = {
						this = root
						house.house_confederation ?= root.house.house_confederation
						root.intent_target ?= this
					}
					is_ruler = yes
					is_ai = yes
					house.house_head = this
					any_courtier = {
						is_physically_able_ai_adult = yes
						age < define:NCharacter|FEMALE_ATTRACTION_CUTOFF_AGE # we just default to the lower of the two
						trigger_if = {
							root.intent_target ?= {
								is_male = yes
							}
							is_female = yes
						}
						trigger_else = {
							is_male = yes
						}
						is_attracted_to_gender_of = scope:target_character
						might_cheat_on_every_partner_trigger = yes
						has_lustful_adjacent_trait_trigger = yes
					}
				}
				save_scope_as = courtier_host
			}
		}
		scope:courtier_host = {
			random_courtier = {
				limit = {
					is_physically_able_ai_adult = yes
					age < define:NCharacter|FEMALE_ATTRACTION_CUTOFF_AGE # we just default to the lower of the two
					trigger_if = {
						root.intent_target ?= {
							is_male = yes
						}
						is_female = yes
					}
					trigger_else = {
						is_male = yes
					}
					is_attracted_to_gender_of = scope:target_character
					might_cheat_on_every_partner_trigger = yes
					has_lustful_adjacent_trait_trigger = yes
				}
				save_scope_as = character_of_rumor
			}
		}
		house.house_confederation ?= {
			save_scope_as = root_bloc
		}
	}

	option = {
		name = festival.107.a 

		scope:target_character = {
			add_prestige = minor_prestige_loss
		}

		if = {
			limit = {
				government_has_flag = government_has_influence
			}
			change_influence = minor_influence_loss
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_damage_minor_value
				REASON = malicious_slander
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value < 25
				}
			}
		}
	}

	option = {
		name = festival.107.b

		scope:target_character = {
			add_prestige = minor_prestige_gain
		}

		if = {
			limit = {
				government_has_flag = government_has_influence
			}
			change_influence = minor_influence_gain
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = bolstered_reputation
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
		}
	}

	option = {
		name = festival.107.c

		trigger = {
			exists = house.house_confederation
		}

		house.house_confederation ?= {
			tgp_bloc_change_cohesion_effect = {
				VALUE = cohesion_gain_minor
				ICON = root
				REASON = festival
			}
		}

		scope:activity = {
			every_attending_character = {
				limit = {
					this != root
					highest_held_title_tier > tier_barony
					OR = {
						is_independent_ruler = yes
						is_vassal_of = top_liege
					}
					is_ai = yes
					house.house_confederation ?= root.house.house_confederation
					has_lustful_adjacent_trait_trigger = yes
				}
				custom = all_members_of_root_confederation_in_attendance
				add_opinion = {
					target = root
					modifier = festival_enhanced_amorous_reputation
					opinion = 20
				}
			}
		}
		ai_chance = {
			base = 40
		}
	}
}

festival.108 = {
	type = activity_event
	title = festival.108.t
	desc = festival.108.desc
	theme = festival_activity
	override_background = tavern
	cooldown = { years = 1 }

	center_portrait = {
		character = root
		animation = map_schadenfreude
	}

	right_portrait = {
		character = scope:target_character2
		animation = fanning
	}

	lower_right_portrait = {
		character = scope:target_character
	}

	lower_left_portrait = {
		character = scope:target_character4
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = remove_from_bloc_intent
			add = 50
		}
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
		modifier = {
			has_activity_intent = raise_cohesion_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
					save_temporary_scope_as = target
				}	
				any_attending_character = {
					house.house_confederation ?= root.house.house_confederation
					is_ai = yes
					house.house_head = this
					NOT = { root.intent_target ?= this }
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					save_temporary_scope_as = target
				}
				any_attending_character = {
					house.house_confederation ?= root.house.house_confederation
					is_ai = yes
					house.house_head = this
				}
			}
		}
		scope:target = {
			OR = {
				house.house_confederation.leading_house.house_head ?= {
					is_ai = yes
					is_married = yes
					primary_spouse = {
						is_physically_able_ai_adult = yes
						age < define:NCharacter|FEMALE_ATTRACTION_CUTOFF_AGE # we just default to the lower of the two
					}
				}
				liege ?= {
					is_ai = yes
					house.house_head = this
					is_married = yes
					primary_spouse = {
						is_physically_able_ai_adult = yes
						age < define:NCharacter|FEMALE_ATTRACTION_CUTOFF_AGE # we just default to the lower of the two
					}
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						house.house_confederation ?= root.house.house_confederation
						NOR = {
							this = root
							root.intent_target ?= this
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						house.house_confederation ?= root.house.house_confederation
						NOT = {
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character2
				}
			}
		}
		scope:target_character = {
			if = {
				limit = {
					exists = house.house_confederation.leading_house.house_head
				}
				house.house_confederation.leading_house.house_head = {
					save_scope_as = target_character3
					primary_spouse = {
						save_scope_as = target_character4
					}
				}
			}
			else = {
				liege = {
					save_scope_as = target_character3
					primary_spouse = {
						save_scope_as = target_character4
					}
				}
			}
		}
	}

	option = {
		name = festival.108.a 

		scope:target_character3 = {
			add_opinion = {
				target = scope:target_character
				modifier = festival_advanced_upon_my_spouse
				opinion = -30
			}			
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = scope:target_character3.house
				VALUE = house_relation_damage_minor_value
				REASON = gifted_a_fan
				CHAR = scope:target_character
				TARGET_CHAR = scope:target_character3
				TITLE = scope:dummy_gender
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value < 25
				}
			}
		}
	}

	option = {
		name = festival.108.b

		scope:target_character = {
			add_opinion = {
				target = root
				modifier = festival_returned_my_possession
				opinion = 10
			}
		}

		if = {
			limit = {
				can_add_hook = {
					type = favor_hook
					target = scope:target_character
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:target_character
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
		}
	}

	option = {
		name = festival.108.c

		scope:target_character2 = {
			add_opinion = {
				target = root
				modifier = festival_shared_a_secret
				opinion = 10
			}
		}

		scope:target_character2.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = shared_secret
				CHAR = root
				TARGET_CHAR = scope:target_character2
				TITLE = scope:dummy_gender
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character2
					value >= 25
				}
			}
		}
	}
}

festival.109 = {
	type = activity_event
	title = festival.109.t
	desc = festival.109.desc
	theme = festival_activity
	cooldown = { years = 1 }

	left_portrait = {
		character = root
		animation = fanning
	}

	center_portrait = {
		character = scope:target_character2
		animation = fear
	}

	right_portrait = {
		character = scope:target_character
		animation = flirtation 
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
		modifier = {
			has_activity_intent = raise_cohesion_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
					ai_compassion < low_positive_ai_value
					save_temporary_scope_as = target_one_check
				}	
				any_attending_character = {
					NOR = {
						root.intent_target ?= this
						house.house_confederation ?= root.house.house_confederation
						has_any_good_relationship_with_character_trigger = { CHARACTER = scope:target_one_check }
						this = scope:target_one_check
					}
					is_ai = yes
					house.house_head = this
					diplomacy <= low_skill_rating
					ai_boldness < low_positive_ai_value
				}		
			}
			trigger_else = {
				any_attending_character = {
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					ai_compassion < low_positive_ai_value
					save_temporary_scope_as = target_one_check
				}
				any_attending_character = {
					NOR = {
						house.house_confederation ?= root.house.house_confederation
						house.house_confederation ?= { this != scope:target_one_check.confederation }
						has_any_good_relationship_with_character_trigger = { CHARACTER = scope:target_one_check }
						this = scope:target_one_check
					}
					is_ai = yes
					house.house_head = this
					diplomacy <= low_skill_rating
					ai_boldness < low_positive_ai_value
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
						ai_compassion < low_positive_ai_value
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							root.intent_target ?= this
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							has_any_good_relationship_with_character_trigger = { CHARACTER = scope:target_character }
							this = scope:target_character
						}
						is_ai = yes
						house.house_head = this
						diplomacy <= low_skill_rating
						ai_boldness < low_positive_ai_value
					}
					save_scope_as = target_character2
				}
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
						ai_compassion < low_positive_ai_value
					}
					save_scope_as = target_character
				}
				random_attending_character = {
					limit = {
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							house.house_confederation ?= scope:target_character.confederation
							this = root
							has_any_good_relationship_with_character_trigger = { CHARACTER = scope:target_character }
							this = scope:target_character
						}
						is_ai = yes
						house.house_head = this
						diplomacy <= low_skill_rating
						ai_boldness < low_positive_ai_value
					}
					save_scope_as = target_character2
				}
			}
		}
		house.house_confederation ?= {
			save_scope_as = root_bloc
		}
	}

	option = {
		name = festival.109.a 

		scope:target_character = {

			add_opinion = {
				target = root
				modifier = opposed_me
				opinion = -15
			}
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_damage_minor_value
				REASON = forced_to_back_off
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		scope:target_character2 = {
			add_opinion = {
				target = root
				modifier = helped_me
				opinion = 20
			}
		}

		scope:target_character2.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = came_to_my_aid
				CHAR = root
				TARGET_CHAR = scope:target_character2
				TITLE = scope:dummy_gender
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character2
					value >= 25
				}
			}
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value < 25
				}
			}
		}
	}

	option = {
		name = festival.109.b

		scope:target_character2 = {

			add_opinion = {
				target = root
				modifier = festival_shamed_me
				opinion = -20
			}
		}

		scope:target_character2.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_damage_minor_value
				REASON = compelled_poetry
				CHAR = root
				TARGET_CHAR = scope:target_character2
				TITLE = scope:dummy_gender
			}
		}

		scope:target_character = {
			add_opinion = {
				target = root
				modifier = festival_shamed_another
				opinion = 20
			}
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = shared_mockery
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character2
					value < 25
				}
			}
		}
	}

	option = {
		name = festival.109.c

		trigger = {
			exists = house.house_confederation
		}

		if = {
			limit = {
				can_add_hook = {
					type = favor_hook
					target = scope:target_character2
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:target_character2
			}
		}

		house.house_confederation ?= {
			tgp_bloc_change_cohesion_effect = {
				VALUE = cohesion_gain_minor
				ICON = root
				REASON = festival
			}
		}
		
		scope:activity = {
			every_attending_character = {
				limit = {
					this != root
					highest_held_title_tier > tier_barony
					OR = {
						is_independent_ruler = yes
						is_vassal_of = top_liege
					}
					is_ai = yes
					house.house_confederation ?= root.house.house_confederation
				}
				custom = all_members_of_root_confederation_in_attendance
				add_opinion = {
					target = root
					modifier = festival_praised_poetic_prowess
					opinion = 20
				}
			}
		}

		ai_chance = {
			base = 40
		}
	}
}

festival.114 = {
	type = activity_event
	title = festival.114.t
	desc = festival.114.desc
	theme = festival_activity
	cooldown = { years = 1 }

	left_portrait = {
		character = root
		animation = personality_compassionate
	}
	center_portrait = {
		character = scope:companion
		animation = interested
	}

	right_portrait = {
		character = scope:target_character
		camera = camera_event_left_away_3_4_far
	}

	override_background = activity_witch_ritual

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = add_to_bloc_intent
			add = 50
		}
		modifier = {
			has_activity_intent = raise_cohesion_intent
			add = 50
		}
		modifier = {
			has_activity_intent = remove_from_bloc_intent
			add = 50
		}
	}

	trigger = {
		scope:activity = {
			trigger_if = {
				limit = {
					exists = root.intent_target
				}
				any_attending_character = {
					exists = house.house_confederation
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
					root.intent_target = this
				}	
			}
			trigger_else = {
				any_attending_character = {
					exists = house.house_confederation
					NOT = {
						house.house_confederation ?= root.house.house_confederation
					}
					is_ai = yes
					house.house_head = this
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				exists = root.intent_target
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						exists = house.house_confederation
						root.intent_target ?= this
						NOR = {
							this = root
							house.house_confederation ?= root.house.house_confederation
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
				#find a companion 
				ordered_attending_character = {
					order_by = "opinion(root)"
					max = 1
					limit = {
						this != root
						this != scope:target_character
						is_ai = yes
					}
					save_scope_as = companion
				}	
			}	
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						exists = house.house_confederation
						NOR = {
							house.house_confederation ?= root.house.house_confederation
							this = root
						}
						is_ai = yes
						house.house_head = this
					}
					save_scope_as = target_character
				}
			}
		}
		scope:target_character.house.house_confederation ?= {
			save_scope_as = bloc
		}
		house.house_confederation ?= {
			save_scope_as = root_bloc
		}
	}

	option = {
		name = festival.114.a 

		scope:target_character = {
			add_opinion = {
				target = root
				modifier = festival_extended_an_invitation
				opinion = 20
			}			
		}

		scope:target_character.house ?= {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = extended_a_kind_invitation
				CHAR = root
				TARGET_CHAR = scope:target_character
				TITLE = scope:dummy_gender
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value >= 25
				}
			}
		}
	}

	option = {
		name = festival.114.b

		scope:activity = {
			every_attending_character = {
				limit = {
					this != scope:target_character
					this != root
					highest_held_title_tier > tier_barony
					OR = {
						is_independent_ruler = yes
						is_vassal_of = top_liege
					}
					is_ai = yes
					house.house_confederation ?= root.house.house_confederation
				}
				custom = all_members_of_confederation_in_attendance
				reverse_add_opinion = {
					target = scope:target_character
					modifier = festival_cast_me_aside
					opinion = -30
				}
			}
		}

		ai_chance = {
			base = 25
			modifier = {
				add = 25
				opinion = {
					target = scope:target_character
					value < 25
				}
			}
		}
	}

	option = {
		name = festival.114.c

		trigger = {
			exists = house.house_confederation
		}

		house.house_confederation ?= {
			tgp_bloc_change_cohesion_effect = {
				VALUE = cohesion_gain_minor
				ICON = root
				REASON = festival
			}
		}
		scope:activity = {
			every_attending_character = {
				limit = {
					this != root
					highest_held_title_tier > tier_barony
					OR = {
						is_independent_ruler = yes
						is_vassal_of = top_liege
					}
					is_ai = yes
					house.house_confederation ?= root.house.house_confederation
				}
				custom = all_members_of_root_confederation_in_attendance
				add_opinion = {
					target = root
					modifier = festival_reinforced_group_cohesion
					opinion = 15
				}
			}
		}

		ai_chance = {
			base = 40
		}
	}
}

####################
# ESTEEMED COMPANY #
####################

scripted_trigger festival_1000_bloc_member_house_trigger = {
	NOR = {
		root ?= this
		scope:bloc_member_head_1 ?= this
	}
	is_house_head = yes
}

festival.1000 = {
	type = activity_event
	title = festival.1000.t
	desc = {
		desc = festival.1000.desc
		desc = festival.1000.outro
	}
	theme = festival_activity 
	override_background = tavern
	left_portrait = {
		character = root
		animation = war_over_tie
	}
	center_portrait = {
		character = scope:bloc_member_head_1
		animation = thinking
	}
	right_portrait = {
		character = scope:bloc_member_head_2
		animation = admiration
	}

	cooldown = { years = 1 }

	trigger = {
		# Is a house head
		is_house_head = yes
		# House is in a Bloc
		exists = house.house_confederation
		OR = {
			exists = intent_target
			scope:activity = {
				any_attending_character = {
					count >= 2
					is_house_head = yes
					this != root
				}
			}
		}
	}

	immediate = {
		house.house_confederation = { save_scope_as = bloc }
		# Always save intent target if relevant
		if = {
			limit = { has_activity_intent = add_to_bloc_intent }
			intent_target = { save_scope_as = bloc_member_head_1 }
			# Get member of own Bloc
			scope:bloc = {
				random_confederation_member_house = {
					limit = { # Prefer leading house
						this = scope:bloc.leading_house
						festival_1000_bloc_member_house_trigger = yes
					}
					alternative_limit = { festival_1000_bloc_member_house_trigger = yes }
					house_head = { save_scope_as = bloc_member_head_2 }
				}
			}
		}
		else_if = {
			limit = { has_activity_intent = remove_from_bloc_intent }
			intent_target = {
				save_scope_as = bloc_member_head_1
				# Get member of their Bloc
				house.house_confederation = {
					random_confederation_member_house = {
						limit = { # Prefer leading house
							this = root.intent_target.house.house_confederation.leading_house
							festival_1000_bloc_member_house_trigger = yes
						}
						alternative_limit = { festival_1000_bloc_member_house_trigger = yes }
						house_head = { save_scope_as = bloc_member_head_2 }
					}
				}
			}
		}
		else = {
			# Always have at least 2 other house heads in the event
			hidden_effect = {
				while = {
					limit = { NOT = { exists = scope:bloc_member_head_2 } }
					scope:activity = {
						random_attending_character = {
							limit = { festival_1000_bloc_member_house_trigger = yes }
							if = {
								limit = { exists = scope:bloc_member_head_1 }
								save_scope_as = bloc_member_head_2
							}
							else = { save_scope_as = bloc_member_head_1 }
						}
					}
				}
			}
		}
	}

	option = {
		name = festival.1000.a
		trigger = { has_activity_intent = raise_cohesion_intent }
		reason = activity_intent
		scope:bloc = {
			tgp_bloc_change_cohesion_effect = {
				VALUE = cohesion_gain_minor
				ICON = root
				REASON = festival
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = festival.1000.b
		trigger = { has_activity_intent = add_to_bloc_intent }
		reason = activity_intent
		reverse_add_opinion = {
			target = scope:bloc_member_head_1
			modifier = respect_opinion
			opinion = 15
		}
		scope:bloc_member_head_1.house = {
			change_house_relation_effect = {
				HOUSE = root.house
				VALUE = house_relation_improve_minor_value
				REASON = festival_increase
				CHAR = root
				TARGET_CHAR = scope:bloc_member_head_1
				TITLE = scope:dummy_gender
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = festival.1000.c
		trigger = { has_activity_intent = remove_from_bloc_intent }
		reason = activity_intent
		reverse_add_opinion = {
			target = scope:bloc_member_head_1
			modifier = insulted_opinion
			opinion = -15
		}
		scope:bloc_member_head_1.house = {
			change_house_relation_effect = {
				HOUSE = scope:bloc_member_head_1.house.house_confederation.leading_house
				VALUE = house_relation_damage_minor_value
				REASON = festival_decrease
				CHAR = root
				TARGET_CHAR = scope:bloc_member_head_1
				TITLE = scope:dummy_gender
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = festival.1000.e
		trigger = {
			NAND = {
				has_activity_intent = add_to_bloc_intent
				intent_target = scope:bloc_member_head_1
			}
		}
		house = {
			change_house_relation_effect = {
				HOUSE = scope:bloc_member_head_1.house
				VALUE = house_relation_improve_minor_value
				REASON = festival_increase
				CHAR = root
				TARGET_CHAR = scope:bloc_member_head_1
				TITLE = scope:dummy_gender
			}
		}
		ai_chance = {
			base = 10
			opinion_modifier = {
				opinion_target = scope:bloc_member_head_1
				multiplier = 0.1 # +10 at 100
			}
		}
	}

	option = {
		name = festival.1000.f
		trigger = {
			NAND = {
				has_activity_intent = add_to_bloc_intent
				intent_target = scope:bloc_member_head_2
			}
		}
		house = {
			change_house_relation_effect = {
				HOUSE = scope:bloc_member_head_2.house
				VALUE = house_relation_improve_minor_value
				REASON = festival_increase
				CHAR = root
				TARGET_CHAR = scope:bloc_member_head_2
				TITLE = scope:dummy_gender
			}
		}
		ai_chance = {
			base = 10
			opinion_modifier = {
				opinion_target = scope:bloc_member_head_2
				multiplier = 0.1 # +10 at 100
			}
		}
	}

	option = {
		name = festival.1000.g
		stress_impact = {
			base = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
		}
		ai_chance = {
			base = 10
		}
	}
}

###########
# CLOSING #
###########

festival.2000 = {
	type = activity_event
	title = festival.2000.t
	desc = {
		desc = festival.2000.intro_desc
		triggered_desc = {
			trigger = {
				exists = scope:friendly_attendee
			}
			desc = festival.2000.intro_part_two
		}
		desc = { 
			first_valid = {
				triggered_desc = {
					trigger = {
						exists = scope:bloc_inviter
					}
					desc = festival.2000.bloc_invitation
				}
				triggered_desc = {
					trigger = {
						exists = scope:friend_candidate
					}
					desc = festival.2000.befriending
				}
				desc = festival.2000.nobody_likes_you
			}
		}
	}
	theme = festival_activity

	left_portrait = {
		character = root
		animation = personality_compassionate
	}

	right_portrait = {
		character = scope:friendly_attendee
		animation = personality_compassionate
	}

	immediate = {
		if = {
			limit = {
				NOT = { exists = house.house_confederation }
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						is_ai = yes
						exists = house.house_confederation
						is_house_head = yes
						house.house_confederation.leading_house.house_head = {
							NOT = { has_any_bad_relationship_with_character_trigger = { CHARACTER = root } }
						}
						NOT = { has_any_bad_relationship_with_character_trigger = { CHARACTER = root } }
						opinion = {
							target = root
							value >= 50
						}
					}
					save_scope_as = friendly_attendee
					save_scope_as = bloc_inviter
					house.house_confederation = {
						save_scope_as = bloc_name
					}
				}
			}
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						is_ai = yes
						can_set_relation_friend_trigger = { CHARACTER = root }
						is_house_head = yes
						NOT = {
							has_any_relation_trigger = { CHARACTER = root }
						}
						opinion = {
							target = root
							value >= 30
						}
					}
					save_scope_as = friendly_attendee
					save_scope_as = friend_candidate
				}
			}
		}
	}

	option = {
		name = festival.2000.a_accept

		trigger = {
			exists = scope:bloc_inviter
		}

		scope:activity = {
			add_activity_log_entry = {
				key = festival_joined_a_bloc_log
				score = 10
				tags = { neutral }
				character = root
				root.house = {
					tgp_join_house_bloc_effect = {
						INVITER = scope:friendly_attendee.house
						OPINION = flag:yes
					}
				}
			}
		}

		if = {
			limit = {
				can_add_hook = {
					target = scope:friendly_attendee
					type = favor_hook
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:friendly_attendee
			}
		}
	}

	option = {
		name = festival.2000.a_decline

		trigger = {
			exists = scope:bloc_inviter
		}

		scope:friendly_attendee = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
	}

	option = {
		name = festival.2000.b_accept

		trigger = {
			exists = scope:friend_candidate
		}

		if = {
			limit = {
				scope:friendly_attendee = {
					can_set_relation_best_friend_trigger = { CHARACTER = root }
				}
				opinion = {
					target = scope:friendly_attendee
					value >= 90
				}
			}
			set_relation_best_friend = { reason = friend_festival_bonding target = scope:friendly_attendee }
		}
		else = {
			set_relation_friend = { reason = friend_festival_bonding target = scope:friendly_attendee }
		}
	}

	option = {
		name = festival.2000.b_decline

		trigger = {
			exists = scope:friend_candidate
		}

		scope:friendly_attendee = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -20
			}
		}
	}

	option = {
		name = festival.2000.c

		trigger = {
			NOT = {
				exists = scope:friendly_attendee
			}
		}
		
		stress_impact = {
			base = minor_stress_impact_loss
		}
	}
}
