﻿scripted_trigger tgp_east_asian_hunt_event_potential = {
	scope:host.culture = {
		has_graphical_east_asia_culture_group_trigger = yes
	}
}

scripted_trigger tgp_faith_is_buddhist_or_influenced_by_buddhism_trigger = {
	OR = {
		religion = religion:buddhism_religion
		has_doctrine = special_doctrine_is_eastern_faith
	}
}

scripted_trigger tgp_east_asian_influenced_by_buddhism_trigger = {
	scope:activity.activity_location.faith = {
		tgp_faith_is_buddhist_or_influenced_by_buddhism_trigger = yes
	}
}

namespace = tgp_hunt

#######################
#	Pair Separation
#######################

scripted_effect tgp_outlawed_falconry_hunt_end_effect = {
	if = {
		limit = { is_in_list = attendees }
		if = {
			limit = {
				scope:activity = {
					has_activity_option = { category = special_type option = hunt_type_falconry }
				}
			}
			hunter_lifestyle_rank_up_check_effect = { FALCONRY = yes }
		}
		else = {
			hunter_lifestyle_rank_up_check_effect = { FALCONRY = no }
		}
	}
	if = {
		limit = { exists = scope:activity }
		custom_tooltip = hunt_ends_tt
	}
	custom_tooltip = hunt_invalidated_warning_ban_tt
}

scripted_effect tgp_hunt_0006_outlaw_hunting_effect = {
	scope:activity = {
		add_activity_log_entry = {
			key = hunt_outlawed_falconry_log
			character = root
			
			root = {
				set_variable = banned_falconry_hunts
				tgp_outlawed_falconry_hunt_end_effect = yes
				add_piety = massive_piety_gain
			}
		}
	}
}

tgp_hunt.0002 = {
	type = activity_event
	title = tgp_hunt.0002.t
	desc = tgp_hunt.0002.desc
	theme = hunt_activity
	override_background = bp3_riverside
	cooldown = { years = 15 }
	
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				has_trait = compassionate
			}
			animation = sadness
		}
		animation = hunting_falcon
	}

	trigger = {
		tgp_east_asian_hunt_event_potential = yes
		NOT = {
			scope:activity.var:animal_type ?= flag:duck
		}
		has_dlc_feature = tours_and_tournaments
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
		}
	}

	option = { # Nice one!
		name = tgp_hunt.0002.a
		flavor = tgp_hunt.0002.a.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_caught_a_duck_log
				character = root
				
				root = {
					add_trait_xp = {
						trait = lifestyle_hunter
						track = falconer 
						value = 15
					}
					add_prestige = minor_prestige_gain

					hunt_activity_success_change_effect = { CHANGE = increase_minor }
				}
			}
		}

		stress_impact = {
			compassionate = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 1.25
				ai_boldness = 1.5
			}
		}
	}
	#Option B) # Show some compassion
	option = { 
		name = tgp_hunt.0002.b
		flavor = tgp_hunt.0002.b.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_showed_remorse_log
				character = root
				
				root = {
					add_piety = minor_piety_gain
				}
			}
		}

		ai_chance = {
			base = 35
			ai_value_modifier = {
				ai_compassion = 1.75
				ai_zeal = 1.25
			}
		}
	}
	#Option C) outlaw falconry
	option = { 
		name = tgp_hunt.0002.c
		flavor = tgp_hunt.0002.c.flavor

		trigger = {
			is_independent_ruler = yes
			scope:host = this
		}

		tgp_hunt_0006_outlaw_hunting_effect = yes

		stress_impact = {
			lifestyle_hunter = major_stress_impact_gain
		}

		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_compassion = 2
				ai_zeal = 2
			}
		}
	}
}

#######################
#	Hunt Invalidated Due to Falconry Ban
#######################

tgp_hunt.0003 = {
	type = character_event
	title = tgp_hunt.0003.t
	desc = tgp_hunt.0003.desc
	theme = hunt_activity
	right_portrait = {
		animation = disappointed
		character = root
	}

	option = { # Time to go home
		name = tgp_hunt.0003.a
		flavor = tgp_hunt.0003.a.flavor

		hunt_invalidation_event_effect = yes
	}	
}

#######################
#	Spiritual Figurine Sighted
#######################

