#######Demak Major Events########
#         By Cool-Toxic         #
#################################

event = {
	id = 865300
	trigger = {
		owned = {
			province = 1743 #Mataram
			data = -1
		}
		control = {
			province = 1743 #Mataram
			data = -1
		}
			stability = 1
	}
	random = no
	province = 1743
	name = "Establishment of Mataram"
	desc = "The Sultanate of Mataram was the last major independent Javanese empire on Java before the island was colonized by the Dutch. It was the dominant political force in interior Central Java from the late sixteenth century until the beginning of the eighteenth century."
	style = 1

	date = { year = 1570 }
	offset = 30
	deathdate = { year = 1700 }

	action_a ={
		name = "Help them become a Kingdom"
		command = { type = independence  which = DEL }
		command = { type = stability value = 1 }
		command = { type = trigger   which = 864301 }
	}
	action_b ={
		name = "Don't do anything"
		command = { type = revolt which = 1743 }
		command = { type = stability value = -2 }
	}
}

event = {
	id = 864301 # Triggered by MTR 865002A
	random = no
	country = IST
	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

	action_a ={
		name = "Celebrate!"
		command = { type = war  which = MTR }
		command = { type = stability value = -1 }
		command = { type = badboy   value = 2 }
	}
}

event = {
	id = 864302 # Triggered by MTR 865002B
	random = no
	country = IST
	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

	action_a ={
		name = "Celebrate!"
		command = { type = inherit   which = MTR }
		command = { type = population   which = -1 value = -5000 }
		command = { type = population   which = 704 value = 5000 }
                command = { type = treasury   value = 100 }
		command = { type = stability value = 1 }
		command = { type = badboy   value = -2 }
	}
}


# Reserved IDs to 865399