﻿### Royal Favor
@xp_gain = 5
@xp_loss = -1

### Realm Ethos
@ruler = 30
@heir = 10
@heir_adv = 15
@councillor = 15
@pvassal = 15
@pvassal_adv = 25
@nruler = -30
@nheir = -10
@ncouncillor = -15
@npvassal = -15
@npvassal_adv = -25

on_game_start_after_lobby = { 
	on_actions = {
		gpt_adv_expansion_traits_start
	 	gpt_adv_royal_favor_start
	}
}

quarterly_playable_pulse = {
	on_actions = {
		gpt_adv_royal_favor_check
    }
	on_actions = {
		delay = { days = 1 }
		gpt_adv_court_skill_check
    }
	on_actions = {
		delay = { days = 2 }
		gpt_adv_army_xp_check
    }
	on_actions = {
		delay = { days = 3 }
	 	gpt_adv_realm_ethos_check
    }
	on_actions = {
		delay = { days = 4 }
	 	gpt_adv_entourage_circle_check
    }
}

yearly_playable_pulse = {
	on_actions = {
		gpt_adv_remove_check
		gpt_adv_remove_check_2
		gpt_adv_royal_favor_nobility
		gpt_adv_royal_favor_merchants
		gpt_adv_royal_favor_knights
		gpt_adv_royal_favor_clergy
		gpt_adv_royal_favor_peasants
		gpt_adv_royal_favor_outlaws
    }
}

gpt_adv_expansion_traits_start = {
	trigger = {
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
	}
	effect = {
		every_ruler = {
			if = {
				limit = {
					is_landless_adventurer = yes
					is_ai = no
				}
				add_trait = gpt_adv_social_strata
				add_trait = gpt_adv_court_skill
			 	add_trait = gpt_adv_army_xp
				add_trait = gpt_adv_realm_ethos
				add_trait = gpt_adv_entourage_circle
				add_character_flag = {
					flag = gpt_adv_rfavor_player_start
					years = 2
				}
			}
		}
	}
}

gpt_adv_royal_favor_start = {
	trigger = {
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
	 #	OR = {
	 #		has_game_rule = gpt_adv_rfavor_player
	 #		has_game_rule = gpt_adv_rfavor_count
	 #	}
	}
	effect = {
		every_ruler = {
			if = {
				limit = {
					is_landless_adventurer = yes
				 #	is_landed = yes
					NOT = { has_game_rule = gpt_adv_rfavor_disabled }
					OR = {
						has_game_rule = gpt_adv_rfavor_count
						is_ai = no
					}
				}
				if = { limit = { NOT = { has_trait = gpt_adv_social_strata } } add_trait = gpt_adv_social_strata }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 45 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 45 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 45 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 45 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 45 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 45 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					government_has_flag = government_is_landless_adventurer
					has_realm_law = camp_purpose_wanderers
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_mercenaries
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_scholars
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_explorers
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_brigands
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_legitimists
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					OR = {
						culture = { has_cultural_tradition = tradition_horse_lords }
						culture = { has_cultural_tradition = tradition_devoted_horsemanship }
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					faith = { has_doctrine_parameter = unreformed }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_bellicose }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_bureaucratic }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_communal }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_spiritual }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_egalitarian }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_stoic }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = brave
						has_trait = ambitious
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = greedy
						has_trait = just
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = arrogant
						has_trait = diligent
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = zealous
						has_trait = trusting
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = deceitful
						has_trait = arbitrary
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = compassionate
						has_trait = humble
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = craven
						has_trait = content
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = generous
						has_trait = arbitrary
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = humble
						has_trait = lazy
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = cynical
						has_trait = paranoid
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = honest
						has_trait = just
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = sadistic
						has_trait = arrogant
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 5 }
			}
		}
	}	
}

gpt_adv_royal_favor_check = {
	trigger = {
		is_landless_adventurer = yes
	 #	is_landed = yes
	 	NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = gpt_adv_rfavor_disabled
					has_game_rule = gpt_adv_rfavor_player
				}
				has_trait = gpt_adv_social_strata
			}
			remove_trait = gpt_adv_social_strata
		}
		if = {
			limit = {
			 #	is_landed = yes
				NOT = { has_game_rule = gpt_adv_rfavor_disabled }
				OR = {
					has_game_rule = gpt_adv_rfavor_count
					is_ai = no
				}
				NOT = { has_trait = gpt_adv_social_strata }
			}

			add_trait = gpt_adv_social_strata

			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -100 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -100 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -100 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -100 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -100 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -100 }

			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 45 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 45 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 45 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 45 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 45 }
			add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 45 }

			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_mercenaries
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_scholars
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_explorers
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_brigands
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					has_realm_law = camp_purpose_legitimists
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -10 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					OR = {
						culture = { has_cultural_tradition = tradition_horse_lords }
						culture = { has_cultural_tradition = tradition_devoted_horsemanship }
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					faith = { has_doctrine_parameter = unreformed }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_bellicose }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_bureaucratic }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_communal }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_spiritual }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_egalitarian }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					culture = { has_cultural_pillar = ethos_stoic }
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 20 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = brave
						has_trait = ambitious
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = greedy
						has_trait = just
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = arrogant
						has_trait = diligent
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = zealous
						has_trait = trusting
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = deceitful
						has_trait = arbitrary
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = compassionate
						has_trait = humble
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = craven
						has_trait = content
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = generous
						has_trait = arbitrary
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = humble
						has_trait = lazy
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = -5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = cynical
						has_trait = paranoid
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = honest
						has_trait = just
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
					Or = {
						has_trait = sadistic
						has_trait = arrogant
					}
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_social_strata
				}
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = 5 }
				add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = 5 }
			}
		}
	}	
}

