####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.

#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.
#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.


##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 = 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 = feeble
		trait = dwarf
		trait = clubfooted
		trait = harelip
		trait = hunchback
		trait = lisp
		trait = weak
		trait = lunatic
		trait = possessed
		trait = inbred
		trait = has_aztec_disease
		trait = syphilitic
		trait = leper
		trait = maimed
		trait = drunkard
		trait = gluttonous
		trait = craven
		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
	}
}

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
	}
}

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
		trait = fertile
	}
}

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
		trait = infertile
	}
}

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 = celtic_pagan
				religion = celtic_pagan_reformed
				religion = egyptian_pagan
			}
			trait = holy_crusader
		}
		AND = {
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
				religion = german_pagan
				religion = german_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 = {
			religion = aztec
			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 = {
			religion_group = hellenic_pagan_group
			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
		OR = {
			trait = martial_lady
			trait = martial_lady_tengri
			trait = martial_lady_pagan
			martial = 12
		}
	}
	OR = {
		is_female = no
		AND = {
			is_feminist_trigger = yes
			FROM = { is_feminist_trigger = yes }
		}
		AND = {
			religion = norse_pagan
			FROM = { religion = norse_pagan }
		}
		AND = {
			religion = norse_pagan_reformed
			FROM = { religion = norse_pagan_reformed }
		}
		AND = {
			religion = german_pagan
			FROM = { religion = german_pagan }
		}
		AND = {
			religion = german_pagan_reformed
			FROM = { religion = german_pagan_reformed }
		}
		AND = {
			religion = celtic_pagan
			FROM = { religion = celtic_pagan }
		}
		AND = {
			religion = celtic_pagan_reformed
			FROM = { religion = celtic_pagan_reformed }
		}
		AND = {
			religion_group = zoroastrian_group
			culture_group = iranian
			any_dynasty_member = { higher_tier_than = BARON }
			FROM = { religion_group = zoroastrian_group }
			FROM = { culture_group = iranian }
		}
		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
		primary_title = { NOT = { has_law = council_privileges_1 } }
	}
	NAND = {
		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 = {
	is_adult = yes
	prisoner = no
	liege = { num_of_baron_titles = 1 }
	NOT = { trait = incapable }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { has_character_modifier = planning_claimant_adventure }
	OR = {
		is_female = no
		NOT = { liege = { is_married = ROOT } }
		liege = { ai = no }
	}
	OR = {
		is_female = no
		has_character_flag = special_chancellor
		AND = {
			is_feminist_trigger = yes
			liege = { is_feminist_trigger = yes }
		}
		AND = {
			OR = {
				trait = nun
				trait = desert_mother
				trait = perfecti
				is_landed = yes
				liege = { dynasty = ROOT }
				liege = { is_close_relative = ROOT }
			}
			liege = {
				primary_title = {
					OR = {
						has_law = female_council_law_2
						has_law = female_council_law_3
					}
				}
			}
		}
		OR = {
			liege = {
				primary_title = {
					has_law = female_council_law_4
				}
			}
			has_game_rule = {
				name = gender
				value = all
			}
			has_game_rule = {
				name = gender
				value = plus
			}
		}
	}
	OR = {
		NOT = { religion = waldensian }
		is_theocracy = no
		is_ruler = no
	}
	OR = {
		NOT = { religion = bogomilist }
		NOR = {
			trait = perfecti
			is_theocracy = yes
		}
		liege = {
			religion = bogomilist
			OR = {
				has_law = bogomilist_church_2
				has_law = bogomilist_church_3
				has_law = bogomilist_church_4
			}
		}
	}		
	independent = no
}

can_be_marshal_trigger = {
	is_adult = yes
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = desert_father }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { trait = desert_mother }
	NOT = { trait = pf_neutral }
	NOT = { has_character_flag = guru }
	NOT = { has_character_modifier = planning_claimant_adventure }
	OR = {
		NOT = { religion = hindu }
		trait = kshatriya
	}
	OR = {
		ai = no
		controls_religion = no
		has_called_crusade = no
	}
	OR = {
		is_female = no
		trait = martial_lady
		trait = martial_lady_tengri
		trait = martial_lady_pagan
		has_character_flag = special_marshal
		AND = {
			is_feminist_trigger = yes
			liege = { is_feminist_trigger = yes }
		}
		AND = {
			is_female = yes
			has_global_flag = gender_equality
		}
		AND = {
			OR = {
				is_landed = yes
				liege = { dynasty = ROOT }
				liege = { is_close_relative = ROOT }
			}
			liege = {
				primary_title = {
					has_law = female_council_law_3
				}
			}
		}
		OR = {
			liege = {
				primary_title = {
					has_law = female_council_law_4
				}
			}
			has_game_rule = {
				name = gender
				value = all
			}
			has_game_rule = {
				name = gender
				value = plus
			}
		}
	}
	OR = {
		is_female = no
		has_character_flag = special_marshal
		AND = {
			is_feminist_trigger = yes
			liege = { is_feminist_trigger = yes }
		}
		AND = {
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
				religion = german_pagan
				religion = german_pagan_reformed
			}
			liege = { religion = ROOT }
		}
		AND = {
			religion_group = zoroastrian_group
			culture_group = iranian
			any_dynasty_member = { higher_tier_than = baron }
			liege = {
				religion_group = ROOT
				culture_group = ROOT
			}
		}
		AND = {
			is_female = yes
			has_global_flag = gender_equality
		}
		AND = {
			OR = {
				is_landed = yes
				liege = { dynasty = ROOT }
				liege = { is_close_relative = ROOT }
			}
			liege = {
				primary_title = {
					has_law = female_council_law_3
				}
			}
		}
		OR = {
			liege = {
				primary_title = {
					has_law = female_council_law_4
				}
			}
			has_game_rule = {
				name = gender
				value = all
			}
			has_game_rule = {
				name = gender
				value = plus
			}
		}
	}
	OR = {
		NOT = { religion = bogomilist }
		NOR = {
			trait = perfecti
			is_theocracy = yes
		}
		liege = {
			religion = bogomilist
			OR = {
				has_law = bogomilist_church_2
				has_law = bogomilist_church_3
				has_law = bogomilist_church_4
			}
		}
	}
	independent = no
}

can_be_treasurer_trigger = {
	is_adult = yes
	prisoner = no
	liege = { num_of_baron_titles = 1 }
	NOT = { trait = incapable }
	NOT = { trait = desert_father }
	NOT = { trait = desert_mother }
	NOT = { has_character_flag = guru }
	NOT = { has_character_modifier = resigned_in_anger }
	NOT = { has_character_modifier = planning_claimant_adventure }
	OR = {
		is_female = no
		NOT = { liege = { is_married = ROOT } }
		liege = { ai = no }
	}
	OR = {
		is_female = no
		has_character_flag = special_treasurer
		liege = { is_close_relative = ROOT }
		liege = { is_married = ROOT }
		AND = {
			is_feminist_trigger = yes
			liege = { is_feminist_trigger = yes }
		}
		AND = {
			OR = {
				liege = { dynasty = ROOT }
				trait = nun
				trait = desert_mother
				trait = perfecti
				is_ruler = yes
			}
			liege = {
				primary_title = {
					OR = {
						has_law = female_council_law_2
						has_law = female_council_law_3
					}
				}
			}
		}
		OR = {
			liege = {
				primary_title = {
					has_law = female_council_law_4
				}
			}
			has_game_rule = {
				name = gender
				value = all
			}
			has_game_rule = {
				name = gender
				value = plus
			}
		}
	}
	OR = {
		NOT = { religion = waldensian }
		is_theocracy = no
		is_ruler = no
	}
	OR = {
		NOT = { religion = bogomilist }
		NOR = {
			trait = perfecti
			is_theocracy = yes
		}
		liege = {
			religion = bogomilist
			OR = {
				has_law = bogomilist_church_2
				has_law = bogomilist_church_3
				has_law = bogomilist_church_4
			}
		}
	}
	
	independent = no
}

can_be_spymaster_trigger = {
	is_adult = yes
	prisoner = no
	NOT = { trait = incapable }
	NOT = { trait = desert_father }
	NOT = { trait = desert_mother }
	NOT = { has_character_flag = guru }
	NOT = { has_character_modifier = planning_claimant_adventure }
	OR = {
		is_female = no
		NOT = { liege = { is_married = ROOT } }
		liege = { ai = no }
	}
	OR = {
		is_female = no
		has_character_flag = special_spymaster
		liege = { is_child_of = ROOT }
		liege = { is_married = ROOT }
		AND = {
			is_pagan_religion = yes
			liege = { is_pagan_religion = yes }
		}
		AND = {
			is_feminist_trigger = yes
			liege = { is_feminist_trigger = yes }
		}
		AND = {
			OR = {
				trait = nun
				is_landed = yes
				liege = { dynasty = ROOT }
				liege = { is_close_relative = ROOT }
			}
			liege = {
				primary_title = {
					OR = {
						has_law = female_council_law_1
						has_law = female_council_law_2
						has_law = female_council_law_3
					}
				}
			}
		}
		OR = {
			liege = {
				primary_title = {
					has_law = female_council_law_4
				}
			}
			has_game_rule = {
				name = gender
				value = all
			}
			has_game_rule = {
				name = gender
				value = plus
			}
		}
	}
	OR = {
		intrigue = 10
		trait = amateurish_plotter
		trait = flamboyant_schemer
		trait = intricate_webweaver
		trait = elusive_shadow
	}
	OR = {
		NOT = { religion = bogomilist }
		NOR = {
			trait = perfecti
			is_theocracy = yes
		}
		liege = {
			religion = bogomilist
			OR = {
				has_law = bogomilist_church_2
				has_law = bogomilist_church_3
				has_law = bogomilist_church_4
			}
		}
	}
	independent = no
	NOT = { has_character_modifier = resigned_in_anger }
}

can_be_spiritual_trigger = {
	independent = no
	prisoner = no
	liege = { num_of_baron_titles = 1 }
	liege = { religion = ROOT }
	NOT = { trait = incapable }
	NOT = { has_character_modifier = planning_claimant_adventure }
	NOT = { has_character_modifier = resigned_in_anger }

	OR = {
		is_female = no
		NOT = { liege = { is_married = ROOT } }
		liege = { ai = no }
	}
	OR = {
		AND = {
			is_adult = yes
			OR = {
				NOT = { religion = hindu }
				trait = brahmin
				is_ascetic_trigger = yes
			}
			OR = {
				is_female = no
				religion_allows_female_temple_holders = yes
			}
		}
		has_character_flag = special_spiritual
	}
	OR = {
		is_theocracy = yes
		trait = monk
		trait = nun
		liege = { religion_group = muslim }
		AND = {
			clan = yes
			liege = { is_nomadic = yes }
		}
		AND = {
			religion = lollard
			liege = { religion = lollard }
		}
		AND = {
			is_ruler = no
			has_autocephaly = no
			OR = {
				trait = detached_priest
				trait = martial_cleric
				trait = scholarly_theologian
				trait = mastermind_theologian
			}
		}
		AND = {
			religion = miaphysite
			liege = { religion = miaphysite }
			OR = {
				trait = desert_father
				trait = desert_mother
			}
		}
		AND = {
			religion = monophysite
			liege = { religion = monophysite }
			OR = {
				trait = desert_father
				trait = desert_mother
			}
		}
		AND = {
			religion = cathar
			liege = { religion = cathar }
			trait = perfecti
		}
		AND = {
			religion = bogomilist
			liege = { religion = bogomilist }
			trait = perfecti
		}
	}		
	OR = {
		NOT = { religion_group = muslim }
		NOT = { liege = { religion_group = muslim } }
		trait = detached_priest
		trait = martial_cleric
		trait = scholarly_theologian
		trait = mastermind_theologian
		trait = druze_uqqal
		trait = druze_ajawid
	}
	OR = {
		NOT = { religion = bogomilist }
		NAND = {
			trait = perfecti
			is_theocracy = yes
		}
		liege = {
			religion = bogomilist
			OR = {
				has_law = bogomilist_church_3
				has_law = bogomilist_church_4
			}
		}
	}
}

can_be_council_advisor_trigger = {
	independent = no
	prisoner = no
	NOT = { trait = incapable }
	NOT = { is_inaccessible_trigger = yes }
	NOT = { has_character_modifier = resigned_in_anger }
	OR = {
		is_female = no
		AND = {
			is_feminist_trigger = yes
			liege = { is_feminist_trigger = yes }
		}
		AND = {
			is_landed = yes
			liege = {
				primary_title = {
					OR = {
						has_law = female_council_law_1
						has_law = female_council_law_2
						has_law = female_council_law_3
					}
				}
			}
		}
		OR = {
			liege = {
				primary_title = {
					has_law = female_council_law_4
				}
			}
			has_game_rule = {
				name = gender
				value = all
			}
			has_game_rule = {
				name = gender
				value = plus
			}
		}
	}
	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
		has_character_flag = physician_is_quack
	}
}

