####TRAIT GROUP TRIGGERS####
#If you make changes, update the "Trait group triggers CK2" spreadsheet

#Agreeable
#has_benevolent_trait_trigger		Has a benevolent trait.
#is_benevolent_trigger				Has a benevolent trait and not any evil traits.
#has_pleasant_trait_trigger			Has a pleasant personality trait. 
#has_pleasant_personality_trigger	Has a pleasant personality trait and not any unpleasant personality traits.
#has_pious_trait_trigger			Has a piety trait.
#is_pious_trigger					Has a piety trait and not any impious traits.
#has_virtue_trigger					Has a virtue trait.

#Disagreeable
#has_evil_trait_trigger				Has an evil trait.
#is_evil_trigger					Has an evil trait and not any benevolent traits.
#has_unpleasant_trait_trigger		Has an unpleasant personality trait. 
#has_unpleasant_personality_trigger	Has an  unpleasant personality trait and not any pleasant personality traits.
#has_impious_trait_trigger			Has an impious trait.
#is_impious_trigger					Has a impious trait and not any piety traits.
#has_vice_trigger					Has a vice trait.

#Attractiveness
#has_attractive_trait_trigger		Has a sex appeal trait.
#is_attractive_trigger				Has a sex appeal trait and not any traits with negative sex appeal.
#has_unattractive_trait_trigger		Has a negative sex appeal trait.
#is_unattractive_trigger			Has a negative sex appeal trait and not any traits with sex appeal.
#has_fair_trait_trigger				Is Fair/Groomed.
#has_ugly_trait_trigger				Is Ugly/Uncouth.

#Health/congential
#is_smart_trigger					Has a smart trait.
#is_dumb_trigger					Has a dumb trait.
#is_strong_trigger					Has a strong trait.
#is_weak_trigger					Has a weak trait.
#well_treated_for_disease_trigger   Has a modifier relating to a positive treatement.
#poorly_treated_for_disease_trigger Has a modifier relating to a negative treatement.
#character_disease_trigger			Has a disease trait.
#has_symptom_trigger				Has a symptom trait.
#has_injury_trigger					Has an injury trait.
#is_maimed_trigger					Has a maimed trait
#has_severe_disability_trigger		Has a severe disability, which makes the characters life really hard.
#has_medium_disability_trigger		Has a medium disability, which limits the character to some extent but they can mostly live a full life.
#has_minor_disability_trigger		Has a minor disability, which does not limit the character in a physical sense, but is a source of ridicule and trauma.
#has_disability_trigger				Has a severe or light disability.
#has_mental_disorder_trigger		Has a mental disorder trait.
#has_fertile_trait_trigger			Has a fertile trait.
#is_fertile_trigger					Has a fertile trait and not any infertile traits.
#has_infertile_trait_trigger		Has an infertile trait.
#is_infertile_trigger				Has an infertile trait and not any fertile traits, OR is celibate OR is eunuch.
#has_negative_congenital_trigger	Has a negative congenital trait

#Diplomacy
#has_education_diplomacy_trigger	Has a diplomacy education trait.
#has_lifestyle_diplomacy_trigger	Has a diplomacy lifestyle trait.
#child_personality_diplomacy_triggerHas a child trait with diplomacy bonus.

#Martial
#has_education_martial_trigger		Has a martial education trait.
#has_lifestyle_martial_trigger		Has a martial lifestyle trait.
#child_personality_martial_trigger	Has a child trait with martial bonus.

#Stewardship
#has_education_stewardship_trigger	Has a stewardship education trait.
#has_lifestyle_stewardship_trigger	Has a stewardship  lifestyle trait.
#child_personality_stewardship_trigger	Has a child trait with stewardship bonus.

#Intrigue
#has_education_intrigue_trigger		Has a intrigue education trait.
#has_lifestyle_intrigue_trigger		Has a intrigue lifestyle trait.
#child_personality_intrigue_trigger	Has a child trait with intrigue bonus.

#Learning
#has_education_learning_trigger		Has a learning education trait.
#has_lifestyle_learning_trigger		Has a learning lifestyle trait.
#child_personality_learning_trigger	Has a child trait with learning bonus.
#is_learned_trigger					Has a scholarly trait, learning-oriented trait.

#has_any_lifestyle_trait			Has any of the above lifestyle traits.

#Religion
#has_crusade_trait_trigger			Has a crusade type trait.
#has_secret_religion_trait_trigger	Has a secret religion trait.

#is_mongol_empire_leader_trigger	If the Character is a Mongol emperor or its liege is

##AGREEABLE###

has_benevolent_trait_trigger = {
	OR = {
		trait = just
		trait = kind
		trait = charitable
		trait = patient
		trait = affectionate
	}
}

is_benevolent_trigger = {
	has_benevolent_trait_trigger = yes
	has_evil_trait_trigger = no
}

has_pleasant_trait_trigger = {
	OR = {
		trait = honest
		trait = gregarious
		trait = trusting
		trait = affectionate
		trait = playful
		trait = socializer
		trait = charitable
		trait = patient
		trait = kind
	}
}

has_pleasant_personality_trigger = {
	has_pleasant_trait_trigger = yes
	has_unpleasant_trait_trigger = no
}

has_pious_trait_trigger = {
	OR = {
		trait = theologian
		trait = celibate
		trait = chaste
		trait = humble
		trait = content
		trait = on_pilgrimage
		trait = pilgrim
		is_ascetic_trigger = yes
		trait = hajjaj
		trait = on_hajj
		trait = ashari
		trait = shieldmaiden
		trait = zealous
	}
}

is_pious_trigger = {
	has_pious_trait_trigger = yes
	has_impious_trait_trigger = no
}

has_virtue_trigger = {
	OR = {
		trait = chaste
		trait = temperate
		trait = charitable
		trait = diligent
		trait = patient
		trait = kind
		trait = humble
	}
}


##DISAGREEABLE##

has_evil_trait_trigger = {
	OR = {
		trait = arbitrary
		trait = cruel
		trait = impaler
	}
}

is_evil_trigger = {
	has_evil_trait_trigger = yes
	has_benevolent_trait_trigger = no
}

has_unpleasant_trait_trigger = {
	OR = {
		trait = deceitful
		trait = shy
		trait = paranoid
		trait = cruel
		trait = stubborn
		trait = haughty
		trait = brooding
		trait = impaler
		trait = greedy
		trait = wroth
		trait = envious
	}
}

has_unpleasant_personality_trigger = {
	has_unpleasant_trait_trigger = yes
	has_pleasant_trait_trigger = no
}

has_impious_trait_trigger = {
	OR = {
		trait = cynical
		trait = bad_priest_christian
		trait = bad_priest_muslim
		trait = bad_priest_norse
		trait = bad_priest_tengri
		trait = bad_priest_zoroastrian
		trait = bad_priest_aztec
		trait = hedonist
		trait = lustful
		trait = cannibal_trait
		trait = impaler
	}
}

is_impious_trigger = {
	has_impious_trait_trigger = yes
	has_pious_trait_trigger = no
}

has_vice_trigger = {
	OR = {
		trait = lustful
		trait = gluttonous
		trait = greedy
		trait = slothful
		trait = wroth
		trait = envious
		trait = proud
	}
}


##ATTRACTIVENESS##

has_attractive_trait_trigger = {
	OR = {
		trait = fair
		trait = groomed
		trait = just
		trait = brave
		trait = gregarious
		trait = seducer
		trait = seductress
		trait = robust
		trait = strong
		trait = socializer
	}
}

is_attractive_trigger = {
	has_attractive_trait_trigger = yes
	has_unattractive_trait_trigger = no
}

has_unattractive_trait_trigger = {
	OR = {
		trait = ugly
		trait = uncouth
		trait = feeble
		trait = dwarf
		trait = giant
		trait = clubfooted
		trait = harelip
		trait = hunchback
		trait = lisp
		trait = weak
		trait = lunatic
		trait = possessed
		trait = has_aztec_disease
		trait = syphilitic
		trait = leper
		trait = maimed
		trait = drunkard
		trait = gluttonous
		trait = craven
		trait = arbitrary
		trait = cruel
		trait = stubborn
		trait = blinded
		trait = horse
		trait = one_eyed
		trait = one_handed
		trait = one_legged
		trait = disfigured
		trait = mangled
		trait = severely_injured
		trait = flu
		trait = dysentery
		trait = food_poisoning
		trait = rabies
		trait = infection
		trait = rash
		trait = vomiting
		trait = diarrhea
		trait = cough
	}
}

is_unattractive_trigger = {
	has_unattractive_trait_trigger = yes
	has_attractive_trait_trigger = no
}


##HEALTH/CONGENTIAL##

is_smart_trigger = {
	OR = {
		trait = genius
		trait = quick
		trait = shrewd
	}
}

is_dumb_trigger = {
	OR = {
		trait = dull
		trait = slow
		trait = imbecile 
	}
}

is_strong_trigger = {
	OR = {
		trait = strong
		trait = robust
	}
}

is_weak_trigger = {
	OR = {
		trait = weak
		trait = feeble
	}
}

well_treated_for_disease_trigger = {
	OR = {
		has_character_modifier = mystic_treatment_decent
		has_character_modifier = symptom_treatment_1
		has_character_modifier = symptom_treatment_2
		has_character_modifier = symptom_treatment_3
		has_character_modifier = symptom_treatment_4	
		has_character_modifier = successful_treatment_1
		has_character_modifier = successful_treatment_2
		has_character_modifier = successful_treatment_3
	}	
}
poorly_treated_for_disease_trigger = {
	OR = {
		has_character_modifier = mystic_treatment_poor
		has_character_modifier = mystic_treatment_terrible
		has_character_modifier = failed_treatment_1
		has_character_modifier = failed_treatment_2
	}	
}

character_disease_trigger = {
	OR = {
		trait = has_tuberculosis
		trait = has_typhoid_fever
		trait = has_typhus
		trait = has_bubonic_plague
		trait = has_measles
		trait = has_small_pox
		trait = has_aztec_disease
		trait = syphilitic
		trait = flu
		trait = dysentery
		trait = gout
		trait = food_poisoning
		trait = rabies
		trait = cancer
		trait = pneumonic
	}
}

has_disease_trigger = {
	OR = {
		trait = has_tuberculosis
		trait = has_typhoid_fever
		trait = has_typhus
		trait = has_bubonic_plague
		trait = has_measles
		trait = has_small_pox
		trait = has_aztec_disease
		trait = syphilitic
		trait = flu
		trait = dysentery
		trait = gout
		trait = food_poisoning
		trait = rabies
		trait = cancer
		trait = pneumonic

		trait = dancing_plague
		trait = scurvy
		trait = ill
		trait = leper
		trait = lovers_pox
	}
}


has_symptom_trigger = {
	OR = {
		trait = infection
		trait = malaise
		trait = fatigue
		trait = abdominal_pain
		trait = headache
		trait = rash
		trait = cramps
		trait = chest_pain
		trait = vomiting
		trait = diarrhea
		trait = fever
		trait = cough
	}
}

has_minor_disease_trigger = {
	OR = {
		trait = malaise
		trait = fatigue
		trait = abdominal_pain
		trait = headache
		trait = rash
		trait = cramps
		trait = chest_pain
		trait = vomiting
		trait = diarrhea
		trait = fever
		trait = cough
		trait = ill
		trait = lovers_pox
		trait = flu
	}
}

has_injury_trigger = {
	OR = {
		trait = wounded
		trait = severely_injured
	}
}

is_maimed_trigger = {
	OR = {
		trait = maimed
		trait = one_eyed
		trait = one_handed 
		trait = one_legged 
		trait = disfigured 
		trait = mangled
	}
}

has_severe_disability_trigger = {
	OR = {
		trait = infirm
		trait = mangled
		trait = inbred
		trait = blinded
		trait = incapable
		trait = maimed
	}
}

has_medium_disability_trigger = {
	OR = {
		trait = one_legged
		trait = one_handed
		trait = one_eyed
		trait = clubfooted
		trait = hunchback
		trait = dwarf
		trait = giant
	}
}

has_minor_disability_trigger = {
	OR = {
		trait = disfigured
		trait = eunuch
		trait = harelip
		trait = stutter
		trait = lisp
	}
}

has_disability_trigger = {
	OR = {
		has_severe_disability_trigger = yes
		has_medium_disability_trigger = yes
		has_minor_disability_trigger = yes
	}
}

has_mental_disorder_trigger = {
	OR = {
		trait = stressed
		trait = depressed
		trait = lunatic
		trait = possessed
		trait = drunkard
	}
}

has_fertile_trait_trigger = {
	OR = {
		trait = underhanded_rogue
		trait = charismatic_negotiator
		trait = grey_eminence
		trait = thrifty_clerk
		trait = fortune_builder
		trait = midas_touched
		trait = strong
		trait = hedonist
		trait = lustful
		trait = dancing_plague
	}
}

is_fertile_trigger = {
	has_fertile_trait_trigger = yes
	has_infertile_trait_trigger = no
}

has_infertile_trait_trigger = {
	OR = {
		trait = homosexual
		trait = eunuch
		trait = scholarly_theologian
		trait = mastermind_theologian
		trait = stressed
		trait = depressed
		trait = ill
		trait = pneumonic
		trait = leper
		trait = syphilitic
		trait = has_aztec_disease
		trait = infirm
		trait = incapable
		trait = inbred
		trait = weak
		trait = celibate
		trait = chaste
		trait = mangled
		trait = severely_injured
		trait = dysentery
		trait = food_poisoning
		trait = cancer
	}
}

is_infertile_trigger = {
	OR = {
		AND = {
			has_infertile_trait_trigger = yes
			has_fertile_trait_trigger = no
		}
		trait = eunuch
		trait = celibate
	}
}


##DIPLOMACY##

has_education_diplomacy_trigger = {
	OR = {
		trait = naive_appeaser
		trait = underhanded_rogue
		trait = charismatic_negotiator
		trait = grey_eminence
	}
}

has_lifestyle_diplomacy_trigger = {
	OR = {
		trait = socializer
		trait = gamer
		trait = hedonist
	}
}

child_personality_diplomacy_trigger = {
	OR = {
		trait = affectionate
		trait = playful
	}
}


##MARTIAL##

has_education_martial_trigger = {
	custom_tooltip = {
		text = has_martial_education_tt
		OR = {
			trait = misguided_warrior
			trait = tough_soldier
			trait = skilled_tactician
			trait = brilliant_strategist
		}
	}
}

has_lifestyle_martial_trigger = {
	OR = {
		trait = duelist
		trait = hunter
		trait = strategist
	}
}

child_personality_martial_trigger = {
	OR = {
		trait = haughty
		trait = rowdy
	}
}


##STEWARDSHIP##

has_education_stewardship_trigger = {
	OR = {
		trait = indulgent_wastrel
		trait = thrifty_clerk
		trait = fortune_builder
		trait = midas_touched
	}
}

has_lifestyle_stewardship_trigger = {
	OR = {
		trait = administrator
		trait = architect
		trait = gardener
	}
}

child_personality_stewardship_trigger = {
	OR = {
		trait = conscientious
		trait = fussy
		trait = curious
	}
}


##INTRIGUE##

has_education_intrigue_trigger = {
	OR = {
		trait = amateurish_plotter
		trait = flamboyant_schemer
		trait = intricate_webweaver
		trait = elusive_shadow
	}
}

has_lifestyle_intrigue_trigger = {
	OR = {
		trait = schemer
		trait = impaler
		trait = seducer
		trait = seductress
	}
}

child_personality_intrigue_trigger = {
	OR = {
		trait = willful
		trait = brooding
		trait = indolent
	}
}


##LEARNING##

has_education_learning_trigger = {
	OR = {
		trait = detached_priest
		trait = martial_cleric
		trait = scholarly_theologian
		trait = mastermind_theologian
	}
}

has_lifestyle_learning_trigger = {
	OR = {
		trait = scholar
		trait = theologian
		trait = mystic
		trait = faqih
	}
}

child_personality_learning_trigger = {
	OR = {
		trait = timid
		trait = idolizer
	}
}

is_learned_trigger = {
	OR = {
		trait = erudite
		trait = scholar
		trait = scholarly_theologian
		trait = mastermind_theologian
		trait = physician
		trait = faqih
	}
}


has_any_lifestyle_trait = {
	OR = {
		has_lifestyle_diplomacy_trigger = yes
		has_lifestyle_martial_trigger = yes
		has_lifestyle_stewardship_trigger = yes
		has_lifestyle_intrigue_trigger = yes
		has_lifestyle_learning_trigger = yes
	}
}


##RELIGION##

has_crusade_trait_trigger = {
	OR = {
		AND = {
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
			trait = valhalla_bound
		}
		AND = {
			OR = {
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			}
			trait = tengri_warrior
		}
		AND = {
			OR = {
				religion = baltic_pagan
				religion = baltic_pagan_reformed
			}
			trait = romuvas_own
		}
		AND = {
			OR = {
				religion = finnish_pagan
				religion = finnish_pagan_reformed
			}
			trait = ukkos_shield
		}
		AND = {
			OR = {
				religion = aztec
				religion = aztec_reformed
			}
			trait = eagle_warrior
		}
		AND = {
			OR = {
				religion = slavic_pagan
				religion = slavic_pagan_reformed
			}
			trait = peruns_chosen
		}
		AND = {
			OR = {
				religion = west_african_pagan
				religion = west_african_pagan_reformed
			}
			trait = nyames_shield
		}
		AND = {
			OR = {
				religion = zun_pagan
				religion = zun_pagan_reformed
			}
			trait = sun_warrior
		}
		AND = {
			OR = {
				religion = hellenic_pagan
				religion = hellenic_pagan_reformed
			}
			trait = ares_own
		}
		AND = {
			religion_group = muslim
			trait = mujahid
		}
		AND = {
			religion_group = christian
			trait = crusader
		}
		AND = {
			religion_group = zoroastrian_group
			trait = gondi_shahansha
		}
		AND = {
			religion_group = jewish_group
			trait = shaddai
		}
	}
}

has_secret_religion_trait_trigger = {
	custom_tooltip = {
		text = no_secret_religion
		has_secret_religion = yes
	}
}

####MERC LEADER/COUNCIL JOB####

#Used with character interaction to replace merc leader. DO NOT REMOVE
can_be_mercenary_leader_potential_trigger = {
	prisoner = no
	is_ruler = no
	is_adult = yes
	
	NOR = { 
		trait = incapable
		is_inaccessible_trigger = yes
		is_ascetic_trigger = yes
	}
	same_realm = FROM
	OR = {
		is_female = no
		AND = {
			religion = cathar
			FROM = {
				religion = cathar
			}
		}
		AND = {
			religion = messalian
			FROM = {
				religion = messalian
			}
		}
		FROM = {
			OR = {
				has_law = true_cognatic_succession
				has_law = enatic_cognatic_succession
				has_law = enatic_succession
			}
		}
	}
}
#Used with character interaction to replace merc leader. DO NOT REMOVE
can_be_mercenary_leader_allow_trigger = {
	is_adult = yes
	liege = { character = FROM }
	custom_tooltip = {
		text = mercenary_martial_education_tooltip
		hidden_tooltip = {
			OR = {
				trait = misguided_warrior
				trait = tough_soldier
				trait = skilled_tactician
				trait = brilliant_strategist
			}
		}
	}
}

#Used with character interaction to replace merc leader. DO NOT REMOVE
replace_mercenary_captain_potential_trigger = {
	is_ruler = yes
	mercenary = yes
	primary_title = {
		has_title_flag = ze_dyn_merc
		band_creator = {
			character = FROM
		}
	}
}

#Used with character interaction to replace merc leader. DO NOT REMOVE
replace_mercenary_captain_allow_trigger = {
	primary_title = {
		NOT = { has_raised_standing_troops = yes }
		band_creator = {
			character = FROM
		}
	}
}

#Used with character interaction to swap council job. DO NOT REMOVE
change_council_job_potential_trigger = {
	liege = { character = FROM }
	NOT = {
		AND = {
			has_job_title = job_spiritual
			liege = { religion_group = muslim }
			religion = FROM
		}
	}
	OR = {
		AND = {
			OR = {
				has_minor_title = title_councilmember_king
				has_minor_title = title_councilmember_emperor
			}
			OR = {
				can_be_chancellor_trigger = yes
				can_be_marshal_trigger = yes
				can_be_treasurer_trigger = yes
				can_be_spymaster_trigger = yes
				AND = {
					can_be_spiritual_trigger = yes
					ROOT = { NOT = { religion_group = muslim } }
				}
			}
		}
		AND = {
			OR = {
				has_job_title = job_chancellor
				has_job_title = job_marshal
				has_job_title = job_treasurer
				has_job_title = job_spymaster
				has_job_title = job_spiritual
			}
			liege = {
				OR = {
					job_chancellor = {
						NOT = { character = ROOT }
						can_swap_job_title = ROOT
					}
					job_marshal = {
						NOT = { character = ROOT }
						can_swap_job_title = ROOT
					}
					job_treasurer = {
						NOT = { character = ROOT }
						can_swap_job_title = ROOT
					}
					job_spymaster = {
						NOT = { character = ROOT }
						can_swap_job_title = ROOT
					}
					job_spiritual = {
						NOT = { character = ROOT }
						can_swap_job_title = ROOT
					}
				}
			}
		}
	}
}

