########################################################
# MINOR TITLES
# Characters can have any number of these
########################################################
#	grant_limit: Max number of holders.
#	realm_in_name: Append the name of the country after the title (Queen [of Sweden])
#	allowed_to_hold: conditions for the character to hold the title
#	allowed_to_grant: conditions for a ruler to grant the title
#	regent: This is the title for regents (not really "minor")
#	gain_effect: fires when the title is granted
#	lose_effect: fires when a title is lost through most causes
#	retire_effect: fires when a title is lost due to the character stepping down
#	death_effect: fires when a title is lost due to the character dying
#	message: should fire a message to the its owner when set
#	The other fields are all character modifiers.

title_princeps_officii = {
	realm_in_name = yes
	dignity = 0.9
	grant_limit = 1
	opinion_effect = 0
	revoke_allowed = yes
	
	allowed_to_grant = {
		higher_real_tier_than = DUKE	
		is_feudal = yes
		
		has_character_flag = preparing_cash_cow
	}
	
	allowed_to_hold = {
		always = no
	}

	revoke_trigger = {
		always = no
	}
	
	gain_effect = {
		set_dynasty_flag = ongoing_patrician
		character_event = { id = MBF.3 days = 274 random = 91 } # Reconstruction or Redirection needed so it can fully customize progress and date of completion
																# 					^MBF.1
	}
	lose_effect = {
		clr_dynasty_flag = ongoing_patrician
		clear_delayed_event = { id = MBF.3 }
		FROM = {
			character_event = { id = MBF.40	} # notify check
		}
	}
	retire_effect = {
		clr_dynasty_flag = ongoing_patrician
		clear_delayed_event = { id = MBF.3 }
		FROM = {
			character_event = { id = MBF.40	} # notify check
		}
	}
	death_effect = {
		clr_dynasty_flag = ongoing_patrician
		clear_delayed_event = { id = MBF.3 }
		FROM = {
			character_event = { id = MBF.40	} # notify check
		}
	}

	message = yes
}

title_cornicularius = {
	dignity = 0.9
	grant_limit = 4
	opinion_effect = 0
	revoke_allowed = yes
	
	allowed_to_grant = {
		higher_real_tier_than = DUKE
		is_feudal = yes
		
		has_character_flag = preparing_cash_cow
	}
	
	allowed_to_hold = {
		is_female = no # Enatic merchant republic is not full supported in game
		is_adult = yes
		is_inaccessible_or_incapable_trigger = no
		is_lowborn = no
		is_abroad = no
		is_landed = no
		NOT = { trait = bastard }
		NOT = { dynasty = FROM }
		NOT = { has_dynasty_flag = ongoing_patrician }
	}

	revoke_trigger = {
		always = no
	}
	
	gain_effect = { # fire after lose_effect, retire_effect and death_effect
					# swapping patrician trigger notify inevitably.
		set_dynasty_flag = ongoing_patrician
	}
	lose_effect = {
		clr_dynasty_flag = ongoing_patrician
		FROM = {
			character_event = { id = MBF.41	} # notify check
		}
	}
	retire_effect = {
		clr_dynasty_flag = ongoing_patrician
		FROM = {
			character_event = { id = MBF.41	} # notify check
		}
	}
	death_effect = {
		clr_dynasty_flag = ongoing_patrician
		FROM = {
			character_event = { id = MBF.41	} # notify check
		}
	}

	message = yes
}