#####Majapahit Major Events######
#         By Cool-Toxic         #
#################################

event = {
	id = 865000
	trigger = {
		owned = {
			province = 677 #Malacca
			data = -1
		}
		control = {
			province = 677 #Malacca
			data = REB
		}
		owned = {
			province = 682 #Palembang
			data = -1
		}
		control = {
			province = 682 #Palembang
			data = REB
		}
		NOT = {
			stability = 0 # Lower than 0
		}
	}
	random = no
	country = MTR
	name = "Establishment of Malacca"
	desc = "Parameswara founded Malacca around 1402. He was a Hindu Srivijayan prince and Sejarah Melayu alleges that he was a descendant of the Macedonian King Alexander the Great. During Parameswara's time, Srivijaya was in decline and Majapahit had become the overlord of Srivijaya. Parameswara had a dispute with the Majapahit ruler and left Palembang for Temasek island - now Singapore."
	style = 1

	date = { year = 1389 }
	offset = 30
	deathdate = { year = 1429 }

	action_a ={
		name = "What a shame..."
		command = { type = independence  which = MLC }
		command = { type = stability value = 1 }
		command = { type = trigger   which = 865100 } 
	}
	action_b ={
		name = "Try to take it back!"
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = stability value = -2 }
	}
}

event = {
	id = 865001
	trigger = {
		owned = {
			province = 1744 #Malacca
			data = -1
		}
		control = {
			province = 1744 #Malacca
			data = REB
		}
		NOT = {
			stability = 0 # Lower than 0
		}
	}
	random = no
	country = MTR
	name = "Establishment of Demak"
	desc = "Parameswara founded Malacca around 1402. He was a Hindu Srivijayan prince and Sejarah Melayu alleges that he was a descendant of the Macedonian King Alexander the Great. During Parameswara's time, Srivijaya was in decline and Majapahit had become the overlord of Srivijaya. Parameswara had a dispute with the Majapahit ruler and left Palembang for Temasek island - now Singapore."
	style = 1

	date = { year = 1475 }
	offset = 30
	deathdate = { year = 1518 }

	action_a ={
		name = "What a shame..."
		command = { type = independence  which = IST }
		command = { type = stability value = 1 }
		command = { type = trigger   which = 865100 } 
	}
	action_b ={
		name = "Try to take it back!"
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = revolt which = -1 }
		command = { type = stability value = -2 }
	}
}

event = {
	id = 865002
	trigger = {
		owned = {
			province = 1744 #Malacca
			data = -1
		}
		control = {
			province = 1744 #Malacca
			data = REB
		}
		NOT = {
			stability = -2 # Lower than -2
		}
	}
	random = no
	country = MTR
	name = "The fall of Majapahit"
	desc = "Majapahit found itself unable to control the rising power of the Sultanate of Malacca. Dates for the end of the Majapahit Empire range from 1478 (that is, 1400 Saka, the ends of centuries being considered a time when changes of dynasty or courts normally ended) to 1527. After a series of battles with the Sultanate of Demak, the last remaining courtsmen of Majapahit were forced to withdraw eastward to Kediri; it is unclear whether they were still under the rule of the Majapahit dynasty. This small state was finally extinguished at the hands of the Demak in 1527."
	style = 1

	date = { year = 1500 }
	offset = 30
	deathdate = { year = 1527 }

	action_a ={
		name = "Try to resist them"
		command = { type = stability value = 1 }
		command = { type = trigger   which = 864301 }
	}
	action_b ={
		name = "Give up(Game over)"
		command = { type = trigger   which = 864302 }
	}
}


# Reserved IDs to 865099