###########################################
# Mission Events for the Bahmani Sultanate
#
# Scripted by Henrik Lohmander
###########################################

namespace = bah_mission_events
namespace = mer_mission_events
namespace = mug_mission_events
normal_or_historical_nations = yes

#Fall of the City of Victory
country_event = {
	id = bah_mission_events.1
	title = bah_mission_events.1.t
	desc = {
		trigger = {
			NOT = { exists = VIJ }
		}
		desc = bah_mission_events.1.d
	}
	desc = {
		trigger = {
			exists = VIJ
		}
		desc = bah_missions.1.d_VIJ_existed
	}
	picture = 3_Rajput_Estate__eventPicture
	
	is_triggered_only = yes
	major = yes
	
	option = {
		name = bah_mission_events.1.a
		541 = {
			add_base_tax = -2
			add_base_production = -2
			add_base_manpower = -2
			change_province_name = "Bellary"
			rename_capital = "Bellary"
		}
		capital_scope = {
			add_base_tax = 2
			add_base_production = 2
			add_base_manpower = 2
		}
		if = {
			limit = {
				exists = VIJ
			}
			VIJ = { country_event = { id = bah_mission_events.2 } }
		}
	}
}

#Fall of the City of Victory
country_event = {
	id = bah_mission_events.2
	title = bah_mission_events.2.t
	desc = bah_mission_events.2.d
	picture = 3_Rajput_Estate__eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = bah_mission_events.2.a
		add_stability = -1
		add_country_modifier = {
			name = "fall_of_vijayanagar"
			duration = 3650
		}
		if = {
			limit = {
				has_estate = estate_brahmins
			}
			add_estate_loyalty_modifier = {
				estate = estate_brahmins
				desc = EST_VAL_FALL_OF_VJ
				loyalty = -10
				duration = 10950
			}
		}
	}
}

#Fall of Delhi
country_event = {
	id = bah_mission_events.3
	title = bah_mission_events.3.t
	desc = bah_mission_events.3.d
	picture = 3_Rajput_Estate__eventPicture
	
	is_triggered_only = yes
	major = yes
	
	option = {
		name = bah_mission_events.3.a
		add_prestige = 20
	}
}


#Fall of Delhi
country_event = {
	id = mer_mission_events.1
	title = mer_mission_events.1.t
	desc = mer_mission_events.1.d
	picture = 3_Rajput_Estate__eventPicture
	
	is_triggered_only = yes
	major = yes
	
	option = {
		name = mer_mission_events.1.a
		add_prestige = 20
	}
}

#Viceroyalty of the Deccan
country_event = {
	id = mug_mission_events.1
	title = mug_mission_events.1.t
	desc = mug_mission_events.1.d
	picture = 12_Maratha_Estate_eventPicture
	
	is_triggered_only = yes
	major = yes
	
	option = {
		name = mug_mission_events.1.a
		545 = {
			move_capital_effect = yes
			change_province_name = "Aurangabad"
			rename_capital = "Aurangabad"
			add_base_tax = 2
			add_base_manpower = 2
			add_base_production = 2
			add_province_modifier = {
				name = "city_of_aurangabad"
				duration = -1
			}
		}
		542 = {
			change_province_name = "Hyderabad"
			rename_capital = "Hyderabad"
			add_base_tax = 2
			add_base_manpower = 2
			add_base_production = 2
		}
	}
	option = {
		name = mug_mission_events.1.b
		trigger = { NOT = { exists = DEC } }
		custom_tooltip = mug_mission_events.1.b.tt
		add_country_modifier = {
			name = "mug_viceroyalty_of_the_deccan"
			duration = -1
		}
		coromandel_region = {
			add_core = DEC
		}
		golconda_area = {
			add_core = DEC
		}
		telingana_area = {
			add_core = DEC
		}
		rayalaseema_area = {
			add_core = DEC
		}
		mysore_area = {
			add_core = DEC
		}
		raichur_doab_area = {
			add_core = DEC
		}
		maidan_area = {
			add_core = DEC
		}
		desh_area = {
			add_core = DEC
		}
		ahmednagar_area = {
			add_core = DEC
		}
		release = DEC
		vassalize = DEC
		DEC = {
			change_government = monarchy
			#set_legacy_government = indian_sultanate_legacy
			add_opinion  = { who = ROOT modifier = opinion_viceroyalty_of_deccan }
			reverse_add_opinion  = { who = ROOT modifier = opinion_viceroyalty_of_deccan }
			set_capital = 545
			define_ruler = {
				name = "Asaf Jah I" #Qamar-ud-din Khan
				dynasty = "000000000"
				DIP = 4
				ADM = 3
				MIL = 5
			}
			if = {
				limit = {
					has_states_general_mechanic = yes
				}
				change_statists_vs_orangists = 1
			}
			add_country_modifier = {
				name = "viceroyalty_of_the_deccan"
				duration = -1
			}
		}
		545 = {
			change_province_name = "Aurangabad"
			rename_capital = "Aurangabad"
			add_base_tax = 2
			add_base_manpower = 2
			add_base_production = 2
			add_province_modifier = {
				name = "city_of_aurangabad"
				duration = -1
			}
		}
		542 = {
			change_province_name = "Hyderabad"
			rename_capital = "Hyderabad"
			add_base_tax = 2
			add_base_manpower = 2
			add_base_production = 2
		}
	}
}

#Fall of Golconda
country_event = {
	id = mug_mission_events.2
	title = mug_mission_events.2.t
	desc = mug_mission_events.2.d
	picture = 3_Rajput_Estate__eventPicture
	
	is_triggered_only = yes
	major = yes
	
	option = {
		name = mug_mission_events.2.a
		add_prestige_or_monarch_power = { amount = 20 }
		add_treasury = 1000
	}
}