scripted_trigger tgp_hunt_0004_local_faith_true_trigger = {
	scope:local_faith = root.faith
}

scripted_trigger tgp_hunt_0004_local_faith_astray_trigger = {
	scope:local_faith != root.faith
	root.faith = {
		faith_hostility_level = {
			target = scope:local_faith
			value <= faith_astray_level
		}
	}
}

scripted_trigger tgp_hunt_0004_local_faith_hostile_trigger = {
	scope:local_faith != root.faith
	root.faith = {
		faith_hostility_level = {
			target = scope:local_faith
			value > faith_astray_level
		}
	}
}

scripted_effect tgp_hunt_0004_desecration_effect = {
	add_piety = medium_piety_gain
	scope:activity.activity_location = {
		add_province_modifier = {
			modifier = hunt_faith_desecrated_place_of_worship
			years = 5
		}
	}
	stress_impact = {
		zealous = minor_stress_impact_loss
	}
}

scripted_effect tgp_hunt_0004_prayer_effect = {
	if = {
		limit = {
			tgp_hunt_0004_local_faith_astray_trigger = yes
		}
		add_piety = {
			value = medium_piety_gain
			multiply = 0.5
		}
	}
	else = {
		add_piety = medium_piety_gain
	}
}

tgp_hunt.0004 = {
	type = activity_event
	title = tgp_hunt.0004.t
	desc = {
		first_valid = {
			triggered_desc = {
				desc = tgp_hunt.0004.desc_true
				trigger = {
					tgp_hunt_0004_local_faith_true_trigger = yes
				}
			}
			triggered_desc = {
				desc = tgp_hunt.0004.desc_astray
				trigger = {
					tgp_hunt_0004_local_faith_astray_trigger = yes
				}
			}
			triggered_desc = {
				desc = tgp_hunt.0004.desc_evil_hostile
				trigger = {
					always = yes
				}
			}
		}
	}
	theme = hunt_activity
	cooldown = { years = 15 }

	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				tgp_hunt_0004_local_faith_true_trigger = yes
			}
			animation = prayer
		}
		triggered_animation = {
			trigger = {
				tgp_hunt_0004_local_faith_astray_trigger = yes
			}
			animation = personality_zealous
		}
		triggered_animation = {
			trigger = {
				tgp_hunt_0004_local_faith_hostile_trigger = yes
			}
			animation = personality_vengeful
		}
	}

	trigger = {
		tgp_east_asian_hunt_event_potential = yes
		tgp_east_asian_influenced_by_buddhism_trigger = yes
	}

	immediate = {
		scope:activity.activity_location.faith = {
			save_scope_as = local_faith
		}
	}

	option = {
		name = tgp_hunt.0004.a
		flavor = tgp_hunt.0004.a.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_went_past_a_religious_figure_log
				character = root
				
				root = {
					hunt_activity_success_change_effect = { CHANGE = increase_minor }

					add_trait_xp = {
						trait = lifestyle_hunter
						track = hunter
						value = 15
					}

					stress_impact = {
						zealous = minor_stress_impact_gain
					}
				}
			}
		}

		stress_impact = {
			zealous = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = 2
			}
		}
	}

	option = {
		name = tgp_hunt.0004.b
		flavor = tgp_hunt.0004.b.flavor

		trigger = {
			tgp_hunt_0004_local_faith_true_trigger = yes
		}
		
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_prayed_at_a_statue_log
				character = root
				
				root = {
					tgp_hunt_0004_prayer_effect = yes
				}
			}
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = 2
			}
		}

		stress_impact = {
			cynical = minor_stress_impact_gain
		}
	}

	option = {
		name = tgp_hunt.0004.c
		flavor = tgp_hunt.0004.c.flavor

		trigger = {
			tgp_hunt_0004_local_faith_astray_trigger = yes
		}

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_prayed_at_a_statue_log
				character = root
				
				root = {
					tgp_hunt_0004_prayer_effect = yes
				}
			}
		}

		stress_impact = {
			cynical = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = 2
			}
		}
	}

	option = {
		name = tgp_hunt.0004.d
		flavor = tgp_hunt.0004.d.flavor

		trigger = {
			tgp_hunt_0004_local_faith_astray_trigger = yes
		}

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_desecrated_a_statue_log
				character = root
				
				root = {
					tgp_hunt_0004_desecration_effect = yes
				}
			}
		}

		stress_impact = {
			cynical = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 2
			}
		}
	}

	option = {
		name = tgp_hunt.0004.e
		flavor = tgp_hunt.0004.e.flavor

		trigger = {
			tgp_hunt_0004_local_faith_hostile_trigger = yes
		}

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_desecrated_a_statue_log
				character = root
				
				root = {
					tgp_hunt_0004_desecration_effect = yes
				}
			}
		}

		stress_impact = {
			cynical = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 2
				ai_zeal = 2
			}
		}
	}
}

