fall_of_majapahit = {
	ended_by_country_breaking_to_rebels = no
	potential = {
		has_dlc = "Leviathan"
		NOT = { has_country_flag = had_fall_of_majapahit }
		uses_doom = no
		is_free_or_tributary_trigger = yes
		normal_or_historical_nations = yes
		tag = MAJ
	}
	
	can_start = {
		has_any_disaster = no
		
		#added
		started_in = 1389.1.1		#after death of Hayam Wuruk, fell into decline and internal conflict
	}
	
	can_stop = { 
		has_any_disaster = yes
	}
	
	
	progress = {
		modifier = {
			factor = 100
			tag = MAJ
		}
	}
	
	can_end = {
		mission_completed = mnd_maj_end_disaster
	}
	

	modifier = {
		all_power_cost = 0.15
		monarch_lifespan = -0.5
		reduced_liberty_desire = -15
	}
	
	on_start = majapahit.3 # The Fall of Majapahit
	on_end = majapahit.4 # Stabilizing an Empire
	
	on_monthly = {
		events = {
			majapahit.5 # The Rise of Demak
			majapahit.6 # The rise of Mataram
			majapahit.9 # Aid from Muslim merchants
		}
		random_events = {
			360 = 0
			10 = majapahit.7 # Tributary Breaks Away
			10 = majapahit.10 # Spread of Islam in [province]
		}
	}
}