physician_good_trigger = { 
	OR = {
		is_learned_trigger = yes
		religion_group = jewish_group
	}
	NOT = { has_character_flag = physician_is_quack }
}

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 = {
				trait = in_hiding
				trait = on_hajj
				trait = on_pilgrimage
				trait = on_indian_pilgrimage
				trait = kow_tow_travels
				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 }
		}
	}
}

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
		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_sacrificed_trigger = {
	OR = {
		death_reason = death_sacrificed
		death_reason = death_sacrificed_norse
		death_reason = death_sacrificed_ancestors
	}	
}

death_accident_trigger = {
	OR = {
		death_reason = death_accident
		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
	}
}

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
		AND = {
			is_landed = yes
			primary_title = {
				has_law = female_council_law_4 
			}
		}
		AND = {
			is_landed = no
			liege = { primary_title = { has_law = female_council_law_4 } }
		}
		has_game_rule = {
			name = gender
			value = all
		}
		has_game_rule = {
			name = gender
			value = plus
		}
		has_global_flag = gender_equality
	}
}

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_yemoja
		has_character_modifier = follower_of_ekwensu
		has_character_modifier = follower_of_orunmila
		has_character_modifier = follower_of_shango
		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_chalcedonian_trigger = {
	true_religion = chalcedonian
}
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_adoptionist_trigger = {
	true_religion = adoptionist
}

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_apostolic_trigger = {
	true_religion = apostolic
}