can_be_chancellor_trigger = {
	OR = {
		AND = {
			OR = {
				AND = { #Patriarchal religions can only hire males. Matriarchal religions can only hire females.
					is_female = no 
					NOT = { liege = { has_religion_feature = religion_matriarchal } } 
				}
				AND = {
					is_female = yes 
					OR = { 
						liege = { has_religion_feature = religion_matriarchal } 
						liege = { has_religion_feature = religion_equal } 
						liege = { has_religion_feature = religion_feature_bon } 
					} 
				}
				trait = horse # So we can have female glitterhoofs! :D
				AND = {
					religion = cathar
					liege = { religion = cathar }
				}
				AND = {
					religion = messalian
					liege = { religion = messalian }
				}
				AND = {
					liege = {
						primary_title = {
							OR = {
								has_law = status_of_women_2
								has_law = status_of_women_3
							}
						}
					}
					OR = {
						liege = {
							OR = {
								dynasty = ROOT
								is_close_relative = ROOT
								any_spouse = { character = ROOT }
								any_consort = { character = ROOT }
							}
						}
						is_landed = yes
						trait = nun
						
					}
				}
				OR = {
					AND = { 
						is_female = yes
						liege = { primary_title = { has_law = status_of_women_4 } } 
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
			is_adult = yes
		}
		has_character_flag = special_chancellor
	}
	
	independent = no
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = in_hiding }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { 
		liege = { 
			has_opinion_modifier = {
				who = ROOT	
				modifier = opinion_resigned_from_council 
			} 
		} 
	}
}

can_be_marshal_trigger = {
	OR = {
		AND = {
			OR = {
				AND = { #Patriarchal religions can only hire males. Matriarchal religions can only hire females.
					is_female = no 
					NOT = { liege = { has_religion_feature = religion_matriarchal } } 
				}
				AND = {
					is_female = yes 
					OR = { 
						liege = { has_religion_feature = religion_matriarchal } 
						liege = { has_religion_feature = religion_equal } 
						liege = { has_religion_feature = religion_feature_bon } 
					} 
				}
				trait = horse # So we can have female glitterhoofs! :D
				OR = {
					AND = {
						religion = cathar
						liege = { religion = cathar }
					}
					AND = {
						religion = messalian
						liege = { religion = messalian }
					}
				}
				AND = {
					liege = {
						primary_title = {
							OR = {
								has_law = status_of_women_3
							}
						}
					}
					OR = {
						liege = {
							OR = {
								dynasty = ROOT
								is_close_relative = ROOT
								any_spouse = { character = ROOT }
								any_consort = { character = ROOT }
							}
						}
						is_landed = yes
						
					}
				}
				OR = {
					AND = { 
						is_female = yes
						liege = { primary_title = { has_law = status_of_women_4 } } 
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
			OR = {
				NOT = { religion = hindu }
				trait = kshatriya
			}
			is_adult = yes
		}
		has_character_flag = special_marshal
	}
	
	independent = no
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = in_hiding }
	NOT = { has_character_flag = guru }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { 
		liege = { 
			has_opinion_modifier = {
				who = ROOT	
				modifier = opinion_resigned_from_council 
			} 
		} 
	}
}

can_be_treasurer_trigger = {
	OR = {
		AND = {
			OR = {
				AND = { #Patriarchal religions can only hire males. Matriarchal religions can only hire females.
					is_female = no 
					NOT = { liege = { has_religion_feature = religion_matriarchal } } 
				}
				AND = {
					is_female = yes 
					OR = { 
						liege = { has_religion_feature = religion_matriarchal } 
						liege = { has_religion_feature = religion_equal } 
						liege = { has_religion_feature = religion_feature_bon } 
					} 
				}
				trait = horse # So we can have female glitterhoofs! :D
				AND = {
					religion = cathar
					liege = { religion = cathar }
				}
				AND = {
					religion = messalian
					liege = { religion = messalian }
				}
				AND = {
					liege = {
						primary_title = {
							OR = {
								has_law = status_of_women_2
								has_law = status_of_women_3
							}
						}
					}
					OR = {
						liege = {
							OR = {
								dynasty = ROOT
								is_close_relative = ROOT
								any_spouse = { character = ROOT }
								any_consort = { character = ROOT }
							}
						}
						is_landed = yes
						trait = nun
						
					}
				}
				OR = {
					AND = { 
						is_female = yes
						liege = { primary_title = { has_law = status_of_women_4 } } 
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
			is_adult = yes
		}
		has_character_flag = special_treasurer
	}
	
	independent = no
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = in_hiding }
	NOT = { has_character_flag = guru }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { 
		liege = { 
			has_opinion_modifier = {
				who = ROOT	
				modifier = opinion_resigned_from_council 
			} 
		} 
	}
}

can_be_spymaster_trigger = {
	OR = {
		AND = {
			OR = {
				AND = { #Patriarchal religions can only hire males. Matriarchal religions can only hire females.
					is_female = no 
					NOT = { liege = { has_religion_feature = religion_matriarchal } } 
				}
				AND = {
					is_female = yes 
					OR = { 
						liege = { has_religion_feature = religion_matriarchal } 
						liege = { has_religion_feature = religion_equal } 
						liege = { has_religion_feature = religion_feature_bon } 
					} 
				}
				trait = horse # So we can have female glitterhoofs! :D
				liege = { 
					NOR = {
						liege = { has_religion_feature = religion_matriarchal } 
						liege = { has_religion_feature = religion_patriarchal } 
					}
					OR = {
						mother = { character = ROOT }
						any_spouse = { character = ROOT }
					}
				}
				AND = {
					religion_group = pagan_group
					liege = {
						religion_group = pagan_group
						NOR = {
							liege = { has_religion_feature = religion_matriarchal } 
							liege = { has_religion_feature = religion_patriarchal } 
						}
					}
				}
				AND = {
					religion = cathar
					liege = { 
						religion = cathar 
						NOR = {
							liege = { has_religion_feature = religion_matriarchal } 
							liege = { has_religion_feature = religion_patriarchal } 
						}
					}
				}
				AND = {
					religion = messalian
					liege = { 
						religion = messalian 
						NOR = {
							liege = { has_religion_feature = religion_matriarchal } 
							liege = { has_religion_feature = religion_patriarchal } 
						}
					}
				}
				AND = {
					liege = {
						primary_title = {
							OR = {
								has_law = status_of_women_1
								has_law = status_of_women_2
								has_law = status_of_women_3
							}
						}
					}
					OR = {
						liege = {
							OR = {
								dynasty = ROOT
								is_close_relative = ROOT
								any_spouse = { character = ROOT }
								any_consort = { character = ROOT }
							}
						}
						is_landed = yes
						trait = nun
						
					}
				}
				OR = {
					AND = { 
						is_female = yes
						liege = { primary_title = { has_law = status_of_women_4 } } 
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
			is_adult = yes
		}
		has_character_flag = special_spymaster
	}
	
	independent = no
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = in_hiding }
	NOT = { has_character_flag = guru }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { 
		liege = { 
			has_opinion_modifier = {
				who = ROOT	
				modifier = opinion_resigned_from_council 
			} 
		} 
	}
}

can_be_spiritual_trigger = {
	independent = no
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = in_hiding }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { 
		liege = { 
			has_opinion_modifier = {
				who = ROOT	
				modifier = opinion_resigned_from_council 
			} 
		} 
	}

	liege = {
		religion = ROOT
	}
	OR = {
		AND = {
			is_adult = yes
			OR = {
				is_female = no
				religion_allows_female_temple_holders = yes
				has_religion_feature = religion_matriarchal
			}
			OR = {
				is_female = yes
				religion_allows_male_temple_holders = yes
				has_religion_feature = religion_patriarchal
			}
			OR = {
				NOT = { religion = hindu }
				trait = brahmin
				is_ascetic_trigger = yes
			}
		}
		has_character_flag = special_spiritual
	}
	
	OR = {
		is_theocracy = yes
		AND = {
			liege = { is_tribal = yes }
			is_ruler = no
		}
		liege = { religion_group = muslim }
		AND = {
			clan = yes
			liege = {
				is_nomadic = yes
			}
		}
		AND = {
			has_autocephaly = no
			is_ruler = no
		}
		AND = {
			has_autocephaly = yes
			is_ruler = no
			NOT = {
				any_vassal = { is_theocracy = yes }
			}
		}
	}
	
	OR = {
		NOT = { religion_group = muslim }
		NOT = { liege = { religion_group = muslim } }
		trait = detached_priest
		trait = martial_cleric
		trait = scholarly_theologian
		trait = mastermind_theologian
		has_character_flag = special_spiritual
	}
}

can_be_councilmember_king_trigger = {
	independent = no
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = in_hiding }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { 
		liege = { 
			has_opinion_modifier = {
				modifier = opinion_resigned_from_council 
				who = ROOT
			}
		} 
	}
	AND = {
		OR = {
			AND = { #Patriarchal religions can only hire males. Matriarchal religions can only hire females.
				is_female = no 
				NOT = { liege = { has_religion_feature = religion_matriarchal } } 
			}
			AND = {
				is_female = yes 
				NOT = { liege = { has_religion_feature = religion_patriarchal } } 
			}
			AND = {
				OR = {
					religion = cathar
					religion = messalian
				}
				liege = { religion = ROOT }
			}
			AND = {
				is_female = yes
				liege = {
					primary_title = {
						OR = {
							has_law = status_of_women_1
							has_law = status_of_women_2
							has_law = status_of_women_3
						}
					}
				}
				is_landed = yes
			}
			OR = {
				AND = { 
					is_female = yes
					liege = { primary_title = { has_law = status_of_women_4 } } 
				}
				has_game_rule = {
					name = gender
					value = all
				}
			}
		}
		is_adult = yes
	}
}

can_be_councilmember_emperor_trigger = {
	independent = no
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = in_hiding }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { 
		liege = { 
			has_opinion_modifier = {
				who = ROOT	
				modifier = opinion_resigned_from_council 
			} 
		} 
	}
	OR = {
		AND = {
			OR = {
				AND = { #Patriarchal religions can only hire males. Matriarchal religions can only hire females.
					is_female = no 
					NOT = { liege = { has_religion_feature = religion_matriarchal } } 
				}
				AND = {
					is_female = yes 
					OR = { 
						liege = { has_religion_feature = religion_matriarchal } 
						liege = { has_religion_feature = religion_equal } 
						liege = { has_religion_feature = religion_feature_bon } 
					} 
				}
				AND = {
					religion = cathar
					liege = { religion = cathar }
				}
				AND = {
					religion = messalian
					liege = { religion = messalian }
				}
				AND = {
					is_female = yes
					liege = {
						primary_title = {
							OR = {
								has_law = status_of_women_1
								has_law = status_of_women_2
								has_law = status_of_women_3
							}
						}
					}
					is_landed = yes
				}
				OR = {
					AND = { 
						is_female = yes
						liege = { primary_title = { has_law = status_of_women_4 } } 
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
			is_adult = yes
		}
	}
}

###REAPER'S DUE####

can_be_maimed_trigger = {
	OR = {
		AND = {
			NOT = { has_dlc = "Reapers" }
			NOT = { trait = maimed }
		}
		AND = {
			has_dlc = "Reapers"
			NOT = {
				trait = one_eyed
				trait = one_handed 
				trait = one_legged 
				trait = disfigured 
				trait = mangled
			}
		}
	}
}

physician_bad_trigger = { 
	OR = {
		has_severe_disability_trigger = yes
		has_mental_disorder_trigger = yes
	}
}

physician_good_trigger = { 
	OR = {
		is_learned_trigger = yes
		religion_group = jewish_group
	} 
}

is_inaccessible_trigger = { #Remember to write this "is_inaccessible_trigger = no" when scripting, or the tooltip will be messed up (it reads "Is NOT in Hiding, in Seclusion, or out traveling")
	custom_tooltip = {
		text = is_inaccessible_tooltip
		hidden_tooltip = {
			OR = {
				has_character_flag = flag_holding_great_tribal_festival
				trait = in_hiding
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				trait = travelling
				trait = troubled_pregnancy
				trait = pregnancy_finishing
				has_character_modifier = mother_minor_rest
				has_character_modifier = in_seclusion
				has_character_modifier = in_meditation
				has_character_modifier = doing_penance
				has_character_modifier = out_traveling
			}
		}
	}
}

prefers_men_trigger = {
	OR = {
		AND = {
			is_female = yes
			NOT = { trait = homosexual }
		}
		AND = {
			is_female = no
			trait = homosexual
		}
	}
}

root_attraction_trigger = {
	#Returns yes when ROOT is attracted to the scoped character, based on sex
	OR = {
		AND = {
			is_female = yes
			ROOT = { prefers_men_trigger = no }
		}
		AND = {
			is_female = no
			ROOT = { prefers_men_trigger = yes }
		}
	}
}

prev_attraction_trigger = {
	#Returns yes when PREV is attracted to the scoped character, based on sex
	OR = {
		AND = {
			is_female = yes
			PREV = { prefers_men_trigger = no }
		}
		AND = {
			is_female = no
			PREV = { prefers_men_trigger = yes }
		}
	}
}

attacted_to_root_trigger = {
	#Returns yes when scoped character is attracted to ROOT, based on sex
	OR = {
		AND = {
			ROOT = { is_female = yes }
			prefers_men_trigger = no
		}
		AND = {
			ROOT = { is_female = no }
			prefers_men_trigger = yes
		}
	}
}

attacted_to_prev_trigger = {
	OR = {
		AND = {
			PREV = { is_female = yes }
			prefers_men_trigger = no
		}
		AND = {
			PREV = { is_female = no }
			prefers_men_trigger = yes
		}
	}
}

is_unimportant_trigger = {
	NOR = {
		is_married = yes
		is_landed = yes
		has_job_title = yes
		has_minor_title = yes
		AND = {
			NOT = { dynasty = none }
			num_of_dynasty_members = 2
		}
		any_lover = { ai = no }
		any_close_relative = { ai = no }
		any_friend = { ai = no }
		any_rival = { ai = no }
		any_consort = { ai = no }
		num_of_claims = 1
		has_character_flag = eternal_life_mystic
		trait = horse
		has_character_modifier = in_seclusion
		has_character_modifier = elder_long_life_modifier
		immortal = yes
	}
}

sad_example_trigger = {
	age = 30
	is_married = no
	NOT = { num_of_children = 1 }
}

has_epidemic_disease_trigger = {
	OR = {
		trait = has_tuberculosis
		trait = has_typhoid_fever
		trait = has_typhus
		trait = has_bubonic_plague
		trait = has_measles
		trait = has_small_pox
		trait = has_aztec_disease
	}
}

developing_epidemic_disease_trigger = {
	OR = {
		has_character_flag = got_tuberculosis
		has_character_flag = got_typhoid_fever
		has_character_flag = got_typhus
		has_character_flag = got_bubonic_plague
		has_character_flag = got_measles
		has_character_flag = got_small_pox
		has_character_flag = got_aztec_disease
	}
}

can_be_prophet_of_doom_trigger = {
	is_adult = yes
	is_married = no
	trait = zealous
	is_landed = no
	
	OR = {
		trait = ambitious
		trait = misguided_warrior
		trait = elusive_shadow
		trait = lunatic
		trait = possessed
		trait = paranoid
		trait = stubborn
	}
	NOR = {
		trait = content
		trait = cynical
		trait = temperate
		is_main_spouse = yes
		is_landed = yes
		is_close_relative = ROOT
	}
	ai = yes
}

death_murder_trigger = {
	OR = {
		death_murder_unknown_trigger = yes
		death_murder_known_trigger = yes
	}
	
}

death_murder_unknown_trigger = {
	OR = {
		death_reason = death_murder_unknown
		death_reason = death_murder_unknown_poison
		death_reason = death_murder_unknown_fall
		death_reason = death_murder_unknown_arrow
		death_reason = death_murder_unknown_beheading
		death_reason = death_murder_unknown_snakes
		death_reason = death_murder_unknown_strangle
		death_reason = death_murder_unknown_hashashin
		death_reason = death_murder_unknown_fear
		death_reason = death_murder_unknown_lightning
		death_reason = death_murder_unknown_combustion
		death_reason = death_murder_unknown_crows
		death_reason = death_murder_unknown_possessed_fall
	}	
}

death_murder_known_trigger = {
	OR = {
		death_reason = death_murder
		death_reason = death_murder_poison
		death_reason = death_murder_fall
		death_reason = death_murder_drowning
		death_reason = death_murder_butchered
		death_reason = death_murder_arrow
		death_reason = death_murder_beheading
		death_reason = death_murder_snakes
		death_reason = death_murder_strangle
		death_reason = death_murder_hashashin
	}	
}

death_execution_trigger = {
	OR = {
		death_reason = death_execution
		death_reason = death_execution_crushing
		death_reason = death_execution_ash
		death_reason = death_execution_burning
		death_reason = death_execution_hdq
		death_reason = death_execution_bear
		death_reason = death_execution_lion
		death_reason = death_execution_snake_pit
		death_reason = death_execution_disembowelment
		death_reason = death_execution_boiling
		death_reason = death_execution_sawing
		death_reason = death_execution_hunt
		death_reason = death_execution_live_burial
		death_reason = death_execution_hanging
		death_reason = death_execution_immurement
		death_reason = death_execution_beheading
		death_reason = death_execution_wine
		death_reason = death_execution_poison
		death_reason = death_execution_flaying
		death_reason = death_execution_impaling
		death_reason = death_execution_tiger
		death_reason = death_execution_elephants
		death_reason = death_execution_bamboo
		death_reason = death_execution_stoning
		death_reason = death_execution_crucifixion
		death_reason = death_execution_blood_eagle
		death_reason = death_execution_scaphism
		death_reason = death_execution_drowning_pit
		death_reason = death_execution_garrotting
		death_reason = death_execution_horses
		death_reason = death_execution_back_breaking
		death_reason = death_execution_wheel
		death_reason = death_execution_boar
		death_reason = death_execution_eaten
		death_reason = death_execution_aztec_sacrifice
		death_reason = death_executed_by_chinese_emperor
		death_reason = death_execution_brazen_bull
		death_reason = death_execution_macabre_banquet
	}	
}

death_sacrificed_trigger = {
	OR = {
		death_reason = death_sacrificed
		death_reason = death_sacrificed_norse
		death_reason = death_sacrificed_ancestors
		death_reason = death_execution_aztec_sacrifice
	}	
}

death_accident_trigger = {
	OR = {
		death_reason = death_accident
		death_reason = death_accident_generic_beast
		death_reason = death_accident_bear
		death_reason = death_accident_boar
		death_reason = death_accident_drowning
		death_reason = death_accident_arrow
		death_reason = death_accident_tiger
		death_reason = death_accident_snakes
		death_reason = death_accident_fall
	}
}

death_suicide_trigger = {
	OR = {
		death_reason = death_suicide
		death_reason = death_suicide_fall
		death_reason = death_suicide_hanging
		death_reason = death_suicide_poison
	}
}

# Very usable! If poorly named
block_general_event_trigger = {
	OR = {	
		is_adult = no
		trait = incapable
		prisoner = yes
		is_inaccessible_trigger = yes
		hidden_trigger = { is_alive = no }
	}
}

gender_equality_trigger = {
	OR = {
		religion = cathar
		religion = messalian
		has_religion_feature = religion_equal
		has_religion_feature = religion_feature_bon
		AND = {
			is_landed = yes
			primary_title = { 
				has_law = status_of_women_4 
			}
		}
		AND = {
			is_landed = no
			liege = { primary_title = { has_law = status_of_women_4 } }
		}
		has_game_rule = {
			name = gender
			value = all
		}
	}
}

male_can_hold_minor_title_trigger = {
	trigger_if = {
		limit = {
			NOT = {
				has_game_rule = {
					name = gender
					value = all
				}
			}
		}
		is_female = no
		custom_tooltip = {
			text = tooltip_not_matriarchal_liege_religion_feature
			NOR = {
				has_religion_feature = religion_matriarchal
				liege = {
					has_religion_feature = religion_matriarchal
				}
			}
		}
	}
}

female_can_hold_minor_title_trigger = {
	trigger_if = {
		limit = {
			NOT = {
				has_game_rule = {
					name = gender
					value = all
				}
			}
		}
		is_female = yes
		OR = {
			custom_tooltip = {
				text = tooltip_feminist_liege_vanilla_religion
				AND = {
					OR = {
						religion = cathar
						religion = messalian
						religion = bogomilist
						religion = mazdaki
					}
					liege = { religion = ROOT }
				}
			}
			custom_tooltip = {
				text = tooltip_feminist_liege_religion_feature
				AND = {
					OR = {
						has_religion_feature = religion_equal
						has_religion_feature = religion_matriarchal
					}
					liege = {
						has_religion_feature = religion_equal
						has_religion_feature = religion_matriarchal
					}
				}
			}
			primary_title = {
				OR = {
					has_law = status_of_women_4 
					has_law = status_of_women_3 
				}
			}
			liege = {
				primary_title = {
					OR = {
						has_law = status_of_women_4
						has_law = status_of_women_3
					}
				}
			}
		}
	}
}

female_can_hold_minor_commander_title_trigger = {
	trigger_if = {
		limit = {
			NOT = {
				has_game_rule = {
					name = gender
					value = all
				}
			}
		}
		is_female = yes
		OR = {
			has_character_flag = special_marshal
			AND = {
				trait = shieldmaiden
				liege = { religion = ROOT }
			}
			AND = {
				is_member_of_any_warrior_lodge_trigger = yes
				liege = { religion = ROOT }
			}
			custom_tooltip = {
				text = tooltip_feminist_liege_vanilla_religion
				AND = {
					OR = {
						religion = cathar
						religion = messalian
						religion = bogomilist
						religion = mazdaki
					}
					liege = { religion = ROOT }
				}
			}
			custom_tooltip = {
				text = tooltip_feminist_liege_religion_feature
				AND = {
					OR = {
						has_religion_feature = religion_equal
						has_religion_feature = religion_matriarchal
					}
					liege = {
						has_religion_feature = religion_equal
						has_religion_feature = religion_matriarchal
					}
				}
			}
			primary_title = {
				has_law = status_of_women_4 
			}
			liege = {
				primary_title = {
					has_law = status_of_women_4
				}
			}
		}
	}
}

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

#Has same education as prev?
has_prev_education_trigger = {
	OR = {
		AND = {
			has_education_martial_trigger = yes
			PREV = { has_education_martial_trigger = yes }
		}
		AND = {
			has_education_diplomacy_trigger = yes
			PREV = { has_education_diplomacy_trigger = yes }
		}
		AND = {
			has_education_stewardship_trigger = yes
			PREV = { has_education_stewardship_trigger = yes }
		}
		AND = {
			has_education_intrigue_trigger = yes
			PREV = { has_education_intrigue_trigger = yes }
		}
		AND = {
			has_education_learning_trigger = yes
			PREV = { has_education_learning_trigger = yes }
		}
	}
}

useless_character_trigger = {
	OR = {
		NOT = { health = 2.5 }
		trait = lunatic
		trait = maimed
		trait = infirm
		trait = incapable
		trait = mangled
		trait = severely_injured
		trait = imbecile
		trait = inbred
	}
}

#True religion triggers
true_religion_catholic_trigger = {
	true_religion = catholic
}

true_religion_cathar_trigger = {
	true_religion = cathar
}

true_religion_fraticelli_trigger = {
	true_religion = fraticelli
}

true_religion_waldensian_trigger = {
	true_religion = waldensian
}

true_religion_lollard_trigger = {
	true_religion = lollard
}

true_religion_orthodox_trigger = {
	true_religion = orthodox
}

true_religion_bogomilist_trigger = {
	true_religion = bogomilist
}

true_religion_monothelite_trigger = {
	true_religion = monothelite
}

true_religion_iconoclast_trigger = {
	true_religion = iconoclast
}

true_religion_paulician_trigger = {
	true_religion = paulician
}

true_religion_miaphysite_trigger = {
	true_religion = miaphysite
}

true_religion_monophysite_trigger = {
	true_religion = monophysite
}

true_religion_nestorian_trigger = {
	true_religion = nestorian
}

true_religion_messalian_trigger = {
	true_religion = messalian
}

true_religion_sunni_trigger = {
	true_religion = sunni
}

true_religion_zikri_trigger = {
	true_religion = zikri
}

true_religion_yazidi_trigger = {
	true_religion = yazidi
}

true_religion_shiite_trigger = {
	true_religion = shiite
}

true_religion_druze_trigger = {
	true_religion = druze
}

true_religion_hurufi_trigger = {
	true_religion = hurufi
}

true_religion_ibadi_trigger = {
	true_religion = ibadi
}

true_religion_kharijite_trigger = {
	true_religion = kharijite
}

true_religion_jewish_trigger = {
	true_religion = jewish
}

true_religion_samaritan_trigger = {
	true_religion = samaritan
}

true_religion_karaite_trigger = {
	true_religion = karaite
}

true_religion_zoroastrian_trigger = {
	true_religion = zoroastrian
}

true_religion_mazdaki_trigger = {
	true_religion = mazdaki
}

true_religion_manichean_trigger = {
	true_religion = manichean
}

true_religion_khurmazta_trigger = {
	true_religion = khurmazta
}

true_religion_bon_trigger = {
	true_religion = bon
}
true_religion_bon_reformed_trigger = {
	true_religion = bon_reformed
}

true_religion_taoist_trigger = {
	true_religion = taoist
}

true_religion_hindu_trigger = {
	true_religion = hindu
}

true_religion_buddhist_trigger = {
	true_religion = buddhist
}

true_religion_jain_trigger = {
	true_religion = jain
}

true_religion_norse_pagan_trigger = {
	true_religion = norse_pagan
}

true_religion_norse_pagan_reformed_trigger = {
	true_religion = norse_pagan_reformed
}

true_religion_baltic_pagan_trigger = {
	true_religion = baltic_pagan
}

true_religion_baltic_pagan_reformed_trigger = {
	true_religion = baltic_pagan_reformed
}

true_religion_finnish_pagan_trigger = {
	true_religion = finnish_pagan
}

true_religion_finnish_pagan_reformed_trigger = {
	true_religion = finnish_pagan_reformed
}

true_religion_slavic_pagan_trigger = {
	true_religion = slavic_pagan
}

true_religion_slavic_pagan_reformed_trigger = {
	true_religion = slavic_pagan_reformed
}

true_religion_tengri_pagan_trigger = {
	true_religion = tengri_pagan
}

true_religion_tengri_pagan_reformed_trigger = {
	true_religion = tengri_pagan_reformed
}

true_religion_aztec_trigger = {
	true_religion = aztec
}

true_religion_aztec_reformed_trigger = {
	true_religion = aztec_reformed
}

true_religion_west_african_pagan_trigger = {
	true_religion = west_african_pagan
}

true_religion_west_african_pagan_reformed_trigger = {
	true_religion = west_african_pagan_reformed
}

true_religion_zun_pagan_trigger = {
	true_religion = zun_pagan
}

true_religion_zun_pagan_reformed_trigger = {
	true_religion = zun_pagan_reformed
}

true_religion_hellenic_pagan_trigger = {
	true_religion = hellenic_pagan
}

true_religion_hellenic_pagan_reformed_trigger = {
	true_religion = hellenic_pagan_reformed
}

true_religion_pagan_trigger = {
	true_religion = pagan
}

true_religion_group_christian_trigger = {
	true_religion_group = christian
}

true_religion_group_muslim_trigger = {
	true_religion_group = muslim
}

true_religion_group_jewish_group_trigger = {
	true_religion_group = jewish_group
}

true_religion_group_zoroastrian_group_trigger = {
	true_religion_group = zoroastrian_group
}

true_religion_group_indian_group_trigger = {
	true_religion_group = indian_group
}

true_religion_group_pagan_group_trigger = {
	true_religion_group = pagan_group
}

relationship_with_root_trigger = {
	OR = {
		is_lover = ROOT
		is_friend = ROOT
		is_rival = ROOT
	}
}

is_widow_or_widower_trigger = {
	is_married = no
	any_spouse_even_if_dead = {
		always = yes
	}
}

FROMs_religion_is_playable_trigger = {
	hidden_tooltip = {
		NOR = {
			AND = { #Means you're not allowed to play Muslims
				FROM = { religion_group = muslim }
				NOT = { has_dlc = "The Sword of Islam" }
			}
			AND = { #Means you're not allowed to play Jewish
				FROM = { religion_group = jewish_group }
				NOT = { has_dlc = "Sons of Abraham" }
			}
			AND = { #Means you're not allowed to play (most) Pagans
				FROM = {
					religion_group = pagan_group
					NOT = { religion = bon }
					NOT = { religion = bon_reformed }
				}
				NOT = { has_dlc = "The Old Gods" }
			}
			AND = { #Means you're not allowed to play the Bön religion (Pagan)
				FROM = { 
					OR = { 
						religion = bon
						religion = bon_reformed
					}
				}
				NOR = {
					has_dlc = "The Old Gods"
					has_dlc = "Jade Dragon"
				}
			}
			AND = { #Means you're not allowed to play the Eastern Religions
				FROM = { religion_group = indian_group }
				NOT = { 
					FROM = { 
						religion = taoist
					} 
				}
				NOT = {	has_dlc = "Rajas of India" }
			}
			AND = { #Means you're not allowed to play the Zoroastrians
				FROM = { religion_group = zoroastrian_group }
				NOT = { has_dlc = "The Old Gods" }
			}
			AND = { #Means you're not allowed to play the Taoist religion 
				FROM = { religion = taoist }
				NOR = { 
					has_dlc = "Jade Dragon"
					has_dlc = "Rajas of India"
				}
			}
		}
	}
	trigger_if = {
		limit = {
			FROM = { religion_group  = jewish_group }
			NOT = { has_dlc = "Sons of Abraham" }
		}
		AND = {
			religion_group  = jewish_group
			has_dlc = "Sons of Abraham"
		}
	}
	trigger_if = {
		limit = {
			FROM = { religion_group  = muslim }
			NOT = { has_dlc = "The Sword of Islam" }
		}
		AND = {
			religion_group  = muslim
			has_dlc = "The Sword of Islam" 
		}
	}
	trigger_if = {
		limit = {
			FROM = { religion_group  = indian_group }
			NOT = { has_dlc = "Rajas of India" }
		}
		AND = {
			religion_group  = indian_group
			has_dlc = "Rajas of India" 
		}
	}
	trigger_if = {
		limit = {
			FROM = { 
				OR = {
					religion = taoist
					religion = bon
					religion = bon_reformed
					religion = khurmazta 
				}
			}
			NOT = { has_dlc = "Jade Dragon" }
		}
		AND = {
			OR = {
				religion = taoist
				religion = bon 
				#reformed bön prints out as 'bön' and there's no need to display 'bön' twice in the tooltip
				religion = khurmazta 
			}
			has_dlc = "Jade Dragon" 
		}
	}
	trigger_if = {
		limit = {
			FROM = { religion_group  = pagan_group }
			NOR = { 
				has_dlc = "The Old Gods" 
				has_dlc = "Holy Fury"
			}
		}
		AND = {
			religion_group = pagan_group
			OR = {
				has_dlc = "The Old Gods" 
				has_dlc = "Holy Fury" 
			}
		}
	}
}

ROOTs_religion_is_playable_trigger = { #For targeted decision where FROM is the player
	hidden_tooltip = {
		NOR = {
			AND = { #Means you're not allowed to play Muslims
				ROOT = { religion_group = muslim }
				NOT = { has_dlc = "The Sword of Islam" }
			}
			AND = { #Means you're not allowed to play Jewish
				ROOT = { religion_group = jewish_group }
				NOT = { has_dlc = "Sons of Abraham" }
			}
			AND = { #Means you're not allowed to play (most) Pagans
				ROOT = {
					religion_group = pagan_group
					NOT = { religion = bon }
					NOT = { religion = bon_reformed }
				}
				NOT = { has_dlc = "The Old Gods" }
			}
			AND = { #Means you're not allowed to play the Bön religion (Pagan)
				ROOT = { 
					OR = { 
						religion = bon 
						religion = bon_reformed
					} 
				}
				NOR = {
					has_dlc = "The Old Gods"
					has_dlc = "Jade Dragon"
				}
			}
			AND = { #Means you're not allowed to play the Eastern Religions
				ROOT = { religion_group = indian_group }
				NOT = { 
					ROOT = { 
						religion = taoist
					} 
				}
				NOT = {	has_dlc = "Rajas of India" }
			}
			AND = { #Means you're not allowed to play the Zoroastrians
				ROOT = { religion_group = zoroastrian_group }
				NOT = { has_dlc = "The Old Gods" }
			}
			AND = { #Means you're not allowed to play the Taoist religion 
				ROOT = { religion = taoist }
				NOR = { 
					has_dlc = "Jade Dragon"
					has_dlc = "Rajas of India"
				}
			}
		}
	}
	trigger_if = {
		limit = {
			religion_group  = jewish_group
			NOT = { has_dlc = "Sons of Abraham" }
		}
		AND = {
			religion_group  = jewish_group
			has_dlc = "Sons of Abraham"
		}
	}
	trigger_if = {
		limit = {
			religion_group  = muslim
			NOT = { has_dlc = "The Sword of Islam" }
		}
		AND = {
			religion_group  = muslim
			has_dlc = "The Sword of Islam" 
		}
	}
	trigger_if = {
		limit = {
			religion_group  = indian_group
			NOT = { has_dlc = "Rajas of India" }
		}
		AND = {
			religion_group  = indian_group
			has_dlc = "Rajas of India" 
		}
	}
	trigger_if = {
		limit = {
			OR = {
				religion = taoist
				religion = bon
				religion = bon_reformed
				religion = khurmazta 
			}
			NOT = { has_dlc = "Jade Dragon" }
		}
		AND = {
			OR = {
				religion = taoist
				religion = bon 
				#reformed bön prints out as 'bön' and there's no need to display 'bön' twice in the tooltip
				religion = khurmazta 
			}
			has_dlc = "Jade Dragon" 
		}
	}
	trigger_if = {
		limit = {
			religion_group  = pagan_group
			NOR = { 
				has_dlc = "The Old Gods" 
				has_dlc = "Holy Fury"
			}
		}
		AND = {
			religion_group = pagan_group
			OR = {
				has_dlc = "The Old Gods" 
				has_dlc = "Holy Fury" 
			}
		}
	}
}

ROOTs_secret_religion_is_playable_trigger = { 
# To block players from getting a game over if they don't own all DLCs
	hidden_tooltip = {
		OR = {
			secret_religion_group  = christian
			AND = {
				secret_religion_group  = jewish_group
				has_dlc = "Sons of Abraham"
			}
			AND = {
				secret_religion_group  = muslim
				has_dlc = "The Sword of Islam" 
			}
			AND = {
				secret_religion_group  = indian_group
				has_dlc = "Rajas of India" 
			}
			AND = {
				OR = {
					secret_religion = taoist
					secret_religion = bon
					secret_religion = bon_reformed
					secret_religion = khurmazta 
				}
				has_dlc = "Jade Dragon" 
			}
			AND = {
				secret_religion_group = pagan_group
				OR = {
					has_dlc = "The Old Gods" 
					has_dlc = "Holy Fury" 
				}
			}
			AND = {
				secret_religion_group = zoroastrian_group
				has_dlc = "The Old Gods"
			}
		}	
	}

	trigger_if = {
		limit = {
			secret_religion_group  = jewish_group
			NOT = { has_dlc = "Sons of Abraham" }
		}
		AND = {
			secret_religion_group  = jewish_group
			has_dlc = "Sons of Abraham"
		}
	}
	trigger_if = {
		limit = {
			secret_religion_group  = muslim
			NOT = { has_dlc = "The Sword of Islam" }
		}
		AND = {
			secret_religion_group  = muslim
			has_dlc = "The Sword of Islam" 
		}
	}
	trigger_if = {
		limit = {
			secret_religion_group  = indian_group
			NOT = { has_dlc = "Rajas of India" }
		}
		AND = {
			secret_religion_group  = indian_group
				has_dlc = "Rajas of India" 
		}
	}
	trigger_if = {
		limit = {
			OR = {
				secret_religion = taoist
				secret_religion = bon
				secret_religion = bon_reformed
				secret_religion = khurmazta 
			}
			NOT = { has_dlc = "Jade Dragon" }
		}
		AND = {
			OR = {
				secret_religion = taoist
				secret_religion = bon 
				#reformed bön prints out as 'bön' and there's no need to display 'bön' twice in the tooltip
				secret_religion = khurmazta 
			}
			has_dlc = "Jade Dragon" 
		}
	}
	trigger_if = {
		limit = {
			secret_religion_group  = pagan_group
			NOR = { 
				has_dlc = "The Old Gods" 
				has_dlc = "Holy Fury"
			}
		}
		AND = {
			secret_religion_group = pagan_group
			OR = {
				has_dlc = "The Old Gods" 
				has_dlc = "Holy Fury" 
			}
		}
	}
	trigger_if = {
		limit = {
			secret_religion_group  = pagan_group
			NOT = { has_dlc = "The Old Gods" }
		}
		AND = {
			secret_religion_group = zoroastrian_group
			has_dlc = "The Old Gods"
		}
	}
}

###Use the actual is_<family member>_of = scope triggers now
family_of_root_trigger = { #use is_blood_relative_of_root_trigger for all relatives
	OR = {
		is_close_relative = ROOT #spouse, parents, children, siblings, grandparents, grandchildren
		cousin_of_root_trigger = yes #cousins
		sibling_child_of_root_trigger = yes #nephews, nieces
		parent_sibling_of_root_trigger = yes #aunts, uncles
		sibling_in_law_of_root_trigger = yes #brothers and sisters in law
	}
}

cousin_of_root_trigger = {
	is_cousin_of = ROOT
}

sibling_of_root_trigger = {
	sibling = ROOT
}

sibling_child_of_root_trigger = {
	is_nibling_of = ROOT
}

parent_sibling_of_root_trigger = {
	is_aunt_uncle_of = ROOT
}

grandchild_of_root_trigger = {
	is_grandchild_of = ROOT
}

sibling_in_law_of_root_trigger = {
	OR = {
		mother_even_if_dead = { any_child = { any_spouse = { character = ROOT } } }
		father_even_if_dead = { any_child = { any_spouse = { character = ROOT } } }
		any_spouse = { mother_even_if_dead = { any_child = { character = ROOT } } }
		any_spouse = { father_even_if_dead = { any_child = { character = ROOT } } }
	}
}

relative_in_law_of_root_trigger = {
	OR = {
		any_child = { any_spouse = { character = ROOT } }
		#any_spouse = { mother_even_if_dead = { any_child = { any_spouse = { character = ROOT } } } }
		#any_spouse = { father_even_if_dead = { any_child = { any_spouse = { character = ROOT } } } }
	}
}

is_murder_quest_target_of_prev_trigger = {
	PREVPREV = {
		has_quest = quest_the_assassins_assassination
		quest_target = { character = PREVPREV }
	}
}

is_murder_quest_target_of_root_trigger = {
	ROOT = {
		has_quest = quest_the_assassins_assassination
		quest_target = { character = PREVPREV }
	}
}

assassins_appropriate_target_trigger = {
	is_within_diplo_range = ROOT
	is_adult = yes
	is_quest_target = no

	OR = {
		is_ruler = no
		AND = {
			ROOT = {
				society_rank = {
					rank == 3
					society = the_assassins
				}
			}
			primary_title = { higher_real_tier_than = COUNT }
		}
		AND = {
			ROOT = {
				society_rank = {
					rank == 2
					society = the_assassins
				}
			}
			primary_title = { lower_real_tier_than = EMPEROR }
		}
		AND = {
			ROOT = {
				society_rank = {
					rank == 1
					society = the_assassins
				}
			}
			primary_title = { lower_real_tier_than = DUKE }
		}
	}
}

interesting_face_trigger = {
	OR = {
		trait = fair
		trait = groomed
		trait = ugly
		trait = uncouth
		has_scarred_trait_trigger = yes
		is_ill = yes
		trait = disfigured
		trait = blinded
		trait = one_eyed
		trait = leper
		trait = harelip
		is_strong_trigger = yes
		is_weak_trigger = yes
		trait = lunatic
		trait = possessed
		trait = rabies
		trait = horse
	}
}

can_pay_assassins_debt = {
	OR = {
		AND = {
			is_variable_equal = { which = assassins_debt value = 50 }
			wealth = 50
		}
		AND = {
			is_variable_equal = { which = assassins_debt value = 250 }
			wealth = 250
		}
		AND = {
			is_variable_equal = { which = assassins_debt value = 300 }
			wealth = 300
		}
		AND = {
			is_variable_equal = { which = assassins_debt value = 500 }
			wealth = 500
		}
	}
}

is_rich_holding = {
	OR = {
		calc_true_if = {
			amount = 2
			has_building = ca_keep_3
			has_building = ca_keep_4
			has_building = ca_keep_5
			has_building = ca_keep_6
			has_building = ca_town_3
			has_building = ca_town_4
			has_building = ca_town_5
			has_building = ca_town_6
			has_building = tp_monastery_3
			has_building = tp_monastery_4
			has_building = tp_monastery_5
			has_building = tp_monastery_6
			has_building = tp_town_3
			has_building = tp_town_4
			has_building = tp_town_5
			has_building = tp_town_6
		}
		has_building = ct_marketplace_3
		has_building = ct_marketplace_4
		has_building = ct_marketplace_5
		has_building = ct_marketplace_6

	}
}
is_richer_holding = {
	
	OR = {
		calc_true_if = {
			amount = 2
			has_building = ca_keep_5
			has_building = ca_keep_6
			has_building = ca_town_5
			has_building = ca_town_6
			has_building = tp_monastery_5
			has_building = tp_monastery_6
			has_building = tp_town_5
			has_building = tp_town_6
		}
		has_building = ct_marketplace_5
		has_building = ct_marketplace_6
	}
}

has_society_currency_trivial_trigger = {
	society_currency >= 15
}

has_society_currency_tiny_trigger = {
	society_currency >= 50
}

has_society_currency_minor_trigger = {
	society_currency >= 150
}

has_society_currency_medium_trigger = {
	society_currency >= 300
}

has_society_currency_major_trigger = {
	society_currency >= 500
}

is_ill_trigger = {
	OR = {
		has_disease_trigger = yes
	}
}

is_devil_worshiper_trigger = {
	custom_tooltip = {
		text = IS_DEVIL_WORSHIPPER_TRIGGER
		OR = {
			society_member_of = the_satanists
			society_member_of = the_cold_ones
			society_member_of = the_plaguebringers
			society_member_of = the_cult_of_kali
			society_member_of = the_trollcrafters
			society_member_of = the_vodouns
			society_member_of = the_bacchants
		}
	}
}

has_positive_congenital_trigger = {
	OR = {
		trait = strong
		trait = fair
		trait = quick
		trait = genius
	}
}

has_negative_congenital_trigger = {
	OR = {
		trait = ugly
		trait = clubfooted
		trait = hunchback
		trait = dwarf
		trait = giant
		trait = harelip
		trait = stutter
		trait = lisp
		trait = slow
		trait = inbred
		trait = weak
		trait = imbecile
	}
}


is_christian_monastic_member_trigger = {
	OR = {
		society_member_of = monastic_order_orthodox
		society_member_of = monastic_order_benedictine
		society_member_of = monastic_order_dominican
		society_member_of = monastic_order_nestorian
		society_member_of = monastic_order_monophysite
	}
}

is_dharmic_monastic_member_trigger = {
	OR = {
		society_member_of = monastic_order_hindu
		society_member_of = monastic_order_buddhist
		society_member_of = monastic_order_jain
	}
}

is_monastic_member_trigger = {
	OR = {
		is_dharmic_monastic_member_trigger = yes
		is_christian_monastic_member_trigger = yes
		society_member_of = monastic_order_stoics
	}
}

is_ascetic_trigger = {
	custom_tooltip = {
		text = is_ascetic_tooltip
		OR = {
			trait = monk
			trait = nun
			trait = muni
			trait = aryika
			trait = bhikkhu
			trait = bhikkhuni
			trait = sanyasi
			trait = sanyasini
		}
	}
}

is_virgin_trigger = {
	NOR = {
		any_lover = { always = yes }
		any_child_even_if_dead = { always = yes }
		any_spouse_even_if_dead = { always = yes }
		has_focus = focus_seduction
		is_pregnant = yes
		trait = pregnant
		trait = lustful
		trait = hedonist
		trait = seducer
		trait = seductress
		trait = lovers_pox
		trait = has_aztec_disease
		trait = syphilitic
	}
	OR = {
		NOT = { age = 25 }
		trait = celibate
		trait = chaste
		trait = shy
		is_ascetic_trigger = yes
	}
}

print_scope_trigger = {
	log = "------------------------------"
	log = "- Printing the current scope -"
	log = "- This: [This.GetName][This.GetBestName]"
	log = "- Root: [Root.GetName][Root.GetBestName]"
	log = "- Prev: [Prev.GetName][Prev.GetBestName]"
	log = "- PrevPrev: [PrevPrev.GetName][PrevPrev.GetBestName]"
	log = "- PrevPrevPrev: [PrevPrevPrev.GetName][PrevPrevPrev.GetBestName]"
	log = "- PrevPrevPrevPrev: [PrevPrevPrevPrev.GetName][PrevPrevPrevPrev.GetBestName]"
	log = "- From: [From.GetName][From.GetBestName]"
	log = "- FromFrom: [FromFrom.GetName][FromFrom.GetBestName]"
	log = "- FromFromFrom: [FromFromFrom.GetName][FromFromFrom.GetBestName]"
	log = "- FromFromFromFrom: [FromFromFromFrom.GetName][FromFromFromFrom.GetBestName]"
	log = "- Event_target:test_target1: [test_target1.GetName][test_target1.GetBestName]"
	log = "- Event_target:test_target2: [test_target2.GetName][test_target2.GetBestName]"
	log = "- Event_target:test_target3: [test_target3.GetName][test_target3.GetBestName]"
	log = "------------------------------"
}

is_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
}

is_christian_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	secret_religion_group = christian
}

is_muslim_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	secret_religion_group = muslim
}

is_zoroastrian_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	secret_religion_group = zoroastrian_group
}

is_indian_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	secret_religion_group = indian_group
}

is_jewish_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	secret_religion_group = jewish_group
}

is_norse_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	OR = {
		society_member_of = secret_religious_society_norse_pagan_reformed
		society_member_of = secret_religious_society_norse_pagan
	}
}

is_slavic_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	OR = {
		society_member_of = secret_religious_society_slavic_pagan_reformed
		society_member_of = secret_religious_society_slavic_pagan
	}
}

