###########################################
#										 #
# M&M Secret religious cults			  #
#										 #
# ID MNM.3000-MNM.3999					  #
#										 #
###########################################

#IDs:
#3100-3199 David
#3200-3399 Milla
#3400-3599 Mathilda
#3600-3799 Drikus
#3800-3948 Joel
#3949-3997 Jakob

#Useful triggers
#is_secret_religious_society_member_trigger
#is_christian_secret_religious_society_member_trigger
#is_muslim_secret_religious_society_member_trigger
#is_indian_secret_religious_society_member_trigger
#is_openly_of_prevs_secret_religion_trigger
#has_sympathy_for_true_religion_of_prev_trigger
#true_religion_X_trigger
#true_religion_group_X_trigger
#is_in_prevs_interesting_society_trigger
#shares_prevs_secret_religion_trigger

#Useful effects 
#add_trait_for_prevs_secret_religion_society_effect 
#add_prevs_secret_religion_trait_effect 
#add_sympathy_for_prevs_true_religion_effect


namespace = MNM

#POWERS
#Power: Attempt to give character sympathy
character_event = {
	id = MNM.3404
	desc = EVTDESC_MNM_3404
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	

	#How to make your argument?

	#Friends & family
	option = { 
		name = EVTOPTA_MNM_3404
		custom_tooltip = { text = EVTOPTA_MNM_3404_TT }
		set_character_flag = sympathy_argument_friends_family

	}

	#Home & business
	option = {
		name = EVTOPTB_MNM_3404
		custom_tooltip = { text = EVTOPTB_MNM_3404_TT }
		set_character_flag = sympathy_argument_trauma
	}
	
	#Logical option
	option = {
		name = EVTOPTC_MNM_3404
		custom_tooltip = { text = EVTOPTC_MNM_3404_TT }
		set_character_flag = sympathy_argument_profit
	}
	
	#Stress your own opinion
	option = {
		name = EVTOPTD_MNM_3404
		custom_tooltip = { text = EVTOPTD_MNM_3404_TT }
		set_character_flag = sympathy_argument_personal
	}

	after = {
		hidden_effect = { FROM = { character_event = { id = MNM.3405 days = 5 } } }
	}
}

#Person is approached with touching story, develop sympathy or not?
character_event = {
	id = MNM.3405
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_diplomacy

	desc = {
		trigger = { FROM = { has_character_flag = sympathy_argument_friends_family } }
		text = EVTDESC_MNM_3405_A
	}
	desc = {
		trigger = { FROM = { has_character_flag = sympathy_argument_trauma } }
		text = EVTDESC_MNM_3405_B
	}
	desc = {
		trigger = { FROM = { has_character_flag = sympathy_argument_profit } }
		text = EVTDESC_MNM_3405_C
	}
	desc = {
		trigger = { FROM = { has_character_flag = sympathy_argument_personal } }
		text = EVTDESC_MNM_3405_D
	}

	is_triggered_only = yes
	
	#Yes I agree
	option = { 
		name = EVTOPTA_MNM_3405

		if = {
			limit = { trait = zealous }
			remove_trait = zealous
		}

		FROM = {
			ROOT = {
				add_sympathy_for_prevs_true_religion_effect = yes
			}
		}

		reverse_opinion =  {
			who = FROM
			modifier = opinion_open_minded
			years = 10
		}

		hidden_effect = {
			FROM = { character_event =  { id = MNM.3406 days = 1 } }
		}

		ai_chance = {
			factor = 60
			modifier = { trait = kind factor = 3 }
			modifier = { trait = just factor = 2 }
			modifier = { trait = trusting factor = 2 }
			modifier = { trait = patient factor = 1.5 }
			modifier = { trait = charitable factor = 1.5 }
			modifier = { controls_religion = yes factor = 0 }
			modifier = { FROM = { diplomacy = 12 } factor = 1.4 }
			modifier = { FROM = { diplomacy = 14 } factor = 1.3 }
			modifier = { FROM = { diplomacy = 16 } factor = 1.2 }
			#modifier = { FROM = { ai = yes } factor = 2 } #The AI makes an uniformed choice, so they need this boost

			modifier = {
				factor = 3
				FROM = { has_character_flag = sympathy_argument_friends_family }
				OR = {
					trait = gregarious
					trait = socializer
					trait = kind
					num_of_friends = 1
					num_of_lovers = 1
					any_child = { reverse_opinion = { who = ROOT value = 35 } }
					has_education_diplomacy_trigger = yes
				}
			}

			modifier = {
				factor = 3
				FROM = { has_character_flag = sympathy_argument_trauma }
				OR = {
					trait = craven
					trait = kind
					trait = scarred
					is_weak_trigger = yes
					character_disease_trigger = yes
					has_injury_trigger = yes
					has_disability_trigger = yes
					has_mental_disorder_trigger = yes
					has_negative_congenital_trigger = yes
				}
			}

			modifier = {
				factor = 3
				FROM = { has_character_flag = sympathy_argument_profit }
				OR = {
					trait = greedy
					trait = ambitious
					trait = cynical
					trait = administrator
					trait = diligent
					is_smart_trigger = yes
					has_education_stewardship_trigger = yes
				}
			}

			modifier = {
				factor = 3
				FROM = { has_character_flag = sympathy_argument_personal }
				opinion = { who = FROM value = 15 }
				OR = {
					is_friend = FROM
					is_lover = FROM
					opinion = { who = FROM value = 50 }
					liege = { character = FROM }
					top_liege = { character = FROM }
					is_close_relative = FROM
					FROM = { diplomacy = 15 }
				}
			}
			
			modifier = {
				factor = 2
				FROM = { has_focus = focus_theology }
			}
		}
	}

	#No I don't care
	option = {
		name = EVTOPTB_MNM_3405

		reverse_opinion =  {
			who = FROM
			modifier = opinion_narrow_minded
			years = 10
		}

		hidden_effect = {
			FROM = { character_event =  { id = MNM.3407 days = 1 } }
		}

		ai_chance = {
			factor = 40
			modifier = { trait = zealous factor = 5 }
			modifier = { trait = cruel factor = 3 }
			modifier = { trait = arbitrary factor = 3 }
			modifier = { is_priest = yes factor = 2 }
			modifier = { NOT = { FROM = { diplomacy = 8 } } factor = 2 }
			modifier = { tier = BARON factor = 1.2 }
			modifier = { tier = DUKE factor = 1.4 }
			modifier = { tier = KING factor = 1.7 }
			modifier = { tier = EMPEROR factor = 2 }
		}
	}

	after = {
		hidden_effect = {
			FROM = {
				clr_character_flag = sympathy_argument_friends_family
				clr_character_flag = sympathy_argument_trauma
				clr_character_flag = sympathy_argument_profit
				clr_character_flag = sympathy_argument_personal
			}
		}
	}
}

#They gained sympathy
character_event = {
	id = MNM.3406
	desc = EVTDESC_MNM_3406
	picture = GFX_evt_uncomfortable
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_MNM_3406

		tooltip = {
			FROM = { add_sympathy_for_prevs_true_religion_effect = yes }
		}
	}
}

#They did not gain sympathy
character_event = {
	id = MNM.3407
	desc = EVTDESC_MNM_3407
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_MNM_3407
	}
}


#POWER: Induct character to secret faith
character_event = {
	id = MNM.3408
	desc = EVTDESC_MNM_3408
	picture = GFX_evt_library
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	immediate = {
		save_event_target_as = secret_religion_inductor
		FROM = { save_event_target_as = secret_religion_inductee }
	}
	
	#A passage about great warriors of the faith
	option = { 
		name = EVTOPTA_MNM_3408
		custom_tooltip = { text = EVTOPTA_MNM_3408_TT }
		set_character_flag = induction_argument_war
	}

	#A passage about community  
	option = {
		name = EVTOPTB_MNM_3408
		custom_tooltip = { text = EVTOPTB_MNM_3408_TT }
		 set_character_flag = induction_argument_community
	}
	
	#An interesting passage on matters of ethics and philosophy
	option = {
		name = EVTOPTC_MNM_3408
		custom_tooltip = { text = EVTOPTC_MNM_3408_TT }
		 set_character_flag = induction_argument_theology
	}
	
	#A passage about a succesful and fair ruler
	option = {
		name = EVTOPTD_MNM_3408
		custom_tooltip = { text = EVTOPTD_MNM_3408_TT }
		set_character_flag = induction_argument_stewardship
	}

	after = {
		hidden_effect = { event_target:secret_religion_inductee = { character_event = { id = MNM.3409 days = 3 } } }
	}
}

#Finds a holy book
character_event = {
	id = MNM.3409
	picture = GFX_evt_library
	desc = EVTDESC_MNM_3409
	border = GFX_event_normal_frame_religion

	hide_from = yes

	is_triggered_only = yes
  
	#Read it
	option = { 
		name = EVTOPTA_MNM_3409
		custom_tooltip = { text = EVTOPTA_MNM_3409_TT }

		hidden_effect = { character_event = { id = MNM.3410 days = 12 } }
		ai_chance = { factor = 10 }
	}

	#Hide it
	option = {
		name = EVTOPTC_MNM_3409
		custom_tooltip = { text = EVTOPTC_MNM_3409_TT }

		hidden_effect = { event_target:secret_religion_inductor = { character_event = { id = MNM.3413 days = 3 } } } #fail event

		random = {
			chance = 10
			add_trait_paranoid_effect = yes
		}

		ai_chance = { factor = 0 }
	}
}

#Reading the holy book
character_event = {
	id = MNM.3410
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_religion

	desc = {
		trigger = { event_target:secret_religion_inductor = { has_character_flag = induction_argument_war } }
		text = EVTDESC_MNM_3410_A
	}
	desc = {
		trigger = { event_target:secret_religion_inductor = { has_character_flag = induction_argument_community } }
		text = EVTDESC_MNM_3410_B
	}
	desc = {
		trigger = { event_target:secret_religion_inductor = { has_character_flag = induction_argument_theology } }
		text = EVTDESC_MNM_3410_C
	}
	desc = {
		trigger = { event_target:secret_religion_inductor = { has_character_flag = induction_argument_stewardship } }
		text = EVTDESC_MNM_3410_D
	}

	hide_from = yes

	is_triggered_only = yes

	#It speaks the truth
	option = { 
		name = EVTOPTA_MNM_3410
		#custom_tooltip = { text = EVTOPTA_MNM_3410_TT }

		hidden_effect = {
			clear_secret_religion = yes
		}
		#Add new secret religion
		set_secret_religion = event_target:secret_religion_inductor
	   	event_target:secret_religion_inductor = {
	   		#And update the inductor
	   		hidden_effect = { character_event = { id = MNM.3411 days = 3 } }
	   	}

	   	ai_chance = {
			factor = 60
			modifier = { trait = trusting factor = 2 }
			modifier = { controls_religion = yes factor = 0 }
			modifier = { FROM = { diplomacy = 12 } factor = 1.4 }
			modifier = { FROM = { diplomacy = 14 } factor = 1.4 }
			modifier = { FROM = { diplomacy = 16 } factor = 1.3 }
			modifier = { FROM = { diplomacy = 18 } factor = 1.3 }
			modifier = { FROM = { diplomacy = 20 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 22 } factor = 1.2 }
			#modifier = { FROM = { ai = yes } factor = 1.5 } #The AI makes an uniformed choice, so they need this boost

			modifier = {
				factor = 3
				FROM = { has_character_flag = induction_argument_war }
				OR = {
					trait = brave
					has_education_martial_trigger = yes
					has_lifestyle_martial_trigger = yes
					has_job_title = job_marshal
				}
			}

			modifier = {
				factor = 3
				FROM = { has_character_flag = induction_argument_community }
				OR = {
					trait = gregarious
					num_of_friends = 1
					num_of_lovers = 1
					any_child = { reverse_opinion = { who = ROOT value = 35 } }
					has_education_diplomacy_trigger = yes
					has_lifestyle_diplomacy_trigger = yes
				}
			}

			modifier = {
				factor = 3
				FROM = { has_character_flag = induction_argument_theology }
				OR = {
					trait = erudite
					has_education_learning_trigger = yes
					has_lifestyle_learning_trigger = yes
				}
			}

			modifier = {
				factor = 3
				FROM = { has_character_flag = induction_argument_stewardship }
				OR = {
					trait = ambitious
					trait = just
					has_lifestyle_stewardship_trigger = yes
					has_education_stewardship_trigger = yes
				}
			}
			
			modifier = {
				factor = 2
				FROM = { has_focus = focus_theology }
			}
		}
	}

	#Reaffirmed my belief
	option = {
		name = EVTOPTB_MNM_3410

		piety = 100

	   	hidden_effect = { event_target:secret_religion_inductor = { character_event = { id = MNM.3413 days = 3 } } } #fail event

		ai_chance = {
			factor = 40
			modifier = { is_priest = yes factor = 4 }
			modifier = { trait = paranoid factor = 10 }
			modifier = { trait = zealous factor = 100 }
			modifier = { NOT = { FROM = { diplomacy = 8 } } factor = 2 }
			modifier = { tier = BARON factor = 2 }
			modifier = { tier = COUNT factor = 3 }
			modifier = { tier = DUKE factor = 4 }
			modifier = { tier = KING is_nomadic = no factor = 16 }
			modifier = { tier = EMPEROR is_nomadic = no factor = 32 }
		}
	}

	after = {
		hidden_effect = {
			event_target:secret_religion_inductor = {
				clr_character_flag = induction_argument_war
				clr_character_flag = induction_argument_community
				clr_character_flag = induction_argument_theology
				clr_character_flag = induction_argument_stewardship
			}
		}
	}
}

#The inductee did accept my secret religion
character_event = {
	id = MNM.3411
	desc = EVTDESC_MNM_3411
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_religion

	trigger = { has_secret_religion = yes }

	is_triggered_only = yes

	#Good
	option = { 
		name = EVTOPTB_MNM_3411
	}

	after = {
		event_target:secret_religion_inductee = {
			tooltip = { set_secret_religion = event_target:secret_religion_inductor }
		}
	}
}


#Fail: Inductee hid/didn't read book
character_event = {
	id = MNM.3413
	desc = EVTDESC_MNM_3413
	picture = GFX_evt_uncomfortable
	border = GFX_event_normal_frame_religion

	trigger = { has_secret_religion = yes }

	is_triggered_only = yes

	option = { 
		name = EVTOPTA_MNM_3412
	}
}