gpt_adv_court_skill_check = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = gpt_adv_rfavor_disabled
					has_game_rule = gpt_adv_rfavor_player
				}
			}
			if = { limit = { has_trait = gpt_adv_court_skill } remove_trait = gpt_adv_court_skill }
		}

		if = {
			limit = {
			 #	is_adult = yes
			 	NOT = { has_game_rule = gpt_adv_rfavor_disabled }
				OR = {
					has_game_rule = gpt_adv_rfavor_count
					is_ai = no
				}
			}
			if = { limit = { NOT = { has_trait = gpt_adv_court_skill } } add_trait = gpt_adv_court_skill }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -100 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_stewardship_track value = -100 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = -100 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = -100 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = -100 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -100 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = -100 }



			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = gpt_camp_average_dip }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = gpt_camp_average_mar }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_stewardship_track value = gpt_camp_average_stw }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = gpt_camp_average_int }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = gpt_camp_average_ler }

			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_stewardship_track value = gpt_officer_average_dip }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_stewardship_track value = gpt_officer_average_mar }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_stewardship_track value = gpt_officer_average_stw }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_stewardship_track value = gpt_officer_average_int }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_stewardship_track value = gpt_officer_average_ler }

		 #	add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = gpt_camp_temperament_value }


			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						OR = {
							has_trait = gregarious
							has_trait = calm
							has_trait = forgiving
							has_trait = generous
							has_trait = compassionate
							has_trait = patient
							has_trait = trusting
							has_trait = gluttonous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						OR = {
							has_trait = gregarious
							has_trait = calm
							has_trait = forgiving
							has_trait = generous
							has_trait = compassionate
							has_trait = patient
							has_trait = trusting
							has_trait = gluttonous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						OR = {
							has_trait = gregarious
							has_trait = calm
							has_trait = forgiving
							has_trait = generous
							has_trait = compassionate
							has_trait = patient
							has_trait = trusting
							has_trait = gluttonous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						OR = {
							has_trait = gregarious
							has_trait = calm
							has_trait = forgiving
							has_trait = generous
							has_trait = compassionate
							has_trait = patient
							has_trait = trusting
							has_trait = gluttonous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						OR = {
							has_trait = gregarious
							has_trait = calm
							has_trait = forgiving
							has_trait = generous
							has_trait = compassionate
							has_trait = patient
							has_trait = trusting
							has_trait = gluttonous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						OR = {
							has_trait = shy
							has_trait = wrathful
							has_trait = vengeful
							has_trait = greedy
							has_trait = sadistic
							has_trait = impatient
							has_trait = paranoid
							has_trait = lustful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						OR = {
							has_trait = shy
							has_trait = wrathful
							has_trait = vengeful
							has_trait = greedy
							has_trait = sadistic
							has_trait = impatient
							has_trait = paranoid
							has_trait = lustful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						OR = {
							has_trait = shy
							has_trait = wrathful
							has_trait = vengeful
							has_trait = greedy
							has_trait = sadistic
							has_trait = impatient
							has_trait = paranoid
							has_trait = lustful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						OR = {
							has_trait = shy
							has_trait = wrathful
							has_trait = vengeful
							has_trait = greedy
							has_trait = sadistic
							has_trait = impatient
							has_trait = paranoid
							has_trait = lustful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						OR = {
							has_trait = shy
							has_trait = wrathful
							has_trait = vengeful
							has_trait = greedy
							has_trait = sadistic
							has_trait = impatient
							has_trait = paranoid
							has_trait = lustful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = -10 }
			}








			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_knight = {
						count = 1
						martial >= 12
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							count = 2
							martial >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							count = 3
							martial >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							count = 4
							martial >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							count = 5
							martial >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							martial >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							martial >= 20
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							martial >= 24
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							martial >= 28
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_knight = {
						count = 1
						prowess >= 12
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							count = 2
							prowess >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							count = 3
							prowess >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							count = 4
							prowess >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							count = 5
							prowess >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							prowess >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							prowess >= 20
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							prowess >= 24
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					OR = {
						any_knight = {
							prowess >= 28
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_knight = {
						percent >= 0.20
						OR = {
							has_trait = logistician
							has_trait = military_engineer
							has_trait = aggressive_attacker
							has_trait = unyielding_defender
							has_trait = flexible_leader
							has_trait = desert_warrior
							has_trait = jungle_stalker
							has_trait = reaver
							has_trait = reckless
							has_trait = holy_warrior
							has_trait = open_terrain_expert
							has_trait = rough_terrain_expert
							has_trait = forest_fighter
							has_trait = cautious_leader
							has_trait = organizer
							has_trait = winter_soldier
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_knight = {
						percent >= 0.35
						OR = {
							has_trait = logistician
							has_trait = military_engineer
							has_trait = aggressive_attacker
							has_trait = unyielding_defender
							has_trait = flexible_leader
							has_trait = desert_warrior
							has_trait = jungle_stalker
							has_trait = reaver
							has_trait = reckless
							has_trait = holy_warrior
							has_trait = open_terrain_expert
							has_trait = rough_terrain_expert
							has_trait = forest_fighter
							has_trait = cautious_leader
							has_trait = organizer
							has_trait = winter_soldier
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_knight = {
						percent >= 0.50
						OR = {
							has_trait = logistician
							has_trait = military_engineer
							has_trait = aggressive_attacker
							has_trait = unyielding_defender
							has_trait = flexible_leader
							has_trait = desert_warrior
							has_trait = jungle_stalker
							has_trait = reaver
							has_trait = reckless
							has_trait = holy_warrior
							has_trait = open_terrain_expert
							has_trait = rough_terrain_expert
							has_trait = forest_fighter
							has_trait = cautious_leader
							has_trait = organizer
							has_trait = winter_soldier
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 8 }
			}





			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.3
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_intrigue_2
							has_trait = education_martial_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.4
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_intrigue_2
							has_trait = education_martial_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.5
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_intrigue_2
							has_trait = education_martial_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 6 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.1
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_intrigue_3
							has_trait = education_martial_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.2
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_intrigue_3
							has_trait = education_martial_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 9 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.3
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_intrigue_3
							has_trait = education_martial_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.4
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_intrigue_3
							has_trait = education_martial_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 11 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.5
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_intrigue_3
							has_trait = education_martial_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.1
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_intrigue_4
							has_trait = education_martial_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.2
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_intrigue_4
							has_trait = education_martial_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 14 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.3
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_intrigue_4
							has_trait = education_martial_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 16 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						OR = {
							has_trait = education_diplomacy_5
							has_trait = education_stewardship_5
							has_trait = education_intrigue_5
							has_trait = education_martial_5
							has_trait = education_learning_5
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 20 }
			}






			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.10
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.20
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.30
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.40
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.50
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.60
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.70
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.80
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.90
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 1
						OR = {
							has_trait = august
							has_trait = diplomat
							has_trait = family_first
							has_trait = strategist
							has_trait = overseer
							has_trait = gallant
							has_trait = architect
							has_trait = administrator
							has_trait = avaricious
							has_trait = schemer
							has_trait = seducer
							has_trait = torturer
							has_trait = whole_of_body
							has_trait = scholar
							has_trait = theologian
							has_trait = gpt_homelander
							has_trait = gpt_wordly
							has_trait = gpt_founder
							has_trait = gpt_deceiver
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 10 }
			}



			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.10
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_martial_2
							has_trait = education_intrigue_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.20
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_martial_2
							has_trait = education_intrigue_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.30
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_martial_2
							has_trait = education_intrigue_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.40
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_martial_2
							has_trait = education_intrigue_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.50
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_martial_2
							has_trait = education_intrigue_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.60
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_martial_2
							has_trait = education_intrigue_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.10
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_martial_3
							has_trait = education_intrigue_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.20
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_martial_3
							has_trait = education_intrigue_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.30
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_martial_3
							has_trait = education_intrigue_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.40
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_martial_3
							has_trait = education_intrigue_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.50
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_martial_3
							has_trait = education_intrigue_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.60
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_stewardship_3
							has_trait = education_martial_3
							has_trait = education_intrigue_3
							has_trait = education_learning_3
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 8 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.60
						OR = {
							has_trait = education_diplomacy_2
							has_trait = education_stewardship_2
							has_trait = education_martial_2
							has_trait = education_intrigue_2
							has_trait = education_learning_2
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.10
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_martial_4
							has_trait = education_intrigue_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.20
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_martial_4
							has_trait = education_intrigue_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.30
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_martial_4
							has_trait = education_intrigue_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.40
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_martial_4
							has_trait = education_intrigue_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.50
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_martial_4
							has_trait = education_intrigue_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.60
						OR = {
							has_trait = education_diplomacy_4
							has_trait = education_stewardship_4
							has_trait = education_martial_4
							has_trait = education_intrigue_4
							has_trait = education_learning_4
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.10
						OR = {
							has_trait = education_diplomacy_5
							has_trait = education_stewardship_5
							has_trait = education_martial_5
							has_trait = education_intrigue_5
							has_trait = education_learning_5
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 16 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.20
						OR = {
							has_trait = education_diplomacy_5
							has_trait = education_stewardship_5
							has_trait = education_martial_5
							has_trait = education_intrigue_5
							has_trait = education_learning_5
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 16 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.30
						OR = {
							has_trait = education_diplomacy_5
							has_trait = education_stewardship_5
							has_trait = education_martial_5
							has_trait = education_intrigue_5
							has_trait = education_learning_5
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 16 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.40
						OR = {
							has_trait = education_diplomacy_5
							has_trait = education_stewardship_5
							has_trait = education_martial_5
							has_trait = education_intrigue_5
							has_trait = education_learning_5
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 16 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.50
						OR = {
							has_trait = education_diplomacy_5
							has_trait = education_stewardship_5
							has_trait = education_martial_5
							has_trait = education_intrigue_5
							has_trait = education_learning_5
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 16 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest  = {
						percent >= 0.60
						OR = {
							has_trait = education_diplomacy_5
							has_trait = education_stewardship_5
							has_trait = education_martial_5
							has_trait = education_intrigue_5
							has_trait = education_learning_5
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 16 }
			}
	




			





			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.60
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.60
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.60
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.60
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.60
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value >= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 10 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value <= -1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						NOT = { faith = root.faith }
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = -30 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value <= -1
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						NOT = { culture = root.culture }
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = -20 }
			}











			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 8
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 8
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 8
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 8
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 24
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 24
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 24
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 24
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 30
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 30
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 30
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value >= 30
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 12 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value <= -10
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -6 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value <= -10
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -6 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value <= -10
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -6 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value <= -10
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -6 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value <= -20
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -6 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value <= -20
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -6 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value <= -20
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -6 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						has_any_court_position = yes
						trait_compatibility = {
							target = root
							value <= -20
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = -6 }
			}

			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_legitimacy_track value = 0.1 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_loyalty_track value = 0.1 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_diplomacy_track value = 0.1 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_stewardship_track value = 0.1 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_martial_track value = 0.1 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_intrigue_track value = 0.1 }
			add_trait_xp = { trait = gpt_adv_court_skill track = gpt_adv_learning_track value = 0.1 }
		}
	}	
}

gpt_adv_army_xp_check = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = gpt_adv_rfavor_disabled
					has_game_rule = gpt_adv_rfavor_player
				}
			}
			if = { limit = { has_trait = gpt_adv_army_xp } remove_trait = gpt_adv_army_xp }
		}
		if = {
			limit = {
				is_adult = yes
				NOT = { has_game_rule = gpt_adv_rfavor_disabled }
				OR = {
					has_game_rule = gpt_adv_rfavor_count
					is_ai = no
				}
				OR = {
					NOT = { has_trait = gpt_adv_army_xp }
					has_character_flag = gpt_adv_rfavor_player_start
				}
			}

			add_trait = gpt_adv_army_xp

			add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = -100 }
			add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = -100 }
			add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = -100 }
			add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = -100 }
			add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = -100 }
			add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = -100 }

			if = {
				limit = {
					has_trait = gpt_adv_army_xp
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = gpt_adv_initial_xp_dip }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = gpt_adv_initial_xp_stw }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = gpt_adv_initial_xp_mar }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = gpt_adv_initial_xp_int }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = gpt_adv_initial_xp_ler }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = gpt_adv_initial_xp_dread }
			}

			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					government_has_flag = government_is_landless_adventurer
					has_realm_law = camp_purpose_wanderers
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					has_realm_law = camp_purpose_mercenaries
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					has_realm_law = camp_purpose_scholars
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					has_realm_law = camp_purpose_explorers
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					has_realm_law = camp_purpose_brigands
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					has_realm_law = camp_purpose_legitimists
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = 5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = -5 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = 5 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					culture = { has_cultural_pillar = ethos_bellicose }
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = 10 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					culture = { has_cultural_pillar = ethos_bureaucratic }
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = 10 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					culture = { has_cultural_pillar = ethos_communal }
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = 10 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					culture = { has_cultural_pillar = ethos_egalitarian }
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = 10 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					culture = { has_cultural_pillar = ethos_courtly }
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = 10 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_army_xp
					culture = { has_cultural_pillar = ethos_stoic }
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = 10 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = 10 }
			}

			if = {
				limit = {
					has_trait = gpt_adv_army_xp
				}
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dip value = 0.1 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_stw value = 0.1 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_mar value = 0.1 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_int value = 0.1 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_ler value = 0.1 }
				add_trait_xp = { trait = gpt_adv_army_xp track = gpt_adv_army_dread value = 0.1 }
			}
		}
	}	
}