#######################
#	Beast in the Rice Fields
#######################

scripted_effect flushed_out_the_beast = {
	hunt_activity_success_change_effect = { CHANGE = increase_minor }
}

scripted_effect failed_to_flush_out_the_beast = {
	root = {
		add_prestige = minor_prestige_loss
	}
}

tgp_hunt.0005 = {
	type = activity_event
	title = tgp_hunt.0005.t
	desc = tgp_hunt.0005.desc
	theme = hunt_activity
	override_background = tgp_rice_fields
	cooldown = { years = 15 }

	left_portrait = {
		character = root
		animation = horse_archer_idle
		camera = camera_activity_horse
	}

	right_portrait = {
		character = scope:target_character
		animation = horse_archer_aggressive
		camera = camera_activity_horse
	}

	trigger = {
		tgp_east_asian_hunt_event_potential = yes
	}

	immediate = {
		hunt_activity_random_subordinate_participant_effect = {
			ARCHETYPE = hunter
			COMBATANT = yes
			SCOPE = target_character
		}

		court_position:master_of_hunt_court_position ?= {
			save_scope_as = target_character
		}
	}

	option = {
		name = tgp_hunt.0005.a

		skill = martial

		duel = {
			skill = martial
			value = high_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				desc = tgp_hunt.0005.success
				send_interface_toast = {
					title = tgp_hunt.0005.success
					left_icon = root
					root = {
						flushed_out_the_beast = yes
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				desc = tgp_hunt.0005.failure
				send_interface_toast = {
					title = tgp_hunt.0005.failure
					left_icon = root
					root = {
						failed_to_flush_out_the_beast = yes 
					}
				}
			}
		}

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

	option = {
		name = tgp_hunt.0005.d

		trigger = {
			has_trait = lifestyle_hunter
			has_trait_xp = { trait = lifestyle_hunter track = hunter value >= 50 }
		}

		flushed_out_the_beast = yes

		stress_impact = {
			impatient = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_rationality = 2
			}
		}
	}

	option = {
		name = tgp_hunt.0005.b

		add_dread = minor_dread_gain
		scope:activity.activity_location = {
			add_province_modifier = {
				modifier = tgp_hunt_burnt_local_crops
				years = 5
			}
		}
		flushed_out_the_beast = yes

		stress_impact = {
			compassionate = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_rationality = 1
				ai_honor = -1
			}
		}
	}

	option = {
		name = tgp_hunt.0005.c

		add_prestige = minor_prestige_loss
		scope:target_character = {
			duel = {
				skill = martial
				value = high_skill_rating
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					desc = tgp_hunt.0005.success
					send_interface_toast = {
						title = tgp_hunt.0005.success
						left_icon = scope:target_character
						root = {
							flushed_out_the_beast = yes
						}
					}
				}
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					desc = tgp_hunt.0005.failure
					send_interface_toast = {
						title = tgp_hunt.0005.failure
						left_icon = scope:target_character
						reverse_add_opinion = {
							target = root
							modifier = disappointed_opinion
							opinion = -10
						}
					}
				}
			}
		}

		stress_impact = {
			ambitious = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_rationality = 1
				ai_sociability = 1
			}
		}
	}
}

#######################
#	Poem Written
#######################

