###########################################
#                                         #
# Rajas of India feast events             #
#                                         #
# ID RoI.3000-RoI.3999                    #
#                                         #
###########################################

# Written by Tobias Bodlund

namespace = RoI

###########################################
# Arrival of guru                         #
###########################################

# Start looking for guru
character_event = {
	id = RoI.3000
	desc = EVTDESC_RoI_3000
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RoI_3000
		hidden_tooltip = { character_event = { id = RoI.3001 days = 30 random = 60 } }
	}
}

# Guru is found
character_event = {
	id = RoI.3001

	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		clr_character_flag = looking_for_guru
		set_character_flag = found_guru
		random_list = {
			15 = { # Finds great guru
				create_character = {
					random_traits = no
					dynasty = NONE
					religion = ROOT
					culture = ROOT
					female = no
					age = 50
					attributes = {
						diplomacy = 12
						stewardship = 10
						intrigue = 11
						learning = 14
					}
					trait = genius
					trait = scholar
					trait = patient
					trait = mastermind_theologian
				}
				new_character = {
					set_character_flag = guru
					give_minor_title = title_guru
					piety = 600
					prestige = 150
					if = {
						limit = {
							OR = {
								religion = buddhist
								religion = jain
							}
						}
						random_list = {
							60 = { add_trait = brahmin }
							25 = { add_trait = vaishya }
							15 = {} # Casteless
						}
					}
					if = {
						limit = {
							religion = hindu
							ROOT = {
								ai = no
								religion = hindu
							}
							year = 1150
							NOT = { year = 1250 }
							NOT = { has_global_flag = basava }
						}
						set_name = Basava
						set_character_flag = is_basava
						set_global_flag = basava
						culture = marathi
						add_trait = shaivist_hindu
						add_trait = brahmin
						add_trait = brave
					}
					if = {
						limit = {
							religion = hindu
							NOT = { has_character_flag = basava }
						}
						random_list = {
							85 = { add_trait = brahmin }
							10 = { add_trait = vaishya }
							5 = {} # Casteless
						}
					}
					opinion = {
						modifier = opinion_loyal_servant
						who = ROOT
						years = 100
					}
					random_list = {  # Small chance of having some unusual memorable trait
						1 = { add_trait = blinded }
						1 = { add_trait = dwarf }
						50 = {}
					}
					character_event = { id = RoI.3002 }
				}
			}
			80 = { # Finds ordinary guru
				create_character = {
					random_traits = no
					dynasty = NONE
					religion = ROOT
					culture = ROOT
					female = no
					age = 50
					attributes = {
						diplomacy = 10
						stewardship = 8
						intrigue = 9
						learning = 12
					}
					trait = quick
					trait = scholar
					trait = patient
					trait = mastermind_theologian
				}
				new_character = {
					set_character_flag = guru
					give_minor_title = title_guru
					piety = 300
					prestige = 750
					if = {
						limit = {
							OR = {
								religion = buddhist
								religion = jain
							}
						}
						random_list = {
							60 = { add_trait = brahmin }
							25 = { add_trait = vaishya }
							15 = {} # Casteless
						}
					}
					if = {
						limit = {
							religion = hindu
						}
						random_list = {
							85 = { add_trait = brahmin }
							10 = { add_trait = vaishya }
							5 = {} # Casteless
						}
					}
					opinion = {
						modifier = opinion_loyal_servant
						who = ROOT
						years = 100
					}
					character_event = { id = RoI.3002 }
				}
			}
			5 = { # Finds con artist pretending to be guru - but doesn't know it yet...
				create_character = {
					random_traits = no
					dynasty = NONE
					religion = ROOT
					culture = ROOT
					female = no
					age = 40
					attributes = {
						diplomacy = 12
						stewardship = 8
						intrigue = 16
						learning = 10
					}
					trait = quick
					trait = martial_cleric
					trait = weak
				}
				new_character = {
					set_character_flag = guru
					set_character_flag = fake_guru
					give_minor_title = title_guru
					piety = 100
					prestige = 50
					add_trait = brahmin
					opinion = {
						modifier = opinion_loyal_servant
						who = ROOT
						years = 100
					}
					character_event = { id = RoI.3002 }
				}
			}
		}
	}
}