is_tengri_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	OR = {
		society_member_of = secret_religious_society_tengri_pagan_reformed
		society_member_of = secret_religious_society_tengri_pagan
	}
}

is_baltic_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	OR = {
		society_member_of = secret_religious_society_baltic_pagan_reformed
		society_member_of = secret_religious_society_baltic_pagan
	}
}

is_finnish_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	OR = {
		society_member_of = secret_religious_society_finnish_pagan_reformed
		society_member_of = secret_religious_society_finnish_pagan
	}
}

is_west_african_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	OR = {
		society_member_of = secret_religious_society_west_african_pagan_reformed
		society_member_of = secret_religious_society_west_african_pagan
	}
}

is_zun_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	OR = {
		society_member_of = secret_religious_society_zun_pagan_reformed
		society_member_of = secret_religious_society_zun_pagan
	}
}

is_aztec_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_cult
	OR = {
		society_member_of = secret_religious_society_aztec_reformed
		society_member_of = secret_religious_society_aztec
	}
}

is_bon_secret_religious_society_member_trigger = {
	OR = {
		society_member_of = secret_religious_society_bon
		society_member_of = secret_religious_society_bon_reformed
	}
}

is_hellenic_secret_religious_society_member_trigger = {
	OR = {
		society_member_of = secret_religious_society_hellenic_pagan
		society_member_of = secret_religious_society_hellenic_pagan_reformed
	}
}
is_taoist_secret_religious_society_member_trigger = {
	society_member_of = secret_religious_society_taoist
}

is_openly_of_prevs_secret_religion_trigger = {
	religion = { target = PREV target_type = secret }
}

is_openly_of_roots_secret_religion_trigger = {
	religion = { target = ROOT target_type = secret }
}

has_sympathy_for_true_religion_of_prev_trigger = { 
	OR = {
		AND = {
			trait = sympathy_christendom
			PREV = { true_religion_group_christian_trigger = yes }
		}
		AND = {
			trait = sympathy_islam
			PREV = { true_religion_group_muslim_trigger = yes }
		}
		AND = {
			trait = sympathy_pagans
			PREV = { true_religion_group_pagan_group_trigger = yes }
		}
		AND = {
			trait = sympathy_zoroastrianism
			PREV = { true_religion_group_zoroastrian_group_trigger = yes }
		}
		AND = {
			trait = sympathy_judaism
			PREV = { true_religion_group_jewish_group_trigger = yes }
		}
		AND = {
			trait = sympathy_indian
			PREV = { true_religion_group_indian_group_trigger = yes }
		}
	}
}

has_sympathy_for_true_religion_of_root_trigger = { 
	OR = {
		AND = {
			trait = sympathy_christendom
			ROOT = { true_religion_group_christian_trigger = yes }
		}
		AND = {
			trait = sympathy_islam
			ROOT = { true_religion_group_muslim_trigger = yes }
		}
		AND = {
			trait = sympathy_pagans
			ROOT = { true_religion_group_pagan_group_trigger = yes }
		}
		AND = {
			trait = sympathy_zoroastrianism
			ROOT = { true_religion_group_zoroastrian_group_trigger = yes }
		}
		AND = {
			trait = sympathy_judaism
			ROOT = { true_religion_group_jewish_group_trigger = yes }
		}
		AND = {
			trait = sympathy_indian
			ROOT = { true_religion_group_indian_group_trigger = yes }
		}
	}
}

ok_sr_induction_mission_target_trigger = {
	is_adult = yes
	NOT = { secret_religion = ROOT }
	NOT = { religion = { target_type = secret target = ROOT } }
	prisoner = no
	NOT = { trait = incapable }
	is_inaccessible_trigger = no
	NOT = { has_character_modifier = secret_religion_sympathy_timer }
	OR = {
		religion_group = { target_type = secret target = ROOT }
		has_sympathy_for_true_religion_of_root_trigger = yes
	}
}

ok_sr_sympathy_mission_target_trigger = {
	has_secret_religion_trait_trigger = no
	ROOT = {
		NOT = { secret_religion = { target_type = public target = PREV } }
		NOR = {
			AND = {
				true_religion_group = christian
				PREV = { trait = sympathy_christendom }
			}
			AND = {
				true_religion_group = muslim
				PREV = { trait = sympathy_islam }
			}
			AND = {
				true_religion_group = pagan_group
				PREV = { trait = sympathy_pagans }
			}
			AND = {
				true_religion_group = zoroastrian_group
				PREV = { trait = sympathy_zoroastrianism }
			}
			AND = {
				true_religion_group = jewish_group
				PREV = { trait = sympathy_judaism }
			}
			AND = {
				true_religion_group = indian_group
				PREV = { trait = sympathy_indian }
			}
		}
	}
	ROOT = { PREV = { is_openly_of_prevs_secret_religion_trigger = no } }
	ROOT = { PREV = { has_sympathy_for_true_religion_of_prev_trigger = no } }
	prisoner = no
	is_adult = yes
	NOT = { trait = incapable }
	is_inaccessible_trigger = no
	NOT = { has_character_modifier = secret_religion_sympathy_timer }
}

has_prevs_secret_religion_truly_trigger = {
	secret_religion = { target = PREV target_type = true }
}

has_roots_secret_religion_truly_trigger = {
	secret_religion = { target = ROOT target_type = true }
}

has_my_liege_secret_religion_truly_trigger = {
	secret_religion = { target = event_target:my_liege target_type = true }
}

is_in_prevs_interesting_society_trigger = {
	OR = {
		AND = {
			society_member_of = secret_religious_society_catholic
			PREV = { interested_in_society = secret_religious_society_catholic }
		}
		AND = {
			society_member_of = secret_religious_society_cathar
			PREV = { interested_in_society = secret_religious_society_cathar }
		}
		AND = {
			society_member_of = secret_religious_society_fraticelli
			PREV = { interested_in_society = secret_religious_society_fraticelli }
		}
		AND = {
			society_member_of = secret_religious_society_waldensian
			PREV = { interested_in_society = secret_religious_society_waldensian }
		}
		AND = {
			society_member_of = secret_religious_society_lollard
			PREV = { interested_in_society = secret_religious_society_lollard }
		}
		AND = {
			society_member_of = secret_religious_society_orthodox
			PREV = { interested_in_society = secret_religious_society_orthodox }
		}
		AND = {
			society_member_of = secret_religious_society_miaphysite
			PREV = { interested_in_society = secret_religious_society_miaphysite }
		}
		AND = {
			society_member_of = secret_religious_society_monophysite
			PREV = { interested_in_society = secret_religious_society_monophysite }
		}
		AND = {
			society_member_of = secret_religious_society_bogomilist
			PREV = { interested_in_society = secret_religious_society_bogomilist }
		}
		AND = {
			society_member_of = secret_religious_society_monothelite
			PREV = { interested_in_society = secret_religious_society_monothelite }
		}
		AND = {
			society_member_of = secret_religious_society_iconoclast
			PREV = { interested_in_society = secret_religious_society_iconoclast }
		}
		AND = {
			society_member_of = secret_religious_society_paulician
			PREV = { interested_in_society = secret_religious_society_paulician }
		}
		AND = {
			society_member_of = secret_religious_society_nestorian
			PREV = { interested_in_society = secret_religious_society_nestorian }
		}
		AND = {
			society_member_of = secret_religious_society_messalian
			PREV = { interested_in_society = secret_religious_society_messalian }
		}
		AND = {
			society_member_of = secret_religious_society_sunni
			PREV = { interested_in_society = secret_religious_society_sunni }
		}
		AND = {
			society_member_of = secret_religious_society_zikri
			PREV = { interested_in_society = secret_religious_society_zikri }
		}
		AND = {
			society_member_of = secret_religious_society_yazidi
			PREV = { interested_in_society = secret_religious_society_yazidi }
		}
		AND = {
			society_member_of = secret_religious_society_ibadi
			PREV = { interested_in_society = secret_religious_society_ibadi }
		}
		AND = {
			society_member_of = secret_religious_society_kharijite
			PREV = { interested_in_society = secret_religious_society_kharijite }
		}
		AND = {
			society_member_of = secret_religious_society_shiite
			PREV = { interested_in_society = secret_religious_society_shiite }
		}
		AND = {
			society_member_of = secret_religious_society_druze
			PREV = { interested_in_society = secret_religious_society_druze }
		}
		AND = {
			society_member_of = secret_religious_society_hurufi
			PREV = { interested_in_society = secret_religious_society_hurufi }
		}
		AND = {
			society_member_of = secret_religious_society_jewish
			PREV = { interested_in_society = secret_religious_society_jewish }
		}
		AND = {
			society_member_of = secret_religious_society_karaite
			PREV = { interested_in_society = secret_religious_society_karaite }
		}
		AND = {
			society_member_of = secret_religious_society_samaritan
			PREV = { interested_in_society = secret_religious_society_samaritan }
		}
		AND = {
			society_member_of = secret_religious_society_zoroastrian
			PREV = { interested_in_society = secret_religious_society_zoroastrian }
		}
		AND = {
			society_member_of = secret_religious_society_mazdaki
			PREV = { interested_in_society = secret_religious_society_mazdaki }
		}
		AND = {
			society_member_of = secret_religious_society_manichean
			PREV = { interested_in_society = secret_religious_society_manichean }
		}
		AND = {
			society_member_of = secret_religious_society_khurmazta
			PREV = { interested_in_society = secret_religious_society_khurmazta }
		}
		AND = {
			society_member_of = secret_religious_society_bon
			PREV = { interested_in_society = secret_religious_society_bon }
		}
		AND = {
			society_member_of = secret_religious_society_taoist
			PREV = { interested_in_society = secret_religious_society_taoist }
		}
		AND = {
			society_member_of = secret_religious_society_hindu
			PREV = { interested_in_society = secret_religious_society_hindu}
		}
		AND = {
			society_member_of = secret_religious_society_buddhist
			PREV = { interested_in_society = secret_religious_society_buddhist }
		}
		AND = {
			society_member_of = secret_religious_society_jain
			PREV = { interested_in_society = secret_religious_society_jain }
		}
		AND = {
			society_member_of = secret_religious_society_norse_pagan_reformed
			PREV = { interested_in_society = secret_religious_society_norse_pagan_reformed }
		}
		AND = {
			society_member_of = secret_religious_society_slavic_pagan_reformed
			PREV = { interested_in_society = secret_religious_society_slavic_pagan_reformed }
		}
		AND = {
			society_member_of = secret_religious_society_tengri_pagan_reformed
			PREV = { interested_in_society = secret_religious_society_tengri_pagan_reformed }
		}
		AND = {
			society_member_of = secret_religious_society_baltic_pagan_reformed
			PREV = { interested_in_society = secret_religious_society_baltic_pagan_reformed }
		}
		AND = {
			society_member_of = secret_religious_society_finnish_pagan_reformed
			PREV = { interested_in_society = secret_religious_society_finnish_pagan_reformed }
		}
		AND = {
			society_member_of = secret_religious_society_west_african_pagan_reformed
			PREV = { interested_in_society = secret_religious_society_west_african_pagan_reformed }
		}
		AND = {
			society_member_of = secret_religious_society_zun_pagan_reformed
			PREV = { interested_in_society = secret_religious_society_zun_pagan_reformed }
		}
		AND = {
			society_member_of = secret_religious_society_norse_pagan
			PREV = { interested_in_society = secret_religious_society_norse_pagan }
		}
		AND = {
			society_member_of = secret_religious_society_slavic_pagan
			PREV = { interested_in_society = secret_religious_society_slavic_pagan }
		}
		AND = {
			society_member_of = secret_religious_society_tengri_pagan
			PREV = { interested_in_society = secret_religious_society_tengri_pagan }
		}
		AND = {
			society_member_of = secret_religious_society_baltic_pagan
			PREV = { interested_in_society = secret_religious_society_baltic_pagan }
		}
		AND = {
			society_member_of = secret_religious_society_finnish_pagan
			PREV = { interested_in_society = secret_religious_society_finnish_pagan }
		}
		AND = {
			society_member_of = secret_religious_society_west_african_pagan
			PREV = { interested_in_society = secret_religious_society_west_african_pagan }
		}
		AND = {
			society_member_of = secret_religious_society_zun_pagan
			PREV = { interested_in_society = secret_religious_society_zun_pagan }
		}
		AND = {
			society_member_of = secret_religious_society_aztec
			PREV = { interested_in_society = secret_religious_society_aztec }
		}
		AND = {
			society_member_of = secret_religious_society_aztec_reformed
			PREV = { interested_in_society = secret_religious_society_aztec_reformed }
		}
	}
}

shares_prevs_secret_religion_trigger = {
	secret_religion = PREV
}

character_knows_prev_trigger = {
	OR = {
		is_close_relative = PREV
		is_lover = PREV
		is_friend = PREV
		is_rival = PREV
		any_courtier_or_vassal = { character = PREVPREV }
		is_liege_or_above = PREV
		dynasty = PREV
		same_liege = PREV
		AND = {
			is_within_diplo_range = PREV
			PREV = { independent = yes } 
		}
	}
}

shares_true_religion_group_with_prev_trigger = {
	true_religion_group = PREV
}

is_openly_of_prevs_true_religion_group = {
	religion_group = { target = PREV target_type = true }
}

is_visible_to_self_trigger = { #For hidden modifiers
	custom_tooltip = {
		text =  is_visible_to_self_trigger_tooltip
		character = FROM
	}
}

#has_any_char_old_religion = {
#	OR = {
#		AND = {
#			has_character_flag = character_was_catholic
#	    	any_character = {
#	    		religion = catholic
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_cathar
#	    	any_character = {
#	    		religion = cathar
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_fraticelli
#	    	any_character = {
#	    		religion = fraticelli
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_waldensian
#	    	any_character = {
#	    		religion = waldensian
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_lollard
#	    	any_character = {
#	    		religion = lollard
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_orthodox
#	    	any_character = {
#	    		religion = orthodox
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_miaphysite
#	    	any_character = {
#	    		religion = miaphysite
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_monophysite
#	    	any_character = {
#	    		religion = monophysite
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_bogomilist
#	    	any_character = {
#	    		religion = bogomilist
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_monothelite
#	    	any_character = {
#	    		religion = monothelite
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_iconoclast
#	    	any_character = {
#	    		religion = iconoclast
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_paulician
#	    	any_character = {
#	    		religion = paulician
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_nestorian
#	    	any_character = {
#	    		religion = nestorian
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_messalian
#	    	any_character = {
#	    		religion = messalian
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_sunni
#	    	any_character = {
#	    		religion = sunni
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_zikri
#	    	any_character = {
#	    		religion = zikri
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_yazidi
#	    	any_character = {
#	    		religion = yazidi
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_ibadi
#	    	any_character = {
#	    		religion = ibadi
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_kharijite
#	    	any_character = {
#	    		religion = kharijite
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_shiite
#	    	any_character = {
#	    		religion = shiite
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_druze
#	    	any_character = {
#	    		religion = druze
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_hurufi
#	    	any_character = {
#	    		religion = hurufi
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_jewish
#	    	any_character = {
#	    		religion = jewish
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_karaite
#	    	any_character = {
#	    		religion = karaite
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_samaritan
#	    	any_character = {
#	    		religion = samaritan
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_zoroastrian
#	    	any_character = {
#	    		religion = zoroastrian
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_mazdaki
#	    	any_character = {
#	    		religion = mazdaki
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_manichean
#	    	any_character = {
#	    		religion = manichean
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_khurmazta
#	    	any_character = {
#	    		religion = khurmazta
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_bon
#	    	any_character = {
#	    		religion = bon
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_bon_reformed
#	    	any_character = {
#	    		religion = bon_reformed
#	    	}
#	    }
#		AND = {
#			has_character_flag = character_was_taoist
#	    	any_character = {
#	    		religion = taoist
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_hindu
#	    	any_character = {
#	    		religion = hindu
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_buddhist
#	    	any_character = {
#	    		religion = buddhist
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_jain
#	    	any_character = {
#	    		religion = jain
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_norse_pagan_reformed
#	    	any_character = {
#	    		religion = norse_pagan_reformed
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_slavic_pagan_reformed
#	    	any_character = {
#	    		religion = slavic_pagan_reformed
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_tengri_pagan_reformed
#	    	any_character = {
#	    		religion = tengri_pagan_reformed
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_baltic_pagan_reformed
#	    	any_character = {
#	    		religion = baltic_pagan_reformed
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_finnish_pagan_reformed
#	    	any_character = {
#	    		religion = finnish_pagan_reformed
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_west_african_pagan_reformed
#	    	any_character = {
#	    		religion = west_african_pagan_reformed
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_zun_pagan_reformed
#	    	any_character = {
#	    		religion = zun_pagan_reformed
#	    	}
#	    }
#		AND = { 
#	    	has_character_flag = character_was_norse_pagan
#	    	any_character = {
#	    		religion = norse_pagan
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_slavic_pagan
#	    	any_character = {
#	    		religion = slavic_pagan
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_tengri_pagan
#	    	any_character = {
#	    		religion = tengri_pagan
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_baltic_pagan
#	    	any_character = {
#	    		religion = baltic_pagan
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_finnish_pagan
#	    	any_character = {
#	    		religion = finnish_pagan
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_west_african_pagan
#	    	any_character = {
#	    		religion = west_african_pagan
#	    	}
#	    }
#	    AND = { 
#	    	has_character_flag = character_was_zun_pagan
#	    	any_character = {
#	    		religion = zun_pagan
#	    	}
#	    }
#		AND = { 
#	    	has_character_flag = character_was_aztec
#	    	any_character = {
#	    		religion = aztec
#	    	}
#	    }
#		AND = { 
#	    	has_character_flag = character_was_aztec_reformed
#	    	any_character = {
#	    		religion = aztec_reformed
#	    	}
#	    }
#	}
#}