tgp_hunt.0006 = {
	type = activity_event
	title = tgp_hunt.0006.t
	desc = tgp_hunt.0006.desc
	theme = hunt_activity_camp
	cooldown = { years = 15 }

	left_portrait = {
		animation = interested
		character = root
	}
	right_portrait = {
		animation = storyteller
		character = scope:poet
	}

	trigger = {
		this = scope:host
		scope:host.court_position:court_poet_court_position ?= {
			is_participant_in_activity = scope:activity
			aptitude:court_poet_court_position >= 1
		}
	}

	immediate = {
		scope:activity.activity_location = {
			save_scope_as = activity_location
		}
		scope:host.court_position:court_poet_court_position = {
			save_scope_as = poet
		}
		if = {
			limit = {
				has_activity_intent = befriend_attendee_intent
				exists = intent_target
				intent_target != scope:poet
			}
			intent_target = {
				save_scope_as = befriend_target
			}
		}
		else_if = {
			limit = {
				has_activity_intent = woo_attendee_intent
				exists = intent_target
				intent_target != scope:poet
			}
			intent_target = {
				save_scope_as = seduction_target
			}
		}
		set_local_variable = {
			name = befriend_value
			value = {
				value = 10
				multiply = {
					value = scope:host.aptitude:court_poet_court_position
					subtract = 1
				}
			}
		}
	}

	option = {
		name = tgp_hunt.0006.a

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_gives_advice_log
				character = root
				
				root = {
					add_stress = {
						value = minor_stress_loss
						multiply = {
							value = 1
							add = {
								value = scope:host.aptitude:court_poet_court_position
								subtract = 1
								divide = 10
							}
						}
					}
					custom_tooltip = hunt_depends_on_aptitude
				}
			}
		}

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

	option = {
		name = tgp_hunt.0006.b

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_had_poem_written_about_self_log
				character = root
				
				root = {
					add_prestige = {
						value = medium_prestige_gain
						multiply = {
							value = 1
							add = {
								value = scope:host.aptitude:court_poet_court_position
								subtract = 1
								divide = 10
							}
						}
					}
					custom_tooltip = hunt_depends_on_aptitude
				}
			}
		}
		
		stress_impact = {
			humble = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
	
	option = {
		name = tgp_hunt.0006.c

		trigger = {
			exists = scope:seduction_target
		}

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_had_poem_written_about_their_love_interest_log
				character = root
				
				root = {
					progress_towards_lover_effect = {
						CHARACTER = scope:seduction_target
						OPINION = local_var:befriend_value
						REASON = hunt_poem_dedication
					}
					custom_tooltip = hunt_depends_on_aptitude
				}
			}
		}

		stress_impact = {
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 1.25
			}
		}
	}

	option = {
		name = tgp_hunt.0006.d

		trigger = {
			exists = scope:befriend_target
		}

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_had_poem_written_about_friend_target_log
				character = root
				
				root = {
					progress_towards_friend_effect = {
						CHARACTER = scope:befriend_target
						OPINION = local_var:befriend_value
						REASON =  hunt_poem_dedication
					}
					custom_tooltip = hunt_depends_on_aptitude
				}
			}
		}

		stress_impact = {
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 1.25
			}
		}
	}

	option = {
		name = tgp_hunt.0006.e

		trigger = {
			has_trait = lifestyle_poet
		}

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_helped_write_poem_log
				character = root
				
				root = {
					add_trait_xp = {
						trait = lifestyle_poet
						value = 10
					}
					scope:poet = {
						add_opinion = {
							target = root
							modifier = hunt_helped_with_poem
							opinion = 10
						}
						reverse_add_opinion = {
							target = root
							modifier = hunt_helped_with_poem
							opinion = 10
						}
					}
				}
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}
}

#######################
#	Fang Sheng
#######################