true_religion_paulician_trigger = {
	true_religion = paulician
}

true_religion_tondrakian_trigger = {
	true_religion = tondrakian
}

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_quranist_trigger = {
	true_religion = quranist
}

true_religion_yazidi_trigger = {
	true_religion = yazidi
}

true_religion_shiite_trigger = {
	true_religion = shiite
}

true_religion_bektashi_trigger = {
	true_religion = bektashi
}

true_religion_druze_trigger = {
	true_religion = druze
}

true_religion_hurufi_trigger = {
	true_religion = hurufi
}

true_religion_qarmatian_trigger = {
	true_religion = qarmatian
}

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_zurvanist_trigger = {
	true_religion = zurvanist
}

true_religion_manichean_trigger = {
	true_religion = manichean
}

true_religion_khurmazta_trigger = {
	true_religion = khurmazta
}

true_religion_bon_trigger = {
	true_religion = bon
}

true_religion_taoist_trigger = {
	true_religion = taoist
}

true_religion_mandaean_trigger = {
	true_religion = mandaean
}

true_religion_hinduism_trigger = {
	true_religion = hindu
}

true_religion_hindu_trigger = {
	true_religion = hindu
}

true_religion_buddhist_trigger = {
	true_religion = buddhist
}

true_religion_jain_trigger = {
	true_religion = jain
}