# Guru bounce event
character_event = {
	id = RoI.3002

	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		FROM = { character_event = { id = RoI.3003 } }
	}
}

# Notify player that guru has been found
character_event = {
	id = RoI.3003
	desc = EVTDESC_RoI_3003
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RoI_3003
	}
}

###########################################
# Guru offers moral advice                #
###########################################

# Drunkard
character_event = {
	id = RoI.3100
	desc = EVTDESC_RoI_3100
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"


	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = drunkard
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = drunkard
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

# Hedonist
character_event = {
	id = RoI.3101
	desc = EVTDESC_RoI_3101
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	
	trigger = {
		has_dlc = "Rajas of India"
		OR = {
			religion = buddhist
			religion = jain
		}
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = hedonist
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = hedonist
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

# Impaler
character_event = {
	id = RoI.3102
	desc = EVTDESC_RoI_3102
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = impaler
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = impaler
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
	option = {
		name = EVTOPTC_RoI_3100
		piety = -50
		any_courtier = {
			limit = { has_minor_title = title_guru }
			imprison = ROOT
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = -1
			}
		}
		custom_tooltip = { text = sacrilege_tooltip }
		hidden_tooltip = {
			any_realm_character  = {
				limit = { religion_group = indian_group }
				opinion = {
					who = ROOT
					years = 2
					modifier = opinion_sacrilege
				}
			}
			any_playable_ruler  = {
				limit = { religion_group = indian_group }
				opinion = {
					who = ROOT
					years = 2
					modifier = opinion_sacrilege
				}
			}
		}
	}
}

# Lustful
character_event = {
	id = RoI.3103
	desc = EVTDESC_RoI_3103
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	
	trigger = {
		has_dlc = "Rajas of India"
		OR = {
			religion = buddhist
			religion = jain
		}
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = lustful
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = lustful
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

# Gluttonous
character_event = {
	id = RoI.3104
	desc = EVTDESC_RoI_3104
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	
	trigger = {
		has_dlc = "Rajas of India"
		OR = {
			religion = buddhist
			religion = jain
		}
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = gluttonous
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = gluttonous
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

# Greedy
character_event = {
	id = RoI.3105
	desc = EVTDESC_RoI_3105
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = greedy
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = greedy
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

# Envious
character_event = {
	id = RoI.3106
	desc = EVTDESC_RoI_3106
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = envious
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = envious
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

# Wroth
character_event = {
	id = RoI.3107
	desc = EVTDESC_RoI_3107
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = wroth
	}

	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = wroth
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
	option = {
		name = EVTOPTC_RoI_3100
		piety = -50
		any_courtier = {
			limit = { has_minor_title = title_guru }
			imprison = ROOT
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = -1
			}
		}
		custom_tooltip = { text = sacrilege_tooltip }
		hidden_tooltip = {
			any_realm_character  = {
				limit = { religion_group = indian_group }
				opinion = {
					who = ROOT
					years = 2
					modifier = opinion_sacrilege
				}
			}
			any_playable_ruler  = {
				limit = { religion_group = indian_group }
				opinion = {
					who = ROOT
					years = 2
					modifier = opinion_sacrilege
				}
			}
		}
	}
}

# Proud
character_event = {
	id = RoI.3108
	desc = EVTDESC_RoI_3108
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = proud
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = proud
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
	option = {
		name = EVTOPTC_RoI_3100
		piety = -50
		any_courtier = {
			limit = { has_minor_title = title_guru }
			imprison = ROOT
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = -1
			}
		}
		custom_tooltip = { text = sacrilege_tooltip }
		hidden_tooltip = {
			any_realm_character  = {
				limit = { religion_group = indian_group }
				opinion = {
					who = ROOT
					years = 2
					modifier = opinion_sacrilege
				}
			}
			any_playable_ruler  = {
				limit = { religion_group = indian_group }
				opinion = {
					who = ROOT
					years = 2
					modifier = opinion_sacrilege
				}
			}
		}
	}
}

# Arbitrary
character_event = {
	id = RoI.3109
	desc = EVTDESC_RoI_3109
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = arbitrary
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = arbitrary
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}


# Cynical
character_event = {
	id = RoI.3110
	desc = EVTDESC_RoI_3110
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = cynical
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = cynical
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}


# Cruel
character_event = {
	id = RoI.3111
	desc = EVTDESC_RoI_3111
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = cruel
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = cruel
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}


# Duelist
character_event = {
	id = RoI.3112
	desc = EVTDESC_RoI_3112
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion = jain
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = duelist
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = duelist
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

# Hunter
character_event = {
	id = RoI.3113
	desc = EVTDESC_RoI_3113
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion = jain
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		OR = {
			trait = hunter
			trait = falconer
		}
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = hunter
		}
		random = {
			chance = 10
			remove_trait = falconer
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

# Paranoid
character_event = {
	id = RoI.3114
	desc = EVTDESC_RoI_3114
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		trait = paranoid
	}
	
	option = {
		name = EVTOPTA_RoI_3100
		prestige = -20
		random = {
			chance = 10
			remove_trait = paranoid
		}
	}
	option = {
		name = EVTOPTB_RoI_3100
		piety = -20
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				modifier = opinion_unhappy
				who = ROOT
				years = 1
			}
		}
	}
}

###########################################
# False guru found out                    #
###########################################

# False guru?
character_event = {
	id = RoI.3150
	desc = EVTDESC_RoI_3150
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	ai = no
	only_capable = yes
	prisoner = no
	min_age = 16
	religion_group = indian_group
	has_dlc = "Rajas of India"
	
	trigger = {		
		is_dumb_trigger = no
		NOT = { trait = inbred }
		NOT = { trait = trusting }
		any_courtier = {
			has_minor_title = title_guru
			has_character_flag = fake_guru
			NOT = { has_character_flag = fake_guru_suspected }
		}
	}
	
	mean_time_to_happen = {
		months = 60
	}

	immediate = {
		any_courtier = {
			limit = {
				has_minor_title = title_guru
				has_character_flag = fake_guru
			}
			add_trait = drunkard
			set_character_flag = fake_guru_suspected
			piety = -50
		}
	}
	
	option = {
		name = EVTOPTA_RoI_3150
		hidden_tooltip = { character_event = { id = RoI.3151 days = 15 } }
	}
	option = {
		name = EVTOPTB_RoI_3150
	}
}

# Guru is obviously false - confront him?
character_event = {
	id = RoI.3151
	desc = EVTDESC_RoI_3151
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	immediate = {
		any_courtier = {
			limit = {
				has_minor_title = title_guru
				has_character_flag = fake_guru
			}
			piety = -100
			add_trait = arbitrary
			add_trait = deceitful
			add_trait = cynical
			add_character_modifier = {
				name = whoremaster
				duration = -1
			}
			add_character_modifier = {
				name = gambler
				duration = -1
			}
		}
	}
	
	option = {
		name = EVTOPTA_RoI_3151
		hidden_tooltip = { character_event = { id = RoI.3152 } }
	}
	option = {
		name = EVTOPTB_RoI_3151
		any_courtier = {
			limit = {
				has_minor_title = title_guru
				has_character_flag = fake_guru
			}
			add_friend = ROOT
		}
	}
}

# Confront false guru, decide what to do
character_event = {
	id = RoI.3152
	desc = EVTDESC_RoI_3152
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	immediate = {
		any_courtier = {
			limit = {
				has_minor_title = title_guru
				has_character_flag = fake_guru
			}
			add_trait = arbitrary
			add_trait = deceitful
			add_trait = cynical
			add_character_modifier = {
				name = whoremaster
				duration = -1
			}
			add_character_modifier = {
				name = gambler
				duration = -1
			}
			clr_character_flag = guru
			prestige = -100
			piety = -100
			remove_trait = brahmin
			remove_trait = vaishya
		}
	}
	
	option = {
		name = EVTOPTA_RoI_3152
		prestige = -30
		any_courtier = {
			limit = {
				has_minor_title = title_guru
				has_character_flag = fake_guru
			}
			imprison = ROOT
		}
	}
	option = {
		name = EVTOPTB_RoI_3152
		prestige = -30
		any_courtier = {
			limit = {
				has_minor_title = title_guru
				has_character_flag = fake_guru
			}
			clr_character_flag = fake_guru
			remove_title = title_guru
			banish = yes
		}
	}
}

###########################################
# Guru helps with Buddhist ambitions      #
###########################################

character_event = {
	id = RoI.3200

	hide_window = yes
	
	is_triggered_only = yes
	
	only_capable = yes
	prisoner = no
	min_age = 16
	religion = buddhist
	
	trigger = {
		has_dlc = "Rajas of India"
		OR = {
			has_ambition = obj_buddhist_stop_drinking
			has_ambition = obj_buddhist_abstain_sexual_excess
			has_ambition = obj_buddhist_reject_cruelty
			has_ambition = obj_buddhist_temperance_food
			has_ambition = obj_buddhist_reject_greed
			has_ambition = obj_buddhist_reject_envy
			has_ambition = obj_buddhist_reject_hate
			has_ambition = obj_buddhist_reject_pride
			has_ambition = obj_buddhist_defeat_fear
		}
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
		NOT = { has_character_flag = guru_helped_ambition }
	}
	
	immediate = {
		set_character_flag = guru_helped_ambition
		any_courtier = {
			limit = { has_minor_title = title_guru }
			character_event = { id = RoI.3201 }
		}
	}
}

# Guru bounce event
character_event = {
	id = RoI.3201

	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				OR = {
					FROM = { trait = zealous }
					FROM = { trait = ambitious }
					trait = genius
				}
			}
			random = {
				chance = 75
				FROM = { set_character_flag = buddhist_obj_success }
			}
		}
		if = {
			limit = {
				FROM = { NOT = { trait = zealous } }
				FROM = { NOT = { trait = ambitious } }
				NOT = {	trait = genius }
			}
			random = {
				chance = 25
				FROM = { set_character_flag = buddhist_obj_success }
			}
		}
		FROM = { character_event = { id = RoI.3202 } }
	}
}

character_event = {
	id = RoI.3202
	desc = EVTDESC_RoI_3202
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_RoI_3202
		trigger = {
			has_character_flag = buddhist_obj_success
		}
			if = {
				limit = {
					has_ambition = obj_buddhist_stop_drinking
				}
				remove_trait = drunkard
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_abstain_sexual_excess
				}
				remove_trait = lustful
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_reject_cruelty
					trait = impaler
				}
				remove_trait = impaler
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_reject_cruelty
					trait = cruel
				}
				remove_trait = cruel
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_temperance_food
				}
				remove_trait = gluttonous
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_reject_greed
				}
				remove_trait = greedy
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_reject_envy
				}
				remove_trait = envious
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_reject_hate
				}
				remove_trait = wroth
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_reject_pride
				}
				remove_trait = proud
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_defeat_fear
					trait = paranoid
				}
				remove_trait = paranoid
			}
			if = {
				limit = {
					has_ambition = obj_buddhist_defeat_fear
					trait = craven
				}
				remove_trait = craven
			}
			clr_character_flag = buddhist_obj_success
	}
	option = {
		name = EVTOPTB_RoI_3202
		trigger = {
			NOT = { has_character_flag = buddhist_obj_success }
		}
		if = {
			limit = { NOT = { trait = slothful } }
			prestige = -10
			piety = -10
			random = {
				chance = 5
				add_trait = slothful
				hidden_tooltip = {
					character_event = {
						id = 38251 #Notify Slothful
					}
				}
			}
		}
	}
}

