###########################################
#
# Indian Holy Order Events
#
# ID HO.100-999
#
###########################################
# Written by Emil Tisander
###########################################

namespace = HO

###########################
# Holy Order Creation Event
###########################
# Creation event if India is invaded by another religion group
character_event = {
	id = HO.100
	hide_window = yes
	
	is_triggered_only = yes
	
	only_playable = yes
	religion_group = indian_group
	
	trigger = {
		# An Indian Holy Order has yet to be created
		OR = {
			NOT = { is_title_active = d_followers_arjuna }
			NOT = { is_title_active = d_ashokas_chosen }
			NOT = { is_title_active = d_bulls_rishabha }
		}
		# Major cities in India has fallen to another religion group
		calc_true_if = {
			amount = 4 # vanilla 5/20 on full india -> SWMH 4/8 on rajasthan
			#1114 = { # Mahoyadapuram
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1115 = { # cholamandalam
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1118 = { # Manyapura
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			1639 = { # SWMH: Navasarika
				holder_scope = {
					OR = {
						NOT = { religion_group = indian_group }
						religion = taoist
					}
				}
			}
			#1129 = { # Kataka
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1151 = { # Laksmanavati
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1154 = { # Magadha
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1166 = { # Jaunpur
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1210 = { # Manyakheta
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1220 = { # Goa
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1221 = { # Vijayawada
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1238 = { # Mallabhum
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			#1271 = { # Tripuri
			#	holder_scope = {
			#		OR = {
			#			NOT = { religion_group = indian_group }
			#			religion = taoist
			#		}
			#	}
			#}
			1673 = { # SWMH: Ujjayini
				holder_scope = {
					OR = {
						NOT = { religion_group = indian_group }
						religion = taoist
					}
				}
			}
			1600 = { # SWMH: Debul
				holder_scope = {
					OR = {
						NOT = { religion_group = indian_group }
						religion = taoist
					}
				}
			}
			1654 = { # SWMH: Ajayameru
				holder_scope = {
					OR = {
						NOT = { religion_group = indian_group }
						religion = taoist
					}
				}
			}
			1682 = { # SWMH: Kanyakubja
				holder_scope = {
					OR = {
						NOT = { religion_group = indian_group }
						religion = taoist
					}
				}
			}
			1620 = { # SWMH: Lahur
				holder_scope = {
					OR = {
						NOT = { religion_group = indian_group }
						religion = taoist
					}
				}
			}
			1658 = { # SWMH: Delhi
				holder_scope = {
					OR = {
						NOT = { religion_group = indian_group }
						religion = taoist
					}
				}
			}
			1615 = { # SWMH: Multan
				holder_scope = {
					OR = {
						NOT = { religion_group = indian_group }
						religion = taoist
					}
				}
			}
		}
		NOT = {
			has_alternate_start_parameter = { key = religion_names value = random }
		}
	}
	
	immediate = {
		if = {
			limit = { NOT = { is_title_active = d_followers_arjuna } }
			activate_title = { title = d_followers_arjuna status = yes }
			create_character = {
				random_traits = no
				dynasty = random
				religion = hindu
				culture = hindustani
				female = no
				age = 33
				trait = brilliant_strategist
				trait = zealous
				trait = humble
				trait = ambitious
				trait = strategist
				trait = holy_warrior
				trait = kshatriya
			}
			new_character = {
				wealth = 500
				d_followers_arjuna = {
					grant_title = PREV
				}
				set_government_type = feudal_government
				save_event_target_as = leader_of_arjuna
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = no
					age = 16
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = no
					age = 18
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = no
					age = 18
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = no
					age = 20
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = no
					age = 25
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = no
					age = 26
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = no
					age = 28
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = yes
					age = 16
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = hindustani
					female = yes
					age = 17
				}
			}
			any_playable_ruler = {
				limit = {
					ai = no
					OR = {
						religion = hindu
						capital_scope = { region = world_india }
						capital_scope = { region = world_himalayas }
						capital_scope = { region = world_steppe }
						capital_scope = { region = world_persia }
						capital_scope = { region = world_middle_east }
					}
				}
				narrative_event = { id = HO.110 days = 1 random = 20 }
			}
		}
		
		if = {
			limit = { NOT = { is_title_active = d_ashokas_chosen } }
			activate_title = { title = d_ashokas_chosen status = yes }
			create_character = {
				random_traits = no
				dynasty = random
				religion = buddhist
				culture = marathi
				female = no
				age = 33
				trait = brilliant_strategist
				trait = zealous
				trait = humble
				trait = ambitious
				trait = strategist
				trait = holy_warrior
				trait = kshatriya
			}
			new_character = {
				wealth = 500
				d_ashokas_chosen = {
					grant_title = PREV
				}
				set_government_type = feudal_government
				save_event_target_as = leader_of_ashokas
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = no
					age = 16
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = no
					age = 18
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = no
					age = 18
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = no
					age = 20
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = no
					age = 25
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = no
					age = 26
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = no
					age = 28
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = yes
					age = 16
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = buddhist
					culture = marathi
					female = yes
					age = 17
				}
			}
			any_playable_ruler = {
				limit = {
					ai = no
					OR = {
						religion = buddhist
						capital_scope = { region = world_india }
						capital_scope = { region = world_himalayas }
						capital_scope = { region = world_steppe }
						capital_scope = { region = world_persia }
						capital_scope = { region = world_middle_east }
					}
				}
				narrative_event = { id = HO.120 days = 1 random = 20 }
			}
		}
		
		if = {
			limit = { NOT = { is_title_active = d_bulls_rishabha } }
			activate_title = { title = d_bulls_rishabha status = yes }
			create_character = {
				random_traits = no
				dynasty = random
				religion = jain
				culture = kannada
				female = no
				age = 33
				trait = brilliant_strategist
				trait = zealous
				trait = humble
				trait = ambitious
				trait = strategist
				trait = holy_warrior
				trait = kshatriya
			}
			new_character = {
				wealth = 500
				d_bulls_rishabha = {
					grant_title = PREV
				}
				set_government_type = feudal_government
				save_event_target_as = leader_of_rishabha
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = no
					age = 16
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = no
					age = 18
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = no
					age = 18
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = no
					age = 20
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = no
					age = 25
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = no
					age = 26
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = no
					age = 28
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = yes
					age = 16
				}
				create_character = {
					random_traits = yes
					dynasty = random
					religion = jain
					culture = kannada
					female = yes
					age = 17
				}
			}
			any_playable_ruler = {
				limit = {
					ai = no
					OR = {
						religion = jain
						capital_scope = { region = world_india }
						capital_scope = { region = world_himalayas }
						capital_scope = { region = world_steppe }
						capital_scope = { region = world_persia }
						capital_scope = { region = world_middle_east }
					}
				}
				narrative_event = { id = HO.130 days = 1 random = 20 }
			}
		}
	}
}

#######################
# Followers of Arjuna
#######################
# Notification event
narrative_event = {
	id = HO.110
	title = d_followers_arjuna
	desc = EVTDESC_HO_110
	
	picture = GFX_evt_battle_indo_aryan_group
	
	only_playable = yes
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_HO_100
		trigger = {
			religion = hindu
		}
	}
	option = {
		name = EVTOPTB_HO_100
		trigger = {
			religion_group = indian_group
			NOT = { religion = hindu }
		}
	}
	option = {
		name = EVTOPTC_HO_100
		trigger = {
			NOT = { religion_group = indian_group }
		}
	}
}

#######################
# Ashokas Chosen
#######################
# Notification event
narrative_event = {
	id = HO.120
	title = d_ashokas_chosen
	desc = EVTDESC_HO_120
	
	picture = GFX_evt_ruler_riding_elephant
	
	only_playable = yes
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_HO_100
		trigger = {
			religion = buddhist
		}
	}
	option = {
		name = EVTOPTB_HO_100
		trigger = {
			religion_group = indian_group
			NOT = { religion = buddhist }
		}
	}
	option = {
		name = EVTOPTC_HO_100
		trigger = {
			NOT = { religion_group = indian_group }
		}
	}
}

#######################
# Bulls of Rishabha
#######################
# Notification event
narrative_event = {
	id = HO.130
	title = d_bulls_rishabha
	desc = EVTDESC_HO_130
	
	picture = GFX_evt_throne_room_indo_aryan_group
	
	only_playable = yes
	hide_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_HO_100
		trigger = {
			religion = jain
		}
	}
	option = {
		name = EVTOPTB_HO_100
		trigger = {
			religion_group = indian_group
			NOT = { religion = jain }
		}
	}
	option = {
		name = EVTOPTC_HO_100
		trigger = {
			NOT = { religion_group = indian_group }
		}
	}
}
