﻿bodyguards_effect = {
	if = {
		limit = {
			AND = {
				is_ai = yes
				NOT = { has_character_modifier = helpmeouted_modifier }
				OR = {
					has_character_modifier = bad_omen_modifier
					has_character_modifier = good_omen_modifier
					has_character_modifier = poisonous_gold_modifier
					has_character_modifier = suspicious_of_carpet_modifier
					has_character_modifier = has_plush_carpet_modifier
					has_character_modifier = watchful_modifier
				}
			}
		}
	add_character_modifier = {
		modifier = helpmeouted_modifier
		years = 3
	}
	save_scope_as = helpmeout
	house = {
		add_house_modifier = {
			modifier = helpmeout_modifier
			desc = helpmeout_modifier_custom_desc
			years = 3
			stacking = yes
		}
		every_house_member = {
			limit = { is_ai = no }
				send_interface_message = {
					type = event_generic_bad_with_text
					title = helpmeout_alert
					desc = helpmeout_alert_desc
					left_icon = scope:helpmeout
					right_icon = scope:title
				}
		}
	}
	}
}


guardon_effect = {
	if = {
		limit = {
			NOR = {
				has_character_modifier = shadowbodyguard_modifier
				has_character_modifier = holybodyguard_modifier
				has_character_modifier = prestigebodyguard_modifier
				has_character_modifier = elitebodyguard_modifier
				is_lowborn = yes
				is_pool_character = yes
				any_parent = { is_ai = no }
				is_ai = no
				has_trait = intellect_bad_3
				has_trait = beauty_bad_3
				has_trait = physique_bad_3
				has_trait = intellect_bad_2
				has_trait = beauty_bad_2
				has_trait = physique_bad_2
				has_trait = intellect_bad_1
				has_trait = beauty_bad_1
				has_trait = physique_bad_1
				has_trait = lovers_pox
				has_trait = early_great_pox
				has_trait = great_pox
				has_trait = smallpox
				has_trait = dull
				has_trait = infertile
				has_trait = maimed
				has_trait = albino
				has_trait = leper
				has_trait = impotent
				has_trait = inbred
				has_trait = dwarf
				has_trait = scaly
				has_trait = hunchbacked
				has_trait = weak
				has_trait = bleeder
				has_trait = spindly
				has_trait = wheezing
				has_trait = clubfooted
				has_trait = stuttering
				has_trait = lisping
				has_trait = blind
				has_trait = sickly
			}
			OR = {
				has_character_modifier = bad_omen_modifier
				has_character_modifier = good_omen_modifier
				has_character_modifier = poisonous_gold_modifier
				has_character_modifier = suspicious_of_carpet_modifier
				has_character_modifier = has_plush_carpet_modifier
				has_character_modifier = watchful_modifier
				num_virtuous_traits >= 2
				num_of_relation_rival >= 3
				num_of_relation_friend >= 3
				has_trait = shrewd
				has_trait = intellect_good_1
				has_trait = beauty_good_1
				has_trait = physique_good_1
				has_trait = intellect_good_2
				has_trait = beauty_good_2
				has_trait = physique_good_2
				has_trait = intellect_good_3
				has_trait = beauty_good_3
				has_trait = physique_good_3
				is_betrothed = yes
			}
		}
		random_list = {
				86 = { }
				6 = { add_character_modifier = { modifier = shadowbodyguard_modifier years = 5 } }
				3 = { add_character_modifier = { modifier = holybodyguard_modifier years = 5 } }
				3 = { add_character_modifier = { modifier = prestigebodyguard_modifier years = 5 } }
				2 = { add_character_modifier = { modifier = elitebodyguard_modifier years = 5 } }
		}
	}
	else_if = {
		limit = {
			NOR = {
				has_character_modifier = shadowbodyguard_modifier
				has_character_modifier = holybodyguard_modifier
				has_character_modifier = prestigebodyguard_modifier
				has_character_modifier = elitebodyguard_modifier
				is_lowborn = yes
				is_pool_character = yes
				any_parent = { is_ai = no }
				is_ai = no
			}
			OR = {
				has_character_modifier = bad_omen_modifier
				has_character_modifier = good_omen_modifier
				has_character_modifier = poisonous_gold_modifier
				has_character_modifier = suspicious_of_carpet_modifier
				has_character_modifier = has_plush_carpet_modifier
				has_character_modifier = watchful_modifier
				sum_of_all_skills_value >= 70
				learning >= 25
				martial >= 25
				diplomacy >= 25
				intrigue >= 25
				stewardship >= 25
			}
		}
		random_list = {
				90 = { }
				5 = { add_character_modifier = { modifier = shadowbodyguard_modifier years = 5 } }
				2 = { add_character_modifier = { modifier = holybodyguard_modifier years = 5 } }
				2 = { add_character_modifier = { modifier = prestigebodyguard_modifier years = 5 } }
				1 = { add_character_modifier = { modifier = elitebodyguard_modifier years = 5 } }
		}
	}
}
	