# openly_adopt_faith - Convert cultists
character_event = {
	id = MNM.3800
	desc = EVTDESC_MNM_3800
	picture = GFX_evt_society_joining
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = currently_part_of_secret_religion_uncovering
	}
	
	option = {
		name = EVTOPTA_MNM_3800
		if = {
			limit = {
				OR = {
					religion_group = muslim
					religion = norse_pagan_reformed
				}
				any_demesne_title = {
					controls_religion = yes
				}
			}
			any_demesne_title = {
				limit = {
					controls_religion = yes
				}
				destroy_landed_title = THIS
			}
		}
		if = {
			limit = {
				NOR = {
					religion_group = muslim
					religion = norse_pagan_reformed
				}
				any_demesne_title = {
					controls_religion = yes
				}
			}
			hidden_tooltip = {
				liege = {
					save_event_target_as = liege_target
				}
				create_character = {
					age = 38
					dynasty = random
					religion = ROOT
					culture = ROOT
					random_traits = yes
				}
				new_character = {
					save_event_target_as = new_holder
				}
			}
			any_demesne_title = {
				limit = {
					controls_religion = yes
				}
				grant_title = event_target:new_holder
				holder_scope = {
					any_vassal = {
						set_defacto_liege = event_target:liege_target
					}
				}
			}
			hidden_tooltip = {
				set_defacto_liege = event_target:liege_target
			}
		}
		if = { # Holy Orders/Static Mercs are given to a random new character
			limit = {
				any_demesne_title = {
					OR = {
						holy_order = yes
						mercenary = yes
					}
				}
			}
			hidden_tooltip = {
				liege = {
					save_event_target_as = liege_target
				}
				create_character = {
					age = 38
					dynasty = random
					religion = ROOT
					culture = ROOT
					random_traits = yes
				}
				new_character = {
					save_event_target_as = new_holder
				}
			}
			any_demesne_title = {
				limit = {
					OR = {
						holy_order = yes
						mercenary = yes
					}
				}
				grant_title = event_target:new_holder
				holder_scope = {
					any_vassal = {
						set_defacto_liege = event_target:liege_target
					}
				}
			}
			hidden_tooltip = {
				set_defacto_liege = event_target:liege_target
			}
		}
		flip_to_secret_religion_effect = yes
		if = {
			limit = { ai = yes }
			set_character_flag = ai_flag_refuse_conversion
		}
		set_variable = { which = visibility_value value = 0 }
		remove_character_modifier = highly_suspect
		remove_character_modifier = under_suspicion
	}
	
	option = {
		name = NEVERMIND
		trigger = { ai = no }
		clr_character_flag = currently_part_of_secret_religion_uncovering
	}
}

# openly_adopt_faith - Allow sympathisers the chance to flip
character_event = {
	id = MNM.3810
	desc = EVTDESC_MNM_3810
	picture = GFX_evt_society_joining
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			ai = yes
			is_nomadic = yes
			NOR = {
				AND = {
					FROM = { 
						OR = {
							secret_religion = sunni
							secret_religion = shiite
							secret_religion = zikri
							secret_religion = yazidi
							secret_religion = ibadi
							secret_religion = kharijite
							secret_religion = druze
							secret_religion = hurufi
							secret_religion = bektashi
							secret_religion = quranist
							secret_religion = qarmatian
						}
					}
					NOT = { has_dlc = "The Sword of Islam" }
				}
				AND = {
					FROM = {
						OR = {
							secret_religion = jewish
							secret_religion = karaite
							secret_religion = samaritan
						}
					}
					NOT = { has_dlc = "Sons of Abraham" }
				}
				AND = {
					FROM = { 
						OR = { 
							secret_religion = zoroastrian
							secret_religion = zurvanist
							secret_religion = mazdaki
							secret_religion = manichean
							secret_religion = mandaean
							secret_religion = norse_pagan
							secret_religion = german_pagan
							secret_religion = celtic_pagan
							secret_religion = slavic_pagan
							secret_religion = tengri_pagan
							secret_religion = baltic_pagan
							secret_religion = finnish_pagan
							secret_religion = west_african_pagan
							secret_religion = zun_pagan	
							secret_religion = norse_pagan_reformed
							secret_religion = german_pagan_reformed
							secret_religion = celtic_pagan_reformed
							secret_religion = slavic_pagan_reformed
							secret_religion = tengri_pagan_reformed
							secret_religion = baltic_pagan_reformed
							secret_religion = finnish_pagan_reformed
							secret_religion = west_african_pagan_reformed
							secret_religion = zun_pagan_reformed
							secret_religion = roman_pagan
							secret_religion = egyptian_pagan
							secret_religion = promethean_pagan
							secret_religion = aten_pagan
							secret_religion = arab_pagan
							secret_religion = berber_pagan
							secret_religion = jewish_pagan
							secret_religion = hellenic_pagan
						}
					}
					NOT = { has_dlc = "The Old Gods" }
				}
				AND = {
					FROM = { 
						OR = {
							secret_religion = hindu
							secret_religion = buddhist
							secret_religion = jain
						}
					}
					NOT = { has_dlc = "Rajas of India" }
				}
			}
		}
	}
	
	immediate = {
		FROM = {
			trigger_switch = { # Figure out which society is uncovering itself
				on_trigger = secret_religion
				chalcedonian = { 
					ROOT = { set_character_flag = adopt_faith_chalcedonian }
				}
				catholic = { 
					ROOT = { set_character_flag = adopt_faith_catholic }
				}
				cathar = { 
					ROOT = { set_character_flag = adopt_faith_cathar }
				}
				fraticelli = { 
					ROOT = { set_character_flag = adopt_faith_fraticelli }
				}
				waldensian = { 
					ROOT = { set_character_flag = adopt_faith_waldensian }
				}
				lollard = { 
					ROOT = { set_character_flag = adopt_faith_lollard }
				}
				adoptionist = { 
					ROOT = { set_character_flag = adopt_faith_adoptionist }
				}
				orthodox = { 
					ROOT = { set_character_flag = adopt_faith_orthodox }
				}
				miaphysite = { 
					ROOT = { set_character_flag = adopt_faith_miaphysite }
				}
				monophysite = { 
					ROOT = { set_character_flag = adopt_faith_monophysite }
				}
				bogomilist = { 
					ROOT = { set_character_flag = adopt_faith_bogomilist }
				}
				monothelite = { 
					ROOT = { set_character_flag = adopt_faith_monothelite }
				}
				iconoclast = { 
					ROOT = { set_character_flag = adopt_faith_iconoclast }
				}
				paulician = { 
					ROOT = { set_character_flag = adopt_faith_paulician }
				}
				nestorian = { 
					ROOT = { set_character_flag = adopt_faith_nestorian }
				}
				messalian = { 
					ROOT = { set_character_flag = adopt_faith_messalian }
				}
				apostolic = { 
					ROOT = { set_character_flag = adopt_faith_apostolic }
				}
				tondrakian = { 
					ROOT = { set_character_flag = adopt_faith_tondrakian }
				}
				manichean = { 
					ROOT = { set_character_flag = adopt_faith_manichean }
				}
				sunni = { 
					ROOT = { set_character_flag = adopt_faith_sunni }
				}
				zikri = { 
					ROOT = { set_character_flag = adopt_faith_zikri }
				}
				quranist = { 
					ROOT = { set_character_flag = adopt_faith_quranist }
				}
				bektashi = { 
					ROOT = { set_character_flag = adopt_faith_bektashi }
				}
				yazidi = { 
					ROOT = { set_character_flag = adopt_faith_yazidi }
				}
				ibadi = { 
					ROOT = { set_character_flag = adopt_faith_ibadi }
				}
				kharijite = { 
					ROOT = { set_character_flag = adopt_faith_kharijite }
				}
				shiite = { 
					ROOT = { set_character_flag = adopt_faith_shiite }
				}
				druze = { 
					ROOT = { set_character_flag = adopt_faith_druze }
				}
				hurufi = { 
					ROOT = { set_character_flag = adopt_faith_hurufi }
				}
				qarmatian = { 
					ROOT = { set_character_flag = adopt_faith_qarmatian }
				}
				jewish = { 
					ROOT = { set_character_flag = adopt_faith_jewish }
				}
				karaite = { 
					ROOT = { set_character_flag = adopt_faith_karaite }
				}
				samaritan = { 
					ROOT = { set_character_flag = adopt_faith_samaritan }
				}
				zoroastrian = { 
					ROOT = { set_character_flag = adopt_faith_zoroastrian }
				}
				mazdaki = { 
					ROOT = { set_character_flag = adopt_faith_mazdaki }
				}
				mandaean = { 
					ROOT = { set_character_flag = adopt_faith_mandaean }
				}
				zurvanist = { 
					ROOT = { set_character_flag = adopt_faith_zurvanist }
				}
				hindu = { 
					ROOT = { set_character_flag = adopt_faith_hindu }
				}
				khurmazta = {
					ROOT = { set_character_flag = adopt_faith_khurmazta }
				}
				taoist = {
					ROOT = { set_character_flag = adopt_faith_taoist }
				}
				bon = {
					ROOT = { set_character_flag = adopt_faith_bon }
				}
				tibetan_pagan = {
					ROOT = { set_character_flag = adopt_faith_tibetan_pagan }
				}
				buddhist = { 
					ROOT = { set_character_flag = adopt_faith_buddhist }
				}
				jain = { 
					ROOT = { set_character_flag = adopt_faith_jain }
				}
				norse_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_norse_reformed }
				}
				german_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_german_reformed }
				}
				celtic_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_celtic_reformed }
				}
				slavic_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_slavic_reformed } 
				}
				tengri_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_tengri_reformed } 
				}
				baltic_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_baltic_reformed } 
				}
				finnish_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_finnish_reformed }
				}
				west_african_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_west_african_reformed }
				}
				zun_pagan_reformed = { 
					ROOT = { set_character_flag = adopt_faith_zun_reformed } 
				}
				norse_pagan = { 
					ROOT = { set_character_flag = adopt_faith_norse }
				}
				german_pagan = { 
					ROOT = { set_character_flag = adopt_faith_german }
				}
				celtic_pagan = { 
					ROOT = { set_character_flag = adopt_faith_celtic }
				}
				slavic_pagan = { 
					ROOT = { set_character_flag = adopt_faith_slavic } 
				}
				tengri_pagan = { 
					ROOT = { set_character_flag = adopt_faith_tengri } 
				}
				baltic_pagan = { 
					ROOT = { set_character_flag = adopt_faith_baltic } 
				}
				finnish_pagan = { 
					ROOT = { set_character_flag = adopt_faith_finnish }
				}
				west_african_pagan = { 
					ROOT = { set_character_flag = adopt_faith_west_african }
				}
				zun_pagan = { 
					ROOT = { set_character_flag = adopt_faith_zun } 
				}
				aztec = { 
					ROOT = { set_character_flag = adopt_faith_aztec }
				}
				roman_pagan = { 
					ROOT = { set_character_flag = adopt_faith_roman } 
				}
				egyptian_pagan = { 
					ROOT = { set_character_flag = adopt_faith_egyptian } 
				}
				promethean_pagan = { 
					ROOT = { set_character_flag = adopt_faith_promethean } 
				}
				aten_pagan = { 
					ROOT = { set_character_flag = adopt_faith_aten } 
				}
				arab_pagan = { 
					ROOT = { set_character_flag = adopt_faith_arab } 
				}
				berber_pagan = { 
					ROOT = { set_character_flag = adopt_faith_berber } 
				}
				jewish_pagan = { 
					ROOT = { set_character_flag = adopt_faith_jewish_pagan } 
				}
				hellenic_pagan = { 
					ROOT = { set_character_flag = adopt_faith_hellenic_pagan } 
				}
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_3810 
		ai_chance = {
			factor = 20
			modifier = {
				factor = 1.3
				FROM = {
					diplomacy = 7
				}
			}
			modifier = {
				factor = 1.3
				FROM = {
					diplomacy = 10
				}
			}
			modifier = {
				factor = 1.3
				FROM = {
					diplomacy = 13
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					diplomacy = 15
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					diplomacy = 17
				}
			}
			modifier = {
				factor = 1.2
				FROM = {
					diplomacy = 19
				}
			}
			modifier = {
				factor = 1.2
				FROM = {
					diplomacy = 21
				}
			}
			modifier = {
				factor = 1.2
				FROM = {
					diplomacy = 23
				}
			}
			modifier = {
				factor = 1.2
				FROM = {
					diplomacy = 25
				}
			}
			modifier = {
				factor = 2
				FROM = { has_focus = focus_theology }
			}
		}
		if = {
			limit = {
				OR = {
					religion_group = muslim
					religion = norse_pagan_reformed
				}
				any_demesne_title = {
					controls_religion = yes
				}
			}
			any_demesne_title = {
				limit = {
					controls_religion = yes
				}
				destroy_landed_title = THIS
			}
		}
		if = {
			limit = {
				NOR = {
					religion_group = muslim
					religion = norse_pagan_reformed
				}
				any_demesne_title = {
					controls_religion = yes
				}
			}
			hidden_tooltip = {
				liege = {
					save_event_target_as = liege_target
				}
				create_character = {
					age = 38
					dynasty = random
					religion = ROOT
					culture = ROOT
					random_traits = yes
				}
				new_character = {
					save_event_target_as = new_holder
				}
			}
			any_demesne_title = {
				limit = {
					controls_religion = yes
				}
				grant_title = event_target:new_holder
				holder_scope = {
					any_vassal = {
						set_defacto_liege = event_target:liege_target
					}
				}
			}
			hidden_tooltip = {
				set_defacto_liege = event_target:liege_target
			}
		}
		if = { # Holy Orders/Static Mercs are given to a random new character
			limit = {
				any_demesne_title = {
					OR = {
						holy_order = yes
						mercenary = yes
					}
				}
			}
			hidden_tooltip = {
				liege = {
					save_event_target_as = liege_target
				}
				create_character = {
					age = 38
					dynasty = random
					religion = ROOT
					culture = ROOT
					random_traits = yes
				}
				new_character = {
					save_event_target_as = new_holder
				}
			}
			any_demesne_title = {
				limit = {
					OR = {
						holy_order = yes
						mercenary = yes
					}
				}
				grant_title = event_target:new_holder
				holder_scope = {
					any_vassal = {
						set_defacto_liege = event_target:liege_target
					}
				}
			}
			hidden_tooltip = {
				set_defacto_liege = event_target:liege_target
			}
		}
		trigger_switch = {
			on_trigger = has_character_flag
			adopt_faith_chalcedonian = {
				religion = chalcedonian
			}
			adopt_faith_catholic = {
				religion = catholic
			}
			adopt_faith_cathar = {
				religion = cathar
			}
			adopt_faith_fraticelli = {
				religion = fraticelli
			}
			adopt_faith_waldensian = {
				religion = waldensian
			}
			adopt_faith_lollard = {
				religion = lollard
			}
			adopt_faith_adoptionist = {
				religion = adoptionist
			}
			adopt_faith_orthodox = {
				religion = orthodox
			}
			adopt_faith_miaphysite = {
				religion = miaphysite
			}
			adopt_faith_monophysite = {
				religion = monophysite
			}
			adopt_faith_bogomilist = {
				religion = bogomilist
			}
			adopt_faith_monothelite = {
				religion = monothelite
			}
			adopt_faith_iconoclast = {
				religion = iconoclast
			}
			adopt_faith_apostolic = {
				religion = apostolic
			}
			adopt_faith_paulician = {
				religion = paulician
			}
			adopt_faith_tondrakian = {
				religion = tondrakian
			}
			adopt_faith_nestorian = {
				religion = nestorian
			}
			adopt_faith_messalian = {
				religion = messalian
			}
			adopt_faith_manichean = {
				religion = manichean
			}
			adopt_faith_sunni = {
				religion = sunni
			}
			adopt_faith_zikri = {
				religion = zikri
			}
			adopt_faith_quranist = {
				religion = quranist
			}
			adopt_faith_yazidi = {
				religion = yazidi
			}
			adopt_faith_ibadi = {
				religion = ibadi
			}
			adopt_faith_kharijite = {
				religion = kharijite
			}
			adopt_faith_shiite = {
				religion = shiite
			}
			adopt_faith_bektashi = {
				religion = bektashi
			}
			adopt_faith_druze = {
				religion = druze
			}
			adopt_faith_qarmatian = {
				religion = qarmatian
			}
			adopt_faith_hurufi = {
				religion = hurufi
			}
			adopt_faith_jewish = {
				religion = jewish
			}
			adopt_faith_karaite = {
				religion = karaite
			}
			adopt_faith_samaritan = {
				religion = samaritan
			}
			adopt_faith_zoroastrian = {
				religion = zoroastrian
			}
			adopt_faith_zurvanist = {
				religion = zurvanist
			}
			adopt_faith_mandaean = {
				religion = mandaean
			}
			adopt_faith_mazdaki = {
				religion = mazdaki
			}
			adopt_faith_taoist = {
				religion = taoist
			}
			adopt_faith_khurmazta = {
				religion = khurmazta
			}
			adopt_faith_bon = {
				religion = bon
			}
			adopt_faith_tibetan_pagan = {
				religion = tibetan_pagan
			}
			adopt_faith_hindu = {
				religion = hindu
			}
			adopt_faith_buddhist = {
				religion = buddhist
			}
			adopt_faith_jain = {
				religion = jain
			}
			adopt_faith_norse_reformed = {
				religion = norse_pagan_reformed
			}
			adopt_faith_german_reformed = {
				religion = german_pagan_reformed
			}
			adopt_faith_celtic_reformed = {
				religion = celtic_pagan_reformed
			}
			adopt_faith_slavic_reformed = {
				religion = slavic_pagan_reformed
			}
			adopt_faith_tengri_reformed = {
				religion = tengri_pagan_reformed
			}
			adopt_faith_baltic_reformed = {
				religion = baltic_pagan_reformed
			}
			adopt_faith_finnish_reformed = {
				religion = finnish_pagan_reformed
			}
			adopt_faith_west_african_reformed = {
				religion = west_african_pagan_reformed
			}
			adopt_faith_zun_reformed  = {
				religion = zun_pagan_reformed
			}
			adopt_faith_norse = {
				religion = norse_pagan
			}
			adopt_faith_german = {
				religion = german_pagan
			}
			adopt_faith_celtic = {
				religion = celtic_pagan
			}
			adopt_faith_slavic = {
				religion = slavic_pagan
			}
			adopt_faith_tengri = {
				religion = tengri_pagan
			}
			adopt_faith_baltic = {
				religion = baltic_pagan
			}
			adopt_faith_finnish = {
				religion = finnish_pagan
			}
			adopt_faith_west_african = {
				religion = west_african_pagan
			}
			adopt_faith_zun = {
				religion = zun_pagan
			}
			adopt_faith_aztec = {
				religion = aztec
			}
			adopt_faith_roman = {
				religion = roman_pagan
			}
			adopt_faith_egyptian = {
				religion = egyptian_pagan
			}
			adopt_faith_promethean = {
				religion = promethean_pagan
			}
			adopt_faith_aten = {
				religion = aten_pagan
			}
			adopt_faith_arab = {
				religion = arab_pagan
			}
			adopt_faith_berber = {
				religion = berber_pagan
			}
			adopt_faith_jewish_pagan = {
				religion = jewish_pagan
			}
			adopt_faith_hellenic_pagan = {
				religion = hellenic_pagan
			}
		}
		clear_secret_religion = yes
		if = {
			limit = { ai = yes }
			set_character_flag = ai_flag_refuse_conversion
		}
	}
	
	option = {
		name = EVTOPTB_MNM_3810
		ai_chance = {
			factor = 80
			modifier = {
				factor = 0.05
				FROM = {
					ROOT = {
						has_prevs_secret_religion_truly_trigger = yes
					}
				}
			}
		}
	}
	
	after = {
		set_character_flag = currently_part_of_secret_religion_uncovering
		
		clr_character_flag = adopt_faith_catholic
		clr_character_flag = adopt_faith_cathar
		clr_character_flag = adopt_faith_fraticelli
		clr_character_flag = adopt_faith_waldensian
		clr_character_flag = adopt_faith_lollard
		clr_character_flag = adopt_faith_adoptionist
		clr_character_flag = adopt_faith_chalcedonian
		clr_character_flag = adopt_faith_orthodox
		clr_character_flag = adopt_faith_bogomilist
		clr_character_flag = adopt_faith_monothelite
		clr_character_flag = adopt_faith_iconoclast
		clr_character_flag = adopt_faith_nestorian
		clr_character_flag = adopt_faith_messalian
		clr_character_flag = adopt_faith_miaphysite
		clr_character_flag = adopt_faith_monophysite
		clr_character_flag = adopt_faith_apostolic
		clr_character_flag = adopt_faith_paulician
		clr_character_flag = adopt_faith_tondrakian
		clr_character_flag = adopt_faith_ibadi
		clr_character_flag = adopt_faith_kharijite
		clr_character_flag = adopt_faith_manichean
		clr_character_flag = adopt_faith_sunni
		clr_character_flag = adopt_faith_zikri
		clr_character_flag = adopt_faith_quranist
		clr_character_flag = adopt_faith_shiite
		clr_character_flag = adopt_faith_bektashi
		clr_character_flag = adopt_faith_druze
		clr_character_flag = adopt_faith_hurufi
		clr_character_flag = adopt_faith_qarmatian
		clr_character_flag = adopt_faith_jewish
		clr_character_flag = adopt_faith_samaritan
		clr_character_flag = adopt_faith_karaite
		clr_character_flag = adopt_faith_zoroastrian
		clr_character_flag = adopt_faith_mazdaki
		clr_character_flag = adopt_faith_zurvanist
		clr_character_flag = adopt_faith_mandaean
		clr_character_flag = adopt_faith_yazidi
		clr_character_flag = adopt_faith_hindu
		clr_character_flag = adopt_faith_buddhist
		clr_character_flag = adopt_faith_jain
		clr_character_flag = adopt_faith_khurmazta
		clr_character_flag = adopt_faith_taoist
		clr_character_flag = adopt_faith_bon
		clr_character_flag = adopt_faith_tibetan_pagan
		clr_character_flag = adopt_faith_norse_reformed
		clr_character_flag = adopt_faith_german_reformed
		clr_character_flag = adopt_faith_celtic_reformed
		clr_character_flag = adopt_faith_slavic_reformed
		clr_character_flag = adopt_faith_tengri_reformed
		clr_character_flag = adopt_faith_baltic_reformed
		clr_character_flag = adopt_faith_finnish_reformed
		clr_character_flag = adopt_faith_west_african_reformed
		clr_character_flag = adopt_faith_zun_reformed
		clr_character_flag = adopt_faith_norse
		clr_character_flag = adopt_faith_german
		clr_character_flag = adopt_faith_celtic
		clr_character_flag = adopt_faith_slavic
		clr_character_flag = adopt_faith_tengri
		clr_character_flag = adopt_faith_baltic
		clr_character_flag = adopt_faith_finnish
		clr_character_flag = adopt_faith_west_african
		clr_character_flag = adopt_faith_zun
		clr_character_flag = adopt_faith_roman
		clr_character_flag = adopt_faith_egyptian
		clr_character_flag = adopt_faith_arab
		clr_character_flag = adopt_faith_berber
		clr_character_flag = adopt_faith_jewish_pagan
		clr_character_flag = adopt_faith_aten
		clr_character_flag = adopt_faith_promethean
		clr_character_flag = adopt_faith_aztec
		clr_character_flag = adopt_faith_hellenic_pagan
	}
}