gpt_adv_realm_ethos_check = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {
		
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = gpt_adv_rfavor_disabled
					has_game_rule = gpt_adv_rfavor_player
				}
			}
			if = { limit = { has_trait = gpt_adv_realm_ethos } remove_trait = gpt_adv_realm_ethos }
		}

		if = {
			limit = {
			 #	is_landed = yes
				NOT = { has_game_rule = gpt_adv_rfavor_disabled }
				OR = {
					has_game_rule = gpt_adv_rfavor_count
					is_ai = no
				}
			}
			if = { limit = { NOT = { has_trait = gpt_adv_realm_ethos } } add_trait = gpt_adv_realm_ethos }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = -100 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = -100 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = -100 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = -100 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = -100 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = -100 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = -100 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = -100 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = -100 }
			
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					OR = {
						has_trait = greedy
						has_trait = ambitious
						has_trait = arbitrary
						has_trait = impatient
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					OR = {
						has_trait = generous
						has_trait = content
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = @npvassal_adv }
			}












			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					OR = {
						has_trait = compassionate
						has_trait = forgiving
						has_trait = humble
						has_trait = generous
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = callous
							has_trait = cynical
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = @npvassal_adv }
			}



















			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = @npvassal_adv }
			}














			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = craven
							has_trait = humble
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = @npvassal_adv }
			}













			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = shy
							has_trait = trusting
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = @npvassal_adv }
			}










			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = @npvassal_adv }
			}













			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = @npvassal_adv }
			}













			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = @npvassal_adv }
			}















			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @heir_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @pvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @pvassal_adv }
			}

			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						has_court_position = second_camp_officer
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 1
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 2
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 3
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 4
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @npvassal_adv }
			}
			if = {
				limit = {
					has_trait = gpt_adv_realm_ethos
					any_courtier = {
						count >= 5
						OR = {
							has_court_position = gpt_veteran_camp_officer
							has_court_position = gpt_mistress_camp_officer
							has_court_position = gpt_paymaster_camp_officer
							has_court_position = gpt_recruiter_camp_officer
							has_court_position = gpt_clerk_camp_officer
						}
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = @npvassal_adv }
			}


			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_taxation value = 0.1 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_charity value = 0.1 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_revelry value = 0.1 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_warfare value = 0.1 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_authority value = 0.1 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_production value = 0.1 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_statecraft value = 0.1 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_espionage value = 0.1 }
			add_trait_xp = { trait = gpt_adv_realm_ethos track = gpt_adv_scholarship value = 0.1 }
		}
	}	
}