can_add_admin_bonus_trigger = {
	NAND = {
		has_province_modifier = harvest_festivals
		has_province_modifier = inspired_peasantry
		has_province_modifier = new_roads
	}
}

can_be_sabotaged_trigger = {
	NAND = {
		has_province_modifier = sabotaged_buildings
		has_province_modifier = sabotaged_defences
		has_province_modifier = sabotaged_unrest
	}
}

has_assassins_prerequisites = {
	age = 16
	conditional_tooltip = { #recruitment decision
		trigger = { FROM = { society_member_of = the_assassins } }
		OR = {
			FROM = { ai = no }
			hidden_trigger = { ai = no }
			religion_group = muslim
		}
	}
	conditional_tooltip = { #showing interest via interface
		trigger = { NOT = { FROM = { society_member_of = the_assassins } } }
		OR = {
			true_religion = shiite
			religion_group = muslim
			AND = {
				ai = no
				NOT = { trait = zealous }
				any_playable_ruler = {
					religion = shiite
					NOT = {
						distance_from_realm = { value = 300 who = ROOT }
					}
				}
			}
		}
	}
	OR = {
		is_female = no
		has_game_rule = {
			name = gender
			value = all
		}
	}
}

has_common_devilworship_prerequisites = {
	age = 16
	custom_tooltip = {
		text = must_be_a_sinner_tooltip
		hidden_tooltip = {
			OR = {
				has_impious_trait_trigger = yes
				has_vice_trigger = yes
				trait = drunkard
				trait = possessed
				trait = lunatic
			}
		}
	}
}

has_satanists_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion_group = christian
		religion_group = muslim
		religion_group = zoroastrian_group
		religion_group = jewish_group
		religion = zun_pagan
		religion = zun_pagan_reformed
	}
}

has_trollcrafters_prerequisites = {
	has_common_devilworship_prerequisites = yes
	religion_openly_norse_or_reformed_trigger = yes
}

has_cult_of_kali_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion = hindu
	}
}

has_cold_ones_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion_openly_baltic_or_reformed_trigger = yes
		religion_openly_slavic_or_reformed_trigger = yes
		religion_openly_finnish_or_reformed_trigger = yes
	}
}

has_plaguebringers_prerequisites = {
	has_common_devilworship_prerequisites = yes
	religion_openly_tengri_or_reformed_trigger = yes
}

has_vodouns_prerequisites = {
	has_common_devilworship_prerequisites = yes
	religion_openly_west_african_or_reformed_trigger = yes
}

has_bacchants_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = { 
		religion_openly_hellenic_or_reformed_trigger = yes
		culture = roman #Historically fashionable thrill for bored patricians.
		AND = { 
			has_global_flag = flag_started_roman_renaissance
			top_liege = { has_landed_title = e_roman_empire } #Historically a plague for the Empire.
		} 
	} 
}
same_society_rank_as_prev_trigger = {
	OR = {
		AND = {
			society_rank == 1
			PREV = { society_rank == 1 }
		}
		AND = {
			society_rank == 2
			PREV = { society_rank == 2 }
		}
		AND = {
			society_rank == 3
			PREV = { society_rank == 3 }
		}
		AND = {
			society_rank == 4
			PREV = { society_rank == 4 }
		}
	}
}

higher_society_rank_than_prev_trigger = {
	OR = {
		AND = {
			PREV = { society_rank == 1 }
			society_rank > 1
		}
		AND = {
			PREV = { society_rank == 2 }
			society_rank > 2
		}
		AND = {
			PREV = { society_rank == 3 }
			society_rank > 3
		}
	}
}

higher_society_rank_than_root_trigger = {
	OR = {
		AND = {
			ROOT = { society_rank == 1 }
			society_rank > 1
		}
		AND = {
			ROOT = { society_rank == 2 }
			society_rank > 2
		}
		AND = {
			ROOT = { society_rank == 3 }
			society_rank > 3
		}
	}
}

#returns true if scoped character already likes ROOT and could be physically attracted to them
possibly_romantically_interested_in_ROOT_trigger = {
	NOT = { is_rival = ROOT }
	NOT = { is_lover = ROOT }
	attacted_to_root_trigger = yes
	OR = {
		opinion = { who = ROOT value = 45 }
		has_opinion_modifier = { who = ROOT modifier = opinion_budding_romance }
	}
}

#returns true if scoped character is already liked by ROOT and ROOT could be physically attracted to them
ROOT_possibly_romantically_interested_trigger = {
	NOT = { is_rival = ROOT }
	NOT = { is_lover = ROOT }
	root_attraction_trigger = yes
	OR = { 
		reverse_opinion = { who = ROOT value = 45 }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_budding_romance }
	}
}

#returns true if scoped character and ROOT are somewhat likely to fancy each other
possibly_romantically_interested_in_each_other_trigger = {
	possibly_romantically_interested_in_ROOT_trigger = yes
	ROOT_possibly_romantically_interested_trigger = yes
}

looting_artifact_event_religious_artifacts_trigger = {
	FROM = {
		any_artifact = {
			has_artifact_flag = looted_artifact_tooltip_1
			has_artifact_flag = religious
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = catholic
				ROOT = { religion = catholic }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = cathar
				ROOT = { religion = cathar }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = fraticelli
				ROOT = { religion = fraticelli }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = waldensian
				ROOT = { religion = waldensian }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = lollard
				ROOT = { religion = lollard }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = orthodox
				ROOT = { religion = orthodox }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = bogomilist
				ROOT = { religion = bogomilist }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = monothelite
				ROOT = { religion = monothelite }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = iconoclast
				ROOT = { religion = iconoclast }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = paulician
				ROOT = { religion = paulician }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = miaphysite
				ROOT = { religion = miaphysite }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = monophysite
				ROOT = { religion = monophysite }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = nestorian
				ROOT = { religion = nestorian }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = messalian
				ROOT = { religion = messalian }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = sunni
				ROOT = { religion = sunni }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zikri
				ROOT = { religion = zikri }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = yazidi
				ROOT = { religion = yazidi }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = shiite
				ROOT = { religion = shiite }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = druze
				ROOT = { religion = druze }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = hurufi
				ROOT = { religion = hurufi }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = ibadi
				ROOT = { religion = ibadi }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = kharijite
				ROOT = { religion = kharijite }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = jewish
				ROOT = { religion = jewish }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = samaritan
				ROOT = { religion = samaritan }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = karaite
				ROOT = { religion = karaite }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zoroastrian
				ROOT = { religion = zoroastrian }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = mazdaki
				ROOT = { religion = mazdaki }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = manichean
				ROOT = { religion = manichean }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = khurmazta
				ROOT = { religion = khurmazta }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = bon
				ROOT = { OR = { religion = bon religion = bon_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = taoist
				ROOT = { religion = taoist }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = hindu
				ROOT = { religion = hindu }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = buddhist
				ROOT = { religion = buddhist }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = jain
				ROOT = { religion = jain }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = norse_pagan
				ROOT = { OR = { religion = norse_pagan religion = norse_pagan_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = baltic_pagan
				ROOT = { OR = { religion = baltic_pagan religion = baltic_pagan_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = finnish_pagan
				ROOT = { OR = { religion = finnish_pagan religion = finnish_pagan_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = slavic_pagan
				ROOT = { OR = { religion = slavic_pagan religion = slavic_pagan_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = tengri_pagan
				ROOT = { OR = { religion = tengri_pagan religion = tengri_pagan_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = aztec
				ROOT = { OR = { religion = aztec religion = aztec_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = west_african_pagan
				ROOT = { OR = { religion = west_african_pagan religion = west_african_pagan_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zun_pagan
				ROOT = { OR = { religion = zun_pagan religion = zun_pagan_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = hellenic_pagan
				ROOT = { OR = { religion = hellenic_pagan religion = hellenic_pagan_reformed } }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = pagan
				ROOT = { religion = pagan }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = christian
				ROOT = { religion_group = christian }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = muslim
				ROOT = { religion_group = muslim }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = pagan_group
				ROOT = { religion_group = pagan_group }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zoroastrian_group
				ROOT = { religion_group = zoroastrian_group }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = jewish_group
				ROOT = { religion_group = jewish_group }
			}
		}
		NAND = {
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = indian_group
				ROOT = { religion_group = indian_group }
			}
		}
	}
}

have_duplicate_goldsmith_artifacts_flag_okay_trigger = {
	OR = {
		AND = {
		    OR = {
		       	religion_group = christian 
		       	religion_group = jewish_group
			}
			AND = 
			{
		       	has_artifact = the_lily_crown
       			has_artifact = noble_scepter
        		has_artifact = engraved_sword
		  	}
		}
		AND = {
	        OR = {
	        	religion_group = muslim 
	        	religion = west_african_pagan
	        	religion = west_african_pagan_reformed
	        }
	        AND = {
		        has_artifact = engraved_dagger
        		has_artifact = silver_bracelets
		    }
		}
        AND = {
	        OR = {
	        	religion_group = indian_group
	        	religion = bon
	        	religion = bon_reformed
	        }
        	AND = {
        		has_artifact = engraved_dagger
        		has_artifact = collar_of_pearls
        	}
        }
        AND = {
	        OR = {
	        	religion_group = zoroastrian_group
	        	religion = zun_pagan
	        	religion = zun_pagan_reformed
			}
			AND = {
			    has_artifact = circlet_of_twilight
        		has_artifact = silver_staff
        	}
        }
       	AND = {
	        OR = {
	        	religion = norse_pagan
	        	religion = norse_pagan_reformed
	        }
		    AND = {
		        has_artifact = iron_crown
      		    has_artifact = engraved_sword
        	}
        }
        AND = {
        	has_artifact = engraved_crown
        	has_artifact = ceremonial_axe
       	}
    }
}

have_duplicate_goldsmith_artifacts_flag_good_trigger = {
	OR = {
		AND = {
		    OR = {
		       	religion_group = christian 
		       	religion_group = jewish_group
			}
			AND = 
			{
		       	has_artifact = crown_of_pearls
        		has_artifact = ruby_scepter
        		has_artifact = golden_sword
		  	}
		}
		AND = {
	        OR = {
	        	religion_group = muslim 
	        	religion = west_african_pagan
	        	religion = west_african_pagan_reformed
	        }
	        AND = {
		        has_artifact = bejeweled_dagger
        		has_artifact = golden_bracelets
		    }
		}
        AND = {
	        OR = {
	        	religion_group = indian_group
	        	religion = bon
	        	religion = bon_reformed
	        }
        	AND = {
        		has_artifact = bejeweled_dagger
        		has_artifact = necklace_of_radiance
        	}
        }
        AND = {
	        OR = {
	        	religion_group = zoroastrian_group
	        	religion = zun_pagan
	        	religion = zun_pagan_reformed
			}
			AND = {
			    has_artifact = circlet_of_the_heavens
        		has_artifact = golden_staff
        	}
        }
       	AND = {
	        OR = {
	        	religion = norse_pagan
	        	religion = norse_pagan_reformed
	        }
		    AND = {
		        has_artifact = crown_of_the_sea
        		has_artifact = golden_sword
        	}
        }
        AND = {
        	has_artifact = amber_crown
        	has_artifact = obsidian_axe
       	}
    }
}

have_duplicate_goldsmith_artifacts_flag_expensive_trigger = {
	OR = {
		AND = {
		    OR = {
		       	religion_group = christian 
		       	religion_group = jewish_group
			}
			AND = 
			{
		       	has_artifact = crown_of_majesty
		     	has_artifact = emerald_scepter
		    	has_artifact = sword_of_heroes
		  	}
		}
		AND = {
	        OR = {
	        	religion_group = muslim 
	        	religion = west_african_pagan
	        	religion = west_african_pagan_reformed
	        }
	        AND = {
		        has_artifact = dagger_of_glory
		        has_artifact = ruby_bracelets
		    }
		}
        AND = {
	        OR = {
	        	religion_group = indian_group
	        	religion = bon
	        	religion = bon_reformed
	        }
        	AND = {
        		has_artifact = dagger_of_glory
        		has_artifact = celestial_necklace
        	}
        }
        AND = {
	        OR = {
	        	religion_group = zoroastrian_group
	        	religion = zun_pagan
	        	religion = zun_pagan_reformed
			}
			AND = {
			    has_artifact = circlet_of_the_heavens
			    has_artifact = staff_of_majesty
        	}
        }
       	AND = {
	        OR = {
	        	religion = norse_pagan
	        	religion = norse_pagan_reformed
	        }
		    AND = {
		        has_artifact = crown_of_crows
		        has_artifact = sword_of_heroes
        	}
        }
        AND = {
        	has_artifact = heros_crown
        	has_artifact = axe_of_the_ancestors
       	}
    }
}

have_duplicate_goldsmith_artifacts_flag_amazing_trigger = {
	OR = {
		AND = {
		    OR = {
		       	religion_group = christian 
		       	religion_group = jewish_group
			}
			AND = 
			{
		       	has_artifact = crown_of_majesty_2
		     	has_artifact = emerald_scepter_2
		    	has_artifact = sword_of_heroes_2
		  	}
		}
		AND = {
	        OR = {
	        	religion_group = muslim 
	        	religion = west_african_pagan
	        	religion = west_african_pagan_reformed
	        }
	        AND = {
		        has_artifact = dagger_of_glory_2
		        has_artifact = ruby_bracelets_2
		    }
		}
        AND = {
	        OR = {
	        	religion_group = indian_group
	        	religion = bon
	        	religion = bon_reformed
	        }
        	AND = {
        		has_artifact = dagger_of_glory_2
        		has_artifact = celestial_necklace_2
        	}
        }
        AND = {
	        OR = {
	        	religion_group = zoroastrian_group
	        	religion = zun_pagan
	        	religion = zun_pagan_reformed
			}
			AND = {
			    has_artifact = circlet_of_the_heavens_2
			    has_artifact = staff_of_majesty_2
        	}
        }
       	AND = {
	        OR = {
	        	religion = norse_pagan
	        	religion = norse_pagan_reformed
	        }
		    AND = {
		        has_artifact = crown_of_crows_2
		        has_artifact = sword_of_heroes_2
        	}
        }
        AND = {
        	has_artifact = heros_crown_2
        	has_artifact = axe_of_the_ancestors_2
       	}
    }
}

have_all_armorsmith_artifacts_all_flags_trigger = {
	has_artifact = armor_tier_4_guardian
	has_artifact = armor_tier_4_champion
	has_artifact = armor_tier_4_warden
	has_artifact = armor_tier_3_guardian
	has_artifact = armor_tier_3_champion
	has_artifact = armor_tier_3_warden
	has_artifact = armor_tier_2
	has_artifact = armor_tier_1
}

have_all_weaponsmith_artifacts_all_flags_trigger = {
	trigger_if = {
		limit = {
			NOR = { 
				religion_group = muslim 
				has_dharmic_religion_trigger = yes 
			}
		}
		have_all_weaponsmith_swords_all_flags_trigger = yes
	}
	trigger_if = {
		limit = {
			OR = { 
				religion_group = muslim 
				has_dharmic_religion_trigger = yes 
			}
		}
		have_all_weaponsmith_scimitar_all_flags_trigger = yes
	}
	trigger_if = {
		limit = { is_nomadic = yes }
		have_all_weaponsmith_bow_all_flags_trigger = yes
	}

	have_all_weaponsmith_lance_all_flags_trigger = yes
	have_all_weaponsmith_axe_all_flags_trigger = yes
	have_all_weaponsmith_mace_all_flags_trigger = yes
}

have_all_weaponsmith_mace_all_flags_trigger = {
	has_artifact = mace_tier_4_foe_hammer
	has_artifact = mace_tier_3_foe_hammer
    has_artifact = mace_tier_4_bone_breaker
    has_artifact = mace_tier_3_bone_breaker
    has_artifact = mace_tier_4_shatterer
    has_artifact = mace_tier_3_shatterer
    has_artifact = mace_tier_2_new
    has_artifact = mace_tier_1_new
}

have_all_weaponsmith_axe_all_flags_trigger = {
	has_artifact = axe_tier_4_cleaver
	has_artifact = axe_tier_3_cleaver
	has_artifact = axe_tier_4_ravager
	has_artifact = axe_tier_3_ravager
	has_artifact = axe_tier_4_marauder
	has_artifact = axe_tier_3_marauder
	has_artifact = axe_tier_2_new
    has_artifact = axe_tier_1_new
}

have_all_weaponsmith_lance_all_flags_trigger = {
	has_artifact = lance_tier_4_impaler
	has_artifact = lance_tier_3_impaler
	has_artifact = lance_tier_4_trident
	has_artifact = lance_tier_3_trident
	has_artifact = lance_tier_4_piercer
	has_artifact = lance_tier_3_piercer
	has_artifact = lance_tier_2_new
    has_artifact = lance_tier_1_new
}

have_all_weaponsmith_swords_all_flags_trigger = {
	has_artifact = sword_tier_4_heartseeker
	has_artifact = sword_tier_3_heartseeker
	has_artifact = sword_tier_4_vengeance
    has_artifact = sword_tier_3_vengeance
    has_artifact = sword_tier_4_fury
    has_artifact = sword_tier_3_fury
    has_artifact = sword_tier_2_new
    has_artifact = sword_tier_1_new
}

have_all_weaponsmith_scimitar_all_flags_trigger = {
	has_artifact = scimitar_tier_4_golden
	has_artifact = scimitar_tier_3_golden
	has_artifact = scimitar_tier_4_fortune
	has_artifact = scimitar_tier_3_fortune
	has_artifact = scimitar_tier_4_conquest
	has_artifact = scimitar_tier_3_conquest
	has_artifact = scimitar_tier_2_new
    has_artifact = scimitar_tier_1_new
}

have_all_weaponsmith_bow_all_flags_trigger = {
	has_artifact = bow_tier_4_silent_wind
	has_artifact = bow_tier_3_silent_wind
	has_artifact = bow_tier_4_lightning
	has_artifact = bow_tier_3_lightning
	has_artifact = bow_tier_4_eagle
	has_artifact = bow_tier_3_eagle
	has_artifact = bow_tier_2_new
	has_artifact = bow_tier_1_new
}

have_duplicate_smith_artifacts_flag_okay_trigger = {
	OR = {
		AND = {
		    FROM = { has_character_flag = weapon_sword }
			has_artifact = sword_tier_1_new
		}
		AND = {
	        FROM = { has_character_flag = weapon_scimitar } 
        	has_artifact = scimitar_tier_1_new
		}
        AND = {
	        FROM = { has_character_flag = weapon_lance } 
        	has_artifact = lance_tier_1_new
        }
        AND = {
	        FROM = { has_character_flag = weapon_axe } 
        	has_artifact = axe_tier_1_new
        }
       	AND = {
	        FROM = { has_character_flag = weapon_mace } 
        	has_artifact = mace_tier_1_new
        }
        AND = {
        	FROM = { has_character_flag = weapon_bow } 
        	has_artifact = bow_tier_1_new
       	}
       	AND = {
        	FROM = { has_character_flag = armor_set } 
       		has_artifact = armor_tier_1
       	}
    }
}

have_duplicate_smith_artifacts_flag_good_trigger = {
	OR = {
		AND = {
		    FROM = { has_character_flag = weapon_sword }
			has_artifact = sword_tier_2_new
		}
		AND = {
	        FROM = { has_character_flag = weapon_scimitar } 
        	has_artifact = scimitar_tier_2_new
		}
        AND = {
	        FROM = { has_character_flag = weapon_lance } 
        	has_artifact = lance_tier_2_new
        }
        AND = {
	        FROM = { has_character_flag = weapon_axe } 
        	has_artifact = axe_tier_2_new
        }
       	AND = {
	        FROM = { has_character_flag = weapon_mace } 
        	has_artifact = mace_tier_2_new
        }
        AND = {
        	FROM = { has_character_flag = weapon_bow } 
        	has_artifact = bow_tier_2_new
       	}
       	AND = {
        	FROM = { has_character_flag = armor_set } 
       		has_artifact = armor_tier_2
       	}
    }
}

have_duplicate_smith_artifacts_flag_amazing_optionA_trigger = {
	OR = {
		AND = {
		    FROM = { has_character_flag = weapon_sword }
			has_artifact = sword_tier_4_heartseeker
		}
		AND = {
	        FROM = { has_character_flag = weapon_scimitar } 
        	has_artifact = scimitar_tier_4_golden
		}
        AND = {
	        FROM = { has_character_flag = weapon_lance } 
        	has_artifact = lance_tier_4_impaler
        }
        AND = {
	        FROM = { has_character_flag = weapon_axe } 
        	has_artifact = axe_tier_4_cleaver
        }
       	AND = {
	        FROM = { has_character_flag = weapon_mace } 
        	has_artifact = mace_tier_4_foe_hammer
        }
        AND = {
        	FROM = { has_character_flag = weapon_bow } 
        	has_artifact = bow_tier_4_silent_wind
       	}
       	AND = {
        	FROM = { has_character_flag = armor_set } 
       		has_artifact = armor_tier_4_guardian
       	}
    }
}

have_duplicate_smith_artifacts_flag_amazing_optionB_trigger = {
	OR = {
		AND = {
		    FROM = { has_character_flag = weapon_sword }
			has_artifact = sword_tier_4_vengeance
		}
		AND = {
	        FROM = { has_character_flag = weapon_scimitar } 
        	has_artifact = scimitar_tier_4_fortune
		}
        AND = {
	        FROM = { has_character_flag = weapon_lance } 
        	has_artifact = lance_tier_4_trident
        }
        AND = {
	        FROM = { has_character_flag = weapon_axe } 
        	has_artifact = axe_tier_4_ravager
        }
       	AND = {
	        FROM = { has_character_flag = weapon_mace } 
        	has_artifact = mace_tier_4_bone_breaker
        }
        AND = {
        	FROM = { has_character_flag = weapon_bow } 
        	has_artifact = bow_tier_4_lightning
       	}
       	AND = {
        	FROM = { has_character_flag = armor_set } 
       		has_artifact = armor_tier_4_champion
       	}
    }
}

have_duplicate_smith_artifacts_flag_amazing_optionC_trigger = {
	OR = {
		AND = {
		    FROM = { has_character_flag = weapon_sword }
			has_artifact = sword_tier_4_fury
		}
		AND = {
	        FROM = { has_character_flag = weapon_scimitar } 
        	has_artifact = scimitar_tier_4_conquest
		}
        AND = {
	        FROM = { has_character_flag = weapon_lance } 
        	has_artifact = lance_tier_4_piercer
        }
        AND = {
	        FROM = { has_character_flag = weapon_axe } 
        	has_artifact = axe_tier_4_marauder
        }
       	AND = {
	        FROM = { has_character_flag = weapon_mace } 
        	has_artifact = mace_tier_4_shatterer
        }
        AND = {
        	FROM = { has_character_flag = weapon_bow } 
        	has_artifact = bow_tier_4_eagle
       	}
       	AND = {
        	FROM = { has_character_flag = armor_set } 
       		has_artifact = armor_tier_4_warden
       	}
    }
}

have_duplicate_smith_artifacts_flag_expensive_optionA_trigger = {
	OR = {
		AND = {
		    FROM = { has_character_flag = weapon_sword }
			has_artifact = sword_tier_3_heartseeker
		}
		AND = {
	        FROM = { has_character_flag = weapon_scimitar } 
        	has_artifact = scimitar_tier_3_golden
		}
        AND = {
	        FROM = { has_character_flag = weapon_lance } 
        	has_artifact = lance_tier_3_impaler
        }
        AND = {
	        FROM = { has_character_flag = weapon_axe } 
        	has_artifact = axe_tier_3_cleaver
        }
       	AND = {
	        FROM = { has_character_flag = weapon_mace } 
        	has_artifact = mace_tier_3_foe_hammer
        }
        AND = {
        	FROM = { has_character_flag = weapon_bow } 
        	has_artifact = bow_tier_3_silent_wind
       	}
       	AND = {
        	FROM = { has_character_flag = armor_set } 
       		has_artifact = armor_tier_3_guardian
       	}
    }
}

have_duplicate_smith_artifacts_flag_expensive_optionB_trigger = {
	OR = {
		AND = {
		    FROM = { has_character_flag = weapon_sword }
			has_artifact = sword_tier_3_vengeance
		}
		AND = {
	        FROM = { has_character_flag = weapon_scimitar } 
        	has_artifact = scimitar_tier_3_fortune
		}
        AND = {
	        FROM = { has_character_flag = weapon_lance } 
        	has_artifact = lance_tier_3_trident
        }
        AND = {
	        FROM = { has_character_flag = weapon_axe } 
        	has_artifact = axe_tier_3_ravager
        }
       	AND = {
	        FROM = { has_character_flag = weapon_mace } 
        	has_artifact = mace_tier_3_bone_breaker
        }
        AND = {
        	FROM = { has_character_flag = weapon_bow } 
        	has_artifact = bow_tier_3_lightning
       	}
       	AND = {
        	FROM = { has_character_flag = armor_set } 
       		has_artifact = armor_tier_3_champion
       	}
    }
}

have_duplicate_smith_artifacts_flag_expensive_optionC_trigger = {
	OR = {
		AND = {
		    FROM = { has_character_flag = weapon_sword }
			has_artifact = sword_tier_3_fury
		}
		AND = {
	        FROM = { has_character_flag = weapon_scimitar } 
        	has_artifact = scimitar_tier_3_conquest
		}
        AND = {
	        FROM = { has_character_flag = weapon_lance } 
        	has_artifact = lance_tier_3_piercer
        }
        AND = {
	        FROM = { has_character_flag = weapon_axe } 
        	has_artifact = axe_tier_3_marauder
        }
       	AND = {
	        FROM = { has_character_flag = weapon_mace } 
        	has_artifact = mace_tier_3_shatterer
        }
        AND = {
        	FROM = { has_character_flag = weapon_bow } 
        	has_artifact = bow_tier_3_eagle
       	}
       	AND = {
        	FROM = { has_character_flag = armor_set } 
       		has_artifact = armor_tier_3_warden
       	}
    }
}

can_be_asked_to_leave_court_trigger = {
	NOR = {
		custom_tooltip = { #To avoid double negation
			text = is_a_child_tt
			is_adult = no
		}
		prisoner = yes
		trait = incapable
		is_ruler = yes
		has_job_title = yes

		#custom tooltip for minor titles
		custom_tooltip = {
			text = is_regent_commander_or_physician_tt
			OR = {
				has_minor_title = title_regent
				has_minor_title = title_appointed_regent
				has_minor_title = title_commander
				has_minor_title = title_court_physician
			}
		}

		custom_tooltip = {
			text = is_spouse_consort_or_of_your_dynasty
			OR = {
				is_married = FROM
				is_consort = FROM
				is_close_relative = FROM
				sibling = FROM
			}
		}

		is_primary_heir = yes

		#trigger_if has Reaper's Due
		trigger_if = {
			limit = { has_dlc = "Reapers"}
			in_seclusion = yes
		}
		custom_tooltip = {
			text = is_inaccessible_tt
			OR = {
				has_character_flag = flag_holding_great_tribal_festival
				trait = in_hiding
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				trait = travelling
				trait = troubled_pregnancy
				trait = pregnancy_finishing
				has_character_modifier = mother_minor_rest
				has_character_modifier = in_meditation
				has_character_modifier = doing_penance
				has_character_modifier = out_traveling
			}
		}

		#Special circumstances
		custom_tooltip = {
			text = is_character_in_important_chain_of_events_tt
			has_character_flag = eternal_life_mystic
			has_character_flag = immortal_rival
			has_character_flag = flag_special_event_character
			has_character_flag = is_death
			is_immune_to_pruning = yes
			historical = yes
		}

		trigger_if = {
			limit = {
				trait = horse
			}
			trait = horse
		}
	}
}

has_a_seer_modifier_trigger = {
	OR = {
		has_character_modifier = fulfilled_vision_great
		has_character_modifier = fulfilled_vision_ok
		has_character_modifier = fulfilled_vision_bad
		has_character_modifier = fulfilled_vision_worst
	}
}

has_an_omen_modifier_trigger = {
	OR = {
		has_character_modifier = good_battle_omen
		has_character_modifier = good_relationship_omen
		has_character_modifier = good_power_omen
		has_character_modifier = bad_battle_omen
		has_character_modifier = bad_relationship_omen
		has_character_modifier = bad_power_omen
	}
}

has_positive_omen_modifier_trigger = {
	OR = {
		has_character_modifier = good_battle_omen
		has_character_modifier = good_relationship_omen
		has_character_modifier = good_power_omen
	}
}

has_negative_omen_modifier_trigger = {
	OR = {
		has_character_modifier = bad_battle_omen
		has_character_modifier = bad_relationship_omen
		has_character_modifier = bad_power_omen
	}
}

has_battle_omen_modifier_trigger = {
	OR = {
		has_character_modifier = good_battle_omen
		has_character_modifier = bad_battle_omen
	}
}

has_relationship_omen_modifier_trigger = {
	OR = {
		has_character_modifier = good_relationship_omen
		has_character_modifier = bad_relationship_omen
	}
}

has_power_omen_modifier_trigger = {
	OR = {
		has_character_modifier = good_power_omen
		has_character_modifier = bad_power_omen
	}
}

has_bottom_tier_education_trait_trigger = {
	OR = {
		trait = naive_appeaser
		trait = misguided_warrior
		trait = indulgent_wastrel
		trait = amateurish_plotter
		trait = detached_priest
	}
}

has_2nd_tier_education_trait_trigger = {
	OR = {
		trait = underhanded_rogue
		trait = tough_soldier
		trait = thrifty_clerk
		trait = flamboyant_schemer
		trait = martial_cleric
	}
}

has_3rd_tier_education_trait_trigger = {
	custom_tooltip = {
		text = tribute_interaction_level4_education_tt
		hidden_trigger = {	
			OR = {
				trait = charismatic_negotiator
				trait = skilled_tactician
				trait = fortune_builder
				trait = intricate_webweaver
				trait = scholarly_theologian
			}
		}
	}
}

has_top_tier_education_trait_trigger = {
	custom_tooltip = {
		text = tribute_interaction_level4_education_tt
		hidden_trigger = {
			OR = {
				trait = elusive_shadow
				trait = grey_eminence
				trait = midas_touched
				trait = brilliant_strategist
				trait = mastermind_theologian
			}
		}
	}
}

has_medium_education_trait_trigger = {
	OR = {
		has_2nd_tier_education_trait_trigger = yes
		has_3rd_tier_education_trait_trigger = yes
	}
}

has_childhood_horoscope_modifier_trigger = {
	OR = {
		has_character_modifier = guided_by_horoscope_diplomacy
		has_character_modifier = guided_by_horoscope_martial
		has_character_modifier = guided_by_horoscope_stewardship
		has_character_modifier = guided_by_horoscope_intrigue
		has_character_modifier = guided_by_horoscope_learning
	}
}

is_born_in_january_trigger = {
	month_of_birth = 1
	NOT = { month_of_birth = 2 }
}
is_born_in_february_trigger = {
	month_of_birth = 2
	NOT = { month_of_birth = 3 }
}
is_born_in_march_trigger = {
	month_of_birth = 3
	NOT = { month_of_birth = 4 }
}
is_born_in_april_trigger = {
	month_of_birth = 4
	NOT = { month_of_birth = 5 }
}
is_born_in_may_trigger = {
	month_of_birth = 5
	NOT = { month_of_birth = 6 }
}
is_born_in_june_trigger = {
	month_of_birth = 6
	NOT = { month_of_birth = 7 }
}
is_born_in_july_trigger = {
	month_of_birth = 7
	NOT = { month_of_birth = 8 }
}
is_born_in_august_trigger = {
	month_of_birth = 8
	NOT = { month_of_birth = 9 }	
}
is_born_in_september_trigger = {
	month_of_birth = 9
	NOT = { month_of_birth = 10 }	
}
is_born_in_october_trigger = {
	month_of_birth = 10
	NOT = { month_of_birth = 11 }	
}
is_born_in_november_trigger = {
	month_of_birth = 11
	NOT = { month_of_birth = 12 }	
}
is_born_in_december_trigger = {
	month_of_birth = 12
}

is_born_under_Aries_trigger = {
	OR = {
		AND = {
			is_born_in_march_trigger = yes
			day_of_birth = 20 #including this
		}
		AND = {
			is_born_in_april_trigger = yes
			NOT = { day_of_birth = 19 } #not 19th, so 18th at the latest
		}
	}
}
is_born_under_Taurus_trigger = {
	OR = {
		AND = {
			is_born_in_april_trigger = yes
			day_of_birth = 19
		}
		AND = {
			is_born_in_may_trigger = yes
			NOT = { day_of_birth = 20 }
		}
	}
}
is_born_under_Gemini_trigger = {
	OR = {
		AND = {
			is_born_in_may_trigger = yes
			day_of_birth = 20
		}
		AND = {
			is_born_in_june_trigger = yes
			NOT = { day_of_birth = 21 }
		}
	}
}
is_born_under_Cancer_trigger = {
	OR = {
		AND = {
			is_born_in_june_trigger = yes
			day_of_birth = 21
		}
		AND = {
			is_born_in_july_trigger = yes
			NOT = { day_of_birth = 22 }
		}
	}
}
is_born_under_Leo_trigger = {
	OR = {
		AND = {
			is_born_in_july_trigger = yes
			day_of_birth = 22
		}
		AND = {
			is_born_in_august_trigger = yes
			NOT = { day_of_birth = 22 }
		}
	}
}
is_born_under_Virgo_trigger = {
	OR = {
		AND = {
			is_born_in_august_trigger = yes
			day_of_birth = 22
		}
		AND = {
			is_born_in_september_trigger = yes
			NOT = { day_of_birth = 22 }
		}
	}
}
is_born_under_Libra_trigger = {
	OR = {
		AND = {
			is_born_in_september_trigger = yes
			day_of_birth = 22
		}
		AND = {
			is_born_in_october_trigger = yes
			NOT = { day_of_birth = 23 }
		}
	}
}
is_born_under_Scorpius_trigger = {
	OR = {
		AND = {
			is_born_in_october_trigger = yes
			day_of_birth = 23
		}
		AND = {
			is_born_in_november_trigger = yes
			NOT = { day_of_birth = 22 }
		}
	}
}
is_born_under_Sagittarius_trigger = {
	OR = {
		AND = {
			is_born_in_november_trigger = yes
			day_of_birth = 22
		}
		AND = {
			is_born_in_december_trigger = yes
			NOT = { day_of_birth = 21 }
		}
	}
}
is_born_under_Capricorn_trigger = {
	OR = {
		AND = {
			is_born_in_december_trigger = yes
			day_of_birth = 21
		}
		AND = {
			is_born_in_january_trigger = yes
			NOT = { day_of_birth = 19 }
		}
	}
}
is_born_under_Aquarius_trigger = {
	OR = {
		AND = {
			is_born_in_january_trigger = yes
			day_of_birth = 19
		}
		AND = {
			is_born_in_february_trigger = yes
			NOT = { day_of_birth = 18 }
		}
	}
}
is_born_under_Pisces_trigger = {
	OR = {
		AND = {
			is_born_in_february_trigger = yes
			day_of_birth = 18
		}
		AND = {
			is_born_in_march_trigger = yes
			NOT = { day_of_birth = 20 }
		}
	}
}

is_romantic_zodiac_match_with_root_trigger = {
	OR = {
		AND = {
			is_born_under_Aries_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Gemini_trigger = yes
					is_born_under_Leo_trigger = yes
					is_born_under_Sagittarius_trigger = yes
					is_born_under_Aquarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Taurus_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Cancer_trigger = yes
					is_born_under_Virgo_trigger = yes
					is_born_under_Capricorn_trigger = yes
					is_born_under_Pisces_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Gemini_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Aries_trigger = yes
					is_born_under_Leo_trigger = yes
					is_born_under_Libra_trigger = yes
					is_born_under_Aquarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Cancer_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Taurus_trigger = yes
					is_born_under_Virgo_trigger = yes
					is_born_under_Scorpius_trigger = yes
					is_born_under_Pisces_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Leo_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Aries_trigger = yes
					is_born_under_Gemini_trigger = yes
					is_born_under_Libra_trigger = yes
					is_born_under_Sagittarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Virgo_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Taurus_trigger = yes
					is_born_under_Cancer_trigger = yes
					is_born_under_Scorpius_trigger = yes
					is_born_under_Capricorn_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Libra_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Gemini_trigger = yes
					is_born_under_Leo_trigger = yes
					is_born_under_Sagittarius_trigger = yes
					is_born_under_Aquarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Scorpius_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Cancer_trigger = yes
					is_born_under_Virgo_trigger = yes
					is_born_under_Capricorn_trigger = yes
					is_born_under_Pisces_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Sagittarius_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Aries_trigger = yes
					is_born_under_Leo_trigger = yes
					is_born_under_Libra_trigger = yes
					is_born_under_Aquarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Capricorn_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Taurus_trigger = yes
					is_born_under_Virgo_trigger = yes
					is_born_under_Scorpius_trigger = yes
					is_born_under_Pisces_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Aquarius_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Aries_trigger = yes
					is_born_under_Gemini_trigger = yes
					is_born_under_Libra_trigger = yes
					is_born_under_Sagittarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Pisces_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Taurus_trigger = yes
					is_born_under_Cancer_trigger = yes
					is_born_under_Scorpius_trigger = yes
					is_born_under_Capricorn_trigger = yes
				}
			}
		}
	}
}

is_romantic_zodiac_mismatch_with_root = {
	OR = {
		AND = {
			is_born_under_Aries_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Cancer_trigger = yes
					is_born_under_Capricorn_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Taurus_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Leo_trigger = yes
					is_born_under_Aquarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Gemini_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Virgo_trigger = yes
					is_born_under_Pisces_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Cancer_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Aries_trigger = yes
					is_born_under_Libra_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Leo_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Taurus_trigger = yes
					is_born_under_Scorpius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Virgo_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Gemini_trigger = yes
					is_born_under_Sagittarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Libra_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Cancer_trigger = yes
					is_born_under_Capricorn_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Scorpius_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Leo_trigger = yes
					is_born_under_Aquarius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Sagittarius_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Virgo_trigger = yes
					is_born_under_Pisces_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Capricorn_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Aries_trigger = yes
					is_born_under_Libra_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Aquarius_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Taurus_trigger = yes
					is_born_under_Scorpius_trigger = yes
				}
			}
		}
		AND = {
			is_born_under_Pisces_trigger = yes
			ROOT = {
				OR = {
					is_born_under_Gemini_trigger = yes
					is_born_under_Sagittarius_trigger = yes
				}
			}
		}
	}
}

has_unsafe_secret_religion = {
	NOT = { is_nomadic = yes }
	OR = {
		AND = {
			NOT = { has_dlc = "The Sword of Islam" }
			OR = {
				secret_religion = sunni
				secret_religion = zikri
				secret_religion = yazidi
				secret_religion = shiite
				secret_religion = druze
				secret_religion = hurufi
				secret_religion = ibadi
				secret_religion = kharijite
			}
		}
		AND = {
			NOT = { has_dlc = "Sons of Abraham" }
			OR = {
				secret_religion = jewish
				secret_religion = samaritan
				secret_religion = karaite
			}
		}
		AND = {
			NOT = { has_dlc = "The Old Gods" }
			OR = {
				secret_religion = zoroastrian
				secret_religion = mazdaki
				secret_religion = manichean
				secret_religion = khurmazta
				secret_religion = bon
				secret_religion = bon_reformed
				secret_religion = norse_pagan
				secret_religion = norse_pagan_reformed
				secret_religion = baltic_pagan
				secret_religion = baltic_pagan_reformed
				secret_religion = finnish_pagan
				secret_religion = finnish_pagan_reformed
				secret_religion = slavic_pagan
				secret_religion = slavic_pagan_reformed
				secret_religion = tengri_pagan
				secret_religion = tengri_pagan_reformed
				secret_religion = west_african_pagan
				secret_religion = west_african_pagan_reformed
				secret_religion = zun_pagan
				secret_religion = zun_pagan_reformed
				secret_religion = hellenic_pagan
				secret_religion = hellenic_pagan_reformed
				secret_religion = pagan
				secret_religion = aztec
				secret_religion = aztec_reformed
			}
		}
		AND = {
			NOT = { has_dlc = "Rajas of India" }
			OR = {
				secret_religion = hindu
				secret_religion = buddhist
				secret_religion = jain
			}
		}
		AND = {
			NOT = { has_dlc = "Jade Dragon" }
			secret_religion = taoist
		}
	}
}

#to check type of ingredient... (if more are added, they need to go in here to work with the current system)
is_ingredient_herb_trigger = {
	OR = {
		artifact_type = ingredient_herb1
		artifact_type = ingredient_herb2
		artifact_type = ingredient_herb3
		artifact_type = ingredient_herb4
		artifact_type = ingredient_herb5
		artifact_type = ingredient_herb6
		artifact_type = ingredient_herb7
		artifact_type = ingredient_herb8
		artifact_type = ingredient_herb9
	}
}

is_ingredient_animal_part_trigger = {
	OR = {
		artifact_type = ingredient_animal1
		artifact_type = ingredient_animal2
		artifact_type = ingredient_animal3
		artifact_type = ingredient_animal4
		artifact_type = ingredient_animal5
		artifact_type = ingredient_animal6
		artifact_type = ingredient_animal7
		artifact_type = ingredient_animal8
		artifact_type = ingredient_animal9
	}
}

is_ingredient_powder_trigger = {
	OR = {
		artifact_type = ingredient_metal_exotic1
		artifact_type = ingredient_metal_exotic5
		artifact_type = ingredient_metal_exotic6
		artifact_type = ingredient_metal_exotic7
		artifact_type = ingredient_metal_exotic8
		artifact_type = ingredient_metal_exotic9
	}
}

is_ingredient_liquid_trigger = {
	OR = {
		artifact_type = ingredient_metal_exotic2
		artifact_type = ingredient_metal_exotic3
		artifact_type = ingredient_metal_exotic4
	}
}

#to check which ingredient TO BE selected (via scripted effects)...
has_a_herb_ingredient_trigger = {
	any_artifact = {
		is_ingredient_herb_trigger = yes
	}
}

has_an_animal_part_ingredient_trigger = {
	any_artifact = {
		is_ingredient_animal_part_trigger = yes
	}
}

has_a_powder_ingredient_trigger = {
	any_artifact = {
		is_ingredient_powder_trigger = yes
	}
}

has_a_liquid_ingredient_trigger = {
	any_artifact = {
		is_ingredient_liquid_trigger = yes
	}
}

#to check if HAS selected (via scripted effects) an ingredient...
has_selected_herb_ingredient_1_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_1
		is_ingredient_herb_trigger = yes
	}
}

has_selected_animal_part_ingredient_1_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_1
		is_ingredient_animal_part_trigger = yes
	}
}

has_selected_powder_ingredient_1_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_1
		is_ingredient_powder_trigger = yes
	}
}

has_selected_liquid_ingredient_1_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_1
		is_ingredient_liquid_trigger = yes
	}
}

has_selected_herb_ingredient_2_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_2
		is_ingredient_herb_trigger = yes
	}
}

has_selected_animal_part_ingredient_2_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_2
		is_ingredient_animal_part_trigger = yes
	}
}

