namespace = religions_and_cultures_expanded_events
namespace = rce_events

# set global flag for the mod being active
country_event = {
	id = religions_and_cultures_expanded_events.1
	title = religions_and_cultures_expanded_events.EVTNAME1
	desc = religions_and_cultures_expanded_events.EVTDESC1
	picture = INVENTION_eventPicture

	hidden = yes
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		NOT = { has_global_flag = religions_and_cultures_expanded_mod_active }
	}

	immediate = {
		hidden_effect = {
			set_global_flag = religions_and_cultures_expanded_mod_active
		}
	}

	option = {
		name = religions_and_cultures_expanded_events1.EVTOPT1

		ai_chance = { factor = 100 }
	}
}

# cheat event to convert to a new/changed religion
country_event = {
	id = rce_events.1
	title = rce_events.EVTNAME1
	desc = rce_events.EVTDESC1
	picture = RELIGION_eventPicture

	is_triggered_only = yes

	trigger = {
		always = no
	}

	option = {
		name = hinduism

		ai_chance = { factor = 0 }

		change_religion = hinduism
	}

	option = {
		name = jainism

		highlight = yes

		ai_chance = { factor = 0 }

		change_religion = jainism
	}

	option = {
		name = tibetan_buddhism

		highlight = yes

		ai_chance = { factor = 0 }

		change_religion = tibetan_buddhism
	}

	option = {
		name = vidilist

		highlight = yes

		ai_chance = { factor = 0 }

		change_religion = vidilist
	}

	option = {
		name = nestorian

		highlight = yes

		ai_chance = { factor = 0 }

		change_religion = nestorian
	}

	option = {
		name = manichaeism

		highlight = yes

		ai_chance = { factor = 0 }

		change_religion = manichaeism
	}

	option = {
		name = bogomilist

		highlight = yes

		ai_chance = { factor = 0 }

		change_religion = bogomilist
	}

	option = {
		name = rce_events1.EVTOPT1

		ai_chance = { factor = 100 }
	}
}

# cheat event to give power for a new religion mechanic
country_event = {
	id = rce_events.2
	title = rce_events.EVTNAME2
	desc = rce_events.EVTDESC2
	picture = RELIGION_eventPicture

	is_triggered_only = yes

	trigger = {
		always = no
		OR = {
			rce_uses_religion_mechanic = { mechanic = bogomilist_church_aspects }
			rce_uses_religion_mechanic = { mechanic = hindu }
			rce_uses_religion_mechanic = { mechanic = sukha }
			rce_uses_religion_mechanic = { mechanic = four_tenets_system }
			rce_uses_religion_mechanic = { mechanic = sylvan_affinity }
			rce_uses_religion_mechanic = { mechanic = nestorian_patriarchy }
			rce_uses_religion_mechanic = { mechanic = manichaeism_purity }
		}
	}

	option = {
		name = rce_events2.EVTOPT1

		ai_chance = { factor = 0 }

		if = {
			limit = {
				rce_uses_religion_mechanic = { mechanic = bogomilist_church_aspects }
			}
			add_church_power = 100
		}
		rce_add_religion_mechanic_hindu_value = { major_deity = current value = 100 }
		rce_add_religion_mechanic_sukha_value = { value = 100 }
		rce_add_religion_mechanic_four_tenets_system_value = { value = 100 }
		rce_add_religion_mechanic_sylvan_affinity_value = { value = 100 }
		rce_add_religion_mechanic_nestorian_patriarchy_value = { value = 100 }
		rce_add_religion_mechanic_manichaeism_purity_value = { value = 100 }
	}

	option = {
		name = rce_events2.EVTOPT2

		ai_chance = { factor = 100 }
	}
}