﻿
random_yearly_everyone_pulse = {
	on_actions = {
		slave_profit_pulse
		property_profit_pulse
		work_maintenance_pulse
		rtr_lifestyle_progress_pulse
		slave_ongoing
		slave_ration
		rtr_random_yearly_pulse
	}
}

rtr_random_yearly_pulse = {

trigger = { basic_is_valid_for_yearly_events_rtr_trigger = yes }

random_on_action = {
		chance_of_no_event = {
			value = 0
			if = {
				limit = {
					is_ai = yes
					highest_held_title_tier < tier_duchy
				}
				add = 75 # AI counts aren't particularly important
			}
		}
		6 = on_yearly_events
		5 = fp1_yearly_events
		4 = fp2_yearly_events
		4 = fp3_yearly_events
		2 = bp1_yearly_events
		6 = ep3_yearly_events_byzantium
		6 = ep3_yearly_events_admin
	
	effect = {
		# Special Holy Seeds drops
		if = {
			limit = {
				has_dlc_feature = legends
				OR = {
					has_trait = theologian
					has_trait = sayyid
				}
				NOT = { has_game_rule = historical_legends_only }
			}
			random = {
				chance = 15
				send_interface_toast = {
					type = msg_legend_seed_created
					title = holy_seed_toast_traits
					left_icon = root
					create_legend_seed = {
						type = holy
						quality = famed
						chronicle = saintly_life
						properties = {
							religion = root.religion
						}
					}
				}
			}
		}
		# Baron contract generation
		if = {
			limit = {
				highest_held_title_tier = tier_barony
			}
			random = {
				chance = {
					value = 70
					if = {
						limit = { has_character_flag = admin_governance_frequency_cooldown }
						subtract = 50
					}
				}
				spawn_baron_contract_effect = yes
			}
		}
	}
	on_actions = {
		delay = { days = { 45 75 } }
		on_yearly_common_events	
		delay = { days = { 50 80 } }
		on_yearly_invisible_events
		delay = { days = { 85 165 } }
		bishop_ongoing
		delay = { days = { 166 185 } }
		jester_ongoing
		delay = { days = { 186 205 } }
		wet_nurse_pulse
		delay = { days = { 51 180 } }
		childhood_ongoing
		delay = { days = { 51 180 } }
		hunt_sighting_on_action
		delay = { days = { 181 240 } }
		bp2_child_pulse
		delay = { days = { 181 240 } }
		bp2_parent_guardian_hostage_taker_pulse
		delay = { days = { 241 290 } }
		bp2_adult_followups
		delay = { days = { 291 310 } }
		court_scholar_ongoing
		delay = { days = { 25 44 } }
		clan_events_on_action
		ep3_akolouthos_on_action
		delay = { days = { 25 44 } }
	}

}
}