has_selected_powder_ingredient_2_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_2
		is_ingredient_powder_trigger = yes
	}
}

has_selected_liquid_ingredient_2_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_2
		is_ingredient_liquid_trigger = yes
	}
}

has_selected_ingredient_1_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_1
	}
}

has_selected_ingredient_2_trigger = {
	any_artifact = {
		has_artifact_flag = selected_ingredient_2
	}
}

selected_ingredient_is_sleep_inducing_trigger = {
	any_artifact = {
		OR = {
			has_artifact_flag = selected_ingredient_1
			has_artifact_flag = selected_ingredient_2
		}
		OR = {
			artifact_type = ingredient_herb7
			artifact_type = ingredient_herb3
			artifact_type = ingredient_herb9			
		}
	}
}

selected_ingredient_is_antipyretic_trigger = {
	any_artifact = {
		OR = {
			has_artifact_flag = selected_ingredient_1
			has_artifact_flag = selected_ingredient_2
		}
		OR = {
			artifact_type = ingredient_herb1
			artifact_type = ingredient_herb2
			artifact_type = ingredient_herb4
			artifact_type = ingredient_herb5
			artifact_type = ingredient_herb8
			artifact_type = ingredient_metal_exotic6
		}
	}
}

selected_ingredient_is_perceived_healthy_trigger = {
	any_artifact = {
		OR = {
			has_artifact_flag = selected_ingredient_1
			has_artifact_flag = selected_ingredient_2
		}
		OR = {
			AND = {
				is_ingredient_herb_trigger = yes
				NOT = { artifact_type = ingredient_herb3 } #Mandrake
			}
			artifact_type = ingredient_metal_exotic8 #Mercury
			artifact_type = ingredient_metal_exotic8 #Iron
			artifact_type = ingredient_metal_exotic6 #Gold

			artifact_type = ingredient_animal2 #Kidney
			artifact_type = ingredient_animal7 #Heart
			artifact_type = ingredient_animal8 #Liver
			artifact_type = ingredient_animal9 #Intestines
		}
	}
}

selected_ingredient_is_unhealthy_trigger = {
	any_artifact = {
		OR = {
			has_artifact_flag = selected_ingredient_1
			has_artifact_flag = selected_ingredient_2
		}
		OR = {
			artifact_type = ingredient_herb3 #Mandrake
			artifact_type = ingredient_metal_exotic8 #Mercury
			artifact_type = ingredient_metal_exotic8 #Iron
			is_ingredient_animal_part_trigger = yes
		}
	}
}

selected_ingredient_1_and_2_are_same = {
	#Checks whether the ingredients selected are same type, such as two Hibiscus (if so, returns true)...
	any_artifact = {
		has_artifact_flag = selected_ingredient_1
		ROOT = {
			any_artifact = {
				has_artifact_flag = selected_ingredient_2
				is_artifact_same_type_as = PREVPREV
			}
		}
	}
}

ingredient_is_sleep_inducing_trigger = {
	OR = {
		artifact_type = ingredient_herb7
		artifact_type = ingredient_herb3
		artifact_type = ingredient_herb9
	}
}

ingredient_is_antipyretic_trigger = {
	OR = {
		artifact_type = ingredient_herb1
		artifact_type = ingredient_herb2
		artifact_type = ingredient_herb4
		artifact_type = ingredient_herb5
		artifact_type = ingredient_herb8
		artifact_type = ingredient_metal_exotic6
	}
}

ingredient_is_perceived_healthy_trigger = {
	OR = {
		AND = {
			is_ingredient_herb_trigger = yes
			NOT = { artifact_type = ingredient_herb3 } #Mandrake
		}
		artifact_type = ingredient_metal_exotic8 #Mercury
		artifact_type = ingredient_metal_exotic8 #Iron
		artifact_type = ingredient_metal_exotic6 #Gold

		artifact_type = ingredient_animal2 #Kidney
		artifact_type = ingredient_animal7 #Heart
		artifact_type = ingredient_animal8 #Liver
		artifact_type = ingredient_animal9 #Intestines
	}
}

ingredient_is_unhealthy_trigger = {
	OR = {
		artifact_type = ingredient_herb3 #Mandrake
		artifact_type = ingredient_metal_exotic8 #Mercury
		artifact_type = ingredient_metal_exotic8 #Iron
		AND = {
			is_ingredient_animal_part_trigger = yes
			NOR = {
				artifact_type = ingredient_animal2 #Kidney
				artifact_type = ingredient_animal7 #Heart
				artifact_type = ingredient_animal8 #Liver
				artifact_type = ingredient_animal9 #Intestines
			}
		}
	}
}

same_true_religion_as_from_trigger = {
	true_religion = FROM
}
same_true_religion_as_root_trigger = {
	true_religion = ROOT
}

religion_openly_norse_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_norse_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
		}
	}
}

religion_openly_baltic_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_baltic_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = baltic_pagan
				religion = baltic_pagan_reformed
			}
		}
	}
}

religion_openly_finnish_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_finnish_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = finnish_pagan
				religion = finnish_pagan_reformed
			}
		}
	}
}

religion_openly_slavic_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_slavic_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = slavic_pagan
				religion = slavic_pagan_reformed
			}
		}
	}
}

religion_openly_tengri_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_tengri_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = tengri_pagan
				religion = tengri_pagan_reformed
			}
		}
	}
}

religion_openly_west_african_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_west_african_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = west_african_pagan
				religion = west_african_pagan_reformed
			}
		}
	}
}

religion_openly_zun_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_zun_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = zun_pagan
				religion = zun_pagan_reformed
			}
		}
	}
}
religion_openly_bon_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_bon_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = bon
				religion = bon_reformed
			}
		}
	}
}
religion_openly_hellenic_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_hellenic_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = hellenic_pagan
				religion = hellenic_pagan_reformed
			}
		}
	}
}

religion_openly_aztec_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_aztec_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = aztec
				religion = aztec_reformed
			}
		}
	}
}

has_dharmic_religion_trigger = {
	OR = {
		religion = hindu
		religion = buddhist
		religion = jain
	}
}

###CHINA TRIGGERS###

#Grace triggers
has_grace_trivial_trigger = {
	has_offmap_currency = { offmap = offmap_china value = 10 }
}
has_grace_minor_trigger = {
	has_offmap_currency = { offmap = offmap_china value = 50 }
}
has_grace_medium_trigger = {
	has_offmap_currency = { offmap = offmap_china value = 150 }
}
has_grace_major_trigger = {
	has_offmap_currency = { offmap = offmap_china value = 500 }
}
has_grace_massive_trigger = { 
	has_offmap_currency = { offmap = offmap_china value = 1000 }
}


#Always put this at the end of your triggers!
china_diplo_interaction_trigger = { 
	offmap_china = {
		governor = { 
			NOT = { war_with = PREVPREV } 
			is_within_diplo_range = PREVPREV
		}
		NOT = { has_policy = china_isolationist }
	}
	conditional_tooltip = { 
		trigger = { government = chinese_imperial_government }
		custom_tooltip = { 
			text = china_offmap_decisions_pretender_emperor_tt
			always = no
		}
	}
}

china_is_suffering_trigger = {
	offmap_china = {
		OR = {
			has_status = china_unrest
			has_status = china_civil_war
			has_status = china_famine
			has_status = china_plague
			has_status = china_mongol_invasion
			has_status = china_jurchen_invasion
		}
	}
}

china_is_fine_trigger = { #"fine", read like "fiii-iine", i.e. China is currently treating the world as their oyster
	offmap_china = {
		OR = {
			has_status = china_golden_age
			has_status = china_stable
		}
		OR = {
			has_policy = china_open
			has_policy = china_expansionist
		}
	}
}

china_is_stable_open_trigger = {
	offmap_china = {
		has_status = china_stable
		has_policy = china_open
	}
}
china_is_stable_expansionist_trigger = {
	offmap_china = {
		has_status = china_stable
		has_policy = china_expansionist
	}
}
china_is_golden_age_open_trigger = {
	offmap_china = {
		has_status = china_golden_age
		has_policy = china_open
	}
}
china_is_golden_age_expansionist_trigger = {
	offmap_china = {
		has_status = china_golden_age
		has_policy = china_expansionist
	}
}


#Found in the 00_offmap_powers file... and the conditions for the decisions
china_offmap_boon_decisions_enabled_trigger = {
	china_offmap_decisions_enabled_trigger = yes
	custom_tooltip = {
		text = china_offmap_boon_decisions_enabled_trigger_cd_tt #From is player character
		FROM = { NOT = { has_character_modifier = jd_china_boon_cd } } #boon cooldown, which is set in each decision (one year!)...
	}
}

#Found in the 00_offmap_powers file... and the conditions for the decisions, use custom tooltip for that decisions cooldown modifier
china_offmap_tribute_decisions_enabled_trigger = {
	china_offmap_decisions_enabled_trigger = yes
}

#What goes into the two triggers above...
china_offmap_decisions_enabled_trigger = { 
	offmap_china = {
		NOT = { has_policy = china_isolationist }
		custom_tooltip = {
			text = china_offmap_decisions_enabled_trigger_war_tt #"Is at peace with §Y[From.GetTitledFirstName]§!"
			NOT = { governor = { war_with = FROM } }
		}
		governor = {
			show_scope_change = no
			is_within_diplo_range = FROM
			hidden_trigger  = { NOT = { character = FROM } } #Governor cannot use boon/tributes decisions
		}
	}
	custom_tooltip = {
		text = china_offmap_boon_decisions_enabled_trigger_raiding_tt
		FROM = {
			NOR = {
				has_character_modifier = china_raid_active
				has_character_modifier = china_raid_grace_cd
			}
		}
	}
	hidden_trigger = { has_dlc = "Jade Dragon" }
	conditional_tooltip = { 
		trigger = { FROM = { primary_title = { has_title_flag = rebel_general_title } } }
		custom_tooltip = { 
			text = china_offmap_decisions_pretender_emperor_tt
			always = no
		}
	}
	conditional_tooltip = { 
		trigger = { FROM = { has_character_modifier = failed_invasion_of_china } }
		custom_tooltip = { 
			text = china_offmap_decisions_failed_invasion_tt
			always = no
		}
	}
}

#Found in the 00_offmap_powers file... and the conditions for the force open china decision
china_offmap_hostile_decisions_enabled_trigger = {
	offmap_china = {
		custom_tooltip = {
			text = china_offmap_decisions_enabled_trigger_war_tt #"Is at peace with §Y[From.GetTitledFirstName]§!"
			NOT = { governor = { war_with = FROM } }
		}
		governor = {
			show_scope_change = no
			is_within_diplo_range = FROM
			hidden_trigger  = { NOT = { character = FROM } } #Governor cannot use boon/tributes decisions
		}
		offmap_ruler = {
			NOT = { dynasty = FROM }
		}
	}
	hidden_trigger = { has_dlc = "Jade Dragon" }
}