character_event = { # Openly Adopt Faith event (for the character who actually fires all of it)
	id = MNM.3811
	desc = EVTDESC_MNM_3811
	picture = GFX_evt_dark_prayer
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	
	immediate = {
		set_variable = { which = visibility_value value = 0 }
		remove_character_modifier = highly_suspect
		remove_character_modifier = under_suspicion
	}
	
	option = {	  
		name = EVTOPTA_MNM_3811
		custom_tooltip = { text = EVTOPTA_MNM_3811_TT }
		add_character_modifier = {
			modifier = devout_leader
			duration = -1
		}
		if = {
			limit = { ai = yes }
			set_character_flag = ai_flag_refuse_conversion
		}
	}
}


# openly_adopt_faith - Flip provinces with local cult modifier
character_event = {
	id = MNM.3820
	desc = EVTDESC_MNM_3820
	picture = GFX_evt_society_joining
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			trigger_switch = {
				on_trigger = secret_religion
				catholic = {
					ROOT = {
						set_character_flag = sr_catholic_prov_flip
					}
				}
				cathar = {
					ROOT = {
						set_character_flag = sr_cathar_prov_flip
					}
				}
				fraticelli = {
					ROOT = {
						set_character_flag = sr_fraticelli_prov_flip
					}
				}
				waldensian = {
					ROOT = {
						set_character_flag = sr_waldensian_prov_flip
					}
				}
				lollard = {
					ROOT = {
						set_character_flag = sr_lollard_prov_flip
					}
				}
				adoptionist = {
					ROOT = {
						set_character_flag = sr_adoptionist_prov_flip
					}
				}
				chalcedonian = {
					ROOT = {
						set_character_flag = sr_chalcedonian_prov_flip
					}
				}
				orthodox = { 
					ROOT = {
						set_character_flag = sr_orthodox_prov_flip
					}
				}
				miaphysite = { 
					ROOT = {
						set_character_flag = sr_miaphysite_prov_flip
					}
				}
				monophysite = { 
					ROOT = {
						set_character_flag = sr_monophysite_prov_flip
					}
				}
				bogomilist = { 
					ROOT = {
						set_character_flag = sr_bogomilist_prov_flip
					}
				}
				monothelite = { 
					ROOT = {
						set_character_flag = sr_monothelite_prov_flip
					}
				}
				iconoclast = { 
					ROOT = {
						set_character_flag = sr_iconoclast_prov_flip
					}
				}
				paulician = { 
					ROOT = {
						set_character_flag = sr_paulician_prov_flip
					}
				}
				tondrakian = { 
					ROOT = {
						set_character_flag = sr_tondrakian_prov_flip
					}
				}
				nestorian = { 
					ROOT = {
						set_character_flag = sr_nestorian_prov_flip
					}
				}
				messalian = { 
					ROOT = {
						set_character_flag = sr_messalian_prov_flip
					}
				}
				apostolic = { 
					ROOT = {
						set_character_flag = sr_apostolic_prov_flip
					}
				}
				manichean = { 
					ROOT = {
						set_character_flag = sr_manichean_prov_flip
					}
				}
				sunni = { 
					ROOT = {
						set_character_flag = sr_sunni_prov_flip
					}
				}
				zikri = { 
					ROOT = {
						set_character_flag = sr_zikri_prov_flip
					}
				}
				quranist = { 
					ROOT = {
						set_character_flag = sr_quranist_prov_flip
					}
				}
				yazidi = { 
					ROOT = {
						set_character_flag = sr_yazidi_prov_flip
					}
				}
				ibadi = { 
					ROOT = {
						set_character_flag = sr_ibadi_prov_flip
					}
				}
				kharijite = { 
					ROOT = {
						set_character_flag = sr_kharijite_prov_flip
					}
				}
				shiite = { 
					ROOT = {
						set_character_flag = sr_shiite_prov_flip
					}
				}
				bektashi = { 
					ROOT = {
						set_character_flag = sr_bektashi_prov_flip
					}
				}
				hurufi = { 
					ROOT = {
						set_character_flag = sr_hurufi_prov_flip
					}
				}
				druze = { 
					ROOT = {
						set_character_flag = sr_druze_prov_flip
					}
				}
				qarmatian = { 
					ROOT = {
						set_character_flag = sr_qarmatian_prov_flip
					}
				}
				jewish = { 
					ROOT = {
						set_character_flag = sr_jewish_prov_flip
					}
				}
				karaite = { 
					ROOT = {
						set_character_flag = sr_karaite_prov_flip
					}
				}
				samaritan = { 
					ROOT = {
						set_character_flag = sr_samaritan_prov_flip
					}
				}
				zoroastrian = { 
					ROOT = {
						set_character_flag = sr_zoroastrian_prov_flip
					}
				}
				mazdaki = { 
					ROOT = {
						set_character_flag = sr_mazdaki_prov_flip
					}
				}
				mandaean = { 
					ROOT = {
						set_character_flag = sr_mandaean_prov_flip
					}
				}
				zurvanist = { 
					ROOT = {
						set_character_flag = sr_zurvanist_prov_flip
					}
				}
				hindu = { 
					ROOT = {
						set_character_flag = sr_hindu_prov_flip
					}
				}
				buddhist = { 
					ROOT = {
						set_character_flag = sr_buddhist_prov_flip
					}
				}
				jain = { 
					ROOT = {
						set_character_flag = sr_jain_prov_flip
					}
				}
				khurmazta = { 
					ROOT = {
						set_character_flag = sr_khurmazta_prov_flip
					}
				}
				taoist = { 
					ROOT = {
						set_character_flag = sr_taoist_prov_flip
					}
				}
				bon = { 
					ROOT = {
						set_character_flag = sr_bon_prov_flip
					}
				}
				tibetan_pagan = { 
					ROOT = {
						set_character_flag = sr_tibetan_pagan_prov_flip
					}
				}
				norse_pagan_reformed = { 
					ROOT = {
						set_character_flag = sr_norse_pagan_reformed_prov_flip
					}
				}
				german_pagan_reformed = { 
					ROOT = {
						set_character_flag = sr_german_pagan_reformed_prov_flip
					}
				}
				celtic_pagan_reformed = { 
					ROOT = {
						set_character_flag = sr_celtic_pagan_reformed_prov_flip
					}
				}
				slavic_pagan_reformed = { 
					ROOT = {
						set_character_flag = sr_slavic_pagan_reformed_prov_flip
					}
				}
				tengri_pagan_reformed = {
					ROOT = {
						set_character_flag = sr_tengri_pagan_reformed_prov_flip
					}
				}
				baltic_pagan_reformed = { 
					ROOT = {
						set_character_flag = sr_baltic_pagan_reformed_prov_flip
					}
				}
				finnish_pagan_reformed = { 
					ROOT = {
						set_character_flag = sr_finnish_pagan_reformed_prov_flip
					}
				}
				west_african_pagan_reformed = { 
					ROOT = {
						set_character_flag = sr_west_african_pagan_reformed_prov_flip
					}
				}
				zun_pagan_reformed = { 
					ROOT = {
						set_character_flag = sr_zun_pagan_reformed_prov_flip
					}
				}
				norse_pagan = { 
					ROOT = {
						set_character_flag = sr_norse_pagan_prov_flip
					}
				}
				german_pagan = { 
					ROOT = {
						set_character_flag = sr_german_pagan_prov_flip
					}
				}
				celtic_pagan = { 
					ROOT = {
						set_character_flag = sr_norse_pagan_prov_flip
					}
				}
				slavic_pagan = { 
					ROOT = {
						set_character_flag = sr_slavic_pagan_prov_flip
					}
				}
				tengri_pagan = {
					ROOT = {
						set_character_flag = sr_tengri_pagan_prov_flip
					}
				}
				baltic_pagan = { 
					ROOT = {
						set_character_flag = sr_baltic_pagan_prov_flip
					}
				}
				finnish_pagan = { 
					ROOT = {
						set_character_flag = sr_finnish_pagan_prov_flip
					}
				}
				west_african_pagan = { 
					ROOT = {
						set_character_flag = sr_west_african_pagan_prov_flip
					}
				}
				zun_pagan = { 
					ROOT = {
						set_character_flag = sr_zun_pagan_prov_flip
					}
				} 
				aztec = { 
					ROOT = {
						set_character_flag = sr_aztec_prov_flip
					}
				}
				roman_pagan = { 
					ROOT = {
						set_character_flag = sr_roman_pagan_prov_flip
					}
				}
				egyptian_pagan = { 
					ROOT = {
						set_character_flag = sr_egyptian_pagan_prov_flip
					}
				}
				promethean_pagan = { 
					ROOT = {
						set_character_flag = sr_promethean_pagan_prov_flip
					}
				}
				aten_pagan = { 
					ROOT = {
						set_character_flag = sr_aten_pagan_prov_flip
					}
				}
				berber_pagan = { 
					ROOT = {
						set_character_flag = sr_berber_pagan_prov_flip
					}
				}
				jewish_pagan = { 
					ROOT = {
						set_character_flag = sr_jewish_pagan_prov_flip
					}
				}
				arab_pagan = { 
					ROOT = {
						set_character_flag = sr_arab_pagan_prov_flip
					}
				}
				hellenic_pagan = { 
					ROOT = {
						set_character_flag = sr_hellenic_pagan_prov_flip
					}
				}
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_3820
		
		trigger_switch = {
			on_trigger = has_character_flag
			
			sr_catholic_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_catholic_community
					}
					religion = catholic
					remove_province_modifier = secret_catholic_community
				}
			}
			sr_cathar_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_cathar_community
					}
					religion = cathar
					remove_province_modifier = secret_cathar_community
				}
			}
			sr_fraticelli_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_fraticelli_community
					}
					religion = fraticelli
					remove_province_modifier = secret_fraticelli_community
				}
			}
			sr_waldensian_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_waldensian_community
					}
					religion = waldensian
					remove_province_modifier = secret_waldensian_community
				}
			}
			sr_lollard_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_lollard_community
					}
					religion = lollard
					remove_province_modifier = secret_lollard_community
				}
			}
			sr_adoptionist_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_adoptionist_community
					}
					religion = adoptionist
					remove_province_modifier = secret_adoptionist_community
				}
			}
			sr_chalcedonian_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_chalcedonian_community
					}
					religion = chalcedonian
					remove_province_modifier = secret_chalcedonian_community
				}
			}
			sr_orthodox_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_orthodox_community
					}
					religion = orthodox
					remove_province_modifier = secret_orthodox_community
				}
			}
			sr_miaphysite_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_miaphysite_community
					}
					religion = miaphysite
					remove_province_modifier = secret_miaphysite_community
				}
			}
			sr_monophysite_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_monophysite_community
					}
					religion = monophysite
					remove_province_modifier = secret_monophysite_community
				}
			}
			sr_bogomilist_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_bogomilist_community
					}
					religion = bogomilist
					remove_province_modifier = secret_bogomilist_community
				}
			}
			sr_monothelite_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_monothelite_community
					}
					religion = monothelite
					remove_province_modifier = secret_monothelite_community
				}
			}
			sr_iconoclast_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_iconoclast_community
					}
					religion = iconoclast
					remove_province_modifier = secret_iconoclast_community
				}
			}
			sr_paulician_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_paulician_community
					}
					religion = paulician
					remove_province_modifier = secret_paulician_community
				}
			}
			sr_nestorian_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_nestorian_community
					}
					religion = nestorian
					remove_province_modifier = secret_nestorian_community
				}
			}
			sr_messalian_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_messalian_community
					}
					religion = messalian
					remove_province_modifier = secret_messalian_community
				}
			}
			sr_apostolic_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_apostolic_community
					}
					religion = apostolic
					remove_province_modifier = secret_apostolic_community
				}
			}
			sr_tondrakian_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_tondrakian_community
					}
					religion = tondrakian
					remove_province_modifier = secret_tondrakian_community
				}
			}
			sr_manichean_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_manichean_community
					}
					religion = manichean
					remove_province_modifier = secret_manichean_community
				}
			}
			sr_sunni_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_sunni_community
					}
					religion = sunni
					remove_province_modifier = secret_sunni_community
				}
			}
			sr_zikri_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_zikri_community
					}
					religion = zikri
					remove_province_modifier = secret_zikri_community
				}
			}
			sr_quranist_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_quranist_community
					}
					religion = quranist
					remove_province_modifier = secret_quranist_community
				}
			}
			sr_yazidi_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_yazidi_community
					}
					religion = yazidi
					remove_province_modifier = secret_yazidi_community
				}
			}
			sr_ibadi_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_ibadi_community
					}
					religion = ibadi
					remove_province_modifier = secret_ibadi_community
				}
			}
			sr_kharijite_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_kharijite_community
					}
					religion = kharijite
					remove_province_modifier = secret_kharijite_community
				}
			}
			sr_shiite_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_shiite_community
					}
					religion = shiite
					remove_province_modifier = secret_shiite_community
				}
			}
			sr_bektashi_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_bektashi_community
					}
					religion = bektashi
					remove_province_modifier = secret_bektashi_community
				}
			}
			sr_druze_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_druze_community
					}
					religion = druze
					remove_province_modifier = secret_druze_community
				}
			}
			sr_hurufi_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_hurufi_community
					}
					religion = hurufi
					remove_province_modifier = secret_hurufi_community
				}
			}
			sr_qarmatian_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_qarmatian_community
					}
					religion = qarmatian
					remove_province_modifier = secret_qarmatian_community
				}
			}
			sr_jewish_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_jewish_community
					}
					religion = jewish
					remove_province_modifier = secret_jewish_community
				}
			}
			sr_karaite_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_karaite_community
					}
					religion = karaite
					remove_province_modifier = secret_karaite_community
				}
			}
			sr_samaritan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_samaritan_community
					}
					religion = samaritan
					remove_province_modifier = secret_samaritan_community
				}
			}
			sr_zoroastrian_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_zoroastrian_community
					}
					religion = zoroastrian
					remove_province_modifier = secret_zoroastrian_community
				}
			}
			sr_mazdaki_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_mazdaki_community
					}
					religion = mazdaki
					remove_province_modifier = secret_mazdaki_community
				}
			}
			sr_mandaean_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_mandaean_community
					}
					religion = mandaean
					remove_province_modifier = secret_mandaean_community
				}
			}
			sr_taoist_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_taoist_community
					}
					religion = taoist
					remove_province_modifier = secret_taoist_community
				}
			}
			sr_khurmazta_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_khurmazta_community
					}
					religion = khurmazta
					remove_province_modifier = secret_khurmazta_community
				}
			}
			sr_bon_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_bon_community
					}
					religion = bon
					remove_province_modifier = secret_bon_community
				}
			}
			sr_tibetan_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_tibetan_pagan_community
					}
					religion = tibetan_pagan
					remove_province_modifier = secret_tibetan_pagan_community
				}
			}
			sr_hindu_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_hindu_community
					}
					religion = hindu
					remove_province_modifier = secret_hindu_community
				}
			}
			sr_buddhist_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_buddhist_community
					}
					religion = buddhist
					remove_province_modifier = secret_buddhist_community
				}
			}
			sr_jain_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_jain_community
					}
					religion = jain
					remove_province_modifier = secret_jain_community
				}
			}
			sr_norse_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_norse_pagan_reformed_community
					}
					religion = norse_pagan_reformed
					remove_province_modifier = secret_norse_pagan_reformed_community
				}
			}
			sr_german_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_german_pagan_reformed_community
					}
					religion = german_pagan_reformed
					remove_province_modifier = secret_german_pagan_reformed_community
				}
			}
			sr_celtic_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_celtic_pagan_reformed_community
					}
					religion = celtic_pagan_reformed
					remove_province_modifier = secret_celtic_pagan_reformed_community
				}
			}
			sr_slavic_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_slavic_pagan_reformed_community
					}
					religion = slavic_pagan_reformed
					remove_province_modifier = secret_slavic_pagan_reformed_community
				}
			}
			sr_tengri_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_tengri_pagan_reformed_community
					}
					religion = tengri_pagan_reformed
					remove_province_modifier = secret_tengri_pagan_reformed_community
				}
			}
			sr_baltic_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_baltic_pagan_reformed_community
					}
					religion = baltic_pagan_reformed
					remove_province_modifier = secret_baltic_pagan_reformed_community
				}
			}
			sr_finnish_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_finnish_pagan_reformed_community
					}
					religion = finnish_pagan_reformed
					remove_province_modifier = secret_finnish_pagan_reformed_community
				}
			}
			sr_west_african_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_west_african_pagan_reformed_community
					}
					religion = west_african_pagan_reformed
					remove_province_modifier = secret_west_african_pagan_reformed_community
				}
			}
			sr_zun_pagan_reformed_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_zun_pagan_reformed_community
					}
					religion = zun_pagan_reformed 
					remove_province_modifier = secret_zun_pagan_reformed_community
				}
			}
			sr_norse_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_norse_pagan_community
					}
					religion = norse_pagan
					remove_province_modifier = secret_norse_pagan_community
				}
			}
			sr_german_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_german_pagan_community
					}
					religion = german_pagan
					remove_province_modifier = secret_german_pagan_community
				}
			}
			sr_celtic_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_celtic_pagan_community
					}
					religion = celtic_pagan
					remove_province_modifier = secret_celtic_pagan_community
				}
			}
			sr_slavic_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_slavic_pagan_community
					}
					religion = slavic_pagan
					remove_province_modifier = secret_slavic_pagan_community
				}
			}
			sr_tengri_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_tengri_pagan_community
					}
					religion = tengri_pagan
					remove_province_modifier = secret_tengri_pagan_community
				}
			}
			sr_baltic_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_baltic_pagan_community
					}
					religion = baltic_pagan
					remove_province_modifier = secret_baltic_pagan_community
				}
			}
			sr_finnish_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_finnish_pagan_community
					}
					religion = finnish_pagan
					remove_province_modifier = secret_finnish_pagan_community
				}
			}
			sr_west_african_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_west_african_pagan_community
					}
					religion = west_african_pagan
					remove_province_modifier = secret_west_african_pagan_community
				}
			}
			sr_zun_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_zun_pagan_community
					}
					religion = zun_pagan 
					remove_province_modifier = secret_zun_pagan_community
				}
			}
			sr_aztec_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_aztec_community
					}
					religion = aztec
					remove_province_modifier = secret_aztec_community
				}
			}
			sr_roman_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_roman_pagan_community
					}
					religion = roman_pagan 
					remove_province_modifier = secret_roman_pagan_community
				}
			}
			sr_egyptian_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_egyptian_pagan_community
					}
					religion = egyptian_pagan 
					remove_province_modifier = secret_egyptian_pagan_community
				}
			}
			sr_promethean_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_promethean_pagan_community
					}
					religion = promethean_pagan 
					remove_province_modifier = secret_promethean_pagan_community
				}
			}
			sr_aten_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_aten_pagan_community
					}
					religion = aten_pagan 
					remove_province_modifier = secret_aten_pagan_community
				}
			}
			sr_arab_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_arab_pagan_community
					}
					religion = arab_pagan 
					remove_province_modifier = secret_arab_pagan_community
				}
			}
			sr_berber_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_berber_pagan_community
					}
					religion = berber_pagan 
					remove_province_modifier = secret_berber_pagan_community
				}
			}
			sr_jewish_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_jewish_pagan_community
					}
					religion = jewish_pagan 
					remove_province_modifier = secret_jewish_pagan_community
				}
			}
			sr_hellenic_pagan_prov_flip = { 
				any_demesne_province = {
					limit = {
						has_province_modifier = secret_hellenic_pagan_community
					}
					religion = hellenic_pagan 
					remove_province_modifier = secret_hellenic_pagan_community
				}
			}
		}
		clr_character_flag = sr_catholic_prov_flip
		clr_character_flag = sr_cathar_prov_flip
		clr_character_flag = sr_fraticelli_prov_flip
		clr_character_flag = sr_waldensian_prov_flip
		clr_character_flag = sr_lollard_prov_flip
		clr_character_flag = sr_adoptionist_prov_flip
		clr_character_flag = sr_chalcedonian_prov_flip
		clr_character_flag = sr_orthodox_prov_flip
		clr_character_flag = sr_miaphysite_prov_flip
		clr_character_flag = sr_monophysite_prov_flip
		clr_character_flag = sr_bogomilist_prov_flip
		clr_character_flag = sr_monothelite_prov_flip
		clr_character_flag = sr_iconoclast_prov_flip
		clr_character_flag = sr_paulician_prov_flip
		clr_character_flag = sr_nestorian_prov_flip
		clr_character_flag = sr_messalian_prov_flip
		clr_character_flag = sr_apostolic_prov_flip
		clr_character_flag = sr_sunni_prov_flip
		clr_character_flag = sr_quranist_prov_flip
		clr_character_flag = sr_zikri_prov_flip
		clr_character_flag = sr_yazidi_prov_flip
		clr_character_flag = sr_ibadi_prov_flip
		clr_character_flag = sr_kharijite_prov_flip
		clr_character_flag = sr_shiite_prov_flip
		clr_character_flag = sr_bektashi_prov_flip
		clr_character_flag = sr_druze_prov_flip
		clr_character_flag = sr_hurufi_prov_flip
		clr_character_flag = sr_qarmatian_prov_flip
		clr_character_flag = sr_jewish_prov_flip
		clr_character_flag = sr_karaite_prov_flip
		clr_character_flag = sr_samaritan_prov_flip
		clr_character_flag = sr_zoroastrian_prov_flip
		clr_character_flag = sr_zurvanist_prov_flip
		clr_character_flag = sr_mazdaki_prov_flip
		clr_character_flag = sr_manichean_prov_flip
		clr_character_flag = sr_mandaean_prov_flip
		clr_character_flag = sr_hindu_prov_flip
		clr_character_flag = sr_buddhist_prov_flip
		clr_character_flag = sr_jain_prov_flip
		clr_character_flag = sr_taoist_prov_flip
		clr_character_flag = sr_khurmazta_prov_flip
		clr_character_flag = sr_bon_prov_flip
		clr_character_flag = sr_tibetan_pagan_prov_flip
		clr_character_flag = sr_norse_pagan_reformed_prov_flip
		clr_character_flag = sr_german_pagan_reformed_prov_flip
		clr_character_flag = sr_celtic_pagan_reformed_prov_flip
		clr_character_flag = sr_slavic_pagan_reformed_prov_flip
		clr_character_flag = sr_tengri_pagan_reformed_prov_flip
		clr_character_flag = sr_baltic_pagan_reformed_prov_flip
		clr_character_flag = sr_finnish_pagan_reformed_prov_flip
		clr_character_flag = sr_west_african_pagan_reformed_prov_flip
		clr_character_flag = sr_zun_pagan_reformed_prov_flip
		clr_character_flag = sr_norse_pagan_prov_flip
		clr_character_flag = sr_celtic_pagan_prov_flip
		clr_character_flag = sr_german_pagan_prov_flip
		clr_character_flag = sr_slavic_pagan_prov_flip
		clr_character_flag = sr_tengri_pagan_prov_flip
		clr_character_flag = sr_baltic_pagan_prov_flip
		clr_character_flag = sr_finnish_pagan_prov_flip
		clr_character_flag = sr_west_african_pagan_prov_flip
		clr_character_flag = sr_zun_pagan_prov_flip
		clr_character_flag = sr_aztec_prov_flip
		clr_character_flag = sr_roman_pagan_prov_flip
		clr_character_flag = sr_egyptian_pagan_prov_flip
		clr_character_flag = sr_promethean_pagan_prov_flip
		clr_character_flag = sr_aten_pagan_prov_flip
		clr_character_flag = sr_arab_pagan_prov_flip
		clr_character_flag = sr_berber_pagan_prov_flip
		clr_character_flag = sr_jewish_pagan_prov_flip
		clr_character_flag = sr_hellenic_pagan_prov_flip
	}
}

