﻿

random_yearly_playable_pulse = {
	on_actions = {
		yearly_on_action_events_magister
		yearly_on_action_magister_heresy
	}
}

yearly_on_action_events_magister = {
	trigger = {
		is_ai = no
		is_travelling = no
		is_at_war = no
		has_trait = magister_trait_group
	}

	random_events = {
		chance_to_happen = 50

		200 = 0						# To prevent 1 eligible event from constantly firing.
		100 = regula_yearly.1000 	# Vassal offers liege a gift.
		200 = regula_yearly.1100 	# A group of vassals collectively wish to contribute to your war effort against a female ruler.
		50  = regula_yearly.1300	# Vassal offers to start a holy order. Has a high likelihood modifier, based on vassal personality traits.
		100 = regula_yearly.2101 	# Catching Lover and Spouse fighting.
		100 = regula_yearly.2200	# Paelex tries to displace Domina.
		100 = regula_yearly.2300	# Domina offers Paelex to Magister
		100 = regula_yearly.2400	# Paelex presents a barren woman to you
	}
}

yearly_on_action_magister_heresy = {
	trigger = {
		is_ai = no
		has_trait = magister_trait_group
		NOT = { has_game_rule = regula_heresy_difficulty_disabled }
		regula_heresy_blocked_trigger = no
		regula_heresy_valid_trigger = yes
		regula_heresy_ongoing_trigger = no
	}

	effect = {
		regula_heresy_story_start_chance_log_effect = yes
		random = {
			chance = regula_heresy_story_start_chance
			regula_heresy_start_story_cycle_effect = yes
		}
	}
}
