decisions = {
	hold_an_aonach_tailteann  = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = {	has_character_flag = aonach_tailteann }
			religion_openly_in_celtic_subgroup_trigger = yes
			OR = {
				culture = irish
				culture = scottish
				culture = pictish
			}
			independent = yes
			primary_title = { higher_tier_than = COUNT }
			location = {
				owner = { character = ROOT }
			}
			is_inaccessible_or_incapable_trigger = no
		}
		allow = {
			war = no
			in_command = no
			age = 16
			prestige = 500
			wealth = 200
			OR = {
				any_vassal = {
					has_minor_title = title_court_bard
				}
				any_courtier = {
					has_minor_title = title_court_bard
				}
			}
		}
		effect = {
			set_character_flag = aonach_tailteann
			clr_character_flag = tailteann_has_ended
			wealth = -200
			prestige = 100
			character_event = { id = celtic.1193 tooltip = tailteann_invite }
			hidden_tooltip = {
				character_event = { id = celtic.1191 days = 60 } # Aonach starts
				clr_character_flag = tailteann_has_ended
				any_realm_character = {
					limit = {
						is_incapable = no
						prisoner = no
					}
					clr_character_flag = tailteann_has_ended
					character_event = { id = celtic.1190 }
				}
			}

			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 12 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOR = {
					wealth = 1000
					scaled_wealth = 3.0
				}
			}
		}
	}
	
	hold_divination = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			has_dlc = "The Old Gods"
			is_ruler = yes
			age = 16
			is_inaccessible_or_incapable_trigger = no
			religion_openly_celtic_or_reformed_trigger = yes
			NOT = {	has_character_flag = holding_divination }
			NOT = {	has_character_modifier = held_divination_timer }
		}
		allow = {
			war = no
			any_demesne_title = {
				location = {
					any_province_holding = { is_occupied = no }
				}
			}
			OR = {
				any_vassal = {
					has_minor_title = title_court_druid
				}
				any_courtier = {
					has_minor_title = title_court_druid
				}
			}
			month = 5
			NOT = { month = 11 }
			scaled_wealth = { value = 0.2 min = 25 max = 500 }
		}
		effect = {
			scaled_wealth = { value = -0.2 min = -25 max = -500 }
			custom_tooltip = {
				text = prepare_divination
				set_character_flag = holding_divination
				
				hidden_tooltip = {
					character_event = { id = celtic.20 }
				}
			}

			if = {
				limit = {
					has_dlc = "Reapers"
				}
				custom_tooltip = {
					text = capital_prospers_custom_tooltip
					hidden_tooltip = {
						capital_scope = {
							change_variable = { which = prosperity_value value = 6 }
						}
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 3.0
				}
			}
			modifier = {
				factor = 0
				NOT = {
					martial = 8
				}
			}
		}
	}

	reinstate_celtic_rites = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			has_dlc = "The Old Gods"
			age = 16
			is_inaccessible_or_incapable_trigger = no
			culture_group = celtic
			NOR = {
				has_character_flag = adopted_celtic_rites
				religion_openly_celtic_or_reformed_trigger = yes
			}
			any_courtier = {
				has_minor_title = title_court_wizard_acr
			}
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			war = no
			scaled_wealth = { value = 0.1 min = 10 max = 250 }
			learning = 8
			NOT = { trait = zealous }
			any_courtier = {
				has_minor_title = title_court_wizard_acr
				prisoner = no
			}
		}
		effect = {
			scaled_wealth = { value = -0.1 min = -10 max = 250 }
			custom_tooltip = {
				text = adopt_celtic_rites
				
				set_character_flag = adopted_celtic_rites
				hidden_tooltip = {
					character_event = { id = celtic.1 }
				}
			}

			chronicle = {
				entry = CHRONICLE_CELTIC_RITES
				portrait = [Root.GetID]
			}
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0
				trait = zealous
			}
			modifier = {
				factor = 0
				NOT = { learning = 6 }
			}
		}
	}

	organize_gwydion = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			OR = {
				tier = king
				tier = emperor
			}

			religion = celtic_pagan_reformed

			is_inaccessible_or_incapable_trigger = no
			age = 16
			NOT = { has_global_flag = gwydion_founded }
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			trigger_if = {
				limit = {
					is_random_world = yes
				}
				tier = emperor
			}
			trigger_else = { has_landed_title = e_britannia }
			wealth = 300
			prestige = 300
			trigger_if = {
				limit = { has_religion_feature = religion_temporal_head }
				d_celtic_pagan_reformed = { holder = ROOT }
			}
			trigger_else_if = {
				limit = { NOT = { has_religion_feature = religion_no_leader } }
				d_celtic_pagan_reformed = {
					holder_scope = { show_scope_change = no is_liege_or_above = ROOT }
				}
			}
			trigger_else = { piety = 300 }
		}
		effect = {
			set_global_flag = gwydion_founded
			set_character_flag = acr_founded_gwydion
			prestige = -300
			wealth = -300
			activate_title = { title = d_gwydion status = yes }
			hidden_tooltip = {
				narrative_event = { id = celtic.110 }
				create_character = {
					random_traits = yes
					religion = celtic_pagan_reformed
					culture = ROOT
					dynasty = NONE
					female = no
					age = 34
					trait = skilled_tactician
				}
				new_character = {
					wealth = 100
					prestige = 100
					piety = 100
					gain_title = d_gwydion
					set_defacto_liege = ROOT
					while = {
						count = 7

						create_character = {
							random_traits = yes
							dynasty = random
							religion = celtic_pagan_reformed
							culture = ROOT
							female = no
							min_age = 16
							max_age = 28
						}
					}

					while = {
						count = 2

						create_character = {
							random_traits = yes
							dynasty = random
							religion = celtic_pagan_reformed
							culture = ROOT
							female = yes
							min_age = 16
							max_age = 18
						}
					}
					
					### IPC ###
					if = {
						limit = { has_global_flag = is_toe_ipc_save }
						primary_title = {
							set_title_flag = is_imperial_guard
							set_title_flag = celtic_guard
						}
						ROOT = {
							primary_title = { set_title_flag = imperial_guard_founded }
						}
						add_trait = toe_guard_captain
						save_event_target_as = guard_captain
						add_character_modifier = { 
							name = guard_captain
							duration = -1
						}
					}
				}
			}
			religion_authority = {
				modifier = religious_order_formed
				years = 10
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	organize_fianna = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			OR = {
				any_demesne_title = {
					tier = count
					de_jure_liege_or_above = k_ireland
				}
				culture = irish
			}
			higher_tier_than = count
			religion_openly_celtic_or_reformed_trigger = yes
			is_heretic = no
			is_inaccessible_or_incapable_trigger = no
			age = 16
			NOT = { has_global_flag = fianna_founded }
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			OR = {
				has_landed_title = k_ireland
				any_vassal = { has_landed_title = k_ireland }
				completely_controls = k_ireland
			}
			prestige = 300
			wealth = 300
		}
		effect = {
			set_global_flag = fianna_founded
			prestige = -300
			wealth = -300
			activate_title = { title = d_fianna status = yes }
			hidden_tooltip = {
				narrative_event = { id = celtic.1150 }
				create_character = {
					random_traits = yes
					religion = ROOT
					culture = irish
					dynasty = NONE
					female = no
					age = 34
					add_trait = brilliant_strategist
					add_trait = zealous
					add_trait = humble
					add_trait = ambitious
					add_trait = strategist
					add_trait = holy_warrior
					trait = fian
				}
				new_character = {
					gain_title = d_fianna
					set_government_type = order_government
					save_event_target_as = target_grandmaster
					set_defacto_liege = this
					prestige = 300
					wealth = 300
					
					while = {
						count = 7

						create_character = {
							random_traits = yes
							dynasty = random
							religion = ROOT
							culture = irish
							female = no
							min_age = 16
							max_age = 28
						}
					}

					while = {
						count = 2

						create_character = {
							random_traits = yes
							dynasty = random
							religion = ROOT
							culture = irish
							female = yes
							min_age = 16
							max_age = 18
						}
					}
				}
			}
			religion_authority = {
				modifier = religious_order_formed
				years = 10
			}
			chronicle = {
				entry = CHRONICLE_FIANNA
				portrait = [Root.GetID]
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	vassalize_fianna = {
		is_high_prio = yes
		only_playable = yes
		potential = {
			religion = celtic_pagan_reformed
			is_heretic = no
			is_inaccessible_or_incapable_trigger = no
			age = 16
			is_title_active = d_fianna
			
			OR = {
				has_landed_title = k_ireland
				AND = {
					has_landed_title = e_britannia
					OR = {
						completely_controls = k_ireland
						any_vassal = { has_landed_title = k_ireland }
					}
				}
			}
			
			d_fianna = {
				holder_scope = {
					independent = yes
				}
			}
		}
		
		allow = {
			prestige = 500
			piety = 500
			wealth = 500
		}
		
		effect = {
			prestige = -500
			wealth = -500
			
			hidden_tooltip = {
				d_fianna = {
					holder_scope = {
						wealth = 500
						prestige = 500
						character_event = {
							id = celtic.116
						}
					}
				}
			}

			chronicle = {
				entry = CHRONICLE_FIANNA_VASSALIZED
				portrait = [Root.GetID]
			}
		}
		
		
		ai_will_do = {
			factor = 1
		}
	}

	donate_money_to_fianna = {
		only_playable = yes
		potential = {
			religion = celtic_pagan_reformed
			is_inaccessible_or_incapable_trigger = no
			is_title_active = d_fianna
			
			NOT = { has_character_modifier = expelled_d_fianna }
			
			has_dlc = "Sons of Abraham"
			
			d_fianna = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
		}
		
		effect = {
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_fianna = {
					holder_scope = {
						character_event = {
							id = celtic.1333
						}
					}
				}
			}
			
			wealth = -300
			piety = 300
		}

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					piety = 1000
					NOT = { wealth = 1000 }
					NOT = { has_landed_title = d_celtic_pagan_reformed }
				}
			}
			modifier = {
				factor = 0.002 # Slow it down
			}
		}
	}

	expel_red_dragons = {
		ai = no
		only_playable = yes
		potential = {
			religion = celtic_pagan_reformed
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_red_dragons
			NOT = { has_character_modifier = expelled_d_red_dragons }
			is_inaccessible_or_incapable_trigger = no
			any_realm_province = {
				any_province_lord = {
					d_red_dragons = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
		}
		
		effect = {
			piety = -1000
			
			religion_authority = {
				modifier = holy_order_expelled
				years = 20
			}
			
			hidden_tooltip = {
				d_red_dragons = {
					holder_scope = {
						character_event = {
							id = celtic.1329
						}
					}
				}
				add_character_modifier = {
					name = expelled_d_red_dragons
					duration = -1
					inherit = yes
				}
			}
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_red_dragons = {
		only_playable = yes
		potential = {
			religion = celtic_pagan_reformed
			is_inaccessible_or_incapable_trigger = no
			is_title_active = d_red_dragons
			
			NOT = { has_character_modifier = expelled_d_red_dragons }
			
			has_dlc = "Sons of Abraham"
			
			d_red_dragons = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
		}
		
		effect = {
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_red_dragons = {
					holder_scope = {
						character_event = {
							id = celtic.1331
						}
					}
				}
			}
			
			wealth = -300
			piety = 300
		}
			
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					piety = 1000
					NOT = { wealth = 1000 }
					NOT = { has_landed_title = d_celtic_pagan_reformed }
				}
			}
			modifier = {
				factor = 0.002 # Slow it down
				always = yes
			}
		}
	}

	invite_druid_to_court = {
		only_playable = yes
		potential = {
			religion_openly_celtic_or_reformed_trigger = yes
			NOT = { has_character_flag = inviting_druid_over }
			primary_title = { higher_tier_than = BARON }
			is_inaccessible_or_incapable_trigger = no
		}
		allow = {
			scaled_wealth = { value = 0.5 min = 25 max = 500 }
		}
		effect = {
			scaled_wealth = { value = -0.5 min = -25 max = -500 }
			
			set_character_flag = inviting_druid_over

			hidden_tooltip = {
				character_event = {
					id = celtic.155
					days = 3
				}
			}
			
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.3 #Decrease chance AI will do this
				always = yes
			}
			modifier = {
				factor = 0.1
				any_courtier = {
					trait = druid
				}
			}
			modifier = {
				factor = 2
				trait = diligent
			}	
			modifier = {
				factor = 0.5
				trait = slothful
			}	
			modifier = {
				factor = 2
				trait = ambitious
			}	
			modifier = {
				factor = 0.5
				is_dumb_trigger = yes
			}		
			modifier = {
				factor = 2
				trait = zealous
			}	
			modifier = {
				factor = 0.5
				trait = cynical
			}			
			modifier = {
				factor = 2
				primary_title = { higher_tier_than = DUKE }
			}	
		}
	}

	invite_bard_to_court = {
		only_playable = yes
		potential = {
			religion_openly_in_celtic_subgroup_trigger = yes
			is_inaccessible_or_incapable_trigger = no
			primary_title = { higher_tier_than = BARON }
		}
		allow = {
			scaled_wealth = { value = 0.5 min = 25 max = 500 }
		}
		effect = {
			scaled_wealth = { value = -0.5 min = -25 max = -500 }
			
			random_list = {
				35 = {
					create_character = {
						random_traits = yes
						dynasty = random
						trait = naive_appeaser
						trait = poet
						attributes = {
							diplomacy = 3
							martial = 3
							stewardship = 3
							intrigue = 3
							learning = 3
						}
					}	
				}
				30 = {
					create_character = {
						random_traits = yes
						dynasty = random
						trait = poet
						trait = underhanded_rogue
						attributes = {
							diplomacy = 5
							martial = 5
							stewardship = 5
							intrigue = 5
							learning = 5
						}
					}		
				}
				20 = {
					create_character = {
						random_traits = yes
						dynasty = random
						trait = poet
						trait = charismatic_negotiator
						attributes = {
							diplomacy = 8
							martial = 8
							stewardship = 8
							intrigue = 8
							learning = 8
						}
					}		
				}
				12 = {
					create_character = {
						random_traits = yes
						dynasty = random
						trait = poet
						trait = grey_eminence
						attributes = {
							diplomacy = 10
							martial = 10
							stewardship = 10
							intrigue = 10
							learning = 10
						}
					}		
				}
				3 = {
					create_character = {
						random_traits = yes
						dynasty = random
						trait = poet
						trait = grey_eminence
						attributes = {
							diplomacy = 13
							martial = 13
							stewardship = 13
							intrigue = 13
							learning = 13
						}
					}		
				}
			}
			new_character = {
				opinion = {
					modifier = opinion_patron
					who = ROOT
					years = 5
				}
			}		
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.3 #Decrease chance AI will do this
				always = yes
			}
			modifier = {
				factor = 0.1
				any_courtier = {
					trait = poet
				}
			}
			modifier = {
				factor = 0
				any_courtier = {
					has_minor_title = title_court_bard
				}
			}
			modifier = {
				factor = 2
				trait = diligent
			}	
			modifier = {
				factor = 0.5
				trait = slothful
			}	
			modifier = {
				factor = 2
				trait = ambitious
			}	
			modifier = {
				factor = 0.5
				is_dumb_trigger = yes
			}		
			modifier = {
				factor = 2
				trait = zealous
			}	
			modifier = {
				factor = 0.5
				trait = cynical
			}			
			modifier = {
				factor = 2
				primary_title = { higher_tier_than = DUKE }
			}
		}
	}

	assign_druid = { # For the AI, because they are dumb enough not to hand out minor titles
		only_playable = yes

		potential = {
			ai = yes
			primary_title = { higher_tier_than = BARON }
			religion_openly_celtic_or_reformed_trigger = yes
			NOT = { 
				any_courtier = {
					has_minor_title = title_court_druid
				}
			}
		}
		allow = {
			any_courtier = {
				trait = druid
				is_adult = yes
			}
		}
		effect = {
			random_courtier = {
				limit = {
					is_adult = yes
					trait = druid
				}
				give_minor_title = title_court_druid
			}
			
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.75 #Decrease chance AI will do this - they'll still do it eventually anyways, this will just prevent them from doing it immediately
				always = yes
			}
		}
	}

	assign_bard = { # For the AI, because they are dumb enough not to hand out minor titles
		only_playable = yes
		
		potential = {
			ai = yes
			primary_title = { higher_tier_than = BARON }
			religion_openly_in_celtic_subgroup_trigger = yes
			NOT = { 
				any_courtier = {
					has_minor_title = title_court_bard
				}
			}
		}
		allow = {
			any_courtier = {
				trait = poet
				is_adult = yes
			}
		}
		effect = {
			random_courtier = {
				limit = {
					is_adult = yes
					trait = poet
				}
				give_minor_title = title_court_bard
			}
			
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.75 #Decrease chance AI will do this - they'll still do it eventually anyways, this will just prevent them from doing it immediately
				always = yes
			}
		}
	}

	give_offerings_sidhe = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			has_dlc = "The Old Gods"
			is_ruler = yes
			age = 16
			is_inaccessible_or_incapable_trigger = no
			religion_openly_in_celtic_subgroup_trigger = yes
			NOT = { has_religion_feature = religion_dogmatic }
			NOR = {
				has_character_modifier = sidhe_offerings_bad
				has_character_modifier = sidhe_offerings_neutral
				has_character_modifier = sidhe_offerings_good
				has_character_flag = sidhe_offerings_giving
			}
		}
		allow = {
			war = no
			any_demesne_title = {
				location = {
					any_province_holding = { is_occupied = no }
				}
			}
			trigger_if = {
				limit = { religion = britannic_pagan }
				any_courtier = { has_job_title = job_spiritual }
			}
			trigger_else = {
				OR = {
					any_vassal = { has_minor_title = title_court_druid }
					any_courtier = { has_minor_title = title_court_druid }
				}
			}
			scaled_wealth = { value = 0.3 min = 10 max = 500 }
		}
		effect = {
			custom_tooltip = {
				text = prepare_offerings
				scaled_wealth = { value = -0.15 min = -5 max = -250 }
				set_character_flag = sidhe_offerings_giving
				hidden_tooltip = {
					character_event = { id = celtic.248 }
				}
			}
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 1.0
				}
			}
			modifier = {
				factor = 0
				trait = cynical
			}
			modifier = {
				factor = 0
				trait = craven
			}
		}
	}

	abdicate_gaelic = {
		only_playable = yes
		potential = {
			is_ruler = yes
			prisoner = no
			has_character_modifier = unfit_gaelic_king
		}
		allow = {
			war = no
			any_demesne_title = {
				NOT = { higher_tier_than = count }
				is_occupied = no
			}
		}
		effect = {
			custom_tooltip = {
				text = gaelic_abdication
				any_vassal = {
					limit = { among_most_powerful_vassals = 5 }

					ROOT = {
						primary_title = {
							add_weak_claim = PREVPREV
						}
					}
				}
				abdicate = yes
			}
		}
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 3.0
				}
			}
			modifier = {
				factor = 0
				trait = cynical
			}
			modifier = {
				factor = 0
				trait = craven
			}
			modifier = {
				factor = 0
				trait = paranoid
			}
			modifier = {
				factor = 0
				trait = proud
			}
			modifier = {
				factor = 0
				trait = ambitious
			}
		}
	}
}