# openly_adopt_faith - Inform lieges unless they're part of the cult flipping
character_event = {
	id = MNM.3830
	desc = EVTDESC_MNM_3830
	picture = GFX_evt_society_joining
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_character_flag = currently_part_of_secret_religion_uncovering }
	}
	
	option = {
		name = EVTOPTA_MNM_3830
	}
}

###MISC###

#Child gets holy scripture read to them, do they like it?
character_event = { 
	id = MNM.3431
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_religion

	desc = {
		trigger = { FROM = { shares_true_religion_group_with_prev_trigger = no } }
		text = EVTDESC_MNM_3431_A
	}
	desc = {
		trigger = { FROM = { shares_true_religion_group_with_prev_trigger = yes } }
		text = EVTDESC_MNM_3431_B
	}

	is_triggered_only = yes
 
 	#tell me more
   	option = {
		name = EVTOPTC_MNM_3431

		FROM = { ROOT = { add_prevs_secret_religion_trait_effect = yes } }

		hidden_effect = { FROM = { character_event = { id = MNM.3432 days = 14 } } }

		ai_chance = {
			factor = 20
			modifier = { mother = { character = FROM } factor = 1.6 }
			modifier = { father = { character = FROM } factor = 1.6 }
			modifier = { opinion = { who = FROM value = 30 } factor = 1.5 }
			modifier = { opinion = { who = FROM value = 50 } factor = 1.5 }
			modifier = { opinion = { who = FROM value = 70 } factor = 1.6 }
			modifier = { OR = { trait = trusting trait = affectionate } factor = 2 }
			modifier = { OR = { trait = craven trait = timid } factor = 1.5 }
			modifier = { FROM = { diplomacy = 10 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 12 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 14 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 16 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 18 } factor = 1.2 }
			modifier = {
				factor = 2
				FROM = { has_focus = focus_theology }
			}
		}
	}

	#interesting
	option = { 
		trigger = { #Can get sympathy
			FROM = { ROOT = { has_sympathy_for_true_religion_of_prev_trigger = no } }
			FROM = { shares_true_religion_group_with_prev_trigger = no }
		}
		name = EVTOPTA_MNM_3431
		
		FROM = { ROOT = { add_sympathy_for_prevs_true_religion_effect = yes } }
		
		hidden_effect = { FROM = { character_event = { id = MNM.3433 days = 14 } } }

		ai_chance = {
			factor = 40
			modifier = { mother = { character = FROM } factor = 1.4 }
			modifier = { father = { character = FROM } factor = 1.4 }
			modifier = { opinion = { who = FROM value = 30 } factor = 1.2 }
			modifier = { opinion = { who = FROM value = 50 } factor = 1.2 }
			modifier = { opinion = { who = FROM value = 70 } factor = 1.2 }
			modifier = { OR = { trait = trusting trait = affectionate } factor = 2 }
			modifier = { OR = { trait = craven trait = timid } factor = 1.5 }
			modifier = { FROM = { diplomacy = 10 } factor = 1.1 }
			modifier = { FROM = { diplomacy = 12 } factor = 1.1 }
			modifier = { FROM = { diplomacy = 14 } factor = 1.1 }
			modifier = { FROM = { diplomacy = 16 } factor = 1.1 }
			modifier = { FROM = { diplomacy = 18 } factor = 1.1 }
		}
	}

	#this is stupid!
	option = {
		name = EVTOPTB_MNM_3431

		hidden_effect = { FROM = { character_event = { id = MNM.3434 days = 14 } } }

		ai_chance = {
			factor = 40
			modifier = { NOT = { opinion = { who = FROM value = 0 } } factor = 1.5 }
			modifier = { NOT = { opinion = { who = FROM value = -20 } } factor = 1.5 }
			modifier = { NOT = { opinion = { who = FROM value = -40 } } factor = 1.5 }
			modifier = { OR = { trait = zealous trait = idolizer } factor = 5 }
			modifier = { OR = { trait = willful trait = stubborn } factor = 1.5 }
			modifier = { OR = { trait = cynical trait = curious } factor = 1.5 }
			modifier = { FROM = { NOT = { diplomacy = 8 } } factor = 1.5 }
			modifier = { FROM = { NOT = { diplomacy = 6 } } factor = 1.5 }
		}
	}
}