tgp_hunt.0007 = {
	type = activity_event
	title = tgp_hunt.0007.t
	desc = tgp_hunt.0007.desc
	theme = hunting
	cooldown = { years = 15 }

	left_portrait = {
		character = root
		animation = interested
	}
	
	right_portrait = {
		character = scope:target_character
		animation = hunting_carcass_start
	}

	trigger = {
		tgp_east_asian_hunt_event_potential = yes
		tgp_east_asian_influenced_by_buddhism_trigger = yes
		NOT = {
			scope:activity.var:animal_type ?= flag:hare
		}
	}

	immediate = {
		hunt_activity_random_interest_participant_effect = {
			ARCHETYPE = hunter
			COMBATANT = yes
			SCOPE = target_character
		}
	}

	option = {
		name = tgp_hunt.0007.a
		flavor = tgp_hunt.0007.a.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_found_rabbit_in_a_trap_log
				character = root

				hunt_activity_success_change_effect = { CHANGE = increase_minor }
				scope:activity = {
					every_attending_character = {
						limit = {
							this != root
						}
						custom = all_hunt_participants
						add_opinion = {
							modifier = hunt_active_participation
							target = root
							opinion = 5
						}
					}
				}
			}
		}

		stress_impact = {
			compassionate = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_rationality = 2
				ai_boldness = 1.25
				ai_sociability = 1.25
			}
		}
	}

	option = {
		name = tgp_hunt.0007.b
		flavor  = tgp_hunt.0007.b.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_released_rabbit_from_trap_log
				character = root
				root = {
					add_piety = {
						value = minor_piety_gain
						if = {
							limit = {
								faith.religion ?= religion:buddhism_religion
							}
							multiply = 2
						}
					}
				}
			}
		}

		duel = {
			skill = diplomacy
			target = scope:target_character
			30 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -25
				}
				desc = tgp_hunt.0007.b.success
				send_interface_toast = {
					title = tgp_hunt.0007.b.success
					left_icon = scope:target_character
							
					add_diplomacy_lifestyle_xp = minor_lifestyle_xp 
				}
			}
			70 = {
				desc = tgp_hunt.0007.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -25
				}
				send_interface_toast = {
					title = tgp_hunt.0007.b.success
					left_icon = scope:target_character

					scope:activity = {
						every_attending_character = {
							limit = {
								this != root
							}
							custom = activity_every_attendee_tt
							add_opinion = {
								target = root
								modifier = hunt_released_someones_catch
								opinion = -5
							}
						}
					}
				}
			}
		}
		
		stress_impact = {
			sadistic = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			lifestyle_hunter = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 2
			}
		}
	}
}

#######################
#	Hunter Abandons Lifestyle to become a Monk
#######################

scripted_effect tgp_hunt_hunter_becomes_a_buddhist_monk_effect = {
	scope:target_character = {
		remove_trait = lifestyle_hunter
		remove_from_activity = scope:activity
		add_character_flag = {
			flag = need_priest_outfit
		}
	}
	hunt_activity_success_change_effect = { CHANGE = decrease_medium }
}

tgp_hunt.0008 = {
	type = activity_event
	title = tgp_hunt.0008.t
	desc = tgp_hunt.0008.desc
	theme = hunt_activity_camp
	cooldown = { years = 15 }

	left_portrait = {
		animation = disgust
		character = root
	}
	right_portrait = {
		animation = dismissal
		character = scope:target_character
	}

	trigger = {
		tgp_east_asian_hunt_event_potential = yes
		tgp_east_asian_influenced_by_buddhism_trigger = yes
		scope:activity = {
			any_attending_character = {
				is_ai = yes
				has_trait = lifestyle_hunter
			}
		}
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_ai = yes
					has_trait = lifestyle_hunter
				}
				save_scope_as = target_character
			}
		}
	}

	option = {
		name = tgp_hunt.0008.a
		flavor = tgp_hunt.0008.a.flavor

		duel = {
			skill = diplomacy
			target = scope:target_character
			70 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -25
				}
				desc = tgp_hunt.0008.a.success
				send_interface_toast = {
					title = tgp_hunt.0008.a.success
					left_icon = scope:target_character
					
					scope:activity = {
						add_activity_log_entry = {
							key = hunt_character_got_talked_out_of_becoming_monk_log
							character = scope:target_character
							scope:activity = {
								every_attending_character = {
									limit = {
										this != root
									}
									custom = activity_every_attendee_tt
									add_opinion = {
										target = root
										modifier = hunt_convinced_fellow_hunter_to_stay
										opinion = 10
									}
								}
							}

							root = { add_diplomacy_lifestyle_xp = medium_lifestyle_xp }
						}
					}
				}
			}
			30 = {
				desc = tgp_hunt.0008.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -25
				}
				send_interface_toast = {
					title = tgp_hunt.0008.a.success
					left_icon = scope:target_character

					scope:activity = {
						add_activity_log_entry = {
							key = hunt_character_became_a_buddhist_monk_log
							character = scope:target_character
							
							root = {
								add_prestige = medium_prestige_loss
								tgp_hunt_hunter_becomes_a_buddhist_monk_effect = yes
							}
						}
					}
				}
			}
		}

		stress_impact = {
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_rationality = 1.25
				ai_sociability = 2
			}
		}
	}

	option = {
		name = tgp_hunt.0008.b
		flavor = tgp_hunt.0008.b.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_character_became_a_buddhist_monk_log
				character = scope:buddhist_hermit
				
				root = {
					tgp_hunt_hunter_becomes_a_buddhist_monk_effect = yes
				}
			}
		}

		stress_impact = {
			lifestyle_hunter = minor_stress_impact_gain
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = 1.25
				ai_zeal = 1.25
			}
		}
	}
}