true_religion_celtic_pagan_trigger = {
	true_religion = celtic_pagan
}

true_religion_celtic_pagan_reformed_trigger = {
	true_religion = celtic_pagan_reformed
}

true_religion_norse_pagan_trigger = {
	true_religion = norse_pagan
}

true_religion_norse_pagan_reformed_trigger = {
	true_religion = norse_pagan_reformed
}

true_religion_german_pagan_trigger = {
	true_religion = german_pagan
}

true_religion_german_pagan_reformed_trigger = {
	true_religion = german_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_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_roman_pagan_trigger = {
	true_religion = roman_pagan
}

true_religion_pagan_trigger = {
	true_religion = pagan
}

true_religion_egyptian_pagan_trigger = {
	true_religion = egyptian_pagan
}

true_religion_berber_pagan_trigger = {
	true_religion = berber_pagan
}

true_religion_arab_pagan_trigger = {
	true_religion = arab_pagan
}

true_religion_jewish_pagan_trigger = {
	true_religion = jewish_pagan
}

true_religion_aten_pagan_trigger = {
	true_religion = aten_pagan
}

true_religion_promethean_pagan_trigger = {
	true_religion = promethean_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_hellenic_pagan_trigger = {
	true_religion_group = hellenic_pagan_group
}

true_religion_group_pagan_group_trigger = {
	true_religion_is_pagan = yes
}

true_religion_group_mesoamerican_group_trigger = {
	true_religion_aztec_trigger = yes
}

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

FROMs_religion_is_playable = {
	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 = { has_dlc = "The Old Gods" }
		}
		AND = { #Means you're not allowed to play the BĂ¶n religion (Pagan)
			FROM = { religion = bon }
			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 }
			NOR = {
				has_dlc = "Rajas of India"
				has_dlc = "Jade Dragon"
			}
		}
		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 }
			NOT = { has_dlc = "Jade Dragon" }
		}
	}
}

###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 } } }
	}
}

is_murder_quest_target_of_prev_trigger = {
	PREV = {
		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 = ugly
		trait = scarred
		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_cult_of_balor
			society_member_of = cult_of_angra_mainyu
			society_member_of = the_trollcrafters
			society_member_of = arab_jinn_sorcerers
			society_member_of = cult_of_titan
			society_member_of = cult_of_apep
		}
	}
}