#They seemed to like the holy scripture!
character_event = {
	id = MNM.3432
	desc = EVTDESC_MNM_3432
	picture = GFX_evt_child_reading
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { 
		name = EVTOPTA_MNM_3432
		tooltip = { FROM = { add_prevs_secret_religion_trait_effect = yes } }
	}
}

#They were intrigued by the holy scripture
character_event = {
	id = MNM.3433
	desc = EVTDESC_MNM_3433
	picture = GFX_evt_child_reading
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { 
		name = EVTOPTA_MNM_3433
		tooltip = { FROM = { add_sympathy_for_prevs_true_religion_effect = yes } }
	}
}

#They weren't impressed...
character_event = {
	id = MNM.3434
	desc = EVTDESC_MNM_3434
	picture = GFX_evt_child_play
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	#Try anyway
	option = { 
		trigger = {
			OR = {
				trait = patient
				NOT = { has_character_modifier = out_of_patience }
			}
		}

		name = EVTOPTA_MNM_3434

		tooltip = {
			random_list = {
				60 = { #Success
					modifier = { mother = { character = ROOT } factor = 1.6 }
					modifier = { father = { character = ROOT } factor = 1.6 }
					modifier = { opinion = { who = ROOT value = 30 } factor = 1.5 }
					modifier = { opinion = { who = ROOT value = 50 } factor = 1.5 }
					modifier = { opinion = { who = ROOT value = 70 } factor = 1.6 }
					modifier = { OR = { trait = trusting trait = affectionate } factor = 2 }
					modifier = { OR = { trait = craven trait = timid } factor = 1.5 }
					modifier = { ROOT = { diplomacy = 10 } factor = 1.2 }
					modifier = { ROOT = { diplomacy = 12 } factor = 1.2 }
					modifier = { ROOT = { diplomacy = 14 } factor = 1.2 }
					modifier = { ROOT = { diplomacy = 16 } factor = 1.2 }
					modifier = { ROOT = { diplomacy = 18 } factor = 1.2 }

					FROM = { add_prevs_secret_religion_trait_effect = yes }		
				}
				40 = { #Fail
					modifier = { NOT = { opinion = { who = ROOT value = 0 } } factor = 1.5 }
					modifier = { NOT = { opinion = { who = ROOT value = -20 } } factor = 1.5 }
					modifier = { NOT = { opinion = { who = ROOT value = -40 } } factor = 1.5 }
					modifier = { OR = { trait = zealous trait = idolizer } factor = 5 }
					modifier = { OR = { trait = willful trait = stubborn } factor = 1.5 }
					modifier = { OR = { trait = cynical trait = curious } factor = 1.5 }
					modifier = { ROOT = { NOT = { diplomacy = 8 } } factor = 1.5 }
					modifier = { ROOT = { NOT = { diplomacy = 6 } } factor = 1.5 }

					FROM = {
						if = {
							limit = {
								NOT = { trait = zealous }
								NOT = { has_dlc = Zeus }
							}
							add_trait = zealous
						}
						if = {
							limit = {
								NOT = { trait = idolizer }
								has_dlc = Zeus
							}
							add_trait = idolizer
						}
						add_rival = ROOT
					}
				}
			}
		}

		if = {
			limit = { NOT = { trait = patient } }
			add_character_modifier = {
				name = out_of_patience 
				years = 3
			}
		}

		hidden_effect = {
			FROM = { character_event = { id = MNM.3435 days = 1 } }
		}

		ai_chance = { 
			factor = 20
			modifier = { any_child = { character = ROOT } factor = 5 }
			modifier = { current_heir = { character = ROOT } factor = 5 }
		}
	}

	#Let it be
	option = {
		name = EVTOPTB_MNM_3434

		ai_chance = { 
			factor = 80
		}
	}
}

#They're trying to force the scripture on me again
character_event = {
	id = MNM.3435
	desc = EVTDESC_MNM_3435
	picture = GFX_evt_child_reading
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_MNM_3435

		FROM = { ROOT = { add_prevs_secret_religion_trait_effect = yes } }

		hidden_effect = { FROM = { character_event = { id = MNM.3436 days = 14 } } }

		ai_chance = {
			factor = 60
			modifier = { mother = { character = FROM } factor = 1.6 }
			modifier = { father = { character = FROM } factor = 1.6 }
			modifier = { opinion = { who = FROM value = 30 } factor = 1.5 }
			modifier = { opinion = { who = FROM value = 50 } factor = 1.5 }
			modifier = { opinion = { who = FROM value = 70 } factor = 1.6 }
			modifier = { OR = { trait = trusting trait = affectionate } factor = 2 }
			modifier = { OR = { trait = craven trait = timid } factor = 1.5 }
			modifier = { FROM = { diplomacy = 10 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 12 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 14 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 16 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 18 } factor = 1.2 }
			modifier = {
				factor = 2
				FROM = { has_focus = focus_theology }
			}
		}
	}

	option = {
		name = EVTOPTB_MNM_3435

		if = {
			limit = {
				NOT = { trait = zealous }
				NOT = { has_dlc = Zeus }
			}
			add_trait = zealous
		}
		if = {
			limit = {
				NOT = { trait = idolizer }
				has_dlc = Zeus
			}
			add_trait = idolizer
		}

		add_rival = FROM

		hidden_effect = { FROM = { character_event = { id = MNM.3437 days = 14 } } }

		ai_chance = {
			factor = 60
			modifier = { mother = { character = FROM } factor = 1.6 }
			modifier = { father = { character = FROM } factor = 1.6 }
			modifier = { opinion = { who = FROM value = 30 } factor = 1.5 }
			modifier = { opinion = { who = FROM value = 50 } factor = 1.5 }
			modifier = { opinion = { who = FROM value = 70 } factor = 1.6 }
			modifier = { OR = { trait = trusting trait = affectionate } factor = 2 }
			modifier = { OR = { trait = craven trait = timid } factor = 1.5 }
			modifier = { FROM = { diplomacy = 10 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 12 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 14 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 16 } factor = 1.2 }
			modifier = { FROM = { diplomacy = 18 } factor = 1.2 }
		}
	}
}