######################
#	Buddhist Hermit
######################

scripted_effect tgp_hunt_0009_get_falcon = {
	if = {
		limit = { has_character_modifier = peregrine_falcon }
		hidden_effect = { remove_character_modifier = peregrine_falcon }
	}
	add_character_modifier = {
		modifier = peregrine_falcon
		years = 5
	}
}

tgp_hunt.0009 = {
	type = activity_event
	title = tgp_hunt.0009.t
	desc = tgp_hunt.0009.desc
	theme = hunt_activity
	cooldown = { years = 15 }

	left_portrait = {
		animation = interested
		character = root
	}
	right_portrait = {
		animation = hunting_falcon
		character = scope:buddhist_hermit
	}
	override_background = {
		trigger = {
			scope:activity.activity_location = {
				OR = {
					terrain = forest
					terrain = taiga
				}
				NOR = {
					geographical_region = world_africa
					geographical_region = world_india
					geographical_region = world_europe_west_iberia
					geographical_region = world_middle_east
				}
			}
		}
		reference = ep2_hunt_forest_hut
	}

	trigger = {
		tgp_east_asian_hunt_event_potential = yes
		tgp_east_asian_influenced_by_buddhism_trigger = yes 
	}

	immediate = {
		hidden_effect = {
			scope:activity.activity_location = {
				save_scope_as = activity_location
			}
			if = {
				limit = {
					scope:activity.activity_location.religion = religion:buddhism_religion
				}
				scope:activity.activity_location.faith = {
					save_scope_as = target_faith
				}
			}
			else_if = {
				limit = {
					scope:host = {
						any_sub_realm_county = {
							religion = religion:buddhism_religion
						}
					}
				}
				religion:buddhism_religion = {
					random_faith = {
						save_scope_as = target_faith
					}
				}
			}
			else = { #fallback
				faith:dhyana = { 
					save_scope_as = target_faith
				}
			}
			create_character = {
				template = priest_character_template
				location = scope:activity.activity_location
				dynasty = none
				culture = scope:activity.activity_location.culture
				faith = scope:target_faith
				save_scope_as = buddhist_hermit
			}
		}
	}

	option = { # Deceived a Monk
		name = tgp_hunt.0009.a
		flavor = tgp_hunt.0009.a.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_deceives_a_monk
				character = root

				#Effect
				root = {
					duel = {
						skills = { diplomacy intrigue }
						target = scope:buddhist_hermit
						70 = {
							desc = tgp_hunt.0009.a.success
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -25
							}
							modifier = {
								has_trait = deceitful
								factor = 2
							}
							send_interface_toast = {
								title = tgp_hunt.0009.a.success
								left_icon = scope:buddhist_hermit
								
								tgp_hunt_0009_get_falcon = yes
							}
						}
						30 = {
							desc = tgp_hunt.0009.a.failure
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -25
							}
							send_interface_toast = {
								title = tgp_hunt.0009.b.failure
								left_icon = scope:buddhist_hermit

								add_prestige = medium_prestige_loss
							}
						}
					}
				}
			}
		}

		stress_impact = {
			honest = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_honor = -1
			}
		}
	}

	option = { # Offer to buy the falcon
		name = tgp_hunt.0009.b
		flavor = tgp_hunt.0009.b.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_deceives_a_monk
				character = root

				#Effect
				root = {
					duel = {
						skill = diplomacy
						target = scope:buddhist_hermit
						90 = {
							desc = tgp_hunt.0009.b.success
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -25
							}

							send_interface_toast = {
								title = tgp_hunt.0009.b.success
								left_icon = scope:buddhist_hermit
								
								if = {
									limit = {
										has_trait = generous
									}
									pay_short_term_gold = {
										target = scope:buddhist_hermit
										gold = scope:buddhist_hermit.massive_gold_value
									}
								}
								else = {
									pay_short_term_gold = {
										target = scope:buddhist_hermit
										gold = scope:buddhist_hermit.major_gold_value
									}
								}

								tgp_hunt_0009_get_falcon = yes
							}
						}
						10 = {
							desc = tgp_hunt.0009.b.failure
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -25
							}
							send_interface_toast = {
								title = tgp_hunt.0009.b.failure
								left_icon = scope:buddhist_hermit

								add_prestige = medium_prestige_loss
							}
						}
					}
				}
			}
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_honor = -1
				ai_greed = -2
			}
		}
	}
	
	option = { # Bah! I don't care.
		name = tgp_hunt.0009.c
		flavor = tgp_hunt.0009.c.flavor

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_wanders
				character = root

				hunt_activity_success_change_effect = { CHANGE = increase_minor }
			}
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_energy = -1
			}
		}
	}
	
	option = { # Admire Monk's values
		name = tgp_hunt.0009.d
		flavor = tgp_hunt.0009.d.flavor

		trigger = {
			scope:host.faith = {
				tgp_faith_is_buddhist_or_influenced_by_buddhism_trigger = yes
			}
		}

		scope:activity = {
			add_activity_log_entry = {
				key = hunt_admires_buddhist_principles
				character = root

				add_piety = minor_piety_gain
			}
		}

		stress_impact = {
			cynical = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_compassion = 1.25
				ai_sociability = 1.5
				ai_zeal = 2
			}
		}
	}
}