###########################################
# Guru criticizes caste system (Basava)   #
###########################################

character_event = {
	id = RoI.3300

	hide_window = yes
	
	ai= no
	min_age = 16
	only_capable = yes
	prisoner = no
	religion = hindu
	
	is_triggered_only = yes

	trigger = {
		has_dlc = "Rajas of India"
		any_courtier = {
			has_minor_title = title_guru
			trait = genius
		}
		NOT = { has_global_flag = basava_advice }
		NOT = { is_inaccessible_trigger = yes }
	}
	
	immediate = {
		if = {
			limit = {
				any_courtier = {
					has_minor_title = title_guru
					has_character_flag = is_basava
				}
			}
			set_global_flag = basava_advice
			random_courtier = {
				limit = { has_minor_title = title_guru }
				character_event = { id = RoI.3301 }
			}
		}
		if = {
			limit = {
				any_courtier = {
					has_minor_title = title_guru
					NOT = { has_character_flag = is_basava }
				}
			}
			random = {
				chance = 10
				set_global_flag = basava_advice
				random_courtier = {
					limit = { has_minor_title = title_guru }
					character_event = { id = RoI.3301 }
				}
			}
		}
	}
}
	
# Guru bounce event
character_event = {
	id = RoI.3301

	hide_window = yes

	is_triggered_only = yes
	
	immediate = {
		character_event = { id = RoI.3302 }
	}
}

