﻿namespace = regula_orba_event

# 0001: Creation of Orba.
# 0002: Orba lose a bit of health each year
# 0003: If a character has the Orba health penalty, check to see if they should keep it

# Removes paelex or domina traits from those cast from the concubinage.
regula_orba_event.0001 = {
	hidden = yes
	type = character_event

	trigger = {
		is_regula_leader_devoted_trigger = yes
		NOT = {
			any_consort = {
				has_trait = magister_trait_group
			}
		}
	}

	immediate = {
		if = {
			limit = {
				OR = {
					has_trait = paelex
					has_trait = familia_paelex
					has_trait = domina
				}
			}
			remove_trait = paelex
			remove_trait = familia_paelex
			remove_trait = domina
		}
		add_trait = orba
		add_character_modifier = regula_orba_health_loss
		random = {
			chance = 25
			add_trait = depressed_1
		}
	}
}

# Orba continue to lose a bit of health each year
regula_orba_event.0002 = {
	hidden = yes
	type = character_event

	trigger = {
		has_trait = orba
	}

	immediate = {
		add_character_modifier = regula_orba_health_loss
	}
}

# If character has the Orba health penalty, remove it if they are no longer an Orba
regula_orba_event.0003 = {
	hidden = yes
	type = character_event

	trigger = {
		has_character_modifier = regula_orba_health_loss
		NOT = { has_trait = orba }
	}

	immediate = {
		remove_all_character_modifier_instances = regula_orba_health_loss
	}
}
