###########################################
#                                         #
# FEATURED RULER EVENTS                   #
#                                         #
# ID LT.61000-61999                       #
#                                         #
###########################################

# Written by Linna Thimrn

namespace = LT

# Was I converting from the right religion?

# Character converts religion, for whatever reason. ROOT is the character after conversion and the FROM scope has the old religion.
character_event = {
	id = LT.62001

	hide_window = yes
	is_triggered_only = yes # on_character_convert_religion

	religion = shiite

	trigger = {
		vassal_of = c_220820 # Arwa Al-Sulayhi
		FROM = { religion = hindu }
	}

	immediate = { # For featured ruler tracking (conversion)
		set_character_flag = was_converted_by_arwa_al_sulayhi
	}
}


# Was I converted by the right character?

# FROM is the character converted
# FROMFROM and THIS are Arwa Al-Sulayhi
# ROOT is empty
# FROM & FROMFROM appear to be undefined in the trigger section

character_event = {
	id = LT.62002

	hide_window = yes
	is_triggered_only = yes # DEMAND_RELIGIOUS_CONVERSION_INTERACTION_ACCEPT_EVENT

	ai = no

	trigger = {
		character = c_220820 # Arwa Al-Sulayhi
	}

	immediate = { # For featured ruler tracking (conversion)
		if = {
			limit = {
				FROM = { has_character_flag = was_converted_by_arwa_al_sulayhi }
			}

			if = {
				limit = {
					check_variable = { which = character_converted_to_shia value >= 1 }
				}
				change_variable = { which = character_converted_to_shia value = 1 }
			}
			else = {
				set_variable = { which = character_converted_to_shia value = 1 }
			}
		}
	}
}