decisions = {

	feast_0 = {
		ai_check_interval = 12

		only_playable = yes

		potential = {
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
			}

			OR = {
				religion_group = christian
				religion_group = zoroastrian_group
				religion_group = jewish_group

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}

			num_of_vassals >= 1
			prisoner = no

			NOR = {
				has_character_modifier = holding_large_feast
				has_character_modifier = large_feast_timer
				has_character_modifier = fabulous_feast
				has_character_flag = guest_feast_started

				liege = {
					has_character_modifier = holding_large_feast
				}
			}
		}

		allow = {
			month >= 10
			wealth >= 25
			prestige >= 100
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -25

			add_character_modifier = {
				name = holding_large_feast
				duration = -1
			}

			save_event_target_as = feast_host
			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			character_event = { id = 72109 } # Feast

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth > 200
				diplomacy >= 10
				NOT = { trait = shy }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	summer_fair = {
		ai_check_interval = 3

		only_playable = yes

		potential = {
			OR = {
				religion_group = christian
				religion = mazdaki
				religion = manichaean

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}

			num_of_vassals >= 1
			prisoner = no

			NOT = { has_character_modifier = holding_summer_fair }

			trigger_if = {
				limit = { has_character_flag = recent_summer_fair }

				had_character_flag = {
					flag = recent_summer_fair
					days >= 60
				}
			}
		}

		allow = {
			month >= 4
			month <= 6
			wealth >= 25
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -25

			add_character_modifier = {
				name = holding_summer_fair
				duration = -1
			}

			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			character_event = { id = 74050 } # Summer fair begins

			character_event = {
				id = 74047 # Summer fair ends
				months = 2
			}

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 200
				NOT = { trait = slothful }
				stewardship >= 10

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years > 2
					}
				}
			}
		}
	}

	hold_grand_hunt = {
		ai_check_interval = 2

		only_playable = yes

		potential = {
			is_adult = yes
			is_incapable = no
			prisoner = no

			trigger_if = {
				limit = { is_female = yes }

				OR = {
					has_law = status_of_women_4

					has_game_rule = {
						name = gender
						value = all
					}
				}
			}

			OR = {
				religion_group = christian
				religion_group = pagan_group
				religion_group = zoroastrian_group

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}

			NOR = {
				has_character_modifier = holding_grand_hunt
				has_landed_title = e_mongol_empire
				has_landed_title = e_golden_horde
				has_landed_title = e_ilkhanate
				has_landed_title = e_chagatai
			}

			trigger_if = {
				limit = { has_dlc = "Way of Life" }
				has_focus = focus_hunting
			}
		}

		allow = {
			month >= 8
			month <= 9
			wealth >= 25
			war = no
			health_traits == 0 # TODO: Tooltip is awkward. Replace with custom tooltip
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -25

			add_character_modifier = {
				name = holding_grand_hunt
				duration = -1
			}

			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb

			character_event = { id = 36080 } # Hunt begins

			character_event = {
				id = 36090 # Hunt ends
				months = 2
			}

			character_event = { # TODO: Is this necessary?
				id = 36999 # Safety catch flag clearing
				months = 5
			}

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				trigger_if = {
					limit = { has_focus = focus_hunting }
					wealth >= 50
				}
				trigger_else = {
					wealth >= 200
				}

				martial >= 10
				NOT = { trait = craven }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	hold_tiger_hunt = {
		ai_check_interval = 7

		only_playable = yes

		potential = {
			has_dlc = "Rajas of India"

			capital_scope = {
				region = world_india
			}

			is_adult = yes
			prisoner = no
			num_of_vassals >= 1

			NOR = {
				has_character_flag = holding_tiger_hunt
				has_character_modifier = hunt_timer
			}
		}

		allow = {
			month <= 9
			wealth >= 25
			war = no
			prisoner = no
			is_incapable = no
			is_inaccessible_trigger = no
			NOT = { religion = jain }

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -25

			set_character_flag = holding_tiger_hunt
			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			character_event = { id = RoI.2000 }

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				trigger_if = {
					limit = { has_focus = focus_hunting }

					wealth >= 50
				}
				trigger_else = {
					wealth >= 200
					martial >= 10
				}

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	choose_hindu_patron_deity = {
		ai_check_interval = 12

		is_high_prio = yes

		only_playable = yes

		potential = {
			has_dlc = "Rajas of India"
			religion = hindu
			is_adult = yes
			is_incapable = no

			NOR = {
				has_character_modifier = patron_shiva
				has_character_modifier = patron_vishnu
				has_character_modifier = patron_brahma
				has_character_modifier = patron_kali
				has_character_modifier = patron_ganesha
				has_character_modifier = patron_ganga
				has_character_flag = selecting_patron_deity

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			prisoner = no
		}

		effect = {
			custom_tooltip = {
				text = custom_tooltip_choose_patron_diety

				character_event = { id = RoI.100 }
				set_character_flag = selecting_patron_deity
			}
		}

		ai_will_do = {
			factor = 0.1

			mult_modifier = {
				factor = 5
				trait = zealous
			}

			mult_modifier = {
				factor = 0.5
				trait = cynical
			}
		}
	}

	indian_pilgrimage = {        # For all Dharmics
		ai_check_interval = 120

		only_playable = yes

		potential = {
			has_dlc = "Mystics"
			has_dharmic_religion_trigger = yes

			trigger_if = {
				limit = { has_dlc = "Way of Life" }

				OR = {
					has_focus = focus_theology
					has_quest = quest_indian_monastic_order_pilgrimage
				}
			}

			NOR = {
				trait = indian_pilgrim

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			scaled_wealth = 0.2
			is_adult = yes
			war = no
			in_command = no
			prisoner = no
			is_inaccessible_trigger = no

			custom_tooltip = {
				text = health_travel_condition

				is_incapable = no
				has_epidemic_disease_trigger = no

				NOR = {
					trait = pregnant
					trait = blinded
				}
			}

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			scaled_wealth = -0.2
			set_character_flag = activated_pilgrimage
			set_character_flag = do_not_disturb
			character_event = { id = MNM.8000 }
		}

		ai_will_do = {
			factor = 0.1 # Only a small minority ever go on a pilgrimage

			trigger = {
				age >= 30
				wealth >= 200
			}

		#	mult_modifier = {
		#		factor = 100
		#		has_quest = quest_indian_monastic_order_pilgrimage
		#	}

			mult_modifier = {
				factor = 3
				trait = zealous
			}
		}
	}

	christian_pilgrimage = {
		ai_check_interval = 120

		only_playable = yes

		potential = {
			has_dlc = "Sons of Abraham"
			religion_group = christian
			### CIM ###
			trigger_if = {
				limit = { has_global_flag = is_kcl_CIML_save }
				NOT = { religion = mandean }
			}

			trigger_if = {
				limit = { has_dlc = "Way of Life" }

				OR = {
					has_focus = focus_theology
					has_quest = quest_monastic_order_pilgrimage_christian
				}
			}

			NOR = {
				trait = pilgrim

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			scaled_wealth = 0.2
			is_adult = yes
			war = no
			in_command = no
			prisoner = no
			is_inaccessible_trigger = no

			custom_tooltip = {
				text = health_travel_condition

				is_incapable = no
				has_epidemic_disease_trigger = no

				NOR = {
					trait = pregnant
					trait = blinded
				}
			}

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}

			trigger_if = {
				limit = { has_character_modifier = coronation_request_cooldown }

				custom_tooltip = {
					text = TT_NOT_RECENTLY_ASKED_CORONATION
					always = no
				}
			}
		}

		effect = {
			scaled_wealth = -0.2
			set_character_flag = activated_pilgrimage
			set_character_flag = do_not_disturb
			character_event = { id = SoA.5000 }
		}

		ai_will_do = {
			factor = 0.1 # Only a small minority of Christians ever go on a pilgrimage

			trigger = {
				wealth >= 200
				age >= 30
			}

			mult_modifier = {
				factor = 3
				trait = zealous
			}
		}
	}

	go_on_hajj = {
		ai_check_interval = 12

		is_high_prio = yes

		only_playable = yes

		potential = {
			religion_group = muslim

			NOR = {
				religion = qarmatian
				trait = hajjaj
				trait = on_hajj
				has_character_flag = preparing_hajj
				has_character_flag = activated_hajj
				has_character_flag = ramadan

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
				### CIM ###
				trigger_if = {
					limit = { has_global_flag = is_kcl_CIML_save }
					religion = yarsan
				}
			}
		}

		allow = {
			scaled_wealth = 0.2
			is_adult = yes
			war = no
			in_command = no
			prisoner = no
			is_inaccessible_trigger = no

			custom_tooltip = {
				text = health_travel_condition

				is_incapable = no
				has_epidemic_disease_trigger = no

				NOT = { trait = blinded }
			}

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			scaled_wealth = -0.2
			clr_character_flag = promise_hajj
			set_character_flag = activated_hajj
			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			letter_event = { id = 86000 }

			if = {
				limit = { trait = decadent }
				remove_trait = decadent
			}
		}

		ai_will_do = {
			factor = 0.01

			trigger = {
				age >= 30
				wealth >= 300
				NOT = { trait = cynical }

				trigger_if = {
					limit = { is_ruler = no }
					NOT = { trait = decadent }
				}
			}

			mult_modifier = {
				factor = 2
				is_ruler = yes
				trait = decadent
			}
		}
	}

	observe_ramadan = {
		ai = no

		potential = {
			religion_group = muslim
			prisoner = no
			is_adult = yes
			is_incapable = no

			NOR = {
				has_character_flag = ramadan
				has_character_modifier = observed_ramadan
				trait = on_hajj

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
				### CIM ###
				trigger_if = {
					limit = { has_global_flag = is_kcl_CIML_save }
					religion = qarmatian
				}
				trigger_if = {
					limit = { has_global_flag = is_kcl_CIML_save }
					religion = yarsan
				}
			}
		}

		allow = {
			wealth >= 100
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			custom_tooltip = {
				text = IS_HEALTHY

				is_ill = no
				has_symptom_trigger = no
			}
		}

		effect = {
			character_event = {
				id = 88500
				tooltip = begin_fast
			}

			set_character_flag = ramadan
			decadence = -3
			piety = 15
			wealth = -100

			add_character_modifier = {
				name = observed_ramadan
				days = 1900
				hidden = no
			}

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	settle_iceland = {
		ai_check_interval = 36

		is_high_prio = yes

		only_playable = yes

		potential = {
			OR = {
				culture_group = north_germanic
				religion_openly_norse_or_reformed_trigger = yes
			}

			# has_global_flag = viking_age_started
			is_landed = yes
			is_alternate_start = no
			is_adult = yes
			prisoner = no
			rebel = no

			NOR = {
				has_global_flag = iceland_settled
				has_landed_title = e_pirates
				has_landed_title = e_rebels

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}

			d_iceland = {
				any_direct_de_jure_vassal_title = {
					holder_scope = {
						independent = yes
						is_theocracy = yes
					}
				}
			}
		}

		allow = {
			prestige >= 200
			wealth   >= 100

			prisoner = no
			war = no

			custom_tooltip = {
				text = viking_age_tt

				has_global_flag = viking_age_started
			}
		}

		effect = {
			wealth = -100

			custom_tooltip = {
				text = settle_iceland_tt

				save_event_target_as = settler_of_iceland_target
				set_global_flag = iceland_settled

				d_iceland = {
					any_direct_de_jure_vassal_title = {
						limit = {
							tier = COUNT

							holder_scope = {
								top_liege = {
									independent = yes
									is_theocracy = yes
								}
							}
						}

						holder_scope = {
							save_event_target_as = left_iceland_target
						}

						usurp_title = ROOT

						location = {
							religion = ROOT
							culture = ROOT
							remove_province_modifier = incredibly_poor

							capital_holding = {
								if = {
									limit = { holding_type = temple }

									convert_to = tribal
									refill_holding_levy = yes
								}
							}
						}
					}

					usurp_title = ROOT
				}

				narrative_event = { id = TGF.404 }
			}

			if = {
				limit = { has_nickname = no }
				give_nickname = nick_the_explorer
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				# Give players a chance before AI does it
				OR = {
					independent = yes

					NOT = {
						any_liege = {
							ai = no
						}
					}

					had_global_flag = {
						flag = viking_age_started
						years >= 2
					}
				}
			}
		}
	}

	commission_runestone = {
		ai_check_interval = 36

		only_playable = yes

		potential = {
			has_dlc = "The Old Gods"
			culture_group = north_germanic
			year < 1150
			is_adult = yes
			prisoner = no

			NOR = {
				has_character_flag = commissioned_runestone

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			wealth >= 100
			prisoner = no
		}

		effect = {
			wealth = -100
			set_character_flag = commissioned_runestone
			character_event = { id = TOG.500 }
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 200
				age >= 30
			}
		}
	}

	hold_nerge = {
		ai_check_interval = 2

		is_high_prio = yes

		only_independent = yes

		potential = {
			has_dlc = "The Old Gods"
			culture = mongol

			OR = {
				has_landed_title = e_ilkhanate
				has_landed_title = e_golden_horde
				has_landed_title = e_mongol_empire
				has_landed_title = e_chagatai
			}

			is_adult = yes
			is_female = no
			prisoner = no

			NOR = {
				has_character_modifier = morale_from_nerge
				has_character_flag = holding_nerge

				has_alternate_start_parameter = {
					key = culture_names
					value = random
				}
			}
		}

		allow = {
			month >= 8
			month <= 9
			wealth >= 50
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -50

			custom_tooltip = {
				text = prepare_nerge

				character_event = { id = TOG.100 }

				set_character_flag = holding_nerge
				set_character_flag = recent_minor_decision
				set_character_flag = do_not_disturb

				character_event = {
					id = TOG.299 # Safety catch flag clearing
					days = 150
				}
			}

			if = {
				limit = {
					has_dlc = "Reapers"
					is_nomadic = no
				}

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 300
				martial >= 10
				NOT = { trait = craven }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	hold_blot = {
		ai_check_interval = 6

		is_high_prio = yes

		only_playable = yes

		potential = {
			has_dlc = "The Old Gods"
			religion_openly_norse_or_reformed_trigger = yes
			is_adult = yes
			prisoner = no

			NOR = {
				has_character_modifier = held_blot_timer
				has_character_flag = holding_blot

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			OR = {
				month <= 1
				month >= 10
			}

			wealth >= 50
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -50

			custom_tooltip = {
				text = prepare_blot

				set_character_flag = holding_blot
				set_character_flag = recent_minor_decision
				set_character_flag = do_not_disturb
				character_event = { id = TOG.600 }

				character_event = {
					id = TOG.699 # Safety catch flag clearing
					days = 150
				}
			}

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 300
				diplomacy >= 10
				NOT = { trait = shy }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	ancestor_worship = {
		ai_check_interval = 12

		is_high_prio = yes

		only_playable = yes

		potential = {
			has_dlc = "The Old Gods"
			is_landed = yes

			OR = {
				religion_openly_finnish_or_reformed_trigger = yes
				religion_openly_west_african_or_reformed_trigger = yes
				religion_openly_baltic_or_reformed_trigger = yes
				religion_openly_slavic_or_reformed_trigger = yes
				religion_openly_tengri_or_reformed_trigger = yes
				has_religion_feature = religion_beatification
				### ACR ###
				trigger_if = {
					limit = { has_global_flag = ancrel }
					religion_openly_in_egyptian_subgroup_trigger = yes
				}
			}

			is_adult = yes
			prisoner = no
		}

		allow = {
			war = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = { has_character_modifier = worshipped_ancestors_timer }

				custom_tooltip = {
					text = worship_cooldown_tooltip
					always = no
				}
			}

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			custom_tooltip = {
				text = prepare_worship_ancestors

				set_character_flag = recent_minor_decision
				set_character_flag = do_not_disturb

				character_event = { id = TOG.7000 }

				add_character_modifier = {
					name = worshipped_ancestors_timer
					years = 10
					hidden = yes
				}
			}
		}

		ai_will_do = {
			factor = 0.1

			trigger = {
				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}

			mult_modifier = {
				factor = 0.01
				trait = cynical
			}

			mult_modifier = {
				factor = 5
				trait = zealous
			}
		}
	}

	hold_ukon_juhla = {
		ai_check_interval = 3

		only_playable = yes

		potential = {
			has_dlc = "The Old Gods"
			religion_openly_finnish_or_reformed_trigger = yes
			is_adult = yes
			prisoner = no

			NOR = {
				has_character_modifier = held_ukon_juhla_timer
				has_character_flag = holding_ukon_juhla

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 4
			month <= 6
			wealth = 50
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -50

			custom_tooltip = {
				text = prepare_ukon_juhla

				set_character_flag = holding_ukon_juhla
				set_character_flag = recent_minor_decision
				set_character_flag = do_not_disturb
				character_event = { id = TOG.700 }

				character_event = {
					id = TOG.899 # Safety catch flag clearing
					days = 150
				}
			}

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 300
				diplomacy >= 10
				NOT = { trait = shy }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	pick_main_deity = {
		ai_check_interval = 12

		is_high_prio = yes

		only_playable = yes

		potential = {
			has_dlc = "The Old Gods"

			OR = {
				religion_openly_slavic_or_reformed_trigger = yes
				religion_openly_west_african_or_reformed_trigger = yes
				religion_openly_baltic_or_reformed_trigger = yes
				religion_openly_finnish_or_reformed_trigger = yes
			}

			is_adult = yes
			prisoner = no

			NOT = {
				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			piety >= 25
			prisoner = no

			trigger_if = {
				limit = { has_character_modifier = picked_main_deity_timer }

				custom_tooltip = {
					text = pick_main_deity_timer_tooltip
					always = no
				}
			}
		}

		effect = {
			trigger_switch = {
				on_trigger = has_character_modifier

				follower_of_akka               = { remove_character_modifier = follower_of_akka }
				follower_of_anansi             = { remove_character_modifier = follower_of_anansi }
				follower_of_ayyur              = { remove_character_modifier = follower_of_ayyur }
				follower_of_bida               = { remove_character_modifier = follower_of_bida }
				follower_of_dan                = { remove_character_modifier = follower_of_dan }
				follower_of_dievas             = { remove_character_modifier = follower_of_dievas }
				follower_of_dongo              = { remove_character_modifier = follower_of_dongo }
				follower_of_jarilo             = { remove_character_modifier = follower_of_jarilo }
				follower_of_lempo              = { remove_character_modifier = follower_of_lempo }
				follower_of_morana             = { remove_character_modifier = follower_of_morana }
				follower_of_perkunas           = { remove_character_modifier = follower_of_perkunas }
				follower_of_perun              = { remove_character_modifier = follower_of_perun }
				follower_of_taipo_and_mielikki = { remove_character_modifier = follower_of_taipo_and_mielikki }
				follower_of_tsumburbura        = { remove_character_modifier = follower_of_tsumburbura }
				follower_of_ukko               = { remove_character_modifier = follower_of_ukko }
				follower_of_veles              = { remove_character_modifier = follower_of_veles }
				follower_of_velnias            = { remove_character_modifier = follower_of_velnias }
				follower_of_zemyna             = { remove_character_modifier = follower_of_zemyna }
			}

			piety >= -25

			custom_tooltip = {
				text = pick_main_deity_tooltip

				# Starts main deity events
				if = {
					limit = { has_minor_deity_trigger = no }

					character_event = {
						id = TOG.7100
						days = 10
					}
				}

				# Event for picking main deity
				if = {
					limit = { religion_openly_slavic_or_reformed_trigger = yes }
					character_event = { id = TOG.7110 }
				}
				else_if = {
					limit = { religion_openly_west_african_or_reformed_trigger = yes }
					character_event = { id = TOG.7200 }
				}
				else_if = {
					limit = { religion_openly_finnish_or_reformed_trigger = yes }
					character_event = { id = TOG.7300 }
				}
				else = { # Baltic pagan
					character_event = { id = TOG.7400 }
				}

				add_character_modifier = {
					name = picked_main_deity_timer
					years = 10
					hidden = yes
				}
			}
		}

		ai_will_do = {
			factor = 0.5

			trigger = {
				has_minor_deity_trigger = no
			}
		}
	}

	hold_uzgavenes = {
		ai_check_interval = 3

		only_playable = yes

		potential = {
			has_dlc = "The Old Gods"
			religion_openly_baltic_or_reformed_trigger = yes
			is_adult = yes
			prisoner = no

			NOR = {
				has_character_modifier = held_uzgavenes_timer
				has_character_flag = holding_uzgavenes

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 4
			month < 6
			wealth >= 50
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -50

			custom_tooltip = {
				text = prepare_uzgavenes

				set_character_flag = holding_uzgavenes
				set_character_flag = recent_minor_decision
				set_character_flag = do_not_disturb

				character_event = {
					id = TOG.899 # Safety catch flag clearing
					days = 150
				}

				character_event = { id = TOG.750 }
			}

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 300
				diplomacy >= 10
				NOT = { trait = shy }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	hold_jarilo = {
		ai_check_interval = 3

		only_playable = yes

		potential = {
			has_dlc = "The Old Gods"
			religion_openly_slavic_or_reformed_trigger = yes
			is_adult = yes
			prisoner = no

			NOR = {
				has_character_modifier = held_jarilo_timer
				has_character_flag = holding_jarilo

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 4
			month < 6
			wealth >= 50
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -50

			custom_tooltip = {
				text = prepare_jarilo

				set_character_flag = holding_jarilo
				set_character_flag = recent_minor_decision
				set_character_flag = do_not_disturb

				character_event = {
					id = TOG.899 # Safety catch flag clearing
					days = 150
				}

				character_event = { id = TOG.800 }
			}

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 300
				diplomacy >= 10
				NOT = { trait = shy }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	celebrate_passover = {
		ai_check_interval = 3

		is_high_prio = yes

		only_playable = yes

		potential = {
			has_dlc = "Sons of Abraham"
			religion_group = jewish_group
			is_adult = yes
			prisoner = no

			NOR = {
				has_character_modifier = held_passover_timer
				has_character_flag = holding_passover

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 3
			month >= 5
			wealth >= 50
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -50

			custom_tooltip = {
				text = passover_celebrations

				set_character_flag = holding_passover
				set_character_flag = recent_minor_decision
				set_character_flag = do_not_disturb

				character_event = {
					id = SoA.599 # Safety catch flag clearing
					days = 150
				}

				character_event = { id = SoA.500 }
			}

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 300
				diplomacy >= 10
				NOT = { trait = shy }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	borrow_money_jews = {
		ai_check_interval = 30

		only_playable = yes

		potential = {
			has_dlc = "Sons of Abraham"
			is_nomadic = no

			### JEW ###
			trigger_if = {
				limit = { has_global_flag = is_kcl_jews_save }
				kcl_has_jew_content_trigger = yes
			}
			trigger_else = {
				OR = {
					religion_group = christian
					religion_group = muslim
					religion_group = zoroastrian_group
					religion = taoist
				}
			}

			NOR = {
				religion = manichaean
				secret_religion_group = jewish_group
				government = order_government
			}
		}

		allow = {
			### JEW ###
			trigger_if = {
				limit = { has_global_flag = is_kcl_jews_save }
				kcl_has_jew_content_trigger = yes
			}
			trigger_else = {
				OR = {
					religion_group = christian
					religion_group = muslim
					religion_group = zoroastrian_group
					religion = taoist
				}
			}

			prisoner = no

			NOR = {
				### JEW ###
				trigger_if = {
					limit = { has_global_flag = is_kcl_jews_save }
					trigger_if = {
						limit = { tier = COUNT }
						has_character_modifier = borrowed_from_jews_small
					}
					trigger_else_if = {
						limit = { tier = DUKE }
						has_character_modifier = borrowed_from_jews_moderate
					}
					trigger_else_if = {
						limit = { tier = KING }
						has_character_modifier = borrowed_from_jews_large
					}
					trigger_else_if = {
						limit = { tier = EMPEROR }
						has_character_modifier = borrowed_from_jews_huge
					}
				}
				trigger_else = { has_character_modifier = borrowed_from_jews }
				has_character_modifier = expelled_jewish

				top_liege = {
					has_character_modifier = expelled_jewish
				}
			}
		}

		effect = {
			### JEW ###
			if = {
				limit = { has_global_flag = is_kcl_jews_save }
				if = {
					limit = { tier = COUNT }
					wealth = 50
					add_character_modifier = {
						name = borrowed_from_jews_small
						duration = -1
						inherit = yes
					}
				}
				else_if = {
					limit = { tier = DUKE }
					wealth = 100
					add_character_modifier = {
						name = borrowed_from_jews_moderate
						duration = -1
						inherit = yes
					}
				}
				else_if = {
					limit = { tier = KING }
					wealth = 200
					add_character_modifier = {
						name = borrowed_from_jews_large
						duration = -1
						inherit = yes
					}
				}
				else = {
					wealth = 400
					add_character_modifier = {
						name = borrowed_from_jews_huge
						duration = -1
						inherit = yes
					}
				}
				#trigger_switch = {
				#	on_trigger = tier
				#
				#	COUNT = {
				#		wealth = 50
				#		add_character_modifier = {
				#			name = borrowed_from_jews_small
				#			duration = -1
				#			inherit = yes
				#		}
				#	}
				#	DUKE = {
				#		wealth = 100
				#		add_character_modifier = {
				#			name = borrowed_from_jews_moderate
				#			duration = -1
				#			inherit = yes
				#		}
				#	}
				#	KING = {
				#		wealth = 200
				#		add_character_modifier = {
				#			name = borrowed_from_jews_large
				#			duration = -1
				#			inherit = yes
				#		}
				#	}
				#	EMPEROR = {
				#		wealth = 400
				#		add_character_modifier = {
				#			name = borrowed_from_jews_huge
				#			duration = -1
				#			inherit = yes
				#		}
				#	}
				#}
			}
			else = {
				wealth = 300

				add_character_modifier = {
					name = borrowed_from_jews
					duration = -1
					inherit = yes
				}
			}
		}

		ai_will_do = {
			factor = 0.1

			trigger = {
				trigger_if = {
					limit = { war = yes }
					wealth < 200
				}
				trigger_else = {
					wealth < 0
				}
			}
		}
	}

	repay_money_jews = {
		ai_check_interval = 6

		only_playable = yes

		potential = {
			has_dlc = "Sons of Abraham"
			### JEW ###
			trigger_if = {
				limit = { has_global_flag = is_kcl_jews_save }
				OR = {
					has_character_modifier = borrowed_from_jews_huge
					has_character_modifier = borrowed_from_jews_large
					has_character_modifier = borrowed_from_jews_moderate
					has_character_modifier = borrowed_from_jews_small
				}
			}
			trigger_else = { has_character_modifier = borrowed_from_jews }
			NOT = { has_character_modifier = expelled_jewish }
		}

		allow = {
			### JEW ###
			trigger_if = {
				limit = { has_global_flag = is_kcl_jews_save }
				trigger_if = {
					limit = { has_character_modifier = borrowed_from_jews_huge }
					trigger_if = {
						limit = {
							OR = {
								religion_group = jewish_group
								any_owned_bloodline = {
									has_bloodline_flag = jewish_saintly_bloodline
									bloodline_is_active_for = PREV
								}
								has_character_modifier = major_friend_of_the_jews
							}
						}

						wealth >= 400
					}
					trigger_else = {
						wealth >= 600
					}
				}
				trigger_else_if = {
					limit = { has_character_modifier = borrowed_from_jews_large }
					trigger_if = {
						limit = {
							OR = {
								religion_group = jewish_group
								any_owned_bloodline = {
									has_bloodline_flag = jewish_saintly_bloodline
									bloodline_is_active_for = PREV
								}
								has_character_modifier = major_friend_of_the_jews
							}
						}

						wealth >= 200
					}
					trigger_else = {
						wealth >= 300
					}
				}
				trigger_else_if = {
					limit = { has_character_modifier = borrowed_from_jews_moderate }
					trigger_if = {
						limit = {
							OR = {
								religion_group = jewish_group
								any_owned_bloodline = {
									has_bloodline_flag = jewish_saintly_bloodline
									bloodline_is_active_for = PREV
								}
								has_character_modifier = major_friend_of_the_jews
							}
						}

						wealth >= 100
					}
					trigger_else = {
						wealth >= 150
					}
				}
				trigger_else = {
					trigger_if = {
						limit = {
							OR = {
								religion_group = jewish_group
								any_owned_bloodline = {
									has_bloodline_flag = jewish_saintly_bloodline
									bloodline_is_active_for = PREV
								}
								has_character_modifier = major_friend_of_the_jews
							}
						}

						wealth >= 50
					}
					trigger_else = {
						wealth >= 75
					}
				}
			}
			trigger_else = {
				trigger_if = {
					limit = {
						any_owned_bloodline = {
							has_bloodline_flag = jewish_saintly_bloodline
							bloodline_is_active_for = PREV
						}
					}

					wealth >= 300
				}
				trigger_else = {
					wealth >= 350
				}
			}
		}

		effect = {
			### JEW ###
			if = {
				limit = { has_global_flag = is_kcl_jews_save }
				if = {
					limit = { has_character_modifier = borrowed_from_jews_huge }
					remove_character_modifier = borrowed_from_jews_huge
					if = {
						limit = {
							OR = {
								religion_group = jewish_group
								any_owned_bloodline = {
									has_bloodline_flag = jewish_saintly_bloodline
									bloodline_is_active_for = PREV
								}
								has_character_modifier = major_friend_of_the_jews
							}
						}
				
						wealth = -400
					}
					else = { wealth = -600 }
				}
				else_if = {
					limit = { has_character_modifier = borrowed_from_jews_large }
					remove_character_modifier = borrowed_from_jews_large
					if = {
						limit = {
							OR = {
								religion_group = jewish_group
								any_owned_bloodline = {
									has_bloodline_flag = jewish_saintly_bloodline
									bloodline_is_active_for = PREV
								}
								has_character_modifier = major_friend_of_the_jews
							}
						}
				
						wealth = -200
					}
					else = { wealth = -300 }
				}
				else_if = {
					limit = { has_character_modifier = borrowed_from_jews_moderate }
					remove_character_modifier = borrowed_from_jews_moderate
					if = {
						limit = {
							OR = {
								religion_group = jewish_group
								any_owned_bloodline = {
									has_bloodline_flag = jewish_saintly_bloodline
									bloodline_is_active_for = PREV
								}
								has_character_modifier = major_friend_of_the_jews
							}
						}
				
						wealth = -100
					}
					else = { wealth = -150 }
				}
				else = {
					remove_character_modifier = borrowed_from_jews_small
					if = {
						limit = {
							OR = {
								religion_group = jewish_group
								any_owned_bloodline = {
									has_bloodline_flag = jewish_saintly_bloodline
									bloodline_is_active_for = PREV
								}
								has_character_modifier = major_friend_of_the_jews
							}
						}
				
						wealth = -50
					}
					else = { wealth = -75 }
				}
				#trigger_switch = {
				#	on_trigger = has_character_modifier
				#
				#	borrowed_from_jews_huge = {
				#		remove_character_modifier = borrowed_from_jews_huge
				#		if = {
				#			limit = {
				#				OR = {
				#					religion_group = jewish_group
				#					any_owned_bloodline = {
				#						has_bloodline_flag = jewish_saintly_bloodline
				#						bloodline_is_active_for = PREV
				#					}
				#					has_character_modifier = major_friend_of_the_jews
				#				}
				#			}
				#
				#			wealth = -400
				#		}
				#		else = { wealth = -600 }
				#	}
				#	borrowed_from_jews_large = {
				#		remove_character_modifier = borrowed_from_jews_large
				#		if = {
				#			limit = {
				#				OR = {
				#					religion_group = jewish_group
				#					any_owned_bloodline = {
				#						has_bloodline_flag = jewish_saintly_bloodline
				#						bloodline_is_active_for = PREV
				#					}
				#					has_character_modifier = major_friend_of_the_jews
				#				}
				#			}
				#
				#			wealth = -200
				#		}
				#		else = { wealth = -300 }
				#	}
				#	borrowed_from_jews_moderate = {
				#		remove_character_modifier = borrowed_from_jews_moderate
				#		if = {
				#			limit = {
				#				OR = {
				#					religion_group = jewish_group
				#					any_owned_bloodline = {
				#						has_bloodline_flag = jewish_saintly_bloodline
				#						bloodline_is_active_for = PREV
				#					}
				#					has_character_modifier = major_friend_of_the_jews
				#				}
				#			}
				#
				#			wealth = -100
				#		}
				#		else = { wealth = -150 }
				#	}
				#	borrowed_from_jews_small = {
				#		remove_character_modifier = borrowed_from_jews_small
				#		if = {
				#			limit = {
				#				OR = {
				#					religion_group = jewish_group
				#					any_owned_bloodline = {
				#						has_bloodline_flag = jewish_saintly_bloodline
				#						bloodline_is_active_for = PREV
				#					}
				#					has_character_modifier = major_friend_of_the_jews
				#				}
				#			}
				#
				#			wealth = -50
				#		}
				#		else = { wealth = -75 }
				#	}
				#}
			}
			else = {
				remove_character_modifier = borrowed_from_jews
				
				if = {
					limit = {
						any_owned_bloodline = {
							has_bloodline_flag = jewish_saintly_bloodline
							bloodline_is_active_for = PREV
						}
					}

					wealth = -300
				}
				else = { wealth = -350 }
			}
		}

		ai_will_do = {
			factor = 0.5

			trigger = {
				wealth >= 450
			}
		}
	}

	become_kshatriya = {
		ai_check_interval = 12

		is_high_prio = yes

		only_playable = yes

		potential = {
			has_dlc = "Rajas of India"
			religion = hindu

			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
			}

			is_adult = yes
			NOT = { trait = kshatriya }
		}

		allow = {
			OR = {
				trait = brahmin
				piety >= 200
			}

			OR = {
				scaled_wealth = 6

				AND = {
					learning >= 12
					scaled_wealth = 3
				}
			}
		}

		effect = {
			if = {
				limit = { learning >= 12 }
				scaled_wealth = -3
			}
			else = {
				scaled_wealth = -6
			}

			if = {
				limit = { NOT = { trait = brahmin } }
				piety = -200
			}

			prestige = 50
			add_trait = kshatriya

			any_spouse = {
				show_scope_change = no

				limit = {
					is_ruler = no
					vassal_of = ROOT
					NOT = { trait = kshatriya }
				}

				add_trait = kshatriya
			}

			any_child = {
				show_scope_change = no

				limit = {
					is_ruler = no
					vassal_of = ROOT
					NOT = { trait = kshatriya }
				}

				add_trait = kshatriya
			}

			hidden_effect = {
				top_liege = {
					any_realm_character = {
						limit = {
							religion = hindu
							is_adult = yes

							NOR = {
								character = ROOT
								trait = cynical
							}
						}

						opinion = {
							name = opinion_changed_caste
							who = ROOT
							years = 100
						}
					}
				}
			}

			if = {
				limit = { ai = no }

				chronicle = {
					entry = CHRONICLE_BECAME_KSHATRIYA
					picture = GFX_evt_emissary_indo_aryan_group
				}
			}
		}

		ai_will_do = {
			factor = 0.5
		}
	}

	become_vaishya = {
		ai_check_interval = 12

		is_high_prio = yes

		only_playable = yes

		potential = {
			has_dlc = "Rajas of India"
			is_republic = yes
			religion = hindu
			is_adult = yes
			NOT = { trait = vaishya }
		}

		allow = {
			OR = {
				trait = brahmin
				piety >= 200
			}

			OR = {
				scaled_wealth = 6

				AND = {
					learning >= 12
					scaled_wealth = 3
				}
			}
		}

		effect = {
			if = {
				limit = { learning >= 12 }
				scaled_wealth = -3
			}
			else = {
				scaled_wealth = -6
			}

			if = {
				limit = { NOT = { trait = brahmin } }
				piety = -200
			}

			prestige >= 50
			add_trait = vaishya

			any_spouse = {
				show_scope_change = no

				limit = {
					is_ruler = no
					vassal_of = ROOT
					NOT = { trait = vaishya }
				}

				add_trait = vaishya
			}

			any_child = {
				show_scope_change = no

				limit = {
					is_ruler = no
					vassal_of = ROOT
					NOT = { trait = vaishya }
				}

				add_trait = vaishya
			}

			hidden_effect = {
				top_liege = {
					any_realm_character = {
						limit = {
							religion = hindu
							is_adult = yes

							NOR = {
								trait = cynical
								character = ROOT
							}
						}

						opinion = {
							name = opinion_changed_caste
							who = ROOT
							years = 100
						}
					}
				}
			}

			if = {
				limit = { ai = no }

				chronicle = {
					entry = CHRONICLE_BECAME_VAISHYA
					picture = GFX_evt_emissary_indo_aryan_group
				}
			}
		}

		ai_will_do = {
			factor = 0.5
		}
	}

	hold_diwali_feast_hindu = {
		ai_check_interval = 4

		only_playable = yes

		potential = {
			has_dlc = "Rajas of India"
			religion = hindu
			num_of_vassals >= 1

			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_republic = yes
			}

			is_adult = yes
			prisoner = no
			is_incapable = no

			NOR = {
				has_character_modifier = patron_kali
				has_character_modifier = holding_diwali_feast
				has_character_modifier = holding_kali_puja_feast
				has_character_modifier = large_feast_timer
				has_character_modifier = fabulous_feast
				has_character_flag = guest_diwali_feast_started

				liege = {
					OR = {
						has_character_modifier = holding_diwali_feast
						has_character_modifier = holding_kali_puja_feast
					}
				}

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 9
			scaled_wealth = 0.2
			prestige >= 100
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			scaled_wealth = -0.2

			add_character_modifier = {
				name = holding_diwali_feast
				years = 1
			}

			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			character_event = { id = RoI.1000 }

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				scaled_wealth >= 2
				age >= 30

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				trait = shy
			}

			mult_modifier = {
				factor = 0.5
				diplomacy < 10
			}
		}
	}

	hold_diwali_feast_buddhist = {
		ai_check_interval = 4

		only_playable = yes

		potential = {
			has_dlc = "Rajas of India"
			religion = buddhist

			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_republic = yes
			}

			num_of_vassals >= 1
			is_adult = yes
			prisoner = no
			is_incapable = no

			NOR = {
				has_character_modifier = holding_diwali_feast
				has_character_modifier = holding_kali_puja_feast
				has_character_modifier = large_feast_timer
				has_character_modifier = fabulous_feast
				has_character_flag = guest_diwali_feast_started

				liege = {
					OR = {
						has_character_modifier = holding_diwali_feast
						has_character_modifier = holding_kali_puja_feast
					}
				}

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 9
			scaled_wealth = 0.2
			prestige >= 100
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			scaled_wealth = -0.2

			add_character_modifier = {
				name = holding_diwali_feast
				years = 1
			}

			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			character_event = { id = RoI.1000 }

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				scaled_wealth = 2
				age >= 30

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				trait = shy
			}

			mult_modifier = {
				factor = 0.5
				diplomacy < 10
			}
		}
	}

	hold_diwali_feast_jain = {
		ai_check_interval = 4

		only_playable = yes

		potential = {
			has_dlc = "Rajas of India"
			religion = jain

			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_republic = yes
			}

			num_of_vassals >= 1
			is_adult = yes
			prisoner = no
			is_incapable = no

			NOR = {
				has_character_modifier = holding_diwali_feast
				has_character_modifier = holding_kali_puja_feast
				has_character_modifier = large_feast_timer
				has_character_modifier = fabulous_feast
				has_character_flag = guest_diwali_feast_started

				liege = {
					OR = {
						has_character_modifier = holding_diwali_feast
						has_character_modifier = holding_kali_puja_feast
					}
				}

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 9
			scaled_wealth = 0.2
			prestige >= 100
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			scaled_wealth = -0.2

			add_character_modifier = {
				name = holding_diwali_feast
				years = 1
			}

			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			character_event = { id = RoI.1000 }

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				scaled_wealth = 2
				age >= 30

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				trait = shy
			}

			mult_modifier = {
				factor = 0.5
				diplomacy < 10
			}
		}
	}

	hold_diwali_feast_kali_puja = {
		ai_check_interval = 4

		only_playable = yes

		potential = {
			has_dlc = "Rajas of India"
			religion = hindu

			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_republic = yes
			}

			num_of_vassals >= 1
			is_adult = yes
			prisoner = no
			is_incapable = no

			OR = {
				has_character_modifier = patron_kali

				capital_scope = {
					region = world_india_bengal
				}
			}

			NOR = {
				has_character_modifier = holding_diwali_feast
				has_character_modifier = holding_kali_puja_feast
				has_character_modifier = large_feast_timer
				has_character_modifier = fabulous_feast
				has_character_flag = guest_diwali_feast_started

				liege = {
					OR = {
						has_character_modifier = holding_diwali_feast
						has_character_modifier = holding_kali_puja_feast
					}
				}

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 9
			scaled_wealth = 0.2
			prestige >= 100
			war = no

			OR = {
				has_character_modifier = patron_kali

				capital_scope = {
					region = world_india_bengal
				}
			}

			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			scaled_wealth = -0.2

			add_character_modifier = {
				name = holding_kali_puja_feast
				years = 1
			}

			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			character_event = { id = RoI.1000 }

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				scaled_wealth = 2
				age >= 30

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				trait = shy
			}

			mult_modifier = {
				factor = 0.5
				diplomacy < 10
			}
		}
	}

	find_guru = {
		ai_check_interval = 36

		only_playable = yes

		potential = {
			OR = {
				has_dharmic_religion_trigger = yes
				religion_openly_bon_or_reformed_trigger = yes
			}

			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
			}

			is_adult = yes
			prisoner = no

			NOR = {
				has_assigned_minor_title = title_guru
				has_character_flag = looking_for_guru
				has_character_flag = found_guru
			}
		}

		allow = {
			wealth >= 50
			prestige >= 300
			prisoner = no
		}

		effect = {
			wealth = -50
			set_character_flag = looking_for_guru
			character_event = { id = RoI.3000 }
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 200
				NOT = { trait = cynical }
			}
		}
	}

	hold_zun_feast = {
		ai_check_interval = 6

		only_playable = yes

		potential = {
			has_dlc = "Charlemagne"
			religion_openly_zun_or_reformed_trigger = yes

			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
			}

			is_adult = yes
			num_of_vassals >= 1
			prisoner = no
			is_incapable = no

			NOR = {
				has_character_modifier = holding_zun_feast
				has_character_modifier = holding_diwali_feast
				has_character_modifier = holding_kali_puja_feast
				has_character_modifier = large_feast_timer
				has_character_modifier = fabulous_feast
				has_character_flag = guest_zun_feast_started

				liege = {
					has_character_modifier = holding_zun_feast
				}

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 3
			month <= 8
			scaled_wealth = 0.2
			prestige >= 100
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			scaled_wealth = -0.2

			add_character_modifier = {
				name = holding_zun_feast
				years = 1
			}

			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb
			character_event = { id = CM.4100 }

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				scaled_wealth = 2
				age >= 30

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				trait = shy
			}

			mult_modifier = {
				factor = 0.5
				diplomacy < 10
			}
		}
	}

	celebrate_bema = {
		ai_check_interval = 2

		only_playable = yes

		potential = {
			religion = manichaean
			is_adult = yes
			prisoner = no

			NOR = {
				has_character_modifier = held_bema_timer
				has_character_flag = holding_bema

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 1
			month <= 2
			wealth >= 50
			war = no
			prisoner = no
			is_inaccessible_trigger = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -50

			set_character_flag = holding_bema
			set_character_flag = recent_minor_decision
			set_character_flag = do_not_disturb

			character_event = {
				id = 39818 # Safety catch flag clearing
				days = 150
			}

			character_event = { id = 39812 }

			if = {
				limit = { has_dlc = "Reapers" }

				custom_tooltip = {
					text = capital_prospers_custom_tooltip

					capital_scope = {
						change_variable = {
							which = prosperity_value
							value = 8
						}
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 300
				diplomacy >= 10
				NOT = { trait = shy }

				trigger_if = {
					limit = { has_character_flag = recent_minor_decision }

					had_character_flag = {
						flag = recent_minor_decision
						years >= 2
					}
				}
			}
		}
	}

	celebrate_jashan_e_sadah = {
		ai_check_interval = 2

		only_playable = yes

		potential = {
			OR = {
				religion = zoroastrian
				religion = khurmazta
			}

			NOR = {
				has_character_modifier = held_sadah_feast_timer
				has_character_modifier = jd_held_sadah_timer
				has_character_flag = holding_sadah_feast
				has_character_flag = planning_sadah_feast
				liege = { has_character_flag = holding_sadah_feast }

				has_alternate_start_parameter = {
					key = religion_names
					value = random
				}
			}
		}

		allow = {
			month >= 8
			month <= 9
			wealth >= 50
			prestige >= 100
			war = no
			prisoner = no
			is_inaccessible_trigger = no
			has_regent = no

			trigger_if = {
				limit = {
					NOT = {
						any_demesne_title = {
							lower_real_tier_than = DUKE
							is_occupied = no
						}
					}
				}

				custom_tooltip = {
					text = UNOCCUPIED_DEMESNE_TITLE
					always = no
				}
			}
		}

		effect = {
			wealth = -50

			custom_tooltip = {
				text = prepare_sadah_feast

				character_event = { id = 39820 }

				add_character_modifier = {
					name = held_sadah_feast_timer
					years = 5
					hidden = yes
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				wealth >= 300
				diplomacy >= 10
				NOT = { trait = shy }
			}
		}
	}

	# Sky burial
	sky_burial_decision = {
		ai_check_interval = 12

		is_high_prio = yes

		only_playable = yes

		potential = {
			has_character_flag = sky_burial
			NOT = { has_character_flag = performed_sky_burial }

			OR = {
				religion_group = zoroastrian_group
				religion_openly_bon_or_reformed_trigger = yes

				any_owned_bloodline = {
					has_bloodline_flag = bloodline_sky_burial
					bloodline_is_active_for = PREV
				}

				trigger_if = {
					limit = { is_nomadic = yes }

					OR = {
						religion_openly_tengri_or_reformed_trigger = yes
						has_dharmic_religion_trigger = yes
					}
				}
			}
		}

		allow = {
			is_adult = yes
			in_command = no
			prisoner = no
			is_incapable = no
			is_inaccessible_trigger = no
			NOT = { trait = infirm }
		}

		effect = {
			custom_tooltip = {
				text = sky_burial_custom_tooltip

				character_event = { id = HLF.8005 }
				clr_character_flag = sky_burial
				set_character_flag = performed_sky_burial
			}
		}

		ai_will_do = {
			factor = 0.5
		}
	}

	# Choose Warhorse (Nomad)
	choose_warhorse_nomad = {
		ai_check_interval = 12

		only_playable = yes

		potential = {
			is_nomadic = yes
			NOT = { has_character_modifier = nomad_warhorse }
		}

		allow = {
			wealth >= 20
			is_adult = yes
			prisoner = no
			is_incapable = no
			is_inaccessible_trigger = no
		}

		effect = {
			wealth = -20

			custom_tooltip = {
				text = nomad_acquires_warhorse_tooltip

				long_character_event = { id = HL.6000 } # Select and name horse

				character_event = {
					id = HL.6500 # Horse dies
					days = 3500
					random = 2000
				}
			}
		}

		ai_will_do = {
			factor = 0.1

			trigger = {
				wealth >= 200
			}
		}
	}

	destroy_artifact = {
		hide_in_decisions_list = yes

		ai = no

		potential = {
			FROM = {
				artifact_owner = {
					character = ROOT
				}
			}
		}

		allow = {
			FROM = {
				show_scope_change = no

				is_indestructible = no

				custom_tooltip = {
					text = tooltip_considering_artifact_donation

					NOT = { has_artifact_flag = flag_considering_donation }
				}
			}
		}

		effect = {
			FROM = {
				destroy_artifact = yes
			}
		}
	}

	rename_artifact = {
		hide_in_decisions_list = yes

		ai = no

		potential = {
			has_dlc = "Holy Fury"

			FROM = {
				artifact_owner = {
					character = ROOT
				}
			}
		}

		allow = {
		}

		effect = {
			FROM = {
				prompt_name = {
					player = ROOT
					type = RENAME_ARTIFACT_MESSAGE
				}
			}
		}
	}

	rename_wonder = {
		hide_in_decisions_list = yes

		ai = no

		potential = {
			FROM = {
				wonder_owner = {
					character = ROOT
				}
			}
		}

		allow = {
		}

		effect = {
			FROM = {
				prompt_name = {
					player = ROOT
					type = RENAME_WONDER_MESSAGE
				}
			}
		}
	}

}