#It worked out, in the end!
character_event = {
	id = MNM.3436
	desc = EVTDESC_MNM_3436
	picture = GFX_evt_child_reading
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { 
		name = EVTOPTA_MNM_3436
		tooltip = { FROM = { add_prevs_secret_religion_trait_effect = yes } }
	}
}

#I failed and now they are zealous
character_event = {
	id = MNM.3437
	desc = EVTDESC_MNM_3437
	picture = GFX_evt_child_sword
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = { 
		name = EVTOPTA_MNM_3412
		tooltip = {
			FROM  =	{
				if = {
					limit = {
						NOT = { trait = zealous }
						NOT = { has_dlc = Zeus }
					}
					add_trait = zealous
				}
				if = {
					limit = {
						NOT = { trait = idolizer }
						has_dlc = Zeus
					}
					add_trait = idolizer
				}

				add_rival = ROOT
			}
		}
	}
}

#Parent/educator/guardian ping event for the decision
character_event = {
	id = MNM.3438
	hide_window = yes
	is_triggered_only = yes
	immediate = { FROM = { character_event = { id = MNM.3431 } } }
}

# personally_openly_adopt_faith - inform liege
character_event = {
	id = MNM.3840
	desc = EVTDESC_MNM_3840
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3840
	}
}

# prepare_grounds - safety flag clear
character_event = {
	id = MNM.3849
	hide_window = yes
	is_triggered_only = yes
	immediate = { clr_character_flag = preparing_grounds_in_province }
}

# prepare_grounds - Start progress
character_event = {
	id = MNM.3850
	desc = EVTDESC_MNM_3850
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3850
		custom_tooltip = {
			text = EVTTOOLTIP_MNM_3850
			hidden_effect = {
				random_list = {
					10 = { # easy conversion
						modifier = {
							factor = 0.1
							event_target:target_province = {
								holder_scope = {
									NOT = {
										character = ROOT
									}
								}
							}
						}
						modifier = {
							factor = 1.1
							diplomacy = 12
						}
						modifier = {
							factor = 1.1
							diplomacy = 14
						}
						modifier = {
							factor = 1.1
							diplomacy = 16
						}
						modifier = {
							factor = 1.1
							diplomacy = 18
						}
						modifier = {
							factor = 1.1
							diplomacy = 20
						}
						
						if = {
							limit = {
								event_target:target_province = {
									holder_scope = {
										NOT = {
											character = ROOT
										}
									}
								}
							}
							character_event = { id = MNM.3860 days = 500 random = 50 }
						}
						if = {
							limit = {
								event_target:target_province = {
									holder_scope = {
										character = ROOT
									}
								}
							}
							character_event = { id = MNM.3860 days = 300 random = 50 }
						}
					}
					30 = { # conversion going well
						modifier = {
							factor = 0.2
							event_target:target_province = {
								holder_scope = {
									NOT = {
										character = ROOT
									}
								}
							}
						}
						modifier = {
							factor = 1.1
							diplomacy = 12
						}
						modifier = {
							factor = 1.1
							diplomacy = 14
						}
						modifier = {
							factor = 1.1
							diplomacy = 16
						}
						modifier = {
							factor = 1.1
							diplomacy = 18
						}
						modifier = {
							factor = 1.1
							diplomacy = 20
						}
						
						if = {
							limit = {
								event_target:target_province = {
									holder_scope = {
										NOT = {
											character = ROOT
										}
									}
								}
							}
							character_event = { id = MNM.3870 days = 500 random = 50 }
						}
						if = {
							limit = {
								event_target:target_province = {
									holder_scope = {
										character = ROOT
									}
								}
							}
							character_event = { id = MNM.3870 days = 300 random = 50 }
						}
					}
					60 = { # conversion struggle
						if = {
							limit = {
								event_target:target_province = {
									holder_scope = {
										character = ROOT
									}
								}
							}
							random_list = {
								50 = {
									event_target:target_province = {
										set_province_flag = fail_conversion_flag
									}
								}
								50 = {
									# there's still a chance for conversion to be successful
								}
							}
							character_event = { id = MNM.3880 days = 300 random = 50 }
						}
					}
				}
			}
		}
		character_event = { id = MNM.3859 days = 30 }
	}
}

character_event = {
	id = MNM.3858
	desc = EVTDESC_MNM_3858
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3858
		clear_delayed_event = { id = MNM.3849 }
		clear_delayed_event = { id = MNM.3859 }
		clr_character_flag = preparing_grounds_in_province
	}
}

character_event = {
	id = MNM.3859
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				event_target:target_province = {
					county = {
						holder_scope = {
							NOT = { 
								same_realm = ROOT
							}
						}
					}
				}
			}
			clear_delayed_event = { id = MNM.3860 }
			clear_delayed_event = { id = MNM.3870 }
			clear_delayed_event = { id = MNM.3880 }
			clear_delayed_event = { id = MNM.3890 }
			character_event = { id = MNM.3858 }
			break = yes
		}
		repeat_event = { id = MNM.3859 days = 30 }
	}
}

character_event = {
	id = MNM.3860
	desc = EVTDESC_MNM_3860
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3860
		hidden_effect = {
			character_event = { id = MNM.3890 days = 150 random = 50 }
		}
	}
}

character_event = {
	id = MNM.3870
	desc = EVTDESC_MNM_3870
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3870
		hidden_effect = {
			character_event = { id = MNM.3890 days = 350 random = 50 }
		}
	}
}

character_event = {
	id = MNM.3880
	desc = EVTDESC_MNM_3880
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3880
		scaled_wealth = {
			value = -0.3
			min = -50
			max = -250
		}
		trigger = {
			event_target:target_province = {
				has_province_flag = fail_conversion_flag
			}
		}
		hidden_effect = {
			character_event = { id = MNM.3890 days = 450 random = 50 }
		}
	}
	
	option = {
		name = EVTOPTB_MNM_3880
		hidden_effect = {
			clear_delayed_event = { id = MNM.3859 }
			clear_delayed_event = { id = MNM.3849 }
			clr_character_flag = preparing_grounds_in_province
			event_target:target_province = {
				clr_province_flag = fail_conversion_flag
			}
		}
	}
}

character_event = {
	id = MNM.3890
	desc = EVTDESC_MNM_3890
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3890
		trigger_switch = {
			on_trigger = secret_religion
			catholic = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_catholic_community
						duration = -1
					} 
				}
			}
			cathar = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_cathar_community
						duration = -1
					} 
				}
			}
			fraticelli = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_fraticelli_community
						duration = -1
					} 
				}
			}
			waldensian = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_waldensian_community
						duration = -1
					} 
				}
			}
			lollard = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_lollard_community
						duration = -1
					} 
				}
			}
			adoptionist = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_adoptionist_community
						duration = -1
					} 
				}
			}
			chalcedonian = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_chalcedonian_community
						duration = -1
					} 
				}
			}
			orthodox = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_orthodox_community
						duration = -1
					} 
				}
			}
			miaphysite = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_miaphysite_community
						duration = -1
					} 
				}
			}
			monophysite = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_monophysite_community
						duration = -1
					} 
				}
			}
			bogomilist = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_bogomilist_community
						duration = -1
					} 
				}
			}
			monothelite = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_monothelite_community
						duration = -1
					} 
				}
			}
			iconoclast = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_iconoclast_community
						duration = -1
					} 
				}
			}
			paulician = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_paulician_community
						duration = -1
					} 
				}
			}
			nestorian = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_nestorian_community
						duration = -1
					} 
				}
			}
			messalian = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_messalian_community
						duration = -1
					} 
				}
			}
			apostolic = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_apostolic_community
						duration = -1
					} 
				}
			}
			tondrakian = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_tondrakian_community
						duration = -1
					} 
				}
			}
			manichean = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_manichean_community
						duration = -1
					} 
				}
			}
			sunni = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_sunni_community
						duration = -1
					} 
				}
			}
			quranist = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_quranist_community
						duration = -1
					} 
				}
			}
			zikri = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_zikri_community
						duration = -1
					} 
				}
			}
			yazidi = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_yazidi_community
						duration = -1
					} 
				}
			}
			ibadi = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_ibadi_community
						duration = -1
					} 
				}
			}
			kharijite = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_kharijite_community
						duration = -1
					} 
				}
			}
			shiite = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_shiite_community
						duration = -1
					} 
				}
			}
			bektashi = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_bektashi_community
						duration = -1
					} 
				}
			}
			druze = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_druze_community
						duration = -1
					} 
				}
			}
			hurufi = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_hurufi_community
						duration = -1
					} 
				}
			}
			qarmatian = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_qarmatian_community
						duration = -1
					} 
				}
			}
			jewish = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_jewish_community
						duration = -1
					} 
				}
			}
			karaite = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_karaite_community
						duration = -1
					} 
				}
			}
			samaritan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_samaritan_community
						duration = -1
					} 
				}
			}
			zoroastrian = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_zoroastrian_community
						duration = -1
					} 
				}
			}
			zurvanist = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_zurvanist_community
						duration = -1
					} 
				}
			}
			mazdaki = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_mazdaki_community
						duration = -1
					}
				}
			}
			mandaean = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_mandaean_community
						duration = -1
					}
				}
			}
			taoist = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_taoist_community
						duration = -1
					} 
				}
			}
			khurmazta = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_khurmazta_community
						duration = -1
					} 
				}
			}
			bon = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_bon_community
						duration = -1
					} 
				}
			}
			tibetan_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_tibetan_pagan_community
						duration = -1
					} 
				}
			}
			hindu = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_hindu_community
						duration = -1
					} 
				}
			}
			buddhist = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_buddhist_community
						duration = -1
					} 
				}
			}
			jain = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_jain_community
						duration = -1
					} 
				}
			}
			norse_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_norse_pagan_reformed_community
						duration = -1
					} 
				}
			}
			german_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_german_pagan_reformed_community
						duration = -1
					} 
				}
			}
			celtic_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_celtic_pagan_reformed_community
						duration = -1
					} 
				}
			}
			baltic_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_baltic_pagan_reformed_community
						duration = -1
					} 
				}
			}
			finnish_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_finnish_pagan_reformed_community
						duration = -1
					} 
				}
			}
			slavic_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_slavic_pagan_reformed_community
						duration = -1
					} 
				}
			}
			tengri_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_tengri_pagan_reformed_community
						duration = -1
					} 
				}
			}
			west_african_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_west_african_pagan_reformed_community
						duration = -1
					} 
				}
			}
			zun_pagan_reformed = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_zun_pagan_reformed_community
						duration = -1
					} 
				}
			}
			norse_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_norse_pagan_community
						duration = -1
					} 
				}
			}
			german_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_german_pagan_community
						duration = -1
					} 
				}
			}
			celtic_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_celtic_pagan_community
						duration = -1
					} 
				}
			}
			baltic_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_baltic_pagan_community
						duration = -1
					} 
				}
			}
			finnish_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_finnish_pagan_community
						duration = -1
					} 
				}
			}
			slavic_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_slavic_pagan_community
						duration = -1
					} 
				}
			}
			tengri_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_tengri_pagan_community
						duration = -1
					} 
				}
			}
			west_african_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_west_african_pagan_community
						duration = -1
					} 
				}
			}
			zun_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_zun_pagan_community
						duration = -1
					} 
				}
			}
			aztec = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_aztec_community
						duration = -1
					} 
				}
			}
			roman_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_roman_pagan_community
						duration = -1
					} 
				}
			}
			hellenic_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_hellenic_pagan_community
						duration = -1
					} 
				}
			}
			promethean_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_promethean_pagan_community
						duration = -1
					} 
				}
			}
			egyptian_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_egyptian_pagan_community
						duration = -1
					} 
				}
			}
			aten_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_aten_pagan_community
						duration = -1
					} 
				}
			}
			arab_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_arab_pagan_community
						duration = -1
					} 
				}
			}
			berber_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_berber_pagan_community
						duration = -1
					} 
				}
			}
			jewish_pagan = { 
				event_target:target_province = { 
					add_province_modifier = { 
						name = secret_jewish_pagan_community
						duration = -1
					} 
				}
			}
		}

		clear_delayed_event = { id = MNM.3849 }
		clr_character_flag = preparing_grounds_in_province
		
		hidden_effect = {
			clear_delayed_event = { id = MNM.3859 }
		}
	}
}

