﻿### Royal Favor
@xp_gain = 4
@xp_loss = -0.8

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

on_game_start_after_lobby = { 
	on_actions = {
		gpt_expansion_traits_start
	 	gpt_royal_favor_start
	}
}

quarterly_playable_pulse = {
	on_actions = {
		gpt_royal_favor_check
    }
	on_actions = {
		delay = { days = 1 }
		gpt_court_skill_check
    }
	on_actions = {
		delay = { days = 2 }
		gpt_army_xp_check
    }
	on_actions = {
		delay = { days = 3 }
	 	gpt_realm_ethos_check
    }
	on_actions = {
		delay = { days = 4 }
	 	gpt_entourage_circle_check
    }
}

yearly_playable_pulse = {
	on_actions = {
		gpt_remove_check
		gpt_remove_check_2
    	gpt_royal_favor_dynasty
		gpt_royal_favor_nobility
		gpt_royal_favor_merchants
		gpt_royal_favor_knights
		gpt_royal_favor_clergy
		gpt_royal_favor_peasants
		gpt_royal_favor_outlaws
    }
}

gpt_expansion_traits_start = {
	trigger = {
		NOT = { has_game_rule = GPT_rfavor_disabled }
	}
	effect = {
		every_ruler = {
			if = {
				limit = {
					is_landless_adventurer = no
					is_ai = no
				}
				add_trait = gpt_social_strata
				add_trait = gpt_court_skill
			 	add_trait = gpt_army_xp
				add_trait = gpt_realm_ethos
				add_trait = gpt_entourage_circle
				add_character_flag = {
					flag = gpt_rfavor_player_start
					years = 2
				}
			}
		}
	}
}

gpt_royal_favor_start = {
	trigger = {
		NOT = { has_game_rule = GPT_rfavor_disabled }
	 #	OR = {
	 #		has_game_rule = GPT_rfavor_player
	 #		has_game_rule = GPT_rfavor_count
	 #		has_game_rule = GPT_rfavor_duke
	 #		has_game_rule = GPT_rfavor_king
	 #	}
	}
	effect = {
		every_ruler = {
			if = {
				limit = {
					is_landless_adventurer = no
				 #	is_landed = yes
					NOT = { has_game_rule = GPT_rfavor_disabled }
					OR = {
						AND = {
							NOT = { has_game_rule = GPT_rfavor_player }
							highest_held_title_tier >= gpt_rfavor_tier
						}
						is_ai = no
					}
				}
				if = { limit = { NOT = { has_trait = gpt_social_strata } } add_trait = gpt_social_strata }
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 45 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = 45 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 45 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 45 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = 45 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 45 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = 45 }
			 #	if = {
			 #		limit = {
			 #			is_ai = no
			 #		}
			 #		trigger_event = {
			 #			id = bestow_favor_events.9999
			 #		}
			 #	}
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_landless_adventurer
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_administrative
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 10 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 10 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -10 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_feudal
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_clan
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_tribal
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_tradition = tradition_horse_lords }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					faith = { has_doctrine_parameter = unreformed }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_bellicose }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_bureaucratic }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_communal }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_spiritual }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_egalitarian }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_stoic }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = brave
						has_trait = ambitious
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = greedy
						has_trait = just
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = arrogant
						has_trait = diligent
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = zealous
						has_trait = trusting
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = deceitful
						has_trait = arbitrary
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = compassionate
						has_trait = humble
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = craven
						has_trait = content
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = generous
						has_trait = arbitrary
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = humble
						has_trait = lazy
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = cynical
						has_trait = paranoid
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = honest
						has_trait = just
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = sadistic
						has_trait = arrogant
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = 5 }
			}
		}
	}	
}

gpt_royal_favor_check = {
	trigger = {
		is_landless_adventurer = no
	 #	is_landed = yes
	 	NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = GPT_rfavor_disabled
					highest_held_title_tier < gpt_rfavor_tier
				}
				has_trait = gpt_social_strata
			}
			remove_trait = gpt_social_strata
		}
		if = {
			limit = {
			 #	is_landed = yes
				NOT = { has_game_rule = GPT_rfavor_disabled }
				OR = {
					highest_held_title_tier >= gpt_rfavor_tier
					is_ai = no
				}
				NOT = { has_trait = gpt_social_strata }
			}

			add_trait = gpt_social_strata

			add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = -100 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -100 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = -100 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = -100 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -100 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = -100 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = -100 }

			add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 45 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = 45 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 45 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 45 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = 45 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 45 }
			add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = 45 }

			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_landless_adventurer
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_administrative
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 10 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 10 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -10 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_feudal
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_clan
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					government_has_flag = government_is_tribal
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_tradition = tradition_horse_lords }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					faith = { has_doctrine_parameter = unreformed }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_bellicose }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_bureaucratic }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_communal }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_spiritual }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_egalitarian }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					culture = { has_cultural_pillar = ethos_stoic }
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 20 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = -20 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = brave
						has_trait = ambitious
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = greedy
						has_trait = just
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = arrogant
						has_trait = diligent
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = zealous
						has_trait = trusting
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = deceitful
						has_trait = arbitrary
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = compassionate
						has_trait = humble
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = craven
						has_trait = content
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = generous
						has_trait = arbitrary
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = humble
						has_trait = lazy
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = cynical
						has_trait = paranoid
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = honest
						has_trait = just
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
					Or = {
						has_trait = sadistic
						has_trait = arrogant
					}
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = -15 }
			}
			if = {
				limit = {
					has_trait = gpt_social_strata
				}
				add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = 5 }
				add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = 5 }
			}
		}
	}	
}