#Used with Sending Tribute characters to China...
local_third_party_score_low_trigger = {
	NOT = { check_variable = { which = local_third_party_score value = 91 } }
}
local_third_party_score_medium_trigger = {
	check_variable = { which = local_third_party_score value = 91 }
	NOT = { check_variable = { which = local_third_party_score value = 141 } }
}
local_third_party_score_great_trigger = {
	check_variable = { which = local_third_party_score value = 141 }
}

# For checking the Chinese Emperor's likes & dislikes
is_liked_by_China_trigger = {
	liked_by_offmap = {
        type = offmap_china
    }
    NOT = {
        disliked_by_offmap = {
            type = offmap_china
        }
    }
    offmap_china = {
        show_scope_change = no
        custom_tooltip = { text = emperor_likes_THIS_tt }
    }
}

is_disliked_by_China_trigger = {
	disliked_by_offmap = {
        type = offmap_china
    }
    NOT = {
		liked_by_offmap = {
            type = offmap_china
        }
    }
    offmap_china = {
        show_scope_change = no
        custom_tooltip = { text = emperor_dislikes_THIS_tt }
    }
}

is_liked_and_disliked_by_China = {
    disliked_by_offmap = {
        type = offmap_china
    }
    liked_by_offmap = {
        type = offmap_china
    }
    offmap_china = {
        show_scope_change = no
        custom_tooltip = { text = emperor_has_ambiguous_feelings_of_THIS_tt }
    }
}

#Used in the invasion script...
valid_offmap_china_target = {
	NOT = { character = ROOT }
	NOT = { has_character_modifier = peace_deal_with_china }
	NOT = { has_character_flag = defeated_china }
	NOT = {	is_tributary = { suzerain = ROOT } }
	in_revolt = no
	is_within_diplo_range = ROOT
	is_landed = yes
	higher_tier_than = BARON
	NOT = { primary_title = { has_title_flag = rebel_general_title } } #uses special cb to target
	NOT = { offmap_china = { offmap_ruler = { dynasty = PREVPREV } } }
}

valid_offmap_china_target_location = {
	OR = {
		any_realm_province = { region = custom_chinese_invasion_target_region }
		any_neighbor_independent_ruler = {
			has_landed_title = e_china_west_governor
		}
	}
}

valid_offmap_china_target_location_tributary_chain = {
	OR = {
		#any_realm_province = { region = custom_chinese_invasion_target_region }
		any_neighbor_independent_ruler = {
			has_landed_title = e_china_west_governor
		}
		any_neighbor_independent_ruler = {
			is_tributary = yes
			suzerain = {
				has_landed_title = e_china_west_governor
			}
		}
	}
}

# JADE DRAGON
# EMPEROR LIKES & DISLIKES
likes_concubines = {
	context = concubine # Not a trigger, but used by the 'liked_by_offmap' & 'disliked_by_offmap' triggers
}
likes_eunuchs = {
	context = eunuch # Not a trigger, but used by the 'liked_by_offmap' & 'disliked_by_offmap' triggers
	trait = eunuch
}
likes_wealth = {
	context = wealth # Not a trigger, but used by the 'liked_by_offmap' & 'disliked_by_offmap' triggers
}
likes_tributaries = {
	context = tributary # Not a trigger, but used by the 'liked_by_offmap' & 'disliked_by_offmap' triggers
}
likes_indians = {
	culture_group = indo_aryan_group
}
likes_dravidians = {
	culture_group = dravidian_group
}
likes_tibetans = {
	culture_group = tibetan_group
}
likes_germanics = {
	OR = {
		culture_group = north_germanic
		culture_group = central_germanic
		culture_group = west_germanic
	}
}
likes_latino_iberians = {
	OR = {
		culture_group = latin
		culture_group = iberian
	}
}
likes_byzantines = {
	culture_group = byzantine
}
likes_celts = {
	culture_group = celtic
}
likes_finno_ugrics = {
	OR = {
		culture_group = finno_ugric
		culture_group = magyar
	}
}
likes_altaics = {
	culture_group = altaic
}
likes_balto_slavics = {
	OR = {
		culture_group = baltic
		culture_group = east_slavic
		culture_group = west_slavic
		culture_group = south_slavic
	}
}
likes_arabs = {
	culture_group = arabic
}
likes_iranians = {
	culture_group = iranian
}
likes_africans = {
	OR = {
		culture_group = west_african
		culture_group = east_african
	}
}
likes_mesoamericans = {
	culture_group = mesoamerican
}
likes_muslims = {
	religion_group = muslim
}
likes_christians = {
	religion_group = christian
}
likes_jews = {
	religion_group = jewish_group
}
likes_mazdans = {
	religion_group = zoroastrian_group
}
likes_zoroastrians = {
	religion = zoroastrian
}
likes_mazdakis = {
	religion = mazdaki
}
likes_manicheans = {
	religion = manichean
}
likes_khurmaztans = {
	religion = khurmazta
}
likes_buddhists = {
	religion = buddhist
}
likes_hindus = {
	religion = hindu
}
likes_jains = {
	religion = jain
}
likes_tengris = {
	OR = {
		religion = tengri_pagan
		religion = tengri_pagan_reformed
	}
}
likes_zunists = {
	OR = {
		religion = zun_pagan
		religion = zun_pagan_reformed
	}
}
likes_bon = {
	OR = {
		religion = bon
		religion = bon_reformed
	}
}

is_blood_relative_of_root_trigger = {
	OR = {
		is_ancestor_of = ROOT
		is_descendant_of = ROOT
		sibling = ROOT
		is_cousin_of = ROOT
		is_aunt_uncle_of = ROOT
		is_nibling_of = ROOT
		dynasty = ROOT
	}
}

silk_road_trade_post_trigger = {
	custom_tooltip = {
		text = silk_road_province_desc
		hidden_tooltip = {
			OR = {
				province_id = 1491
				province_id = 1498
				province_id = 1478
				province_id = 1359
				province_id = 1365
				province_id = 1448
				province_id = 1440
				province_id = 1439
				province_id = 678
				province_id = 764
				province_id = 802
				province_id = 596
				province_id = 667
				province_id = 693
				province_id = 649
				province_id = 646
				province_id = 641
				province_id = 630
				province_id = 1180
				province_id = 1127
				province_id = 1220
				province_id = 1114
				province_id = 1221
				province_id = 1446
				province_id = 868
				province_id = 719
				province_id = 1338
				province_id = 1369
				province_id = 858
				province_id = 903
				province_id = 1185
				province_id = 1129
				province_id = 1318
				province_id = 1297
				province_id = 1163
				province_id = 1154
				province_id = 1151
				province_id = 1481
				province_id = 1115
				province_id = 1288
				province_id = 796
				province_id = 1362
				province_id = 728
				province_id = 774
				province_id = 620
				province_id = 1794
				province_id = 775
				province_id = 633
				province_id = 664
				province_id = 644
				province_id = 1797
			}
		}
	}
}

is_any_kinslayer_trigger = {
	OR = {
		trait = kinslayer
		trait = familial_kinslayer
		trait = dynastic_kinslayer
		trait = tribal_kinslayer
	}
}

has_unsafe_religion = {
	NOT = { is_nomadic = yes }
	OR = {
		AND = {
			NOT = { has_dlc = "The Sword of Islam" }
			OR = {
				religion = sunni
				religion = zikri
				religion = yazidi
				religion = shiite
				religion = druze
				religion = hurufi
				religion = ibadi
				religion = kharijite
			}
		}
		AND = {
			NOT = { has_dlc = "Sons of Abraham" }
			OR = {
				religion = jewish
				religion = samaritan
				religion = karaite
			}
		}
		AND = {
			NOT = { has_dlc = "The Old Gods" }
			OR = {
				religion = zoroastrian
				religion = mazdaki
				religion = manichean
				religion = khurmazta
				religion = bon
				religion = bon_reformed
				religion = norse_pagan
				religion = norse_pagan_reformed
				religion = baltic_pagan
				religion = baltic_pagan_reformed
				religion = finnish_pagan
				religion = finnish_pagan_reformed
				religion = slavic_pagan
				religion = slavic_pagan_reformed
				religion = tengri_pagan
				religion = tengri_pagan_reformed
				religion = west_african_pagan
				religion = west_african_pagan_reformed
				religion = zun_pagan
				religion = zun_pagan_reformed
				religion = hellenic_pagan
				religion = hellenic_pagan_reformed
				religion = pagan
				religion = aztec
				religion = aztec_reformed
			}
		}
		AND = {
			NOT = { has_dlc = "Rajas of India" }
			OR = {
				religion = hindu
				religion = buddhist
				religion = jain
			}
		}
		AND = {
			NOT = { has_dlc = "Jade Dragon" }
			religion = taoist
		}
	}
}

courtier_from_china_trigger = {
	custom_tooltip = {
		text = courtier_from_china_trigger_tt
		has_character_flag = originated_from_chinese_court
	}
}

using_unimportant_cb = {
	OR = {
		using_cb = peasant_revolt
		using_cb = heretic_revolt
		using_cb = religious_revolt
		using_cb = liberation_revolt
	}
}

death_in_china_trigger = {
	OR = {
		death_reason = death_went_to_china
		death_reason = death_offmap
		death_reason = death_went_back_to_china
		death_reason = death_in_china_historic
	}
}

death_no_trace_trigger = {
	OR = {
		death_reason = death_missing
		death_reason = death_vanished
	}
}

proselytize_convert_independent_trigger = {
	owner = {
		OR = { 
			FROM = { NOT = { religion_group = pagan_group } } 
			FROM = { has_religion_feature = religion_proselytizing }
		}
		independent = yes
		NOT = { religion = FROM }
		religion_group = pagan_group
		OR = {
			NOT = { religion = aztec }
			year = 1350
		}
		is_reformed_religion = no
		capital_scope = {
			province = ROOT
		}
		controls_religion = no
		FROM = {
			higher_tier_than = COUNT
			OR = {
				independent = yes
				higher_tier_than = DUKE
			}
		}
		NOT = {
			has_opinion_modifier = { who = FROM modifier = opinion_sent_preacher }
		}
		is_within_diplo_range = FROM
	}
}

is_toddler_age_trigger = {
	age = 0
 	NOT = { age = 4 }
}

is_young_child_age_trigger = {
	age = 4
 	NOT = { age = 9 }
}

is_child_age_trigger = {
	age = 9
 	NOT = { age = 12 }
}

is_adolescent_age_trigger = {
	age = 12
 	NOT = { age = 17 }
}

is_teenager_age_trigger = {
	age = 13
 	NOT = { age = 20 }
}

is_grown_up_age_trigger = {
	age = 20
}

is_middle_aged_trigger = {
	age = 40
	NOT = { age = 65 }
}

is_senior_age_trigger = {
	age = 50
}

is_elder_age_trigger = {
	age = 70
}

# Hardcoded trigger for the Execute Imprisoned interaction. Used for the description warning you of kinslaying
# Root - The executioner
# event_target:kinslayer_target - The person being executed
will_add_kinslayer = {
	NOT = { religion_group = muslim }
	OR = {
		AND = {
			NOT = { trait = kinslayer }
			OR = {
				is_ancestor_of = event_target:kinslayer_target
				is_descendant_of = event_target:kinslayer_target
				sibling = event_target:kinslayer_target
			}
		}
		AND = {
			NOR = { 
				trait = kinslayer
				trait = familial_kinslayer
			}
			OR = {
				is_cousin_of = event_target:kinslayer_target
				is_aunt_uncle_of = event_target:kinslayer_target
				is_nibling_of = event_target:kinslayer_target
			}
		}
		AND = {
			NOR = { 
				trait = kinslayer
				trait = familial_kinslayer
				trait = dynastic_kinslayer
			}
			is_lowborn = no
			dynasty = event_target:kinslayer_target
		}
	}
}

# Hardcoded trigger for the Assassinate interaction. Used for triggering whether it can be used at all
# Root - The person being assassinated
# From - The person doing the assassination
assassination_interaction_trigger = {
	conditional_tooltip = {
		trigger = {
			multiplayer = yes
		}
		custom_tooltip = {
			text = MP_GAME_RULE_ALLOWED
			OR = {
				ai = yes
				NOT = {
					has_game_rule = {
						name = multiplayer_assassinations
						value = no_players
					}
				}
			}
			OR = {
				NOT = {
					has_game_rule = {
						name = multiplayer_assassinations
						value = no_players_or_relatives
					}
				}
				AND = {
					ai = yes
					NOT = {
						any_close_relative = {
							ai = no
							NOT = { character = FROM }
						}
					}
					NOT = {
						any_spouse = {
							ai = no
							NOT = { character = FROM }
						}
					}
					NOT = {
						liege = {
							ai = no
							dynasty = ROOT
							NOT = { character = FROM }
						}
						is_heir = yes
					}
				}
			}
		}
	}
}

#checks whether ROOT has one of the following opinion modifiers against the currently scoped character
root_has_terrible_opinion_modifier_of_this_trigger = {
	OR = {
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_hate }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_tortured_me }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_me }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_imprisoned }
	}
}

#checks whether the current scope has one of the following opinion modifiers against ROOT
this_has_terrible_opinion_modifier_of_root_trigger = {
	OR = {
		has_opinion_modifier = { who = ROOT modifier = opinion_hate }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_imprisoned }
	}
}

#for MNM.9000 chain
the_hunt_for_an_artifact_has_made_enough_progress_trigger = {
	OR = {
		AND = {
			event_target:relic_ruler = { check_variable = { which = relic_score value = 8 } } #15 } } old value
			event_target:relic_ruler = { has_character_modifier = relic_rumor_minor } 
		}
		AND = {
			event_target:relic_ruler = { check_variable = { which = relic_score value = 14 } } #25 } } old value
			event_target:relic_ruler = { has_character_modifier = relic_rumor_medium } 
		}
		AND = {
			event_target:relic_ruler = { check_variable = { which = relic_score value = 20 } } #40 } } old value
			event_target:relic_ruler = { has_character_modifier = relic_rumor_major } 
		}
	}
}

has_tribal_or_nomadic_government_trigger = {
	custom_tooltip = {
		text = tribal_or_nomadic_government_tt
		hidden_trigger = {
			OR = {
				government = tribal_government
				government = nomadic_government
			}
		}
	}
}


has_minor_title_relating_to_martial_trigger = { #WIP - feel free to add to this
	OR = {
		has_minor_title = title_master_of_the_horse
		has_minor_title = title_cupbearer
		has_minor_title = title_commander
	}
}


#returns true if scoped character already dislikes ROOT (while not being caught up in a friendship or love, and such)
potentially_interested_in_rivaling_root_trigger = { #must be a character
	NOT = { is_rival = ROOT }
	NOT = { is_lover = ROOT }
	NOT = { is_friend = ROOT }
	NOT = { opinion = { who = ROOT value = 5 } }
	OR = {
		ROOT = { is_foe = PREV } #checks if the current scope has committed a crime against ROOT (I hope)
		is_foe = ROOT  #checks if root has committed a crime against the current scope
		NOT = { opinion = { who = ROOT value = -25 } }
		this_has_terrible_opinion_modifier_of_root_trigger = yes
		#Fill up with fun opinion modifiers, whenever you think of them...! Ideas: opinion_spurned, opinion_revoked_my_title, etc
	}
}
#returns true if scoped character is already disliked by ROOT (while not being caught up in a friendship or love, and such)
root_potentially_interested_in_rivaling_this_trigger = { #must be a character
	NOT = { is_rival = ROOT }
	NOT = { is_lover = ROOT }
	NOT = { is_friend = ROOT }
	NOT = { reverse_opinion = { who = ROOT value = 5 } }
	OR = {
		ROOT = { is_foe = PREV } #checks if the current scope has committed a crime against ROOT (I hope)
		is_foe = ROOT  #checks if root has committed a crime against the current scope
		NOT = { reverse_opinion = { who = ROOT value = -25 } }
		root_has_terrible_opinion_modifier_of_this_trigger = yes
		#Fill up with fun opinion modifiers, whenever you think of them...! Ideas: opinion_spurned, opinion_revoked_my_title, etc
	}
}

#returns true if scoped character and ROOT are both sort of interested in a rivalry
#(they both dislike one another and are not friends, lovers, or rivals already)
current_scope_and_root_make_sense_as_rivals_trigger = {
	potentially_interested_in_rivaling_root_trigger = yes
	root_potentially_interested_in_rivaling_this_trigger = yes
}

#checks whether the current scope has one of the following opinion modifiers against PREV
this_has_friendly_opinion_modifier_of_prev_trigger = {
	OR = {
		has_opinion_modifier = { who = PREV modifier = opinion_budding_friendship }
		has_opinion_modifier = { who = PREV modifier = opinion_was_praised }
		has_opinion_modifier = { who = PREV modifier = opinion_charmed }
		has_opinion_modifier = { who = PREV modifier = opinion_honorable }
		has_opinion_modifier = { who = PREV modifier = opinion_was_rewarded }
		has_opinion_modifier = { who = PREV modifier = nice_adventure }
		has_opinion_modifier = { who = PREV modifier = great_adventure }
		has_opinion_modifier = { who = PREV modifier = epic_adventure }
		has_opinion_modifier = { who = PREV modifier = opinion_accomplice }
		has_opinion_modifier = { who = PREV modifier = opinion_mediator }
		has_opinion_modifier = { who = PREV modifier = opinion_poet_pen_pal }
		has_opinion_modifier = { who = PREV modifier = opinion_calmed }
		has_opinion_modifier = { who = PREV modifier = opinion_cheered_up }
		has_opinion_modifier = { who = PREV modifier = opinion_teach_virtue }
		has_opinion_modifier = { who = PREV modifier = opinion_no_cat }
		has_opinion_modifier = { who = PREV modifier = opinion_feels_appreciated }
		has_opinion_modifier = { who = PREV modifier = opinion_amused }
		has_opinion_modifier = { who = PREV modifier = opinion_swayed_3 }
	}
}

#checks whether PREV has one of the following opinion modifiers against the currently scoped character
prev_has_friendly_opinion_modifier_of_this_trigger = {
	OR = {
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_budding_friendship }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_was_praised }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_charmed }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_honorable }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_was_rewarded }
		reverse_has_opinion_modifier = { who = PREV modifier = nice_adventure }
		reverse_has_opinion_modifier = { who = PREV modifier = great_adventure }
		reverse_has_opinion_modifier = { who = PREV modifier = epic_adventure }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_accomplice }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_mediator }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_poet_pen_pal }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_calmed }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_cheered_up }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_teach_virtue }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_no_cat }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_feels_appreciated }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_amused }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_swayed_3 }
	}
}

#checks whether the current scope has one of the following opinion modifiers against ROOT
this_has_friendly_opinion_modifier_of_root_trigger = {
	OR = {
		has_opinion_modifier = { who = ROOT modifier = opinion_budding_friendship }
		has_opinion_modifier = { who = ROOT modifier = opinion_was_praised }
		has_opinion_modifier = { who = ROOT modifier = opinion_charmed }
		has_opinion_modifier = { who = ROOT modifier = opinion_honorable }
		has_opinion_modifier = { who = ROOT modifier = opinion_was_rewarded }
		has_opinion_modifier = { who = ROOT modifier = nice_adventure }
		has_opinion_modifier = { who = ROOT modifier = great_adventure }
		has_opinion_modifier = { who = ROOT modifier = epic_adventure }
		has_opinion_modifier = { who = ROOT modifier = opinion_accomplice }
		has_opinion_modifier = { who = ROOT modifier = opinion_mediator }
		has_opinion_modifier = { who = ROOT modifier = opinion_poet_pen_pal }
		has_opinion_modifier = { who = ROOT modifier = opinion_calmed }
		has_opinion_modifier = { who = ROOT modifier = opinion_cheered_up }
		has_opinion_modifier = { who = ROOT modifier = opinion_teach_virtue }
		has_opinion_modifier = { who = ROOT modifier = opinion_no_cat }
		has_opinion_modifier = { who = ROOT modifier = opinion_feels_appreciated }
		has_opinion_modifier = { who = ROOT modifier = opinion_amused }
		has_opinion_modifier = { who = ROOT modifier = opinion_swayed_3 }
	}
}

#checks whether ROOT has one of the following opinion modifiers against the currently scoped character
root_has_friendly_opinion_modifier_of_this_trigger = {
	OR = {
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_budding_friendship }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_was_praised }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_charmed }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_honorable }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_was_rewarded }
		reverse_has_opinion_modifier = { who = ROOT modifier = nice_adventure }
		reverse_has_opinion_modifier = { who = ROOT modifier = great_adventure }
		reverse_has_opinion_modifier = { who = ROOT modifier = epic_adventure }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_accomplice }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_mediator }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_poet_pen_pal }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_calmed }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_cheered_up }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_teach_virtue }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_no_cat }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_feels_appreciated }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_amused }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_swayed_3 }
	}
}
#returns true if scoped character already likes ROOT
potentially_platonically_interested_in_root_trigger = {
	NOT = { is_rival = ROOT }
	NOT = { is_friend = ROOT }
	opinion = { who = ROOT value = 10 }
	this_has_terrible_opinion_modifier_of_root_trigger = no

	OR = {
		opinion = { who = ROOT value = 45 }
		this_has_friendly_opinion_modifier_of_root_trigger = yes
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_budding_friendship } #Or if ROOT has this opinion of current scope
	}
}

#returns true if scoped character is already liked by ROOT
root_potentially_platonically_interested_in_this_trigger = {
	NOT = { is_rival = ROOT }
	NOT = { is_friend = ROOT }
	root_has_terrible_opinion_modifier_of_this_trigger = no

	OR = { 
		reverse_opinion = { who = ROOT value = 45 }
		root_has_friendly_opinion_modifier_of_this_trigger = yes
		has_opinion_modifier = { who = ROOT modifier = opinion_budding_friendship } #Or if current scope has this opinion of current ROOT
	}
}

#returns true if scoped character and ROOT are both sort of interested in a rivalry
#(they both dislike one another and are not friends, lovers, or rivals already)
current_scope_and_root_make_sense_as_friendlies_trigger = {
	potentially_platonically_interested_in_root_trigger = yes
	root_potentially_platonically_interested_in_this_trigger = yes
}

# Hardcoded trigger for Pagan baptism. Only used (except where referenced in script) for the Pagan baptism tooltip in the religion window
pagan_baptism_trigger = {
	NOT = { trait = incapable }
	has_regent = no
	war = no
	prisoner = no
	prestige = 500
	conditional_tooltip = {
		trigger = { has_character_flag = ai_flag_refuse_conversion }
		custom_tooltip = {
			text = NOT_TRUE_BELIEVER
			hidden_tooltip = {
				NOT = { has_character_flag = ai_flag_refuse_conversion }
			}
		}
	}
	conditional_tooltip = {
		trigger = { has_character_modifier = baptism_request_cooldown }
		custom_tooltip = {
			text = NOT_ASKED_BAPTISM_RECENTLY
			hidden_tooltip = {  
				NOT = { has_character_modifier = baptism_request_cooldown } 
			} 
		} 
	} 
	custom_tooltip = {
		text = TT_UNREFORMED_PAGAN
		hidden_tooltip = {
			religion_group = pagan_group
			NOT = { is_reformed_religion = yes }
			#NOT = { religion = bon }
		}
	}
	primary_title = { 
		OR = { 
			has_law = tribal_organization_2 
			has_law = tribal_organization_3 
			has_law = tribal_organization_4 
		} 
	}
}

has_fat_for_flag_trigger = { 
	OR = {
		has_character_flag = flag_fat_for_gluttony 
		has_character_flag = flag_fat_for_stress
		has_character_flag = flag_fat_for_depression
		has_character_flag = flag_fat_for_sloth
		has_character_flag = flag_fat_for_hedonism
		has_character_flag = flag_fat_for_carousing
		has_character_flag = flag_fat_for_family 
		has_character_flag = flag_fat_for_content 
		has_character_flag = flag_fat_for_lust
		has_character_flag = flag_fat_for_wroth
		has_character_flag = flag_fat_for_drunkard
		has_character_flag = flag_fat_for_boredom #fallback reason
	}
}

has_malnourished_for_flag_trigger = { 
	OR = {
		has_character_flag = flag_malnourished_for_temperance 
		has_character_flag = flag_malnourished_for_stress
		has_character_flag = flag_malnourished_for_depression
		has_character_flag = flag_malnourished_for_sloth
		has_character_flag = flag_malnourished_for_study
		has_character_flag = flag_malnourished_for_faith
		has_character_flag = flag_malnourished_for_paranoia 
		has_character_flag = flag_malnourished_for_diligence
		has_character_flag = flag_malnourished_for_cannibal
		has_character_flag = flag_malnourished_for_craven
		has_character_flag = flag_malnourished_for_boredom #fallback reason
	}
}

is_child_or_sibling_of_from_trigger = {
	custom_tooltip = {
		text = is_child_or_sibling_of_yours_tt
		OR = {
			is_child_of = FROM
			sibling = FROM
		}
	}
}

should_evolve_cultures_trigger = {
	hidden_tooltip = {
		OR = {
			is_alternate_start = no
			has_alternate_start_parameter = {
				key = culture_names
				value = historical
			}
		}
	}
}

non_historical_culture_names_in_alt_start_trigger = {
	hidden_tooltip = {
		AND = {
			is_alternate_start = yes
			NOT = {
				has_alternate_start_parameter = {
					key = culture_names
					value = historical
				}
			}
		}
	}
}

religions_are_standard_trigger = {
	hidden_tooltip = {
		OR = {
			is_alternate_start = no
			has_alternate_start_parameter = {
				key = religion_names
				value = historical
			}
		}
	}
}

this_has_terrible_opinion_modifier_of_root_extended_trigger = {
	OR = {
		#Personal grievances.

		has_opinion_modifier = { who = ROOT modifier = opinion_hate }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_imprisoned }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder }

		#Family grievances
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_executed_child }

		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_spouse }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_child }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_parent }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_sibling }
	}
}
root_has_terrible_opinion_modifier_of_this_extended_trigger = {
	OR = {
		#Personal grievances.

		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_hate }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_tortured_me }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_me }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_imprisoned }
		reverse_has_opinion_modifier = { who = ROOT modifier = attempted_murder }

		#Family grievances
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_tortured_family }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_tortured_close_kin }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_family }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_close_kin }
		reverse_has_opinion_modifier = { who = ROOT modifier = opinion_executed_child }

		reverse_has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_spouse }
		reverse_has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_child }
		reverse_has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_parent }
		reverse_has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_sibling }
	}
}

this_has_terrible_opinion_modifier_of_prev_extended_trigger = {
	OR = {
		#Personal grievances.

		has_opinion_modifier = { who = PREV modifier = opinion_hate }
		has_opinion_modifier = { who = PREV modifier = opinion_tortured_me }
		has_opinion_modifier = { who = PREV modifier = opinion_mutilated_me }
		has_opinion_modifier = { who = PREV modifier = opinion_imprisoned }
		has_opinion_modifier = { who = PREV modifier = attempted_murder }

		#Family grievances
		has_opinion_modifier = { who = PREV modifier = opinion_tortured_family }
		has_opinion_modifier = { who = PREV modifier = opinion_tortured_close_kin }
		has_opinion_modifier = { who = PREV modifier = opinion_mutilated_family }
		has_opinion_modifier = { who = PREV modifier = opinion_mutilated_close_kin }
		has_opinion_modifier = { who = PREV modifier = opinion_executed_child }

		has_opinion_modifier = { who = PREV modifier = attempted_murder_of_spouse }
		has_opinion_modifier = { who = PREV modifier = attempted_murder_of_child }
		has_opinion_modifier = { who = PREV modifier = attempted_murder_of_parent }
		has_opinion_modifier = { who = PREV modifier = attempted_murder_of_sibling }
	}
}
prev_has_terrible_opinion_modifier_of_this_extended_trigger = {
	OR = {
		#Personal grievances.

		reverse_has_opinion_modifier = { who = PREV modifier = opinion_hate }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_tortured_me }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_mutilated_me }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_imprisoned }
		reverse_has_opinion_modifier = { who = PREV modifier = attempted_murder }

		#Family grievances
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_tortured_family }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_tortured_close_kin }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_mutilated_family }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_mutilated_close_kin }
		reverse_has_opinion_modifier = { who = PREV modifier = opinion_executed_child }

		reverse_has_opinion_modifier = { who = PREV modifier = attempted_murder_of_spouse }
		reverse_has_opinion_modifier = { who = PREV modifier = attempted_murder_of_child }
		reverse_has_opinion_modifier = { who = PREV modifier = attempted_murder_of_parent }
		reverse_has_opinion_modifier = { who = PREV modifier = attempted_murder_of_sibling }
	}
}



