
namespace = everpreg_chakravarti_event

### Become everpreg Chakravarti
# adapted from the event by Petter Vilberg
# everpreg_chakravarti_event.0001 # I became Chakravarti
# everpreg_chakravarti_event.0002 # My liege became Chakravarti
# everpreg_chakravarti_event.0003 # My liege became Chakravarti - convert?
# everpreg_chakravarti_event.0004 # Someone became Chakravarti
###


################
# Become Chakravarti events
# everpreg_chakravarti_event.0001 - 0004
#

#I united India
everpreg_chakravarti_event.0001 = {
	type = character_event
	title = everpreg_chakravarti_event.0001.t
	desc = everpreg_chakravarti_event.0001.desc
	theme = realm
	left_portrait = {
		character = root
		animation = personality_bold
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		#unite_india_decision_effect = yes
		add_trait = everpreg_saoshyant
	}

	option = {
		name = everpreg_chakravarti_event.0001.a
		add_prestige = massive_prestige_value
		add_prestige_level = 2
		faith = {
			if = {
				limit = {
					NOT = { has_doctrine = divine_destiny_doctrine }
				}
				add_doctrine = divine_destiny_doctrine
			}
			change_fervor = {
				value = major_fervor_gain
				desc = everpreg_fervor_gain_become_chakravarti
			}
		}
	}
}


#My ruler became Chakravarti
everpreg_chakravarti_event.0002 = {
	type = character_event
	title = everpreg_chakravarti_event.0002.t
	desc = {
		desc = everpreg_chakravarti_event.0002.intro
		desc = everpreg_chakravarti_event.0002.text
	}
	theme = realm
	left_portrait = {
		character = scope:everpreg_chakravarti
		animation = personality_bold
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		show_as_tooltip = {
			scope:chakravarti = {
				add_trait_force_tooltip = everpreg_saoshyant
				#hidden_effect = { set_primary_title_to = title:e_india }
				faith = {
					add_doctrine = divine_destiny_doctrine
					change_fervor = {
						value = major_fervor_gain
						desc = everpreg_fervor_gain_become_chakravarti
					}
				}
			}
		}
	}

	option = {
		name = everpreg_chakravarti_event.0002.a
		if = {
			limit = {
				faith = scope:everpreg_chakravarti.faith
			}
			scope:everpreg_chakravarti = {
				add_opinion = {
					target = root
					modifier = followed_the_everpreg_chakravarti_opinion
				}
			}
		}
	}

	option = {
		name = everpreg_chakravarti_event.0002.b
		trigger = {
			NOT = { faith = scope:everpreg_chakravarti.faith }
		}
		set_character_faith_with_conversion = scope:everpreg_chakravarti.faith
		scope:everpreg_chakravarti = {
			add_opinion = {
				target = root
				modifier = followed_the_everpreg_chakravarti_opinion
			}
		}
	}
}

#My ruler became everpreg Chakravarti - non-Indian religion
everpreg_chakravarti_event.0003 = {
	type = character_event
	title = everpreg_chakravarti_event.0002.t
	desc = {
		desc = everpreg_chakravarti_event.0002.intro
		desc = everpreg_chakravarti_event.0003.text
	}
	theme = realm
	left_portrait = {
		character = scope:everpreg_chakravarti
		animation = personality_bold
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		show_as_tooltip = {
			scope:everpreg_chakravarti = {
				add_trait_force_tooltip = everpreg_saoshyant
				#hidden_effect = { set_primary_title_to = title:e_india }
				faith = {
					add_doctrine = divine_destiny_doctrine
					change_fervor = {
						value = major_fervor_gain
						desc = everpreg_fervor_gain_become_chakravarti
					}
				}
			}
		}
	}

	option = {
		name = everpreg_chakravarti_event.0003.a
		set_character_faith_with_conversion = scope:everpreg_chakravarti.faith
		scope:everpreg_chakravarti = {
			add_opinion = {
				target = root
				modifier = followed_the_everpreg_chakravarti_opinion
			}
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:everpreg_chakravarti
			}
		}
	}

	option = {
		name = everpreg_chakravarti_event.0003.b
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
			}
		}
	}
}


#Someone became Chakravarti
everpreg_chakravarti_event.0004 = {
	type = character_event
	title = everpreg_chakravarti_event.0002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						faith.religion = faith:everpreg_antideleuvianism.religion
					}
				}
				desc = everpreg_chakravarti_event.0004.relevant_religion
			}
			desc = everpreg_chakravarti_event.0004.desc
		}
		desc = everpreg_chakravarti_event.0004.text
	}
	theme = realm
	left_portrait = {
		character = scope:everpreg_chakravarti
		animation = personality_bold
	}

	immediate = {
		#Indian faith coreligionists get a positive music cue.
		if = {
			limit = {
				OR = {
					faith = { religion_tag = everpreg_antideleuvianism_religion }
				}
			}
			play_music_cue = "mx_cue_epic_sacral_moment"
		}
		#Everyone else sees a terrifying empire.
		else = { play_music_cue = "mx_cue_combat_2" }
		show_as_tooltip = {
			scope:everpreg_chakravarti = {
				add_trait_force_tooltip = everpreg_saoshyant
				#hidden_effect = { set_primary_title_to = title:e_india }
				faith = {
					add_doctrine = divine_destiny_doctrine
					change_fervor = {
						value = major_fervor_gain
						desc = everpreg_fervor_gain_become_chakravarti
					}
				}
			}
		}
	}

	option = {
		name = everpreg_chakravarti_event.0004.a
		trigger = {
			OR = {
				faith.religion = faith:everpreg_antideleuvianism.religion
			}
		}
	}

	option = {
		name = everpreg_chakravarti_event.0004.b
		fallback = yes
	}
}

#
# END Become Chakravarti events
#################