decisions = {
	
	feast_0 = {
		only_playable = yes
		ai_check_interval = 12
		potential = {
			is_playable = yes
			num_of_vassals = 1
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_patrician = yes
			}
			OR = {
				religion_group = christian
				religion_group = zoroastrian_group
				religion_group = jewish_group
				religion = celtic_pagan
				religion = celtic_pagan_reformed
				religion = german_pagan
				religion = german_pagan_reformed
				religion = egyptian_pagan
				religion = aten_pagan
				religion = west_african_pagan
				religion = west_african_pagan_reformed
				religion_group = hellenic_pagan_group
				religion = pagan
				religion = aztec
				AND = {
					OR = { 
						religion = tengri_pagan 
						religion = tengri_pagan_reformed 
					}
					NOR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_chagatai
						has_landed_title = e_mongol_empire
					}
				}
			}			
			NOR = {
				is_inaccessible_trigger = yes
				religion = manichean
				religion = yazidi
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_flag = planning_feast
				has_character_modifier = holding_large_feast
				has_character_flag = celebrating_nowruz
				liege = { has_character_modifier = holding_large_feast }
			}
			OR = {
				NOT = { has_character_flag = held_recent_feast }
				had_character_flag = { flag = held_recent_feast days = 365 }
			}
		}
		allow = {
			war = no
			has_regent = no
			scaled_wealth = 0.5
			prestige = 100
		}
		effect = {
			scaled_wealth = -0.5
			set_character_flag = planning_feast
			hidden_tooltip = {
				character_event = { id = 72109 }
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = { month = 10 }
			}
			modifier = {
				factor = 0
				NOT = { scaled_wealth = 5.0 }
				NOT = {
					trait = charitable
					trait = gregarious
					trait = gluttonous
				}
			}
			modifier = {
				factor = 0
				NOT = { scaled_wealth = 2.5 }
			}
			modifier = {
				factor = 0
				OR = {
					trait = shy
					trait = greedy
					trait = paranoid
				}
			}	
			modifier = {
				factor = 0
				has_character_flag = held_recent_feast
				NOT = {
					had_character_flag = {
						flag = held_recent_feast
						days = 1825
					}
				}
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	summer_fair_0 = {
		only_playable = yes
		ai_check_interval = 3
		potential = {
			is_playable = yes
			OR = {
				religion_group = christian
				religion = mazdaki
				religion = manichean
			}
			num_of_vassals = 1
			NOR = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_flag = planning_summer_fair
				has_character_modifier = holding_summer_fair
			}
			OR = {
				NOT = { has_character_flag = held_recent_summer_fair }
				had_character_flag = {
					flag = held_recent_summer_fair
					days = 100
				}
			}
		}
		allow = {
			war = no
			scaled_wealth = 0.3
			has_regent = no
		}
		effect = {
			scaled_wealth = -0.3
			set_character_flag = planning_summer_fair
			hidden_tooltip = {
				character_event = { id = 74050 }
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.3
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { month = 4 }
					month = 7
				}
			}
			modifier = {
				factor = 0
				NOT = { scaled_wealth = 5.0 }
			}
			modifier = {
				factor = 0
				OR = {
					trait = slothful
					trait = greedy
				}
			}
			modifier = {
				factor = 0
				NOT = {
					stewardship = 10
					trait = diligent
					trait = gardener
				}
			}
			modifier = {
				factor = 0
				has_character_flag = held_recent_summer_fair
				NOT = {
					had_character_flag = {
						flag = held_recent_summer_fair
						days = 1825
					}
				}
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	hold_grand_hunt = {
		only_playable = yes
		ai_check_interval = 2
		potential = {
			is_playable = yes
			is_nomadic = no
			mercenary = no
			demesne_size = 1
			OR = {
				religion_group = christian
				is_pagan_religion = yes
				religion_group = zoroastrian_group
				religion = aztec
				religion = tengri_pagan 
				religion = tengri_pagan_reformed 				
			}
			NOR = {
				religion = cathar
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_flag = planning_grand_hunt
				has_character_modifier = holding_grand_hunt
			}
			primary_title = { higher_tier_than = baron }
			OR = {
				NOT = { has_character_flag = held_recent_hunt }
				had_character_flag = { flag = held_recent_hunt days = 100 }
			}
		}
		allow = {
			war = no
			scaled_wealth = 0.5
			NOT = {	health_traits = 1 }
			has_regent = no
		}
		effect = {
			scaled_wealth = -0.5
			set_character_flag = planning_grand_hunt
			hidden_tooltip = { 
				character_event = { id = 36080  }
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.2
				always = yes
			}
			modifier = {
				factor = 0
				NOT = { month = 8 }
				month = 10
			}
			modifier = {
				factor = 0
				NOT = { wealth = 100 }
			}
			modifier = {
				factor = 0
				is_female = no
				trait = craven
			}			
			modifier = {
				factor = 0
				NOR = {
					has_focus = focus_hunting
					trait = hunter
					trait = falconer
					trait = brave
					martial = 10
				}
			}
			modifier = {
				factor = 0
				has_character_flag = held_recent_hunt
				NOT = { trait = hunter }
				NOT = {
					had_character_flag = {
						flag = held_recent_hunt
						days = 1825
					}
				}
			}
			modifier = {
				factor = 0
				has_character_flag = held_recent_hunt
				trait = hunter
				NOT = {
					had_character_flag = {
						flag = held_recent_hunt
						days = 365
					}
				}
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	hold_tiger_hunt = {
		only_playable = yes
		ai_check_interval = 7
		potential = {
			has_dlc = "Rajas of India"
			is_playable = yes
			num_of_vassals = 1
			capital_scope = {
				region = world_india
			}
			NOR = {
				is_inaccessible_trigger = yes
				religion = jain
				religion = cathar
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_flag = planning_tiger_hunt
				has_character_flag = holding_tiger_hunt
				has_character_modifier = hunt_timer
			}
			OR = {
				NOT = { has_character_flag = held_recent_tiger_hunt }
				had_character_flag = { flag = held_recent_tiger_hunt days = 395 }
			}
		}
		allow = {
			war = no
			scaled_wealth = 0.5
			has_regent = no
			is_ill = no
		}
		effect = {
			scaled_wealth = -0.5
			set_character_flag = planning_tiger_hunt
			hidden_tooltip = { character_event = { id = RoI.2000 } }
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.7
				always = yes
			}			
			modifier = {
				factor = 0
				month = 10
			}
			modifier = {
				factor = 0
				NOT = { scaled_wealth = 5.0 }
			}
			modifier = {
				factor = 0
				trait = craven
			}			
			modifier = {
				factor = 0
				NOT = {
					trait = hunter
					trait = brave
					martial = 10
				}
			}
			modifier = {
				factor = 0
				has_character_flag = held_recent_tiger_hunt
				NOT = {
					had_character_flag = {
						flag = held_recent_tiger_hunt
						days = 1825
					}
				}
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}			
		}
	}
	
	choose_hindu_patron_deity = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			has_dlc = "Rajas of India"
			is_playable = yes
			religion = hindu
			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
			}
			NOT = { has_character_flag = selecting_patron_deity }
		}
		allow = {
			has_regent = no
		}
		effect = {
			character_event = { id = RoI.100 }
			set_character_flag = selecting_patron_deity
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.12
				always = yes
			}
			modifier = {
				factor = 5
				trait = zealous
			}
			modifier = {
				factor = 0.5
				trait = cynical
			}
		}
	}
	
	indian_pilgrimage = {        # For all Dharmics
		only_playable = yes
		ai_check_interval = 120
		potential = {
			has_dlc = "Mystics"
			OR = {
				NOT = { has_dlc = "Way of Life" }
				has_focus = focus_theology
				has_quest = quest_indian_monastic_order_pilgrimage
			}
			is_playable = yes
			has_dharmic_religion_trigger = yes
			NOT = { trait = indian_pilgrim }
		}
		allow = {
			war = no
			in_command = no
			any_demesne_title = {
				NOT = { higher_tier_than = count }
				is_occupied = no
			}
			prisoner = no
			NOT = { is_inaccessible_trigger = yes }
			scaled_wealth = 0.2
			age = 16
			custom_tooltip = {
				text = health_travel_condition
				hidden_tooltip = {
					NOT = {	trait = pregnant }
					NOT = {	trait = incapable }
					NOT = {	trait = blinded }
					NOT = {	trait = has_tuberculosis }
					NOT = {	trait = has_typhoid_fever }
					NOT = {	trait = has_typhus }
					NOT = {	trait = has_bubonic_plague }
					NOT = {	trait = has_measles }
					NOT = {	trait = has_small_pox }
					NOT = {	trait = has_aztec_disease }
				}
			}
			is_not_busy_trigger = yes
		}
		effect = {
			scaled_wealth = -0.2
			set_character_flag = activated_pilgrimage
			set_character_flag = do_not_disturb
			hidden_tooltip = {
				character_event = { 
					id = MNM.8000
				}
			}
		}
		ai_will_do = {
			factor = 1
			
			#modifier = {
			#	factor = 100
			#	has_quest = quest_indian_monastic_order_pilgrimage
			#}
			modifier = {
				factor = 0.1             # Only a small minority ever go on a pilgrimage
			}
			modifier = {
				factor = 3
				trait = zealous
			}
			modifier = {
				factor = 0
				NOT = { wealth = 200 }
			}			
			modifier = {
				factor = 0
				NOT = { age = 30 }
			}
		}
	}
	
	catholic_pilgrimage = {
		only_playable = yes
		ai_check_interval = 120
		potential = {
			has_dlc = "Sons of Abraham"
			OR = {
				NOT = { has_dlc = "Way of Life" }
				has_focus = focus_theology
				has_quest = quest_monastic_order_pilgrimage_christian
			}
			is_playable = yes
			religion_group = christian
			NOT = {
				is_inaccessible_trigger = yes
				trait = pilgrim
				religion = waldensian
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_flag = planning_feast
				has_character_flag = planning_summer_fair
				has_character_flag = planning_grand_hunt
				has_character_flag = planning_nerge
				has_character_modifier = holding_epic_tournament
			}
		}
		allow = {
			war = no
			in_command_trigger = no
			is_abroad_trigger = no
			prisoner = no
			scaled_wealth = 0.2
			is_adult = yes
			custom_tooltip = {
				text = health_travel_condition
				hidden_tooltip = {
					is_pregnant = no
					NOT = {	trait = incapable }
					NOT = { trait = infirm }
					NOT = {	trait = blinded }
					NOT = {	trait = has_tuberculosis }
					NOT = {	trait = has_typhoid_fever }
					NOT = {	trait = has_typhus }
					NOT = {	trait = has_bubonic_plague }
					NOT = {	trait = has_measles }
					NOT = {	trait = has_small_pox }
					NOT = {	trait = has_aztec_disease }
					OR = {
						is_ill = no
						NOT = {
							has_game_rule = {
								name = supernatural_events
								value = off
							}
						}
					}
				}
			}
			is_not_busy_trigger = yes
		}
		effect = {
			log = "[Root.GetTitledName] is going on pilgrimage"
			scaled_wealth = -0.2
			custom_tooltip = {
				text = PREPARE_FOR_PILGRIMAGE
				hidden_tooltip = {
					character_event = { 
						id = SoA.5000
					}
				}
			}
		}
		ai_will_do = {
			factor = 1		
			modifier = {
				factor = 0
				NOT = { has_character_flag = will_go_on_pilgrimage }
			}
		}
	}

	go_on_hajj = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			is_playable = yes
			religion_group = muslim
			NOT = {
				is_inaccessible_trigger = yes
				trait = hajjaj
				religion = druze
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_flag = preparing_hajj
				has_character_flag = planning_ramadan
				has_character_flag = planning_nerge
				has_character_flag = planning_tiger_hunt
			}
		}
		allow = {
			age = 16
			prisoner = no
			war = no
			in_command_trigger = no
			is_abroad_trigger = no
			has_regent = no
			scaled_wealth = 1.0
			custom_tooltip = {
				text = health_travel_condition
				hidden_tooltip = {
					is_pregnant = no
					NOT = {	trait = incapable }
					NOT = { trait = infirm }
					NOT = {	trait = blinded }
					is_ill = no
				}
			}
			is_not_busy_trigger = yes
		}
		effect = {
			log = "[Root.GetTitledName] is going on hajj"
			scaled_wealth = -1.0
			clr_character_flag = promise_hajj		
			if = {
				limit = {
					trait = decadent
				}
				remove_trait = decadent
			}
			custom_tooltip = {
				text = PREPARE_FOR_HAJJ
				hidden_tooltip = {
					letter_event = { 
						id = 86000
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.005
				always = yes
			}
			modifier = {
				factor = 3
				trait = zealous
			}
			modifier = {
				factor = 0
				OR = {
					trait = cynical
					trait = slothful
					trait = proud
					trait = deceitful
					trait = decadent
				}
			}
			modifier = {
				factor = 0
				NOT = { scaled_wealth = 10.0 }
			}
			modifier = {
				factor = 0
				NOT = { age = 30 }
			}
		}
	}
	
	observe_ramadan = {
		only_playable = yes
		ai_check_interval = 12
		potential = {
			is_playable = yes
			OR = {
				is_feudal = yes
				is_tribal = yes
			}
			religion_group = muslim
			NOR = {
				is_inaccessible_trigger = yes
				trait = on_hajj
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_flag = ramadan
				has_character_flag = planning_ramadan
				has_character_modifier = observed_ramadan
			}
		}
		allow = {
			war = no
			in_command_trigger = no
			prestige = 100
			has_regent = no
			scaled_wealth = 0.8
			custom_tooltip = {
				text = IS_HEALTHY
				NOR = {
					is_ill = yes
					has_symptom_trigger = yes
				}
			}
		}
		effect = {
			set_character_flag = planning_ramadan
			scaled_wealth = -0.8
			piety = 5
			hidden_tooltip = {
				character_event = { id = 88500 }
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { month = 3 }
					month = 5
				}
			}
			modifier = {
				factor = 0
				trait = cynical
			}
			modifier = {
				factor = 0
				NOT = { scaled_wealth = 5.0 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	commission_runestone = {
		only_playable = yes
		ai_check_interval = 36
		potential = {
			has_dlc = "The Old Gods"
			is_playable = yes
			is_adult = yes
			prisoner = no
			NOT = { year = 1150 }
			culture_group = north_germanic
			NOT = {	has_character_flag = commissioned_runestone }
		}
		allow = {
			wealth = 100
			prisoner = no
		}
		effect = {
			wealth = -100
			set_character_flag = commissioned_runestone
			hidden_tooltip = { 
				character_event = { id = TOG.500 }
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				NOT = { wealth = 300 }
			}
			modifier = {
				factor = 0
				NOT = { age = 30 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	hold_nerge = {
		only_playable = yes
		ai_check_interval = 2
		potential = {
			has_dlc = "The Old Gods"
			is_playable = yes
			is_nomadic = yes
			num_of_vassals = 1
			OR = {
				is_female = no
				trait = martial_lady
				trait = martial_lady_tengri
				trait = martial_lady_pagan
			}
			NOR = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_modifier = held_nerge_timer
				has_character_flag = holding_nerge
				has_character_flag = planning_nerge
				liege = { has_character_flag = holding_nerge }
			}
		}
		allow = {
			war = no
			scaled_wealth = 0.75
			has_regent = no
		}
		effect = {
			scaled_wealth = -0.75
			set_character_flag = planning_nerge
			custom_tooltip = {
				text = prepare_nerge
				hidden_tooltip = { 
					character_event = { id = TOG.100 } 
				}
			}
			if = {
				limit = {
					has_dlc = "Reapers"
					is_nomadic = no
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { month = 8 }
					month = 10
				}
			}
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 10.0
				}
			}
			modifier = {
				factor = 0
				trait = craven
			}
			modifier = {
				factor = 0
				NOT = { martial = 10 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}	
	
	hold_blot = {
		only_playable = yes
		ai_check_interval = 6
		potential = {
			has_dlc = "The Old Gods"
			is_playable = yes
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
			NOT = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_modifier = held_blot_timer
				has_character_flag = holding_blot
				has_character_flag = planning_blot
				liege = { has_character_flag = holding_blot }
			}
		}
		allow = {
			war = no
			wealth = 50
			has_regent = no
			custom_tooltip = {
				text = HAS_THREE_NORSE_VASSALS_AVAILABLE
				hidden_tooltip = {
					any_vassal = {
						OR = {
							religion = norse_pagan
							religion = norse_pagan_reformed
						}
						has_regent = no
						war = no
						count = 3
					}
				}
			}
		}
		effect = {
			wealth = -50
			set_character_flag = planning_blot
			custom_tooltip = {
				text = prepare_blot
				hidden_tooltip = { 
					character_event = { id = TOG.600 } 
				}
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				month = 2
				NOT = { month = 10 }
			}
			modifier = {
				factor = 0
				NOT = {
					wealth = 300
				}
			}
			modifier = {
				factor = 0
				trait = shy
			}
			modifier = {
				factor = 0
				NOT = { diplomacy = 10 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	ancestor_worship = {
		only_playable = yes
		is_high_prio = yes 
		ai_check_interval = 12

		potential = {
			has_dlc = "The Old Gods"
			is_playable = yes
			is_landed = yes
			is_adult = yes
			prisoner = no
			OR = {
				religion = finnish_pagan
				religion = finnish_pagan_reformed
				religion = west_african_pagan
				religion = west_african_pagan_reformed
				religion = baltic_pagan
				religion = baltic_pagan_reformed
				religion = slavic_pagan
				religion = slavic_pagan_reformed
				religion = tengri_pagan
				religion = tengri_pagan_reformed
				religion = tibetan_pagan
			}
		}

		allow = {
			war = no
			any_demesne_title = {
				NOT = { higher_tier_than = count }
				is_occupied = no
			}
			NOT = { is_inaccessible_trigger = yes }
			is_not_busy_trigger = yes
			custom_tooltip = {
				text = worship_cooldown_tooltip
				hidden_tooltip = { NOT = { has_character_modifier = worshipped_ancestors_timer } }
			}
		}

		effect = {
			set_character_flag = recent_minor_decision
			add_character_modifier = {
				name = do_not_disturb
				days = 90
				hidden = yes
			}
			custom_tooltip = {
				text = prepare_worship_ancestors
				hidden_tooltip = { 
					character_event = { id = TOG.7000 } 
					add_character_modifier = {
						name = worshipped_ancestors_timer
						years = 10
						hidden = yes
					}
				}
			}
		}
		ai_will_do = {
			factor = 0.1
			
			modifier = {
				factor = 0.01
				trait = cynical
			}
			modifier = {
				factor = 5
				trait = zealous
			}	
			modifier = {
				factor = 0
				has_character_flag = recent_minor_decision
				NOT = {
					had_character_flag = {
						flag = recent_minor_decision
						days = 730
					}
				}
			}
		}
	}

	hold_ukon_juhla = {
		only_playable = yes
		ai_check_interval = 3
		potential = {
			has_dlc = "The Old Gods"
			is_playable = yes
			is_adult = yes
			num_of_vassals = 1
			prisoner = no
			OR = {
				religion = finnish_pagan
				religion = finnish_pagan_reformed
			}
			NOT = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_modifier = held_ukon_juhla_timer
				has_character_flag = holding_ukon_juhla
				has_character_flag = planning_ukon_juhla
			}
		}
		allow = {
			war = no
			wealth = 50
			has_regent = no
		}
		effect = {
			wealth = -50
			set_character_flag = planning_ukon_juhla
			custom_tooltip = {
				text = prepare_ukon_juhla
				hidden_tooltip = { 
					character_event = { id = TOG.700 } 
				}
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { month = 4 }
					month = 7
				}
			}
			modifier = {
				factor = 0
				NOT = {
					wealth = 300
				}
			}
			modifier = {
				factor = 0
				trait = shy
			}
			modifier = {
				factor = 0
				NOT = { diplomacy = 10 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}


	pick_main_deity = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			has_dlc = "The Old Gods"
			is_playable = yes
			is_adult = yes
			prisoner = no
			OR = {
				religion = slavic_pagan
				religion = slavic_pagan_reformed
				religion = west_african_pagan
				religion = west_african_pagan_reformed
				religion = finnish_pagan
				religion = finnish_pagan_reformed
				religion = baltic_pagan
				religion = baltic_pagan_reformed
			}
		}
		allow = {
			piety = 25
			custom_tooltip = {
				text = pick_main_deity_timer_tooltip
				NOT = { has_character_modifier = picked_main_deity_timer }
			}
			prisoner = no
		}
		effect = {
			if = {
				limit = { has_character_modifier = follower_of_perun }
				remove_character_modifier = follower_of_perun
			}
			if = {
				limit = { has_character_modifier = follower_of_veles }
				remove_character_modifier = follower_of_veles
			}
			if = {
				limit = { has_character_modifier = follower_of_jarilo }
				remove_character_modifier = follower_of_jarilo
			}
			if = {
				limit = { has_character_modifier = follower_of_morana }
				remove_character_modifier = follower_of_morana
			}
			if = {
				limit = { has_character_modifier = follower_of_yemoja }
				remove_character_modifier = follower_of_yemoja
			}
			if = {
				limit = { has_character_modifier = follower_of_ekwensu }
				remove_character_modifier = follower_of_ekwensu
			}
			if = {
				limit = { has_character_modifier = follower_of_orunmila }
				remove_character_modifier = follower_of_orunmila
			}
			if = {
				limit = { has_character_modifier = follower_of_shango }
				remove_character_modifier = follower_of_shango
			}
			if = {
				limit = { has_character_modifier = follower_of_ukko }
				remove_character_modifier = follower_of_ukko
			}
			if = {
				limit = { has_character_modifier = follower_of_akka }
				remove_character_modifier = follower_of_akka
			}
			if = {
				limit = { has_character_modifier = follower_of_taipo_and_mielikki }
				remove_character_modifier = follower_of_taipo_and_mielikki
			}
			if = {
				limit = { has_character_modifier = follower_of_lempo }
				remove_character_modifier = follower_of_lempo
			}
			if = {
				limit = { has_character_modifier = follower_of_dievas }
				remove_character_modifier = follower_of_dievas
			}
			if = {
				limit = { has_character_modifier = follower_of_velnias }
				remove_character_modifier = follower_of_velnias
			}
			if = {
				limit = { has_character_modifier = follower_of_perkunas }
				remove_character_modifier = follower_of_perkunas
			}
			if = {
				limit = { has_character_modifier = follower_of_zemyna }
				remove_character_modifier = follower_of_zemyna
			}

			piety = -25

			custom_tooltip = {
				text = pick_main_deity_tooltip

				#Starts main deity events
				hidden_tooltip = {
					if = {
						limit = { has_minor_deity_trigger = no }
						character_event = { id = TOG.7100 days = 10 }
					}				
				}

				#Event for picking main deity
				trigger_switch = {
					on_trigger = religion
					slavic_pagan 				= { character_event = { id = TOG.7110 } } 
					slavic_pagan_reformed	 	= { character_event = { id = TOG.7110 } } 
					west_african_pagan			= { character_event = { id = TOG.7200 } } 
					west_african_pagan_reformed = { character_event = { id = TOG.7200 } }
					finnish_pagan				= { character_event = { id = TOG.7300 } }
					finnish_pagan_reformed		= { character_event = { id = TOG.7300 } }
					baltic_pagan				= { character_event = { id = TOG.7400 } } 
					baltic_pagan_reformed		= { character_event = { id = TOG.7400 } }   
				}

				add_character_modifier = {
					name = picked_main_deity_timer
					duration = 3650
					hidden = yes
				}
			}
		}
		ai_will_do = {
			factor = 0.5
			modifier = {
				factor = 0
				has_minor_deity_trigger = yes
			}
		}
	}

	
	
	hold_uzgavenes = {
		only_playable = yes
		ai_check_interval = 3
		potential = {
			has_dlc = "The Old Gods"
			is_playable = yes
			is_adult = yes
			num_of_vassals = 1
			prisoner = no
			OR = {
				religion = baltic_pagan
				religion = baltic_pagan_reformed
			}
			NOT = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_modifier = held_uzgavenes_timer
				has_character_flag = holding_uzgavenes
				has_character_flag = planning_uzgavenes
			}
		}
		allow = {
			war = no
			wealth = 50
			has_regent = no
		}
		effect = {
			wealth = -50
			set_character_flag = planning_uzgavenes
			custom_tooltip = {
				text = prepare_uzgavenes
				hidden_tooltip = { 
					character_event = { id = TOG.750 } 
				}
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { month = 4 }
					month = 7
				}
			}
			modifier = {
				factor = 0
				NOT = {
					wealth = 300
				}
			}
			modifier = {
				factor = 0
				trait = shy
			}
			modifier = {
				factor = 0
				NOT = { diplomacy = 10 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	hold_jarilo = {
		only_playable = yes
		ai_check_interval = 3
		potential = {
			has_dlc = "The Old Gods"
			is_playable = yes
			is_adult = yes
			num_of_vassals = 1
			prisoner = no
			OR = {
				religion = slavic_pagan
				religion = slavic_pagan_reformed
			}
			NOT = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_modifier = held_jarilo_timer
				has_character_flag = holding_jarilo
				has_character_flag = planning_jarilo
			}
		}
		allow = {
			war = no
			wealth = 50
			has_regent = no
		}
		effect = {
			wealth = -50
			set_character_flag = planning_jarilo
			custom_tooltip = {
				text = prepare_jarilo
				hidden_tooltip = { 
					character_event = { id = TOG.800 } 
				}
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { month = 4 }
					month = 7
				}
			}			
			modifier = {
				factor = 0
				NOT = {
					wealth = 300
				}
			}
			modifier = {
				factor = 0
				trait = shy
			}
			modifier = {
				factor = 0
				NOT = { diplomacy = 10 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	celebrate_passover = {
		only_playable = yes
		ai_check_interval = 3
		potential = {
			has_dlc = "Sons of Abraham"
			is_playable = yes
			is_adult = yes
			prisoner = no
			religion_group = jewish_group
			num_of_vassals = 1
			NOR = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_modifier = held_passover_timer
				has_character_flag = holding_passover
				has_character_flag = planning_passover
			}
		}
		allow = {
			war = no
			wealth = 50
			has_regent = no
		}
		effect = {
			wealth = -50
			set_character_flag = planning_passover
			custom_tooltip = {
				text = passover_celebrations
				hidden_tooltip = { 
					character_event = { id = SoA.500 } 
				}
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { month = 3 }
					month = 6
				}
			}
			modifier = {
				factor = 0
				NOT = {
					wealth = 300
				}
			}
			modifier = {
				factor = 0
				trait = shy
			}
			modifier = {
				factor = 0
				NOT = { diplomacy = 10 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}	
	
	borrow_money_jews = {
		only_playable = yes
		only_independent = yes
		ai_check_interval = 3
		potential = {
			is_playable = yes
			is_nomadic = no
			has_dlc = "Sons of Abraham"
			ai = no
			independent = yes
			OR = {
				religion_group = christian
				religion_group = muslim
				religion_group = zoroastrian_group
				AND = {
					is_pagan_religion = yes
					is_reformed_pagan_religion = yes
				}
			NOR = { 
				secret_religion = jewish
				secret_religion = karaite
				secret_religion = samaritan
			}
			}
			OR = {
				any_demesne_province = {
					has_building = ct_jewish_community_1
				}
				any_realm_lord = {
					is_republic = yes
					any_demesne_province = {
						has_building = ct_jewish_community_1
					}
				}
			}
			NOR = {
				has_character_flag = offended_moneylenders
				has_character_flag = pogrom
			}
		}
		
		allow = {
			has_regent = no
			NOR = {
				has_character_modifier = borrowed_from_jews
				has_character_modifier = expelled_jewish
				top_liege = { has_character_modifier = expelled_jewish }
			}
		}
		
		effect = {
			set_character_flag = loan_taken
			add_character_modifier = {
				name = borrowed_from_jews
				duration = -1
				inherit = yes
				hidden = yes
			}
			add_character_modifier = {
				name = loan_timer_jews
				duration = 730
				inherit = yes
			}
			wealth = 300
		}
		
		
		ai_will_do = {
			factor = 0
		}
	}
	
	repay_money_jews = {
		only_playable = yes
		ai_check_interval = 6
		potential = {
			is_playable = yes
			has_dlc = "Sons of Abraham"
			NOT = { has_character_flag = loan_in_progress_jewish }
			has_character_modifier = borrowed_from_jews
			has_character_modifier = loan_timer_jews
		}
		
		allow = {
			wealth = 350
		}
		
		effect = {
			remove_character_modifier = borrowed_from_jews
			remove_character_modifier = loan_timer_jews
			if = {
				limit = {
					has_character_modifier = loan_50_hidden
					has_character_modifier = loan_100_hidden
					has_character_modifier = loan_200_hidden
					has_character_modifier = loan_400_hidden
					has_character_modifier = loan_600_hidden
					has_character_modifier = loan_800_hidden
					has_character_modifier = loan_1000_hidden
				}
				clr_character_flag = loan_taken
			}
			wealth = -350
		}
		
		
		ai_will_do = {
			factor = 0
			modifier = {
				factor = 0.5 # Slow it down
			}
		}
	}

	become_kshatriya = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			is_playable = yes
			is_adult = yes
			religion = hindu
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
			}
			has_dlc = "Rajas of India"
			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
			}
			if = {
				limit = { NOT = { learning = 12 } }
				scaled_wealth = -6
			}
			if = {
				limit = { NOT = { trait = brahmin } }
				piety = -200
			}
			
			prestige = 50
			add_trait = kshatriya
			any_spouse = {
				limit = {
					is_ruler = no
					liege = { character = ROOT }
					NOT = { trait = kshatriya }
				}
				add_trait = kshatriya
			}
			any_child = {
				limit = {
					is_ruler = no
					liege = { character = ROOT }
					NOT = { trait = kshatriya }
				}
				add_trait = kshatriya
			}
			hidden_tooltip = {
				top_liege = {
					any_realm_character = {
						limit = {
							religion = hindu
							is_adult = yes
							NOT = { character = ROOT }
							NOT = { trait = cynical }
						}
						opinion = {
							modifier = 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 = 1
			modifier = {
				factor = 0.5
				always = yes
			}
		}
	}
	
	become_vaishya = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			is_playable = yes
			is_adult = yes
			religion = hindu
			OR = {
				is_republic = yes
				is_merchant_republic = yes
			}
			has_dlc = "Rajas of India"
			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
			}
			if = {
				limit = { NOT = { learning = 12 } }
				scaled_wealth = -6
			}
			if = {
				limit = { NOT = { trait = brahmin } }
				piety = -200
			}
			
			prestige = 50
			add_trait = vaishya
			any_spouse = {
				limit = {
					is_ruler = no
					liege = { character = ROOT }
					NOT = { trait = vaishya }
				}
				add_trait = vaishya
			}
			any_child = {
				limit = {
					is_ruler = no
					liege = { character = ROOT }
					NOT = { trait = vaishya }
				}
				add_trait = vaishya
			}
			hidden_tooltip = {
				top_liege = {
					any_realm_character = {
						limit = {
							religion = hindu
							is_adult = yes
							NOT = { character = ROOT }
							NOT = { trait = cynical }
						}
						opinion = {
							modifier = 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 = 1
			modifier = {
				factor = 0.5
			}
		}
	}

	hold_diwali_feast_hindu = {
		only_playable = yes
		ai_check_interval = 4
		potential = {
			has_dlc = "Rajas of India"
			is_playable = yes
			is_adult = yes
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_republic = yes
			}
			num_of_vassals = 1
			prisoner = no
			religion = hindu
			NOT = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				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_flag = planning_diwali_feast
				has_character_flag = planning_kali_puja_feast
				liege = { has_character_modifier = holding_diwali_feast }
				liege = { has_character_modifier = holding_kali_puja_feast }
			}
		}
		allow = {
			war = no
			has_regent = no
			scaled_wealth = 0.2
			prestige = 100
		}
		effect = {
			scaled_wealth = -0.2
			set_character_flag = planning_diwali_feast
			custom_tooltip = { text = PREPARE_DIWALI }
			hidden_tooltip = { character_event = { id = RoI.1000 } }
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				NOT = { month = 9 }
			}
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 2
				}
			}
			modifier = {
				factor = 0.5
				trait = shy
			}
			modifier = {
				factor = 0.5
				NOT = { diplomacy = 10 }
			}	
			modifier = {
				factor = 0
				NOT = { age = 30 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}

	hold_diwali_feast_buddhist = {
		only_playable = yes
		ai_check_interval = 4
		potential = {
			has_dlc = "Rajas of India"
			is_playable = yes
			is_adult = yes
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_republic = yes
			}
			num_of_vassals = 1
			religion = buddhist
			NOT = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				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_flag = planning_diwali_feast
				has_character_flag = planning_kali_puja_feast
				liege = { has_character_modifier = holding_diwali_feast }
				liege = { has_character_modifier = holding_kali_puja_feast }
			}
		}
		allow = {
			war = no
			has_regent = no
			scaled_wealth = 0.2
			prestige = 100
		}
		effect = {
			scaled_wealth = -0.2
			set_character_flag = planning_diwali_feast
			custom_tooltip = { text = PREPARE_DIWALI }
			hidden_tooltip = { character_event = { id = RoI.1000 } }
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				NOT = { month = 9 }
			}
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 2
				}
			}
			modifier = {
				factor = 0.5
				trait = shy
			}
			modifier = {
				factor = 0.5
				NOT = { diplomacy = 10 }
			}	
			modifier = {
				factor = 0
				NOT = { age = 30 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}

	hold_diwali_feast_jain = {
		only_playable = yes
		ai_check_interval = 4
		potential = {
			has_dlc = "Rajas of India"
			is_playable = yes
			is_adult = yes
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_republic = yes
			}
			num_of_vassals = 1
			religion = jain
			NOT = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				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_flag = planning_diwali_feast
				has_character_flag = planning_kali_puja_feast
				liege = { has_character_modifier = holding_diwali_feast }
				liege = { has_character_modifier = holding_kali_puja_feast }
			}
		}
		allow = {
			war = no
			has_regent = no
			scaled_wealth = 0.2
			prestige = 100
		}
		effect = {
			scaled_wealth = -0.2
			set_character_flag = planning_diwali_feast
			custom_tooltip = { text = PREPARE_DIWALI }
			hidden_tooltip = { character_event = { id = RoI.1000 } }
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				NOT = { month = 9 }
			}
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 2
				}
			}
			modifier = {
				factor = 0.5
				trait = shy
			}
			modifier = {
				factor = 0.5
				NOT = { diplomacy = 10 }
			}	
			modifier = {
				factor = 0
				NOT = { age = 30 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}

	hold_diwali_feast_kali_puja = {
		only_playable = yes
		ai_check_interval = 4
		potential = {
			has_dlc = "Rajas of India"
			is_playable = yes
			is_adult = yes
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
				is_republic = yes
			}
			num_of_vassals = 1
			religion = hindu
			OR = {
				has_character_modifier = patron_kali
				capital_scope = { region = world_india_bengal }
			}
			NOT = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_modifier = holding_diwali_feast
				has_character_modifier = holding_kali_puja_feast
				has_character_modifier = large_feast_timer
				has_character_flag = planning_diwali_feast
				has_character_flag = planning_kali_puja_feast
				liege = { has_character_modifier = holding_diwali_feast }
				liege = { has_character_modifier = holding_kali_puja_feast }
			}
		}
		allow = {
			war = no
			has_regent = no
			scaled_wealth = 0.2
			prestige = 100
		}
		effect = {
			scaled_wealth = -0.2
			set_character_flag = planning_kali_puja_feast
			custom_tooltip = { text = PREPARE_KALI_PUJA }
			hidden_tooltip = { character_event = { id = RoI.1000 } }
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				NOT = { month = 9 }
			}
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 2
				}
			}
			modifier = {
				factor = 0.5
				trait = shy
			}
			modifier = {
				factor = 0.5
				NOT = { diplomacy = 10 }
			}	
			modifier = {
				factor = 0
				NOT = { age = 30 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}

	find_guru = {
		only_playable = yes
		ai_check_interval = 36
		potential = {
			OR = {
				has_dharmic_religion_trigger = yes
				religion = bon
			}
			is_playable = yes
			is_adult = yes
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
			}
			NOT = {
				is_inaccessible_trigger = yes
				has_character_flag = looking_for_guru
				has_character_flag = found_guru
				any_courtier = { has_minor_title = title_guru }
			}
			is_not_busy_trigger = yes
		}
		allow = {
			has_regent = no
			wealth = 50
			prestige = 300
		}
		effect = {
			wealth = -50
			set_character_flag = looking_for_guru
			character_event = { id = RoI.3000 }
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}			
			modifier = {
				factor = 0
				trait = cynical
			}
			modifier = {
				factor = 0
				NOT = { wealth = 200 }
			}
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
		}
	}
	
	hold_zun_feast = {
		only_playable = yes
		ai_check_interval = 6
		potential = {
			has_dlc = "Charlemagne"
			is_playable = yes
			is_adult = yes
			OR = {
				is_feudal = yes
				is_tribal = yes
				is_nomadic = yes
			}
			OR = {
				religion = zun_pagan
				religion = zun_pagan_reformed
			}
			num_of_vassals = 1
			NOR = {
				is_inaccessible_trigger = yes
				any_demesne_title = { NOT = { higher_tier_than = count } is_occupied = yes }
				has_character_flag = planning_zun_feast
				has_character_modifier = large_feast_timer
				liege = { has_character_modifier = holding_zun_feast }
			}
		}
		allow = {
			war = no
			has_regent = no
			scaled_wealth = 0.2
			prestige = 100
		}
		effect = {
			scaled_wealth = -0.2
			set_character_flag = planning_zun_feast
			hidden_tooltip = { 
				character_event = { id = CM.4100 }
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 8 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
			modifier = {
				factor = 0
				OR = {
					NOT = { month = 3 }
					month = 9
				}
			}
			modifier = {
				factor = 0
				NOT = { scaled_wealth = 2 }
			}
			modifier = {
				factor = 0.5
				trait = shy
			}
			modifier = {
				factor = 0.5
				NOT = { diplomacy = 10 }
			}
			modifier = {
				factor = 0
				NOT = { age = 30 }
			}			
		}
	}
	
	come_out_of_hiding_siege = {
		is_high_prio = yes
		only_rulers = yes

		potential = {
			is_ruler = yes
			war = no
			OR = {
				AND = {
					trait = in_hiding
					has_character_flag = in_hiding_siege
				}
				any_courtier = {
					is_close_relative = ROOT
					trait = in_hiding
					has_character_flag = in_hiding_siege
				}
			}
		}
		allow = {
			war = no
		}
		effect = {
			if = {
				limit = {
					trait = in_hiding
					has_character_flag = in_hiding_siege
				}
				custom_tooltip = { text = come_out_of_hiding_info_tooltip }
				hidden_tooltip = {
					remove_trait = in_hiding
					clr_character_flag = in_hiding_siege
				}
			}
			any_courtier = {
				limit = {
					trait = in_hiding
					has_character_flag = in_hiding_siege
				}
				custom_tooltip = { text = come_out_of_hiding_other_tooltip }
				hidden_tooltip = {
					remove_trait = in_hiding
					clr_character_flag = in_hiding_siege
				}
			}
			hidden_tooltip = {
				clr_character_flag = defending_the_castle
				remove_character_modifier = stalwart_defender
				remove_character_modifier = left_at_siege
				remove_character_modifier = escaped_siege
				any_courtier = {
					clr_character_flag = defending_the_castle
					remove_character_modifier = stalwart_defender
					remove_character_modifier = left_at_siege
					remove_character_modifier = escaped_siege
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					in_siege = yes
					any_courtier = { in_siege = yes }
				}
			}
		}
	}
	
	# Sky burial
	sky_burial_decision = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			is_playable = yes
			has_character_flag = sky_burial
			NOT = { has_character_flag = performed_sky_burial }
			OR = {
				religion_group = zoroastrian_group
				religion = bon
				AND = {
					government = nomadic_government
					OR = {
						religion = tengri_pagan
						religion = tengri_pagan_reformed
						religion = tibetan_pagan
						religion_group = zoroastrian_group
						has_dharmic_religion_trigger = yes
					}
				}
			}
		}
		allow = {
			in_command_trigger = no
			prisoner = no
			is_adult = yes
			NOT = { trait = incapable }
			NOT = { trait = infirm }
			NOT = { is_inaccessible_trigger = yes }
			is_not_busy_trigger = yes
		}
		effect = {
			custom_tooltip = { text = sky_burial_custom_tooltip }
			hidden_tooltip = {
				character_event = { id = HL.8005 }
				clr_character_flag = sky_burial
				set_character_flag = performed_sky_burial
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				always = yes
			}
		}
	}

	# Choose Warhorse (Nomad)
	choose_warhorse_nomad = {
		only_playable = yes
		ai_check_interval = 12
		potential = {
			is_playable = yes
			is_nomadic = yes
			NOT = { has_character_modifier = nomad_warhorse }
		}
		allow = {
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
			wealth = 20
			is_not_busy_trigger = yes
		}
		effect = {
			wealth = -20
			custom_tooltip = { text = nomad_acquires_warhorse_tooltip }
			hidden_tooltip = { long_character_event = { id = HL.6000 } } # Select and name horse
			hidden_tooltip = { character_event = { id = HL.6500 days = 3500 random = 2000 } } # Horse dies
		}
		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 0
				NOT = { wealth = 200 }
			}
		}
	}
	destroy_artifact = {
		only_playable = yes
		ai = no
		hide_in_decisions_list = yes
		potential = {
			FROM = {
				owner = {
					character = ROOT
				}
			}
		}
		allow = {
			FROM = {
				show_scope_change = no
				is_indestructible = no 
			}
		}
		effect = {
			FROM = {
				destroy_artifact = yes
			}
		}
	}
}