# Hardcoded trigger for Coronation alert. Only used (except where referenced in script) for that alert, on top of the "potential" for the coronation decision. If it does not exist, only the decision potential is used
needs_coronation_trigger = {
	age >= 16
}

ruler_has_dedicated_temple_trigger = {
	OR = {
		has_character_modifier = dedicated_to_zeus
		has_character_modifier = dedicated_to_poseidon
		has_character_modifier = dedicated_to_hades
		has_character_modifier = dedicated_to_hermes
		has_character_modifier = dedicated_to_demeter
		has_character_modifier = dedicated_to_athena
		has_character_modifier = dedicated_to_apollo
		has_character_modifier = dedicated_to_arthemis
		has_character_modifier = dedicated_to_ares
		has_character_modifier = dedicated_to_aphrodite
		has_character_modifier = dedicated_to_ephaestus
		has_character_modifier = dedicated_to_hestia
	}
}

martyrs_death_trigger = {
	OR = {
		death_reason = death_sacrificed
  		death_reason = death_sacrificed_norse
  		death_reason = death_sacrificed_ancestors
  		death_reason = death_execution_aztec_sacrifice
  		
	}
}
can_build_hillfort_trigger = {
						OR = { 
							AND = { 
										NOR = { 
											is_building = tb_hillfort_1 
											has_building = tb_hillfort_1 
										}
										location = { TECH_CASTLE_CONSTRUCTION = 0 }
							}
							AND = { 
										has_building = tb_hillfort_1
										NOR = { 
											is_building = tb_hillfort_2 
											has_building = tb_hillfort_2 
										}
										location = { TECH_CASTLE_CONSTRUCTION = 0 }
							}
							AND = { 
										has_building = tb_hillfort_2
										NOR = { 
											is_building = tb_hillfort_3 
											has_building = tb_hillfort_3 
										}
										location = { TECH_CASTLE_CONSTRUCTION = 1 }
							}
							AND = { 
										has_building = tb_hillfort_3
										NOR = { 
												is_building = tb_hillfort_4 
												has_building = tb_hillfort_4 
											}
										location = { TECH_CASTLE_CONSTRUCTION = 1 }
							}
						}
}
can_build_defensive_fortifications_trigger = {
						holding_type = tribal
						hidden_tooltip = { 
							NOR = { 
								is_building = tb_defensive_fortifications_4
								has_building = tb_defensive_fortifications_4
							}
						}
						OR = { 
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_tb_defensive_fortifications_1
									hidden_tooltip = { 
										NOR = { 
											is_building = tb_defensive_fortifications_1 
											has_building = tb_defensive_fortifications_1
										}
										location = { TECH_CASTLE_CONSTRUCTION = 0 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_tb_defensive_fortifications_2 
									hidden_tooltip = { 
										has_building = tb_defensive_fortifications_1
										NOR = { 
											is_building = tb_defensive_fortifications_2 
											has_building = tb_defensive_fortifications_2 
										}
										location = { TECH_CASTLE_CONSTRUCTION = 0 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_tb_defensive_fortifications_3
									hidden_tooltip = { 
										has_building = tb_defensive_fortifications_2
										NOR = { 
											is_building = tb_defensive_fortifications_3 
											has_building = tb_defensive_fortifications_3 
										}
										location = { TECH_CASTLE_CONSTRUCTION = 1 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_tb_defensive_fortifications_4
									hidden_tooltip = { 
										has_building = tb_defensive_fortifications_3
										NOR = { 
											is_building = tb_defensive_fortifications_4 
											has_building = tb_defensive_fortifications_4 
										}
										location = { TECH_CASTLE_CONSTRUCTION = 1 }
									}
								}
							}
						}
}
can_build_walls_trigger = {
						holding_type = castle
						hidden_tooltip = { NOT = { has_building = ca_wall_5 } }
						OR = { 
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_1
									hidden_tooltip = { 
										NOR = { 
											is_building = ca_wall_1 
											has_building = ca_wall_1
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 0 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_2
									hidden_tooltip = { 
										has_building = ca_wall_1
										NOR = { 
											is_building = ca_wall_2 
											has_building = ca_wall_2
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_3
									hidden_tooltip = { 
										has_building = ca_wall_2
										NOR = { 
											is_building = ca_wall_3 
											has_building = ca_wall_3
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 4 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_4
									hidden_tooltip = { 
										has_building = ca_wall_3
										NOR = { 
											is_building = ca_wall_4 
											has_building = ca_wall_4
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 6 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_5
									hidden_tooltip = { 
										has_building = ca_wall_4
										NOR = { 
											is_building = ca_wall_5 
											has_building = ca_wall_5
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 8 }
									}
								}
							}
						}
}
can_build_castle_fortifications_trigger = {
						holding_type = castle
						hidden_tooltip = { 
							NOR = { 
								is_building = ca_wall_q_5
								has_building = ca_wall_q_5
							}
						}
						OR = { 
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_q_1
									hidden_tooltip = { 
										NOR = { 
											is_building = ca_wall_q_1
											has_building = ca_wall_q_1
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 0 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_q_2
									hidden_tooltip = { 
										has_building = ca_wall_q_1
										NOR = { 
											is_building = ca_wall_q_2 
											has_building = ca_wall_q_2
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_q_3
									hidden_tooltip = { 
										has_building = ca_wall_q_2
										NOR = { 
											is_building = ca_wall_q_3 
											has_building = ca_wall_q_3
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
									}
								}
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_q_4
									hidden_tooltip = { 
										has_building = ca_wall_q_3
										NOR = { 
											is_building = ca_wall_q_4 
											has_building = ca_wall_q_4 
										}
									}
								}
								location = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
							}
							AND = { 
								custom_tooltip = { 
									text = tooltip_can_build_ca_wall_q_5
									hidden_tooltip = { 
										has_building = ca_wall_q_4
										NOR = { 
											is_building = ca_wall_q_5 
											has_building = ca_wall_q_5
										}
										location = { TECH_FORTIFICATIONS_CONSTRUCTION = 7 }
									}
								}
							}
						}
}

personal_grievance_trigger = {
	OR = {
		has_opinion_modifier = { who = ROOT modifier = opinion_hate }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_imprisoned }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder }
	}
}

family_grievance_trigger = {
	OR = {
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_executed_child }

		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_spouse }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_child }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_parent }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_sibling }
	}
}

no_grievance_trigger = {
	NOR = {
		personal_grievance_trigger = yes
		family_grievance_trigger = yes
	}
}

is_inaccessible_or_incapable_trigger = {
	OR = {  
		is_inaccessible_trigger = yes
		trait = incapable
		prisoner = yes
	}
}

lower_educational_trait_trigger = {
	OR = {
		AND = {
			trait = naive_appeaser
			ROOT = {
				OR = {
					trait = underhanded_rogue
					trait = charismatic_negotiator
					trait = grey_eminence
				}
			}
		}
		AND = {
			trait = underhanded_rogue 
			ROOT = {
				OR = {
					trait = charismatic_negotiator
					trait = grey_eminence
				}
			}
		}
		AND = {
			trait = charismatic_negotiator
			ROOT = {
				trait = grey_eminence
			}
		}
		AND = {
			trait = misguided_warrior
			ROOT = {
				OR = {
					trait = tough_soldier
					trait = skilled_tactician
					trait = brilliant_strategist
				}
			}
		}
		AND = {
			trait = tough_soldier
			ROOT = {
				OR = {
					trait = skilled_tactician
					trait = brilliant_strategist
				}
			}
		}
		AND = {
			trait = skilled_tactician
			ROOT = {
				trait = brilliant_strategist
			}
		}
		AND = {
			trait = indulgent_wastrel
			ROOT = {
				OR = {
					trait = thrifty_clerk
					trait = fortune_builder
					trait = midas_touched
				}
			}
		}
		AND = {
			trait = thrifty_clerk
			ROOT = {
				OR = {
					trait = fortune_builder
					trait = midas_touched
				}
			}
		}
		AND = {
			trait = fortune_builder
			ROOT = {
				trait = midas_touched
			}
		}
		AND = {
			trait = amateurish_plotter
			ROOT = {
				OR = {
					trait = flamboyant_schemer
					trait = intricate_webweaver
					trait = elusive_shadow
				}
			}
		}
		AND = {
			trait = flamboyant_schemer
			ROOT = {
				OR = {
					trait = intricate_webweaver
					trait = elusive_shadow
				}
			}
		}
		AND = {
			trait = intricate_webweaver
			ROOT = {
				trait = elusive_shadow
			}
		}
		AND = {
			trait = detached_priest
			ROOT = {
				OR = {
					trait = martial_cleric
					trait = scholarly_theologian
					trait = mastermind_theologian
				}
			}
		}
		AND = {
			trait = martial_cleric
			ROOT = {
				OR = {
					trait = scholarly_theologian
					trait = mastermind_theologian
				}
			}
		}
		AND = {
			trait = scholarly_theologian
			ROOT = {
				trait = mastermind_theologian
			}
		}
	}
}

has_scarred_trait_trigger = {
	OR = {  
		trait = scarred
		trait = scarred_mid
		trait = scarred_high
	}
}

this_is_warrior_culture_trigger = { #Not really about culture - Used in AI voting logic.
	NOT = { pacifist = yes }
	OR = { 
		religion_group = muslim
		religion = norse_pagan
		religion = tengri_pagan
		religion = aztec
		has_religion_feature = religion_warlike
		is_tribal = yes
		is_nomadic = yes
		AND = { 
			NOT = { has_dlc = "Holy Fury"}
			religion = norse_pagan_reformed
		}
		AND = { 
			NOT = { has_dlc = "Holy Fury"}
			religion = tengri_pagan_reformed
		}
		AND = { 
			NOT = { has_dlc = "Holy Fury"}
			religion = aztec_reformed
		}
	}
}

this_is_diplomatic_culture_trigger = { #Not really about culture - Used in AI voting logic.
	OR = {
		is_feudal = yes
		is_patrician = yes
		is_merchant_republic = yes
	} 
	OR = { 
		religion_group = christian
		religion_group = jewish_group
		religion_group = zoroastrian_group
		religion = hellenic_pagan
		has_religion_feature = religion_cosmopolitan
		AND = { 
			NOT = { has_dlc = "Holy Fury"}
			religion = hellenic_pagan_reformed
		}
	}
}
this_is_spiritual_culture_trigger = { #Not really about culture - Used in AI voting logic.
	OR = { 
		religion_group = indian_group
		religion = bon
		has_religion_feature = religion_peaceful
		AND = { 
			NOT = { has_dlc = "Holy Fury"}
			religion = bon_reformed
		}
	}
}
this_is_sea_raider_trigger = {
	OR = { 
		trait = pirate
		trait = viking
		trait = ravager
		trait = seaking
		trait = sea_queen
	}
}

can_apply_lame_nickname_trigger = {
	has_nickname = no
}

can_apply_average_nickname_trigger = {
	OR = {
		has_nickname = no
		this_has_lame_nickname_trigger = yes
	}	
}

can_apply_cool_nickname_trigger = {
	OR = {
		has_nickname = no
		this_has_lame_nickname_trigger = yes
		this_has_average_nickname_trigger = yes
	}
}

can_apply_super_cool_nickname_trigger = {
	OR = {
		has_nickname = no
		this_has_lame_nickname_trigger = yes
		this_has_average_nickname_trigger = yes
		this_has_cool_nickname_trigger = yes
	}
}

this_has_lame_nickname_trigger = {
	OR = { 
		has_nickname = nick_the_avenger
		has_nickname = nick_the_brave
		has_nickname = nick_the_fearless
		has_nickname = nick_the_unlucky
		has_nickname = nick_the_lucky
		has_nickname = nick_the_restorer
		has_nickname = nick_the_effeminate
		has_nickname = nick_the_clueless
		has_nickname = nick_the_ill_tempered
		has_nickname = nick_the_affable
		has_nickname = nick_the_liberator
		has_nickname = nick_the_glorious
		has_nickname = nick_the_german
		has_nickname = nick_the_younger
		has_nickname = nick_the_youthful
		has_nickname = nick_the_unfaithful
		has_nickname = nick_the_beguiling
		has_nickname = nick_the_temptress
		has_nickname = nick_the_seducer
		has_nickname = nick_the_lewd
		has_nickname = nick_the_lecher
		has_nickname = nick_the_unchaste
		has_nickname = nick_the_culture			
		has_nickname = nick_the_rel_group		
		has_nickname = nick_the_pilgrim
		has_nickname = nick_the_viking
		has_nickname = nick_the_decadent
		has_nickname = nick_the_shrewd
		has_nickname = nick_the_wily
		has_nickname = nick_the_jovial
		has_nickname = nick_the_jolly
		has_nickname = nick_the_gracious
		has_nickname = nick_the_rash
		has_nickname = nick_the_ruthless
		has_nickname = nick_the_strange
		has_nickname = nick_the_shieldmaiden
		has_nickname = nick_the_clumsy
		has_nickname = nick_the_evil
		has_nickname = nick_the_culture_marauder
		has_nickname = nick_the_kingslayer
		has_nickname = nick_iron_hand
		has_nickname = nick_peg_leg
		has_nickname = nick_the_goldsmith
		has_nickname = nick_the_weaponsmith
		has_nickname = nick_the_armorsmith
		has_nickname = nick_the_trader
		has_nickname = nick_the_lisp_and_lame
		has_nickname = nick_the_able
		has_nickname = nick_the_kind
		has_nickname = nick_the_good
		has_nickname = nick_the_strong
		has_nickname = nick_the_magnanimous
		has_nickname = nick_the_simple
		has_nickname = nick_the_merry
		has_nickname = nick_the_noble
		has_nickname = nick_the_blind
		has_nickname = nick_the_leper
		has_nickname = nick_the_gentle
		has_nickname = nick_the_proud
		has_nickname = nick_the_silent
		has_nickname = nick_the_bastard
		has_nickname = nick_the_gouty
		has_nickname = nick_half_hand
		has_nickname = nick_the_chaste
		has_nickname = nick_the_hunter
		has_nickname = nick_the_fowler
		has_nickname = nick_the_just
		has_nickname = nick_the_lame
		has_nickname = nick_the_handsome
		has_nickname = nick_the_fair
		has_nickname = nick_the_hideous
		has_nickname = nick_the_frog
		has_nickname = nick_the_tenacious
		has_nickname = nick_the_repulsive
		has_nickname = nick_the_mad
		has_nickname = nick_the_fat
		has_nickname = nick_the_hollow
		has_nickname = nick_the_drunkard
		has_nickname = nick_the_cruel
		has_nickname = nick_the_wise
		has_nickname = nick_the_resilient
		has_nickname = nick_one_eye
		has_nickname = nick_one_hand
		has_nickname = nick_one_leg
		has_nickname = nick_the_wicked 
		has_nickname = nick_the_bewitched 
		has_nickname = nick_priest_hater 
		has_nickname = nick_the_pious 
		has_nickname = nick_the_blessed 
		has_nickname = nick_the_monk 
		has_nickname = nick_the_nun 
		has_nickname = nick_the_ill_ruler 
		has_nickname = nick_the_terrible 
		has_nickname = nick_the_oppressor 
		has_nickname = nick_the_witch 
		has_nickname = nick_the_magnificent 
		has_nickname = nick_the_careless 
		has_nickname = nick_the_young 
		has_nickname = nick_the_old 
		has_nickname = nick_the_hunchback 
		has_nickname = nick_the_scholar 
		has_nickname = nick_the_black 
		has_nickname = nick_the_healer 
		has_nickname = nick_the_unmercenary_healer 
		has_nickname = nick_the_understanding 
		has_nickname = nick_the_merciful 
		has_nickname = nick_the_flat_chested 
		has_nickname = nick_the_oakskin
		has_nickname = nick_the_green_faced 
		has_nickname = nick_the_word_thief 
		has_nickname = nick_the_pups_gut 
		has_nickname = nick_the_jittery
		has_nickname = nick_the_broken_lute
		has_nickname = nick_the_dust_biter
		has_nickname = nick_the_sleepy
		has_nickname = nick_the_squealer
		has_nickname = nick_the_toothless
		has_nickname = nick_butter_teeth
		has_nickname = nick_the_cowardly
		has_nickname = nick_the_squirmy
		has_nickname = nick_the_frantic 
		has_nickname = nick_the_spare 
		has_nickname = nick_the_dry_throat 
		has_nickname = nick_the_floor_kisser 
		has_nickname = nick_the_toothless_wolf 
		has_nickname = nick_the_rough_hair
		has_nickname = nick_the_singing_crow
		has_nickname = nick_the_broken_nail
		has_nickname = nick_the_forgetful
		has_nickname = nick_the_thin_minded
		has_nickname = nick_the_messy 
		has_nickname = nick_the_feeble
		has_nickname = nick_the_milkdrinker
		has_nickname = nick_the_girls_arm
		has_nickname = nick_the_flower
		has_nickname = nick_the_hermit
		has_nickname = nick_the_recluse
		has_nickname = nick_the_absolved
		has_nickname = nick_the_short_tempered
		has_nickname = nick_the_red_cheeks
		has_nickname = nick_the_blushing
		has_nickname = nick_the_shrinking_violet
		has_nickname = nick_the_whiner
		has_nickname = nick_the_moaner
		has_nickname = nick_the_liar
		has_nickname = nick_the_cheater
		has_nickname = nick_the_vain
		has_nickname = nick_the_twitchy
	}
}
this_has_average_nickname_trigger = {
	OR = {
		has_nickname = nick_the_troubadour
		has_nickname = nick_the_holy
		has_nickname = nick_the_usurper
		has_nickname = nick_the_conqueror
		has_nickname = nick_the_victorious
		has_nickname = nick_the_crusader
		has_nickname = nick_the_martyr
		has_nickname = nick_the_heathen
		has_nickname = nick_the_jackal
		has_nickname = nick_the_saint
		has_nickname = nick_the_maid
		has_nickname = nick_darc
		has_nickname = nick_ring
		has_nickname = nick_of_the_wilds
		has_nickname = nick_the_impaler
		has_nickname = nick_bloodaxe
		has_nickname = nick_the_fox
		has_nickname = nick_the_headless
		has_nickname = nick_the_beheader
		has_nickname = nick_the_red
		has_nickname = nick_the_defender
		has_nickname = nick_the_legendary
		has_nickname = nick_the_slayer_of_culture
		has_nickname = nick_the_butcher
		has_nickname = nick_the_vengeful
		has_nickname = nick_the_betrayer
		has_nickname = nick_the_flayer
		has_nickname = nick_the_tormentor
		has_nickname = nick_the_mutilator
		has_nickname = nick_the_depraved
		has_nickname = nick_the_monster
		has_nickname = nick_the_abomination
		has_nickname = nick_the_inquisitor
		has_nickname = nick_the_purifier
		has_nickname = nick_the_tiger
		has_nickname = nick_the_explorer
		has_nickname = nick_the_astrologer	
		has_nickname = nick_the_terrain_commander
		has_nickname = nick_the_ground_warrior
		has_nickname = nick_lord_lady_of_the_terrain
		has_nickname = nick_lord_lady_ground
		has_nickname = nick_warrior_lodge_spirit
		has_nickname = nick_the_cannibal
		has_nickname = nick_the_frail
		has_nickname = nick_the_weak
		has_nickname = nick_the_brute
		has_nickname = nick_the_mule
		has_nickname = nick_the_wealthy
		has_nickname = nick_the_loyal
		has_nickname = nick_the_lord_of_realm
		has_nickname = nick_the_beanstalk 
		has_nickname = nick_the_accursed 
		has_nickname = nick_the_apostle 
		has_nickname = nick_the_confessor 
		has_nickname = nick_the_ironside 
		has_nickname = nick_the_lion 
		has_nickname = nick_the_bold 
		has_nickname = nick_the_unready 
		has_nickname = nick_the_tyrant 
		has_nickname = nick_the_quarreller 
		has_nickname = nick_the_devil 
		has_nickname = nick_the_great 
		has_nickname = nick_the_giant 
		has_nickname = nick_tiny 
		has_nickname = nick_the_shield_of_capital 
		has_nickname = nick_the_myrrh_streaming 
		has_nickname = nick_the_god_bearing 
		has_nickname = nick_the_righteous 
		has_nickname = nick_the_venerable 
		has_nickname = nick_the_spark_of_god 
		has_nickname = nick_the_right_believing 
		has_nickname = nick_the_miracle_worker 
		has_nickname = nick_the_pest
		has_nickname = nick_the_little_crow
		has_nickname = nick_the_piglet
		has_nickname = nick_the_splinter
		has_nickname = nick_the_word_master
		has_nickname = nick_the_mead_master
		has_nickname = nick_the_horse_gelder
		has_nickname = nick_the_undefeated
		has_nickname = nick_the_thigh_biter
		has_nickname = nick_the_hundred_flagons
		has_nickname = nick_the_bottomless
		has_nickname = nick_the_silver_tongue
		has_nickname = nick_the_bard
		has_nickname = nick_the_fairest_of_location
		has_nickname = nick_the_tamer
		has_nickname = nick_the_strongest_of_location
		has_nickname = nick_the_beef_thrasher
		has_nickname = nick_the_dove
		has_nickname = nick_the_stallion
		has_nickname = nick_the_harth_of_location
		has_nickname = nick_the_star_weaver
		has_nickname = nick_the_quick_fingers
		has_nickname = nick_the_strongarm
		has_nickname = nick_the_iron_grip
		has_nickname = nick_the_knuckle_slammer
		has_nickname = nick_the_gods_arm
		has_nickname = nick_the_bone_squeezer
		has_nickname = nick_the_bull
		has_nickname = nick_the_butch
		has_nickname = nick_the_protector
		has_nickname = nick_the_guardian
		has_nickname = nick_the_sharp_tongue
		has_nickname = nick_the_trickster
		has_nickname = nick_the_merciless
		has_nickname = nick_the_word_slayer
		has_nickname = nick_the_grinner
		has_nickname = nick_the_poison_tooth
		has_nickname = nick_the_vixen
		has_nickname = nick_the_hyena
		has_nickname = nick_the_guide
		has_nickname = nick_the_elder
		has_nickname = nick_the_knight_of_turnips
		has_nickname = nick_the_festive
		has_nickname = nick_the_burden
		has_nickname = nick_the_snake
	}
}
this_has_cool_nickname_trigger = {
	OR = { 
		has_nickname = nick_the_lawgiver
		has_nickname = nick_the_hammer
		has_nickname = nick_the_stranger
		has_nickname = nick_the_bald
		has_nickname = nick_the_stammerer
		has_nickname = nick_the_master_of_hungary
		has_nickname = nick_hildetand
		has_nickname = nick_the_shadow
		has_nickname = nick_the_whisperer
		has_nickname = nick_the_spider
		has_nickname = nick_the_sword_of_god
		has_nickname = nick_the_sea_devil
		has_nickname = nick_the_lioness
		has_nickname = nick_the_flail_of
		has_nickname = nick_the_scourge_of
		has_nickname = nick_the_scourge
		has_nickname = nick_the_alchemist
		has_nickname = nick_the_survivor
		has_nickname = nick_the_valkyrie
		has_nickname = nick_the_destroyer
		has_nickname = nick_the_scourge_of_god
		has_nickname = nick_the_terror_of_provincename
		has_nickname = nick_son_of_evilgod
		has_nickname = nick_the_cleansing_flame
		has_nickname = nick_the_witch_hunter
		has_nickname = nick_the_eastern_wind
		has_nickname = nick_the_despoiler
		has_nickname = nick_the_bane_of_realmname
		has_nickname = nick_the_heavenly
		has_nickname = nick_the_great_beast
		has_nickname = nick_the_great_eagle
		has_nickname = nick_the_artist_ruler
		has_nickname = nick_the_ambitious
		has_nickname = nick_the_bloody
		has_nickname = nick_the_diplomat
		has_nickname = nick_the_kind_hearted
		has_nickname = nick_the_generous
		has_nickname = nick_the_executioner
		has_nickname = nick_iron_fist
		has_nickname = nick_stone_fist
		has_nickname = nick_the_bulwark
		has_nickname = nick_the_tower
		has_nickname = nick_the_wall_of_title
		has_nickname = nick_the_underdog
		has_nickname = nick_of_a_thousand_faces
		has_nickname = nick_the_plaguebearer
		has_nickname = nick_the_persevering
		has_nickname = nick_twistedbeard 
		has_nickname = nick_the_bear 
		has_nickname = nick_the_boar 
		has_nickname = nick_the_faceless 
		has_nickname = nick_the_cyclops 
		has_nickname = nick_the_lionheart 
		has_nickname = nick_the_dragon 
		has_nickname = nick_the_dragoness 
		has_nickname = nick_the_undying 
		has_nickname = nick_the_wolf 
		has_nickname = the_timely_rain 
		has_nickname = the_jade_unicorn 
		has_nickname = the_wizard 
		has_nickname = the_big_halberd 
		has_nickname = beautiful_beard 
		has_nickname = the_tattooed_monk 
		has_nickname = the_unrestrained 
		has_nickname = nick_the_roaring_flame 
		has_nickname = nick_the_goliath 
		has_nickname = nick_the_mythological_creature 
		has_nickname = nick_the_fool_for_christ 
		has_nickname = nick_the_skull_crusher
		has_nickname = nick_the_quick_foot
		has_nickname = nick_the_bleeder
		has_nickname = nick_the_sharp_teeth
		has_nickname = nick_the_crimson_flurry
		has_nickname = nick_the_champion_of_province
		has_nickname = nick_the_bone_gnasher
		has_nickname = nick_the_gods_champion
		has_nickname = nick_the_red_gladiator
		has_nickname = nick_the_red_gladiatrix
		has_nickname = nick_the_crimson_gorgon
		has_nickname = nick_the_scarlet_eagle
		has_nickname = nick_the_exalted_chosen_of_province
		has_nickname = nick_the_scarlet_painter
		has_nickname = nick_the_ladder_legs
		has_nickname = nick_the_peacock
		has_nickname = nick_the_bellower
	}
}
this_has_super_cool_nickname_trigger = {
	OR = { 
		has_nickname = nick_haardraade
		has_nickname = nick_lodbrok
		has_nickname = nick_the_boneless
		has_nickname = nick_bluetooth
		has_nickname = nick_snake_in_the_eye
		has_nickname = nick_fairhair
		has_nickname = nick_whiteshirt
		has_nickname = nick_the_saoshyant
		has_nickname = nick_hardeknud
		has_nickname = nick_the_world_burner
		has_nickname = nick_the_vatican_prince
		has_nickname = nick_the_vatican_princess
		has_nickname = nick_the_pale_prince
		has_nickname = nick_the_leechlord
		has_nickname = nick_the_black_boar
		has_nickname = nick_the_apostate
		has_nickname = nick_the_hawk_of_quarysh
		has_nickname = nick_the_submissive 			
		has_nickname = nick_the_deliverer			
		has_nickname = nick_the_purified			
		has_nickname = nick_the_illuminated		
		has_nickname = nick_the_exalted			
		has_nickname = nick_the_awoken 			
		has_nickname = nick_the_bleeding_eyes		
		has_nickname = nick_the_sky_rider			
		has_nickname = nick_the_civilized 
		has_nickname = nick_the_missionary 		
		has_nickname = nick_the_proselytizer 		
		has_nickname = nick_the_adjudicator	 	
		has_nickname = nick_the_enlightened				
		has_nickname = nick_the_waking_teacher 	
		has_nickname = nick_the_whirling_spell	
		has_nickname = nick_the_horse_shepherd	
		has_nickname = nick_the_educator 	
		has_nickname = nick_the_white_raven
		has_nickname = nick_the_salt_snake
		has_nickname = nick_the_salt_viper
		has_nickname = nick_the_siren
		has_nickname = nick_the_wyrm
		has_nickname = nick_the_fury
		has_nickname = nick_the_stormforged
		has_nickname = nick_the_tempest_of_capital
		has_nickname = the_panther_head 
		has_nickname = the_thunderbolt 
		has_nickname = the_whirlwind 
		has_nickname = the_black_whirlwind 
		has_nickname = the_winged_tiger 
		has_nickname = the_turbulent_river_dragon 
		has_nickname = the_ferocious_giant 
		has_nickname = the_prodigy 
		has_nickname = nick_of_the_nine_hostages 
		has_nickname = nick_gods_torturer 
		has_nickname = nick_gods_hedonist 
		has_nickname = nick_gods_cannibal 
		has_nickname = nick_gods_drunkard
		has_nickname = nick_papal_lover  
		has_nickname = nick_gods_seducer 
		has_nickname = nick_the_red_storm
		has_nickname = nick_the_scarlet_hands
		has_nickname = nick_the_blood_monger
		has_nickname = nick_the_black_skull
		has_nickname = nick_the_heart_eater
		has_nickname = nick_the_slaughterer
		has_nickname = nick_the_spirit_stalker
		has_nickname = nick_the_soul_flayer
		has_nickname = nick_the_crimson_reaper
		has_nickname = nick_the_dreaded
		has_nickname = nick_the_chest_buster
		has_nickname = nick_the_angel_of_location
		has_nickname = nick_the_chosen_of_gabriel
		has_nickname = nick_the_page_of_lord
		has_nickname = nick_the_maid_of_virgin
		has_nickname = nick_the_messenger_of_christ
		has_nickname = nick_the_deaths_child
		has_nickname = nick_the_snakeling
		has_nickname = nick_the_little_spider
		has_nickname = nick_the_eerie
		has_nickname = nick_the_little_nightmare
		has_nickname = nick_the_ripper
		has_nickname = nick_the_black_widow
		has_nickname = nick_the_ferrante
		has_nickname = nick_the_iron_heart
		has_nickname = nick_the_pale_spider
		has_nickname = nick_the_grim_mistress
		has_nickname = nick_the_young_eagle
		has_nickname = nick_the_green_warrior
		has_nickname = nick_the_warrior_child
		has_nickname = nick_the_young_conqueror
		has_nickname = nick_the_white_knight 
		has_nickname = nick_the_virago
		has_nickname = nick_the_bloodhound
		has_nickname = nick_the_warrior_philosopher
		has_nickname = nick_the_angel
		has_nickname = nick_the_pure
		has_nickname = nick_the_celestial
		has_nickname = nick_the_radiant
		has_nickname = nick_the_innocent
		has_nickname = nick_the_peace_maker
		has_nickname = nick_the_munificent
		has_nickname = nick_the_architect
		has_nickname = nick_the_castellan
		has_nickname = nick_the_carpenter
		has_nickname = nick_the_grandiose
		has_nickname = nick_the_griffin
		has_nickname = nick_the_compassionate
		has_nickname = nick_the_founder
		has_nickname = nick_the_bloodlime
		has_nickname = nick_the_patron_of_arts
		has_nickname = nick_the_bastion_of_capital
		has_nickname = nick_the_holy_mason
		has_nickname = nick_the_grand_patriarch
		has_nickname = nick_the_grand_matriarch
		has_nickname = nick_the_philosopher
		has_nickname = nick_the_theologian
		has_nickname = nick_the_zealot
		has_nickname = nick_the_benevolent
	}
}

#Sex restrictions on Great Tribal Festival activities.
can_enter_festival_physical_competitions_trigger = { 
	is_adult = yes
	OR = {
		AND = {
			is_female = no
			OR = { 
				NOT = { has_religion_feature = religion_matriarchal }
				is_member_of_any_warrior_lodge_trigger = yes
				has_character_flag = special_marshal
			}
		}
		AND = {
			is_female = yes
			OR = { 
				trait = shieldmaiden
				has_religion_feature = religion_matriarchal 
				has_character_flag = special_marshal
				is_member_of_any_warrior_lodge_trigger = yes
			}
		}
	}
}

has_at_least_3_traits_in_common_with_prev_trigger = {
	calc_true_if = { 
		amount = 3
		#Virtues...
		AND = {
			trait = chaste
			PREV = { trait = chaste }
		}
		AND = {
			trait = temperate
			PREV = { trait = temperate }
		}
		AND = {
			trait = charitable
			PREV = { trait = charitable }
		}
		AND = {
			trait = diligent
			PREV = { trait = diligent }
		}
		AND = {
			trait = patient
			PREV = { trait = patient }
		}
		AND = {
			trait = kind
			PREV = { trait = kind }
		}
		AND = {
			trait = humble
			PREV = { trait = humble }
		}

		#sins...
		AND = {
			trait = lustful
			PREV = { trait = lustful }
		}
		AND = {
			trait = gluttonous
			PREV = { trait = gluttonous }
		}
		AND = {
			trait = greedy
			PREV = { trait = greedy }
		}
		AND = {
			trait = slothful
			PREV = { trait = slothful }
		}
		AND = {
			trait = envious
			PREV = { trait = envious }
		}
		AND = {
			trait = wroth
			PREV = { trait = wroth }
		}
		AND = {
			trait = proud
			PREV = { trait = proud }
		}

		#Others traits!
		AND = {
			trait = ambitious
			PREV = { trait = ambitious }
		}
		AND = {
			trait = arbitrary
			PREV = { trait = arbitrary }
		}
		AND = {
			trait = brave
			PREV = { trait = brave }
		}
		AND = {
			trait = content
			PREV = { trait = content }
		}
		AND = {
			trait = craven
			PREV = { trait = craven }
		}
		AND = {
			trait = cruel
			PREV = { trait = cruel }
		}
		AND = {
			trait = cynical
			PREV = { trait = cynical }
		}
		AND = {
			trait = deceitful
			PREV = { trait = deceitful }
		}
		AND = {
			trait = erudite
			PREV = { trait = erudite }
		}
		AND = {
			trait = gregarious
			PREV = { trait = gregarious }
		}
		AND = {
			trait = honest
			PREV = { trait = honest }
		}
		AND = {
			trait = just
			PREV = { trait = just }
		}
		AND = {
			trait = paranoid
			PREV = { trait = paranoid }
		}
		AND = {
			trait = shy
			PREV = { trait = shy }
		}
		AND = {
			trait = stubborn
			PREV = { trait = stubborn }
		}
		AND = {
			trait = trusting
			PREV = { trait = trusting }
		}
		AND = {
			trait = zealous
			PREV = { trait = zealous }
		}
	}
}

has_at_least_3_traits_opposite_prev_trigger = {
	calc_true_if = { 
		amount = 3
		#Virtues...
		AND = {
			trait = chaste
			PREV = { trait = lustful }
		}
		AND = {
			trait = temperate
			PREV = { trait = gluttonous }
		}
		AND = {
			trait = charitable
			PREV = { trait = greedy }
		}
		AND = {
			trait = diligent
			PREV = { trait = slothful }
		}
		AND = {
			trait = patient
			PREV = { trait = wroth }
		}
		AND = {
			trait = kind
			PREV = {
				OR = {
					trait = envious
					trait = cruel
				}
			}
		}
		AND = {
			trait = humble
			PREV = { trait = proud }
		}

		#sins...
		AND = {
			trait = lustful
			PREV = { trait = chaste }
		}
		AND = {
			trait = gluttonous
			PREV = { trait = temperate }
		}
		AND = {
			trait = greedy
			PREV = { trait = charitable }
		}
		AND = {
			trait = slothful
			PREV = { trait = diligent }
		}
		AND = {
			OR = {
				trait = envious
				trait = cruel
			}
			PREV = { trait = kind }
		}
		AND = {
			trait = wroth
			PREV = { trait = patient }
		}
		AND = {
			trait = proud
			PREV = { trait = humble }
		}

		#Others traits!
		AND = {
			trait = ambitious
			PREV = { trait = content }
		}
		AND = {
			trait = arbitrary
			PREV = { trait = just }
		}
		AND = {
			trait = brave
			PREV = { trait = craven }
		}
		AND = {
			trait = content
			PREV = { trait = ambitious }
		}
		AND = {
			trait = craven
			PREV = { trait = brave }
		}
		AND = {
			trait = cynical
			PREV = { trait = zealous }
		}
		AND = {
			trait = deceitful
			PREV = { trait = honest }
		}
		AND = {
			trait = gregarious
			PREV = { trait = shy }
		}
		AND = {
			trait = honest
			PREV = { trait = deceitful }
		}
		AND = {
			trait = just
			PREV = { trait = arbitrary }
		}
		AND = {
			trait = paranoid
			PREV = { trait = trusting }
		}
		AND = {
			trait = shy
			PREV = { trait = gregarious }
		}
		AND = {
			trait = trusting
			PREV = { trait = paranoid }
		}
		AND = {
			trait = zealous
			PREV = { trait = cynical }
		}
	}
}

has_any_sympathy_trait_trigger = { 
	OR = {
		trait = sympathy_christendom
		trait = sympathy_islam
		trait = sympathy_pagans
		trait = sympathy_zoroastrianism
		trait = sympathy_judaism
		trait = sympathy_indian
	}
}

preferred_gender_based_on_laws_trigger = {
	OR = {
		AND = {
			is_female = no
			PREV = {
				OR = {
					has_law = cognatic_succession
					has_law = agnatic_succession
				}
			}
		}
		PREV = { has_law = true_cognatic_succession }
		AND = {
			is_female = yes
			PREV = {
				OR = {
					has_law = enatic_succession
					has_law = enatic_cognatic_succession
				}
			}
		}
	}
}

has_bad_priest_trait_trigger = {
	OR = {
		trait = bad_priest_christian
		trait = bad_priest_muslim
		trait = bad_priest_norse
		trait = bad_priest_tengri
		trait = bad_priest_zoroastrian
		trait = bad_priest_aztec
	}
}

# Referenced by the "button_rename" button in the character view 
can_rename_character_trigger = {
	is_liege_or_above = FROM
	dynasty = FROM
	age < 10
}

is_sick_or_injured_trigger = {
	OR = {
		trait = pneumonic
		trait = syphilitic
		trait = leper
		trait = maimed
		trait = infirm
		trait = incapable
		trait = has_tuberculosis
		trait = has_typhoid_fever
		trait = has_typhus
		trait = has_bubonic_plague
		trait = has_measles
		trait = has_small_pox
		trait = mangled
		trait = severely_injured
		trait = flu
		trait = dysentery
		trait = gout
		trait = food_poisoning
		trait = rabies
		trait = cancer
		trait = scurvy
	}
}

has_fair_trait_trigger = {
	OR = {
		trait = fair
		trait = groomed
	}
}

has_ugly_trait_trigger = {
	OR = {
		trait = ugly
		trait = uncouth
	}
}

parent_for_elective_succession_trigger = {
	NOT = { character = ROOT } #Not the current ruler.
	OR = {
		any_claim = { title = ROOT_FROMFROM }
		AND = { 
			is_close_relative = ROOT
			OR = { 
				dynasty = ROOT
				AND = { is_landed = yes higher_real_tier_than = BARON }
			}
		}
		AND = { 
			higher_real_tier_than = COUNT
			OR = { #Either defacto direct vassal, or independent ruler who is dejure vassal.
				vassal_of = ROOT 
				AND = { 
			 		any_dejure_liege = { title = ROOT } 
					independent = yes
				}
			}
		}
	}
	AND = {
		OR = { #Candidate should not be a landless Courtier that is about to inherit a Theocracy or Republic
			AND = {
				is_ruler = yes
				is_landed = yes
				is_republic = no
				is_merchant_republic = no
				is_theocracy = no
			}
			NOR = {
				any_heir_title = {
					is_republic = yes
				}
				any_heir_title = {
					is_merchant_republic = yes
				}
				any_heir_title = {
					is_theocracy = yes
				}
			}
		}
		OR = { #If the title controls the religion, candidates must be of the same religion.
			ROOT = { 
				NOT = { 
					controls_religion = yes
				}
			}
			ROOT = { 
				religion = PREV
			}
		}
		NOR = {
			trait = cat
			trait = disinherited
			trait = horse
			trait = eunuch
			trait = bastard
			is_ascetic_trigger = yes
			is_theocracy = yes
			is_republic = yes
			is_merchant_republic = yes
		}
	}
}

has_any_leadership_trait_trigger = {
	OR = {
		trait = aggressive_leader
		trait = narrow_flank_leader
		trait = cavalry_leader
		trait = defensive_leader
		trait = desert_terrain_leader
		trait = experimenter
		trait = flanker
		trait = flat_terrain_leader
		trait = heavy_infantry_leader
		trait = holy_warrior
		trait = inspiring_leader
		trait = jungle_terrain_leader
		trait = light_foot_leader
		trait = mountain_terrain_leader
		trait = organizer
		trait = rough_terrain_leader
		trait = siege_leader
		trait = trickster
		trait = unyielding_leader
		trait = logistics_expert
		trait = master_of_flame
		trait = sapper
		trait = levy_coordinator
		trait = war_elephant_leader
		trait = winter_soldier
	}
}

has_any_astrology_trait_trigger = {
	OR = {
		trait = zodiac_aquarius
		trait = zodiac_aries
		trait = zodiac_cancer
		trait = zodiac_capricorn
		trait = zodiac_gemini
		trait = zodiac_leo
		trait = zodiac_libra
		trait = zodiac_pisces
		trait = zodiac_sagittarius
		trait = zodiac_scorpio
		trait = zodiac_taurus
		trait = zodiac_virgo
	}
}

dlc_religion_check_trigger = {
	OR = {
		religion_group = christian
		AND = {
			religion_group = muslim
			has_dlc = "The Sword of Islam"
		}
		AND = {
			religion_group = jewish_group
			has_dlc = "Sons of Abraham"
		}
		AND = {
			religion_group = pagan_group
			OR = {
				has_dlc = "The Old Gods"
				has_dlc = "Holy Fury"
			}
		}
		AND = {
			OR = {
				religion = bon
				religion = bon_reformed
			}
			has_dlc = "Jade Dragon"
		}
		AND = {
			religion_group = zoroastrian_group
			has_dlc = "The Old Gods"
		}
		AND = {
			religion = khurmazta
			has_dlc = "Jade Dragon"
		}
		AND = {
			religion_group = indian_group
			has_dlc = "Rajas of India"
		}
		AND = {
			religion = taoist
			has_dlc = "Jade Dragon"
		}
	}
}

reconquista_check_trigger = {
	any_war = {
		OR = {
			using_cb = reconquista_leon
			using_cb = reconquista_castille
			using_cb = reconquista_aragon
			using_cb = reconquista_galicia
			using_cb = reconquista_beja
			using_cb = reconquista_granada
			using_cb = reconquista_cordoba
			using_cb = reconquista_valencia
			using_cb = reconquista_navarra
			using_cb = reconquista_balearic
		}
	}
}

not_reconquista_check_trigger = {
	NOT = {
		any_war = {
			OR = {
				using_cb = reconquista_leon
				using_cb = reconquista_castille
				using_cb = reconquista_aragon
				using_cb = reconquista_galicia
				using_cb = reconquista_beja
				using_cb = reconquista_granada
				using_cb = reconquista_cordoba
				using_cb = reconquista_valencia
				using_cb = reconquista_navarra
				using_cb = reconquista_balearic
			}
		}
	}
}


this_has_execution_reason_opinion_trigger = {
	OR = { 
		has_opinion_modifier = { who = THIS modifier = opinion_rebel_traitor }
		has_opinion_modifier = { who = THIS modifier = opinion_regicide_traitor }
		has_opinion_modifier = { who = THIS modifier = attempted_murder_of_spouse }
		has_opinion_modifier = { who = THIS modifier = attempted_murder_of_child }
		has_opinion_modifier = { who = THIS modifier = attempted_murder_of_parent }
		has_opinion_modifier = { who = THIS modifier = attempted_murder_of_sibling }
		has_opinion_modifier = { who = THIS modifier = attempted_murder_of_vassal }
		has_opinion_modifier = { who = THIS modifier = attempted_murder }
		has_opinion_modifier = { who = THIS modifier = opinion_spouse_slayer }
		has_opinion_modifier = { who = THIS modifier = opinion_murder_attempt }
		has_opinion_modifier = { who = THIS modifier = opinion_killed_close_kin }
		has_opinion_modifier = { who = THIS modifier = opinion_killed_father }
		has_opinion_modifier = { who = THIS modifier = opinion_hajj_attempt_murder }
		has_opinion_modifier = { who = THIS modifier = opinion_castrated_me }
		has_opinion_modifier = { who = THIS modifier = opinion_blinded_me }
		has_opinion_modifier = { who = THIS modifier = opinion_witch }
		has_opinion_modifier = { who = THIS modifier = opinion_takfir }
		has_opinion_modifier = { who = THIS modifier = opinion_attempted_abduction }
		has_opinion_modifier = { who = THIS modifier = opinion_unfaithful_wife }
		has_opinion_modifier = { who = THIS modifier = opinion_unfaithful_husband_crime }
		has_opinion_modifier = { who = THIS modifier = opinion_cuckolded }
		has_opinion_modifier = { who = THIS modifier = opinion_charge_dw }
		has_opinion_modifier = { who = THIS modifier = opinion_tortured_me }
		has_opinion_modifier = { who = THIS modifier = opinion_mutilated_me }
		has_opinion_modifier = { who = THIS modifier = opinion_mutilated_family }
		has_opinion_modifier = { who = THIS modifier = opinion_mutilated_close_kin }
		has_opinion_modifier = { who = THIS modifier = opinion_outlawed_society }
		has_opinion_modifier = { who = THIS modifier = opinion_accused_apostate }
	}
}

root_has_execution_reason_opinion_trigger = {
	OR = { 
		has_opinion_modifier = { who = ROOT modifier = opinion_rebel_traitor }
		has_opinion_modifier = { who = ROOT modifier = opinion_regicide_traitor }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_spouse }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_child }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_parent }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_sibling }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_vassal }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder }
		has_opinion_modifier = { who = ROOT modifier = opinion_spouse_slayer }
		has_opinion_modifier = { who = ROOT modifier = opinion_murder_attempt }
		has_opinion_modifier = { who = ROOT modifier = opinion_killed_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_killed_father }
		has_opinion_modifier = { who = ROOT modifier = opinion_hajj_attempt_murder }
		has_opinion_modifier = { who = ROOT modifier = opinion_castrated_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_blinded_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_witch }
		has_opinion_modifier = { who = ROOT modifier = opinion_takfir }
		has_opinion_modifier = { who = ROOT modifier = opinion_attempted_abduction }
		has_opinion_modifier = { who = ROOT modifier = opinion_unfaithful_wife }
		has_opinion_modifier = { who = ROOT modifier = opinion_unfaithful_husband_crime }
		has_opinion_modifier = { who = ROOT modifier = opinion_cuckolded }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_dw }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_outlawed_society }
		has_opinion_modifier = { who = ROOT modifier = opinion_accused_apostate }
	}
}