has_negative_congenital_trigger = {
	OR = {
		trait = ugly
		trait = clubfooted
		trait = hunchback
		trait = dwarf
		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
		society_member_of = monastic_order_apostolic
	}
}
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
	}
}

is_ascetic_trigger = {
	custom_tooltip = {
		text = is_ascetic_tooltip
		OR = {
			trait = monk
			trait = nun
			trait = desert_father
			trait = desert_mother
			trait = perfecti
			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 = {
	has_secret_religion = yes
}

is_christian_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion_group = christian
}

is_muslim_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion_group = muslim
}

is_zoroastrian_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion_group = zoroastrian_group
}

is_indian_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion_group = indian_group
}

is_jewish_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion_group = jewish_group
}

is_norse_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = norse_pagan
		secret_religion = norse_pagan_reformed
	}
}

is_german_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = german_pagan_reformed
		secret_religion = german_pagan
	}
}

is_celtic_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = celtic_pagan_reformed
		secret_religion = celtic_pagan
	}
}

is_slavic_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = slavic_pagan_reformed
		secret_religion = slavic_pagan
	}
}

is_tengri_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = tengri_pagan_reformed
		secret_religion = tengri_pagan
	}
}

is_baltic_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = baltic_pagan_reformed
		secret_religion = baltic_pagan
	}
}

is_finnish_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = finnish_pagan_reformed
		secret_religion = finnish_pagan
	}
}

is_west_african_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = west_african_pagan_reformed
		secret_religion = west_african_pagan
	}
}

is_zun_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = zun_pagan_reformed
		secret_religion = zun_pagan
	}
}

is_aztec_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion = aztec
}


is_bon_secret_religious_society_member_trigger = {
	secret_religion = bon
}

is_taoist_secret_religious_society_member_trigger = {
	secret_religion = taoist
}

is_tibetan_pagan_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion = tibetan_pagan
}

is_khurmazta_secret_religious_society_member_trigger = {
	secret_religion = khurmazta
}

is_hellenic_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion_group = hellenic_pagan_group
}

is_egyptian_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	OR = {
		secret_religion = egyptian_pagan
		secret_religion = aten_pagan
	}
}

is_arab_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion = arab_pagan
}

is_berber_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion = berber_pagan
}