#Character gets option to secretly keep old religion
character_event = {
	id = MNM.3949
	desc = EVTDESC_MNM_3949
	picture = GFX_evt_uncomfortable
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	hide_from = yes
	
	trigger = {
		has_secret_religion_trait_trigger = no
		has_any_char_old_religion = yes
	}

	immediate = {
		event_target_old_religion_from_flag_effect = yes
		FROM = { FROMFROM = { save_event_target_as = demander } }
	}

	option = {
		name = EVTOPTA_MNM_3949
		ai_chance = {
			factor = 50
			modifier = {
				trait = zealous 
				factor = 1.5
			}
			modifier = {
				trait = brave 
				factor = 1.5
			}
			modifier = {
				OR = {
					AND = {
						has_character_flag = character_was_chalcedonian
						liege = { secret_religion = chalcedonian }
					}
					AND = {
						has_character_flag = character_was_catholic
						liege = { secret_religion = catholic }
					}
					AND = {
						has_character_flag = character_was_cathar
						liege = { secret_religion = cathar }
					}
					AND = {
						has_character_flag = character_was_fraticelli
						liege = { secret_religion = fraticelli }
					}
					AND = {
						has_character_flag = character_was_waldensian
						liege = { secret_religion = waldensian }
					}
					AND = {
						has_character_flag = character_was_lollard
						liege = { secret_religion = lollard }
					}
					AND = {
						has_character_flag = character_was_adoptionist
						liege = { secret_religion = adoptionist }
					}
					AND = {
						has_character_flag = character_was_orthodox
						liege = { secret_religion = orthodox }
					}
					AND = {
						has_character_flag = character_was_miaphysite
						liege = { secret_religion = miaphysite }
					}
					AND = {
						has_character_flag = character_was_monophysite
						liege = { secret_religion = monophysite }
					}
					AND = {
						has_character_flag = character_was_bogomilist
						liege = { secret_religion = bogomilist }
					}
					AND = {
						has_character_flag = character_was_monothelite
						liege = { secret_religion = monothelite }
					}
					AND = {
						has_character_flag = character_was_iconoclast
						liege = { secret_religion = iconoclast }
					}
					AND = {
						has_character_flag = character_was_paulician
						liege = { secret_religion = paulician }
					}
					AND = {
						has_character_flag = character_was_nestorian
						liege = { secret_religion = nestorian }
					}
					AND = {
						has_character_flag = character_was_messalian
						liege = { secret_religion = messalian }
					}
					AND = {
						has_character_flag = character_was_sunni
						liege = { secret_religion = sunni }
					}
					AND = {
						has_character_flag = character_was_zikri
						liege = { secret_religion = zikri }
					}
					AND = {
						has_character_flag = character_was_quranist
						liege = { secret_religion = quranist }
					}
					AND = {
						has_character_flag = character_was_yazidi
						liege = { secret_religion = yazidi }
					}
					AND = {
						has_character_flag = character_was_ibadi
						liege = { secret_religion = ibadi }
					}
					AND = {
						has_character_flag = character_was_kharijite
						liege = { secret_religion = kharijite }
					}
					AND = {
						has_character_flag = character_was_shiite
						liege = { secret_religion = shiite }
					}
					AND = {
						has_character_flag = character_was_bektashi
						liege = { secret_religion = bektashi }
					}
					AND = {
						has_character_flag = character_was_druze
						liege = { secret_religion = druze }
					}
					AND = {
						has_character_flag = character_was_hurufi
						liege = { secret_religion = hurufi }
					}
					AND = {
						has_character_flag = character_was_qarmatian
						liege = { secret_religion = qarmatian }
					}
					AND = {
						has_character_flag = character_was_jewish
						liege = { secret_religion = jewish }
					}
					AND = {
						has_character_flag = character_was_karaite
						liege = { secret_religion = karaite }
					}
					AND = {
						has_character_flag = character_was_samaritan
						liege = { secret_religion = samaritan }
					}
					AND = {
						has_character_flag = character_was_zoroastrian
						liege = { secret_religion = zoroastrian }
					}
					AND = {
						has_character_flag = character_was_zurvanist
						liege = { secret_religion = zurvanist }
					}
					AND = {
						has_character_flag = character_was_mazdaki
						liege = { secret_religion = mazdaki }
					}
					AND = {
						has_character_flag = character_was_manichean
						liege = { secret_religion = manichean }
					}
					AND = {
						has_character_flag = character_was_mandaean
						liege = { secret_religion = mandaean }
					}
					AND = {
						has_character_flag = character_was_hindu
						liege = { secret_religion = hindu }
					}
					AND = {
						has_character_flag = character_was_buddhist
						liege = { secret_religion = buddhist }
					}
					AND = {
						has_character_flag = character_was_jain
						liege = { secret_religion = jain }
					}
					AND = {
						has_character_flag = character_was_norse_pagan_reformed
						liege = { secret_religion = norse_pagan_reformed }
					}
					AND = {
						has_character_flag = character_was_german_pagan_reformed
						liege = { secret_religion = german_pagan_reformed }
					}
					AND = {
						has_character_flag = character_was_celtic_pagan_reformed
						liege = { secret_religion = celtic_pagan }
					}
					AND = {
						has_character_flag = character_was_slavic_pagan_reformed
						liege = { secret_religion = slavic_pagan_reformed }
					}
					AND = {
						has_character_flag = character_was_tengri_pagan_reformed
						liege = { secret_religion = tengri_pagan_reformed }
					}
					AND = {
						has_character_flag = character_was_baltic_pagan_reformed
						liege = { secret_religion = baltic_pagan_reformed }
					}
					AND = {
						has_character_flag = character_was_finnish_pagan_reformed
						liege = { secret_religion = finnish_pagan_reformed }
					}
					AND = {
						has_character_flag = character_was_west_african_pagan_reformed
						liege = { secret_religion = west_african_pagan_reformed }
					}
					AND = {
						has_character_flag = character_was_zun_pagan_reformed
						liege = { secret_religion = zun_pagan_reformed }
					}
					 AND = {
						has_character_flag = character_was_norse_pagan
						liege = { secret_religion = norse_pagan }
					}
					AND = {
						has_character_flag = character_was_german_pagan
						liege = { secret_religion = german_pagan }
					}
					AND = {
						has_character_flag = character_was_celtic_pagan
						liege = { secret_religion = celtic_pagan }
					}
					AND = {
						has_character_flag = character_was_slavic_pagan
						liege = { secret_religion = slavic_pagan }
					}
					AND = {
						has_character_flag = character_was_tengri_pagan
						liege = { secret_religion = tengri_pagan }
					}
					AND = {
						has_character_flag = character_was_baltic_pagan
						liege = { secret_religion = baltic_pagan }
					}
					AND = {
						has_character_flag = character_was_finnish_pagan
						liege = { secret_religion = finnish_pagan }
					}
					AND = {
						has_character_flag = character_was_west_african_pagan
						liege = { secret_religion = west_african_pagan }
					}
					AND = {
						has_character_flag = character_was_zun_pagan
						liege = { secret_religion = zun_pagan }
					}
					AND = {
						has_character_flag = character_was_aztec
						liege = { secret_religion = aztec }
					}
					AND = {
						has_character_flag = character_was_roman_pagan
						liege = { secret_religion = roman_pagan }
					}
					AND = {
						has_character_flag = character_was_egyptian_pagan
						liege = { secret_religion = egyptian_pagan }
					}
					AND = {
						has_character_flag = character_was_promethean_pagan
						liege = { secret_religion = promethean_pagan }
					}
					AND = {
						has_character_flag = character_was_aten_pagan
						liege = { secret_religion = aten_pagan }
					}
					AND = {
						has_character_flag = character_was_arab_pagan
						liege = { secret_religion = arab_pagan }
					}
					AND = {
						has_character_flag = character_was_berber_pagan
						liege = { secret_religion = berber_pagan }
					}
					AND = {
						has_character_flag = character_was_jewish_pagan
						liege = { secret_religion = jewish_pagan }
					}
				}
				factor = 500
			}
		}
		add_secret_religion_trait_trigger_is_religion_or_old_religion_flag_clear_flag_after_effect_is_run_this_name_is_a_tribute_to_m_effect = yes
		custom_tooltip = { text = EVTOPTA_MNM_3949_TT }
	}

	option = {
		name = EVTOPTB_MNM_3949
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.3
				trait = craven 
			}
		}
		custom_tooltip = { text = EVTOPTB_MNM_3949_TT }
	}	
}

# Secret religion - Member thinks it's too stressful to keep practising their secret religion.
character_event = {
	id = MNM.3920
	desc = EVTDESC_MNM_3920
	picture = "GFX_evt_uncomfortable"
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	capable_only = yes
	only_playable = yes
	
	trigger = {
		has_secret_religion = yes
		block_general_event_trigger = no
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 0.05
			ai = yes
		}
	}
	
	immediate = {
		# Find a suitable person
		any_realm_character = {
			limit = {
				ai = yes
				NOT = { character = ROOT }
				same_realm = ROOT
				OR = {
					trait = paranoid
					trait = stressed
				}
				secret_religion = { target_type = secret target = ROOT }
				is_within_diplo_range = ROOT
			}
			save_event_target_as = worried_secret_member
			if = {
				limit = {
					NOT = { event_target:worried_secret_member = { always = yes } }
				}
				any_courtier_or_vassal = {
					limit = {
						ai = yes
						NOT = { character = ROOT }
						same_realm = ROOT
						secret_religion = { target_type = secret target = ROOT }
						is_within_diplo_range = ROOT
					}
					save_event_target_as = worried_secret_member
				}
			}
			if = {
				limit = {
					NOT = { event_target:worried_secret_member = { always = yes } }
				}
				any_realm_character = {
					limit = {
						ai = yes
						NOT = { character = ROOT }
						secret_religion = { target_type = secret target = ROOT }
						OR = {
							trait = paranoid
							trait = stressed
						}
						
						is_within_diplo_range = ROOT
					}
					save_event_target_as = worried_secret_member
				}
			}
			if = {
				limit = {
					NOT = { event_target:worried_secret_member = { always = yes } }
				}
				any_realm_character = {
					limit = {
						ai = yes
						NOT = { character = ROOT }
						secret_religion = { target_type = secret target = ROOT }
						
						is_within_diplo_range = ROOT
					}
					save_event_target_as = worried_secret_member
				}
			}
		}
	}
	
	option = { # Try to convince by talking about solidarity
		name = EVTOPTA_MNM_3920
		hidden_effect = {
			random_list = {
				40 = { # Success
					modifier = {
						factor = 1.3
						diplomacy = 9
					}
					modifier = {
						factor = 1.3
						diplomacy = 11
					}
					modifier = {
						factor = 1.3
						diplomacy = 13
					}
					modifier = {
						factor = 1.3
						diplomacy = 15
					}
					modifier = {
						factor = 1.3
						diplomacy = 17
					}
					modifier = {
						factor = 1.3
						diplomacy = 19
					}
					modifier = {
						factor = 2
						event_target:worried_secret_member = { trait = charitable }
					}
					modifier = {
						factor = 2
						event_target:worried_secret_member = { trait = kind }
					}
					modifier = {
						factor = 2
						event_target:worried_secret_member = { trait = honest }
					}
					modifier = {
						factor = 0.5
						event_target:worried_secret_member = { trait = craven }
					}
					modifier = {
						factor = 0.5
						event_target:worried_secret_member = { trait = cynical }
					}
					
					set_character_flag = solidarity_success
				}
				20 = { # Failure
					modifier = { # ai can't deem what would be a good choice
						factor = 0.5
						ai = yes
					}
					set_character_flag = solidarity_failure
				}
			}
			character_event = { id = MNM.3921 days = 14 }
		}
	}
	
	option = { # Try to convince by talking about devotion
		name = EVTOPTB_MNM_3920
		hidden_effect = {
			random_list = {
				40 = { # Success
					modifier = {
						factor = 1.3
						diplomacy = 9
					}
					modifier = {
						factor = 1.3
						diplomacy = 11
					}
					modifier = {
						factor = 1.3
						diplomacy = 13
					}
					modifier = {
						factor = 1.3
						diplomacy = 15
					}
					modifier = {
						factor = 1.3
						diplomacy = 17
					}
					modifier = {
						factor = 1.3
						diplomacy = 19
					}
					modifier = {
						factor = 2
						event_target:worried_secret_member = { trait = patient }
					}
					modifier = {
						factor = 2
						event_target:worried_secret_member = { trait = diligent }
					}
					modifier = {
						factor = 2
						event_target:worried_secret_member = { trait = brave }
					}
					modifier = {
						factor = 0.5
						event_target:worried_secret_member = { trait = paranoid }
					}
					modifier = {
						factor = 0.5
						event_target:worried_secret_member = { trait = arbitrary }
					}
					
					set_character_flag = devotion_success
				}
				20 = { # Failure
					modifier = { # ai can't deem what would be a good choice
						factor = 0.5
						ai = yes
					}
					set_character_flag = devotion_failure
				}
			}
			character_event = { id = MNM.3921 days = 14 }
		}
	}
	
	option = { # Use smooth talking to calm her
		name = EVTOPTC_MNM_3920
		trigger = {
			trait = gregarious
		}
		tooltip_info = gregarious
		
		hidden_effect = {
			set_character_flag = gregarious_success
			character_event = { id = MNM.3921 days = 14 }
		}
	}
	
	option = { # She is free to leave if she feels that way
		name = EVTOPTD_MNM_3920
		event_target:worried_secret_member = {
			clear_secret_religion = yes
		}
	}
}

character_event = {
	id = MNM.3921
	picture = "GFX_evt_uncomfortable"
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes

	trigger = { has_secret_religion = yes }
	
	desc = {
		text = EVTDESC_MNM_3921_A
		trigger = { has_character_flag = solidarity_success }
	}
	desc = {
		text = EVTDESC_MNM_3921_B
		trigger = { has_character_flag = solidarity_failure }
	}
	desc = {
		text = EVTDESC_MNM_3921_C
		trigger = { has_character_flag = devotion_success }
	}
	desc = {
		text = EVTDESC_MNM_3921_D
		trigger = { has_character_flag = devotion_failure }
	}
	desc = {
		text = EVTDESC_MNM_3921_E
		trigger = { has_character_flag = gregarious_success }
	}
	
	option = {
		name = EVTOPTA_MNM_3921
		trigger = {
			OR = {
				has_character_flag = solidarity_success
				has_character_flag = devotion_success
				has_character_flag = gregarious_success
			}
		}
		if = {
			limit = {
				has_character_flag = gregarious_success
				event_target:worried_secret_member = {
					trait = paranoid
				}
			}
			event_target:worried_secret_member = {
				remove_trait = paranoid
			}
		}
		if = {
			limit = {
				has_character_flag = gregarious_success
				event_target:worried_secret_member = {
					trait = stressed
				}
			}
			event_target:worried_secret_member = {
				remove_trait = stressed
			}
		}
	}
	
	option = {
		name = EVTOPTB_MNM_3921
		trigger = {
			NOR = {
				has_character_flag = solidarity_success
				has_character_flag = devotion_success
				has_character_flag = gregarious_success
			}
		}
		event_target:worried_secret_member = {
			clear_secret_religion = yes
		}
	}

    after = {
        clr_character_flag = solidarity_success
        clr_character_flag = solidarity_failure
        clr_character_flag = devotion_success
        clr_character_flag = devotion_failure
        clr_character_flag = gregarious_success
    }
}