######################
#	Red-Crowned Crane
######################

tgp_hunt.0010 = {
	type = activity_event
	title = tgp_hunt.0010.t
	desc = {
		first_valid = {
			triggered_desc = {
				desc = tgp_hunt.0010.desc_master_of_the_hunt
				trigger = {
					court_position:master_of_hunt_court_position ?= {
						is_participant_in_activity = scope:activity
					}
				}
			}
			triggered_desc = {
				desc = tgp_hunt.0010.desc_fallback
				trigger = { always = yes } 
			}
		}
	}
	theme = hunt_activity
	override_background = tgp_rice_fields
	cooldown = { years = 15 }

	left_portrait = {
		animation = interested
		character = root
	}

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

	trigger = {
		tgp_east_asian_hunt_event_potential = yes
	}

	immediate = {
		hunt_activity_random_subordinate_participant_effect = {
			ARCHETYPE = hunter
			COMBATANT = yes
			SCOPE = target_character
		}
		court_position:master_of_hunt_court_position ?= {
			if = {
				limit = {
					is_participant_in_activity = scope:activity
				}
				save_scope_as = target_character
			}
		}
	}

	option = {
		name = tgp_hunt.0010.a

		trigger = {
			NOT = { has_trait = lifestyle_poet }
		}

		stress_impact = {
			base = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
		}

		if = {
			limit = {
				NOT = { has_trait = lifestyle_poet }
			}
			random = {
				chance = 10
				add_trait = lifestyle_poet
			}
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_honor = -1
			}
		}
	}

	option = {
		name = tgp_hunt.0010.b

		hunt_activity_success_change_effect = { CHANGE = increase_minor }

		stress_impact = {
			fickle = minor_stress_impact_gain
		}

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

	option = {
		name = tgp_hunt.0010.c

		duel = {
			skill = prowess
			value =  medium_skill_rating
			
			50 = {
				desc = tgp_hunt.0010.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -25
					min = -25
				}

				send_interface_toast = {
					title = tgp_hunt.0010.c.success
					left_icon = root
					
					add_prestige = medium_prestige_gain
				}
			}
			50 = {
				desc = tgp_hunt.0010.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -25
				}
				send_interface_toast = {
					title = tgp_hunt.0010.c.failure
					left_icon = root

					add_stress = medium_stress_impact_gain
				}
			}
		}
		stress_impact = {
			content = minor_stress_impact_gain
		}

		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_compassion = -0.5
			}
		}
	}

	option = {
		name = tgp_hunt.0010.d

		trigger = { has_trait = lifestyle_poet }

		add_trait_xp = {
			trait = lifestyle_poet
			value = 10
		}

		stress_impact = {
			base = minor_stress_impact_loss
		}

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