root_has_imprisonment_reason_opinion_trigger = {
	OR = { 
		has_opinion_modifier = { who = ROOT modifier = opinion_dishonorable }
		has_opinion_modifier = { who = ROOT modifier = opinion_traitor }
		has_opinion_modifier = { who = ROOT modifier = opinion_rebel_traitor }
		has_opinion_modifier = { who = ROOT modifier = opinion_regicide_traitor }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_spouse }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_child }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_parent }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_sibling }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder_of_vassal }
		has_opinion_modifier = { who = ROOT modifier = attempted_murder }
		has_opinion_modifier = { who = ROOT modifier = opinion_spouse_slayer }
		has_opinion_modifier = { who = ROOT modifier = opinion_murder_attempt }
		has_opinion_modifier = { who = ROOT modifier = opinion_killed_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_killed_father }
		has_opinion_modifier = { who = ROOT modifier = opinion_hajj_attempt_murder }
		has_opinion_modifier = { who = ROOT modifier = opinion_fatwa_target }
		has_opinion_modifier = { who = ROOT modifier = opinion_refused_order }
		has_opinion_modifier = { who = ROOT modifier = opinion_castrated_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_blinded_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_castrated_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_castrated_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_blinded_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_blinded_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_witch }
		has_opinion_modifier = { who = ROOT modifier = opinion_takfir }
		has_opinion_modifier = { who = ROOT modifier = opinion_attempted_abduction }
		has_opinion_modifier = { who = ROOT modifier = opinion_killed_lover }
		has_opinion_modifier = { who = ROOT modifier = opinion_unfaithful_wife }
		has_opinion_modifier = { who = ROOT modifier = opinion_unfaithful_husband_crime }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_heresiarch }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_infidel }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_deviant }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_illegitimate }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_cultist }
		has_opinion_modifier = { who = ROOT modifier = opinion_cuckolded }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_dw }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_traitor }
		has_opinion_modifier = { who = ROOT modifier = opinion_charge_slanderer }
		has_opinion_modifier = { who = ROOT modifier = abuse_of_office }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_tortured_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_me }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_family }
		has_opinion_modifier = { who = ROOT modifier = opinion_mutilated_close_kin }
		has_opinion_modifier = { who = ROOT modifier = opinion_thief }
		has_opinion_modifier = { who = ROOT modifier = opinion_outlawed_society }
		has_opinion_modifier = { who = ROOT modifier = opinion_accused_apostate }
	}
}

region_africa_west_central_or_east_trigger = {
	OR = {
		region = world_africa_west
		region = world_africa_east
		region = world_africa_central
	}
}

has_rain_or_drought_modifier_trigger = {
	OR = {
		has_province_modifier = africa_light_rain
		has_province_modifier = africa_heavy_rain
		has_province_modifier = africa_drought_risk
		has_province_modifier = africa_drought
	}
}

any_neighbor_province_has_dry_weather_trigger = {
	any_neighbor_province = {
    	is_land = yes
		region_africa_west_central_or_east_trigger = yes
		OR = {
			has_province_modifier = africa_drought_risk
			has_province_modifier = africa_drought
		}
	}
}
any_neighbor_province_has_heavy_rain_trigger = {
	any_neighbor_province = {
    	is_land = yes
		region_africa_west_central_or_east_trigger = yes
		has_province_modifier = africa_heavy_rain
	}
}
any_neighbor_province_has_light_rain_trigger = {
	any_neighbor_province = {
    	is_land = yes
		region_africa_west_central_or_east_trigger = yes
		has_province_modifier = africa_light_rain
	}
}

varangian_guard_events_default_trigger = {
	ai = yes
	age = 16
	is_incapable = no
	prisoner = no
	culture_group = north_germanic
	has_character_flag = serving_varangian
	has_dlc = "The Old Gods"
}


ere_elective_politician_titles_trigger = { #Used in Imperial Elective to determine AI behavior.
	OR = {
		has_job_title = job_marshal
		has_job_title = job_spymaster
		has_job_title = job_treasurer
		has_job_title = job_chancellor
		has_minor_title = title_despot
		has_minor_title = title_sebastokrator
		has_minor_title = title_caesar
		has_minor_title = title_kouropalates
		has_minor_title = title_anthypatos
	} 
}

can_still_be_commander_byzantine_trigger = { 
	NOT = { 
		primary_title = { temporary = yes } 
	}
	liege = { 
		character = FROMFROM 
		has_law = succ_byzantine_elective
	}
	OR = {
		AND = {
			OR = {
				male_can_hold_minor_title_trigger = yes
				female_can_hold_minor_commander_title_trigger = yes
			}
			OR = {
				NOT = { religion = hindu }
				trait = kshatriya
			}
			is_adult = yes
		}
		has_character_flag = special_marshal
	}
	
	prisoner = no
	NOT = { trait = incapable }
 	NOT = { trait = sick_incapable }
	NOT = { is_inaccessible_trigger = yes }
	NOT = { has_character_flag = guru }
	NOT = { has_character_modifier = refusing_to_lead }
	NOR = { 
		war_with = FROMFROM
		any_liege = {  
			war_with = FROMFROM
		}
	}
	OR = { 
		higher_real_tier_than = BARON #Either potential commander is vassal...
		NOT = { #...Or there are no valid vassal candidates that can be commanders.
			custom_tooltip = { 
				text = tooltip_byzantine_empire_can_appoint_commanders
				liege = { 
					any_vassal = { 
						higher_real_tier_than = BARON
						NOT = { 
							primary_title = { temporary = yes } 
						}
						OR = {
							AND = {
								OR = {
									male_can_hold_minor_title_trigger = yes
									female_can_hold_minor_commander_title_trigger = yes
								}
								OR = {
									NOT = { religion = hindu }
									trait = kshatriya
								}
								is_adult = yes
							}
							has_character_flag = special_marshal
						}
						
						prisoner = no
						NOT = { trait = incapable }
						NOT = { is_inaccessible_trigger = yes }
						NOT = { has_character_flag = guru }
						NOT = { has_character_modifier = refusing_to_lead }
						NOR = {
							has_job_title = job_chancellor
							has_job_title = job_marshal
							has_job_title = job_treasurer
							has_job_title = job_spymaster
							has_job_title = job_spiritual
							has_minor_title = title_commander
						}
					} 
				} 
			} 
		}
	}
}

can_still_be_marshal_byzantine_trigger = {
	liege = { 
		character = FROMFROM
		has_law = succ_byzantine_elective
	}
	NOR = { 
		war_with = FROMFROM
		any_liege = {  
			war_with = FROMFROM
		}
	}
	OR = {
		AND = {
			OR = {
				AND = { #Patriarchal religions can only hire males. Matriarchal religions can only hire females.
					is_female = no 
					NOT = { liege = { has_religion_feature = religion_matriarchal } } 
				}
				AND = {
					is_female = yes 
					OR = { 
						liege = { has_religion_feature = religion_matriarchal } 
						liege = { has_religion_feature = religion_equal } 
						liege = { has_religion_feature = religion_feature_bon } 
					} 
				}
				trait = horse # So we can have female glitterhoofs! :D
				OR = {
					AND = {
						religion = cathar
						liege = { religion = cathar }
					}
					AND = {
						religion = messalian
						liege = { religion = messalian }
					}
				}
				AND = {
					liege = {
						primary_title = {
							OR = {
								has_law = status_of_women_3
							}
						}
					}
					OR = {
						liege = {
							OR = {
								dynasty = ROOT
								is_close_relative = ROOT
								any_spouse = { character = ROOT }
								any_consort = { character = ROOT }
							}
						}
						is_landed = yes
						
					}
				}
				OR = {
					AND = { 
						is_female = yes
						liege = { primary_title = { has_law = status_of_women_4 } } 
					}
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
			OR = {
				NOT = { religion = hindu }
				trait = kshatriya
			}
			is_adult = yes
		}
		has_character_flag = special_marshal
	}
	
	independent = no
	prisoner = no
	NOT = { trait = incapable }
 	NOT = { trait = sick_incapable }
	NOT = { trait = in_hiding }
	NOT = { has_character_flag = guru }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { 
		liege = { 
			has_opinion_modifier = {
				who = ROOT	
				modifier = opinion_resigned_from_council 
			} 
		} 
	}
}


is_mongol_empire_leader_trigger = {
	OR = {
		has_landed_title = e_il-khanate
		has_landed_title = e_golden_horde
		has_landed_title = e_mongol_empire
		liege = { has_landed_title = e_il-khanate }
		liege = { has_landed_title = e_golden_horde }
		liege = { has_landed_title = e_mongol_empire }
		top_liege = { has_landed_title = e_il-khanate }
		top_liege = { has_landed_title = e_golden_horde }
		top_liege = { has_landed_title = e_mongol_empire }
	}
}

is_single_player_observer_mode = {
	AND = {
		multiplayer = no
		is_local_human_observer = yes
	}
}