gpt_court_skill_check = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = GPT_rfavor_disabled
					highest_held_title_tier < gpt_rfavor_tier
				}
			}
			if = { limit = { has_trait = gpt_court_skill } remove_trait = gpt_court_skill }
		}

		if = {
			limit = {
			 #	is_adult = yes
			 	NOT = { has_game_rule = GPT_rfavor_disabled }
				OR = {
					highest_held_title_tier >= gpt_rfavor_tier
					is_ai = no
				}
			}
			if = { limit = { NOT = { has_trait = gpt_court_skill } } add_trait = gpt_court_skill }
			add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = -100 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = -100 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = -100 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = -100 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = -100 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = 100 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = 100 }



			if = {
				limit = {
					has_trait = gpt_court_skill
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = root.diplomacy }
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = root.stewardship }
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = root.martial }
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = root.intrigue }
				add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = root.learning }
			}



			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						num_virtuous_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.10
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.20
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.30
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.50
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = 20 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_diplomacy_track value = -10 }
			}















			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_chancellor
					cp:councillor_chancellor  = {
						diplomacy >= 8
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_chancellor
					cp:councillor_chancellor  = {
						diplomacy >= 12
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 6 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_chancellor
					cp:councillor_chancellor  = {
						diplomacy >= 16
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_chancellor
					cp:councillor_chancellor  = {
						diplomacy >= 20
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_chancellor
					cp:councillor_chancellor  = {
						diplomacy >= 24
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 12 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_steward
					cp:councillor_steward  = {
						stewardship >= 8
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_steward
					cp:councillor_steward  = {
						stewardship >= 12
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_steward
					cp:councillor_steward  = {
						stewardship >= 16
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 6 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_steward
					cp:councillor_steward  = {
						stewardship >= 20
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 7 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_steward
					cp:councillor_steward  = {
						stewardship >= 24
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 8 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_marshal
					cp:councillor_marshal  = {
						martial >= 8
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_marshal
					cp:councillor_marshal  = {
						martial >= 12
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_marshal
					cp:councillor_marshal  = {
						martial >= 16
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 6 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_marshal
					cp:councillor_marshal  = {
						martial >= 20
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 7 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_marshal
					cp:councillor_marshal  = {
						martial >= 24
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 8 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_spymaster
					cp:councillor_spymaster  = {
						intrigue >= 8
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_spymaster
					cp:councillor_spymaster  = {
						intrigue >= 12
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_spymaster
					cp:councillor_spymaster  = {
						intrigue >= 16
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 6 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_spymaster
					cp:councillor_spymaster  = {
						intrigue >= 20
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 7 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_spymaster
					cp:councillor_spymaster  = {
						intrigue >= 24
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 8 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain  = {
						learning >= 8
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain  = {
						learning >= 12
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 4 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain  = {
						learning >= 16
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 6 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain  = {
						learning >= 20
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 7 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain  = {
						learning >= 24
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 8 }
			}


			








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

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						count = 1
						prowess >= 12
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_knight = {
							count = 2
							prowess >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_knight = {
							count = 3
							prowess >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_knight = {
							count = 4
							prowess >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_knight = {
							count = 5
							prowess >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_knight = {
							prowess >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_knight = {
							prowess >= 20
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_knight = {
							prowess >= 24
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_knight = {
							prowess >= 28
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_martial_track value = 8 }
			}
			if = {
				limit = {
					has_trait = gpt_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_court_skill track = gpt_martial_track value = 8 }
			}













			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						percent >= 0.10
						OR = {
							has_trait = brave
							has_trait = shrewd
							dread >= 40
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						percent >= 0.20
						OR = {
							has_trait = brave
							has_trait = shrewd
							dread >= 40
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						percent >= 0.30
						OR = {
							has_trait = brave
							has_trait = shrewd
							dread >= 40
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						percent >= 0.40
						OR = {
							has_trait = brave
							has_trait = shrewd
							dread >= 40
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						percent >= 0.50
						OR = {
							has_trait = brave
							has_trait = shrewd
							dread >= 40
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						count = 1
						diplomacy >= 10
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 2
							diplomacy >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							diplomacy >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 3
							diplomacy >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							diplomacy >= 14
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 4
							diplomacy >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							diplomacy >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 5
							diplomacy >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							diplomacy >= 18
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						count = 1
						stewardship >= 10
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 2
							stewardship >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							stewardship >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 3
							stewardship >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							stewardship >= 14
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 4
							stewardship >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							stewardship >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 5
							stewardship >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							stewardship >= 18
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						count = 1
						martial >= 10
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 2
							martial >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							martial >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 3
							martial >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							martial >= 14
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 4
							martial >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							martial >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 5
							martial >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							martial >= 18
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						count = 1
						intrigue >= 10
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 2
							intrigue >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							intrigue >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 3
							intrigue >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							intrigue >= 14
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 4
							intrigue >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							intrigue >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 5
							intrigue >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							intrigue >= 18
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest  = {
						count = 1
						learning >= 10
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 2
							learning >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							learning >= 12
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 3
							learning >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							learning >= 14
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 4
							learning >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							learning >= 16
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					OR = {
						any_courtier_or_guest  = {
							count = 5
							learning >= 10
						}
						any_courtier_or_guest  = {
							count = 1
							learning >= 18
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 5 }
			}






			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.1
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.2
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.3
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.1
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.2
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.3
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 20 }
			}
			


			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.15
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.3
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.45
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.15
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.3
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.45
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						is_councillor = no
						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_court_skill track = gpt_learning_track value = 20 }
			}


			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.6
						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_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.4
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.6
						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_court_skill track = gpt_learning_track value = 15 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						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_court_skill track = gpt_learning_track value = 20 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.1
						is_councillor = no
						num_of_known_languages >= 3
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.15
						is_councillor = no
						num_of_known_languages >= 3
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.2
						num_of_known_languages >= 3
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.2
						is_councillor = no
						num_of_known_languages >= 3
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.30
						is_councillor = no
						num_of_known_languages >= 3
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.4
						num_of_known_languages >= 3
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = 10 }
			}







			



			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.4
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.25
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						percent >= 0.1
						is_powerful_vassal = no
						opinion = {
							target = root
							value <= -100
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						is_powerful_vassal = no
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.5
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						is_powerful_vassal = no
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.5
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						is_powerful_vassal = no
						opinion = {
							target = root
							value <= -100
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}

		 #	if = {
		 #		limit = {
		 #			has_trait = gpt_court_skill
		 #			any_councillor = {
		 #				percent >= 0.5
		 #				is_powerful_vassal = yes
		 #			}
		 #		}
		 #		add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
		 #	}
		 #	if = {
		 #		limit = {
		 #			has_trait = gpt_court_skill
		 #			any_councillor = {
		 #				percent >= 1
		 #				is_powerful_vassal = yes
		 #			}
		 #		}
		 #		add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
		 #	}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.5
						OR = {
							has_trait = disloyal
							has_trait = arrogant
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = paranoid
							has_trait = greedy
							has_trait = deceitful
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						percent >= 0.5
						OR = {
							has_trait = loyal
							has_trait = humble
							has_trait = content
							has_trait = just
							has_trait = trusting
							has_trait = honest
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = 12 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_powerful_vassal = {
						percent >= 0.5
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_vassal = {
						percent >= 0.40
						is_powerful_vassal = no
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_vassal = {
						percent >= 0.25
						is_powerful_vassal = no
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						is_powerful_vassal = no
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.25
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent = 0.10
						opinion = {
							target = root
							value <= -100
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						OR = {
							has_trait = disloyal
							has_trait = arrogant
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = paranoid
							has_trait = greedy
							has_trait = deceitful
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_courtier_or_guest = {
						percent >= 0.40
						OR = {
							has_trait = loyal
							has_trait = humble
							has_trait = content
							has_trait = just
							has_trait = trusting
							has_trait = honest
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = 8 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_powerful_vassal = {
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_powerful_vassal = {
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_powerful_vassal = {
						percent >= 0.5
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_powerful_vassal = {
						opinion = {
							target = root
							value <= -100
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_vassal = {
						percent = 0.10
						is_powerful_vassal = no
						opinion = {
							target = root
							value <= -100
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}		
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_vassal = {
						percent >= 0.30
						is_powerful_vassal = no
						OR = {
							has_trait = disloyal
							has_trait = arrogant
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = paranoid
							has_trait = greedy
							has_trait = deceitful
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -8 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_vassal = {
						percent >= 0.30
						is_powerful_vassal = no
						OR = {
							has_trait = loyal
							has_trait = humble
							has_trait = content
							has_trait = just
							has_trait = trusting
							has_trait = honest
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = 8 }
			}

			if = {
				limit = {
					has_trait = gpt_court_skill
					any_powerful_vassal = {
						percent >= 0.5
						OR = {
							has_trait = disloyal
							has_trait = arrogant
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = paranoid
							has_trait = greedy
							has_trait = deceitful
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_powerful_vassal = {
						percent >= 0.5
						OR = {
							has_trait = loyal
							has_trait = humble
							has_trait = content
							has_trait = just
							has_trait = trusting
							has_trait = honest
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = 12 }
			}







			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						count >= 2
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						count >= 4
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						count >= 6
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						count >= 8
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_knight = {
						count >= 10
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						count >= 1
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						count >= 2
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						count >= 3
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -10 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						count >= 4
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_consort = {
						count >= 2
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -4 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_consort = {
						count >= 3
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -4 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_consort = {
						count >= 4
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -4 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_court_position_holder = {
						count >= 1
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_court_position_holder = {
						count >= 2
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_court_position_holder = {
						count >= 3
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_court_position_holder = {
						count >= 4
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_court_position_holder = {
						count >= 5
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_court_position_holder = {
						count >= 1
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = primary_spouse
					primary_spouse = {
						is_lowborn = yes
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -12 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = primary_spouse
					primary_spouse = {
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = primary_spouse
					primary_spouse = {
						num_sinful_traits >= 2
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = primary_spouse
					primary_spouse = {
						num_sinful_traits >= 3
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = primary_spouse
					primary_spouse = {
						piety_level = 0
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = faith.religious_head
					faith.religious_head = {
						opinion = {
							target = root
							value <= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = faith.religious_head
					faith.religious_head = {
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = faith.religious_head
					faith.religious_head = {
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = faith.religious_head
					faith.religious_head = {
						opinion = {
							target = root
							value <= -100
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain = {
						opinion = {
							target = root
							value <= 50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain = {
						opinion = {
							target = root
							value <= 0
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain = {
						opinion = {
							target = root
							value <= -50
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain = {
						opinion = {
							target = root
							value <= -100
						}
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -3 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_vassal = {
						percent >= 0.1
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_vassal = {
						percent >= 0.2
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_vassal = {
						percent >= 0.3
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						count >= 1
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						count >= 2
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					any_councillor = {
						count >= 3
						num_sinful_traits >= 1
					}
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -2 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					num_sinful_traits >= 1
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					num_sinful_traits >= 2
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					num_sinful_traits >= 3
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -5 }
			}
			if = {
				limit = {
					has_trait = gpt_court_skill
					piety_level = 0
				}
				add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = -5 }
			}


			add_trait_xp = { trait = gpt_court_skill track = gpt_legitimacy_track value = 0.1 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_loyalty_track value = 0.1 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_diplomacy_track value = 0.1 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_stewardship_track value = 0.1 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_martial_track value = 0.1 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_intrigue_track value = 0.1 }
			add_trait_xp = { trait = gpt_court_skill track = gpt_learning_track value = 0.1 }
		}
	}	
}

gpt_army_xp_check = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = GPT_rfavor_disabled
					highest_held_title_tier < gpt_rfavor_tier
				}
			}
			if = { limit = { has_trait = gpt_army_xp } remove_trait = gpt_army_xp }
		}
		if = {
			limit = {
				has_trait = gpt_army_xp
				is_at_war = yes
			}
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_dip value = gpt_quarterly_xp_dip }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_stw value = gpt_quarterly_xp_stw }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_mar value = gpt_quarterly_xp_mar }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_int value = gpt_quarterly_xp_int }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_ler value = gpt_quarterly_xp_ler }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_dread value = gpt_quarterly_xp_dread }
		}
		if = {
			limit = {
				is_adult = yes
				NOT = { has_game_rule = GPT_rfavor_disabled }
				OR = {
					highest_held_title_tier >= gpt_rfavor_tier
					is_ai = no
				}
				OR = {
					NOT = { has_trait = gpt_army_xp }
					has_character_flag = gpt_rfavor_player_start
				}
			}

			add_trait = gpt_army_xp

			add_trait_xp = { trait = gpt_army_xp track = gpt_army_dip value = -100 }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_stw value = -100 }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_mar value = -100 }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_int value = -100 }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_ler value = -100 }
			add_trait_xp = { trait = gpt_army_xp track = gpt_army_dread value = -100 }

			if = {
				limit = {
					has_trait = gpt_army_xp
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dip value = gpt_initial_xp_dip }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_stw value = gpt_initial_xp_stw }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_mar value = gpt_initial_xp_mar }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_int value = gpt_initial_xp_int }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_ler value = gpt_initial_xp_ler }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dread value = gpt_initial_xp_dread }
			}

			if = {
				limit = {
					has_trait = gpt_army_xp
					government_has_flag = government_is_tribal
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dip value = 15 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_mar value = 15 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dread value = 20 }
			}

			if = {
				limit = {
					has_trait = gpt_army_xp
					government_has_flag = government_is_clan
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_stw value = 20 }
			 	add_trait_xp = { trait = gpt_army_xp track = gpt_army_int value = 15 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dread value = 15 }
			}

			if = {
				limit = {
					has_trait = gpt_army_xp
					NOR = {
						government_has_flag = government_is_clan
						government_has_flag = government_is_tribal
					}
				}
			 	add_trait_xp = { trait = gpt_army_xp track = gpt_army_dip value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_stw value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_mar value = 10 }
			 	add_trait_xp = { trait = gpt_army_xp track = gpt_army_int value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_ler value = 10 }
			}

			if = {
				limit = {
					has_trait = gpt_army_xp
					culture = { has_cultural_pillar = ethos_bellicose }
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_mar value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dread value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_army_xp
					culture = { has_cultural_pillar = ethos_bureaucratic }
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_stw value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_ler value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_army_xp
					culture = { has_cultural_pillar = ethos_communal }
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_mar value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_stw value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_army_xp
					culture = { has_cultural_pillar = ethos_egalitarian }
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_int value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_ler value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_army_xp
					culture = { has_cultural_pillar = ethos_courtly }
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dip value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_int value = 10 }
			}
			if = {
				limit = {
					has_trait = gpt_army_xp
					culture = { has_cultural_pillar = ethos_stoic }
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dread value = 10 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dip value = 10 }
			}

			if = {
				limit = {
					has_trait = gpt_army_xp
				}
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dip value = 0.1 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_stw value = 0.1 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_mar value = 0.1 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_int value = 0.1 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_ler value = 0.1 }
				add_trait_xp = { trait = gpt_army_xp track = gpt_army_dread value = 0.1 }
			}
		}
	}	
}

gpt_realm_ethos_check = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {
		
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = GPT_rfavor_disabled
					highest_held_title_tier < gpt_rfavor_tier
				}
			}
			if = { limit = { has_trait = gpt_realm_ethos } remove_trait = gpt_realm_ethos }
		}

		if = {
			limit = {
			 #	is_landed = yes
				NOT = { has_game_rule = GPT_rfavor_disabled }
				OR = {
					highest_held_title_tier >= gpt_rfavor_tier
					is_ai = no
				}
			}
			if = { limit = { NOT = { has_trait = gpt_realm_ethos } } add_trait = gpt_realm_ethos }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = -100 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = -100 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = -100 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = -100 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = -100 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = -100 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = -100 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = -100 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = -100 }
			
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					OR = {
						has_trait = greedy
						has_trait = ambitious
						has_trait = arbitrary
						has_trait = impatient
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_taxation value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = greedy
							has_trait = ambitious
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
					OR = {
						has_trait = generous
						has_trait = content
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = generous
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = @npvassal }
			}












			if = {
				limit = {
					has_trait = gpt_realm_ethos
					OR = {
						has_trait = compassionate
						has_trait = forgiving
						has_trait = humble
						has_trait = generous
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_charity value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = compassionate
							has_trait = forgiving
							has_trait = humble
							has_trait = generous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = callous
							has_trait = cynical
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = @npvassal }
			}



















			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_revelry value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = gluttonous
							has_trait = lustful
							has_trait = arrogant
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = temperate
							has_trait = chaste
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = @npvassal }
			}














			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_warfare value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = brave
							has_trait = zealous
							has_trait = stubborn
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = craven
							has_trait = humble
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = craven
							has_trait = humble
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = @npvassal }
			}













			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_authority value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = vengeful
							has_trait = sadistic
							has_trait = chaste
							has_trait = craven
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = shy
							has_trait = trusting
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = shy
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = @npvassal }
			}










			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_production value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = diligent
							has_trait = calm
							has_trait = temperate
							has_trait = callous
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = lazy
							has_trait = arrogant
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = @npvassal }
			}













			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_statecraft value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = just
							has_trait = patient
							has_trait = honest
							has_trait = trusting
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = arbitrary
							has_trait = impatient
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = @npvassal }
			}













			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_espionage value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = deceitful
							has_trait = paranoid
							has_trait = cynical
							has_trait = shy
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = honest
							has_trait = wrathful
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = @npvassal }
			}















			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @ruler }
			}
			if = {
				limit = {
					has_trait = gpt_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_realm_ethos track = gpt_scholarship value = @heir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @councillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @pvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = eccentric
							has_trait = fickle
							has_trait = lazy
							has_trait = content
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @pvassal }
			}

			if = {
				limit = {
					has_trait = gpt_realm_ethos
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @nruler }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					exists = primary_heir
					primary_heir = {
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @nheir }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 1
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 2
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 3
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 4
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_councillor = {
						count >= 5
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @ncouncillor }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 1
						is_councillor = yes
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 2
						is_councillor = yes
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 3
						is_councillor = yes
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 4
						is_councillor = yes
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @npvassal }
			}
			if = {
				limit = {
					has_trait = gpt_realm_ethos
					any_powerful_vassal = {
						count >= 5
						is_councillor = yes
						OR = {
							has_trait = stubborn
							has_trait = gregarious
						}
					}
				}
				add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = @npvassal }
			}


			add_trait_xp = { trait = gpt_realm_ethos track = gpt_taxation value = 0.1 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_charity value = 0.1 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_revelry value = 0.1 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_warfare value = 0.1 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_authority value = 0.1 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_production value = 0.1 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_statecraft value = 0.1 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_espionage value = 0.1 }
			add_trait_xp = { trait = gpt_realm_ethos track = gpt_scholarship value = 0.1 }
		}
	}	
}

gpt_entourage_circle_check = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {
		
		if = {
			limit = {
				is_ai = yes
				OR = {
					has_game_rule = GPT_rfavor_disabled
					highest_held_title_tier < gpt_rfavor_tier
				}
			}
			if = { limit = { has_trait = gpt_entourage_circle } remove_trait = gpt_entourage_circle }
		}

		if = {
			limit = {
			 #	is_landed = yes
				age >= 14
				NOT = { has_game_rule = GPT_rfavor_disabled }
				OR = {
					highest_held_title_tier >= gpt_rfavor_tier
					is_ai = no
				}
			}
			if = { limit = { NOT = { has_trait = gpt_entourage_circle } } add_trait = gpt_entourage_circle }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_coterie value = -100 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_retainers value = -100 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_advisors value = -100 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_family value = -100 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_devouts value = -100 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_foragers value = -100 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_sycophants value = -100 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_artisans value = -100 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_commoners value = -100 }
			
			if = {
				limit = {
					has_trait = gpt_entourage_circle 
				}
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_coterie value = { value = 0 add = ai_sociability } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_coterie value = { value = 0 add = ai_zeal multiply = -1 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_retainers value = { value = 0 add = ai_honor } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_retainers value = { value = 0 add = ai_compassion multiply = -1 } }
				
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_advisors value = { value = 0 add = ai_energy } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_family value = { value = 0 add = ai_vengefulness } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_family value = { value = 0 add = ai_boldness multiply = -1 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_devouts value = { value = 0 add = ai_zeal } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_devouts value = { value = 0 add = ai_sociability multiply = -1 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_foragers value = { value = 0 add = ai_boldness } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_foragers value = { value = 0 add = ai_rationality multiply = -1 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_sycophants value = { value = 0 add = ai_greed } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_sycophants value = { value = 0 add = ai_honor multiply = -1 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_artisans value = { value = 0 add = ai_vengefulness multiply = -1 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_artisans value = { value = 0 add = ai_rationality } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_commoners value = { value = 0 add = ai_compassion } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_commoners value = { value = 0 add = ai_greed multiply = -1 } }


				add_trait_xp = { trait = gpt_entourage_circle track = gpt_coterie value = { value = 0 add = diplomacy multiply = 2 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_coterie value = { value = 0 add = learning multiply = -2 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_retainers value = { value = 0 add = martial multiply = 2 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_retainers value = { value = 0 add = intrigue multiply = -2 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_family value = { value = 0 add = intrigue multiply = 2 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_family value = { value = 0 add = dread multiply = -1 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_devouts value = { value = 0 add = learning multiply = 2 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_devouts value = { value = 0 add = stewardship multiply = -2 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_foragers value = { value = 0 add = prowess multiply = 1.5 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_foragers value = { value = 0 add = diplomacy multiply = -2 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_sycophants value = { value = 0 add = dread multiply = 1 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_sycophants value = { value = 0 add = learning multiply = -2 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_artisans value = { value = 0 add = stewardship multiply = 2 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_artisans value = { value = 0 add = prowess multiply = -1.5 } }

				add_trait_xp = { trait = gpt_entourage_circle track = gpt_commoners value = { value = 0 add = legitimacy_level multiply = 3.5 } }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_commoners value = { value = 0 add = martial multiply = -2 } }
			}

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

			if = {
		 		limit = {
		 			has_trait = gpt_entourage_circle
					OR = {
						AND = {
							has_trait = gregarious
		 					has_trait = zealous
						}
						AND = {
							has_trait = shy
		 					has_trait = cynical
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_entourage_circle track = gpt_coterie value = -100 }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_coterie value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_entourage_circle
					OR = {
						AND = {
							has_trait = just
		 					has_trait = compassionate
						}
						AND = {
							has_trait = arbitrary
		 					has_trait = sadistic
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_entourage_circle track = gpt_retainers value = -100 }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_retainers value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_entourage_circle
					OR = {
						AND = {
							has_trait = vengeful
		 					has_trait = brave
						}
						AND = {
							has_trait = forgiving
		 					has_trait = craven
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_entourage_circle track = gpt_family value = -100 }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_family value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_entourage_circle
					OR = {
						AND = {
							has_trait = zealous
		 					has_trait = gregarious
						}
						AND = {
							has_trait = shy
		 					has_trait = cynical
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_entourage_circle track = gpt_devouts value = -100 }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_devouts value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_entourage_circle
					OR = {
						AND = {
							has_trait = greedy
		 					has_trait = just
						}
						AND = {
							has_trait = arbitrary
		 					has_trait = generous
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_entourage_circle track = gpt_sycophants value = -100 }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_sycophants value = 50 }
		 	}
			if = {
		 		limit = {
		 			has_trait = gpt_entourage_circle
					OR = {
						AND = {
							has_trait = compassionate
		 					has_trait = greedy
						}
						AND = {
							has_trait = sadistic
		 					has_trait = generous
						}
					}
		 		}
		 		add_trait_xp = { trait = gpt_entourage_circle track = gpt_commoners value = -100 }
				add_trait_xp = { trait = gpt_entourage_circle track = gpt_commoners value = 50 }
		 	}

			add_trait_xp = { trait = gpt_entourage_circle track = gpt_coterie value = 0.1 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_retainers value = 0.1 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_advisors value = 0.1 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_family value = 0.1 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_devouts value = 0.1 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_foragers value = 0.1 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_sycophants value = 0.1 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_artisans value = 0.1 }
			add_trait_xp = { trait = gpt_entourage_circle track = gpt_commoners value = 0.1 }
		}
	}	
}





gpt_royal_favor_dynasty = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_social_strata
				NOT = { has_character_flag = gpt_favoring_dynasty }
				has_character_flag = gpt_favoring_dynasty_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_favoring_dynasty_end_t
							desc = gpt_favoring_dynasty_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_favoring_dynasty_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_social_strata
				has_character_flag = gpt_favoring_dynasty
				has_character_flag = gpt_favoring_dynasty_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_dynasty_event_01_t
							desc = bestow_favor_dynasty_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_02_t
							desc = bestow_favor_dynasty_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_03_t
							desc = bestow_favor_dynasty_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_04_t
							desc = bestow_favor_dynasty_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_05_t
							desc = bestow_favor_dynasty_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_06_t
							desc = bestow_favor_dynasty_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_07_t
							desc = bestow_favor_dynasty_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_08_t
							desc = bestow_favor_dynasty_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_09_t
							desc = bestow_favor_dynasty_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_10_t
							desc = bestow_favor_dynasty_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_11_t
							desc = bestow_favor_dynasty_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_12_t
							desc = bestow_favor_dynasty_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_13_t
							desc = bestow_favor_dynasty_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_14_t
							desc = bestow_favor_dynasty_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_15_t
							desc = bestow_favor_dynasty_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_16_t
							desc = bestow_favor_dynasty_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_17_t
							desc = bestow_favor_dynasty_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_18_t
							desc = bestow_favor_dynasty_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_19_t
							desc = bestow_favor_dynasty_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_dynasty_event_20_t
							desc = bestow_favor_dynasty_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_royal_favor_nobility = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_social_strata
				NOT = { has_character_flag = gpt_favoring_nobility }
				has_character_flag = gpt_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_favoring_nobility_end_t
							desc = gpt_favoring_nobility_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_favoring_nobility_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_social_strata
				has_character_flag = gpt_favoring_nobility
				has_character_flag = gpt_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_nobility_event_01_t
							desc = bestow_favor_nobility_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_02_t
							desc = bestow_favor_nobility_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_03_t
							desc = bestow_favor_nobility_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_04_t
							desc = bestow_favor_nobility_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_05_t
							desc = bestow_favor_nobility_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_06_t
							desc = bestow_favor_nobility_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_07_t
							desc = bestow_favor_nobility_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_08_t
							desc = bestow_favor_nobility_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_09_t
							desc = bestow_favor_nobility_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_10_t
							desc = bestow_favor_nobility_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_11_t
							desc = bestow_favor_nobility_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_12_t
							desc = bestow_favor_nobility_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_13_t
							desc = bestow_favor_nobility_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_14_t
							desc = bestow_favor_nobility_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_15_t
							desc = bestow_favor_nobility_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_16_t
							desc = bestow_favor_nobility_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_17_t
							desc = bestow_favor_nobility_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_18_t
							desc = bestow_favor_nobility_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_19_t
							desc = bestow_favor_nobility_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_nobility_event_20_t
							desc = bestow_favor_nobility_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_royal_favor_merchants = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_social_strata
				NOT = { has_character_flag = gpt_favoring_merchants }
				has_character_flag = gpt_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_favoring_merchants_end_t
							desc = gpt_favoring_merchants_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_favoring_merchants_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_social_strata
				has_character_flag = gpt_favoring_merchants
				has_character_flag = gpt_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_merchants_event_01_t
							desc = bestow_favor_merchants_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_02_t
							desc = bestow_favor_merchants_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_03_t
							desc = bestow_favor_merchants_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_04_t
							desc = bestow_favor_merchants_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_05_t
							desc = bestow_favor_merchants_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_06_t
							desc = bestow_favor_merchants_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_07_t
							desc = bestow_favor_merchants_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_08_t
							desc = bestow_favor_merchants_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_09_t
							desc = bestow_favor_merchants_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_10_t
							desc = bestow_favor_merchants_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_11_t
							desc = bestow_favor_merchants_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_12_t
							desc = bestow_favor_merchants_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_13_t
							desc = bestow_favor_merchants_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_14_t
							desc = bestow_favor_merchants_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_15_t
							desc = bestow_favor_merchants_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_16_t
							desc = bestow_favor_merchants_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_17_t
							desc = bestow_favor_merchants_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_18_t
							desc = bestow_favor_merchants_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_19_t
							desc = bestow_favor_merchants_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_merchants_event_20_t
							desc = bestow_favor_merchants_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_royal_favor_knights = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_social_strata
				NOT = { has_character_flag = gpt_favoring_knights }
				has_character_flag = gpt_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_favoring_knights_end_t
							desc = gpt_favoring_knights_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_favoring_knights_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_social_strata
				has_character_flag = gpt_favoring_knights
				has_character_flag = gpt_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_knights_event_01_t
							desc = bestow_favor_knights_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_02_t
							desc = bestow_favor_knights_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_03_t
							desc = bestow_favor_knights_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_04_t
							desc = bestow_favor_knights_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_05_t
							desc = bestow_favor_knights_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_06_t
							desc = bestow_favor_knights_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_07_t
							desc = bestow_favor_knights_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_08_t
							desc = bestow_favor_knights_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_09_t
							desc = bestow_favor_knights_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_10_t
							desc = bestow_favor_knights_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_11_t
							desc = bestow_favor_knights_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_12_t
							desc = bestow_favor_knights_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_13_t
							desc = bestow_favor_knights_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_14_t
							desc = bestow_favor_knights_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_15_t
							desc = bestow_favor_knights_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_16_t
							desc = bestow_favor_knights_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_17_t
							desc = bestow_favor_knights_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_18_t
							desc = bestow_favor_knights_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_19_t
							desc = bestow_favor_knights_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_knights_event_20_t
							desc = bestow_favor_knights_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_royal_favor_clergy = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_social_strata
				NOT = { has_character_flag = gpt_favoring_clergy }
				has_character_flag = gpt_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_favoring_clergy_end_t
							desc = gpt_favoring_clergy_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_favoring_clergy_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_social_strata
				has_character_flag = gpt_favoring_clergy
				has_character_flag = gpt_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_clergy_event_01_t
							desc = bestow_favor_clergy_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_02_t
							desc = bestow_favor_clergy_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_03_t
							desc = bestow_favor_clergy_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_04_t
							desc = bestow_favor_clergy_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_05_t
							desc = bestow_favor_clergy_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_06_t
							desc = bestow_favor_clergy_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_07_t
							desc = bestow_favor_clergy_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_08_t
							desc = bestow_favor_clergy_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_09_t
							desc = bestow_favor_clergy_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_10_t
							desc = bestow_favor_clergy_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_11_t
							desc = bestow_favor_clergy_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_12_t
							desc = bestow_favor_clergy_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_13_t
							desc = bestow_favor_clergy_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_14_t
							desc = bestow_favor_clergy_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_15_t
							desc = bestow_favor_clergy_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_16_t
							desc = bestow_favor_clergy_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_17_t
							desc = bestow_favor_clergy_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_18_t
							desc = bestow_favor_clergy_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_19_t
							desc = bestow_favor_clergy_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_clergy_event_20_t
							desc = bestow_favor_clergy_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_royal_favor_peasants = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_social_strata
				NOT = { has_character_flag = gpt_favoring_peasants }
				has_character_flag = gpt_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_favoring_peasants_end_t
							desc = gpt_favoring_peasants_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_favoring_peasants_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_social_strata
				has_character_flag = gpt_favoring_peasants
				has_character_flag = gpt_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_peasants_event_01_t
							desc = bestow_favor_peasants_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_02_t
							desc = bestow_favor_peasants_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_03_t
							desc = bestow_favor_peasants_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_04_t
							desc = bestow_favor_peasants_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_05_t
							desc = bestow_favor_peasants_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_06_t
							desc = bestow_favor_peasants_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_07_t
							desc = bestow_favor_peasants_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_08_t
							desc = bestow_favor_peasants_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_09_t
							desc = bestow_favor_peasants_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_10_t
							desc = bestow_favor_peasants_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_11_t
							desc = bestow_favor_peasants_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_12_t
							desc = bestow_favor_peasants_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_13_t
							desc = bestow_favor_peasants_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_14_t
							desc = bestow_favor_peasants_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_15_t
							desc = bestow_favor_peasants_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_16_t
							desc = bestow_favor_peasants_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_17_t
							desc = bestow_favor_peasants_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_18_t
							desc = bestow_favor_peasants_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_19_t
							desc = bestow_favor_peasants_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_peasants_event_20_t
							desc = bestow_favor_peasants_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_gain }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_loss }
					}
				}
			}
		}
	}
}

gpt_royal_favor_outlaws = {
	trigger = {
		is_landless_adventurer = no
		NOT = { has_game_rule = GPT_rfavor_disabled }
		OR = {
			is_ai = no
			has_game_rule = GPT_rfavor_count
			has_game_rule = GPT_rfavor_duke
			has_game_rule = GPT_rfavor_king
		}
	}
	effect = {

		if = {
			limit = {
				has_trait = gpt_social_strata
				NOT = { has_character_flag = gpt_favoring_criminals }
				has_character_flag = gpt_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_favoring_criminals_end_t
							desc = gpt_favoring_criminals_end_d
							left_icon = root
						 #	show_as_tooltip = { custom_tooltip = { text = favor_stop_xp_tip } }
						}
						remove_character_flag = gpt_favoring_criminals_timeout
					}
				}
			}
		}

		if = {
			limit = {
				has_trait = gpt_social_strata
				has_character_flag = gpt_favoring_criminals
				has_character_flag = gpt_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_outlaws_event_01_t
							desc = bestow_favor_outlaws_event_01_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_02_t
							desc = bestow_favor_outlaws_event_02_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_03_t
							desc = bestow_favor_outlaws_event_03_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_04_t
							desc = bestow_favor_outlaws_event_04_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_05_t
							desc = bestow_favor_outlaws_event_05_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_06_t
							desc = bestow_favor_outlaws_event_06_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_07_t
							desc = bestow_favor_outlaws_event_07_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_08_t
							desc = bestow_favor_outlaws_event_08_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_09_t
							desc = bestow_favor_outlaws_event_09_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_10_t
							desc = bestow_favor_outlaws_event_10_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_11_t
							desc = bestow_favor_outlaws_event_11_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_12_t
							desc = bestow_favor_outlaws_event_12_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_13_t
							desc = bestow_favor_outlaws_event_13_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_14_t
							desc = bestow_favor_outlaws_event_14_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_15_t
							desc = bestow_favor_outlaws_event_15_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_16_t
							desc = bestow_favor_outlaws_event_16_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_17_t
							desc = bestow_favor_outlaws_event_17_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_18_t
							desc = bestow_favor_outlaws_event_18_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_19_t
							desc = bestow_favor_outlaws_event_19_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
					1 = {
						send_interface_message = {
							type = event_rfavor_neutral_with_text
							title = bestow_favor_outlaws_event_20_t
							desc = bestow_favor_outlaws_event_20_d
							show_as_tooltip = { add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain } custom_tooltip = { text = gpt_loss_favor_xp } }
						}
						add_trait_xp = { trait = gpt_social_strata track = gpt_dynasty value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_nobility value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_merchants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_knights value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_clergy value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_peasants value = @xp_loss }
						add_trait_xp = { trait = gpt_social_strata track = gpt_criminals value = @xp_gain }
					}
				}
			}
		}
	}
}




gpt_remove_check = {
	trigger = {
		OR = {
			has_game_rule = GPT_rfavor_player
			has_game_rule = GPT_rfavor_disabled
		}
	}
	effect = {
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_social_strata
			}
			remove_trait = gpt_social_strata
		}
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_realm_ethos
			}
			remove_trait = gpt_realm_ethos
		}
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_court_skill
			}
			remove_trait = gpt_court_skill
		}
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_army_xp
			}
			remove_trait = gpt_army_xp
		}
		if = {
			limit = {
				is_ai = yes
				has_trait = gpt_entourage_circle
			}
			remove_trait = gpt_entourage_circle
		}
		if = {
			limit = {
				is_ai = no
				has_game_rule = GPT_rfavor_disabled
				OR = {
					has_trait = gpt_social_strata
					has_trait = gpt_realm_ethos
					has_trait = gpt_army_xp
					has_trait = gpt_court_skill
					has_trait = gpt_entourage_circle
				}
			}
			remove_trait = gpt_social_strata
			remove_trait = gpt_realm_ethos
			remove_trait = gpt_army_xp
			remove_trait = gpt_court_skill
			remove_trait = gpt_entourage_circle
		}
	}	
}

gpt_remove_check_2 = {
	trigger = {
		OR = {
		 #	is_landed = no
			is_landless_adventurer = yes
		}
	}
	effect = {
		if = {
			limit = {
				OR = {
				 #	is_landed = no
					is_landless_adventurer = yes
				}
				has_trait = gpt_social_strata
			}
			remove_trait = gpt_social_strata
		}
		if = {
			limit = {
				is_landless_adventurer = yes
				has_trait = gpt_realm_ethos
			}
			remove_trait = gpt_realm_ethos
		}
		if = {
			limit = {
				is_landless_adventurer = yes
				has_trait = gpt_court_skill
			}
			remove_trait = gpt_court_skill
		}
		if = {
			limit = {
				is_landless_adventurer = yes
				has_trait = gpt_army_xp
			}
			remove_trait = gpt_army_xp
		}
		if = {
			limit = {
				is_landless_adventurer = yes
				has_trait = gpt_entourage_circle
			}
			remove_trait = gpt_entourage_circle
		}
	}	
}