# Guru criticizes
character_event = {
	id = RoI.3302
	desc = EVTDESC_RoI_3302
	picture = GFX_evt_throne_room
	border = GFX_event_normal_frame_religion

	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_RoI_3302
		prestige = 30
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				who = ROOT
				duration = -1
				modifier = opinion_disappointed
			}
		}
	}
	option = {
		name = EVTOPTB_RoI_3302
		piety = 30
		any_courtier = {
			limit = { has_minor_title = title_guru }
			opinion = {
				who = ROOT
				duration = -1
				modifier = opinion_pleased
			}
		}
	}
}

###########################################
# Guru meditation...                      #
###########################################

character_event = {
	id = RoI.3400

	hide_window = yes
	
	is_triggered_only = yes
	
	only_capable = yes
	prisoner = no
	min_age = 16
	religion = buddhist
	has_dlc = "Rajas of India"
	
	trigger = {		
		OR = {
			trait = stressed
			trait = depressed
		}
		any_courtier = {
			has_minor_title = title_guru
			NOT = { has_character_flag = fake_guru }
		}
	}
	
	immediate = {
		any_courtier = {
			limit = { has_minor_title = title_guru }
			character_event = { id = RoI.3401 }
		}
	}
}

# Guru bounce event
character_event = {
	id = RoI.3401

	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				trait = genius
			}
			FROM = { narrative_event = { id = RoI.3402 } } # Meditation helps
		}
		if = {
			limit = {
				NOT = {	trait = genius }
			}
			random = {
				chance = 50
				FROM = { narrative_event = { id = RoI.3402 } } # Meditation helps
			}
		}
	}
}

# Meditation helps
narrative_event = {
	id = RoI.3402
	title = EVTTITLE_RoI_3402
	desc = EVTDESC_RoI_3402
	picture = GFX_evt_bishop
	border = GFX_event_narrative_frame_religion

	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_RoI_3402
		trigger = {
			religion = hindu
		}
		if = {
			limit = { trait = stressed }
			remove_trait = stressed
		}
		if = {
			limit = { trait = depressed }
			remove_trait = depressed
		}
	}
	option = {
		name = EVTOPTB_RoI_3402
		trigger = {
			religion = buddhist
		}
		if = {
			limit = { trait = stressed }
			remove_trait = stressed
		}
		if = {
			limit = { trait = depressed }
			remove_trait = depressed
		}
	}
	option = {
		name = EVTOPTC_RoI_3402
		trigger = {
			religion = jain
		}
		if = {
			limit = { trait = stressed }
			remove_trait = stressed
		}
		if = {
			limit = { trait = depressed }
			remove_trait = depressed
		}
	}
}