### Secret religions - commission painting
character_event = {
	id = MNM.3910
	desc = EVTDESC_MNM_3910
	picture = GFX_evt_dharmic_pilgrims
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	
	only_playable = yes
	
	trigger = {
		NOT = { has_character_flag = commissioned_painting }
		block_general_event_trigger = no
		OR = {
			NOT = { has_secret_religion = yes }
			any_realm_character = {
				NOT = { character = ROOT }
				secret_religion = { target_type = secret target = ROOT }
			}
		}
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 0.05
			NOT = { has_secret_religion = yes }
		}
	}
	
	immediate = {
		set_character_flag = commissioned_painting
	}
	
	option = {
		name = EVTOPTA_MNM_3910
		
		scaled_wealth = {
			value = -0.3
			min = -25
			max = -125
		}
		hidden_effect = {
			character_event = { id = MNM.3911 days = 60 random = 20 }
		}
	}
	
	option = {
		name = EVTOPTB_MNM_3910
	}
}

# Add hidden religious symbols to the painting?
character_event = {
	id = MNM.3911
	desc = EVTDESC_MNM_3911
	picture = GFX_evt_dharmic_pilgrims
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = { # Ask artist to add symbols
		name = EVTOPTA_MNM_3911
		trigger = {
			has_secret_religion = yes
		}
		
		scaled_wealth = {
			value = -0.05
			min = -5
			max = -30
		}
		if = {
			limit = { random = 50 }
			custom_tooltip = {
				text = EVTTOOLTIPA_MNM_3911_FEMALE
				random_list = {
					95 = {
						hidden_effect = {
							character_event = { id = MNM.3912 days = 25 random = 5 }
						}
					}
					5 = {
						add_character_modifier = {
							modifier = unfaithful_rumors
							years = 3
						}
						scaled_wealth = {
							value = -0.05
							min = -5
							max = -30
						}
					}
				}
			}
		}
		if = {
			limit = { NOT = { random = 50 } }
			custom_tooltip = {
				text = EVTTOOLTIPA_MNM_3911_MALE
				random_list = {
					95 = {
						hidden_effect = {
							character_event = { id = MNM.3912 days = 25 random = 5 }
						}
					}
					5 = {
						add_character_modifier = {
							modifier = unfaithful_rumors
							years = 3
						}
						scaled_wealth = {
							value = -0.05
							min = -5
							max = -30
						}
					}
				}
			}
		}
	}
	
	option = { # Add symbols yourself
		name = EVTOPTB_MNM_3911
		trigger = {
			has_secret_religion = yes
		}
		
		custom_tooltip = {
			text = EVTTOOLTIPB_MNM_3911
			hidden_effect = {
				random_list = {
					60 = { # Success
						character_event = { id = MNM.3912 days = 35 random = 10 }
					}
					40 = { # Avant Garde
						character_event = { id = MNM.3914 days = 35 random = 10 }
					}
				}
			}
		}
	}
	
	option = { # Keep as is
		name = EVTOPTC_MNM_3911
		add_artifact = magnificent_painting
	}
}

character_event = {
	id = MNM.3912
	desc = EVTDESC_MNM_3912
	picture = GFX_evt_ritual_scroll
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		any_courtier_or_vassal = {
			limit = {
				NOT = { character = ROOT }
				same_realm = ROOT
				secret_religion = { target_type = secret target = ROOT }
			}
			save_event_target_as = society_art_observer
			if = {
				limit = {
					NOT = { event_target:society_art_observer = { always = yes } }
				}
				any_realm_character = {
					limit = {
						NOT = { character = ROOT }
						same_realm = ROOT
						secret_religion = { target_type = secret target = ROOT }
					}
					save_event_target_as = society_art_observer
				}
			}
		}
	}
	
	option = {
		name = EVTOPTA_3912
		add_artifact = magnificent_painting
		
		event_target:society_art_observer = {
			opinion = {
				who = ROOT
				modifier = opinion_budding_friendship
				years = 10
			}
			reverse_opinion = {
				who = ROOT
				modifier = opinion_budding_friendship
				years = 10
			}
		}
	}
}

character_event = {
	id = MNM.3914
	desc = EVTDESC_MNM_3914
	picture = GFX_evt_ritual_scroll
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_3914
		add_artifact = avant_garde_painting
	}
	
	option = {
		name = EVTOPTB_3914
		prestige = -100
	}
}

### Fellow society member asks you to go for a round of drinks
character_event = {
	id = MNM.3930
	desc = EVTDESC_MNM_3930
	picture = GFX_evt_brothel
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	capable_only = yes
	only_playable = yes
	
	trigger = {
		block_general_event_trigger = no
		has_secret_religion = yes
		
		any_courtier_or_vassal = {
			ai = yes
			NOT = { character = ROOT }
			same_realm = ROOT
			secret_religion = { target_type = secret target = ROOT }
		}
	}
	
	immediate = {
		any_courtier_or_vassal = {
			limit = {
				NOT = { character = ROOT }
				ai = yes
				same_realm = ROOT
				secret_religion = { target_type = secret target = ROOT }
			}
			save_event_target_as = society_character
			if = {
				limit = { NOT = { event_target:society_character = { always = yes } } }				
				any_realm_character = {
					limit = {
						NOT = {	character = ROOT }
						ai = yes
						secret_religion = { target_type = secret target = ROOT }
					}
					save_event_target_as = society_character
				}
			}
		}
	}
	
	option = { # Of course
		name = EVTOPTA_3930
		custom_tooltip = {
			text = EVTTOOLTIP_MNM_3930
			hidden_effect = {
				event_target:society_character = {
					character_event = { id = MNM.3931 }
				}
			}
		}
	}
	
	option = { # I don't have time for that
		name = EVTOPTB_3930
	}
}

character_event = {
	id = MNM.3931
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			character_event = { id = MNM.3932 days = 21 random = 7 }
		}
	}
}

# Argument with local
character_event = {
	id = MNM.3932
	desc = EVTDESC_MNM_3932
	picture = GFX_evt_brothel
	border = GFX_event_normal_frame_religion
	is_triggered_only = yes
	
	trigger = { has_secret_religion = yes }

	
	option = { # diplomatically calm the situation
		name = EVTOPTA_MNM_3932
		custom_tooltip = {
			text = EVTTOOLTIPA_MNM_3932
			hidden_effect = {
				character_event = { id = MNM.3933 days = 7 }
			}
		}
	}
	
	option = { # fight the local
		name = EVTOPTB_MNM_3932
		custom_tooltip = {
			text = EVTTOOLTIPB_MNM_3932
			hidden_effect = {
				character_event = { id = MNM.3934 days = 7 }
			}
		}
	}
}

character_event = {
	id = MNM.3933
	desc = {
		text = EVTDESC_MNM_3933_SUCCESS
		trigger = {
			has_character_flag = sr_bar_fight_success
		}
	}
	desc = {
		text = EVTDESC_MNM_3933_FAILURE
		trigger = {
			NOT = { has_character_flag = sr_bar_fight_success }
		}
	}
	picture = GFX_evt_brothel
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		random_list = { # Diplomacy check
			30 = { # success
				modifier = {
					factor = 1.3
					diplomacy = 7
				}
				modifier = {
					factor = 1.3
					diplomacy = 9
				}
				modifier = {
					factor = 1.3
					diplomacy = 11
				}
				modifier = {
					factor = 1.3
					diplomacy = 13
				}
			
			
				set_character_flag = sr_bar_fight_success
			}
			70 = { # failure
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_3933
		trigger = {
			has_character_flag = sr_bar_fight_success
		}
		
		add_character_modifier = {
			modifier = mediator
			years = 2
		}
	}
	
	option = {
		name = EVTOPTB_MNM_3933
		trigger = {
			NOT = { has_character_flag = sr_bar_fight_success }
		}
		
		if = {
			limit = {
				OR = {
					trait = wounded
					trait = maimed
				}
			}
			prestige = -50
		}
		if = {
			limit = {
				NOR = {
					trait = wounded
					trait = maimed
				}
			}
			add_trait = wounded
		}
		event_target:society_character = {
			if = {
				limit = {
					OR = {
						trait = wounded
						trait = maimed
					}
				}
				prestige = -50
			}
			if = {
				limit = {
					NOR = {
						trait = wounded
						trait = maimed
					}
				}
				add_trait = wounded
			}
		}
		add_character_modifier = {
			modifier = bruised_knuckles
			months = 6
		}
	}
	
	after = {
		clr_character_flag = sr_bar_fight_success
		event_target:society_character = {
			opinion = {
				who = ROOT
				modifier = opinion_happy
				years = 5
			}
			hidden_effect = {
				reverse_opinion = {
					who = ROOT
					modifier = opinion_happy
					years = 5
				}
			}
		}
	}
}

character_event = {
	id = MNM.3934
	desc = {
		text = EVTDESC_MNM_3934_SUCCESS
		trigger = {
			has_character_flag = sr_bar_fight_success
		}
	}
	desc = {
		text = EVTDESC_MNM_3934_FAILURE
		trigger = {
			NOT = { has_character_flag = sr_bar_fight_success }
		}
	}
	picture = GFX_evt_brothel
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	immediate = {
		random_list = { # Martial check
			30 = { # success
				modifier = {
					factor = 1.3
					martial = 7
				}
				modifier = {
					factor = 1.3
					martial = 9
				}
				modifier = {
					factor = 1.3
					martial = 11
				}
				modifier = {
					factor = 1.3
					martial = 13
				}
			
				set_character_flag = sr_bar_fight_success
			}
			70 = { # failure
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_3934
		trigger = {
			has_character_flag = sr_bar_fight_success
		}

		increase_visibility_effect = yes
	}
	
	option = {
		name = EVTOPTB_MNM_3934
		trigger = {
			NOT = { has_character_flag = sr_bar_fight_success }
		}
		
		increase_visibility_effect = yes
		if = {
			limit = {
				OR = {
					trait = wounded
					trait = maimed
				}
			}
			prestige = -50
		}
		if = {
			limit = {
				NOR = {
					trait = wounded
					trait = maimed
				}
			}
			add_trait = wounded
		}
		event_target:society_character = {
			if = {
				limit = {
					OR = {
						trait = wounded
						trait = maimed
					}
				}
				prestige = -50
			}
			if = {
				limit = {
					NOR = {
						trait = wounded
						trait = maimed
					}
				}
				add_trait = wounded
			}
		}
	}
	
	after = {
		add_character_modifier = {
			modifier = bruised_knuckles
			months = 6
		}
		event_target:society_character = {
			opinion = {
				who = ROOT
				modifier = opinion_happy
				years = 5
			}
			hidden_effect = {
				reverse_opinion = {
					who = ROOT
					modifier = opinion_happy
					years = 5
				}
			}
		}
		clr_character_flag = sr_bar_fight_success
	}
}

# Feedback event for found_religious_cult decision
character_event = {
	id = MNM.3950
	desc = EVTDESC_MNM_3950
	picture = GFX_evt_secret_ceremony
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3950
	}
}

# Feedback event for falsely_confess_faith decision
character_event = {
	id = MNM.3951
	desc = EVTDESC_MNM_3951
	picture = GFX_evt_secluded_in_prayer
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_3951
	}
}

# rare ai only - secretly convert from spouse/friend/province's religion
character_event = {
	id = MNM.3948
	hide_window = yes
	
	is_triggered_only = yes
	
	ai = yes
	only_playable = yes
	
	trigger = {
		has_secret_religion = no
		any_spouse = {
			same_true_religion_as_root_trigger = no
		}
		any_consort = {
			same_true_religion_as_root_trigger = no
		}
		any_demesne_province = {
			NOT = { religion = { target_type = true target = ROOT} }
		}
		any_friend = {
			same_true_religion_as_root_trigger = no
		}
	}
	
	weight_multiplier = {
		days = 1
	}
	
	immediate = {
		random_spouse = {
			limit = {
				same_true_religion_as_root_trigger = no
			}
			ROOT = { 
				set_secret_religion = { target_type = true target = PREV }
				any_spouse = {
					limit = {
						ai = yes
						has_secret_religion = no
						NOT = { character = PREVPREV }
					}
					set_secret_religion = { target_type = true target = PREVPREV }
				}
				any_child = {
					limit = {
						ai = yes
						has_secret_religion = no
						NOT = { character = PREVPREV }
					}
					set_secret_religion = { target_type = true target = PREVPREV }
				}
			}
			break = yes
		}
		random_consort = {
			limit = {
				same_true_religion_as_root_trigger = no
			}
			ROOT = { 
				set_secret_religion = { target_type = true target = PREV }
				any_spouse = {
					limit = {
						ai = yes
						has_secret_religion = no
						NOT = { character = PREVPREV }
					}
					set_secret_religion = { target_type = true target = PREVPREV }
				}
				any_child = {
					limit = {
						ai = yes
						has_secret_religion = no
						NOT = { character = PREVPREV }
					}
					set_secret_religion = { target_type = true target = PREVPREV }
				}
			}
			break = yes
		}
		random_demesne_province = {
			limit = {
				NOT = { religion = { target_type = true target = ROOT} }
			}
			ROOT = { set_secret_religion = { target_type = public target = PREV } }
			ROOT = {
				any_spouse = {
					limit = {
						ai = yes
						has_secret_religion = no
					}
					set_secret_religion = { target_type = true target = ROOT }
				}
				any_child = {
					limit = {
						ai = yes
						has_secret_religion = no
					}
					set_secret_religion = { target_type = true target = ROOT }
				}
			}
			break = yes
		}
		random_friend = {
			limit = {
				same_true_religion_as_root_trigger = no
			}
			ROOT = { 
				set_secret_religion = { target_type = true target = PREV }
				any_spouse = {
					limit = {
						ai = yes
						has_secret_religion = no
						NOT = { character = PREVPREV }
					}
					set_secret_religion = { target_type = true target = PREVPREV }
				}
				any_child = {
					limit = {
						ai = yes
						has_secret_religion = no
						NOT = { character = PREVPREV }
					}
					set_secret_religion = { target_type = true target = PREVPREV }
				}
			}
			break = yes
		}
	}
}

