namespace = FEE_Jaunpur_Events

# Intervention Requested by Bibi Raji
country_event = {
	id = FEE_Jaunpur_Events.1
	title = FEE_Jaunpur_Events.1.T
	desc = FEE_Jaunpur_Events.1.D
	picture = DIPLOMACY_eventPicture

	fire_only_once = yes

	trigger = {
		tag = JNP
		DLH = {
			dynasty = "Lodi"
			capital = 522
			has_ruler = "Bahlul"
		}
		NOT = { is_year = 1460 }
		OR = {
			NOT = { exists = SRH }
			SRH = {
				NOT = { is_subject_of = DLH }
			}
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Jaunpur_Events.1.OPT1
		ai_chance = {
			factor = 80
		}

		add_war_exhaustion = 3
		add_country_modifier = {
			name = fee_jnp_war_weary_populace
			duration = -1
			desc = FEE_UNTIL_WARS_ENDS_TT
		}
		522 = {
			area = {
				limit = {
					owned_by = DLH
				}
				add_core = ROOT
			}
		}
		declare_war_with_cb = {
			casus_belli = cb_core
			who = DLH
		}
	}

	option = {
		name = FEE_Jaunpur_Events.1.OPT2
		trigger = {
			OR = {
				ruler_has_personality = conqueror_personality
				ruler_has_personality = legendary_conqueror_personality
			}
		}
		ai_chance = {
			factor = 80
		}

		add_country_modifier = {
			name = fee_jnp_war_for_hindustan
			duration = -1
			desc = FEE_UNTIL_WARS_ENDS_TT
		}
		522 = {
			area = {
				limit = {
					owned_by = DLH
				}
				add_core = ROOT
			}
		}
		declare_war_with_cb = {
			casus_belli = cb_core
			who = DLH
		}
	}

	option = {
		name = FEE_Jaunpur_Events.1.OPT3
		ai_chance = {
			factor = 10
		}

		add_stability_or_adm_power = yes
	}
}

# The Rebellion of the Ujjainiya Rajputs
country_event = {
	id = FEE_Jaunpur_Events.2
	title = FEE_Jaunpur_Events.2.T
	desc = FEE_Jaunpur_Events.2.D
	picture = BATTLE_eventPicture

	fire_only_once = yes

	trigger = {
		tag = JNP
		religion_group = muslim
		4469 = {
			owned_by = ROOT
			religion = hinduism
		}
		558 = {
			owned_by = ROOT
			religion = hinduism
		}
	}

	mean_time_to_happen = {
		months = 50
	}

	option = {
		name = FEE_Jaunpur_Events.2.OPT1
		ai_chance = {
			factor = 80
		}

		add_country_modifier = {
			name = fee_jnp_ujjainiya_sabotage
			duration = 5475
		}
		4469 = {
			spawn_rebels = {
				size = 2
				leader = "Sangram Deo"
				type = noble_rebels
			}
		}
		558 = {
			noble_rebels = 1
		}
	}

	option = {
		name = FEE_Jaunpur_Events.2.OPT2
		trigger = {
			OR = {
				DIP = 4
				full_idea_group = influence_ideas
				ruler_has_personality = silver_tongue_personality
			}
		}
		ai_chance = {
			factor = 80
		}

		define_general = {
			fire = 2
			shock = 6
			manuever = 6
			siege = 1
		}
	}

	option = {
		name = FEE_Jaunpur_Events.2.OPT3
		trigger = {
			OR = {
				ruler_has_personality = cruel_personality
				ruler_has_personality = malevolent_personality
			}
		}
		ai_chance = {
			factor = 10
		}

		add_country_modifier = {
			name = fee_jnp_terror_tactics
			duration = 5475
		}
		4469 = {
			spawn_rebels = {
				size = 2
				leader = "Sangram Deo"
				type = noble_rebels
			}
		}
		558 = {
			noble_rebels = 1
		}
	}
}

# Sufi Premakhyan
country_event = {
	id = FEE_Jaunpur_Events.3
	title = FEE_Jaunpur_Events.3.T
	desc = FEE_Jaunpur_Events.3.D
	picture = ADVISOR_eventPicture

	fire_only_once = yes

	trigger = {
		tag = JNP
		religion_group = muslim
		monthly_adm = 7
		OR = {
			has_estate_privilege = estate_vaisyas_patronage_of_the_arts
			has_estate_privilege = estate_burghers_patronage_of_the_arts
			ruler_has_personality = patron_of_arts_personality
		}
	}

	mean_time_to_happen = {
		months = 60
	}

	option = {
		name = FEE_Jaunpur_Events.3.OPT1
		ai_chance = {
			factor = 80
		}

		add_prestige_or_monarch_power = { amount = 35 }
		define_advisor = {
			name = "Qutban Suhrawadi"
			type = theologian
			skill = 3
			cost_multiplier = 0.66
			religion = sunni
			culture = kanauji
		}
		add_country_modifier = {
			name = fee_jnp_golden_era_for_jaunpuri_culture
			duration = 3650
		}
	}
}

# Proliferation of the Shahnai and Jaunpuri Music
country_event = {
	id = FEE_Jaunpur_Events.4
	title = FEE_Jaunpur_Events.4.T
	desc = FEE_Jaunpur_Events.4.D
	picture = ADVISOR_eventPicture

	fire_only_once = yes

	trigger = {
		is_or_was_tag = { tag = JNP }
		capital_scope = {
			development = 25
		}
		stability = 1
		is_at_war = no
		OR = {
			has_adm_advisor = yes
			has_dip_advisor = yes
		}
	}

	mean_time_to_happen = {
		months = 300
	}

	option = {
		name = FEE_Jaunpur_Events.4.OPT1
		ai_chance = {
			factor = 80
		}

		add_dip_power = 100
		add_splendor = 100
		add_country_modifier = {
			name = fee_jnp_jaunpuri_music
			duration = 7300
		}
	}
}

# Raiding the Garjati Forests
country_event = {
	id = FEE_Jaunpur_Events.5
	title = FEE_Jaunpur_Events.5.T
	desc = FEE_Jaunpur_Events.5.D
	picture = VILLAGE_RAIDED_eventPicture

	fire_only_once = yes

	trigger = {
		tag = JNP
		any_country = {
			OR = {
				primary_culture = garjati
				tag = ORI
			}
			ROOT = {
				has_won_war_against = {
					who = PREV
					max_years_since = 5
				}
			}
		}
		num_of_owned_provinces_with = {
			value = 5
			has_terrain = jungle
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Jaunpur_Events.5.OPT1
		ai_chance = {
			factor = 33
		}

		add_country_modifier = {
			name = fee_jnp_elephants_in_abundance
			duration = 7300
		}
		capital_scope = {
			change_trade_good_ivory_or_elephants = yes
			add_base_tax = 2
			add_base_production = 1
			add_base_manpower = 1
			add_province_modifier = {
				name = local_goods_in_demand
				duration = 7300
			}
		}
	}

	option = {
		name = FEE_Jaunpur_Events.5.OPT2
		trigger = {
			OR = {
				full_idea_group = quality_ideas
				full_idea_group = offensive_ideas
				mil = 5
			}
		}
		ai_chance = {
			factor = 33
		}

		add_country_modifier = {
			name = fee_jnp_elephant_aided_siege
			duration = 7300
		}
	}

	option = {
		name = FEE_Jaunpur_Events.5.OPT3
		ai_chance = {
			factor = 33
		}

		add_country_modifier = {
			name = fee_jnp_elephant_incorporation
			duration = 7300
		}
	}
}