is_jewish_pagan_secret_religious_society_member_trigger = {
	has_secret_religion = yes
	secret_religion = jewish_pagan
}

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_is_pagan = 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_is_pagan = 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_is_pagan = yes
				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 }
}

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_adoptionist
	    	any_character = {
	    		religion = adoptionist
	    	}
	    }
		AND = {
			has_character_flag = character_was_chalcedonian
	    	any_character = {
	    		religion = chalcedonian
	    	}
	    }
	    AND = { 
	    	has_character_flag = character_was_orthodox
	    	any_character = {
	    		religion = orthodox
	    	}
	    }
		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_nestorian
	    	any_character = {
	    		religion = nestorian
	    	}
	    }
		AND = {
			has_character_flag = character_was_messalian
	    	any_character = {
	    		religion = messalian
	    	}
	    }
		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_apostolic
	    	any_character = {
	    		religion = nestorian
	    	}
	    }
		AND = {
			has_character_flag = character_was_paulician
	    	any_character = {
	    		religion = paulician
	    	}
	    }
		AND = {
			has_character_flag = character_was_tondrakian
	    	any_character = {
	    		religion = tondrakian
	    	}
	    }
	    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_quranist
	    	any_character = {
	    		religion = quranist
	    	}
	    }
	    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_bektashi
	    	any_character = {
	    		religion = bektashi
	    	}
	    }
		AND = {
			has_character_flag = character_was_hurufi
	    	any_character = {
	    		religion = hurufi
	    	}
	    }
		AND = {
			has_character_flag = character_was_qarmatian
	    	any_character = {
	    		religion = qarmatian
	    	}
	    }
		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_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_zurvanist
	    	any_character = {
	    		religion = zurvanist
	    	}
	    }
		AND = {
			has_character_flag = character_was_mazdaki
	    	any_character = {
	    		religion = mazdaki
	    	}
	    }
		AND = {
			has_character_flag = character_was_mandaean
	    	any_character = {
	    		religion = mandaean
	    	}
	    }
		AND = {
			has_character_flag = character_was_yazidi
	    	any_character = {
	    		religion = yazidi
	    	}
	    }
		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_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_german_pagan_reformed
	    	any_character = {
	    		religion = german_pagan_reformed
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_celtic_pagan_reformed
	    	any_character = {
	    		religion = celtic_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_german_pagan
	    	any_character = {
	    		religion = german_pagan
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_celtic_pagan
	    	any_character = {
	    		religion = celtic_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_hellenic_pagan
	    	any_character = {
	    		religion = hellenic_pagan
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_roman_pagan
	    	any_character = {
	    		religion = roman_pagan
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_egyptian_pagan
	    	any_character = {
	    		religion = egyptian_pagan
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_promethean_pagan
	    	any_character = {
	    		religion = promethean_pagan
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_aten_pagan
	    	any_character = {
	    		religion = aten_pagan
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_arab_pagan
	    	any_character = {
	    		religion = arab_pagan
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_berber_pagan
	    	any_character = {
	    		religion = berber_pagan
	    	}
	    }
		AND = { 
	    	has_character_flag = character_was_jewish_pagan
	    	any_character = {
	    		religion = jewish_pagan
	    	}
	    }
	}
}

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_decision = {
	age = 16
	OR = {
		FROM = { ai = no }
		hidden_trigger = { ai = no }
		religion_group = muslim
	}
	OR = {
		is_female = no
		has_game_rule = {
			name = gender
			value = all
		}
	}
}

has_assassins_prerequisites_inferface = {
	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 = {
				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 = cannibal_trait
				trait = impaler				
				trait = drunkard
				trait = possessed
				trait = lunatic
			}
			OR = {
				has_vice_trigger = yes
				trait = possessed
				trait = lunatic
				AND = { # Specific Zoroastrian sins
					true_religion_zoroastrian_trigger = yes
					trait = arbitrary # Being unjust is seen as a sin
				}
			}
		}
	}
}

has_satanists_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion_group = christian
		religion_group = jewish_group
		religion = zun_pagan
		religion = zun_pagan_reformed
		secret_religion_group = christian
		secret_religion_group = jewish_group
		secret_religion = zun_pagan
		secret_religion = zun_pagan_reformed
	}
}

has_trollcrafters_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion_openly_norse_or_reformed_trigger = yes
		religion_openly_german_or_reformed_trigger = yes
		secret_religion = norse_pagan
		secret_religion = norse_pagan_reformed
		secret_religion = german_pagan
		secret_religion = german_pagan_reformed
	}
}

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

has_cult_of_balor_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion = celtic_pagan
		religion = celtic_pagan_reformed
		secret_religion = celtic_pagan
		secret_religion = celtic_pagan_reformed
	}
}

has_cult_of_angra_mainyu_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		AND = {
			religion_group = zoroastrian_group
			NOT = { religion = yazidi }
		}
		secret_religion_group = zoroastrian_group
	}
}

has_jinn_sorceror_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion_group = muslim
		religion = arab_pagan
		secret_religion_group = muslim
		secret_religion = arab_pagan
	}
}

has_cult_of_titan_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion_group = hellenic_pagan_group
		secret_religion_group = hellenic_pagan_group
	}
}

has_cult_of_apep_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion = egyptian_pagan
		secret_religion = egyptian_pagan
	}
}

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
		secret_religion = baltic_pagan
		secret_religion = baltic_pagan_reformed
		secret_religion = slavic_pagan
		secret_religion = slavic_pagan_reformed
		secret_religion = finnish_pagan
		secret_religion = finnish_pagan_reformed
	}
}

has_plaguebringers_prerequisites = {
	has_common_devilworship_prerequisites = yes
	OR = {
		religion_openly_tengri_or_reformed_trigger = yes
		secret_religion = tengri_pagan
		secret_religion = tengri_pagan_reformed
	}
}

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
		}
	}
}