gpt_adv_entourage_circle_check = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {
		
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = gpt_adv_rfavor_disabled
					has_game_rule = gpt_adv_rfavor_player
				}
			}
			if = { limit = { has_trait = gpt_adv_entourage_circle } remove_trait = gpt_adv_entourage_circle }
		}

		if = {
			limit = {
			 #	is_landed = yes
				age >= 14
				NOT = { has_game_rule = gpt_adv_rfavor_disabled }
				OR = {
					has_game_rule = gpt_adv_rfavor_count
					is_ai = no
				}
			}
			if = { limit = { NOT = { has_trait = gpt_adv_entourage_circle } } add_trait = gpt_adv_entourage_circle }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_coterie value = -100 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_retainers value = -100 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_advisors value = -100 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_family value = -100 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_devouts value = -100 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_foragers value = -100 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_sycophants value = -100 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_artisans value = -100 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_commoners value = -100 }
			
			if = {
				limit = {
					has_trait = gpt_adv_entourage_circle 
				}
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_coterie value = { value = 0 add = ai_sociability } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_coterie value = { value = 0 add = ai_zeal multiply = -1 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_retainers value = { value = 0 add = ai_honor } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_retainers value = { value = 0 add = ai_compassion multiply = -1 } }
				
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_advisors value = { value = 0 add = ai_energy } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_family value = { value = 0 add = ai_vengefulness } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_family value = { value = 0 add = ai_boldness multiply = -1 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_devouts value = { value = 0 add = ai_zeal } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_devouts value = { value = 0 add = ai_sociability multiply = -1 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_foragers value = { value = 0 add = ai_boldness } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_foragers value = { value = 0 add = ai_rationality multiply = -1 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_sycophants value = { value = 0 add = ai_greed } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_sycophants value = { value = 0 add = ai_honor multiply = -1 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_artisans value = { value = 0 add = ai_vengefulness multiply = -1 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_artisans value = { value = 0 add = ai_rationality } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_commoners value = { value = 0 add = ai_compassion } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_commoners value = { value = 0 add = ai_greed multiply = -1 } }


				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_coterie value = { value = 0 add = diplomacy multiply = 2 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_coterie value = { value = 0 add = learning multiply = -2 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_retainers value = { value = 0 add = martial multiply = 2 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_retainers value = { value = 0 add = intrigue multiply = -2 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_family value = { value = 0 add = intrigue multiply = 2 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_family value = { value = 0 add = dread multiply = -1 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_devouts value = { value = 0 add = learning multiply = 2 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_devouts value = { value = 0 add = stewardship multiply = -2 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_foragers value = { value = 0 add = prowess multiply = 1.5 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_foragers value = { value = 0 add = diplomacy multiply = -2 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_sycophants value = { value = 0 add = dread multiply = 1 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_sycophants value = { value = 0 add = learning multiply = -2 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_artisans value = { value = 0 add = stewardship multiply = 2 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_artisans value = { value = 0 add = prowess multiply = -1.5 } }

				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_commoners value = { value = 0 add = piety_level multiply = 3.5 } }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_commoners value = { value = 0 add = martial multiply = -2 } }
			}

			if = {
				limit = {
					has_trait = gpt_adv_entourage_circle 
					OR = {
						has_trait = ambitious
						has_trait = diligent
					}
				}
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_advisors value = 25 }
			}
			if = {
				limit = {
					has_trait = gpt_adv_entourage_circle 
					OR = {
						has_trait = content
						has_trait = lazy
					}
				}
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_advisors value = -25 }
			}

			if = {
		 		limit = {
		 			has_trait = gpt_adv_entourage_circle
					OR = {
						AND = {
							has_trait = gregarious
		 					has_trait = zealous
						}
						AND = {
							has_trait = shy
		 					has_trait = cynical
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_coterie value = -100 }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_coterie value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_adv_entourage_circle
					OR = {
						AND = {
							has_trait = just
		 					has_trait = compassionate
						}
						AND = {
							has_trait = arbitrary
		 					has_trait = sadistic
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_retainers value = -100 }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_retainers value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_adv_entourage_circle
					OR = {
						AND = {
							has_trait = vengeful
		 					has_trait = brave
						}
						AND = {
							has_trait = forgiving
		 					has_trait = craven
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_family value = -100 }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_family value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_adv_entourage_circle
					OR = {
						AND = {
							has_trait = zealous
		 					has_trait = gregarious
						}
						AND = {
							has_trait = shy
		 					has_trait = cynical
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_devouts value = -100 }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_devouts value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_adv_entourage_circle
					OR = {
						AND = {
							has_trait = greedy
		 					has_trait = just
						}
						AND = {
							has_trait = arbitrary
		 					has_trait = generous
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_sycophants value = -100 }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_sycophants value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_adv_entourage_circle
					OR = {
						AND = {
							has_trait = compassionate
		 					has_trait = greedy
						}
						AND = {
							has_trait = sadistic
		 					has_trait = generous
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_commoners value = -100 }
				add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_commoners value = 50 }
		 	}

			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_coterie value = 0.1 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_retainers value = 0.1 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_advisors value = 0.1 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_family value = 0.1 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_devouts value = 0.1 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_foragers value = 0.1 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_sycophants value = 0.1 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_artisans value = 0.1 }
			add_trait_xp = { trait = gpt_adv_entourage_circle track = gpt_adv_commoners value = 0.1 }
		}
	}	
}







gpt_adv_royal_favor_nobility = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				NOT = { has_character_flag = gpt_adv_favoring_nobility }
				has_character_flag = gpt_adv_favoring_nobility_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = gpt_adv_favoring_nobility_end_t
							desc = gpt_adv_favoring_nobility_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_adv_favoring_nobility_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				has_character_flag = gpt_adv_favoring_nobility
				has_character_flag = gpt_adv_favoring_nobility_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_01_t
							desc = bestow_favor_adv_nobility_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_02_t
							desc = bestow_favor_adv_nobility_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_03_t
							desc = bestow_favor_adv_nobility_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_04_t
							desc = bestow_favor_adv_nobility_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_05_t
							desc = bestow_favor_adv_nobility_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_06_t
							desc = bestow_favor_adv_nobility_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_07_t
							desc = bestow_favor_adv_nobility_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_08_t
							desc = bestow_favor_adv_nobility_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_09_t
							desc = bestow_favor_adv_nobility_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_10_t
							desc = bestow_favor_adv_nobility_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_11_t
							desc = bestow_favor_adv_nobility_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_12_t
							desc = bestow_favor_adv_nobility_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_13_t
							desc = bestow_favor_adv_nobility_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_14_t
							desc = bestow_favor_adv_nobility_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_15_t
							desc = bestow_favor_adv_nobility_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_16_t
							desc = bestow_favor_adv_nobility_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_17_t
							desc = bestow_favor_adv_nobility_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_18_t
							desc = bestow_favor_adv_nobility_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_19_t
							desc = bestow_favor_adv_nobility_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_nobility_event_20_t
							desc = bestow_favor_adv_nobility_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_adv_royal_favor_merchants = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				NOT = { has_character_flag = gpt_adv_favoring_merchants }
				has_character_flag = gpt_adv_favoring_merchants_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = gpt_adv_favoring_merchants_end_t
							desc = gpt_adv_favoring_merchants_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_adv_favoring_merchants_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				has_character_flag = gpt_adv_favoring_merchants
				has_character_flag = gpt_adv_favoring_merchants_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_01_t
							desc = bestow_favor_adv_merchants_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_02_t
							desc = bestow_favor_adv_merchants_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_03_t
							desc = bestow_favor_adv_merchants_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_04_t
							desc = bestow_favor_adv_merchants_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_05_t
							desc = bestow_favor_adv_merchants_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_06_t
							desc = bestow_favor_adv_merchants_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_07_t
							desc = bestow_favor_adv_merchants_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_08_t
							desc = bestow_favor_adv_merchants_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_09_t
							desc = bestow_favor_adv_merchants_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_10_t
							desc = bestow_favor_adv_merchants_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_11_t
							desc = bestow_favor_adv_merchants_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_12_t
							desc = bestow_favor_adv_merchants_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_13_t
							desc = bestow_favor_adv_merchants_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_14_t
							desc = bestow_favor_adv_merchants_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_15_t
							desc = bestow_favor_adv_merchants_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_16_t
							desc = bestow_favor_adv_merchants_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_17_t
							desc = bestow_favor_adv_merchants_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_18_t
							desc = bestow_favor_adv_merchants_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_19_t
							desc = bestow_favor_adv_merchants_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_merchants_event_20_t
							desc = bestow_favor_adv_merchants_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_adv_royal_favor_knights = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				NOT = { has_character_flag = gpt_adv_favoring_knights }
				has_character_flag = gpt_adv_favoring_knights_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = gpt_adv_favoring_knights_end_t
							desc = gpt_adv_favoring_knights_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_adv_favoring_knights_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				has_character_flag = gpt_adv_favoring_knights
				has_character_flag = gpt_adv_favoring_knights_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_01_t
							desc = bestow_favor_adv_knights_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_02_t
							desc = bestow_favor_adv_knights_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_03_t
							desc = bestow_favor_adv_knights_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_04_t
							desc = bestow_favor_adv_knights_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_05_t
							desc = bestow_favor_adv_knights_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_06_t
							desc = bestow_favor_adv_knights_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_07_t
							desc = bestow_favor_adv_knights_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_08_t
							desc = bestow_favor_adv_knights_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_09_t
							desc = bestow_favor_adv_knights_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_10_t
							desc = bestow_favor_adv_knights_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_11_t
							desc = bestow_favor_adv_knights_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_12_t
							desc = bestow_favor_adv_knights_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_13_t
							desc = bestow_favor_adv_knights_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_14_t
							desc = bestow_favor_adv_knights_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_15_t
							desc = bestow_favor_adv_knights_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_16_t
							desc = bestow_favor_adv_knights_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_17_t
							desc = bestow_favor_adv_knights_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_18_t
							desc = bestow_favor_adv_knights_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_19_t
							desc = bestow_favor_adv_knights_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_knights_event_20_t
							desc = bestow_favor_adv_knights_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_adv_royal_favor_clergy = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				NOT = { has_character_flag = gpt_adv_favoring_clergy }
				has_character_flag = gpt_adv_favoring_clergy_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = gpt_adv_favoring_clergy_end_t
							desc = gpt_adv_favoring_clergy_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_adv_favoring_clergy_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				has_character_flag = gpt_adv_favoring_clergy
				has_character_flag = gpt_adv_favoring_clergy_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_01_t
							desc = bestow_favor_adv_clergy_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_02_t
							desc = bestow_favor_adv_clergy_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_03_t
							desc = bestow_favor_adv_clergy_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_04_t
							desc = bestow_favor_adv_clergy_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_05_t
							desc = bestow_favor_adv_clergy_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_06_t
							desc = bestow_favor_adv_clergy_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_07_t
							desc = bestow_favor_adv_clergy_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_08_t
							desc = bestow_favor_adv_clergy_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_09_t
							desc = bestow_favor_adv_clergy_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_10_t
							desc = bestow_favor_adv_clergy_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_11_t
							desc = bestow_favor_adv_clergy_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_12_t
							desc = bestow_favor_adv_clergy_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_13_t
							desc = bestow_favor_adv_clergy_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_14_t
							desc = bestow_favor_adv_clergy_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_15_t
							desc = bestow_favor_adv_clergy_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_16_t
							desc = bestow_favor_adv_clergy_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_17_t
							desc = bestow_favor_adv_clergy_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_18_t
							desc = bestow_favor_adv_clergy_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_19_t
							desc = bestow_favor_adv_clergy_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_clergy_event_20_t
							desc = bestow_favor_adv_clergy_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_adv_royal_favor_peasants = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				NOT = { has_character_flag = gpt_adv_favoring_peasants }
				has_character_flag = gpt_adv_favoring_peasants_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = gpt_adv_favoring_peasants_end_t
							desc = gpt_adv_favoring_peasants_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_adv_favoring_peasants_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				has_character_flag = gpt_adv_favoring_peasants
				has_character_flag = gpt_adv_favoring_peasants_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_01_t
							desc = bestow_favor_adv_peasants_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_02_t
							desc = bestow_favor_adv_peasants_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_03_t
							desc = bestow_favor_adv_peasants_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_04_t
							desc = bestow_favor_adv_peasants_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_05_t
							desc = bestow_favor_adv_peasants_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_06_t
							desc = bestow_favor_adv_peasants_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_07_t
							desc = bestow_favor_adv_peasants_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_08_t
							desc = bestow_favor_adv_peasants_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_09_t
							desc = bestow_favor_adv_peasants_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_10_t
							desc = bestow_favor_adv_peasants_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_11_t
							desc = bestow_favor_adv_peasants_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_12_t
							desc = bestow_favor_adv_peasants_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_13_t
							desc = bestow_favor_adv_peasants_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_14_t
							desc = bestow_favor_adv_peasants_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_15_t
							desc = bestow_favor_adv_peasants_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_16_t
							desc = bestow_favor_adv_peasants_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_17_t
							desc = bestow_favor_adv_peasants_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_18_t
							desc = bestow_favor_adv_peasants_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_19_t
							desc = bestow_favor_adv_peasants_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_peasants_event_20_t
							desc = bestow_favor_adv_peasants_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_adv_royal_favor_outlaws = {
	trigger = {
		is_landless_adventurer = yes
		NOT = { has_game_rule = gpt_adv_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = gpt_adv_rfavor_count
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				NOT = { has_character_flag = gpt_adv_favoring_criminals }
				has_character_flag = gpt_adv_favoring_criminals_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = gpt_adv_favoring_criminals_end_t
							desc = gpt_adv_favoring_criminals_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_adv_favoring_criminals_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_adv_social_strata
				has_character_flag = gpt_adv_favoring_criminals
				has_character_flag = gpt_adv_favoring_criminals_timeout
				is_adult = yes
				is_ruler = yes
				highest_held_title_tier >= 2 is_imprisoned = no ### is_landed = yes
			}
			random = {
				chance = 100
				random_list = {
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_01_t
							desc = bestow_favor_adv_outlaws_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_02_t
							desc = bestow_favor_adv_outlaws_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_03_t
							desc = bestow_favor_adv_outlaws_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_04_t
							desc = bestow_favor_adv_outlaws_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_05_t
							desc = bestow_favor_adv_outlaws_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_06_t
							desc = bestow_favor_adv_outlaws_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_07_t
							desc = bestow_favor_adv_outlaws_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_08_t
							desc = bestow_favor_adv_outlaws_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_09_t
							desc = bestow_favor_adv_outlaws_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_10_t
							desc = bestow_favor_adv_outlaws_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_11_t
							desc = bestow_favor_adv_outlaws_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_12_t
							desc = bestow_favor_adv_outlaws_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_13_t
							desc = bestow_favor_adv_outlaws_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_14_t
							desc = bestow_favor_adv_outlaws_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_15_t
							desc = bestow_favor_adv_outlaws_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_16_t
							desc = bestow_favor_adv_outlaws_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_17_t
							desc = bestow_favor_adv_outlaws_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_18_t
							desc = bestow_favor_adv_outlaws_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_19_t
							desc = bestow_favor_adv_outlaws_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_adv_outlaws_event_20_t
							desc = bestow_favor_adv_outlaws_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain } custom_tooltip = { text = gpt_adv_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_adv_social_strata track = gpt_adv_criminals value = @xp_gain }
					}
				}
			}
		}
	}
}




gpt_adv_remove_check = {
	trigger = {
		OR = {
			has_game_rule = gpt_adv_rfavor_player
			has_game_rule = gpt_adv_rfavor_disabled
		}
	}
	effect = {
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_adv_social_strata
			}
			remove_trait = gpt_adv_social_strata
		}
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_adv_realm_ethos
			}
			remove_trait = gpt_adv_realm_ethos
		}
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_adv_court_skill
			}
			remove_trait = gpt_adv_court_skill
		}
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_adv_army_xp
			}
			remove_trait = gpt_adv_army_xp
		}
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_adv_entourage_circle
			}
			remove_trait = gpt_adv_entourage_circle
		}
		if = {
			limit = {
				is_ai = no
				has_game_rule = gpt_adv_rfavor_disabled
				OR = {
					has_trait = gpt_adv_social_strata
					has_trait = gpt_adv_realm_ethos
					has_trait = gpt_adv_army_xp
					has_trait = gpt_adv_court_skill
					has_trait = gpt_adv_entourage_circle
				}
			}
			remove_trait = gpt_adv_social_strata
			remove_trait = gpt_adv_realm_ethos
			remove_trait = gpt_adv_army_xp
			remove_trait = gpt_adv_court_skill
			remove_trait = gpt_adv_entourage_circle
		}
	}	
}

gpt_adv_remove_check_2 = {
	trigger = {
		OR = {
		 #	is_landed = no
			is_landless_adventurer = no
		}
	}
	effect = {
		if = {
			limit = {
				OR = {
				 #	is_landed = no
					is_landless_adventurer = no
				}
				has_trait = gpt_adv_social_strata
			}
			remove_trait = gpt_adv_social_strata
		}
		if = {
			limit = {
				is_landless_adventurer = no
				has_trait = gpt_adv_realm_ethos
			}
			remove_trait = gpt_adv_realm_ethos
		}
		if = {
			limit = {
				is_landless_adventurer = no
				has_trait = gpt_adv_court_skill
			}
			remove_trait = gpt_adv_court_skill
		}
		if = {
			limit = {
				is_landless_adventurer = no
				has_trait = gpt_adv_army_xp
			}
			remove_trait = gpt_adv_army_xp
		}
		if = {
			limit = {
				is_landless_adventurer = no
				has_trait = gpt_adv_entourage_circle
			}
			remove_trait = gpt_adv_entourage_circle
		}
	}	
}









