# Empty Template Non-Unique
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname

    }
    weight_multiplier = {
        base = 1
        modifier = {

        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# Empty Template Unique
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
		NOT = { exists = nickname_character } # New "exists" condition
    }
    weight_multiplier = {
        base = 1
        modifier = {

        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
		add_global_flag = nickname_character # Set a global flag to mark that the nickname has been acquired
    }
}

# Strong Tall Person Unique
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        has_weak_trait_trigger = no
		OR = {
			has_trait = giant
			has_trait = physique_good_3
            AND = {
                has_strong_trait_trigger = yes
                prowess >= 20
            }
            prowess >= 30
		}
		age >= 16
		prowess >= 10

    }
    weight_multiplier = {
        base = 5
        modifier = {
            factor = 3
            AND = {
                has_trait = giant
                has_strong_trait_trigger = yes
            }
        }
        modifier = {
            factor = 3
            prowess >= 30
        }
        modifier = {
            factor = 3
            has_trait_rank = {
                trait = education_martial
                rank >= 2
            }
        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# Tall Person Unique
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
		NOT = { exists = nickname_character } # New "exists" condition
		OR = {
			has_trait = giant
			has_trait = physique_good_3
            AND = {
                has_strong_trait_trigger = yes
                prowess >= 15
            }
		}
		age >= 16

    }
    weight_multiplier = {
        base = 5
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
		add_global_flag = nickname_character # Set a global flag to mark that the nickname has been acquired
    }
}

# Short/Weak Person Unique
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        has_strong_trait_trigger = no
		OR = {
			has_trait = dwarf
            has_weak_trait_trigger = yes
            AND = {
                has_character_modifier = malnourished_modifier
                prowess <= 5
            }
		}
        prowess <= 10
        age >= 16
    }
    weight_multiplier = {
        base = 10
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# Short Strong Person Unique
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
		OR = {
			has_trait = dwarf
            has_weak_trait_trigger = yes
		}
        OR = {
            prowess >= 15
            has_trait_rank = {
                trait = education_martial
                rank >= 2
            }
        }
		age >= 15

    }
    weight_multiplier = {
        base = 10
        modifier = {
            factor = 3
            AND = {
                prowess >= 15
                has_trait_rank = {
                    trait = education_martial
                    rank >= 2
                }
            }
        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# Dreadful/Evil Ruler Unique
WUN_namespace.0000 = {
    hidden = yes
	trigger = {
		age >= 20
		OR = {
			has_trait = wrathful
			has_trait = lunatic
			has_trait = sadistic
			has_trait = torturer
			has_trait = arbitrary
			has_trait = deceitful
			has_trait = paranoid
			has_trait = callous
			has_trait = vengeful
			has_trait = impatient
		}
		tyranny >= 20
	}
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2.0
			calc_true_if = {
				amount >= 2
				has_trait = wrathful
				has_trait = lunatic
				has_trait = sadistic
				has_trait = torturer
				has_trait = arbitrary
				has_trait = stubborn
				has_trait = deceitful
				has_trait = paranoid
				has_trait = callous
				has_trait = vengeful
				has_trait = impatient
			}
		}
		modifier = {
			factor = 2.0
			tyranny >= 40
		}
		modifier = {
			factor = 2.0
			tyranny >= 60
		}
	}
    immediate = {
        set_nickname_effect = { NICKNAME = }
    }
}

# Diplomatic / Benevolent Ruler
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        is_ruler = yes
        tyranny <= 0
        NOT = {
            has_trait = sadistic
            has_trait = callous
            has_trait = arbitrary
            has_trait = deceitful
            has_trait = wrathful
            has_trait = vengeful
        }
        calc_true_if = {
            amount >= 2
            has_trait = compassionate
            has_trait = just
            has_trait = generous
            has_trait = honest
            has_trait = forgiving
            has_trait = calm
        }
    }
    weight_multiplier = {
        base = 10
        modifier = {
            factor = 3
            calc_true_if = {
                amount >= 3
                has_trait = compassionate
                has_trait = just
                has_trait = generous
                has_trait = honest
                has_trait = forgiving
                has_trait = calm
            }
        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# High Prowess/Intelligent/High stats Unique Nickname
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        OR = {
            AND = {
                is_smart_trigger = yes
                prowess >= 15
            }
            AND = {
                prowess >= 15
                has_strong_trait_trigger = yes
            }
            prowess >= 20
            martial >= 20
        }
        NOT = {
            has_trait = craven
        }
    }
    weight_multiplier = {
        base = 10
        modifier = {
            factor = 2
            prowess >= 30
        }
        modifier = {
            factor = 0.5
            is_lowborn = yes
        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# Random Unique Nickname
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        OR = {
            is_smart_trigger = yes
            has_strong_trait_trigger = yes
            prowess >= 30
            has_trait = beauty_good
        }
        NOT = {
            has_trait = craven
        }
        age >= 16
    }
    weight_multiplier = {
        base = 5
        modifier = {
            factor = 2
            prowess >= 40
        }
        modifier = {
            factor = 0.5
            is_lowborn = yes
        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# Dilligent / Builder / Scholar
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        age >= 20
        OR = {
            has_trait = architect
            has_trait = scholar
        }
        has_trait = dilligent
        NOT = {
            has_trait = lazy
        }
    }
    weight_multiplier = {
        base = 5
        modifier = {
            factor = 2
            diplomacy >= 20
        }
        modifier = {
            factor = 2
            martial >= 20
        }
        modifier = {
            factor = 2
            stewardship >= 20
        }
        modifier = {
            factor = 2
            intrigue >= 20
        }
        modifier = {
            factor = 2
            learning >= 20
        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# Scholar / Inventive / Bookworm
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        OR = {
            has_trait = scholar
            has_trait = architect
            has_trait = administrator
            has_trait = theologian
            has_trait = lifestyle_herbalist
        }
        OR = {
            learning >= 20
            stewardship >= 20
            is_smart_trigger = yes
        }
    }
    weight_multiplier = {
        base = 5
        modifier = {
            factor = 2
            diplomacy >= 20
        }
        modifier = {
            factor = 2
            martial >= 20
        }
        modifier = {
            factor = 2
            stewardship >= 20
        }
        modifier = {
            factor = 2
            intrigue >= 20
        }
        modifier = {
            factor = 2
            learning >= 20
        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# Smart person
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        is_smart_trigger = yes
        age >= 16
    }
    weight_multiplier = {
        base = 5
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# High Prestige / Majestic Person
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        OR = {
            AND = {
                prestige_level >= 3
                is_smart_trigger = yes
            }
            prestige_level >= 4
        }
        NOT = {
            has_trait = arbitrary
            has_trait = shy
        }
        age >= 16
    }
    weight_multiplier = {
        base = 5
        modifier = {
            factor = 2
            diplomacy >= 20
        }
        modifier = {
            factor = 2
            martial >= 20
        }
        modifier = {
            factor = 2
            stewardship >= 20
        }
        modifier = {
            factor = 2
            intrigue >= 20
        }
        modifier = {
            factor = 2
            learning >= 20
        }
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}

# HOUSE / DYNASTY / CULTURE
WUN_namespace.0000 = {
    hidden = yes
    trigger = {
        # Conditions to get the nickname
        dynasty = dynasty:dynn_Stark
    }
    weight_multiplier = {
        base = 100
    }
    immediate = {
        set_nickname_effect = { NICKNAME = nick_ }
    }
}