#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 }
	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 }
	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 = {
			ROOT = { religion = chalcedonian }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = chalcedonian
			}
		}
		NAND = {
			ROOT = { religion = catholic }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = catholic
			}
		}
		NAND = {
			ROOT = { religion = cathar }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = cathar
			}
		}
		NAND = {
			ROOT = { religion = fraticelli }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = fraticelli
			}
		}
		NAND = {
			ROOT = { religion = waldensian }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = waldensian
			}
		}
		NAND = {
			ROOT = { religion = lollard }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = lollard
			}
		}
		NAND = {
			ROOT = { religion = adoptionist }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = adoptionist
			}
		}
		NAND = {
			ROOT = { religion = orthodox }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = orthodox
			}
		}
		NAND = {
			ROOT = { religion = bogomilist }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = bogomilist
			}
		}
		NAND = {
			ROOT = { religion = monothelite }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = monothelite
			}
		}
		NAND = {
			ROOT = { religion = iconoclast }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = iconoclast				
			}
		}
		NAND = {
			ROOT = { religion = apostolic }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = apostolic
			}
		}
		NAND = {
			ROOT = { religion = paulician }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = paulician
			}
		}
		NAND = {
			ROOT = { religion = tondrakian }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = tondrakian
			}
		}
		NAND = {
			ROOT = { religion = miaphysite }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = miaphysite
			}
		}
		NAND = {
			ROOT = { religion = monophysite }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = monophysite
			}
		}
		NAND = {
			ROOT = { religion = nestorian }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = nestorian
			}
		}
		NAND = {
			ROOT = { religion = messalian }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = messalian
			}
		}
		NAND = {
			ROOT = { religion = sunni }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = sunni
			}
		}
		NAND = {
			ROOT = { religion = zikri }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zikri
			}
		}
		NAND = {
			ROOT = { religion = quranist }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = quranist
			}
		}
		NAND = {
			ROOT = { religion = yazidi }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = yazidi
			}
		}
		NAND = {
			ROOT = { religion = shiite }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = shiite
			}
		}
		NAND = {
			ROOT = { religion = bektashi }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = bektashi
			}
		}
		NAND = {
			ROOT = { religion = druze }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = druze
			}
		}
		NAND = {
			ROOT = { religion = hurufi }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = hurufi
			}
		}
		NAND = {
			ROOT = { religion = qarmatian }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = qarmatian
			}
		}
		NAND = {
			ROOT = { religion = ibadi }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = ibadi
			}
		}
		NAND = {
			ROOT = { religion = kharijite }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = kharijite
			}
		}
		NAND = {
			ROOT = { religion = jewish }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = jewish
			}
		}
		NAND = {
			ROOT = { religion = samaritan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = samaritan				
			}
		}
		NAND = {
			ROOT = { religion = karaite }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = karaite
			}
		}
		NAND = {
			ROOT = { religion = zoroastrian }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zoroastrian				
			}
		}
		NAND = {
			ROOT = { religion = mazdaki }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = mazdaki
			}
		}
		NAND = {
			ROOT = { religion = zurvanist }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zurvanist				
			}
		}
		NAND = {
			ROOT = { religion = manichean }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = manichean				
			}
		}
		NAND = {
			ROOT = { religion = khurmazta }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = khurmazta				
			}
		}
		NAND = {
			ROOT = { religion = bon }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = bon				
			}
		}
		NAND = {
			ROOT = { religion = taoist }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = taoist
				ROOT = { religion = taoist }
			}
		}
		NAND = {
			ROOT = { religion = mandaean }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = mandaean				
			}
		}
		NAND = {
			ROOT = { religion = hindu }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = hindu
			}
		}
		NAND = {
			ROOT = { religion = buddhist }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = buddhist				
			}
		}
		NAND = {
			ROOT = { religion = jain }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = jain
			}
		}
		NAND = {
			ROOT = { OR = { religion = celtic_pagan religion = celtic_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = celtic_pagan
			}
		}
		NAND = {
			ROOT = { OR = { religion = norse_pagan religion = norse_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = norse_pagan
			}
		}
		NAND = {
			ROOT = { OR = { religion = german_pagan religion = german_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = german_pagan
			}
		}
		NAND = {
			ROOT = { OR = { religion = baltic_pagan religion = baltic_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = baltic_pagan				
			}
		}
		NAND = {
			ROOT = { OR = { religion = finnish_pagan religion = finnish_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = finnish_pagan
			}
		}
		NAND = {
			ROOT = { OR = { religion = slavic_pagan religion = slavic_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = slavic_pagan				
			}
		}
		NAND = {
			ROOT = { OR = { religion = tengri_pagan religion = tengri_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = tengri_pagan				
			}
		}
		NAND = {
			ROOT = { OR = { religion = aztec } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = aztec
			}
		}
		NAND = {
			ROOT = { OR = { religion = west_african_pagan religion = west_african_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = west_african_pagan
			}
		}
		NAND = {
			ROOT = { OR = { religion = zun_pagan religion = zun_pagan_reformed } }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zun_pagan
			}
		}
		NAND = {
			ROOT = { religion = hellenic_pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = hellenic_pagan				
			}
		}
		NAND = {
			ROOT = { religion = roman_pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = roman_pagan				
			}
		}
		NAND = {
			ROOT = { religion = egyptian_pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = egyptian_pagan
			}
		}
		NAND = {
			ROOT = { religion = arab_pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = arab_pagan
			}
		}
		NAND = {
			ROOT = { religion = berber_pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = berber_pagan
			}
		}
		NAND = {
			ROOT = { religion = jewish_pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = jewish_pagan
			}
		}
		NAND = {
			ROOT = { religion = aten_pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = aten_pagan
			}
		}
		NAND = {
			ROOT = { religion = promethean_pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = promethean_pagan
			}
		}
		NAND = {
			ROOT = { religion = pagan }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = pagan
			}
		}
		NAND = {
			ROOT = { religion_group = christian }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = christian
			}
		}
		NAND = {
			ROOT = { religion_group = muslim }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = muslim
			}
		}
		NAND = {
			ROOT = { is_pagan_religion = yes }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = pagan_group
			}
		}
		NAND = {
			ROOT = { religion_group = zoroastrian_group }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = zoroastrian_group
			}
		}
		NAND = {
			ROOT = { religion_group = jewish_group }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = jewish_group				
			}
		}
		NAND = {
			ROOT = { religion_group = indian_group }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = indian_group
			}
		}
		NAND = {
			ROOT = { religion_group = mesoamerican_group }
			any_artifact = {
				has_artifact_flag = looted_artifact_tooltip_1
				has_artifact_flag = mesoamerican_group
			}
		}
	}
}

can_be_asked_to_leave_court_trigger = {
	NOR = {
		is_ruler = yes
		is_landed = yes
		has_job_title = yes
		has_minor_title = title_regent
		has_minor_title = title_appointed_regent
		has_minor_title = title_commander
		has_minor_title = title_court_physician
		dynasty = FROM
		is_married = FROM
		is_consort = FROM
		is_adult = no
		is_close_relative = FROM
		has_character_flag = eternal_life_mystic
		has_character_flag = immortal_rival
		trait = horse
		has_character_modifier = in_seclusion
	}
}

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_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_bottom_tier_education_trait_trigger = {
	has_tier_1_education_trigger = yes
}

has_2nd_tier_education_trait_trigger = {
	has_tier_2_education_trigger = yes
}

has_3rd_tier_education_trait_trigger = {
	custom_tooltip = {
		text = tribute_interaction_level4_education_tt
		hidden_trigger = {
			has_tier_3_education_trigger = yes
		}
	}
}

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 = 20 }
		}
	}
}
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_group = muslim
				secret_religion = yazidi
			}
		}
		AND = {
			NOT = { has_dlc = "Sons of Abraham" }
			secret_religion_group = jewish_group
		}
		AND = {
			NOT = { has_dlc = "The Old Gods" }
			OR = {
				secret_is_pagan_religion = yes
				secret_religion_group = zoroastrian_group
				secret_religion = aztec
			}
		}
		AND = {
			NOT = { has_dlc = "Rajas of India" }
			secret_religion_group = indian_group
		}
		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_exotic2 #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_exotic2 #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_exotic2 #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_exotic2 #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_german_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_norse_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = german_pagan
				religion = german_pagan_reformed
			}
		}
	}
}

religion_openly_celtic_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_norse_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = celtic_pagan
				religion = celtic_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_aztec_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_aztec_or_reformed_tooltip
		hidden_trigger = {
			religion = aztec
		}
	}
}

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

###CHINA TRIGGERS###

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


#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
		culture_group = franco_germanic
		culture_group = east_germanic
	}
}
likes_latino_iberians = {
	OR = {
		culture_group = latin
		culture_group = iberian
		culture_group = italian_group
		culture_group = island_romance
		culture_group = east_romance
		culture_group = vasconic
		culture_group = crusader_group
	}
}
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
	culture_group = maghrebi
	culture_group = amazigh
	culture_group = coptic_group
	culture_group = aramaic
}
likes_iranians = {
	culture_group = iranian
	culture_group = tocharian_group
}
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 = {
	religion = bon
}

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
	}
}

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

has_unsafe_religion = {
	NOT = { is_nomadic = yes }
	OR = {
		AND = {
			NOT = { has_dlc = "The Sword of Islam" }
			OR = {
				religion_group = muslim
				religion = yazidi
			}
		}
		AND = {
			NOT = { has_dlc = "Sons of Abraham" }
			secret_religion_group = jewish_group
		}
		AND = {
			NOT = { has_dlc = "The Old Gods" }
			OR = {
				is_pagan_religion = yes
				religion_group = zoroastrian_group
				religion = aztec
			}
		}
		AND = {
			NOT = { has_dlc = "Rajas of India" }
			religion_group = indian_group
		}
		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 = {
		FROM = { NOT = { religion_group = pagan_group } }
		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_senior_age_trigger = {
	age = 50
}

# 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 with 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 }
	}
}

#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 } 
		}
	}
}