###########################################
#										 #
# M&M Satanists Society Events			#
#										 #
# ID MNM.7000-MNM.7999					  #
#										 #
###########################################

namespace = MNM

### minor/major soul corruption effect (on yearly pulse)
character_event = {
	id = MNM.7000

	hide_window = yes
	is_triggered_only = yes

	trigger = {
		is_devil_worshiper_trigger = yes
		days_in_society > 1095
		has_dlc = Mystics
	}

	immediate = {
		random_list = { #randomizes between big or small effect, both containing a chance of nothing happening
			80 = {
				minor_soul_corruption_effect = yes
			}
			20 = {
				major_soul_corruption_effect = yes
				modifier = {
					factor = 1.1
					check_variable = { which = visibility_value value = 10 }
				}
				modifier = {
					factor = 1.1
					check_variable = { which = visibility_value value = 15 }
				}
				modifier = {
					factor = 1.1
					check_variable = { which = visibility_value value = 20 }
				}
				modifier = {
					factor = 1.1
					check_variable = { which = visibility_value value = 25 }
				}
				modifier = {
					factor = 1.1
					check_variable = { which = visibility_value value = 30 }
				}
				modifier = {
					factor = 1.1
					check_variable = { which = visibility_value value = 35 }
				}
				modifier = {
					factor = 1.1
					check_variable = { which = visibility_value value = 40 }
				}
			}
		}
	}
}


###JOINING & RECRUITMENT EVENTS###

#For the recruit: Do you approve of "alternative views"?
character_event = {
	id = MNM.7001
	desc = EVTDESC_MNM_7001_A
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	prisoner = no

	trigger = { has_dlc = Mystics }

	immediate = {
		if = {
			limit = { NOT = { event_target:satanists_recruiter = { always = yes } } }
			FROMFROM = { save_event_target_as = satanists_recruiter }
		}
		save_event_target_as = satanists_recruit
	}

	fail_trigger_effect = {
		clr_character_flag = being_recruited_by_the_satanists
		clr_character_flag = being_recruited_by_the_trollcrafters
		clr_character_flag = being_recruited_by_the_cult_of_kali
		clr_character_flag = being_recruited_by_the_cold_ones
		clr_character_flag = being_recruited_by_the_plaguebringers
		clr_character_flag = being_recruited_by_cult_of_angra_mainyu
		clr_character_flag = being_recruited_by_the_cult_of_balor
		clr_character_flag = being_recruited_by_the_titancult
		clr_character_flag = being_recruited_by_the_jinn
	}

	#Approving of heretics
	option = {
		name = {
			text = EVTOPTA_7001 #If God didn't want us to ask questions, why did he make us curious?
		}
		
		trigger = {
			OR = {
				ai = no
				NOT = { controls_religion = yes }
				trait = bad_priest_christian
				trait = bad_priest_muslim
				trait = bad_priest_norse
				trait = bad_priest_tengri
				trait = bad_priest_zoroastrian
				trait = bad_priest_aztec
			}
		}

		custom_tooltip = { text = EVTOPTA_7001_TT }

		reverse_opinion = {
			who = event_target:satanists_recruiter
			modifier = opinion_agreed_with_opinion
			years = 5
		}

		set_character_flag = approves_of_satanism

		hidden_effect = { 
			character_event = { id = MNM.6999 days = 3 } 
		}

		ai_chance = {
			factor = 20
			modifier = {
				factor = 0
				trait = zealous
			}
			modifier = {
				factor = 1.5
				trait = trusting
			}
			modifier = {
				factor = 1.5
				is_dumb_trigger = yes
			}
			modifier = {
				factor = 1.5
				OR = {
					trait = bad_priest_christian
					trait = bad_priest_muslim
					trait = bad_priest_norse
					trait = bad_priest_tengri
					trait = bad_priest_zoroastrian
					trait = bad_priest_aztec
				}
			}
			modifier = {
				factor = 1.5
				trait = hedonist
			}
			modifier = {
				factor = 1.5
				trait = lustful
			}
			modifier = {
				factor = 1.5
				trait = cynical
			}
			modifier = {
				factor = 0.2
				OR = {
					AND = {
						has_character_flag = being_recruited_by_the_satanists
						true_religion_group_christian_trigger = no
						true_religion_group_jewish_group_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_cult_of_angra_mainyu
						true_religion_group_zoroastrian_group_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_the_trollcrafters
						true_religion_norse_pagan_reformed_trigger = no
						true_religion_norse_pagan_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_the_cult_of_kali
						true_religion_hindu_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_the_cult_of_balor
						true_religion_celtic_pagan_trigger = no
						true_religion_celtic_pagan_reformed_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_the_jinn
						true_religion_group_muslim_trigger = no
						true_religion_arab_pagan_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_the_cold_ones
						true_religion_baltic_pagan_trigger = no
						true_religion_baltic_pagan_reformed_trigger = no
						true_religion_slavic_pagan_trigger = no
						true_religion_slavic_pagan_reformed_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_the_plaguebringers
						true_religion_tengri_pagan_trigger = no
						true_religion_tengri_pagan_reformed_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_the_titancult
						true_religion_group_hellenic_pagan_trigger = no
					}
					AND = {
						has_character_flag = being_recruited_by_the_apepcult
						true_religion_egyptian_pagan_trigger = no
					}
				}
			}
		}
	}

	#Disapproving of heretics
	option = {
		name = {
			text = EVTOPTB_7001
		}
		
		custom_tooltip = { text = EVTOPTB_7001_TT }

		reverse_opinion = {
			who = event_target:satanists_recruiter
			modifier = opinion_disagreed_with_opinion
			years = 5
		}

		set_character_flag = disapproves_of_satanism

		clr_character_flag = being_recruited_by_the_satanists
		clr_character_flag = being_recruited_by_the_trollcrafters
		clr_character_flag = being_recruited_by_the_cult_of_kali
		clr_character_flag = being_recruited_by_the_cult_of_balor
		clr_character_flag = being_recruited_by_the_jinn
		clr_character_flag = being_recruited_by_the_titancult
		clr_character_flag = being_recruited_by_cult_of_angra_mainyu
		clr_character_flag = being_recruited_by_the_cold_ones
		clr_character_flag = being_recruited_by_the_plaguebringers
		clr_character_flag = being_recruited_by_the_apepcult

		hidden_effect = { 
			event_target:satanists_recruiter = { 
				character_event = { id = MNM.7002 days = 15 } 
			} 
		}

		ai_chance = {
			factor = 80
			modifier = {
				factor = 1.5
				has_pious_trait_trigger = yes
			}
			modifier = {
				factor = 1.5
				has_crusade_trait_trigger = yes
			}
		}
	}
}

# Safety ping.
character_event = {
	id = MNM.6999
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6995 }
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_recruiter = {
					is_alive = yes
					is_devil_worshiper_trigger = yes
				}
			}
			event_target:satanists_recruiter = { 
				character_event = { id = MNM.7002 }
			}
			break = yes
		}
		# Else notify broken chain
		character_event = { id = MNM.6995 }
	}
}

# Safety ping.
character_event = {
	id = MNM.6998
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6995 }
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_recruiter = {
					is_alive = yes
					is_devil_worshiper_trigger = yes
				}
			}
			event_target:satanists_recruiter = { 
				character_event = { id = MNM.7004 }
			}
			break = yes
		}
		# Else notify broken chain
		character_event = { id = MNM.6995 }
	}
}

# Safety ping.
character_event = {
	id = MNM.6997
	hide_window = yes

	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6995 }
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_recruiter = {
					is_alive = yes
					is_devil_worshiper_trigger = yes
				}
			}
			event_target:satanists_recruiter = { 
				character_event = { id = MNM.7007 }
			}
			break = yes
		}
		# Else notify broken chain
		character_event = { id = MNM.6995 }
	}
}

# Safety ping.
character_event = {
	id = MNM.6996
	hide_window = yes

	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6995 }
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_recruiter = {
					is_alive = yes
					is_devil_worshiper_trigger = yes
				}
			}
			event_target:satanists_recruiter = { 
				character_event = { id = MNM.7006 }
			}
			break = yes
		}
		# Else notify broken chain
		character_event = { id = MNM.6995 }
	}
}

character_event = { # event notifying recruitee that "Something must've gone wrong" (in case recruiter/inductor dies)
	id = MNM.6995
	desc = {
		text = EVTDESCA_MNM_6995
		trigger = { NOT = { has_character_flag = dw_recruitment_end_unable } }
	}
	desc = {
		text = EVTDESCB_MNM_6995
		trigger = { has_character_flag = dw_recruitment_end_unable }
		picture = GFX_evt_into_the_dungeon
	}
	picture = GFX_evt_state_diplomacy
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	show_root = yes
	
	option = {
		name = {
			text = EVTOPTA_MNM_6995
			trigger = { NOT = { has_character_flag = dw_recruitment_end_unable } }
		}
		name = {
			text = EVTOPTB_MNM_6995
			trigger = { has_character_flag = dw_recruitment_end_unable }
		}
		custom_tooltip = { text = EVTTOOLTIP_MNM_6995 }
		clr_character_flag = being_recruited_by_the_satanists
		clr_character_flag = being_recruited_by_the_trollcrafters
		clr_character_flag = being_recruited_by_the_cult_of_kali
		clr_character_flag = being_recruited_by_the_cult_of_balor
		clr_character_flag = being_recruited_by_the_jinn
		clr_character_flag = being_recruited_by_the_titancult
		clr_character_flag = being_recruited_by_cult_of_angra_mainyu
		clr_character_flag = being_recruited_by_the_cold_ones
		clr_character_flag = being_recruited_by_the_plaguebringers
		clr_character_flag = being_recruited_by_the_apepcult
		clr_character_flag = dw_recruitment_end_unable
	}
}

# For recruiter: consider the target's reaction, continue or abandon endeavor
character_event = {
	id = MNM.7002
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { FROM = { has_character_flag = approves_of_satanism } } #They seemed kinda fine with it
		text = EVTDESC_MNM_7002_A
	}
	desc = {
		trigger = { FROM = { has_character_flag = disapproves_of_satanism } } #They seemed kinda hesitant to the whole thing
		text = EVTDESC_MNM_7002_B
	}

	is_triggered_only = yes

	#Continue recruitment-attempt
	option = {
		trigger = { FROM = { has_character_flag = approves_of_satanism } }
		name = EVTOPTA_7002
		custom_tooltip = { text = EVTOPTA_7002_TT }

		hidden_effect = {
			FROM = {
				character_event = { id = MNM.7003 }
				clr_character_flag = approves_of_satanism
			}
		}
		ai_chance = { factor = 100 }
	}

	#Too risky - Recruitment attempt ends
	option = {
		trigger = { FROM = { has_character_flag = approves_of_satanism } }
		name = EVTOPTB_7002
		custom_tooltip = { text = EVTOPTB_7002_TT }
		hidden_effect = { FROM = { clr_character_flag = approves_of_satanism } }
		ai_chance = { factor = 0 }
	}

	# The recruit refuses to question their god - Recruitment attempt ends
	option = {
		trigger = { FROM = { has_character_flag = disapproves_of_satanism } }
		name = EVTOPTC_7002
		custom_tooltip = { text = EVTOPTB_7002_TT }
		hidden_effect = { FROM = { clr_character_flag = disapproves_of_satanism } }
	}
}

#For the recruit: Recruiter contiunes offering more radical ideas, gives strange idol
character_event = {
	id = MNM.7003
	desc = EVTDESC_MNM_7003_A
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = { 
			limit = { NOT = { event_target:satanists_recruit = { always = yes } } }
			FROMFROM = { save_event_target_as = satanists_recruiter }
			save_event_target_as = satanists_recruit
		}
	}

	#You encourage the recruiter
	option = {
		name = EVTOPTA_7003
		custom_tooltip = { text = EVTOPTA_7003_TT }
		
		trigger = {
			OR = {
				ai = no
				NOT = { controls_religion = yes }
				trait = bad_priest_christian
				trait = bad_priest_muslim
				trait = bad_priest_norse
				trait = bad_priest_tengri
				trait = bad_priest_zoroastrian
				trait = bad_priest_aztec
			}
		}
		
		reverse_opinion = {
			who = event_target:satanists_recruiter
			modifier = opinion_open_minded
			years = 5
		}

		set_character_flag = willing_to_join
		
		hidden_effect = { character_event = { id = MNM.6998 } }  #to recruiter - via ping: make the offer?
		
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.1
				has_education_intrigue_trigger = yes
			}
			modifier = {
				factor = 1.1
				has_lifestyle_intrigue_trigger = yes
			}
			modifier = {
				factor = 1.1
				trait = trusting
			}
			modifier = {
				factor = 1.5
				is_dumb_trigger = yes
			}
			modifier = {
				factor = 1.5
				OR = {
					trait = bad_priest_christian
					trait = bad_priest_muslim
					trait = bad_priest_norse
					trait = bad_priest_tengri
					trait = bad_priest_zoroastrian
					trait = bad_priest_aztec
				}
			}
			modifier = {
				factor = 1.5
				trait = hedonist
			}
			modifier = {
				factor = 1.5
				trait = lustful
			}
			modifier = {
				factor = 1.5
				trait = cynical
			}
			modifier = {
				factor = 1.5
				FROM = { diplomacy = 12 }
			}
			modifier = {
				factor = 1.5
				FROM = { intrigue = 12 }
			}
			modifier = {
				factor = 1.1
				FROM = { trait = fair }
			}
			modifier = {
				factor = 1.1
				FROM = { has_attractive_trait_trigger = yes }
			}
			modifier = {
				factor = 1.1
				FROM = { is_attractive_trigger = yes }
			}
		}
	}

	#You strongly discourage the recruiter
	option = {
		name = EVTOPTB_7003
		custom_tooltip = { text = EVTOPTB_7003_TT }

		reverse_opinion = {
			who = event_target:satanists_recruiter
			modifier = opinion_narrow_minded
			years = 5
		}

		set_character_flag = unwilling_to_join
		
		clr_character_flag = being_recruited_by_the_satanists
		clr_character_flag = being_recruited_by_the_trollcrafters
		clr_character_flag = being_recruited_by_the_cult_of_kali
		clr_character_flag = being_recruited_by_the_cult_of_balor
		clr_character_flag = being_recruited_by_the_jinn
		clr_character_flag = being_recruited_by_the_titancult
		clr_character_flag = being_recruited_by_cult_of_angra_mainyu
		clr_character_flag = being_recruited_by_the_cold_ones
		clr_character_flag = being_recruited_by_the_plaguebringers
		clr_character_flag = being_recruited_by_the_apepcult


		
		hidden_effect = { character_event = { id = MNM.6998 } }  #to recruiter - via ping: recruit said no
		
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				trait = craven
			}
			modifier = {
				factor = 1.5
				trait = content
			}
			modifier = {
				factor = 1.5
				FROM = { trait = ugly }
			}
			modifier = {
				factor = 1.5
				FROM = { has_unattractive_trait_trigger = yes }
			}
			modifier = {
				factor = 1.5
				FROM = { is_unattractive_trigger = yes }
			}
		}
	}
}

#For the recruiter: Can, and will, you make the offer?
character_event = {
	id = MNM.7004
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { FROM = { has_character_flag = willing_to_join } }
		text = EVTDESC_MNM_7004_A
	}
	desc = {
		trigger = { FROM = { has_character_flag = unwilling_to_join } }
		text = EVTDESC_MNM_7004_B
	}

	is_triggered_only = yes

	#Pose the question (only available if recruit is willing to join)
	option = {
		trigger = { FROM = { has_character_flag = willing_to_join } }
		name = EVTOPTA_7004
		custom_tooltip = { text = EVTOPTA_7004_TT }

		hidden_effect = {
			FROM = {
				character_event = { id = MNM.7005 days = 1 }
				clr_character_flag = willing_to_join
			}
		}

		ai_chance = { factor = 100 }
	}

	#Too risky, volontary end (only available if recruit is willing to join)
	option = {
		trigger = { FROM = { has_character_flag = willing_to_join } }
		name = EVTOPTB_7004
		custom_tooltip = { text = EVTOPTB_7002_TT }
		hidden_effect = { FROM = { clr_character_flag = willing_to_join } }

		ai_chance = { factor = 0 }
	}

	# The recruit refuses to see it my way - Recruitment attempt ends
	option = {
		trigger = { FROM = { has_character_flag = unwilling_to_join } }
		name = EVTOPTC_7004
		custom_tooltip = { text = EVTOPTB_7002_TT }
		hidden_effect = { FROM = { clr_character_flag = unwilling_to_join } }
	}
}

#For Recruit: Join Satanists? (this is where it is more or less confirmed that this is some devil-worshiping going on)
character_event = {
	id = MNM.7005
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { event_target:satanists_recruiter = { society_member_of = the_satanists } } # Recruiter reveals symbol on their arm
		text = EVTDESC_MNM_7005
	}
	desc = {
		trigger = {
			event_target:satanists_recruiter = {
				society_member_of = arab_jinn_sorcerers
				ROOT = { religion_group = muslim }
			}
		}
		text = EVTDESC_MNM_7005_JINN
	}
	desc = {
		trigger = { event_target:satanists_recruiter = { society_member_of = the_plaguebringers } }
		text = EVTDESC_MNM_7005_PLAGUEBRINGER
	}
	desc = {
		trigger = { event_target:satanists_recruiter = { society_member_of = cult_of_titan } }
		text = EVTDESC_MNM_7005_TITAN
	}
	desc = {
		trigger = { event_target:satanists_recruiter = { society_member_of = cult_of_apep } }
		text = EVTDESC_MNM_7005_APEP
	}
	desc = {
		trigger = { event_target:satanists_recruiter = { society_member_of = the_cult_of_balor } }
		text = EVTDESC_MNM_7005_BALOR
	}
	desc = {
		trigger = {
			event_target:satanists_recruiter = {
				NOR = {
					society_member_of = the_satanists
					society_member_of = the_plaguebringers
					society_member_of = cult_of_titan
					society_member_of = cult_of_apep
					society_member_of = the_cult_of_balor
					ROOT = { religion_group = muslim }
				}
			}
		}
		text = EVTDESC_MNM_7005_ALT
	}

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			if = {
				limit = { any_lover = { has_disease_trigger = yes } }
				set_character_flag = has_ill_lover_loc
			}
			if = {
				limit = { any_spouse = { has_disease_trigger = yes }}
				set_character_flag = has_ill_spouse_loc
			}
			if = {
				limit = { any_child = { has_disease_trigger = yes }	}
				set_character_flag = has_ill_child_loc
			}
			if = {
				limit = { NOT = { wealth = 0 } }
				set_character_flag = has_money_troubles_loc
			}
			if = {
				limit = { NOT = { wealth = 0 } }
				set_character_flag = has_money_troubles_loc
			}
			if = {
				limit = { has_disease_trigger = yes }
				set_character_flag = has_some_illness_loc
			}
			if = {
				limit = { war = yes	}
				set_character_flag = has_need_of_winning_battles_loc
			}
			if = {
				limit = { any_rival = { always = yes } }
				set_character_flag = has_a_rival_loc
			}
			if = {
				limit = {
					OR = {
						trait = weak
						trait = feeble
						trait = dwarf
						trait = hunchback
					}
				}
				set_character_flag = is_weak_loc
			}
			if = {
				limit = {
					OR = {
						trait = imbecile
						trait = inbred
						trait = slow
					}
				}
				set_character_flag = is_dumb_loc
			}
		}
	}

	#Yes - can you help me [GetDWReasonToJoin]?
	option = {
		name = EVTOPTA_7005
		custom_tooltip = { text = EVTOPTA_7005_TT }

		hidden_effect = { character_event = { id = MNM.6997 days = 5 } }

	}

	#No - this is blasphemy, get out of my sight
	option = {
		name = EVTOPTB_7005
		custom_tooltip = { text = EVTOPTB_7005_TT }
		clr_character_flag = being_recruited_by_the_satanists
		clr_character_flag = being_recruited_by_the_trollcrafters
		clr_character_flag = being_recruited_by_the_cult_of_kali
		clr_character_flag = being_recruited_by_the_cult_of_balor
		clr_character_flag = being_recruited_by_the_jinn
		clr_character_flag = being_recruited_by_the_titancult
		clr_character_flag = being_recruited_by_cult_of_angra_mainyu
		clr_character_flag = being_recruited_by_the_cold_ones
		clr_character_flag = being_recruited_by_the_plaguebringers
		clr_character_flag = being_recruited_by_the_apepcult

		hidden_effect = { character_event = { id = MNM.6996 days = 1 } } # turn down the satanists

		ai_chance = { factor = 0 }
	}
}

#For Recruiter: Recruit said no
character_event = {
	id = MNM.7006
	picture = GFX_evt_secret_ceremony
	desc = EVTDESC_MNM_7006
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = { # The recruit refuses to see it my way - Recruitment attempt ends
		name = EVTOPTA_7006
		custom_tooltip = { text = EVTOPTB_7002_TT }
	}
}

#For Recruiter: Recruit said yes
character_event = {
	id = MNM.7007
	picture = GFX_evt_secret_ceremony
	desc = EVTDESC_MNM_7007
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	immediate = {
		random_society_member = {
			limit = {
				society_rank >= 3
				same_society_as = event_target:satanists_recruiter
			}
			save_event_target_as = satanists_inductor 
		}
	}

	option = {
		name = EVTOPTA_7007
		custom_tooltip = { text = EVTOPTA_7007_TT }

		hidden_effect = { FROM = { character_event = { id = MNM.7008 } } }
	}
}

#For Recruit: Confirmation
character_event = {
	id = MNM.7008
	picture = GFX_evt_secret_ceremony
	desc = EVTDESC_MNM_7008
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_7008
		custom_tooltip = { text = EVTOPTA_7008_TT }

		hidden_effect = { 
			character_event = { id = MNM.7009 days = 14 random = 21 } 
		}
	}
}

#For Recruit: Joining begins (seek out books and knowledge on the occult)
character_event = {
	id = MNM.7009
	picture = GFX_evt_ritual_scroll
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = {
			event_target:satanists_recruiter = {
				OR = {
					society_member_of = the_satanists
					AND = {
						society_member_of = arab_jinn_sorcerers
						ROOT = { religion_group = muslim }
					}
				}
			}
		}
		text = EVTDESC_MNM_7009_A
	}
	desc = {
		trigger = { event_target:satanists_recruiter = { society_member_of = the_plaguebringers } }
		text = EVTDESC_MNM_7009_PLAGUEBRINGER
	}
	desc = {
		trigger = {
			event_target:satanists_recruiter = {
				NOR = {
					society_member_of = the_satanists
					society_member_of = the_plaguebringers
					AND = {
						society_member_of = arab_jinn_sorcerers
						ROOT = { religion_group = muslim }
					}
				}
			}
		}
		text = EVTDESC_MNM_7009_ALT
	}

	hide_from = yes

	is_triggered_only = yes

	trigger = {
		NOR = {
			prisoner = yes
			event_target:satanists_recruiter = {
				is_alive = no
				is_devil_worshiper_trigger = no
			}
		}
	}

	fail_trigger_effect = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6995 } #notify broken chain
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_recruiter = {
					is_alive = no
					is_devil_worshiper_trigger = no
				}
			}
			event_target:satanists_recruiter = { 
				character_event = { id = MNM.6995 } #notify broken chain
			}
			break = yes
		}
	}

	# I have been blinded by convention
	option = {
		name = EVTOPTA_7009
		custom_tooltip = { text = EVTOPTA_7009_TT }
		remove_trait_zealous_effect = yes

		hidden_effect = { character_event = { id = MNM.7010 days = 20 random = 15 } }
	}
	# I can't believe I have been so gullible!
	option = {
		name = EVTOPTB_7009
		custom_tooltip = { text = EVTOPTA_7009_TT }
		tooltip_info = trusting

		remove_trait_trusting_effect = yes

		hidden_effect = { character_event = { id = MNM.7010 days = 20 random = 15 } }

		trigger = {
			trait = trusting
		}
	}
	# I am beginning to feel that I have been missing out...
	option = {
		name = EVTOPTC_7009
		custom_tooltip = { text = EVTOPTA_7009_TT }
		tooltip_info = chaste

		remove_trait_chaste_effect = yes

		hidden_effect = { character_event = { id = MNM.7010 days = 20 random = 15 } }

		trigger = {
			trait = chaste
		}
	}
	# I am beginning to feel that I have been missing out...
	option = {
		name = EVTOPTD_7009
		custom_tooltip = { text = EVTOPTA_7009_TT }
		tooltip_info = charitable

		remove_trait_charitable_effect = yes

		hidden_effect = { character_event = { id = MNM.7010 days = 20 random = 15 } }

		trigger = {
			trait = charitable
		}
	}
	# Why put the needs of others before our own?
	option = {
		name = EVTOPTD_7009
		custom_tooltip = { text = EVTOPTA_7009_TT }

		add_trait_greedy_effect = yes

		hidden_effect = { character_event = { id = MNM.7010 days = 20 random = 15 } }

		trigger = {
			NOT = { trait = charitable }
			NOT = { trait = greedy }
		}
	}
}

#Seal it with blood (loyalty to grand master)
character_event = {
	id = MNM.7010
	picture = GFX_evt_dark_prayer
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { event_target:satanists_inductor = { society_member_of = the_satanists } } # Recruiter reveals pentagram on their arm
		text = EVTDESC_MNM_7010_A
	}
	desc = {
		trigger = { event_target:satanists_inductor = { society_member_of = cult_of_apep } }
		text = EVTDESC_MNM_7010_APEP
	}
	desc = {
		trigger = { event_target:satanists_inductor = { society_member_of = the_cult_of_balor } }
		text = EVTDESC_MNM_7010_BALOR
	}
	desc = {
		trigger = {
			event_target:satanists_inductor = {
				NOR = {
					society_member_of = the_satanists
					society_member_of = cult_of_apep
					society_member_of = the_cult_of_balor
				}
			}
		}
		text = EVTDESC_MNM_7010_ALT
	}

	hide_from = yes

	is_triggered_only = yes

	trigger = {
		NOR = {
			prisoner = yes
			event_target:satanists_recruiter = {
				is_alive = no
				is_devil_worshiper_trigger = no
			}
		}
	}

	fail_trigger_effect = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6995 } #notify broken chain
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_recruiter = {
					is_alive = no
					is_devil_worshiper_trigger = no
				}
			}
			event_target:satanists_recruiter = { 
				character_event = { id = MNM.6995 } #notify broken chain
			}
			break = yes
		}
	}

	#Yes
	option = {
		name = EVTOPTA_7010
		if = {
			limit = { event_target:satanists_inductor = { society_member_of = the_satanists } }
			custom_tooltip = { text = EVTOPTA_7010_TT_1 }
		}
		if = {
			limit = { event_target:satanists_inductor = { NOT = { society_member_of = the_satanists } } }
			custom_tooltip = { text = EVTOPTA_7010_TT_1_ALT }
		}

		hidden_effect = { character_event = { id = MNM.7012 days = 35 random = 20 } } #Inductor will get in contact with you
		
		add_character_modifier = {
			name = bandaged_arm
			days = 65
		}

		ai_chance = {
			factor = 100
		}
	}

	#No
	option = {
		name = EVTOPTB_7010
		custom_tooltip = { text = EVTOPTB_7010_TT }

		hidden_effect = { 
			FROM = { character_event = { id = MNM.7020 days = 60 random = 20 } } #Fail 

			if = {
				limit = { event_target:satanists_recruiter = { always = yes } }
				event_target:satanists_recruiter = { 
					set_character_flag = recruitment_fail
					character_event = { id = MNM.7021 } #Tell original recruiter what happened (if there is one) OR grand master of cult?
				}
			}
		} 

		ai_chance = {
			factor = 0
		}
	}
}

#Sending event to inductor - hidden event to find somebody appropriate to invite you
character_event = {
	id = MNM.7012
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		if = { 
			limit = { NOT = { event_target:satanists_inductor = { always = yes } } }

			random_society_member = {
				limit = {
					society_rank >= 3
					same_society_as = event_target:satanists_recruiter
					prisoner = no
				}
				save_event_target_as = satanists_inductor 
			}
		}
		event_target:satanists_inductor = { 
			set_character_flag = event_MNM_7014
			character_event = { id = MNM.7013 }
		}
	}
}

#Ping event for inductors
character_event = {
	id = MNM.7013
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		trigger_switch = {
			on_trigger = has_character_flag
			event_MNM_7014 = { FROM = { letter_event = { id = MNM.7014 } } }
			event_MNM_7015 = { FROM = { character_event = { id = MNM.7015 days = 14 } } }
			event_MNM_7016 = { FROM = { character_event = { id = MNM.7016 days = 3 } } }
			event_MNM_7017 = { FROM = { character_event = { id = MNM.7017 days = 5 } } }
			event_MNM_7018 = { FROM = { character_event = { id = MNM.7018 days = 1 } } }
			event_MNM_7019 = { FROM = { character_event = { id = MNM.7019 days = 1 } } }
		}
		clr_character_flag = event_MNM_7014
		clr_character_flag = event_MNM_7015
		clr_character_flag = event_MNM_7016
		clr_character_flag = event_MNM_7017
		clr_character_flag = event_MNM_7018
		clr_character_flag = event_MNM_7019
	}
}

#"Await the messenger" a letter reads
letter_event = {
	id = MNM.7014
	desc = EVTDESC_MNM_7014
	border = GFX_event_letter_frame_intrigue

	is_triggered_only = yes

	trigger = {
		NOR = {
			prisoner = yes
			event_target:satanists_recruiter = {
				is_alive = no
				is_devil_worshiper_trigger = no
			}
		}
	}

	fail_trigger_effect = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6995 } #notify broken chain
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_recruiter = {
					is_alive = no
					is_devil_worshiper_trigger = no
				}
			}
			event_target:satanists_recruiter = { 
				character_event = { id = MNM.6995 } #notify broken chain
			}
			break = yes
		}
	}

	option = {
		name = EVTOPTA_7014
		custom_tooltip = { text = EVTOPTA_7014_TT }

		hidden_effect = {
			event_target:satanists_inductor = { 
				clr_character_flag = event_MNM_7014
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_satanists
					any_society_member = {
						society_member_of = the_satanists
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_satanists
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_trollcrafters
					any_society_member = {
						society_member_of = the_trollcrafters
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_trollcrafters
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_cult_of_kali
					any_society_member = {
						society_member_of = the_cult_of_kali
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_cult_of_kali
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_cult_of_balor
					any_society_member = {
						society_member_of = the_cult_of_balor
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_cult_of_balor
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_jinn
					any_society_member = {
						society_member_of = arab_jinn_sorcerers
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = arab_jinn_sorcerers
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_titancult
					any_society_member = {
						society_member_of = cult_of_titan
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = cult_of_titan
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_apepcult
					any_society_member = {
						society_member_of = cult_of_apep
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = cult_of_apep
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_cult_of_angra_mainyu
					any_society_member = {
						society_member_of = cult_of_angra_mainyu
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = cult_of_angra_mainyu
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_cold_ones
					any_society_member = {
						society_member_of = the_cold_ones
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_cold_ones
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = yes
					has_character_flag = being_recruited_by_the_plaguebringers
					any_society_member = {
						society_member_of = the_plaguebringers
						is_female = no
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_plaguebringers
						is_female = no
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			#start of prefer women 
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_satanists
					any_society_member = {
						society_member_of = the_satanists
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_satanists
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_trollcrafters
					any_society_member = {
						society_member_of = the_trollcrafters
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_trollcrafters
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_cult_of_kali
					any_society_member = {
						society_member_of = the_cult_of_kali
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_cult_of_kali
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_cult_of_balor
					any_society_member = {
						society_member_of = the_cult_of_balor
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_cult_of_balor
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_jinn
					any_society_member = {
						society_member_of = arab_jinn_sorcerers
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = arab_jinn_sorcerers
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_titancult
					any_society_member = {
						society_member_of = cult_of_titan
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = cult_of_titan
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_apepcult
					any_society_member = {
						society_member_of = cult_of_apep
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = cult_of_apep
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_cult_of_angra_mainyu
					any_society_member = {
						society_member_of = cult_of_angra_mainyu
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = cult_of_angra_mainyu
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_cold_ones
					any_society_member = {
						society_member_of = the_cold_ones
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_cold_ones
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}
			if = {
				limit = {
					prefers_men_trigger = no
					has_character_flag = being_recruited_by_the_plaguebringers
					any_society_member = {
						society_member_of = the_plaguebringers
						is_female = yes
						is_attractive_trigger = yes
					}
				}
				random_society_member = {
					limit = {
						society_member_of = the_plaguebringers
						is_female = yes
						is_attractive_trigger = yes
					}
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					character_event = { id = MNM.7013 }
					break = yes
				}
			}

			if = { #back up if there is no eligble society member
				limit = { prefers_men_trigger = yes }
				create_character = {
					random_traits = yes
					dynasty = none
					religion = ROOT
					culture = ROOT
					female = no
					age = 20
					attributes = {
						intrigue = 5
					}
					trait = elusive_shadow
					historical = yes
				}
				new_character = {
					remove_trait = ugly
					remove_trait = hunchback
					remove_trait = dwarf
					remove_trait = chaste
					add_trait = lustful
					add_trait = fair
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					ROOT = {
						trigger_switch = {
							on_trigger = has_character_flag
							being_recruited_by_the_satanists = { PREV = { join_society = the_satanists } }
							being_recruited_by_the_trollcrafters = { PREV = { join_society = the_trollcrafters } }
							being_recruited_by_the_cult_of_kali = { PREV = { join_society = the_cult_of_kali } }
							being_recruited_by_the_cult_of_balor = { PREV = { join_society = the_cult_of_balor } }
							being_recruited_by_the_jinn = { PREV = { join_society = arab_jinn_sorcerers } }
							being_recruited_by_the_titancult = { PREV = { join_society = cult_of_titan } }
							being_recruited_by_the_apepcult = { PREV = { join_society = cult_of_apep } }
							being_recruited_by_cult_of_angra_mainyu = { PREV = { join_society = cult_of_angra_mainyu } }
							being_recruited_by_the_cold_ones = { PREV = { join_society = the_cold_ones } }
							being_recruited_by_the_plaguebringers = { PREV = { join_society = the_plaguebringers } }
						}
					}
					character_event = { id = MNM.7013 }
				}
			}
			if = { limit = { prefers_men_trigger = no }
				create_character = {
					random_traits = yes
					dynasty = none
					religion = ROOT
					culture = ROOT
					female = yes
					age = 20
					attributes = {
						intrigue = 5
					}
					trait = elusive_shadow
					historical = yes
				}
				new_character = {
					remove_trait = ugly
					remove_trait = hunchback
					remove_trait = dwarf
					remove_trait = chaste
					add_trait = lustful
					add_trait = fair
					save_event_target_as = satanists_inductor
					set_character_flag = event_MNM_7015
					ROOT = {
						trigger_switch = {
							on_trigger = has_character_flag
							being_recruited_by_the_satanists = { PREV = { join_society = the_satanists } }
							being_recruited_by_the_trollcrafters = { PREV = { join_society = the_trollcrafters } }
							being_recruited_by_the_cult_of_kali = { PREV = { join_society = the_cult_of_kali } }
							being_recruited_by_the_cult_of_balor = { PREV = { join_society = the_cult_of_balor } }
							being_recruited_by_the_jinn = { PREV = { join_society = arab_jinn_sorcerers } }
							being_recruited_by_the_titancult = { PREV = { join_society = cult_of_titan } }
							being_recruited_by_the_apepcult = { PREV = { join_society = cult_of_apep } }
							being_recruited_by_cult_of_angra_mainyu = { PREV = { join_society = cult_of_angra_mainyu } }
							being_recruited_by_the_cold_ones = { PREV = { join_society = the_cold_ones } }
							being_recruited_by_the_plaguebringers = { PREV = { join_society = the_plaguebringers } }
						}
					}
					character_event = { id = MNM.7013 }
				}
			}
		}
	}
}

##ping event for the messenger
#character_event = {
#	id = MNM.7011
#	hide_window = yes#

#	is_triggered_only = yes#

#	immediate = { FROM = { character_event = { id = MNM.7015 days = 5 } } }
#}

#For Recruit: Have met an intriguing person at court
character_event = {
	id = MNM.7015
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { event_target:satanists_inductor = { society_member_of = the_satanists } } 
		text = EVTDESC_MNM_7015
	}
	desc = {
		trigger = { event_target:satanists_inductor = { NOT = { society_member_of = the_satanists } } } 
		text = EVTDESC_MNM_7015_ALT
	}

	is_triggered_only = yes

	trigger = {
		NOR = {
			prisoner = yes
			event_target:satanists_inductor = {
				is_alive = no
				is_devil_worshiper_trigger = no
			}
		}
	}

	fail_trigger_effect = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6993 } #notify broken chain
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_inductor = {
					is_alive = no
					is_devil_worshiper_trigger = no
				}
			}
			event_target:satanists_inductor = { 
				character_event = { id = MNM.6993 } #notify broken chain
			}
			break = yes
		}
	}

	option = {
		name = EVTOPTA_7015

		hidden_effect = {
			character_event = { id = MNM.6994 }
		}
	}
}

# Safety ping
character_event = {
	id = MNM.6994
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6993 }
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_inductor = { is_alive = yes }
			}
			event_target:satanists_inductor = { 
				clr_character_flag = event_MNM_7015
				set_character_flag = event_MNM_7016
				character_event = { id = MNM.7013 }
			}
			break = yes
		}
		# Else notify failure
		character_event = { id = MNM.6993 }
	}
}

character_event = {
	id = MNM.6989
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6993 }
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_inductor = { is_alive = yes }
			}
			event_target:satanists_inductor = { 
				clr_character_flag = event_MNM_7017
				set_character_flag = event_MNM_7018
				character_event = { id = MNM.7013 } 
			}
			break = yes
		}
		# Else notify failure
		character_event = { id = MNM.6993 }
	}
}

character_event = {
	id = MNM.6988
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6993 }
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_inductor = { is_alive = yes }
			}
			event_target:satanists_inductor = { 
				clr_character_flag = event_MNM_7017
				set_character_flag = event_MNM_7019
				character_event = { id = MNM.7013 } 
				
			}
			break = yes
		}
		# Else notify failure
		character_event = { id = MNM.6993 }
	}
}

character_event = {
	id = MNM.6987
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6993 }
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_inductor = { is_alive = yes }
			}
			event_target:satanists_inductor = { 
				clr_character_flag = event_MNM_7016
				set_character_flag = event_MNM_7017
				character_event = { id = MNM.7013 } 
			}
			break = yes
		}
		# Else notify failure
		character_event = { id = MNM.6993 }
	}
}

character_event = {
	id = MNM.6993
	desc = {
		text = EVTDESCA_MNM_6993
		trigger = { NOT = { has_character_flag = dw_recruitment_end_unable } }
	}
	desc = {
		text = EVTDESCB_MNM_6993
		trigger = { has_character_flag = dw_recruitment_end_unable }
		picture = GFX_evt_into_the_dungeon
	}
	picture = GFX_evt_dark_prayer
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	show_root = yes
	
	option = {
		name = {
			text = EVTOPTA_MNM_6993
			trigger = { NOT = { has_character_flag = dw_recruitment_end_unable } }
		}
		name = {
			text = EVTOPTB_MNM_6993
			trigger = { has_character_flag = dw_recruitment_end_unable }
		}
		custom_tooltip = { text = EVTTOOLTIP_MNM_6993 }
		clr_character_flag = being_recruited_by_the_satanists
		clr_character_flag = being_recruited_by_the_trollcrafters
		clr_character_flag = being_recruited_by_the_cult_of_kali
		clr_character_flag = being_recruited_by_the_cult_of_balor
		clr_character_flag = being_recruited_by_the_jinn
		clr_character_flag = being_recruited_by_the_titancult
		clr_character_flag = being_recruited_by_the_apepcult
		clr_character_flag = being_recruited_by_cult_of_angra_mainyu
		clr_character_flag = being_recruited_by_the_cold_ones
		clr_character_flag = being_recruited_by_the_plaguebringers
		clr_character_flag = dw_recruitment_end_unable
	}
}

#Meet the Seducer/Seductress who then leads you away
character_event = {
	id = MNM.7016
	picture = GFX_evt_secret_ceremony
	desc = EVTDESC_MNM_7016
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		NOR = {
			prisoner = yes
			event_target:satanists_inductor = {
				is_alive = no
				is_devil_worshiper_trigger = no
			}
		}
	}

	fail_trigger_effect = {
		if = {
			limit = {
				prisoner = yes
			}
			set_character_flag = dw_recruitment_end_unable
			character_event = { id = MNM.6993 } #notify broken chain
			break = yes
		}
		if = {
			limit = {
				event_target:satanists_inductor = {
					is_alive = no
					is_devil_worshiper_trigger = no
				}
			}
			event_target:satanists_inductor = { 
				character_event = { id = MNM.6993 } #notify broken chain
			}
			break = yes
		}
	}

	option = {
		name = EVTOPTA_7016
		custom_tooltip = { text = EVTOPTA_7016_TT }

		hidden_effect = {
			character_event = { id = MNM.6987 }
		}
	}
}

# Prove your ambition
character_event = {
	id = MNM.7017
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { }
		text = EVTDESC_MNM_7017_A 
	}

	is_triggered_only = yes
	
	immediate = {
		
	}

	#Anything for the coven and the power you offer
	option = {
		name = EVTOPTA_7017
		custom_tooltip = { text = EVTOPTA_7017_TT }

		hidden_effect = {
			character_event = { id = MNM.6989 }
		}

		ai_chance = { factor = 100 }
	}

	#I... I can't do this!
	option = {
		name = {
			text = EVTOPTB_7017
			trigger = { is_married = no }
		}
		name = {
			text = EVTOPTC_7017
			trigger = { is_married = yes }
		}
		custom_tooltip = { text = EVTOPTB_7017_TT }
		
		hidden_effect = { 
			random_list = {
				#Getaway
				33 = {
					set_character_flag = escape_successful

					modifier = {
						factor = 1.4
						attribute_diff = { character = FROM attribute = intrigue value = 2 }
					}
					modifier = {
						factor = 1.4
						attribute_diff = { character = FROM attribute = intrigue value = 4 }
					}
					modifier = {
						factor = 1.4
						attribute_diff = { character = FROM attribute = intrigue value = 6 }
					}
					modifier = {
						factor = 1.4
						combat_rating_diff = { character = FROM value = 1 }
					}
					modifier = {
						factor = 1.4
						combat_rating_diff = { character = FROM value = 2 }
					}
					modifier = {
						factor = 1.4
						combat_rating_diff = { character = FROM value = 3 }
					}
				}
				#Injured
				33 = {
					set_character_flag = escape_injured
				}
				#Death
				33 = {
					set_character_flag = escape_death
					modifier = {
						factor = 1.4
						FROM = { attribute_diff = { character = ROOT attribute = intrigue value = 2 } }
					}
					modifier = {
						factor = 1.4
						FROM = { attribute_diff = { character = ROOT attribute = intrigue value = 4 } }
					}
					modifier = {
						factor = 1.4
						FROM = { attribute_diff = { character = ROOT attribute = intrigue value = 6 } }
					}
					modifier = {
						factor = 1.4
						FROM = { combat_rating_diff = { character = ROOT value = 1 } }
					}
					modifier = {
						factor = 1.4
						FROM = { combat_rating_diff = { character = ROOT value = 2 } }
					}
					modifier = {
						factor = 1.4
						FROM = { combat_rating_diff = { character = ROOT value = 3 } }
					}
				}
			}
			
			character_event = { id = MNM.6988 }
		}

		ai_chance = { factor = 0 }
	}
}

#You are a member! - The inductor sleeping soundly
character_event = {
	id = MNM.7018
	picture = GFX_evt_dark_love
	desc = EVTDESC_MNM_7018
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	immediate = {
		#If original recruiter is still around, find Grand Master and have them send word of success to that original recruiter
		hidden_effect = {
			if = {
				limit = { event_target:satanists_recruiter = { always = yes } }
				event_target:satanists_recruiter = { set_character_flag = recruitment_success }

				if = { limit = { has_character_flag = being_recruited_by_the_satanists }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_satanists
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_trollcrafters }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_trollcrafters
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cult_of_kali }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cult_of_kali
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cult_of_balor }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cult_of_balor
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_jinn }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = arab_jinn_sorcerers
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_titancult }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_titan
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_apepcult }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_apep
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_cult_of_angra_mainyu }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_angra_mainyu
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cold_ones }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cold_ones
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_plaguebringers }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_plaguebringers
							}
						}
						save_event_target_as = grand_master
					}
				}
				event_target:grand_master = { character_event = { id = MNM.7021 } }
			}
		}
	}

	option = {
		name = EVTOPTA_7018 # I wish you'd found me sooner

		if = {
			limit = { has_character_flag = being_recruited_by_the_satanists }
			join_society = the_satanists
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_trollcrafters }
			join_society = the_trollcrafters
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cult_of_kali }
			join_society = the_cult_of_kali
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cult_of_balor }
			join_society = the_cult_of_balor
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_jinn }
			join_society = arab_jinn_sorcerers
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_titancult }
			join_society = cult_of_titan
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_apepcult }
			join_society = cult_of_apep
		}
		if = {
			limit = { has_character_flag = being_recruited_by_cult_of_angra_mainyu }
			join_society = cult_of_angra_mainyu
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cold_ones }
			join_society = the_cold_ones
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_plaguebringers }
			join_society = the_plaguebringers
		}

		if = { 
			limit = { ai = no }
		}

		opinion = {
			who = event_target:satanists_inductor
			modifier = opinion_budding_romance
		}

		event_target:satanists_inductor = {
			opinion = {
				who = ROOT
				modifier = opinion_budding_friendship
			}
		}

		hidden_effect = {
			clr_character_flag = being_recruited_by_the_satanists
			clr_character_flag = being_recruited_by_the_trollcrafters
			clr_character_flag = being_recruited_by_the_cult_of_kali
			clr_character_flag = being_recruited_by_the_cult_of_balor
			clr_character_flag = being_recruited_by_the_jinn
			clr_character_flag = being_recruited_by_the_titancult
			clr_character_flag = being_recruited_by_the_apepcult
			clr_character_flag = being_recruited_by_cult_of_angra_mainyu
			clr_character_flag = being_recruited_by_the_cold_ones
			clr_character_flag = being_recruited_by_the_plaguebringers
		}
	}
	option = {
		name = EVTOPTB_7018 # this was a necessary evil

		if = {
			limit = { has_character_flag = being_recruited_by_the_satanists }
			join_society = the_satanists
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_trollcrafters }
			join_society = the_trollcrafters
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cult_of_kali }
			join_society = the_cult_of_kali
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cult_of_balor }
			join_society = the_cult_of_balor
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_jinn }
			join_society = arab_jinn_sorcerers
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_titancult }
			join_society = cult_of_titan
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_apepcult }
			join_society = cult_of_apep
		}
		if = {
			limit = { has_character_flag = being_recruited_by_cult_of_angra_mainyu }
			join_society = cult_of_angra_mainyu
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cold_ones }
			join_society = the_cold_ones
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_plaguebringers }
			join_society = the_plaguebringers
		}

		event_target:satanists_inductor = {
			opinion = {
				who = ROOT
				modifier = opinion_very_disappointed
			}
		}

		hidden_effect = {
			if = {
				limit = { event_target:satanists_recruiter = { always = yes } }
				event_target:satanists_recruiter = { set_character_flag = recruitment_success } #notify original recruiter
				if = { limit = { has_character_flag = being_recruited_by_the_satanists }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_satanists
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_trollcrafters }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_trollcrafters
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cult_of_kali }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cult_of_kali
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cult_of_balor }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cult_of_balor
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_jinn }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = arab_jinn_sorcerers
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_titancult }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_titan
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_apepcult }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_apep
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_cult_of_angra_mainyu }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_angra_mainyu
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cold_ones }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cold_ones
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_plaguebringers }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_plaguebringers
							}
						}
						save_event_target_as = grand_master
					}
				}
				event_target:grand_master = { character_event = { id = MNM.7021 } }
			}
			clr_character_flag = being_recruited_by_the_satanists
			clr_character_flag = being_recruited_by_the_trollcrafters
			clr_character_flag = being_recruited_by_the_cult_of_kali
			clr_character_flag = being_recruited_by_the_cult_of_balor
			clr_character_flag = being_recruited_by_the_jinn
			clr_character_flag = being_recruited_by_the_titancult
			clr_character_flag = being_recruited_by_the_apepcult
			clr_character_flag = being_recruited_by_cult_of_angra_mainyu
			clr_character_flag = being_recruited_by_the_cold_ones
			clr_character_flag = being_recruited_by_the_plaguebringers
		}
	}
}

#You flee
character_event = {
	id = MNM.7019
	picture = GFX_evt_secret_ceremony
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { has_character_flag = escape_successful }
		text = EVTDESC_MNM_7019_A
	}
	desc = {
		trigger = { has_character_flag = escape_injured }
		text = EVTDESC_MNM_7019_B
	}
	desc = {
		trigger = { has_character_flag = escape_death }
		text = EVTDESC_MNM_7019_C
	}

	is_triggered_only = yes

	immediate = {
		#If original recruiter is still around, find Grand Master and have them send word of failure to that original recruiter
		hidden_effect = {
			if = {
				limit = { event_target:satanists_recruiter = { always = yes } }
				event_target:satanists_recruiter = { set_character_flag = recruitment_fail }
				
				if = { limit = { has_character_flag = being_recruited_by_the_satanists }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_satanists
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_trollcrafters }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_trollcrafters
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cult_of_kali }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cult_of_kali
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cult_of_balor }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cult_of_balor
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_jinn }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = arab_jinn_sorcerers
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_titancult }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_titan
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_apepcult }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_apep
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_cult_of_angra_mainyu }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_angra_mainyu
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cold_ones }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cold_ones
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_plaguebringers }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_plaguebringers
							}
						}
						save_event_target_as = grand_master
					}
				}
				event_target:grand_master = { character_event = { id = MNM.7021 } }
			}
		}

		clr_character_flag = being_recruited_by_the_satanists
		clr_character_flag = being_recruited_by_the_trollcrafters
		clr_character_flag = being_recruited_by_the_cult_of_kali
		clr_character_flag = being_recruited_by_the_cult_of_balor
		clr_character_flag = being_recruited_by_the_jinn
		clr_character_flag = being_recruited_by_the_titancult
		clr_character_flag = being_recruited_by_the_apepcult
		clr_character_flag = being_recruited_by_cult_of_angra_mainyu
		clr_character_flag = being_recruited_by_the_cold_ones
		clr_character_flag = being_recruited_by_the_plaguebringers
	}

	#Escape successfully
	option = {
		trigger = { has_character_flag = escape_successful }
		name = EVTOPTA_7019
		custom_tooltip = { text = EVTOPTA_7019_TT }

		clr_character_flag = escape_successful
	}

	#Escaped but got injured
	option = {
		trigger = { has_character_flag = escape_injured }
		name = EVTOPTB_7019
		custom_tooltip = { text = EVTOPTB_7019_TT }

		clr_character_flag = escape_injured

		add_maimed_trait_effect = yes
	}

	#Escaped but died
	option = {
		trigger = { has_character_flag = escape_death }
		name = EVTOPTC_7019
		custom_tooltip = { text = EVTOPTC_7019_TT }

		death = { death_reason = death_murder_unknown killer = FROM }
	}
}

#Opt out failstate
character_event = {
	id = MNM.7020
	picture = GFX_evt_secret_ceremony
	desc = EVTDESC_MNM_7020
	border = GFX_event_normal_frame_intrigue

	hide_from = yes

	is_triggered_only = yes

	option = {
		name = EVTOPTA_7020
		custom_tooltip = { text = EVTOPTA_7020_TT}
		clr_character_flag = being_recruited_by_the_satanists
		clr_character_flag = being_recruited_by_the_trollcrafters
		clr_character_flag = being_recruited_by_the_cult_of_kali
		clr_character_flag = being_recruited_by_the_cult_of_balor
		clr_character_flag = being_recruited_by_the_jinn
		clr_character_flag = being_recruited_by_the_titancult
		clr_character_flag = being_recruited_by_the_apepcult
		clr_character_flag = being_recruited_by_cult_of_angra_mainyu
		clr_character_flag = being_recruited_by_the_cold_ones
		clr_character_flag = being_recruited_by_the_plaguebringers
	}
}

#Ping event GM for outcome notification
character_event = {
	id = MNM.7021
	hide_window = yes

	is_triggered_only = yes

	immediate = { event_target:satanists_recruiter = { letter_event = { id = MNM.7022 days = 5 } } }
}

#Outcome of recruitment for the original recruiter (if there is one)
letter_event = {
	id = MNM.7022
	border = GFX_event_letter_frame_intrigue

	trigger = { is_devil_worshiper_trigger = yes }

	desc = {
		trigger = { has_character_flag = recruitment_success }
		text = EVTDESC_MNM_7022_A
	}
	desc = {
		trigger = { has_character_flag = recruitment_fail }
		text = EVTDESC_MNM_7022_B
	}

	is_triggered_only = yes

	option = {
		trigger = { has_character_flag = recruitment_success }
		name = EXCELLENT

		add_society_currency_medium_effect = yes
		clr_character_flag = recruitment_success
	}

	option = {
		trigger = { has_character_flag = recruitment_fail }
		name = CURSES

		clr_character_flag = recruitment_fail

	}
}

#First ping event for joining in case inductor(s) died
character_event = {
	id = MNM.7030
	hide_window = yes

	is_triggered_only = yes

	immediate = { 
		hidden_effect = {	
			if = {
				limit = {
					AND = {
						is_in_society = no
						OR = {
							has_character_flag = being_recruited_by_the_satanists
							has_character_flag = being_recruited_by_the_trollcrafters
							has_character_flag = being_recruited_by_the_cult_of_kali
							has_character_flag = being_recruited_by_the_cult_of_balor
							has_character_flag = being_recruited_by_the_jinn
							has_character_flag = being_recruited_by_the_titancult
							has_character_flag = being_recruited_by_the_apepcult
							has_character_flag = being_recruited_by_cult_of_angra_mainyu
							has_character_flag = being_recruited_by_the_cold_ones
							has_character_flag = being_recruited_by_the_plaguebringers
							has_character_flag = assassins_attempted_recruitment
						}
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_satanists }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_satanists
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_trollcrafters }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_trollcrafters
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cult_of_kali }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cult_of_kali
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cult_of_balor }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cult_of_balor
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_jinn }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = arab_jinn_sorcerers
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_titancult }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_titan
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_apepcult }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_apep
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_cult_of_angra_mainyu }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = cult_of_angra_mainyu
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_cold_ones }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_cold_ones
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = being_recruited_by_the_plaguebringers }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_plaguebringers
							}
						}
						save_event_target_as = grand_master
					}
				}
				if = { limit = { has_character_flag = assassins_attempted_recruitment }
					random_society_member = {
						limit = {
							society_rank = {
								rank == 4
								society = the_assassins
							}
						}
						save_event_target_as = grand_master
					}
				}
				event_target:grand_master = { character_event = { id = MNM.7031 } }
			}
			#Assassins
			clr_character_flag = ongoing_recruitment
			clr_character_flag = approves_of_shia
			clr_character_flag = disapproves_of_shia
			clr_character_flag = willing_to_join
			clr_character_flag = unwilling_to_join
			clr_character_flag = escape_successful
			clr_character_flag = escape_injured
			clr_character_flag = escape_death
			clr_character_flag = escape_bribe 
			#Devil Worshipers
			clr_character_flag = approves_of_satanism
			clr_character_flag = disapproves_of_satanism
			clr_character_flag = has_ill_lover_loc
			clr_character_flag = has_ill_spouse_loc
			clr_character_flag = has_ill_child_loc
			clr_character_flag = has_money_troubles_loc
			clr_character_flag = has_some_illness_loc
			clr_character_flag = has_need_of_winning_battles_loc
			clr_character_flag = has_a_rival_loc
			clr_character_flag = is_weak_loc
			clr_character_flag = is_dumb_loc
		}
	}
}

#Second ping event for joining in case inductor(s) died
character_event = {
	id = MNM.7031
	hide_window = yes

	is_triggered_only = yes

	immediate = { 
		FROM = {
			letter_event = { id = MNM.7032 }
		}
	}
}

#Joining event in case inductor(s) died
letter_event = {
	id = MNM.7032
	desc = {
		trigger = { NOT = { FROM = { society_member_of = the_assassins } } }
		text = EVTDESC_MNM_7032_A
	}
	desc = {
		trigger = { FROM = { society_member_of = the_assassins } }
		text = EVTDESC_MNM_7032_B
	}
	border = GFX_event_letter_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_7032 #I will join
		if = {
			limit = { has_character_flag = being_recruited_by_the_satanists }
			join_society = the_satanists
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_trollcrafters }
			join_society = the_trollcrafters
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cult_of_kali }
			join_society = the_cult_of_kali
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cult_of_balor }
			join_society = the_cult_of_balor
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_jinn }
			join_society = arab_jinn_sorcerers
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_titancult }
			join_society = cult_of_titan
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_apepcult }
			join_society = cult_of_apep
		}
		if = {
			limit = { has_character_flag = being_recruited_by_cult_of_angra_mainyu }
			join_society = cult_of_angra_mainyu
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_cold_ones }
			join_society = the_cold_ones
		}
		if = {
			limit = { has_character_flag = being_recruited_by_the_plaguebringers }
			join_society = the_plaguebringers
		}
		if = {
			limit = { has_character_flag = assassins_attempted_recruitment }
			join_society = the_assassins
		}

		hidden_effect = {
			clr_character_flag = being_recruited_by_the_satanists
			clr_character_flag = being_recruited_by_the_trollcrafters
			clr_character_flag = being_recruited_by_the_cult_of_kali
			clr_character_flag = being_recruited_by_the_cult_of_balor
			clr_character_flag = being_recruited_by_the_jinn
			clr_character_flag = being_recruited_by_the_titancult
			clr_character_flag = being_recruited_by_the_apepcult
			clr_character_flag = being_recruited_by_cult_of_angra_mainyu
			clr_character_flag = being_recruited_by_the_cold_ones
			clr_character_flag = being_recruited_by_the_plaguebringers
			clr_character_flag = assassins_attempted_recruitment
		}
	}

	option = {
		name = EVTOPTB_7032 #Changed my mind
		event_target:grand_master = {
			opinion = {
				who = ROOT
				modifier = opinion_rejected_society_membership
			}
		}
		hidden_effect = {
			clr_character_flag = being_recruited_by_the_satanists
			clr_character_flag = being_recruited_by_the_trollcrafters
			clr_character_flag = being_recruited_by_the_cult_of_kali
			clr_character_flag = being_recruited_by_the_cult_of_balor
			clr_character_flag = being_recruited_by_the_jinn
			clr_character_flag = being_recruited_by_the_titancult
			clr_character_flag = being_recruited_by_the_apepcult
			clr_character_flag = being_recruited_by_cult_of_angra_mainyu
			clr_character_flag = being_recruited_by_the_cold_ones
			clr_character_flag = being_recruited_by_the_plaguebringers
			clr_character_flag = assassins_attempted_recruitment
		}
		ai_chance = { factor = 0 }
	}
}

#Soul Corruption event
character_event = {
	id = MNM.7050
	picture = GFX_evt_dark_prayer
	desc = EVTDESC_MNM_7050
	border = GFX_event_normal_frame_intrigue

	hide_from = yes

	is_triggered_only = yes
	option = {
		name = EVTOPTA_MNM_7050
		trigger_switch = {
			on_trigger = has_character_flag
			corruption_remove_kind = { 
				remove_trait = kind
				clr_character_flag = corruption_remove_kind 
			}
			corruption_add_cruel = { 
				add_trait = cruel
				clr_character_flag = corruption_add_cruel 
			}
			corruption_remove_just = { 
				remove_trait = just
				clr_character_flag = corruption_remove_just
			}
			corruption_add_arbitrary = { 
				add_trait = arbitrary
				clr_character_flag = corruption_add_arbitrary
			}
			corruption_remove_honest = { 
				remove_trait = honest
				clr_character_flag = corruption_remove_honest
			}
			corruption_add_deceitful = { 
				add_trait = deceitful
				clr_character_flag = corruption_add_deceitful
			}
			corruption_add_possessed = { 
				add_trait = possessed
				clr_character_flag = corruption_add_possessed
			}
		}
	}	
}

#Soul corruption adds stress
character_event = {
	id = MNM.7051
	desc = EVTDESC_MNM_7051
	picture = GFX_evt_illness
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOT = { trait = stressed }
	}

	option = { 
		name = EVTOPTA_MNM_7051
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
		add_trait = stressed
	}
}

#Soul corruption adds lunatic
character_event = {
	id = MNM.7052
	desc = EVTDESC_MNM_7052
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOT = { trait = lunatic }
	}

	option = { 
		name = EVTOPTA_MNM_7052
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
		add_trait = lunatic
	}
}

#Soul corruption adds stutter
character_event = {
	id = MNM.7053
	desc = EVTDESC_MNM_7053
	picture = GFX_evt_uncomfortable
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOT = { trait = stutter }
	}

	option = { 
		name = EVTOPTA_MNM_7051
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
		add_trait = stutter
	}
}

#Soul corruption adds clubfooted
character_event = {
	id = MNM.7054
	desc = EVTDESC_MNM_7054
	picture = GFX_evt_uncomfortable
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOT = { trait = clubfooted }
	}

	option = { 
		name = EVTOPTA_MNM_7051
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
		add_trait = clubfooted
	}
}

#Soul corruption adds hunchback
character_event = {
	id = MNM.7055
	desc = EVTDESC_MNM_7055
	picture = GFX_evt_uncomfortable
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOT = { trait = hunchback }
	}

	option = { 
		name = EVTOPTA_MNM_7051
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
		add_trait = hunchback
	}
}

#Soul corruption adds ugly
character_event = {
	id = MNM.7056
	desc = EVTDESC_MNM_7056
	picture = GFX_evt_uncomfortable
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOT = { trait = ugly }
	}

	option = { 
		name = EVTOPTA_MNM_7051
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
		add_trait = ugly
		hidden_effect = { remove_trait = fair }
	}
}

#Soul corruption adds corrupting_magic_major
character_event = {
	id = MNM.7057
	desc = EVTDESC_MNM_7057
	picture = GFX_evt_illness
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOR = { 
			NOT = { health = 3 }
			has_character_modifier = corrupting_magic_minor
			has_character_modifier = corrupting_magic_major
		}
	}

	option = { 
		name = EVTOPTA_MNM_7051
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
		add_character_modifier = {
			name = corrupting_magic_major
			years = 3
		}
	}
}


#Soul corruption adds corrupting_magic_minor
character_event = {
	id = MNM.7058
	desc = EVTDESC_MNM_7058
	picture = GFX_evt_illness
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOR = { 
			NOT = { health = 3 }
			has_character_modifier = corrupting_magic_minor
			has_character_modifier = corrupting_magic_major
		}
	}

	option = { 
		name = EVTOPTA_MNM_7051
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
	   	add_character_modifier = {
			name = corrupting_magic_minor
			years = 3
		}
	}
}

#Soul corruption adds frail
character_event = {
	id = MNM.7059
	desc = EVTDESC_MNM_7059
	picture = GFX_evt_illness
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes
	
	trigger = {
		NOR = {
			trait = feeble
			trait = weak
			trait = strong
		}
	}

	option = { 
		name = EVTOPTA_MNM_7051
		custom_tooltip = { text = EVTOPTA_MNM_7051_TT }
		add_trait = feeble
		hidden_effect = { remove_trait = robust }
	}
}

### MISSIONS ###

#Desecration temporarily moved to mnm_devil_worshipers_events_axel to prevent future conflicts

### POWERS ###

#Power: Corrupt a priest 

#Ping event for Corrupt a priest
character_event = {
	id = MNM.7825
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		save_event_target_as = corrupt_priest_target
		FROMFROM = {
			save_event_target_as = corrupt_priest_spell_caster
		}
		event_target:corrupt_priest_spell_caster = {
			character_event = { id = MNM.7826 }
		}
	}
}

#Corrupt a Priest (find out whether corruptible)
character_event = {
	id = MNM.7826
	picture = GFX_evt_dark_prayer
	desc = EVTDESC_MNM_7826
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		is_devil_worshiper_trigger = yes
	}

	option = {
		name = EVTOPTA_MNM_7826 #try to find something new to corrupt them with (add new sinful traits)
		trigger = {
			event_target:corrupt_priest_target = {
				OR = {
					AND = {
						NOT = { trait = lustful }
						NOT = { trait = chaste }
					}
					AND = {
						NOT = { trait = temperate }
						NOT = { trait = gluttonous }
					}
					AND = {
						NOT = { trait = charitable }
						NOT = { trait = greedy }
					}
					AND = {
						NOT = { trait = diligent }
						NOT = { trait = slothful }
					}
					AND = {
						NOT = { trait = kind }
						OR = {
							NOT = { trait = envious }
							NOT = { trait = cruel }
						}	
					}
					AND = {
						NOT = { trait = patient }
						NOT = { trait = wroth }
					}
					AND = {
						NOT = { trait = humble }
						NOT = { trait = proud }
					}
					AND = {
						NOT = { trait = honest }
						NOT = { trait = deceitful }
					}
					AND = {
						NOT = { trait = just }
						NOT = { trait = arbitrary }
					}
				}
			}
		}
		custom_tooltip = { text = EVTOPTA_MNM_7826_TOOLTIP }
		hidden_effect = {
			event_target:corrupt_priest_target = {
				character_event = { id = MNM.7827 days = 3 random = 27 } 
			}
		}		
	}
	option = {
		name = EVTOPTB_MNM_7826 #remove virtues (slight chance to add new sinful traits)
		trigger = {
			event_target:corrupt_priest_target = {
				OR = {
					trait = chaste
					trait = temperate
					trait = charitable
					trait = diligent
					trait = kind
					trait = patient
					trait = humble
					trait = honest
					trait = just
				}
			}
		}
		custom_tooltip = { text = EVTOPTB_MNM_7826_TOOLTIP }
		hidden_effect = {
			event_target:corrupt_priest_target = {
				character_event = { id = MNM.7828 days = 3 random = 27 }
			}
		}		
	}
	option = {
		name = EVTOPTC_MNM_7826 #nevermind I'm a nice guy
		custom_tooltip = { text = EVTOPTC_MNM_7826_TOOLTIP }
		hidden_effect = {
			event_target:corrupt_priest_target = {
				clr_character_flag = attempted_corrupt_priest
			}
		}
	}
}

#Ping event for Corrupt a Priest find new sinful traits
character_event = {
	id = MNM.7827
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		FROM = { is_devil_worshiper_trigger = yes }
	}

	immediate = {
		event_target:corrupt_priest_target = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = lustful
							trait = chaste
						} 
					}
					set_character_flag = corrupt_priest_add_lustful
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = gluttonous
							trait = temperate
						} 
					}
					set_character_flag = corrupt_priest_add_gluttonous
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = greedy
							trait = charitable
						} 
					}
					set_character_flag = corrupt_priest_add_greedy
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = slothful
							trait = diligent
						} 
					}
					set_character_flag = corrupt_priest_add_slothful
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = envious
							trait = kind
						} 
					}
					set_character_flag = corrupt_priest_add_envious		
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = wroth
							trait = patient
						} 
					}
					set_character_flag = corrupt_priest_add_wroth		
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = proud
							trait = humble
						} 
					}
					set_character_flag = corrupt_priest_add_proud		
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = deceitful
							trait = honest
						} 
					}
					set_character_flag = corrupt_priest_add_deceitful		
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = arbitrary
							trait = just
						} 
					}
					set_character_flag = corrupt_priest_add_arbitrary		
				}
				10 = {
					modifier = {
						factor = 0
						OR = {
							trait = cruel
							trait = kind
						} 
					}
					set_character_flag = corrupt_priest_add_cruel		
				}
			}
		}
		event_target:corrupt_priest_spell_caster = {
			character_event = { id = MNM.7830 }
		}
	}
}

#Ping event for Corrupt a Priest remove virtue traits
character_event = {
	id = MNM.7828
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		event_target:corrupt_priest_target = {
			random_list = {
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = chaste } 
					}
					set_character_flag = corrupt_priest_remove_chaste
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = temperate } 
					}
					set_character_flag = corrupt_priest_remove_temperate
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = charitable } 
					}
					set_character_flag = corrupt_priest_remove_charitable
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = diligent } 
					}
					set_character_flag = corrupt_priest_remove_diligent
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = kind } 
					}
					set_character_flag = corrupt_priest_remove_kind	
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = patient } 
					}
					set_character_flag = corrupt_priest_remove_patient	
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = humble } 
					}
					set_character_flag = corrupt_priest_remove_humble	
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = honest } 
					}
					set_character_flag = corrupt_priest_remove_honest	
				}
				10 = {
					modifier = {
						factor = 0
						NOT = { trait = just } 
					}
					set_character_flag = corrupt_priest_remove_just	
				}
			}
		}
		event_target:corrupt_priest_spell_caster = {
			character_event = { id = MNM.7835 }
		}
	}
}

#Corrupt a priest add trait: corrupt them!
character_event = {
	id = MNM.7830
	picture = GFX_evt_eavesdropping
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_add_lustful
			}
		}
		text = EVTDESC_MNM_7830_lustful
	}
	desc = {
		trigger = { 
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_add_gluttonous
			}
		}
		text = EVTDESC_MNM_7830_gluttonous
	}
	desc = {
		trigger = { 
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_add_greedy
			}
		}
		text = EVTDESC_MNM_7830_greedy
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_add_slothful
			}
		}
		text = EVTDESC_MNM_7830_slothful
	}
	desc = {
		trigger = { 
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_add_envious
			}
		}
		text = EVTDESC_MNM_7830_envious
	}
	desc = {
		trigger = { 
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_add_wroth
			}
		}
		text = EVTDESC_MNM_7830_wroth
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_add_proud
			}
		}
		text = EVTDESC_MNM_7830_proud
	}
	desc = {
		trigger = { 
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_add_deceitful
			}
		}
		text = EVTDESC_MNM_7830_deceitful
	}
	desc = {
		trigger = { 
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_add_arbitrary
			}
		}
		text = EVTDESC_MNM_7830_arbitrary
	}
	desc = {
		trigger = { 
	   		event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_add_cruel
			}
		}
		text = EVTDESC_MNM_7830_cruel
	}
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7830 #try to corrupt them
		custom_tooltip = { text = EVTOPTA_MNM_7830_TOOLTIP }
		hidden_effect = {
			random_list = {
				50 = {
					modifier = {
						factor = 2
						event_target:corrupt_priest_target = {
							OR = {
								trait = bad_priest_christian
								trait = bad_priest_muslim
								trait = bad_priest_norse
								trait = bad_priest_tengri
								trait = bad_priest_zoroastrian
								trait = bad_priest_aztec
							}
						}
					}
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7831 days = 15 random = 45 } #success event
						}
					}
				}
				50 = {
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7833 days = 15 random = 45 } #failure event
						}
					}
				}
			}	
		}
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0
				OR = {
					diplomacy = 15
					intrigue = 15
				}
			}
		}	
	}
	option = {
		trigger = {
			AND = { 
				has_society_currency_minor_trigger = yes
				NAND = {
					has_quest = quest_devil_worshipers_corrupt_priest
					quest_target = { character = event_target:corrupt_priest_target }
				}
			}
		}
		name = EVTOPTB_MNM_7830 #use dark power to corrupt them
		custom_tooltip = { text = EVTOPTB_MNM_7830_TOOLTIP }
		hidden_effect = {
			event_target:corrupt_priest_spell_caster = {
				detract_society_currency_minor_effect = yes
			}
			event_target:corrupt_priest_target = {
				character_event = { id = MNM.7831 days = 15 random = 45 } #success event
			}
		}
		ai_chance = { factor = 0 }		
	}
	option = {
		name = EVTOPTC_MNM_7830 #use diplomacy to talk them into it
		tooltip_info = diplomacy
		trigger = {
			diplomacy = 15
		}
		custom_tooltip = { text = EVTOPTC_MNM_7830_TOOLTIP }
		hidden_effect = {
			random_list = {
				90 = {
					modifier = {
						factor = 2
						event_target:corrupt_priest_target = {
							OR = {
								trait = bad_priest_christian
								trait = bad_priest_muslim
								trait = bad_priest_norse
								trait = bad_priest_tengri
								trait = bad_priest_zoroastrian
								trait = bad_priest_aztec
							}
						}
					}
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7831 days = 15 random = 45 } #success event
						}
					}
				}
				10 = {
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7833 days = 15 random = 45 } #failure event
						}
					}
				}
			}
		}
		ai_chance = {
			factor = 33
		}	
	}
	option = {
		name = EVTOPTD_MNM_7830 #use learning to reason them into it
		tooltip_info = learning
		trigger = {
			learning = 15
		}
		custom_tooltip = { text = EVTOPTD_MNM_7830_TOOLTIP }
		hidden_effect = {
			random_list = {
				90 = {
					modifier = {
						factor = 2
						event_target:corrupt_priest_target = {
							OR = {
								trait = bad_priest_christian
								trait = bad_priest_muslim
								trait = bad_priest_norse
								trait = bad_priest_tengri
								trait = bad_priest_zoroastrian
								trait = bad_priest_aztec
							}
						}
					}
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7831 days = 15 random = 45 } #success event
						}
					}
				}
				10 = {
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7833 days = 15 random = 45 } #failure event
						}
					}
				}
			}
		}
		ai_chance = {
			factor = 33
		}	
	}
}
	

#Ping event for corrupt a priest adding trait successful
character_event = {
	id = MNM.7831
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_lustful
			}
			event_target:corrupt_priest_target = {
				add_trait_lustful_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_gluttonous
			}
			event_target:corrupt_priest_target = {
				add_trait_gluttonous_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_greedy
			}
			event_target:corrupt_priest_target = {
				add_trait_greedy_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_slothful
			}
			event_target:corrupt_priest_target = {
				add_trait_slothful_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_envious
			}
			event_target:corrupt_priest_target = {
				add_trait_envious_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_wroth
			}
			event_target:corrupt_priest_target = {
				add_trait_wroth_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_proud
			}
			event_target:corrupt_priest_target = {
				add_trait_proud_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_deceitful
			}
			event_target:corrupt_priest_target = {
				add_trait_deceitful_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_arbitrary
			}
			event_target:corrupt_priest_target = {
				add_trait_arbitrary_effect = yes
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_add_cruel
			}
			event_target:corrupt_priest_target = {
				add_trait_cruel_effect = yes
			}
		}
		event_target:corrupt_priest_spell_caster = {
			character_event = { id = MNM.7832 }
		}
	}
}

#Corrupt a Priest successful corruption notification
character_event = {
	id = MNM.7832
	picture = GFX_evt_shady_meeting
	###default descriptions
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {
	   			AND = { 
					has_character_flag = corrupt_priest_add_lustful
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_lustful
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_gluttonous
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_gluttonous
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_greedy
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_greedy
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_slothful
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_slothful
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_envious
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_envious
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_wroth
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_wroth
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_proud
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_proud
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_deceitful
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_deceitful
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_arbitrary
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_arbitrary
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				AND = { 
					has_character_flag = corrupt_priest_add_cruel
					NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
				}
			}
		}
		text = EVTDESC_MNM_7832_cruel
	}

	###bonus descriptions if resulting from event id = MNM.7836

	desc = {
		trigger = {
			event_target:corrupt_priest_target = {
	   			AND = {
	   				OR = {
	   					has_character_flag = corrupt_priest_add_lustful
						has_character_flag = corrupt_priest_add_gluttonous
						has_character_flag = corrupt_priest_add_greedy
						has_character_flag = corrupt_priest_add_slothful
						has_character_flag = corrupt_priest_add_envious
						has_character_flag = corrupt_priest_add_wroth
						has_character_flag = corrupt_priest_add_proud
						has_character_flag = corrupt_priest_add_deceitful
						has_character_flag = corrupt_priest_add_arbitrary
						has_character_flag = corrupt_priest_add_cruel
	   				} 
					has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption }
				}
			}
		}
		text = EVTDESC_MNM_7832_bonus
	}

	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7832 #event option if standard event
		trigger = {
			event_target:corrupt_priest_target = {
				NOT = { has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption } }
			}
		}
		custom_tooltip = { text = EVTOPTA_MNM_7832_TOOLTIP }
		reverse_opinion = {
			who = event_target:corrupt_priest_target
			modifier = opinion_successful_corruption
			years = 100
		}
		if = {
			limit = {
				event_target:corrupt_priest_spell_caster = { ai = no }
			}
			event_target:corrupt_priest_target = { set_character_flag = corrupted_by_player }
		}
		hidden_effect = {
			event_target:corrupt_priest_target = {
				clr_character_flag = corrupt_priest_add_lustful
				clr_character_flag = corrupt_priest_add_gluttonous
				clr_character_flag = corrupt_priest_add_greedy
				clr_character_flag = corrupt_priest_add_slothful
				clr_character_flag = corrupt_priest_add_envious
				clr_character_flag = corrupt_priest_add_wroth
				clr_character_flag = corrupt_priest_add_proud
				clr_character_flag = corrupt_priest_add_deceitful
				clr_character_flag = corrupt_priest_add_arbitrary
				clr_character_flag = corrupt_priest_add_cruel
				clr_character_flag = attempted_corrupt_priest
			}
			event_target:corrupt_priest_spell_caster = {
				if = {
					limit = {
						NAND = {
							has_quest = quest_devil_worshipers_corrupt_priest
							quest_target = { character = event_target:corrupt_priest_target }
						}
					}
					add_society_currency_minor_effect = yes
				}
				#If quest holder, clear quest and reward
				if = {
					limit = { 
						has_quest = quest_devil_worshipers_corrupt_priest
						quest_target = { character = event_target:corrupt_priest_target }
					} 
					clr_quest = quest_devil_worshipers_corrupt_priest
					sound_effect = devil_worshippers_corrupt_priest_01
		
					if = {
						limit = { event_target:corrupt_priest_target = { higher_tier_than = DUKE } }
						add_society_currency_major_effect = yes
					}
					if = {
						limit = { event_target:corrupt_priest_target = { tier = DUKE } } 
						add_society_currency_medium_effect = yes
					}
					if = {
						limit = { event_target:corrupt_priest_target = { lower_tier_than = DUKE } }
						add_society_currency_minor_effect = yes
					}
				}
				minor_soul_corruption_effect = yes
			}
		}	
	}

	option = {
		name = EVTOPTB_MNM_7832 #event option if bonus event
		trigger = {
			event_target:corrupt_priest_target = {
				has_opinion_modifier = { who = event_target:corrupt_priest_spell_caster modifier = opinion_successful_corruption }
			}
		}
		custom_tooltip = { text = EVTOPTB_MNM_7832_TOOLTIP }
		hidden_effect = {
			event_target:corrupt_priest_spell_caster = {
				add_society_currency_medium_effect = yes
			}
			event_target:corrupt_priest_target = {
				clr_character_flag = corrupt_priest_add_lustful
				clr_character_flag = corrupt_priest_add_gluttonous
				clr_character_flag = corrupt_priest_add_greedy
				clr_character_flag = corrupt_priest_add_slothful
				clr_character_flag = corrupt_priest_add_envious
				clr_character_flag = corrupt_priest_add_wroth
				clr_character_flag = corrupt_priest_add_proud
				clr_character_flag = corrupt_priest_add_deceitful
				clr_character_flag = corrupt_priest_add_arbitrary
				clr_character_flag = corrupt_priest_add_cruel
			}
		}	
	}
}

#Ping event for corrupt a priest adding trait failure
character_event = {
	id = MNM.7833
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		event_target:corrupt_priest_spell_caster = {
			character_event = { id = MNM.7834 }
		}
	}
}

#Corrupt a Priest failed corruption notification
character_event = {
	id = MNM.7834
	picture = GFX_evt_scandal
	desc = EVTDESC_MNM_7834
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7834
		custom_tooltip = { text = EVTOPTA_MNM_7834_TOOLTIP }
		hidden_effect = {
			increase_visibility_effect = yes
			reverse_opinion = {
				who = event_target:corrupt_priest_target
				modifier = opinion_failed_corruption
				years = 10
			}
			any_realm_character = { #exposed corrupter -10
				opinion = {
					who = event_target:corrupt_priest_spell_caster
					modifier = opinion_known_corrupter
					years = 10
				}
			}
			event_target:corrupt_priest_target = {
				clr_character_flag = corrupt_priest_add_lustful
				clr_character_flag = corrupt_priest_add_gluttonous
				clr_character_flag = corrupt_priest_add_greedy
				clr_character_flag = corrupt_priest_add_slothful
				clr_character_flag = corrupt_priest_add_envious
				clr_character_flag = corrupt_priest_add_wroth
				clr_character_flag = corrupt_priest_add_proud
				clr_character_flag = corrupt_priest_add_deceitful
				clr_character_flag = corrupt_priest_add_arbitrary
				clr_character_flag = corrupt_priest_add_cruel
				clr_character_flag = attempted_corrupt_priest
			}
		}
		if = {
			limit = {
				has_quest = quest_devil_worshipers_corrupt_priest
			}
			clr_quest = { id = quest_devil_worshipers_corrupt_priest failure = yes } 
		}	
	}
}

#Corrupt a priest remove trait: corrupt them!
character_event = {
	id = MNM.7835
	picture = GFX_evt_eavesdropping
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_chaste
			}
		}
		text = EVTDESC_MNM_7835_remove_chaste
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_temperate
			}
		}
		text = EVTDESC_MNM_7835_remove_temperate
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_charitable
			}
		}
		text = EVTDESC_MNM_7835_remove_charitable
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_diligent
			}
		}
		text = EVTDESC_MNM_7835_remove_diligent
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_kind
			}
		}
		text = EVTDESC_MNM_7835_remove_kind
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_patient
			}
		}
		text = EVTDESC_MNM_7835_remove_patient
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_humble
			}
		}
		text = EVTDESC_MNM_7835_remove_humble
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_honest
			}
		}
		text = EVTDESC_MNM_7835_remove_honest
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {  
				has_character_flag = corrupt_priest_remove_just
			}
		}
		text = EVTDESC_MNM_7835_remove_just
	}
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7835 #try to corrupt them
		custom_tooltip = { text = EVTOPTA_MNM_7835_TOOLTIP }
		hidden_effect = {
			random_list = {
				50 = {
					modifier = {
						factor = 2
						event_target:corrupt_priest_target = {
							OR = {
								trait = bad_priest_christian
								trait = bad_priest_muslim
								trait = bad_priest_norse
								trait = bad_priest_tengri
								trait = bad_priest_zoroastrian
								trait = bad_priest_aztec
							}
						}
					}
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7836 days = 15 random = 45 } #success event
						}
					}
				}
				50 = {
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7833 days = 15 random = 45 } #failure event
						}
					}
				}
			}
		}
		ai_chance = {
			factor = 33
			modifier = {
				factor = 0
				OR = {
					diplomacy = 15
					intrigue = 15
				}
			}
		}		
	}
	option = {
		trigger = {
			AND = { 
				has_society_currency_minor_trigger = yes
				NAND = {
					has_quest = quest_devil_worshipers_corrupt_priest
					quest_target = { character = event_target:corrupt_priest_target }
				}
			}
		}
		name = EVTOPTB_MNM_7835 #use dark power to corrupt them
		custom_tooltip = { text = EVTOPTB_MNM_7835_TOOLTIP }
		hidden_effect = {
			event_target:corrupt_priest_spell_caster = {
				detract_society_currency_minor_effect = yes
			}
			event_target:corrupt_priest_target = {
				character_event = { id = MNM.7836 days = 15 random = 45 } #success event
			}
		}
		ai_chance = { factor = 0 }		
	}
	option = {
		name = EVTOPTC_MNM_7835 #use diplomacy to talk them into it
		tooltip_info = diplomacy
		trigger = {
			diplomacy = 15
		}
		custom_tooltip = { text = EVTOPTC_MNM_7835_TOOLTIP }
		hidden_effect = {
			random_list = {
				90 = {
					modifier = {
						factor = 2
						event_target:corrupt_priest_target = {
							OR = {
								trait = bad_priest_christian
								trait = bad_priest_muslim
								trait = bad_priest_norse
								trait = bad_priest_tengri
								trait = bad_priest_zoroastrian
								trait = bad_priest_aztec
							}
						}
					}
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7836 days = 15 random = 45 } #success event
						}
					}
				}
				10 = {
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7833 days = 15 random = 45 } #failure event
						}
					}
				}
			}	
		}
		ai_chance = {
			factor = 33
		}
	}
	option = {
		name = EVTOPTD_MNM_7835 #use learning to reason them into it
		tooltip_info = learning
		trigger = {
			learning = 15
		}
		custom_tooltip = { text = EVTOPTD_MNM_7835_TOOLTIP }
		hidden_effect = {
			random_list = {
				90 = {
					modifier = {
						factor = 2
						event_target:corrupt_priest_target = {
							OR = {
								trait = bad_priest_christian
								trait = bad_priest_muslim
								trait = bad_priest_norse
								trait = bad_priest_tengri
								trait = bad_priest_zoroastrian
								trait = bad_priest_aztec
							}
						}
					}
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7836 days = 15 random = 45 } #success event
						}
					}
				}
				10 = {
					hidden_effect = {
						event_target:corrupt_priest_target = {
							character_event = { id = MNM.7833 days = 15 random = 45 } #failure event
						}
					}
				}
			}	
		}
		ai_chance = {
			factor = 33
		}
	}
}

#Ping event for corrupt a priest removing trait successful, leads back to event id = MNM.7831 (because recycling = awesome!)
character_event = {
	id = MNM.7836
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_chaste
			}
			event_target:corrupt_priest_target = {
				remove_trait_chaste_effect = yes
				random = {
					chance = 10
					set_character_flag = corrupt_priest_add_lustful
					character_event = { id = MNM.7831 days = 30 random = 330 }
				}
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_temperate
			}
			event_target:corrupt_priest_target = {
				remove_trait_temperate_effect = yes
				random = {
					chance = 10
					set_character_flag = corrupt_priest_add_gluttonous
					character_event = { id = MNM.7831 days = 30 random = 330 }
				}
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_charitable
			}
			event_target:corrupt_priest_target = {
				remove_trait_charitable_effect = yes
				random = {
					chance = 10
					set_character_flag = corrupt_priest_add_greedy
					character_event = { id = MNM.7831 days = 30 random = 330 }
				}
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_diligent
			}
			event_target:corrupt_priest_target = {
				remove_trait_diligent_effect = yes
				random = {
					chance = 10
					set_character_flag = corrupt_priest_add_slothful
					character_event = { id = MNM.7831 days = 30 random = 330 }
				}
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_kind
			}
			event_target:corrupt_priest_target = {
				remove_trait_kind_effect = yes
				random_list = {
					5 = {
						set_character_flag = corrupt_priest_add_envious
						character_event = { id = MNM.7831 days = 30 random = 330 }
					}
					5 = {
						set_character_flag = corrupt_priest_add_cruel
						character_event = { id = MNM.7831 days = 30 random = 330 }
					}
					90 = { }
				}
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_patient
			}
			event_target:corrupt_priest_target = {
				remove_trait_patient_effect = yes
				random = {
					chance = 10
					set_character_flag = corrupt_priest_add_wroth
					character_event = { id = MNM.7831 days = 30 random = 330 }
				}
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_humble
			}
			event_target:corrupt_priest_target = {
				remove_trait_humble_effect = yes
				random = {
					chance = 10
					set_character_flag = corrupt_priest_add_proud
					character_event = { id = MNM.7831 days = 30 random = 330 }
				}
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_honest
			}
			event_target:corrupt_priest_target = {
				remove_trait_honest_effect = yes
				random = {
					chance = 10
					set_character_flag = corrupt_priest_add_deceitful
					character_event = { id = MNM.7831 days = 30 random = 330 }
				}
			}
		}
		if = {
			limit = {
				has_character_flag = corrupt_priest_remove_just
			}
			event_target:corrupt_priest_target = {
				remove_trait_just_effect = yes
				random = {
					chance = 10
					set_character_flag = corrupt_priest_add_arbitrary
					character_event = { id = MNM.7831 days = 30 random = 330 }
				}
			}
		}
		event_target:corrupt_priest_spell_caster = {
			character_event = { id = MNM.7837 }
		}
	}
}

#Corrupt a Priest successful corruption notification (remove trait)
character_event = {
	id = MNM.7837
	picture = GFX_evt_shady_meeting
	desc = {
		trigger = {
			event_target:corrupt_priest_target = {			
				has_character_flag = corrupt_priest_remove_chaste
			}
		}
		text = EVTDESC_MNM_7837_chaste
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_remove_temperate
			}
		}
		text = EVTDESC_MNM_7837_temperate
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_remove_charitable
			}
		}
		text = EVTDESC_MNM_7837_charitable
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_remove_diligent
			}
		}
		text = EVTDESC_MNM_7837_diligent
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_remove_kind
			}
		}
		text = EVTDESC_MNM_7837_kind
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_remove_patient
			}
		}
		text = EVTDESC_MNM_7837_patient
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_remove_humble
			}
		}
		text = EVTDESC_MNM_7837_humble
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_remove_honest
			}
		}
		text = EVTDESC_MNM_7837_honest
	}
	desc = {
		trigger = {
			event_target:corrupt_priest_target = { 
				has_character_flag = corrupt_priest_remove_just
			}
		}
		text = EVTDESC_MNM_7837_just
	}

	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7837
		custom_tooltip = { text = EVTOPTA_MNM_7837_TOOLTIP }
		reverse_opinion = {
			who = event_target:corrupt_priest_target
			modifier = opinion_successful_corruption
			years = 100
		}
		if = {
			limit = {
				event_target:corrupt_priest_spell_caster = { ai = no }
			}
			event_target:corrupt_priest_target = { set_character_flag = corrupted_by_player }
		}
		hidden_effect = {
			event_target:corrupt_priest_target = {
				clr_character_flag = corrupt_priest_remove_chaste
				clr_character_flag = corrupt_priest_remove_temperate
				clr_character_flag = corrupt_priest_remove_charitable
				clr_character_flag = corrupt_priest_remove_diligent
				clr_character_flag = corrupt_priest_remove_kind
				clr_character_flag = corrupt_priest_remove_patient
				clr_character_flag = corrupt_priest_remove_humble
				clr_character_flag = corrupt_priest_remove_honest
				clr_character_flag = corrupt_priest_remove_just
				clr_character_flag = attempted_corrupt_priest
			}
			event_target:corrupt_priest_spell_caster = {
				#If not quest holder, give some currency
				if = {
					limit = {
						NAND = { 
							has_quest = quest_devil_worshipers_corrupt_priest
							quest_target = { character = event_target:corrupt_priest_target }
						}
					}
					add_society_currency_minor_effect = yes
				}
				#If quest holder, clear quest and reward
				if = {
					limit = {
						has_quest = quest_devil_worshipers_corrupt_priest
						quest_target = { character = event_target:corrupt_priest_target }
					} 
					clr_quest = quest_devil_worshipers_corrupt_priest
					sound_effect = devil_worshippers_corrupt_priest_01
		
					if = {
						limit = { event_target:corrupt_priest_target = { higher_tier_than = DUKE } }
						add_society_currency_major_effect = yes
					}
					if = {
						limit = { event_target:corrupt_priest_target = { tier = DUKE } } 
						add_society_currency_medium_effect = yes
					}
					if = {
						limit = { event_target:corrupt_priest_target = { lower_tier_than = DUKE } }
						add_society_currency_minor_effect = yes
					}
				}
				minor_soul_corruption_effect = yes
			}
		}	
	}
}

##Demonic Healing##

#Demonic Healing opening#
character_event = {
	id = MNM.7118
	picture = GFX_evt_magic_ritual
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	desc = EVTDESC_MNM_7118
	immediate = {
		if = {
			limit = { has_disease_trigger = yes }
			set_character_flag = dark_healing_disease_flag
		}
		if = {
			limit = { is_maimed_trigger = yes }
			set_character_flag = dark_healing_maimed_flag
		}
		if = {
			limit = {
				OR = {
					trait = wounded
					AND = {
						has_dlc = "Reapers"
						OR = {
							trait = severely_injured
							trait = infection
						}
					}
				}
			}
			set_character_flag = dark_healing_injured
		}
	}

	option = {
		name = EVTOPTA_MNM_7118
		custom_tooltip = {
			text = EVTOPTA_MNM_7118_TOOLTIP
		}
		character_event = { id = MNM.7119 days = 2 }
	}
}

#Demonic Healing result
character_event = {
	id = MNM.7119
	picture = GFX_evt_magic_ritual
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { NOT = { has_dlc = "Reapers" } }
			random_list = {
				3 = { set_character_flag = dark_healing_nothing_happened }
				7 = {
					random_list = {
						10 = {
							modifier = {
								NOT = {trait = maimed}
								factor = 0
							}
							set_character_flag = dark_healing_maimed_healed
						}
						10 = {
							modifier = {
								NOT = {trait = infirm}
								factor = 0
							}
							set_character_flag = dark_healing_infirm
						}
						5 = {
							modifier = {
								NOT = { trait = incapable }
								factor = 0
							}
							set_character_flag = dark_healing_incapable
						}
						5 = {
							modifier = {
								NOT = { trait = eunuch }
								factor = 0
							}
							set_character_flag = dark_healing_eunuch
						}
						5 = {
							modifier = {
								NOT = { trait = blinded }
								factor = 0
							}
							set_character_flag = dark_healing_blinded
						}
					}
				}
			}
		}
	
		if = {
			limit = { has_dlc = "Reapers" }
						
			random_list = {
				3 = { set_character_flag = dark_healing_nothing_happened }
				7 = {
					random_list = {
						10 = {
							modifier = {
								OR = {
									trait = flu
									trait = food_poisoning
								}
								factor = 2
							}
							modifier = {
								trait = cancer
								NOT = { trait = has_measles }
								NOT = { trait = flu }
								NOT = { trait = food_poisoning }
								NOT = { trait = gout }
								NOT = { trait = scurvy }
								NOT = { trait = lovers_pox }
								NOT = { trait = pneumonic }
								NOT = { trait = syphilitic }
								NOT = { trait = leper }
								factor = 0.5
							}
							remove_random_disease_effect = yes # sets a flag to remove random "regular" disease
							set_character_flag = dark_healing_disease_removed
						}
						10 = {
							modifier = {
								NOT = { has_epidemic_disease_trigger = yes }
								factor = 0
							}
							remove_random_epidemic_disease_effect = yes # sets a flag to remove random epidemic disease
							set_character_flag = dark_healing_disease_removed
						}
						10 = {
							modifier = {
								is_maimed_trigger = no
								factor = 0
							}
							modifier = {
								trait = mangled
								factor = 2
							}
							remove_random_maimed_effect = yes
							set_character_flag = dark_healing_maimed_healed
						}
						10 = {
							modifier = {
								NOT = { trait = infirm }
								factor = 0
							}
							set_character_flag = dark_healing_infirm
						}
						10 = {
							modifier = {
								NOT = { trait = incapable }
								factor = 0
							}
							set_character_flag = dark_healing_incapable
						}
						10 = {
							modifier = {
								NOT = { trait = eunuch }
								factor = 0
							}
							set_character_flag = dark_healing_eunuch
						}
						10 = {
							modifier = {
								NOT = { trait = blinded }
								factor = 0
							}
							set_character_flag = dark_healing_blinded
						}
					}
				}
			}
		}
	}

	desc = {
		trigger = {
			OR = {
				has_character_flag = dark_healing_incapable
				has_character_flag = dark_healing_infirm
			}
		}
		text = EVTDESC_MNM_7119_INCAPABLE_INFIRM
	}
	desc = {
		trigger = {
			has_character_flag = dark_healing_blinded
		}
		text = EVTDESC_MNM_7119_BLINDED
	}
	desc = {
		trigger = {
			has_character_flag = dark_healing_eunuch
		}
		text = EVTDESC_MNM_7119_EUNUCH
	}

	desc = {
		trigger = {
			has_character_flag = dark_healing_maimed_healed
		}
		text = EVTDESC_MNM_7119_MAIMED
	}

	desc = {
		trigger = {
			NOT = {
				has_character_flag = dark_healing_incapable
				has_character_flag = dark_healing_eunuch
				has_character_flag = dark_healing_blinded
				has_character_flag = dark_healing_maimed_healed
				has_character_flag = dark_healing_infirm
			}
			has_character_flag = dark_healing_disease_flag
			has_character_flag = dark_healing_disease_removed
		}
		text = EVTDESC_MNM_7119_DISEASE
	}

	desc = {
		trigger = {
			NAND = {
				has_character_flag = dark_healing_disease_flag
				has_character_flag = dark_healing_disease_removed
			}
			has_character_flag = dark_healing_nothing_happened
			OR = {
				has_character_flag = dark_healing_disease_flag
				has_character_flag = dark_healing_maimed_flag
			}
		}
		text = EVTDESC_MNM_7119_NOTHING_HAPPENED
	}

	desc = {
		trigger = {
			NAND = {
				has_character_flag = dark_healing_disease_flag
				has_character_flag = dark_healing_disease_removed
			}
			has_character_flag = dark_healing_injured
			has_character_flag = dark_healing_nothing_happened
			NOR = {
				has_character_flag = dark_healing_disease_flag
				has_character_flag = dark_healing_maimed_flag
			}
		}
		text = EVTDESC_MNM_7119_NORMAL
	}

	desc = {
		trigger = {
			NAND = { 
				has_character_flag = dark_healing_injured 
				has_character_flag = dark_healing_disease_removed
			}
			has_character_flag = dark_healing_nothing_happened
		}
		text = EVTDESC_MNM_7119_TOO_WEAK
	}

	option = {
		name = EVTOPT_MNM_7119

		if = {
			limit = { has_character_flag = dark_healing_disease_removed }
			#general disease clearing effects:
			remove_symptoms_effect = yes
			clear_disease_level_effect = yes
			remove_disease_flags_effect = yes
			hidden_effect = { remove_treatment_modifiers_effect = yes }
		}

		if = { limit = { trait = infection } remove_trait = infection }
		if = { limit = { trait = severely_injured } remove_trait = severely_injured }
		if = { limit = { trait = ill } remove_trait = ill }
		
		if = { limit = { trait = wounded } remove_trait = wounded }

		if = {
			limit = { has_character_flag = dark_healing_infirm }
			remove_trait = infirm
		}
		if = {
			limit = { has_character_flag = dark_healing_blinded }
			remove_trait = blinded
		}
		if = {
			limit = { has_character_flag = dark_healing_incapable }
			remove_trait = incapable
		}
		if = {
			limit = { has_character_flag = dark_healing_eunuch }
			remove_trait = eunuch
		}
		if = {
			limit = { NOT = { has_dlc = "Reapers" } has_character_flag = dark_healing_maimed_healed }
			remove_trait = maimed
		}
		if = {
			limit = { has_character_flag = removed_maimed }
			remove_trait = maimed
		}
		if = {
			limit = { has_character_flag = removed_mangled }
			remove_trait = mangled
		}
		if = {
			limit = { has_character_flag = removed_one_eyed }
			remove_trait = one_eyed
			if = {
				limit = {
					has_character_modifier = glass_eye
				}
				remove_character_modifier = glass_eye
			}
			if = {
				limit = {
					has_character_modifier = phantom_pain
					NOT = { trait = one_handed }
					NOT = { trait = one_legged }
					NOT = { trait = disfigured }
				}
				remove_character_modifier = phantom_pain
			}
		}
		if = {
			limit = { has_character_flag = removed_one_handed }
			remove_trait = one_handed
			if = {
				limit = {
					has_artifact = prosthetic_hand_gold
				}
				destroy_artifact = prosthetic_hand_gold
				wealth = 10
			}
			if = {
				limit = {
					has_artifact = prosthetic_hand_metal
				}
				destroy_artifact = prosthetic_hand_metal
			}
			if = {
				limit = {
					has_character_modifier = phantom_pain
					NOT = { trait = one_eyed }
					NOT = { trait = one_legged }
					NOT = { trait = disfigured }
				}
				remove_character_modifier = phantom_pain
			}
		}
		if = {
			limit = { has_character_flag = removed_one_legged }
			remove_trait = one_legged
			if = {
				limit = {
					has_character_modifier = peg_leg
				}
				remove_character_modifier = peg_leg
			}
			if = {
				limit = {
					has_artifact = prosthetic_leg_artifact
				}
				destroy_artifact = prosthetic_leg_artifact
			}
			if = {
				limit = {
					has_character_modifier = phantom_pain
					NOT = { trait = one_handed }
					NOT = { trait = one_eyed }
					NOT = { trait = disfigured }
				}
				remove_character_modifier = phantom_pain
			}
		}
		if = {
			limit = { has_character_flag = removed_disfigured }
			remove_trait = disfigured
			if = {
				limit = {
					has_character_modifier = golden_mask
				}
				remove_character_modifier = golden_mask
				wealth = 10
			}
			if = {
				limit = {
					has_character_modifier = phantom_pain
					NOT = { trait = one_handed }
					NOT = { trait = one_legged }
					NOT = { trait = one_eyed }
				}
				remove_character_modifier = phantom_pain
			}
		}
		if = {
			limit = { has_character_flag = removing_flu }
			remove_trait = flu
		}
		if = {
			limit = { has_character_flag = removing_measles }
			remove_trait = has_measles
			set_character_flag = immune_measles
		}
		if = {
			limit = { has_character_flag = removing_food_poisoning }
			remove_trait = food_poisoning
		}
		if = {
			limit = { has_character_flag = removing_gout }
			remove_trait = gout
		}
		if = {
			limit = { has_character_flag = removing_scurvy }
			remove_trait = scurvy
		}
		if = {
			limit = { has_character_flag = removing_lovers_pox }
			remove_trait = lovers_pox
		}
		if = {
			limit = { has_character_flag = removing_cancer }
			remove_trait = cancer
		}
		if = {
			limit = { has_character_flag = removing_pneumonic }
			remove_trait = pneumonic
		}
		if = {
			limit = { has_character_flag = removing_syphilitic }
			remove_trait = syphilitic
			set_character_flag = immune_syphilis
		}
		if = {
			limit = { has_character_flag = removing_leper }
			remove_trait = leper
		}
		if = {
			limit = { has_character_flag = removing_has_tuberculosis }
			remove_trait = has_tuberculosis
			set_character_flag = immune_tuberculosis
		}
		if = {
			limit = { has_character_flag = removing_has_aztec_disease }
			remove_trait = has_aztec_disease
			set_character_flag = immune_aztec_disease
		}
		if = {
			limit = { has_character_flag = removing_has_small_pox }
			remove_trait = has_small_pox
			set_character_flag = immune_smallpox
		}
		if = {
			limit = { has_character_flag = removing_has_bubonic_plague }
			remove_trait = has_bubonic_plague
			set_character_flag = immune_bubonic_plague
		}
		if = {
			limit = { has_character_flag = removing_has_typhus }
			remove_trait = has_typhus
			set_character_flag = immune_typhus
		}
		if = {
			limit = { has_character_flag = removing_has_typhoid_fever }
			remove_trait = has_typhoid_fever
			set_character_flag = immune_typhoid_fever
		}

		add_character_modifier = {
			modifier = dark_healing_recent
			years = 1
		}

		# demonic healing specific clearing:
		clr_character_flag = dark_healing_in_effect
		clr_character_flag = dark_healing_nothing_happened
		clr_character_flag = dark_healing_maimed_flag
		clr_character_flag = dark_healing_disease_flag
		clr_character_flag = dark_healing_disease_removed
		clr_character_flag = dark_healing_maimed_healed
		clr_character_flag = dark_healing_incapable
		clr_character_flag = dark_healing_infirm
		clr_character_flag = dark_healing_blinded
		clr_character_flag = dark_healing_eunuch
		clr_character_flag = dark_healing_injured
		clr_character_flag = removed_maimed
		clr_character_flag = removed_mangled
		clr_character_flag = removed_one_eyed
		clr_character_flag = removed_one_handed
		clr_character_flag = removed_one_legged
		clr_character_flag = removed_disfigured
		clr_character_flag = removing_flu
		clr_character_flag = removing_measles
		clr_character_flag = removing_food_poisoning
		clr_character_flag = removing_gout
		clr_character_flag = removing_scurvy
		clr_character_flag = removing_lovers_pox
		clr_character_flag = removing_cancer
		clr_character_flag = removing_leper
		clr_character_flag = removing_has_tuberculosis
		clr_character_flag = removing_has_aztec_disease
		clr_character_flag = removing_has_small_pox
		clr_character_flag = removing_has_bubonic_plague
		clr_character_flag = removing_has_typhus
		clr_character_flag = removing_has_typhoid_fever
	}
}

##Induction##

#Opening Event
character_event = {
	id = MNM.7121
	picture = GFX_evt_dark_prayer
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	immediate = {
	}

	desc = EVTDESC_MNM_7121

	option = {
		name = EVTOPTA_MNM_7121
		FROM = {
			character_event = {
				id = MNM.7122
				days = 0
			}
		}
	}
}

#Result Ping#
character_event = {
	id = MNM.7122
	picture = GFX_evt_dark_prayer
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_window = yes

	immediate = {
		random = {
			chance = 30

			modifier = {
				is_rival = FROM
				factor = 0
			}
			modifier = {
				trait = trusting
				factor = 2
			}
			modifier = {
				trait = paranoid
				factor = 0.5
			}
			modifier = {
				trait = lunatic
				factor = 2
			}
			modifier = {
				trait = possessed
				factor = 2
			}
			modifier = {
				trait = depressed
				factor = 2
			}
			modifier = {
				has_negative_congenital_trigger = yes
				factor = 2
			}
			modifier = {
				trait = ambitious
				factor = 2
			}
			modifier = {
				has_impious_trait_trigger = yes
				factor = 2
			}
			modifier = {
				FROM = {
					any_vassal = {
						character = ROOT
					}
				}
				factor = 2
			}
			modifier = {
				NOT = {
					religion_group = FROM
				}
				factor = 0.5
			}
			modifier = {
				is_ruler = no
				factor = 2
			}
			modifier = {
				dynasty = FROM
				factor = 2
			}
			modifier = {
				is_in_society = yes
				factor = 0
			}
			join_from_devil_worshiper_society_effect = yes
		}

		random = {
			chance = 50
			set_character_flag = wounded_induction
		}
		random = {
			chance = 10
			set_character_flag = lunatic_induction
		}
		random = {
			chance = 10
			set_character_flag = possessed_induction
		}
		add_character_modifier = {
			modifier = recent_induction_attempt
			days = 90
		}

		if = {
			limit = {
				same_society_as = FROM
			}
			FROM = {
				character_event = {
					id = MNM.7123
					days = 7
				}
			}
		}
		if = {
			limit = {
				NOT= { same_society_as = FROM }
			}
			FROM = {
				character_event = {
					id = MNM.7124
					days = 7
				}
			}
		}
	}
}

#Successful Induction#
character_event = {
	id = MNM.7123
	picture = GFX_evt_dark_prayer
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	desc = {
		trigger = {
			FROM = {
				has_character_flag = wounded_induction
				is_alive = yes
			}
		}

		text = EVTDESC_MNM_7123_WOUNDED
	}

	desc = {
		trigger = {
			FROM = {
				OR = {
					has_character_flag = lunatic_induction
					has_character_flag = possessed_induction
				}
				is_alive = yes
			}
		}

		text = EVTDESC_MNM_7123_INSANE
	}

	desc = {
		trigger = {
			FROM = {
				NOR = {
					has_character_flag = wounded_induction
					has_character_flag = lunatic_induction
					has_character_flag = possessed_induction
				}
				is_alive = yes
			}
		}

		text = EVTDESC_MNM_7123_NOT_WOUNDED
	}

	desc = {
		trigger = {
			FROM = {
				is_alive = no
			}
		}
		text = EVTDESC_MNM_7123_DEAD
	}

	option = {
		custom_tooltip = {
			text = successful_induction_tooltip
			FROM = {
				if = {
					limit = {
						has_character_flag = wounded_induction
					}
					add_trait = wounded
					clr_character_flag = wounded_induction
				}
				if = {
					limit = {
						has_character_flag = lunatic_induction
					}
					add_trait = lunatic
					clr_character_flag = lunatic_induction
				}
				if = {
					limit = {
						has_character_flag = possessed_induction
					}
					add_trait = possessed
					clr_character_flag = possessed_induction
				}

			}	
		}
		FROM = {
			if = {
				limit = {
					is_in_society = yes
				}
				leave_society = yes
			}
			if = {
				limit = { ROOT = { society_member_of = the_satanists } }
				join_society = the_satanists
			}
			if = {
				limit = { ROOT = { society_member_of = the_trollcrafters } }
				join_society = the_trollcrafters
			}
			if = {
				limit = { ROOT = { society_member_of = the_cult_of_kali } }
				join_society = the_cult_of_kali
			}
			if = {
				limit = { ROOT = { society_member_of = the_cult_of_balor } }
				join_society = the_cult_of_balor
			}
			if = {
				limit = { ROOT = { society_member_of = arab_jinn_sorcerers } }
				join_society = arab_jinn_sorcerers
			}
			if = {
				limit = { ROOT = { society_member_of = cult_of_titan } }
				join_society = cult_of_titan
			}
			if = {
				limit = { ROOT = { society_member_of = cult_of_apep } }
				join_society = cult_of_apep
			}
			if = {
				limit = { ROOT = { society_member_of = cult_of_angra_mainyu } }
				join_society = cult_of_angra_mainyu
			}
			if = {
				limit = { ROOT = { society_member_of = the_cold_ones } }
				join_society = the_cold_ones
			}
			if = {
				limit = { ROOT = { society_member_of = the_plaguebringers } }
				join_society = the_plaguebringers
			}
		}
		
		name = EVTOPTA_MNM_7123
	}

	option = {
		trigger = {
			FROM = {
				is_alive = no
			}
		}

		name = EVTOPTB_MNM_7123
	}
}

#Failed Induction#
character_event = {
	id = MNM.7124
	picture = GFX_evt_dark_prayer
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	desc = {
		trigger = {
			FROM = {
				has_character_flag = wounded_induction
				is_alive = yes
			}
		}	
		text = EVTDESC_MNM_7124_WOUNDED
	}

	desc = {
		trigger = {
			FROM = {
				OR = {
					has_character_flag = lunatic_induction
					has_character_flag = possessed_induction
				}
				is_alive = yes
			}
		}	
		text = EVTDESC_MNM_7124_INSANE
	}

	desc = {
		trigger = {
			FROM = {
				NOR = {
					has_character_flag = wounded_induction
					has_character_flag = lunatic_induction
					has_character_flag = possessed_induction
				}
				is_alive = yes
			}
		}

		text = EVTDESC_MNM_7124_NOT_WOUNDED
	}

	desc = {
		trigger = {
			FROM = {
				is_alive = no
			}
		}
		text = EVTDESC_MNM_7123_DEAD
	}

	option = {
		trigger = {
			FROM = {
				is_alive = yes
			}
		}
		FROM = {
			if = {
				limit = {
					has_character_flag = wounded_induction
				}
				add_trait = wounded
				clr_character_flag = wounded_induction
			}
			if = {
				limit = {
					has_character_flag = lunatic_induction
				}
				add_trait = lunatic
				clr_character_flag = lunatic_induction
			}
			if = {
				limit = {
					has_character_flag = possessed_induction
				}
				add_trait = possessed
				clr_character_flag = possessed_induction
			}
		}

		name = EVTOPTA_MNM_7124
	}

	option = {
		trigger = {
			FROM = {
				is_alive = no
			}
		}

		name = EVTOPTB_MNM_7123
	}
}
## Dark Divorce

#Ping event for spouse (use of power)
character_event = {
	id = MNM.7800
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		save_event_target_as = dark_divorce_target
		FROMFROM = {
			save_event_target_as = dark_divorce_spell_caster
		}
		event_target:dark_divorce_spell_caster = {
			character_event = { id = MNM.7801 }
		}
	}
}

#Dark Divorce spellcasting event
character_event = {
	id = MNM.7801
	picture = GFX_evt_dark_prayer
	desc = EVTDESC_MNM_7801
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	immediate = {
		event_target:dark_divorce_target = {
			random_list = {
				20 = {
					set_character_flag = supernatural_death_fear
				}
				20 = {
					set_character_flag = supernatural_death_lightning
				}
				20 = {
					set_character_flag = supernatural_death_combustion
				}
				20 = {
					set_character_flag = supernatural_death_crows
				}
				20 = {
					set_character_flag = supernatural_death_suicide			
				}
			}
		}
	}
	option = { #Bye bye baby
		trigger = {
			event_target:dark_divorce_spell_caster = {
				has_society_currency_minor_trigger = yes
			}
		}
		name = EVTOPTA_MNM_7801
		custom_tooltip = { text = EVTOPTA_MNM_7801_TOOLTIP }
		hidden_effect = {
			event_target:dark_divorce_spell_caster = {
				detract_society_currency_minor_effect = yes
			}
			event_target:dark_divorce_target = {
				if = {
					limit = {
						OR = {
							has_character_flag = supernatural_death_fear
							has_character_flag = supernatural_death_lightning
							has_character_flag = supernatural_death_combustion
							has_character_flag = supernatural_death_crows
						}
					}
					character_event = { id = MNM.7802 days = 3 random = 27 }
				}
				if = {
					limit = {
						has_character_flag = supernatural_death_suicide	
					}
					character_event = { id = MNM.7807 days = 1 random = 6 }
				}
			}
		}		
	}
	option = { #No I won't
		name = EVTOPTB_MNM_7801
		custom_tooltip = { text = EVTOPTB_MNM_7801_TOOLTIP }
		event_target:dark_divorce_target = {
			hidden_effect = {
				clr_character_flag = supernatural_death_fear
				clr_character_flag = supernatural_death_lightning
				clr_character_flag = supernatural_death_combustion
				clr_character_flag = supernatural_death_crows
				clr_character_flag = supernatural_death_suicide
				clr_character_flag = being_dark_divorced
			}
		}
		event_target:dark_divorce_spell_caster = {
			remove_character_modifier = recently_did_dark_divorce
		}
		ai_chance = { factor = 0 }
	}
}

#Ping event for spouse death (not possessed suicide)
character_event = {
	id = MNM.7802
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		if = {
			limit = {
				has_character_flag = supernatural_death_fear
			}
			event_target:dark_divorce_spell_caster = {
				character_event = { id = MNM.7803 }
			}
		}
		if = {
			limit = {
				has_character_flag = supernatural_death_lightning
			}
			event_target:dark_divorce_spell_caster = {
				character_event = { id = MNM.7804 }
			}
		}
		if = {
			limit = {
				has_character_flag = supernatural_death_combustion
			}
			event_target:dark_divorce_spell_caster = {
				character_event = { id = MNM.7805 }
			}
		}
		if = {
			limit = {
				has_character_flag = supernatural_death_crows
			}
			event_target:dark_divorce_spell_caster = {
				character_event = { id = MNM.7806 }
			}
		}
	}
}

#Dark Divorce spouse dies from fear event
character_event = {
	id = MNM.7803
	picture = GFX_evt_illness
	desc = EVTDESC_MNM_7803
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7803
		event_target:dark_divorce_target = {
			death = {
				death_reason = death_murder_unknown_fear
				killer = ROOT
			}
			clr_character_flag = supernatural_death_fear
		}
		hidden_effect = {
			event_target:dark_divorce_spell_caster = {
				major_soul_corruption_effect = yes
			}
		}
	}
}

#Dark Divorce spouse dies from lightning event
character_event = {
	id = MNM.7804
	picture = GFX_evt_religious_exultation
	desc = EVTDESC_MNM_7804
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7804
		event_target:dark_divorce_target = {
			death = {
				death_reason = death_murder_unknown_lightning
				killer = ROOT
			}
			clr_character_flag = supernatural_death_lightning
		}
		hidden_effect = {
			event_target:dark_divorce_spell_caster = {
				major_soul_corruption_effect = yes
			}
		}
	}
}

#Dark Divorce spouse dies from spontaneous combustion event
character_event = {
	id = MNM.7805
	picture = GFX_evt_burning_house
	desc = EVTDESC_MNM_7805
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7805
		event_target:dark_divorce_target = {
			death = {
				death_reason = death_murder_unknown_combustion
				killer = ROOT
			}
			clr_character_flag = supernatural_death_combustion
		}
		hidden_effect = {
			event_target:dark_divorce_spell_caster = {
				major_soul_corruption_effect = yes
			}
		}
	}
}

#Dark Divorce spouse dies from crows event
character_event = {
	id = MNM.7806
	picture = GFX_evt_garden
	desc = EVTDESC_MNM_7806
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7806
		event_target:dark_divorce_target = {
			death = {
				death_reason = death_murder_unknown_crows
				killer = ROOT
			}
			clr_character_flag = supernatural_death_crows
		}
		hidden_effect = {
			event_target:dark_divorce_spell_caster = {
				major_soul_corruption_effect = yes
			}
		}
	}
}

#Ping event for Dark Divorce spouse becoming possessed
character_event = {
	id = MNM.7807
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		event_target:dark_divorce_target = {
			add_trait_possessed_effect = yes
		}
		event_target:dark_divorce_spell_caster = {
			character_event = { id = MNM.7808 }
		}
	}
}

#Dark Divorce spouse becomes possessed event
character_event = {
	id = MNM.7808
	picture = GFX_evt_bad_news
	desc = {
		text = EVTDESC_MNM_7808
		picture = GFX_evt_bad_news_female
		trigger = {	is_female = no }
	}
	desc = { 
		text = EVTDESC_MNM_7808
		picture = GFX_evt_bad_news
		trigger = {	is_female = yes }
	}
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7808
		hidden_effect = {
			event_target:dark_divorce_target = {
				character_event = { id = MNM.7809 days = 1 random = 22 }
			}
		}
	}
}

#Ping event for Dark Divorce spouse suicide
character_event = {
	id = MNM.7809
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		event_target:dark_divorce_spell_caster = {
			character_event = { id = MNM.7810 }
		}
	}
}

#Dark Divorce spouse dies from suicide event
character_event = {
	id = MNM.7810
	picture = GFX_evt_bad_news
	desc = {
		text = EVTDESC_MNM_7810
		picture = GFX_evt_bad_news_female
		trigger = {	is_female = no }
	}
	desc = { 
		text = EVTDESC_MNM_7810
		picture = GFX_evt_bad_news
		trigger = {	is_female = yes }
	}
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7810
		event_target:dark_divorce_target = {
			death = {
				death_reason = death_murder_unknown_possessed_fall
				killer = ROOT
			}
			clr_character_flag = supernatural_death_suicide
		}
		hidden_effect = {
			event_target:dark_divorce_spell_caster = {
				major_soul_corruption_effect = yes
			}
		}
	}
}

### POWERS ###

#Power: Summon familiar
character_event = {
	id = MNM.7815 
	desc = EVTDESC_MNM_7815
	picture = GFX_evt_mysterious_forest
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	immediate = {
		remove_character_modifier = cat_familiar
		remove_character_modifier = raven_familiar
		remove_character_modifier = owl_familiar
		remove_character_modifier = wolf_familiar
	}

	#Intrigue (cat)
	option = {
		name = EVTOPTA_MNM_7815

		add_character_modifier = {
			name = cat_familiar
			duration = -1
		}

		ai_chance = {
			factor = 1
			modifier = {
				factor = 3
				has_education_intrigue_trigger = yes
			}
		}
	}

	#Martial (wolf)
	option = {
		name = EVTOPTB_MNM_7815

		add_character_modifier = {
			name = wolf_familiar
			duration = -1
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 3
				has_education_martial_trigger = yes
			}
		}
	}

	#Owl (learning)
	option = {
		name = EVTOPTC_MNM_7815

		add_character_modifier = {
			name = owl_familiar
			duration = -1
		}

		ai_chance = {
			factor = 1
			modifier = {
				factor = 3
				has_education_learning_trigger = yes
			}
		}
	}

	#Raven familiar
	option = {
		name = EVTOPTD_MNM_7815

		add_character_modifier = {
			name = raven_familiar
			duration = -1
		}

		ai_chance = {
			factor = 1
			modifier = {
				factor = 3
				has_education_stewardship_trigger = yes
			}
		}
	}
}

#Power: Tainted touch
character_event = {
	id = MNM.7819
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		FROMFROM = { save_event_target_as = curser }

		random_list = {	
			30 = { #Mild
				random_list = {
					10 = { give_ill_effect = yes }
					10 = { 
						modifier = { factor = 0 NOT = { has_dlc = "Reapers" } }
						give_flu_effect = yes 
					}
					10 = { 
						modifier = { factor = 0 NOT = { has_dlc = "Reapers" } }
						give_food_poisoning_effect = yes
					}
					10 = { 
						modifier = { factor = 0 NOT = { has_dlc = "Reapers" } }
						give_gout_effect = yes 
					}
				}
			}
			50 = { #Dangerous
				modifier = {
					factor = 1.3
					event_target:curser = {
						society_rank == 4
					}
				}
				modifier = {
					factor = 1.3
					event_target:curser = {
						is_learned_trigger = yes
					}
				}
				modifier = {
					factor = 0.75
					has_character_flag = small_defense_against_dark_forces
				}
				modifier = {
					factor = 0.5
					has_character_flag = medium_defense_against_dark_forces
				}
				modifier = {
					factor = 0.1
					has_character_flag = large_defense_against_dark_forces
				}
				random_list = {
					10 = { give_pneumonic_effect = yes }
					10 = { give_syphilitic_effect = yes }
					10 = { give_has_tuberculosis_effect = yes }
					10 = { give_has_small_pox_effect = yes }
					10 = { give_has_measles_effect = yes }
					10 = { give_has_typhoid_fever_effect = yes }
					10 = { 
						modifier = { factor = 0 NOT = { has_dlc = "Reapers" } }
						give_dysentery_effect = yes 
					}
					10 = { 
						modifier = { factor = 0 NOT = { has_dlc = "Reapers" } }
						give_cancer_effect = yes 
					}
				}
			}
			20 = { #Lethal
				modifier = {
					factor = 1.5
					event_target:curser = {
						society_rank == 4
					}
				}
				modifier = {
					factor = 1.5
					event_target:curser = {
						is_learned_trigger = yes
					}
				}
				modifier = {
					factor = 0.75
					has_character_flag = small_defense_against_dark_forces
				}
				modifier = {
					factor = 0.5
					has_character_flag = medium_defense_against_dark_forces
				}
				modifier = {
					factor = 0.1
					has_character_flag = large_defense_against_dark_forces
				}				
				random_list = {
					10 = { give_has_bubonic_plague_effect = yes }
					10 = { 
						modifier = { factor = 0 NOT = { has_dlc = "Reapers" } }
						give_rabies_effect = yes 
					}
				}
			}
		}
		character_event = { id = MNM.7820 days = 7 }
	}
}

character_event = {
	id = MNM.7820
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { has_disease_trigger = yes } 
			event_target:curser = { 
				character_event = { id = MNM.7821 } 
				hidden_effect = {
					major_soul_corruption_effect = yes
				}
			}
			#the three following lines are hook-ins from hermetics ward off evil-event:
			clr_character_flag = small_defense_against_dark_forces
			clr_character_flag = medium_defense_against_dark_forces
			clr_character_flag = large_defense_against_dark_forces
		}
		if = {
			limit = { has_disease_trigger = no } 
			character_event = { id = MNM.7820 days = 5 }
		}
	}
}

character_event = {
	id = MNM.7821
	picture = GFX_evt_illness
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { FROM = { has_character_flag = cursed_mild_illness } }
		text = EVTDESC_7821_MILD
		picture = GFX_evt_recovery
	}
	desc = {
		trigger = { FROM = { has_character_flag = cursed_dangerous_illness } }
		text = EVTDESC_7821_DANGEROUS
		picture = GFX_evt_illness
	}

	is_triggered_only = yes

	immediate = {
		FROM = {
			if = {
				limit = {
					OR = {
						trait = ill
						trait = syphilitic
						trait = flu
						trait = food_poisoning
						trait = gout
					}
				}
				set_character_flag = cursed_mild_illness
			}
			if = {
				limit = {
					OR = {
						trait = pneumonic
						trait = has_tuberculosis
						trait = has_typhoid_fever
						trait = has_small_pox
						trait = has_measles
						trait = dysentery
						trait = cancer
						trait = has_bubonic_plague
						trait = rabies
					}
				}
				set_character_flag = cursed_dangerous_illness
			}
		}
	}

	option = {
		name = {
			trigger = { FROM = { has_character_flag = cursed_mild_illness } }
			text = EVTOPTA_MNM_7821_MILD
		}
		name = {
			trigger = { FROM = { has_character_flag = cursed_dangerous_illness } }
			text = EVTOPTA_MNM_7821_DANGEROUS
		}

		FROM = {
			clr_character_flag = cursed_mild_illness
			clr_character_flag = cursed_dangerous_illness
		}
	}
}

#Power: invite witch to court
character_event = {
	id = MNM.7822
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		clr_character_flag = disciple_arriving
		random_list = {
			#Witch
			60 = {
				random_list = {
					33 = {
						create_character = {
							random_traits = yes
							dynasty = none
							religion = ROOT
							female = yes
							age = 19
							health = 7
						}
						new_character = { save_event_target_as = devil_disciple }
					}
					33 = {
						create_character = {
							random_traits = yes
							dynasty = none
							religion = ROOT
							female = yes
							age = 37
							health = 7
						}
						new_character = { save_event_target_as = devil_disciple }
					}
					33 = {
						create_character = {
							random_traits = yes
							dynasty = none
							religion = ROOT
							female = yes
							age = 68
							health = 7
						}
						new_character = { save_event_target_as = devil_disciple }
					}
				}
			}
			#Warlock
			40 = {
				random_list = {
					33 = {
						create_character = {
							random_traits = yes
							dynasty = none
							religion = ROOT
							female = no
							age = 22
							health = 7
						}
						new_character = { save_event_target_as = devil_disciple }
					}
					33 = {
						create_character = {
							random_traits = yes
							dynasty = none
							religion = ROOT
							female = no
							age = 42
							health = 7
						}
						new_character = { save_event_target_as = devil_disciple }
					}
					33 = {
						create_character = {
							random_traits = yes
							dynasty = none
							religion = ROOT
							female = no
							age = 65
							health = 7
						}
						new_character = { save_event_target_as = devil_disciple }
					}
				}
			}
		}

		event_target:devil_disciple = {
			#Join PREV's (ROOT's) society
			if = {
				limit = {
					ROOT = { ai = no }
				}
				join_prev_devil_worshiper_society_effect = yes
			}
		
			#Set correct education
			remove_education_effect = yes
			random_list = {
				15 = { add_trait = flamboyant_schemer }
				15 = { add_trait = intricate_webweaver }
				10 = { add_trait = elusive_shadow }
				5 = { add_trait = grey_eminence }
				5 = { add_trait = brilliant_strategist }
				5 = { add_trait = midas_touched }
			}

			#Up intrigue
			random_list = {
				33 = { change_intrigue = 2 }
				33 = { change_intrigue = 3 }
				33 = { change_intrigue = 4 }
			}

			#Set some interesting traits 

			#Possessed/lunatic
			random = {
				chance = 10
				add_trait = possessed
			}
			random = {
				chance = 5
				add_trait = lunatic
			}

			#Nice congenital
			random_list = {
				10 = {
					add_trait = fair
					remove_trait = ugly
				}
				5 = {
					add_trait = genius
					remove_trait = imbecile
					remove_trait = quick
					remove_trait = slow
				}
				10 = {
					add_trait = quick
					remove_trait = imbecile
					remove_trait = genius
					remove_trait = slow
				}
				5 = {
					add_trait = strong
					remove_trait = weak
				}
				20 = { }
			}

			#Bad congenital
			random_list = {
				10 = {
					add_trait = ugly
					remove_trait = fair
				}
				10 = {
					add_trait = hunchback
				}
				10 = {
					add_trait = clubfooted
				}
				50 = { }
			}

			#Lifestyle
			remove_lifestyle_trait_effect = yes
			random_list = {
				15 = { add_trait = hedonist }
				15 = { add_trait = mystic }
				10 = { add_trait = schemer }
				10 = { 
					if = { limit = { is_female = yes } add_trait = seductress }
					if = { limit = { is_female = no } add_trait = seducer }
				}
				5 = { add_trait = gardener }
				5 = { add_trait = impaler }
				20 = { }
			}

			#Vices
			remove_trait = chaste
			remove_trait = humble
			random = {
				chance = 25
				add_trait = lustful
			}
			random = {
				chance = 25
				add_trait = proud
			}
			random = {
				chance = 15
				add_trait = greedy
				remove_trait = charitable
			}
			random = {
				chance = 10
				add_trait = gluttonous
				remove_trait = temperate
			}
			random = {
				chance = 10
				add_trait = envious
				remove_trait = kind
			}

			#Misc traits
			remove_trait = honest
			remove_trait = content
			remove_trait = zealous
			remove_trait = trusting
			random = {
				chance = 15
				add_trait = deceitful
			}
			random = {
				chance = 33
				add_trait = ambitious
			}
			random = {
				chance = 15
				add_trait = paranoid
			}
			random = {
				chance = 15
				add_trait = cruel
				remove_trait = kind
			}
			random = {
				chance = 15
				add_trait = homosexual
			}
			if = {
				limit = { has_dlc = "Reapers" }
				random = {
					chance = 15
					add_trait = physician
				}
				random = {
					chance = 5
					modifier = {
						society_member_of = the_trollcrafters
						factor = 4
					}
					add_trait = one_eyed
				}
			}
			
			# Females should be able to lead armies
			set_character_flag = special_marshal

			#Nicknames
			random_list = {
				10 = {
					give_nickname = nick_the_alchemist
				}
				10 = { 
					modifier = {
						factor = 0
						NOR = {
							trait = deceitful
							trait = elusive_shadow
							trait = intricate_webweaver
						}
					}
					give_nickname = nick_the_spider
				}
				10 = { 
					modifier = {
						factor = 0
						has_education_intrigue_trigger = no
					}
					give_nickname = nick_the_whisperer
				}
				10 = { 
					modifier = {
						factor = 0
						has_education_intrigue_trigger = no
					}
					give_nickname = nick_the_shadow
				}
				10 = { 
					give_nickname = nick_of_the_wilds
				}
				10 = { 
					modifier = {
						factor = 0
						NAND = {
							is_female = yes
							OR = {
								trait = seductress
								trait = lustful
							}
						}
					}
					give_nickname = nick_the_temptress
				}
				10 = { 
					modifier = {
						factor = 0
						NAND = {
							is_female = no
							OR = {
								trait = seducer
								trait = lustful
							}
						}
					}
					give_nickname = nick_the_seducer
				}
				10 = { 
					modifier = {
						factor = 0
						NAND = {
							is_female = yes
							trait = fair
						}
					}
					give_nickname = nick_the_fair
				}
				10 = { 
					modifier = {
						factor = 0
						NAND = {
							is_female = no
							trait = fair
						}
					}
					give_nickname = nick_the_handsome
				}
				10 = { 
					give_nickname = nick_the_black
				}
				10 = { 
					modifier = {
						factor = 0
						NOT = { trait = hunchback }
					}
					give_nickname = nick_the_hunchback
				}
				50 = { }
			}
			character_event = { id = MNM.7823 }	
		}
	}
}

#Ping event for new witch/warlock
character_event = {
	id = MNM.7823
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		FROM = { character_event = { id = MNM.7824 } }
	}
}

#Introduction of witch/warlock
character_event = {
	id = MNM.7824
	picture = GFX_evt_magic_ritual
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = {
			has_dlc = Reapers
			FROM = { is_female = yes }
		}
		text = EVTDESC_MNM_7824
		picture = GFX_evt_wise_woman
	}
	desc = {
		trigger = {
			NAND = {
				has_dlc = Reapers
				FROM = { is_female = yes }
			}
		}
		text = EVTDESC_MNM_7824
		picture = GFX_evt_magic_ritual
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7824
		reverse_opinion = {
			who = FROM
			modifier = opinion_loyal_servant
		}
	}
}

character_event = {
	id = MNM.7829
	hide_window = yes
	
	is_triggered_only = yes
	
	ai = yes
	is_in_society = yes
	
	trigger = {
		has_dlc = "Mystics"
		is_devil_worshiper_trigger = yes
		society_rank >= 3
		NOT = { has_character_flag = disciple_arriving }
	}
	
	immediate = {
		character_event = { id = MNM.7822 }
	}
}


##Sacrifice prisoner events 
character_event = { #Head of Religion
	id = MNM.7500
	picture = GFX_evt_sacrifice
	desc = MNM.7500.d
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = MNM.7500.a
	}
}

character_event = { #Holy man
	id = MNM.7501
	picture = GFX_evt_sacrifice
	desc = MNM.7500.d
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = MNM.7500.a
	}
}

character_event = { #Dwarf
	id = MNM.7502
	picture = GFX_evt_sacrifice
	desc = MNM.7502.d
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = MNM.7502.a
	}
}

character_event = { #child
	id = MNM.7503
	picture = GFX_evt_sacrifice
	desc = MNM.7503.d
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = MNM.7503.a
	}
}

character_event = { #Virgin
	id = MNM.7504
	picture = GFX_evt_sacrifice
	desc = MNM.7504.d
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = MNM.7504.a
	}
}

character_event = { #regular dude
	id = MNM.7505
	picture = GFX_evt_sacrifice
	desc = MNM.7505.d
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = MNM.7505.a
	}
}

long_character_event = { #reaction
	id = MNM.7506
	picture = GFX_evt_sacrifice
	desc = MNM.7506.d
	border = GFX_event_long_frame_intrigue

	is_triggered_only = yes

	option = {
		name = MNM.7506.a
		
	}
}

character_event = { #demonic impregnation 
	id = MNM.7507
	picture = GFX_evt_dark_love
	border = GFX_event_normal_frame_intrigue

	desc = {
		trigger = { FROM = { character = ROOT } }
		text = EVTDESC_MNM_7507_SELF
	}
	desc = {
		trigger = { NOT = {  FROM = { character = ROOT } } }
		text = EVTDESC_MNM_7507_OTHER
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7507
		custom_tooltip = { text = EVTOPTA_MNM_7507_TOOLTIP }
		hidden_effect = {
			if = {
				limit = { has_quest = quest_the_devil_worshipers_demonic_impregnation }
				FROM = {
					set_quest_target = {
						id = quest_the_devil_worshipers_demonic_impregnation
						holder = ROOT
					}
				}
			}
			FROM = {
				impregnate = 0
				set_character_flag = DW_unholy_mother
			}
		}
	}
}

character_event = { #birth
	id = MNM.7508
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		mother = {
			has_character_flag = DW_unholy_mother
		}
	}
	
	immediate = {
		random_list = {
			50 = { set_character_flag = demon_child }
			50 = { set_character_flag = demon_child_fake }
		}
		mother = { 
			clr_character_flag = DW_unholy_mother 
			save_event_target_as = unholy_mother
			any_quester_targeting_this = {
				limit = { has_quest = quest_the_devil_worshipers_demonic_impregnation }
				character_event = { id = MNM.7511 days = 10 }
			}
		}	
	}
}

character_event = { #Announcement
	id = MNM.7511
	picture = GFX_evt_magic_ritual
	border = GFX_event_normal_frame_intrigue

	trigger = { 
		has_quest = quest_the_devil_worshipers_demonic_impregnation
	}
	
	desc = {
		trigger = { any_child = { character = FROM } }
		text = EVTDESC_MNM_7511_SELF
	}
	desc = {
		trigger = { NOT = { any_child = { character = FROM } } }
		text = EVTDESC_MNM_7511_OTHER
	}

	is_triggered_only = yes
	
	option = { 
		name = EVTOPTA_MNM_7511
		   
		clr_quest = quest_the_devil_worshipers_demonic_impregnation
		if = {
			limit = { FROM = { is_female = yes } }
			sound_effect = devil_worshippers_impregnation_courtier_female_01
		}
		if = {
			limit = { FROM = { is_female = no } }
			sound_effect = devil_worshippers_impregnation_courtier_male_01
		}
		add_society_currency_massive_effect = yes
	}
}

character_event = { #prolong life sacrifice
	id = MNM.7509
	picture = GFX_evt_sacrifice
	desc = MNM.7509.d
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = MNM.7509.a
		FROM = {
			hidden_effect = { long_character_event = { id = MNM.7506 } }
			death = {
				death_reason = death_missing
			}
		}
		add_prolong_life_effect = yes
		hidden_effect = {
			minor_soul_corruption_effect = yes
		}
		character_event = { id = MNM.7510 days = 3651 }
	}
}

character_event = { #prolong life effect fades
	id = MNM.7510
	picture = GFX_evt_dark_prayer
	desc = MNM.7510.d
	border = GFX_event_normal_frame_religion
	
	trigger = {
		NOR = {
			has_character_modifier = stolen_life_minor
			has_character_modifier = stolen_life_medium
			has_character_modifier = stolen_life_major
		}
	}

	is_triggered_only = yes

	option = {
		name = MNM.7510.a
			#Info only
	}
}

###MISSIONS###
##DW Mission Tombola
character_event = {
	id = MNM.7200
	hide_window = yes

	is_triggered_only = yes
	is_in_society = yes
	only_capable = yes

	trigger = {
		is_devil_worshiper_trigger = yes
		has_any_quest = no
		NOT = { has_character_modifier = quest_cooldown_timer }
		NOT = { is_society_grandmaster = yes }
		NOT = { is_inaccessible_trigger = yes }
	}

	immediate = {
		random_society_member = {
			limit = {
				is_society_grandmaster = yes
				same_society_as = ROOT
			}
			save_event_target_as = grand_enchanter
		}

		random_list = { 
			20 = {
				modifier = {
					factor = 0
					society_rank == 1
				}
				modifier = { 
					factor = 0 
					is_playable = no 
				}
				modifier = {
					factor = 0
					NOT = {
						any_character = {
							is_offmap_ruler = no
							is_priest = yes
							ai = yes
							NOT = { character = ROOT }
							is_within_diplo_range = ROOT
							is_inaccessible_trigger = no
							religion = ROOT
							prisoner = no
							NOT = { trait = incapable }
							NOT = { same_society_as = ROOT }
						}
					}
				}
				event_target:grand_enchanter = {
					character_event = { id = MNM.7838 } #Corrupt a priest
				}
			}
			20 = {
				modifier = { 
					factor = 0 
					is_playable = no 
				}
				modifier = {
					factor = 0
					NOT = {
						any_realm_province = {
							any_province_holding = {
								holding_type = temple
								holder_scope = {
									religion = ROOT
								}
								holder_scope = {
									NOT = {
										character = ROOT
									}
								}
								holder_scope = {
									NOT = { same_society_as = ROOT }
								}
							}
						}
					}
				}
				event_target:grand_enchanter = {
					character_event = { id = MNM.7023 } #desecrate a temple 
				}
			}
			20 = {
				modifier = { 
					factor = 0 
					is_playable = no 
				}
				event_target:grand_enchanter = {
					character_event = { id = MNM.7024 } #sacrifice someone
				}
			}
			20 = { 
				trigger = {
					society_rank >= 3
					is_playable = yes
					NOT = { has_character_flag = given_unholy_impregnation_mission }
				}
				set_character_flag = given_unholy_impregnation_mission
				event_target:grand_enchanter = {
					character_event = { id = MNM.7026 } #demonic impregnation
				}
			}
			20 = {
				modifier = { 
					factor = 0 
					is_playable = no 
				}
				modifier = {
					factor = 0
					society_rank == 1
				}
				event_target:grand_enchanter = {
					character_event = { id = MNM.7028 } #demonic possession
				}
			}
			
			75 = { # AI bypasses missions at times
				modifier = {
					factor = 0
					ai = no
				}
				random_list = {
					70 = {
						modifier = {
							factor = 0.9
							society_influence >= 30
						}
						modifier = {
							factor = 0.9
							society_influence >= 40
						}
						modifier = {
							factor = 0.8
							society_influence >= 50
						}
						modifier = {
							factor = 0.7
							society_influence >= 70
						}
						modifier = {
							factor = 0.6
							society_influence >= 80
						}
						modifier = {
							factor = 0.5
							society_influence >= 90
						}
						add_mission_succeed_influence_effect = yes
					}
					30 = {
						add_mission_fail_influence_effect = yes
					}
				}
			}

			200 = {
				modifier = {
					factor = 0
					ai = no
				}
				#Do nothing for AI
			}
		}
	}
}

###Desecrate temple###

#MISSION: 
#Ping event for the mission Desecrate a temple
character_event = {
	id = MNM.7023
	hide_window = yes

	is_triggered_only = yes

	immediate = { FROM = { society_quest_event = { id = MNM.7110 days = 7 random = 7 } } }
}

#Assign event
society_quest_event = {
	id = MNM.7110
	desc = EVTDESC_MNM_7110

	is_triggered_only = yes

	immediate = {
		random_realm_province = {
			limit = {
				any_province_holding = {
					holding_type = temple
					holder_scope = { religion = ROOT }
					holder_scope = { NOT = { character = ROOT } }
					holder_scope = { NOT = { same_society_as = ROOT } }
				}
			}
			random_province_holding = {
				limit = {
					holding_type = temple
					holder_scope = { religion = ROOT }
					holder_scope = { NOT = { character = ROOT } }
					holder_scope = { NOT = { same_society_as = ROOT } }
				}
				save_event_target_as = dw_desecration_target
			}
		}

		random_realm_province = {
			limit = {
				NOT = { holder_scope =  { character = ROOT } }
				any_province_holding = {
					holding_type = temple
					holder_scope = { religion = ROOT }
					holder_scope = { NOT = { same_society_as = ROOT } }
				}
			}
			random_province_holding = {
				limit = {
					holding_type = temple
					holder_scope = { religion = ROOT }
					holder_scope = { NOT = { same_society_as = ROOT } }
				}
				save_event_target_as = dw_desecration_target
			}
		}
	}

	quest_target = event_target:dw_desecration_target

	option = {
		name = ACCEPT
		event_target:dw_desecration_target = {
			set_quest_target = {
				id = quest_devil_worshipers_desecrate_temple
				holder = ROOT
			}
		}
	}
	option  = {
		name = DECLINE
		custom_tooltip = { text = decline_quest_tooltip }

		add_character_modifier = {
			name = quest_cooldown_timer
			hidden = yes
			days = 1000
		}

		ai_chance = { factor = 0 }
	}
}

#To be Fired by on_siege_over_winner
character_event = {
	id = MNM.7111
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		FROM = {
			is_quest_target_of = ROOT
		}
		has_quest = quest_devil_worshipers_desecrate_temple
		prisoner = no
		NOT = { is_inaccessible_trigger = yes }
		NOT = { trait = incapable }
	}

	desc = EVTDESC_MNM_7111

	immediate = {
		FROM = { save_event_target_as =  dw_desecration_target}
		set_character_flag = desecration_in_progress
	}

	#take opportunity to desecrate, start desecration chain
	option = {
		name = EVTOPTA_MNM_7111
		set_character_flag = desecration_violent
		character_event = {
			id = MNM.7113 days = 4
		}
	}
	#too dangerous
	option = {
		name = EVTOPTB_MNM_7111
		clr_character_flag = desecration_in_progress
		detract_society_currency_minor_effect = yes
	}
}

#To be fired by plot decision
character_event = {
	id = MNM.7112
	picture = GFX_evt_sacrifice
	border = GFX_event_normal_frame_intrigue
	is_triggered_only = yes

	hide_from = yes

	desc = EVTDESC_MNM_7112

	immediate = {
		random_quest_target = {
			limit = {
				is_quest_target_of = ROOT
			}
			save_event_target_as =  dw_desecration_target
		}
	}


	option = {
		name  = EVTOPT_MNM_7112
		set_character_flag = desecration_plotting
		character_event = { id = MNM.7113 days = 7 }
	}
}

#detection choice, martial to cover up with violence, intrigue to be real sneaky, general choice of lots of currency but risk of discovery or little currency but little risk
character_event = {
	id = MNM.7113
	picture = GFX_evt_secluded_in_prayer
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		is_devil_worshiper_trigger = yes
		has_quest = quest_devil_worshipers_desecrate_temple
	}

	immediate = {
		event_target:dw_desecration_target = {
			holder_scope = {
				if = {
					limit = { is_abroad = no }
					random_list = {
						50 = {}
						50 = {
							set_character_flag = desecration_at_home
						}
					}
				}
				save_event_target_as = desecration_holder
			}
		}
	}

	desc = {
		trigger = {
			has_character_flag = desecration_violent
			event_target:desecration_holder = {
				has_character_flag = desecration_at_home
			}
		}
		text = EVTDESC_MNM_7113_VIOLENT_HOLDER
	}

	desc = {
		trigger = {
			has_character_flag = desecration_plotting
			event_target:desecration_holder = {
				has_character_flag = desecration_at_home
			}
		}
		text = EVTDESC_MNM_7113_PLOTTING_HOLDER
	}

	desc = {
		trigger = {
			has_character_flag = desecration_violent
			NOT = {
				event_target:desecration_holder = {
					has_character_flag = desecration_at_home
				}
			}
		}
		text = EVTDESC_MNM_7113_VIOLENT
	}

	desc = {
		trigger = {
			has_character_flag = desecration_plotting
			NOT = {
				event_target:desecration_holder = {
					has_character_flag = desecration_at_home
				}
			}
		}
		text = EVTDESC_MNM_7113_PLOTTING
	}

	option = {
		trigger = {
			has_character_flag = desecration_violent
			OR = {
				martial = 14
				combat_rating = 3
			}
		}
		tooltip_info = martial
		name = EVTOPT_MNM_7113_MARTIAL
		add_society_currency_medium_effect = yes
		event_target:desecration_holder = {
			death = {
				death_reason = death_sacrificed
			}
		}
		hidden_effect = {
			minor_soul_corruption_effect = yes
		}
		character_event = { id = MNM.7116 days = 7 }
	}
	option = {
		trigger = {
			has_character_flag = desecration_plotting
			intrigue = 14
		}
		tooltip_info = intrigue
		name = EVTOPT_MNM_7113_INTRIGUE
		add_society_currency_medium_effect = yes
		event_target:desecration_holder = {
			death = {
				death_reason = death_sacrificed
			}
		}
		hidden_effect = {
			minor_soul_corruption_effect = yes
		}
		character_event = { id = MNM.7116 days = 7 }
	}
	option = {
		name = EVTOPTA_MNM_7113

		hidden_effect = {
			random_list = {
				25 = {character_event = { id = MNM.7114 days = 3 } }
				75 = {
					character_event = { id = MNM.7116 days = 7 }
				}
			}
		}
	}
	option = {
		name = {
			trigger = { has_character_flag = desecration_violent }
			text = EVTOPTB_MNM_7113_VIOLENT
		}
		name = {
			trigger = { has_character_flag = desecration_plotting }
			text = EVTOPTB_MNM_7113_PLOTTING
		}

		hidden_effect = {
			random_list = {
				25 = { 
					#DETECTED!
					modifier = {
						has_character_flag = desecration_violent
						factor = 3
					}
					character_event = { id = MNM.7114 days = 3 }
				}
				25 = {
					#SNEAKY
					modifier = {
						has_character_flag = desecration_plotting
						factor = 3
					}
					character_event = { id = MNM.7116 days = 7 }
				}
			}
		}
	}
}

#Priest/escape
character_event = {
	id = MNM.7114
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		is_devil_worshiper_trigger = yes
		has_quest = quest_devil_worshipers_desecrate_temple
	}

	desc = {
		trigger = {
			event_target:desecration_holder = {
				has_character_flag = desecration_at_home
			}
		}
		text = EVTDESC_MNM_7114_HOLDER
	}
	desc = {
		trigger = { 
			NOT = {
				event_target:desecration_holder = {
					has_character_flag = desecration_at_home
				}
			}
		}
		text = EVTDESC_MNM_7114
	}

	option = {
		name = EVTOPTA_MNM_7114
		hidden_effect = {
			random_list = {
				50 = {
					event_target:desecration_holder = { death = { death_reason = death_murder_unknown killer = ROOT } }
				}
				50 = {		
					increase_visibility_effect = yes
					set_character_flag = desecration_revealed
				}
			}
		}
		random_list = {
			75 = {
			}
			20 = {
				add_trait = wounded
			}
			5 = {
				add_trait = maimed
			}
		}
		character_event = { id = MNM.7116 days = 7 }
	}
	option = {
		name = EVTOPTB_MNM_7114
		
		clr_quest = {
			id = quest_devil_worshipers_desecrate_temple
			failure = yes
		}

		clr_character_flag = desecration_in_progress
		
		event_target:desecration_holder = {
			clr_character_flag = desecration_at_home
		}
	}
}


#Finds holy relics, steal or destroy
character_event = {
	id = MNM.7116
	picture = GFX_evt_burning_house
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		is_devil_worshiper_trigger = yes
		has_quest = quest_devil_worshipers_desecrate_temple
	}

	desc = {
		trigger = {
			event_target:dw_desecration_target = {
				is_rich_holding = no
			}
		}
		text = EVTDESC_MNM_7116_POOR
	}

	desc = {
		trigger = {
			event_target:dw_desecration_target = {
				is_rich_holding = yes
				is_richer_holding = no
			}
		}
		picture = GFX_event_treasure_chamber
		text = EVTDESC_MNM_7116_RICH
	}

	desc = {
		trigger = {
			event_target:dw_desecration_target = {
				is_rich_holding = yes
				is_richer_holding = yes
			}
		}
		picture = GFX_event_treasure_chamber
		text = EVTDESC_MNM_7116_RICHER
	}

	#take most valuable
	option = {
		trigger = {
			stewardship = 20
		}
		name = EVTOPT_MNM_7116_STEWARDSHIP
		tooltip_info = stewardship
		add_society_currency_medium_effect = yes
		if = {
			limit = {
				event_target:dw_desecration_target = {
					is_rich_holding = no
					is_richer_holding = no
				}
			}
			scaled_wealth = {
				value = 0.1 min = 15
			}
		}
		if = {
			limit = {
				event_target:dw_desecration_target = {
					is_rich_holding = yes
					is_richer_holding = no
				}
			}
			scaled_wealth = {
				value = 0.2 min = 40
			}
		}
		if = {
			limit = {
				event_target:dw_desecration_target = {
					is_rich_holding = yes
					is_richer_holding = yes
				}
			}
			scaled_wealth = {
				value = 0.3 min = 100
			}
		}
		character_event = { id = MNM.7117 days = 4 }
	}

	#identify and destroy most holy
	option = {
		trigger = {
			learning = 20
		}
		tooltip_info = learning
		name = EVTOPT_MNM_7116_LEARNING
		add_society_currency_major_effect = yes
		character_event = { id = MNM.7117 days = 4 }
	}
	option = {
		name = EVTOPTA_MNM_7116

		if = {
			limit = {
				event_target:dw_desecration_target = {
					is_rich_holding = no
					is_richer_holding = no
				}
			}
			scaled_wealth = {
				value = 0.05 min = 5
			}
		}
		if = {
			limit = {
				event_target:dw_desecration_target = {
					is_rich_holding = yes
					is_richer_holding = no
				}
			}
			scaled_wealth = {
				value = 0.1 min = 20
			}
		}
		if = {
			limit = {
				event_target:dw_desecration_target = {
					is_rich_holding = yes
					is_richer_holding = yes
				}
			}
			scaled_wealth = {
				value = 0.2 min = 40
			}
		}


		character_event = { id = MNM.7117 days = 4 }
	}
	option = {
		name = EVTOPTB_MNM_7116

		add_society_currency_minor_effect = yes

		character_event = { id = MNM.7117 days = 4 }
	}
}

#finishing narrative piece
character_event = {
	id = MNM.7117
	picture = GFX_evt_sacrifice
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		is_devil_worshiper_trigger = yes
		has_quest = quest_devil_worshipers_desecrate_temple
	}

	desc = {
		trigger = { has_character_flag = desecration_violent }
		text = EVTDESC_MNM_7117_VIOLENT
	}

	desc = {
		trigger = { has_character_flag = desecration_plotting }
		text = EVTDESC_MNM_7117_PLOTTING
	}

	option = {
		trigger = { has_character_flag = desecration_violent }
		name = EVTOPT_MNM_7117_VIOLENT
		
		clr_quest = quest_devil_worshipers_desecrate_temple
		add_society_currency_medium_effect = yes
		
		event_target:dw_desecration_target = {
			add_holding_modifier = {
				name = desecrated_temple
				years = 5
			}
			holder_scope = {
				religion_authority = {
					modifier = temple_desecrated
					years = 30
				}
			}
		}
		
		hidden_effect = {
			clr_character_flag = desecration_violent
			sound_effect = devil_worshippers_desecrate_temple_01
			random = {
				chance = 50
				minor_soul_corruption_effect = yes
			}
			clr_character_flag = desecration_in_progress
		}

		event_target:desecration_holder = {
			clr_character_flag = desecration_at_home
		}
	}
	option = {
		trigger = { has_character_flag = desecration_plotting }
		name = EVTOPT_MNM_7117_PLOTTING

		clr_quest = quest_devil_worshipers_desecrate_temple
		add_society_currency_medium_effect = yes

		event_target:dw_desecration_target = {
			add_holding_modifier = {
				name = desecrated_temple
				years = 5
				hidden = yes
			}
			holder_scope = {
				religion_authority = {
					modifier = temple_desecrated
					years = 30
				}
			}
		}
		
		hidden_effect = {
			clr_character_flag = desecration_violent
			sound_effect = devil_worshippers_desecrate_temple_01
			clr_character_flag = desecration_in_progress
			random = {
				chance = 50
				minor_soul_corruption_effect = yes
			}
		}
		event_target:desecration_holder = {
			clr_character_flag = desecration_at_home
		}
	}
}



#MISSION: Corrupt a priest
#Ping event for mission Corrupt a Priest
character_event = {
	id = MNM.7838
	hide_window = yes

	is_triggered_only = yes

	immediate = { 
		FROM = { society_quest_event = { id = MNM.7839 days = 7 random = 7 } }
	}
}

#MISSION: 
#We want you to corrupt this priest!
society_quest_event = {
	id = MNM.7839
	desc = EVTDESC_MNM_7839
	quest_target = event_target:corrupt_priest_mission_target

	is_triggered_only = yes

	immediate = {
		random_character = {
			limit = {
				is_offmap_ruler = no
				is_priest = yes
				ai = yes
				NOT = { character = ROOT }
				is_within_diplo_range = ROOT
				is_inaccessible_trigger = no
				religion = ROOT
				prisoner = no
				NOT = { trait = incapable }
				NOT = { same_society_as = ROOT }
			}
			save_event_target_as = corrupt_priest_mission_target
		}
		if = {
			limit = { society_rank >= 2 }
			random_character = {
				limit = {
					is_offmap_ruler = no
					is_ruler = yes
					ai = yes
					NOT = { character = ROOT }
					is_within_diplo_range = ROOT
					is_inaccessible_trigger = no
					religion = ROOT
					prisoner = no
					NOT = { trait = incapable }
					higher_tier_than = BARON
					lower_tier_than = KING
					is_priest = yes
					NOT = { same_society_as = ROOT }
				}
				save_event_target_as = corrupt_priest_mission_target
			}
		}	  
		if = {
			limit = { society_rank >= 3 }
			random_character = {
				limit = {
					is_offmap_ruler = no
					is_ruler = yes
					ai = yes
					NOT = { character = ROOT }
					is_within_diplo_range = ROOT
					is_inaccessible_trigger = no
					religion = ROOT
					prisoner = no
					NOT = { trait = incapable }
					higher_tier_than = BARON
					is_priest = yes
					NOT = { same_society_as = ROOT }
				}
				save_event_target_as = corrupt_priest_mission_target
			}
		}
	}

	option = { #accept
		name = ACCEPT
		event_target:corrupt_priest_mission_target = {
			set_character_flag = appear_in_option
			clr_character_flag = appear_in_option
		}
		event_target:corrupt_priest_mission_target = {
			set_quest_target = {
				id = quest_devil_worshipers_corrupt_priest
				holder = ROOT
			}
		}
	}
	option = { #nah thx
		name = DECLINE
		custom_tooltip = { text = decline_quest_tooltip }

		hidden_effect = {
			add_character_modifier = {
				name = quest_cooldown_timer
				hidden = yes
				days = 1000
			}
		}
		ai_chance = { factor = 0 }
	}
}


#MISSION: Sacrifice character
#Ping event for the mission Sacrifice Someone
character_event = {
	id = MNM.7024
	hide_window = yes

	is_triggered_only = yes

	immediate = { FROM = { society_quest_event = { id = MNM.7025 days = 7 random = 7 } } }
}

## For the character that gets the mission Sacrifice someone
society_quest_event = {
	id = MNM.7025
	desc = EVTDESC_MNM_7025
	border = GFX_event_letter_frame_intrigue

	is_triggered_only = yes

	immediate = {
		random_list = {
			10 = { set_character_flag = sacrifice_ruler }
			10 = { set_character_flag = sacrifice_holy_person }
			10 = { set_character_flag = sacrifice_virgin }
			5 = { set_character_flag = sacrifice_dwarf }
		}
	}

	option = {
		name = ACCEPT

		if = {
			limit = { has_character_flag = sacrifice_ruler }
			set_quest = quest_the_devil_worshipers_sacrifice_ruler	
		}
		if = {
			limit = { has_character_flag = sacrifice_holy_person }
			set_quest = quest_the_devil_worshipers_sacrifice_holy_person
		}
		if = {
			limit = { has_character_flag = sacrifice_virgin }
			set_quest = quest_the_devil_worshipers_sacrifice_virgin
		}
		if = {
			limit = { has_character_flag = sacrifice_dwarf }
			set_quest = quest_the_devil_worshipers_sacrifice_dwarf
		}
	}

	option = {
		name = DECLINE
		custom_tooltip = { text = decline_quest_tooltip }
		
		add_character_modifier = {
			name = quest_cooldown_timer
			hidden = yes
			days = 1000
		}

		ai_chance = { factor = 0 }
	}

	after = {
		hidden_effect = {
			clr_character_flag = sacrifice_ruler
			clr_character_flag = sacrifice_holy_person
			clr_character_flag = sacrifice_virgin
			clr_character_flag = sacrifice_dwarf
		}
	}
}


#MISSION: Demonic impregnation
#Ping event for the mission Demonic Impregnation
character_event = {
	id = MNM.7026
	hide_window = yes

	is_triggered_only = yes

	immediate = { FROM = { society_quest_event = { id = MNM.7027 days = 7 random = 7 } } }
}

## For the character that gets the mission Demonic Impregnation
society_quest_event = {
	id = MNM.7027
	desc = EVTDESC_MNM_7027

	is_triggered_only = yes

	option = {
		name = ACCEPT 
		set_quest = quest_the_devil_worshipers_demonic_impregnation
	}

	option = {
		name = DECLINE
		custom_tooltip = { text = decline_quest_tooltip }
		
		add_character_modifier = {
			name = quest_cooldown_timer
			hidden = yes
			days = 1000
		}

		ai_chance = { factor = 0 }
	}
}


#MISSION: Demonic posesssion
#Ping event for the mission Demonic Possession
character_event = {
	id = MNM.7028
	hide_window = yes

	is_triggered_only = yes

	immediate = { FROM = { society_quest_event = { id = MNM.7029 days = 7 random = 7 } } }
}

## For the character that gets the mission Demonic Possession
society_quest_event = {
	id = MNM.7029
	desc = EVTDESC_MNM_7029
	border = GFX_event_letter_frame_intrigue

	is_triggered_only = yes
	quest_target = event_target:demonic_possession_mission_target

	immediate = {
		random_courtier = {
			limit = {
				ai = yes
				NOT = { character = ROOT }
				NOT = { trait = incapable }
				NOT = { trait = lunatic }
				NOT = { trait = possessed }
				is_adult = yes
				NOT = { same_society_as = ROOT }
			}
			save_event_target_as = demonic_possession_mission_target
		}
	}

	option = {
		name = ACCEPT
		
		event_target:demonic_possession_mission_target = {
			set_character_flag = appear_in_option
			clr_character_flag = appear_in_option
		}
		
		event_target:demonic_possession_mission_target = {
			set_quest_target = {
				id = quest_the_devil_worshipers_demonic_possession
				holder = ROOT
			}
		}
			
	}

	option = {
		name = DECLINE
		custom_tooltip = { text = decline_quest_tooltip }
		
		add_character_modifier = {
			name = quest_cooldown_timer
			hidden = yes
			days = 1000
		}

		ai_chance = { factor = 0 }
	}
}

##Demonic Possession##

#Ping event for Demonic Possession
character_event = {
	id = MNM.7840
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		save_event_target_as = possess_courtier_target
		FROMFROM = {
			save_event_target_as = possess_courtier_spell_caster
			character_event = { id = MNM.7841 }
		}
	}
}

#Event for Demonic Possession Spellcasting
character_event = {
	id = MNM.7841
	picture = GFX_evt_dark_prayer
	desc = EVTDESC_MNM_7841
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = { #Possess them
		name = EVTOPTA_MNM_7841
		custom_tooltip = { text = EVTOPTA_MNM_7841_TOOLTIP }
		hidden_effect = {
			event_target:possess_courtier_target = {
				character_event = { id = MNM.7842 days = 3 random = 27 }
			}
		}		
	}
	option = { #No I won't
		name = EVTOPTB_MNM_7841
		custom_tooltip = { text = EVTOPTB_MNM_7841_TOOLTIP }
		event_target:possess_courtier_target = {
			hidden_effect = {
				clr_character_flag = possessing_courtier
			}
		}
		ai_chance = { factor = 0 }
	}
}

#Ping event for Demonic Possession outcome
character_event = {
	id = MNM.7842
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		event_target:possess_courtier_spell_caster = {
			random_list = {
				80 = {
					character_event = { id = MNM.7843 days = 3 random = 27 } #controlled possession
				}
				10 = {
					character_event = { id = MNM.7844 days = 3 random = 27 } #just possession
				}
				10 = {
					character_event = { id = MNM.7845 days = 3 random = 27 } #lunatic instead of possession
				}
			}
		}
	}
}

#Demonic Possession Success event
character_event = {
	id = MNM.7843
	picture = GFX_evt_shady_meeting
	desc = EVTDESC_MNM_7843
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	immediate = {
		event_target:possess_courtier_target = { add_trait = possessed }
	}

	option = {
		name = EVTOPTA_MNM_7843
		#If quest holder, clear quest and reward
		if = {
			limit = {
				has_quest = quest_the_devil_worshipers_demonic_possession
				quest_target = { character = event_target:possess_courtier_target }
			} 
			clr_quest = quest_the_devil_worshipers_demonic_possession
			if = {
				limit = { FROM = { is_female = yes } }
				sound_effect = devil_worshippers_demonic_possession_female_01
			}
			if = {
				limit = { FROM = { is_female = no } }
				sound_effect = devil_worshippers_demonic_possession_male_01
			}
			add_society_currency_medium_effect = yes
		}
		reverse_opinion = {
			who = event_target:possess_courtier_target
			modifier = opinion_loyal_servant
		}
		hidden_effect = {
			minor_soul_corruption_effect = yes
			event_target:possess_courtier_target = {
				random = { #might kill you first year
   					chance = 2
					character_event = { id = MNM.7846 days = 180 random = 180 } 
  				}
  			}
		}
	}
}

#Demonic Possession Failure event (possession)
character_event = {
	id = MNM.7844
	picture = GFX_evt_lunatic
	desc = EVTDESC_MNM_7844
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	immediate = {
		event_target:possess_courtier_target = { add_trait = possessed }
	}

	option = {
		name = EVTOPTA_MNM_7844
		custom_tooltip = { text = EVTOPTA_MNM_7844_TOOLTIP }
		if = {
			limit = {
				has_quest = quest_the_devil_worshipers_demonic_possession
				quest_target = { character = FROM }
			}
			clr_quest = {
				id = quest_the_devil_worshipers_demonic_possession
				failure = yes
			}
		}
		hidden_effect = {
			major_soul_corruption_effect = yes
		}
	}
}

#Demonic Possession Failure event (lunatic)
character_event = {
	id = MNM.7845
	picture = GFX_evt_lunatic
	desc = EVTDESC_MNM_7845
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	immediate = {
		event_target:possess_courtier_target = { add_trait = lunatic }
	}

	option = {
		name = EVTOPTA_MNM_7845
		custom_tooltip = { text = EVTOPTA_MNM_7845_TOOLTIP }
		if = {
			limit = {
				has_quest = quest_the_devil_worshipers_demonic_possession
				quest_target = { character = FROM }
			}
			clr_quest = {
				id = quest_the_devil_worshipers_demonic_possession
				failure = yes
			}
		}
		hidden_effect = {
			major_soul_corruption_effect = yes
		}
	}
}

#Ping event for Demonic Possession courtier kills you
character_event = {
	id = MNM.7846
	hide_window = yes

	is_triggered_only = yes

	trigger = { is_alive = yes }

	immediate = {
		event_target:possess_courtier_spell_caster = {
			character_event = { id = MNM.7847 }
		}
	}
}

#Demonic Possession Failure event (they kill you)
character_event = {
	id = MNM.7847
	picture = GFX_evt_shadow
	desc = EVTDESC_MNM_7847
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_7847

		death = {
			death_reason = death_murder_unknown
			killer = FROM
		}
		hidden_tooltip = {
			event_target:possess_courtier_target = {
				add_character_modifier = {
					name = suspected_assassin
					months = 48
				}
			}
		}
	}
}

###########################################
# Member Interaction Events
# Fired from 'on_society_bi_yearly_pulse'
# By Henrik Fahraeus
###########################################

###########################################
# Satanic Orgy - Hidden start
# Fired from on_society_bi_yearly_pulse
###########################################
character_event = {
	id = MNM.20000
	hide_window = yes
	
	is_triggered_only = yes
	
	only_playable = yes
	only_capable = yes
	prisoner = no
	is_in_society = yes
	
	trigger = {
		is_devil_worshiper_trigger = yes
		NOT = { is_inaccessible_trigger = yes }
		NOT = { trait = celibate }
		is_ill = no
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 2.0
			trait = lustful
		}
		modifier = {
			factor = 1.5
			trait = hedonist
		}
		modifier = {
			factor = 3.0
			has_focus = focus_seduction
		}
		modifier = {
			factor = 0.5
			trait = chaste
		}
		modifier = {
			factor = 0.25
			has_character_flag = had_an_orgy
		}
	}
	
	immediate = {
		# First look for someone at court
		society = {
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					NOT = { trait = celibate }
					OR = {
						is_female = no
						NOT = { age = 45 }
						is_pregnant = no
						is_ill = no
					}
					NOT = { character = ROOT }
					in_command = no
					host = { character = ROOT }
				}
				character_event = { id = MNM.20001 }
				break = yes
			}
			
			# Then look for someone in the same realm
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					NOT = { trait = celibate }
					OR = {
						is_female = no
						NOT = { age = 45 }
						is_pregnant = no
						is_ill = no
					}
					NOT = { character = ROOT }
					in_command = no
					same_realm = ROOT
				}
				character_event = { id = MNM.20001 }
				break = yes
			}
			
			# Then look abroad...
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					NOT = { trait = celibate }
					OR = {
						is_female = no
						NOT = { age = 45 }
						is_pregnant = no
						is_ill = no
					}
					NOT = { character = ROOT }
					in_command = no
					is_within_diplo_range = ROOT
				}
				character_event = { id = MNM.20001 }
			}
		}
	}
}

# Bounce
character_event = {
	id = MNM.20001
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = MNM.20002 } }
	}
}

# Satanic Orgy - Invitation
character_event = {
	id = MNM.20002
	picture = GFX_evt_sultan
	border = GFX_event_normal_frame_intrigue
	
	desc = {
		text = EVTDESC_MNM_20002
		trigger = {
			FROM = {
				NOT = { host = { character = ROOT } }
			}
		}
	}
	desc = {
		text = EVTDESC_MNM_20002_COURT
		trigger = {
			FROM = {
				host = { character = ROOT }
			}
		}
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_20002 # Of course
		ai_chance = {
			factor = 100
		}
		
		FROM = { character_event = { id = MNM.20003 tooltip = EVT_TT_20003 } }
	}
	option = {
		name = EVTOPTB_MNM_20002 # No way!
		ai_chance = {
			factor = 1
			modifier = {
				factor = 200
				trait = chaste
			}
			modifier = {
				factor = 50
				trait = craven
			}
		}
		
		detract_society_currency_minor_effect = yes
		reverse_opinion = { who = FROM modifier = opinion_coward years = 5 }
	}
}

# Bounce
character_event = {
	id = MNM.20003
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		save_event_target_as = sex_partner
		FROM = { character_event = { id = MNM.20004 days = 3 } }
	}
}

# Satanic Orgy - Aftermath
character_event = {
	id = MNM.20004
	picture = GFX_evt_bad_news
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = had_an_orgy
	
		random = {
			chance = 50
			
			unprotected_sex_effect_event_target = yes
			set_character_flag = orgy_sex
			
			# Hetero
			if = {
				limit = {
					NOT = { same_sex = FROM }
				}
				if = {
					limit = {
						trait = homosexual
					}
					random = {
						chance = 50
						set_character_flag = orgy_lose_homo_trait
					}
				}
			}
			
			# Homo
			if = {
				limit = {
					same_sex = FROM
				}
				if = {
					limit = {
						NOT = { trait = homosexual}
					}
					random = {
						chance = 25
						set_character_flag = orgy_gain_homo_trait
					}
				}
			}
			
			# Gain Lover?
			if = {
				limit = {
					NOT = { is_lover = FROM }
					OR = {
						has_character_flag = orgy_lose_homo_trait
						has_character_flag = orgy_gain_homo_trait
						AND = {
							same_sex = FROM
							trait = homosexual
						}
						AND = {
							NOT = { same_sex = FROM }
							NOT = { trait = homosexual }
						}
					}
				}
				random = {
					chance = 50
					set_character_flag = orgy_lover
				}
			}
		}
		
		random_list = {
			100 = { # Become more lustful
				modifier = {
					factor = 0
					trait = lustful
				}
				set_character_flag = orgy_sex_lustify
			}
			20 = { # Gain a "sex dwarf"
				set_character_flag = orgy_sex_dwarf
				modifier = {
					factor = 0
					any_courtier = {
						trait = dwarf
					}
				}
			}
			100 = { # Gain the "Robust" trait
				modifier = {
					factor = 0
					trait = robust
				}
				set_character_flag = orgy_gain_robust
			}
			100 = { # Gain the "Feeble" trait
				modifier = {
					factor = 0
					trait = feeble
				}
				set_character_flag = orgy_gain_feeble
			}
			50 = { # Gain the "Cannibal" trait
				modifier = {
					factor = 0
					trait = cannibal_trait
				}
				set_character_flag = orgy_cannibal
			}
			100 = { # Gain a demonic blessing
				modifier = {
					factor = 0
					OR = {
						has_character_modifier = satyric_blessing
						has_character_modifier = blessing_of_lilith
					}
				}
				set_character_flag = orgy_blessing
			}
		}
		
		# Random courtier is ritually murdered
		random = {
			chance = 20
			random_courtier = {
				limit = {
					NOR = {
						character = ROOT
						character = FROM
						is_married = ROOT
						is_close_relative = ROOT
					}
					is_adult = yes
					prisoner = no
					is_ruler = no
					NOT = { same_society_as = ROOT }
				}
				ROOT = { set_character_flag = orgy_murder }
				save_event_target_as = orgy_casualty
				death = { death_reason = death_murder_unknown killer = ROOT }
			}
		}
	}
	
	desc = { 
		text = EVTDESC_MNM_20004
		picture = GFX_evt_sultan
		trigger = {
			NOT = { has_character_flag = orgy_sex }
		}
	}
	
	desc = { 
		text = EVTDESC_MNM_20004_SEX
		picture = GFX_evt_sultan
		trigger = {
			has_character_flag = orgy_sex
			OR = {
				AND = {
					same_sex = FROM
					trait = homosexual
				}
				AND = {
					NOT = { same_sex = FROM }
					NOT = { trait = homosexual }
				}
			}
		}
	}
	
	desc = { 
		text = EVTDESC_MNM_20004_ODD_SEX
		trigger = {
			has_character_flag = orgy_sex
			OR = {
				AND = {
					same_sex = FROM
					NOT = { trait = homosexual }
				}
				AND = {
					NOT = { same_sex = FROM }
					trait = homosexual
				}
			}
		}
	}

	option = {
		name = {
			text = EVTOPTA_MNM_20004_CANNIBAL
			trigger = {
				has_character_flag = orgy_cannibal
			}
		}
		name = {
			text = EVTOPTA_MNM_20004_GOOD # I feel good!
			trigger = {
				NOT = { has_character_flag = orgy_cannibal }
				OR = {
					has_character_flag = orgy_gain_robust
					has_character_flag = orgy_blessing
				}
			}
		}
		name = {
			text = EVTOPTA_MNM_20004_BAD # I feel drained...
			trigger = {
				NOT = { has_character_flag = orgy_cannibal }
				has_character_flag = orgy_gain_feeble
			}
		}
		name = {
			text = EVTOPTA_MNM_20004_CHANGE
			trigger = {
				NOT = { has_character_flag = orgy_cannibal }
				OR = {
					has_character_flag = orgy_gain_homo_trait
					has_character_flag = orgy_lose_homo_trait
				}
			}
		}
		
		name = {
			text = EVTOPTA_MNM_20004
			trigger = {
				NOR = {
					has_character_flag = orgy_cannibal
					has_character_flag = orgy_gain_robust
					has_character_flag = orgy_blessing
					has_character_flag = orgy_gain_feeble
					has_character_flag = orgy_gain_homo_trait
					has_character_flag = orgy_lose_homo_trait
				}
			}
		}
		
		# Dark Power gain
		add_society_currency_minor_effect = yes
		
		if = {
			limit = { has_character_flag = orgy_gain_homo_trait }
			add_trait = homosexual
		}
		
		if = {
			limit = { has_character_flag = orgy_lose_homo_trait }
			remove_trait = homosexual
		}
		
		if = {
			limit = { has_character_flag = orgy_lover }
			if = {
				limit = { NOT = { is_rival = FROM } }
				add_lover = FROM
			}
			
			if = {
				limit = { is_rival = FROM }
				remove_rival = FROM
			}
		}
		
		if = {
			limit = { has_character_flag = orgy_sex_lustify }
			if = {
				limit = { NOT = { trait = chaste } }
				add_trait = lustful
			}
			if = {
				limit = { trait = chaste }
				remove_trait = chaste
			}
		}
		
		if = {
			limit = { has_character_flag = orgy_sex_dwarf }
			create_character = {
				random_traits = no
				dynasty = none
				religion = FROM
				culture = FROM
				female = no
				age = 30
				attributes = {
					intrigue = 6
					diplomacy = 9
				}
				trait = elusive_shadow
				trait = dwarf
				trait = one_eyed
				trait = cruel
				trait = seducer
				trait = lustful
				trait = drunkard
				trait = ugly
				trait = gregarious
			}
			new_character = {
				set_character_flag = sex_dwarf
				
				if = {
					limit = {
						ROOT = {
							NOT = { has_character_flag = orgy_sex }
							OR = {
								is_female = yes
								trait = homosexual
							}
						}
					}
					save_event_target_as = sex_partner
					ROOT = { set_character_flag = orgy_sex_with_dwarf }
				}
			}
			if = {
				limit = { has_character_flag = orgy_sex_with_dwarf }
				unprotected_sex_effect_event_target = yes
			}
		}
		
		# Impregnated by unspecified participant
		if = {
			limit = {
				is_female = yes
				NOT = { age = 45 }
				fertility = 0.4
				is_pregnant = no
				NOR = {
					has_character_flag = orgy_sex_with_dwarf
					has_character_flag = orgy_sex
				}
				society = { any_society_member = { is_female = no prisoner = no fertility = 1 } }
			}
			hidden_tooltip = {
				random = {
					chance = 25
					society = {
						random_society_member = {
							limit = {
								is_female = no
								prisoner = no
								fertility = 1
							}
							save_event_target_as = impregnator
						}
					}
					impregnate_cuckoo = event_target:impregnator
					set_character_flag = orgy_impregnated
				}
			}
		}
		
		clr_character_flag = orgy_sex_with_dwarf
		
		if = {
			limit = { has_character_flag = orgy_gain_robust }
			if = {
				limit = { NOT = { trait = feeble } }
				add_trait = robust
			}
			if = {
				limit = { trait = feeble }
				remove_trait = feeble
			}
		}
		
		if = {
			limit = { has_character_flag = orgy_gain_feeble }
			if = {
				limit = { NOT = { trait = robust } }
				add_trait = feeble
			}
			if = {
				limit = { trait = robust }
				remove_trait = robust
			}
		}
		
		if = {
			limit = { has_character_flag = orgy_cannibal }
			add_trait = cannibal_trait
		}
		
		if = {
			limit = { has_character_flag = orgy_blessing }
			if = {
				limit = { is_female = yes }
				add_character_modifier = {
					modifier = blessing_of_lilith
					days = -1
				}
			}
			if = {
				limit = { is_female = no }
				add_character_modifier = {
					modifier = satyric_blessing
					days = -1
				}
			}
		}
		
		# Friend gained / Rivalry lost
		if = {
			limit = {
				NOR = {
					is_lover = FROM
					is_friend = FROM
					is_rival = FROM
				}
				random = 75
			}
			add_friend = FROM
		}
		if = {
			limit = {
				is_rival = FROM
			}
			remove_rival = FROM
		}
		
		if = {
			limit = {
				has_character_flag = orgy_murder
			}
			event_target:orgy_casualty = {
				death = { death_reason = death_murder_unknown killer = ROOT }
				show_portrait = yes
			}
		}
		
		clr_character_flag = orgy_sex
		clr_character_flag = orgy_lose_homo_trait
		clr_character_flag = orgy_gain_homo_trait
		clr_character_flag = orgy_lover
		clr_character_flag = orgy_sex_lustify
		clr_character_flag = orgy_sex_dwarf
		clr_character_flag = orgy_gain_robust
		clr_character_flag = orgy_gain_feeble
		clr_character_flag = orgy_cannibal
		clr_character_flag = orgy_blessing
		clr_character_flag = orgy_murder
	}
}

###########################################
# Satanic Night at the Town - Hidden start
# Fired from on_society_bi_yearly_pulse
###########################################
character_event = {
	id = MNM.20010
	hide_window = yes
	
	is_triggered_only = yes
	
	only_playable = yes
	only_capable = yes
	prisoner = no
	is_in_society = yes
	
	trigger = {
		is_devil_worshiper_trigger = yes
		NOT = { is_inaccessible_trigger = yes }
		is_ill = no
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 1.25
			trait = impaler
		}
		modifier = {
			factor = 1.25
			trait = cruel
		}
		modifier = {
			factor = 1.25
			trait = arbitrary
		}
		modifier = {
			factor = 1.25
			trait = socializer
		}
		modifier = {
			factor = 1.25
			trait = drunkard
		}
		modifier = {
			factor = 1.25
			trait = gluttonous
		}
		modifier = {
			factor = 3.0
			has_focus = focus_carousing
		}
		modifier = {
			factor = 0.5
			trait = temperate
		}
		modifier = {
			factor = 0.5
			trait = just
		}
		modifier = {
			factor = 0.25
			trait = kind
		}
		modifier = {
			factor = 0.25
			has_character_flag = had_a_night_at_the_town
		}
	}
	
	immediate = {
		# First look for someone at court
		society = {
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					host = { character = ROOT }
				}
				character_event = { id = MNM.20011 }
				break = yes
			}
			
			# Then look for someone in the same realm
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					same_realm = ROOT
				}
				character_event = { id = MNM.20011 }
				break = yes
			}
			
			# Then look abroad...
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					is_within_diplo_range = ROOT
				}
				character_event = { id = MNM.20011 }
			}
		}
	}
}

# Bounce
character_event = {
	id = MNM.20011
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = MNM.20012 } }
	}
}

# Satanic Night at the Town - Invitation
character_event = {
	id = MNM.20012
	picture = GFX_evt_shady_meeting #GFX_evt_council
	border = GFX_event_normal_frame_intrigue
	
	desc = {
		text = EVTDESC_MNM_20012
		trigger = {
			FROM = {
				NOT = { host = { character = ROOT } }
			}
		}
	}
	desc = {
		text = EVTDESC_MNM_20012_COURT
		trigger = {
			FROM = {
				host = { character = ROOT }
			}
		}
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_20012 # Of course
		ai_chance = {
			factor = 100
		}
		
		FROM = { character_event = { id = MNM.20013 tooltip = EVT_TT_20013 } }
	}
	option = {
		name = EVTOPTB_MNM_20012 # No way!
		ai_chance = {
			factor = 1
			modifier = {
				factor = 20
				trait = temperate
			}
			modifier = {
				factor = 10
				trait = kind
			}
			modifier = {
				factor = 10
				trait = just
			}
		}
		
		detract_society_currency_minor_effect = yes
		reverse_opinion = { who = FROM modifier = opinion_coward years = 5 }
	}
}

# Next step decided
character_event = {
	id = MNM.20013
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				FROM = {
					OR = {
						trait = arbitrary
						trait = wroth
						trait = cruel
						trait = impaler
						trait = lunatic
						trait = possessed
					}
				}
			}
			FROM = { character_event = { id = MNM.20014 days = 1 } }
			break = yes
		}
	
		FROM = { character_event = { id = MNM.20021 days = 2 } }
	}
}

# Satanic Night at the Town - Choice
character_event = {
	id = MNM.20014
	picture = GFX_evt_tribal_lands
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = had_a_night_at_the_town
	}
	
	desc = {
		text = EVTDESC_MNM_20014
		picture = GFX_evt_stone_church
		trigger = {
			society_member_of = the_satanists
		}
	}
	desc = {
		text = EVTDESC_MNM_20014_NOMAD
		picture = GFX_evt_nomad_camp
		trigger = {
			society_member_of = the_plaguebringers
			has_dlc = "Horse Lords"
		}
	}
	desc = {
		text = EVTDESC_MNM_20014_NOMAD
		trigger = {
			society_member_of = the_plaguebringers
			NOT = { has_dlc = "Horse Lords" }
		}
	}

	option = {
		name = EVTOPTA_MNM_20014 # Head for the town
		FROM = { character_event = { id = MNM.20020 days = 2 } }
	}
	
	option = {
		name = EVTOPTB_MNM_20014 # Home Invasion
		character_event = { id = MNM.20015 days = 2 tooltip = EVT_TT_20015 }
	}
}

# Home Invasion - Main event
character_event = {
	id = MNM.20015
	picture = GFX_evt_burning_house
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	immediate = {
		# Chance of a bad effect
		random = {
			chance = 25
			random_list = {
				100 = { # Buddy dies
					modifier = {
						factor = 0
						FROMFROM = {
							is_ruler = yes
						}
					}
					set_character_flag = home_invasion_buddy_dies
				}
				100 = { # Wounded
					modifier = {
						factor = 0
						trait = wounded
					}
					set_character_flag = home_invasion_wounded
				}
				100 = { # Become Arbitrary
					modifier = {
						factor = 0
						trait = arbitrary
					}
					set_character_flag = home_invasion_gain_arbitrary
				}
				100 = { # Become Cannibal
					modifier = {
						factor = 0
						trait = cannibal_trait
					}
					set_character_flag = home_invasion_gain_cannibal
				}
			}
		}
		
		# Increased ambition?
		if = {
			limit = {
				NOT = { trait = ambitious }
			}
			random = {
				chance = 25
				set_character_flag = home_invasion_inc_ambition
			}
		}
		
		# Increased cruelty? (Cruel and Impaler)
		if = {
			limit = {
				OR = {
					NOT = { trait = cruel }
					NOT = { lifestyle_traits = 1 }
				}
			}
			random = {
				chance = 50
				set_character_flag = home_invasion_inc_cruelty
			}
		}
		
		# Remove stress?
		if = {
			limit = {
				trait = stressed
			}
			random = {
				chance = 25
				set_character_flag = home_invasion_remove_stress
			}
		}
		
		# Remove depression?
		if = {
			limit = {
				trait = depressed
				NOT = { trait = stressed }
			}
			random = {
				chance = 25
				set_character_flag = home_invasion_remove_depression
			}
		}
		
		# Chance of peasant revolt in case you leave the scene intact
		if = {
			limit = {
				location = {
					NAND = {
						has_empty_holding = yes
						owner = {
							is_nomadic = yes
						}
					}
					
					any_province_holding = {
						NOT = { holding_type = nomad }
					}
				}
			}
			random = {
				chance = 50
				set_character_flag = peasants_revolt
			}
		}
	}
	
	desc =  {
		trigger = {
			has_dlc = "Reapers"
			NOT = { has_character_flag = home_invasion_buddy_dies }
		}
		picture = GFX_evt_impalement
		text = EVTDESC_MNM_20015
	}
	desc =  {
		trigger = {
			NOT = { has_dlc = "Reapers" }
			NOT = { has_character_flag = home_invasion_buddy_dies }
		}
		text = EVTDESC_MNM_20015
	}
	desc =  {
		trigger = {
			has_dlc = "Reapers"
			has_character_flag = home_invasion_buddy_dies
		}
		picture = GFX_evt_impalement
		text = EVTDESC_MNM_20015_DEATH
	}
	desc =  {
		trigger = {
			NOT = { has_dlc = "Reapers" }
			has_character_flag = home_invasion_buddy_dies
		}
		text = EVTDESC_MNM_20015_DEATH
	}
	
	option = {
		name = EVTOPTA_MNM_20015 # Burn everything! No one must know.
		
		add_society_currency_minor_effect = yes
		
		# Buddy dies
		if = {
			limit = {
				has_character_flag = home_invasion_buddy_dies
			}
			FROMFROM = {
				death = { death_reason = death_accident }
			}
		}
		
		# Wounded
		if = {
			limit = {
				has_character_flag = home_invasion_wounded
			}
			add_trait = wounded
		}
		
		# Become Arbitrary
		if = {
			limit = {
				has_character_flag = home_invasion_gain_arbitrary
			}
			if = {
				limit = {
					NOT = { trait = just }
				}
				add_trait = arbitrary
			}
			if = {
				limit = {
					trait = just
				}
				remove_trait = just
			}
		}
		
		# Cannibal
		if = {
			limit = {
				has_character_flag = home_invasion_gain_cannibal
			}
			add_trait = cannibal_trait
		}
		
		# Ambition
		if = {
			limit = {
				has_character_flag = home_invasion_inc_ambition
			}
			if = {
				limit = {
					NOT = { trait = content }
				}
				add_trait = ambitious
			}
			if = {
				limit = {
					trait = content
				}
				remove_trait = content
			}
		}
		
		# Increase Cruelty
		if = {
			limit = {
				has_character_flag = home_invasion_inc_cruelty
			}
			if = {
				limit = {
					trait = cruel
					NOT = { lifestyle_traits = 1 }
				}
				add_trait = impaler
			}
			if = {
				limit = {
					NOT = { trait = kind }
					NOT = { trait = cruel }
				}
				add_trait = cruel
			}
			if = {
				limit = {
					trait = kind
				}
				remove_trait = kind
			}
		}
		
		# Relieve Stress
		if = {
			limit = {
				has_character_flag = home_invasion_remove_stress
			}
			remove_trait = stressed
		}
		
		# Cure Depression
		if = {
			limit = {
				has_character_flag = home_invasion_remove_depression
			}
			remove_trait = depressed
		}
		
		# Friend gained / Rivalry lost
		if = {
			limit = {
				NOT = { has_character_flag = home_invasion_buddy_dies }
				NOT = { is_friend = FROMFROM }
			}
			if = {
				limit = {
					NOR = {
						is_lover = FROMFROM
						is_friend = FROMFROM
						is_rival = FROMFROM
					}
				}
				add_friend = FROMFROM
			}
			if = {
				limit = {
					is_rival = FROMFROM
				}
				remove_rival = FROMFROM
			}
		}
		
		clr_character_flag = home_invasion_buddy_dies
		clr_character_flag = home_invasion_wounded
		clr_character_flag = home_invasion_gain_arbitrary
		clr_character_flag = home_invasion_gain_cannibal
		clr_character_flag = home_invasion_inc_ambition
		clr_character_flag = home_invasion_inc_cruelty
		clr_character_flag = home_invasion_remove_stress
		clr_character_flag = home_invasion_remove_depression
		clr_character_flag = peasants_revolt
	}
	
	option = {
		name = EVTOPTB_MNM_20015 # Leave it as a monument (risk of revolt)
		
		add_society_currency_medium_effect = yes
		
		# Buddy dies
		if = {
			limit = {
				has_character_flag = home_invasion_buddy_dies
			}
			FROMFROM = {
				death = { death_reason = death_accident }
			}
		}
		
		# Wounded
		if = {
			limit = {
				has_character_flag = home_invasion_wounded
			}
			add_trait = wounded
		}
		
		# Become Arbitrary
		if = {
			limit = {
				has_character_flag = home_invasion_gain_arbitrary
			}
			if = {
				limit = {
					NOT = { trait = just }
				}
				add_trait = arbitrary
			}
			if = {
				limit = {
					trait = just
				}
				remove_trait = just
			}
		}
		
		# Cannibal
		if = {
			limit = {
				has_character_flag = home_invasion_gain_cannibal
			}
			add_trait = cannibal_trait
		}
		
		# Ambition
		if = {
			limit = {
				has_character_flag = home_invasion_inc_ambition
			}
			if = {
				limit = {
					NOT = { trait = content }
				}
				add_trait = ambitious
			}
			if = {
				limit = {
					trait = content
				}
				remove_trait = content
			}
		}
		
		# Increase Cruelty
		if = {
			limit = {
				has_character_flag = home_invasion_inc_cruelty
			}
			if = {
				limit = {
					trait = cruel
					NOT = { lifestyle_traits = 1 }
				}
				add_trait = impaler
			}
			if = {
				limit = {
					NOT = { trait = kind }
					NOT = { trait = cruel }
				}
				add_trait = cruel
			}
			if = {
				limit = {
					trait = kind
				}
				remove_trait = kind
			}
		}
		
		# Relieve Stress
		if = {
			limit = {
				has_character_flag = home_invasion_remove_stress
			}
			remove_trait = stressed
		}
		
		# Cure Depression
		if = {
			limit = {
				has_character_flag = home_invasion_remove_depression
			}
			remove_trait = depressed
		}
		
		# Blessing of Berith
		if = {
			limit = {
				NOT = { has_character_modifier = blessing_of_berith }
			}
			add_character_modifier = {
				modifier = blessing_of_berith
				years = 5
			}
		}
		
		# Friend gained / Rivalry lost
		if = {
			limit = {
				NOT = { has_character_flag = home_invasion_buddy_dies }
				NOT = { is_friend = FROMFROM }
			}
			if = {
				limit = {
					NOR = {
						is_lover = FROMFROM
						is_friend = FROMFROM
						is_rival = FROMFROM
					}
				}
				add_friend = FROMFROM
			}
			if = {
				limit = {
					is_rival = FROMFROM
				}
				remove_rival = FROMFROM
			}
		}
		
		if = {
			limit = { NOT = { has_character_flag = peasants_revolt } }
			character_event = { id = MNM.20016 days = 3 tooltip = EVT_TT_20016 }
		}
		
		if = {
			limit = { has_character_flag = peasants_revolt }
			clr_character_flag = peasants_revolt
			character_event = { id = MNM.20017 days = 3 tooltip = EVT_TT_20016 }
		}
		
		clr_character_flag = home_invasion_buddy_dies
		clr_character_flag = home_invasion_wounded
		clr_character_flag = home_invasion_gain_arbitrary
		clr_character_flag = home_invasion_gain_cannibal
		clr_character_flag = home_invasion_inc_ambition
		clr_character_flag = home_invasion_inc_cruelty
		clr_character_flag = home_invasion_remove_stress
		clr_character_flag = home_invasion_remove_depression
	}
}

# Home Invasion - Demonic Monument outcome - increased revolt risk
character_event = {
	id = MNM.20016
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_intrigue
	
	desc = EVTDESC_MNM_20016
	
	is_triggered_only = yes
	
	immediate = {
		location = {
			add_province_modifier = {
				modifier = rumors_of_witchcraft
				years = 3
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_20016
	}
}

# Home Invasion - Demonic Monument outcome - rebellion
character_event = {
	id = MNM.20017
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_intrigue
	
	desc = EVTDESC_MNM_20017
	
	is_triggered_only = yes
	
	immediate = {
		location = {
			set_province_flag = force_peasant_revolt
			province_event = { id = TOG.1000 }
			clr_province_flag = force_peasant_revolt
		}
	}
	
	option = {
		name = EVTOPTA_MNM_20017
		trigger = {
			location = {
				owner = {
					OR = {
						character = ROOT
						is_liege_or_above = ROOT
					}
				}
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_20017_OTHER
		trigger = {
			location = {
				owner = {
					NOR = {
						character = ROOT
						is_liege_or_above = ROOT
					}
				}
			}
		}
	}
}


# Night at the tavern - Bounce
character_event = {
	id = MNM.20020
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = MNM.20021 } }
	}
}

# Debauchery at the Tavern - Main event
character_event = {
	id = MNM.20021
	picture = GFX_evt_brothel
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	immediate = {
		# Gain Wroth?
		if = {
			limit = {
				NOT = { trait = wroth }
			}
			random = {
				chance = 25
				set_character_flag = nt_gain_wroth
			}
		}
		
		# Gain Cruel?
		if = {
			limit = {
				NOT = { trait = cruel }
			}
			random = {
				chance = 50
				set_character_flag = nt_gain_cruel
			}
		}
		
		# Remove stress?
		if = {
			limit = {
				trait = stressed
			}
			random = {
				chance = 25
				set_character_flag = nt_remove_stress
			}
		}
		
		# Remove depression?
		if = {
			limit = {
				trait = depressed
				NOT = { trait = stressed }
			}
			random = {
				chance = 25
				set_character_flag = nt_remove_depression
			}
		}
		
		# Friendship or Rivalry?
		if = {
			limit = {
				NOT = { is_lover = FROM }
			}
			random_list = {
				100 = {
					modifier = {
						factor = 0
						is_friend = FROM
					}
					set_character_flag = nt_bonding
				}
				20 = {
					modifier = {
						factor = 0
						is_rival = FROM
					}
					set_character_flag = nt_rivalry
				}
			}
		}
		
		# Oops, I drank the beer.
		random = {
			chance = 20
			modifier = {
				factor = 0.5
				trait = shrewd
			}
			modifier = {
				factor = 0.5
				trait = quick
			}
			modifier = {
				factor = 0.25
				trait = genius
			}
			modifier = {
				factor = 3.0
				trait = slow
			}
			modifier = {
				factor = 2.0
				trait = dull
			}
			modifier = {
				factor = 2.0
				trait = drunkard
			}
			modifier = {
				factor = 2.0
				trait = hedonist
			}
			modifier = {
				factor = 5.0
				trait = imbecile
			}
			set_character_flag = nt_drank_the_beer
		}
	}
	
	desc = {
		trigger = {
			NOT = { has_character_flag = nt_rivalry }
		}
		text = EVTDESC_MNM_20021
	}
	
	desc = {
		trigger = {
			has_character_flag = nt_rivalry
		}
		text = EVTDESC_MNM_20021_RIVALRY
	}
	
	option = {
		name = {
			trigger = {
				has_character_flag = nt_rivalry
				NOT = { has_character_flag = nt_drank_the_beer }
			}
			text = EVTOPTA_MNM_20021_RIVALRY
		}
		
		name = {
			trigger = {
				NOT = { has_character_flag = nt_drank_the_beer }
				NOT = { has_character_flag = nt_rivalry }
			}
			text = EVTOPTA_MNM_20021
		}
		
		name = {
			trigger = {
				has_character_flag = nt_drank_the_beer
			}
			text = EVTOPTA_MNM_20021_OOPS
		}
		
		add_society_currency_minor_effect = yes
		
		# Gain Wroth
		if = {
			limit = {
				has_character_flag = nt_gain_wroth
			}
			if = {
				limit = {
					NOT = { trait = patient }
				}
				add_trait = wroth
			}
			if = {
				limit = {
					trait = patient
				}
				remove_trait = patient
			}
		}
		
		# Gain Cruel
		if = {
			limit = {
				has_character_flag = nt_gain_cruel
			}
			if = {
				limit = {
					NOT = { trait = kind }
				}
				add_trait = cruel
			}
			if = {
				limit = {
					trait = kind
				}
				remove_trait = kind
			}
		}
		
		# Relieve Stress
		if = {
			limit = {
				has_character_flag = nt_remove_stress
			}
			remove_trait = stressed
		}
		
		# Cure Depression
		if = {
			limit = {
				has_character_flag = nt_remove_depression
			}
			remove_trait = depressed
		}
		
		# Friend gained
		if = {
			limit = {
				has_character_flag = nt_bonding
			}
			if = {
				limit = {
					NOR = {
						is_lover = FROM
						is_friend = FROM
						is_rival = FROM
					}
				}
				add_friend = FROM
			}
			if = {
				limit = {
					is_rival = FROM
				}
				remove_rival = FROM
			}
		}
		
		# Rival gained
		if = {
			limit = {
				has_character_flag = nt_rivalry
			}
			if = {
				limit = {
					NOR = {
						is_friend = FROM
						is_rival = FROM
					}
				}
				add_rival = FROM
			}
			if = {
				limit = {
					is_friend = FROM
				}
				remove_friend = FROM
			}
		}
		
		if = {
			limit = {
				has_character_flag = nt_drank_the_beer
			}
			character_event = { id = MNM.20022 days = 1 tooltip = EVT_TT_20022 }
		}
		
		clr_character_flag = nt_gain_wroth
		clr_character_flag = nt_gain_cruel
		clr_character_flag = nt_remove_stress
		clr_character_flag = nt_remove_depression
		clr_character_flag = nt_bonding
		clr_character_flag = nt_rivalry
		clr_character_flag = nt_drank_the_beer
	}
}

# Debauchery at the Tavern - Drank the drugged beer
character_event = {
	id = MNM.20022
	picture = GFX_evt_drunk
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	immediate = {
		random_list = {
			100 = {
				modifier = {
					factor = 0
					trait = drunkard
				}
				set_character_flag = nt_gain_drunkard
			}
			25 = {
				modifier = {
					factor = 0
					trait = lunatic
				}
				set_character_flag = nt_gain_lunatic
			}
			100 = {
				set_character_flag = nt_grow_dumber
			}
			100 = {
				modifier = {
					factor = 0
					has_character_modifier = hallucinating
				}
				set_character_flag = nt_bad_modifier
			}
		}
	}
	
	desc = EVTDESC_MNM_20022
	
	option = {
		name = EVTOPTA_MNM_20022
		
		# Become a drunkard
		if = {
			limit = {
				has_character_flag = nt_gain_drunkard
			}
			add_trait = drunkard
		}
		
		#Go insane
		if = {
			limit = {
				has_character_flag = nt_gain_lunatic
			}
			add_trait = lunatic
		}
		
		#Brain damage
		if = {
			limit = {
				has_character_flag = nt_grow_dumber
			}
			if = {
				limit = {
					NOR = {
						trait = dull
						trait = shrewd
						trait = genius
						trait = quick
						trait = slow
						trait = imbecile
					}
				}
				add_trait = dull
			}
			if = {
				limit = {
					trait = slow
				}
				remove_trait = slow
				add_trait = imbecile
			}
			if = {
				limit = {
					trait = shrewd
				}
				remove_trait = shrewd
			}
			if = {
				limit = {
					trait = quick
				}
				remove_trait = quick
			}
			if = {
				limit = {
					trait = genius
				}
				remove_trait = genius
				add_trait = quick
			}
		}
		
		# Poisoned
		if = {
			limit = {
				has_character_flag = nt_bad_modifier
			}
			add_character_modifier = {
				name = hallucinating
				days = 120
			}
		}
		
		clr_character_flag = nt_gain_drunkard
		clr_character_flag = nt_gain_lunatic
		clr_character_flag = nt_grow_dumber
		clr_character_flag = nt_bad_modifier
	}
}

###########################################
# Grand Demon Summoning - Hidden start
# Fired from on_society_bi_yearly_pulse
###########################################

character_event = {
	id = MNM.20030
	hide_window = yes
	
	is_triggered_only = yes
	
	only_playable = yes
	only_capable = yes
	prisoner = no
	is_in_society = yes
	
	trigger = {
		is_devil_worshiper_trigger = yes
		NOT = { is_inaccessible_trigger = yes }
		is_ill = no
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 2.0
			society_rank >= 3
		}
		modifier = {
			factor = 0.5
			society_rank == 1
		}
		modifier = {
			factor = 3.0
			OR = {
				has_focus = focus_scholarship
				has_focus = focus_theology
			}
		}
		modifier = {
			factor = 3.0
			trait = genius
		}
		modifier = {
			factor = 3.0
			trait = mystic
		}
		modifier = {
			factor = 2.0
			trait = quick
		}
		modifier = {
			factor = 2.0
			trait = shrewd
		}
		modifier = {
			factor = 0.5
			trait = dull
		}
		modifier = {
			factor = 0.5
			trait = slow
		}
		modifier = {
			factor = 0.1
			trait = imbecile
		}
		modifier = {
			factor = 0.25
			has_character_flag = had_a_grand_demon_summoning
		}
	}
	
	immediate = {
		# First look for someone at court
		society = {
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					host = { character = ROOT }
				}
				character_event = { id = MNM.20031 }
				break = yes
			}
			
			# Then look for someone in the same realm
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					same_realm = ROOT
				}
				character_event = { id = MNM.20031 }
				break = yes
			}
			
			# Then look abroad...
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					is_within_diplo_range = ROOT
				}
				character_event = { id = MNM.20031 }
			}
		}
	}
}

# Bounce
character_event = {
	id = MNM.20031
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { narrative_event = { id = MNM.20032 } }
	}
}

# Demon Summoning - Planning
narrative_event = {
	id = MNM.20032
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_narrative_frame_intrigue
	
	title = EVTTITLE_MNM_20034
	
	desc = {
		text = EVTDESC_MNM_20032
		trigger = {
			FROM = {
				NOT = { host = { character = ROOT } }
			}
		}
	}
	desc = {
		text = EVTDESC_MNM_20032_COURT
		trigger = {
			FROM = {
				host = { character = ROOT }
			}
		}
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_20032 # Unlimited Power!
		ai_chance = {
			factor = 100
			modifier = {
				factor = 50
				trait = ambitious
			}
			modifier = {
				factor = 50
				trait = mystic
			}
		}
		
		set_character_flag = had_a_grand_demon_summoning
		
		FROM = { character_event = { id = MNM.20033 tooltip = EVT_TT_20033 } }
	}
	option = {
		name = EVTOPTB_MNM_20032 # Let's think this through
		ai_chance = {
			factor = 1
			modifier = {
				factor = 50
				trait = craven
			}
			modifier = {
				factor = 25
				trait = content
			}
		}
		
		detract_society_currency_minor_effect = yes
		reverse_opinion = { who = FROM modifier = opinion_coward years = 5 }
	}
}

# Bounce
character_event = {
	id = MNM.20033
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { narrative_event = { id = MNM.20034 days = 3  } }
	}
}

# Demon Summoning - The Ritual
narrative_event = {
	id = MNM.20034
	picture = GFX_evt_magic_ritual
	border = GFX_event_narrative_frame_intrigue
	
	title = EVTTITLE_MNM_20034
	
	immediate = {
		hidden_effect = {
			random_list = {
				100 = { # Stewardship Demon
					modifier = {
						factor = 0
						has_character_modifier = blessing_of_mammon
						NOR = {
							trait = indulgent_wastrel
							trait = thrifty_clerk
							trait = fortune_builder
						}
					}
					modifier = {
						factor = 2
						OR = {
							trait = indulgent_wastrel
							trait = thrifty_clerk
							trait = fortune_builder
							trait = midas_touched
						}
					}
					modifier = {
						factor = 2
						OR = {
							has_focus = focus_rulership
							has_focus = focus_business
						}
					}
					set_character_flag = ds_STE
				}
				100 = { # Diplomacy Demon
					modifier = {
						factor = 0
						has_character_modifier = blessing_of_belial
						NOR = {
							trait = naive_appeaser
							trait = underhanded_rogue
							trait = charismatic_negotiator
						}
					}
					modifier = {
						factor = 2
						OR = {
							trait = naive_appeaser
							trait = underhanded_rogue
							trait = charismatic_negotiator
							trait = grey_eminence
						}
					}
					modifier = {
						factor = 2
						OR = {
							has_focus = focus_family
							has_focus = focus_carousing
						}
					}
					set_character_flag = ds_DIP
				}
				100 = { # Martial Demon
					modifier = {
						factor = 0
						has_character_modifier = blessing_of_azazel
						NOR = {
							trait = misguided_warrior
							trait = tough_soldier
							trait = skilled_tactician
						}
					}
					modifier = {
						factor = 2
						OR = {
							trait = misguided_warrior
							trait = tough_soldier
							trait = skilled_tactician
							trait = brilliant_strategist
						}
					}
					modifier = {
						factor = 2
						OR = {
							has_focus = focus_war
							has_focus = focus_hunting
						}
					}
					set_character_flag = ds_MAR
				}
				100 = { # Intrigue Demon
					modifier = {
						factor = 0
						NOT = {
							any_rival = {
								always = yes
							}
						}
						has_character_modifier = blessing_of_vetis
						NOR = {
							trait = amateurish_plotter
							trait = flamboyant_schemer
							trait = intricate_webweaver
						}
					}
					modifier = {
						factor = 2
						OR = {
							trait = amateurish_plotter
							trait = flamboyant_schemer
							trait = intricate_webweaver
							trait = elusive_shadow
						}
					}
					modifier = {
						factor = 2
						OR = {
							has_focus = focus_seduction
							has_focus = focus_intrigue
						}
					}
					random_rival = {
						ROOT = { set_character_flag = ds_kill_a_rival_1 }
						save_event_target_as = rival_1
					}
					random_rival = {
						limit = {
							NOT = { character = event_target:rival_1 }
						}
						ROOT = { set_character_flag = ds_kill_a_rival_2 }
						save_event_target_as = rival_2
					}
					set_character_flag = ds_INT
				}
				100 = { # Learning Demon
					modifier = {
						factor = 0
						has_character_modifier = blessing_of_avnas
						NOR = {
							trait = detached_priest
							trait = martial_cleric
							trait = scholarly_theologian
							trait = shrewd
						}
					}
					modifier = {
						factor = 2
						OR = {
							trait = detached_priest
							trait = martial_cleric
							trait = scholarly_theologian
							trait = mastermind_theologian
						}
					}
					modifier = {
						factor = 2
						OR = {
							has_focus = focus_scholarship
							has_focus = focus_theology
						}
					}
					set_character_flag = ds_LEA
				}
				100 = { # Disaster!
					modifier = {
						factor = 0.5
						trait = genius
					}
					modifier = {
						factor = 0.5
						trait = mystic
					}
					modifier = {
						factor = 0.75
						trait = quick
					}
					modifier = {
						factor = 0.75
						trait = shrewd
					}
					modifier = {
						factor = 2.0
						trait = slow
					}
					modifier = {
						factor = 2.0
						trait = dull
					}
					modifier = {
						factor = 5.0
						trait = imbecile
					}
					modifier = {
						factor = 3.0
						trait = inbred
					}
					random_list = {
						100 = {
							set_character_flag = ds_illness
						}
						100 = {
							modifier = {
								factor = 0
								location = {
									has_disease = yes
								}
							}
							set_character_flag = ds_epidemic
						}
						100 = {
							modifier = {
								factor = 0
								OR = {
									is_female = yes
									trait = eunuch
								}
							}
							set_character_flag = ds_eunuch
						}
						100 = {
							set_character_flag = ds_stupid
						}
						100 = {
							modifier = {
								factor = 0
								has_character_modifier = known_witch
							}
							set_character_flag = ds_exposure
						}
						100 = {
							modifier = {
								factor = 0
								is_rival = FROM
							}
							set_character_flag = ds_rivalry
						}
						100 = {
							modifier = {
								factor = 0
								trait = possessed
							}
							set_character_flag = ds_possess
						}
					}
					
					set_character_flag = ds_disaster
				}
			}
		}
	}
	
	desc = {
		trigger = {
			NOT = { has_character_flag = ds_disaster }
		}
		text = EVTDESC_MNM_20034
	}
	desc = {
		trigger = {
			has_character_flag = ds_disaster
		}
		text = EVTOPTA_MNM_20034_DISASTER
	}

	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_20034
		trigger = {
			NOT = { has_character_flag = ds_disaster }
		}
		
		add_society_currency_minor_effect = yes
		
		increase_visibility_effect = yes
		
		# Stewardship Boon
		if = {
			limit = {
				has_character_flag = ds_STE
			}
			if = {
				limit = {
					has_character_modifier = blessing_of_mammon
				}
				if = {
					limit = { trait = fortune_builder }
					hidden_tooltip = { remove_trait = fortune_builder }
					add_trait = midas_touched
				}
				if = {
					limit = { trait = thrifty_clerk }
					hidden_tooltip = { remove_trait = thrifty_clerk }
					add_trait = fortune_builder
				}
				if = {
					limit = { trait = indulgent_wastrel }
					hidden_tooltip = { remove_trait = indulgent_wastrel }
					add_trait = thrifty_clerk
				}
			}
			if = {
				limit = {
					NOT = { has_character_modifier = blessing_of_mammon }
				}
				add_character_modifier = {
					modifier = blessing_of_mammon
					days = -1
				}
			}
		}
		
		# Diplomacy Boon
		if = {
			limit = {
				has_character_flag = ds_DIP
			}
			if = {
				limit = {
					has_character_modifier = blessing_of_belial
				}
				if = {
					limit = { trait = charismatic_negotiator }
					hidden_tooltip = { remove_trait = charismatic_negotiator }
					add_trait = grey_eminence
				}
				if = {
					limit = { trait = underhanded_rogue }
					hidden_tooltip = { remove_trait = underhanded_rogue }
					add_trait = charismatic_negotiator
				}
				if = {
					limit = { trait = naive_appeaser }
					hidden_tooltip = { remove_trait = naive_appeaser }
					add_trait = underhanded_rogue
				}
			}
			if = {
				limit = {
					NOT = { has_character_modifier = blessing_of_belial }
				}
				add_character_modifier = {
					modifier = blessing_of_belial
					days = -1
				}
			}
		}
		
		# Martial Boon
		if = {
			limit = {
				has_character_flag = ds_MAR
			}
			if = {
				limit = {
					has_character_modifier = blessing_of_azazel
				}
				if = {
					limit = { trait = skilled_tactician }
					hidden_tooltip = { remove_trait = skilled_tactician }
					add_trait = brilliant_strategist
				}
				if = {
					limit = { trait = tough_soldier }
					hidden_tooltip = { remove_trait = tough_soldier }
					add_trait = skilled_tactician
				}
				if = {
					limit = { trait = misguided_warrior }
					hidden_tooltip = { remove_trait = misguided_warrior }
					add_trait = tough_soldier
				}
			}
			if = {
				limit = {
					NOT = { has_character_modifier = blessing_of_azazel }
				}
				add_character_modifier = {
					modifier = blessing_of_azazel
					days = -1
				}
			}
		}
		
		# Intrigue Boon
		if = {
			limit = {
				has_character_flag = ds_INT
			}
			if = {
				limit = {
					has_character_modifier = blessing_of_vetis
				}
				if = {
					limit = { trait = intricate_webweaver }
					hidden_tooltip = { remove_trait = intricate_webweaver }
					add_trait = elusive_shadow
				}
				if = {
					limit = { trait = flamboyant_schemer }
					hidden_tooltip = { remove_trait = flamboyant_schemer }
					add_trait = intricate_webweaver
				}
				if = {
					limit = { trait = amateurish_plotter }
					hidden_tooltip = { remove_trait = amateurish_plotter }
					add_trait = flamboyant_schemer
				}
			}
			if = {
				limit = {
					NOT = { has_character_modifier = blessing_of_vetis }
				}
				add_character_modifier = {
					modifier = blessing_of_vetis
					days = -1
				}
			}
		}
		
		# Learning Boon
		if = {
			limit = {
				has_character_flag = ds_LEA
			}
			if = {
				limit = {
					has_character_modifier = blessing_of_avnas
				}
				if = {
					limit = { trait = scholarly_theologian }
					hidden_tooltip = { remove_trait = scholarly_theologian }
					add_trait = mastermind_theologian
					set_character_flag = ds_better_ed
				}
				if = {
					limit = { trait = martial_cleric }
					hidden_tooltip = { remove_trait = martial_cleric }
					add_trait = scholarly_theologian
					set_character_flag = ds_better_ed
				}
				if = {
					limit = { trait = detached_priest }
					hidden_tooltip = { remove_trait = detached_priest }
					add_trait = martial_cleric
					set_character_flag = ds_better_ed
				}
				if = {
					limit = { NOT = { has_character_flag = ds_better_ed } }
					if = {
						limit = { NOT = { trait = dull } }
						add_trait = shrewd
					}
					if = {
						limit = { trait = dull }
						remove_trait = dull
					}
				}
				
				clr_character_flag = ds_better_ed
			}
			if = {
				limit = {
					NOT = { has_character_modifier = blessing_of_avnas }
				}
				add_character_modifier = {
					modifier = blessing_of_avnas
					days = -1
				}
			}
		}
		
		clr_character_flag = ds_INT
		clr_character_flag = ds_STE
		clr_character_flag = ds_MAR
		clr_character_flag = ds_DIP
		clr_character_flag = ds_LEA
		clr_character_flag = ds_kill_a_rival_1
		clr_character_flag = ds_kill_a_rival_2
	}

	option = {
		trigger = {
			has_character_flag = ds_disaster
		}
		
		name = {
			text = EVTOPTA_MNM_20034_ILLNESS
			trigger = {
				has_character_flag = ds_illness
			}
		}
		name = {
			text = EVTOPTA_MNM_20034_EPIDEMIC
			trigger = {
				has_character_flag = ds_epidemic
			}
		}
		name = {
			text = EVTOPTA_MNM_20034_EUNUCH
			trigger = {
				has_character_flag = ds_eunuch
			}
		}
		name = {
			text = EVTOPTA_MNM_20034_STUPID
			trigger = {
				has_character_flag = ds_stupid
			}
		}
		name = {
			text = EVTOPTA_MNM_20034_EXPOSURE
			trigger = {
				has_character_flag = ds_exposure
			}
		}
		name = {
			text = EVTOPTA_MNM_20034_POSSESS
			trigger = {
				has_character_flag = ds_possess
			}
		}
		name = {
			text = EVTOPTA_MNM_20034_RIVALRY
			trigger = {
				has_character_flag = ds_rivalry
			}
		}
		
		if = {
			limit = {
				has_character_flag = ds_illness
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				add_trait = cancer
			}
		}
		
		if = {
			limit = {
				has_character_flag = ds_epidemic
			}
			location = {
				spawn_disease = typhoid_fever
			}
		}
		
		if = {
			limit = {
				has_character_flag = ds_eunuch
			}
			add_trait = eunuch
		}
		
		if = {
			limit = {
				has_character_flag = ds_stupid
			}
			if = {
				limit = {
					NOR = {
						trait = dull
						trait = shrewd
						trait = genius
						trait = quick
						trait = slow
						trait = imbecile
					}
				}
				add_trait = dull
			}
			if = {
				limit = {
					trait = slow
				}
				remove_trait = slow
				add_trait = imbecile
			}
			if = {
				limit = {
					trait = shrewd
				}
				remove_trait = shrewd
			}
			if = {
				limit = {
					trait = quick
				}
				remove_trait = quick
			}
			if = {
				limit = {
					trait = genius
				}
				remove_trait = genius
				add_trait = quick
			}
		}
		
		if = {
			limit = {
				has_character_flag = ds_exposure
			}
			if = {
				limit = {
					NOR = {
						has_character_modifier = suspected_witch
						has_character_modifier = known_witch
					}
				}
				add_character_modifier = {
					name = suspected_witch
					duration = -1
				}
			}
			
			if = {
				limit = { has_character_modifier = suspected_witch }
				remove_character_modifier = suspected_witch
				add_character_modifier = {
					name = known_witch
					duration = -1
				}
			}
		}
		
		if = {
			limit = {
				has_character_flag = ds_possess
			}
			add_trait = possessed
			add_character_modifier = {
				name = voice_of_satan
				duration = -1
			}
		}
		
		if = {
			limit = {
				has_character_flag = ds_rivalry
			}
			if = {
				limit = {
					NOR ={
						is_lover = FROM
						is_friend = FROM
					}
				}
				add_rival = FROM
			}
			if = {
				limit = {
					is_lover = FROM
				}
				remove_lover = FROM
			}
			if = {
				limit = {
					is_friend = FROM
				}
				remove_friend = FROM
			}
		}
		
		clr_character_flag = ds_disaster
		clr_character_flag = ds_illness
		clr_character_flag = ds_epidemic
		clr_character_flag = ds_eunuch
		clr_character_flag = ds_stupid
		clr_character_flag = ds_exposure
		clr_character_flag = ds_possess
		clr_character_flag = ds_rivalry
	}
	
	option = {
		name = EVTOPTA_MNM_20034_KILL_RIVAL_1
		trigger = {
			has_character_flag = ds_kill_a_rival_1
		}
		
		add_society_currency_minor_effect = yes
		
		increase_visibility_effect = yes
		
		event_target:rival_1 = {
			tooltip = {
				death = { death_reason = death_murder_unknown killer = ROOT }
			}
			character_event = { id = MNM.20035 }
		}
		
		clr_character_flag = ds_INT
		clr_character_flag = ds_kill_a_rival_1
		clr_character_flag = ds_kill_a_rival_2
	}
	
	option = {
		name = EVTOPTA_MNM_20034_KILL_RIVAL_2
		trigger = {
			has_character_flag = ds_kill_a_rival_2
		}
		
		add_society_currency_minor_effect = yes
		
		increase_visibility_effect = yes
		
		event_target:rival_2 = {
			tooltip = {
				death = { death_reason = death_murder_unknown killer = ROOT }
			}
			character_event = { id = MNM.20035 }
		}
		
		clr_character_flag = ds_INT
		clr_character_flag = ds_kill_a_rival_1
		clr_character_flag = ds_kill_a_rival_2
	}
}

# Demon Summoning - Rival is killed
character_event = {
	id = MNM.20035
	picture = GFX_evt_magic_ritual
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	immediate = {
		death = { death_reason = death_murder_unknown killer = FROM }
	}
	
	desc = EVTDESC_MNM_20035
	
	option = {
		name = EVTOPTA_MNM_20035
	}
}

###########################################
# Impersonating Priests - Hidden start
# Fired from on_society_bi_yearly_pulse
###########################################

character_event = {
	id = MNM.20040
	hide_window = yes
	
	is_triggered_only = yes
	
	only_playable = yes
	only_capable = yes
	prisoner = no
	is_in_society = yes
	
	trigger = {
		is_devil_worshiper_trigger = yes
		NOT = { is_inaccessible_trigger = yes }
		is_ill = no
		in_command = no
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 1.75
			has_focus = focus_theology
		}
		
		modifier = {
			factor = 1.75
			OR = {
				trait = detached_priest
				trait = martial_cleric
				trait = scholarly_theologian
				trait = mastermind_theologian
			}
		}
		
		modifier = {
			factor = 0.25
			has_character_flag = impersonated_priests
		}
	}
	
	immediate = {
		# First look for someone at court
		society = {
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					NOT = { same_sex = ROOT } # One of us can always masquerade as a local priest
					host = { character = ROOT }
				}
				save_event_target_as = dw_buddy
				character_event = { id = MNM.20041 }
				break = yes
			}
			
			# Then look for someone in the same realm
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					NOT = { same_sex = ROOT } # One of us can always masquerade as a local priest
					same_realm = ROOT
				}
				save_event_target_as = dw_buddy
				character_event = { id = MNM.20041 }
				break = yes
			}
			
			# Then look abroad...
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
					is_ill = no
					NOT = { character = ROOT }
					in_command = no
					NOT = { same_sex = ROOT } # One of us can always masquerade as a local priest
					is_within_diplo_range = ROOT
				}
				save_event_target_as = dw_buddy
				character_event = { id = MNM.20041 }
			}
		}
	}
}

# Bounce
character_event = {
	id = MNM.20041
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			random_realm_province = {
				limit = {
					any_neighbor_province = {
						has_owner = yes
						owner = {
							NOR = {
								character = PREVPREVPREV
								is_liege_or_above = PREVPREVPREV
								character = event_target:dw_buddy
								is_liege_or_above = event_target:dw_buddy
							}
						}
					}
				}
				random_neighbor_province = {
					limit = {
						has_owner = yes
						owner = {
							NOR = {
								character = PREVPREVPREV
								is_liege_or_above = PREVPREVPREV
								character = event_target:dw_buddy
								is_liege_or_above = event_target:dw_buddy
							}
						}
					}
					province_event = { id = MNM.20042 }
				}
			}
		}
	}
}

province_event = {
	id = MNM.20042
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = { character_event = { id = MNM.20043 } }
	}
}

# Impersonating Priests - Planning
character_event = {
	id = MNM.20043
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue
	
	show_from_from = yes
	
	desc = {
		text = EVTDESC_MNM_20043
		trigger = {
			FROMFROM = {
				NOT = { host = { character = ROOT } }
			}
		}
	}
	
	desc = {
		text = EVTDESC_MNM_20043_COURT
		trigger = {
			FROMFROM = {
				host = { character = ROOT }
			}
		}
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_20043 # Yes
		ai_chance = {
			factor = 100
			modifier = {
				factor = 20
				has_focus = focus_theology
			}
			modifier = {
				factor = 10
				OR = {
					trait = detached_priest
					trait = martial_cleric
					trait = scholarly_theologian
					trait = mastermind_theologian
				}
			}
		}
		
		set_character_flag = impersonated_priests
		
		FROMFROM = { character_event = { id = MNM.20044 tooltip = EVT_TT_20044 } }
	}
	option = {
		name = EVTOPTB_MNM_20043 # Bad idea...
		ai_chance = {
			factor = 1
			modifier = {
				factor = 50
				trait = craven
			}
			modifier = {
				factor = 25
				trait = content
			}
		}
		
		detract_society_currency_minor_effect = yes
		reverse_opinion = { who = FROMFROM modifier = opinion_coward years = 5 }
	}
}

# Bounce
character_event = {
	id = MNM.20044
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = MNM.20045 days = 2 } }
	}
}

# Impersonating Priests - The Fun Begins
character_event = {
	id = MNM.20045
	picture = GFX_evt_secluded_in_prayer # GFX_evt_bishop
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	immediate = {
	}
	
	desc = EVTDESC_MNM_20045
	
	option = {
		name = EVTOPTA_MNM_20045 # Firebrand preaching to the peasants (Agitation)
		ai_chance = {
			factor = 100
			modifier = {
				factor = 10
				trait = zealous
			}
			modifier = {
				factor = 10
				OR = {
					trait = temperate
					trait = just
					trait = diligent
				}
			}
		}
		
		FROMFROMFROM = { province_event = { id = MNM.20046 tooltip = EVT_TT_20046 } }
	}
	
	option = {
		name = EVTOPTB_MNM_20045 # Depraved feast
		ai_chance = {
			factor = 100
			modifier = {
				factor = 10
				trait = cynical
			}
			modifier = {
				factor = 10
				OR = {
					trait = gluttonous
					trait = hedonist
					trait = drunkard
					trait = arbitrary
					trait = slothful
				}
			}
		}
		FROMFROMFROM = { province_event = { id = MNM.20047 tooltip = EVT_TT_20047 } }
	}
	
}

# Province Bounce - Agitation 
province_event = {
	id = MNM.20046
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = MNM.20048 days = 7 } }
	}
}

# Province Bounce - Depraved Feast 
province_event = {
	id = MNM.20047
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = MNM.20049 days = 3 } }
	}
}

# Impersonating Priests - Agitation 
character_event = {
	id = MNM.20048
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_intrigue
	
	show_from_from_from = yes
	
	is_triggered_only = yes
	
	trigger = {
		FROMFROMFROM = {
			is_alive = yes
			prisoner = no
			is_incapable = no
		}
		FROMFROM = {
			is_alive = yes
			prisoner = no
			is_incapable = no
		}
	}
	
	immediate = {
		if = {
			limit = {
				FROM = {
					has_heresies = yes
					is_heretic = no
				}
			}
			set_character_flag = ip_heresy
		}
		
		if = {
			limit = { NOT = { trait = deceitful } }
			random = {
				chance = 25
				set_character_flag = ip_deceitful
			}
		}
		if = {
			limit = { NOT = { trait = gregarious } }
			random = {
				chance = 50
				set_character_flag = ip_gregarious
			}
		}
		
		if = {
			limit = {
				NOR = {
					is_friend = FROMFROMFROM
					is_lover = FROMFROMFROM
				}
			}
			random_list = {
				85 = { 
					set_character_flag = ip_friendify
				}
				15 = {
					modifier = {
						factor = 0
						FROMFROMFROM = { trait = honest }
					}
					modifier = {
						factor = 2
						FROMFROMFROM = { trait = deceitful }
					}
					modifier = {
						factor = 2
						FROMFROMFROM = { trait = cruel }
					}
					FROMFROMFROM = { character_event = { id = MNM.20051 days = 7 } } # Rivalry
				}
			}
		}
	}
	
	desc = EVTDESC_MNM_20048
	
	option = {
		name = EVTOPTA_MNM_20048
		
		if = {
			limit = {
				has_character_flag = ip_heresy
			}
			FROM = {
				add_province_modifier = {
					modifier = heretic_stronghold
					years = 3
				}
				become_heretic = yes
				province_event = { id = MNM.20050 } # Notify lieges
			}
		}
		
		if = {
			limit = {
				NOT = { has_character_flag = ip_heresy }
			}
			FROM = {
				add_province_modifier = {
					modifier = religious_unrest
					years = 5
				}
			}
		}
		
		if = {
			limit = {
				has_character_flag = ip_deceitful
			}
			if = {
				limit = {
					NOT = { has_character_flag = honest }
					NOT = { has_character_flag = deceitful }
				}
				add_trait = deceitful
			}
			if = {
				limit = {
					has_character_flag = honest
				}
				remove_trait = honest
			}
		}
		
		if = {
			limit = {
				has_character_flag = ip_gregarious
			}
			if = {
				limit = {
					NOT = { has_character_flag = shy }
					NOT = { has_character_flag = gregarious }
				}
				add_trait = gregarious
			}
			if = {
				limit = {
					has_character_flag = shy
				}
				remove_trait = shy
			}
		}
		
		# Friend gained / Rivalry lost
		if = {
			limit = {
				has_character_flag = ip_friendify
			}
			if = {
				limit = {
					NOT = {
						is_rival = FROMFROMFROM
					}
				}
				add_friend = FROMFROMFROM
			}
			if = {
				limit = {
					is_rival = FROMFROMFROM
				}
				remove_rival = FROMFROMFROM
			}
		}
		
		add_society_currency_minor_effect = yes
		
		clr_character_flag = ip_heresy
		clr_character_flag = ip_deceitful
		clr_character_flag = ip_gregarious
		clr_character_flag = ip_friendify
	}
}

# Impersonating Priests - Depraved Feast 
character_event = {
	id = MNM.20049
	picture = GFX_evt_pope_feast
	border = GFX_event_normal_frame_intrigue
	
	show_from_from_from = yes
	
	is_triggered_only = yes
	
	trigger = {
		FROMFROMFROM = {
			is_alive = yes
			prisoner = no
			is_incapable = no
		}
		FROMFROM = {
			is_alive = yes
			prisoner = no
			is_incapable = no
		}
	}
	
	immediate = {
		if = {
			limit = { NOT = { trait = deceitful } }
			random = {
				chance = 25
				set_character_flag = ip_deceitful
			}
		}
		if = {
			limit = { NOT = { trait = gluttonous } }
			random = {
				chance = 10
				set_character_flag = ip_gluttonous
			}
		}
	}
	
	desc = EVTDESC_MNM_20049
	
	option = {
		name = EVTOPTA_MNM_20049
		
		if = {
			limit = {
				ai = no
			}
			religion_authority = {
				modifier = decadent_clergy
				years = 10
			}
		}
		
		# Friend gained / Rivalry lost
		if = {
			limit = {
				NOR = {
					is_lover = FROM
					is_friend = FROM
					is_rival = FROM
				}
			}
			add_friend = FROM
		}
		if = {
			limit = {
				is_rival = FROM
			}
			remove_rival = FROM
		}
		
		add_society_currency_minor_effect = yes
		
		clr_character_flag = ip_deceitful
		clr_character_flag = ip_gluttonous
	}
}

# Province: notify lieges of heresy
province_event = {
	id = MNM.20050
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		owner = {
			top_liege = {
				if = {
					limit = {
						NOT = { character = PREV }
					}
					character_event = { id = 39400 days = 2 }
				}
				any_vassal = {
					limit = {
						OR = {
							is_parent_religion = ROOT
							religion = ROOT
						}
					}
					character_event = { id = 39400 days = 2 }
				}
			}
		}
	}
}

# Agitation - Rivalry aftermath bounce
character_event = {
	id = MNM.20051
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = MNM.20052 } }
	}
}

# Agitation - Rivalry aftermath
character_event = {
	id = MNM.20052
	picture = GFX_evt_suspicious_noble
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROMFROM = {
			save_event_target_as = local_province
			owner = {
				save_event_target_as = local_ruler
			}
		}
	}
	
	desc = EVTDESC_MNM_20052
	
	option = {
		name = EVTOPTA_MNM_20052
		add_rival = FROM
		event_target:local_ruler = {
			character_event = { id = MNM.20053 days = 3 }
			hidden_tooltip = {
				remove_friend = ROOT
				remove_lover = ROOT
			}
		}
		add_rival = event_target:local_ruler
	}
}

# Agitation - Rivalry aftermath - local ruler notified
character_event = {
	id = MNM.20053
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	desc = EVTDESC_MNM_20053
	
	option = {
		name = EVTOPTA_MNM_20053
		tooltip = { add_rival = FROM }
	}
}

###########################################
# Infernal Choir - Hidden start
# Only with rivals
# Fired from on_society_bi_yearly_pulse
###########################################

character_event = {
	id = MNM.20060
	hide_window = yes
	
	is_triggered_only = yes
	
	only_playable = yes
	only_capable = yes
	prisoner = no
	
	trigger = {
		is_devil_worshiper_trigger = yes
		NOT = { has_character_modifier = in_seclusion }
		NOT = { trait = in_hiding }
		is_ill = no
		society = {
			any_society_member = {
				is_incapable = no
				prisoner = no
				NOT = { has_character_modifier = in_seclusion }
				NOT = { trait = in_hiding }
				is_ill = no
				NOT = { character = ROOT }
				OR = {
					is_rival = ROOT
					ROOT = { trait = lunatic }
					ROOT = { trait = possessed }
				}
				NOT = {
					reverse_has_opinion_modifier = {
						who = ROOT
						modifier = opinion_nemesis
					}
				}
			}
		}
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 1.25
			OR = {
				trait = lunatic
				trait = possessed
			}
		}
		modifier = {
			factor = 1.25
			trait = cruel
		}
		modifier = {
			factor = 1.25
			trait = impaler
		}
		modifier = {
			factor = 1.25
			trait = deceitful
		}
	}
	
	immediate = {
		society = {
			random_society_member = {
				limit = {
					ai = yes
					is_incapable = no
					prisoner = no
					NOT = { has_character_modifier = in_seclusion }
					NOT = { trait = in_hiding }
					is_ill = no
					NOT = { character = ROOT }
					OR = {
						is_rival = ROOT
						ROOT = { trait = lunatic }
						ROOT = { trait = possessed }
					}
					NOT = {
						reverse_has_opinion_modifier = {
							who = ROOT
							modifier = opinion_nemesis
						}
					}
				}
				save_event_target_as = dw_buddy
				ROOT = { narrative_event = { id = MNM.20061 } }
			}
		}
	}
}

# Infernal Choir - Planning
narrative_event = {
	id = MNM.20061
	picture = GFX_evt_lunatic
	border = GFX_event_narrative_frame_intrigue
	
	title = EVTTITLE_MNM_20061
	desc = EVTDESC_MNM_20061

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_20061 # Do it!
		ai_chance = {
			factor = 100
		}
		
		set_character_flag = had_infernal_choir
		
		event_target:dw_buddy = { character_event = { id = MNM.20062 days = 3 tooltip = EVT_TT_20062 } }
	}
	option = {
		name = EVTOPTB_MNM_20061 # Not a good idea
		ai_chance = {
			factor = 0
		}
	}
}

# Infernal Choir - Invitation (looks like MNM.20012 to the rival)
character_event = {
	id = MNM.20062
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue
	
	desc = {
		text = EVTDESC_MNM_20012
		trigger = {
			NOT = { trait = paranoid }
		}
	}
	
	desc = {
		text = EVTDESC_MNM_20012_PARANOID
		trigger = {
			trait = paranoid
		}
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_MNM_20012 # Of course
		trigger = {
			NOT = { trait = paranoid }
		}
		ai_chance = {
			factor = 100
		}
		
		FROM = { narrative_event = { id = MNM.20064 days = 3 tooltip = EVT_TT_20013 } }
	}
	option = {
		name = EVTOPTC_MNM_20062 # I knew it!
		trigger = {
			trait = paranoid
		}
		tooltip_info = paranoid
		
		ai_chance = {
			factor = 1000
		}
		
		set_character_flag = dw_double_cross
		FROM = { narrative_event = { id = MNM.20064 tooltip = EVT_TT_20064 days = 3 } }
	}
	option = {
		name = EVTOPTB_MNM_20012 # No way!
		trigger = {
			NOT = { trait = paranoid }
		}
		
		ai_chance = {
			factor = 1
			modifier = {
				factor = 20
				trait = temperate
			}
			modifier = {
				factor = 10
				trait = kind
			}
			modifier = {
				factor = 10
				trait = just
			}
		}
		
		detract_society_currency_minor_effect = yes
		reverse_opinion = { who = FROM modifier = opinion_coward years = 5 }
		
		FROM = { character_event = { id = MNM.20063 days = 3 } }
	}
}

# Rival declined
character_event = {
	id = MNM.20063
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue
	desc = EVTDESC_MNM_20063
	title = EVTTITLE_MNM_20061
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_20063
		detract_society_currency_minor_effect = yes
	}
}

# Rival accepts the invitation
narrative_event = {
	id = MNM.20064
	picture = GFX_evt_sacrifice #GFX_evt_witch_burning
	border = GFX_event_narrative_frame_intrigue
	
	title = EVTTITLE_MNM_20061
	
	desc = { 
		text = EVTDESC_MNM_20064
		trigger = { FROM = { is_female = no } }
		sound = boiled_alive_male_01
	}
	desc = { 
		text = EVTDESC_MNM_20064
		trigger = { FROM = { is_female = no } }
		sound = boiled_alive_male_02
	}
	desc = { 
		text = EVTDESC_MNM_20064
		trigger = { FROM = { is_female = yes } }
		sound = boiled_alive_female_01
	}
	desc = { 
		text = EVTDESC_MNM_20064
		trigger = { FROM = { is_female = yes } }
		sound = boiled_alive_female_02
	}
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit =  { 
				FROM = { has_character_flag = dw_double_cross }
			}
			FROM = { clr_character_flag = dw_double_cross }
			random_courtier = {
				limit = {
					ai = yes
					prisoner = no
					age = 6
					OR = {
						is_close_relative = ROOT
						is_married = ROOT
						is_consort = ROOT
					}
				}
				save_event_target_as = dw_real_victim
				ROOT = { set_character_flag = dw_double_cross }
			}
			if = {
				limit =  { 
					NOT = { has_character_flag = dw_double_cross }
				}
				random_courtier = {
					limit = {
						ai = yes
						prisoner = no
						age = 6
					}
					save_event_target_as = dw_real_victim
					ROOT = { set_character_flag = dw_double_cross }
				}
			}
		}
		
		if = {
			limit =  {
				NOT = { has_character_flag = dw_double_cross }
			}
			FROM = { narrative_event = { id = MNM.20065 } }
		}
		
		if = {
			limit =  {
				NOT = { trait = poet }
			}
			random = {
				chance = 33
				set_character_flag = dw_gain_poet
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_20064
		
		tooltip = {
			FROM = {
				death = {
					death_reason = death_vanished killer = ROOT
				}
			}
		}
		
		add_society_currency_medium_effect = yes
		
		# Increase Cruelty
		if = {
			limit = {
				trait = cruel
				NOT = { lifestyle_traits = 1 }
			}
			add_trait = impaler
		}
		if = {
			limit = {
				NOT = { trait = kind }
				NOT = { trait = cruel }
			}
			add_trait = cruel
		}
		if = {
			limit = {
				trait = kind
			}
			remove_trait = kind
		}
		
		if = {
			limit =  {
				has_character_flag = dw_double_cross
			}
			event_target:dw_real_victim = { character_event = { id = MNM.20066 days = 3 } }
			clr_character_flag = dw_double_cross
		}
		
		if = {
			limit = {
				has_character_flag = dw_gain_poet
			}
			add_trait = poet
		}
		
		clr_character_flag = dw_gain_poet
	}
}

# Rival dies horribly
narrative_event = {
	id = MNM.20065
	picture = GFX_evt_sacrifice #GFX_evt_witch_burning
	border = GFX_event_narrative_frame_intrigue
	
	title = EVTTITLE_MNM_20061
	
	desc = { 
		text = EVTDESC_MNM_20065
		trigger = { is_female = no }
		sound = boiled_alive_male_01
	}
	desc = { 
		text = EVTDESC_MNM_20065
		trigger = { is_female = no }
		sound = boiled_alive_male_02
	}
	desc = { 
		text = EVTDESC_MNM_20065
		trigger = { is_female = yes }
		sound = boiled_alive_female_01
	}
	desc = { 
		text = EVTDESC_MNM_20065
		trigger = { is_female = yes }
		sound = boiled_alive_female_02
	}
	
	is_triggered_only = yes
	
	immediate = {
		death = {
			death_reason = death_vanished killer = FROM
		}
	}
	
	option = {
		name = EVTOPTA_MNM_20065
	}
}

# Rival replaced with close relative - Bounce through the real victim
character_event = {
	id = MNM.20066
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = { narrative_event = { id = MNM.20067 } }
		FROM = { character_event = { id = MNM.20068 } }
		
		death = {
			death_reason = death_vanished killer = FROM
		}
	}
}

# Rival replaced with close relative!
narrative_event = {
	id = MNM.20067
	picture = GFX_evt_sacrifice #GFX_evt_witch_burning
	border = GFX_event_narrative_frame_intrigue
	
	title = EVTTITLE_MNM_20061
	
	show_from_from = yes
	
	desc = { 
		text = EVTDESC_MNM_20067
		trigger = { event_target:dw_real_victim = { is_female = no } }
		sound = boiled_alive_male_01
	}
	desc = { 
		text = EVTDESC_MNM_20067
		trigger = { event_target:dw_real_victim = { is_female = no } }
		sound = boiled_alive_male_02
	}
	desc = { 
		text = EVTDESC_MNM_20067
		trigger = { event_target:dw_real_victim = { is_female = yes } }
		sound = boiled_alive_female_01
	}
	desc = { 
		text = EVTDESC_MNM_20067
		trigger = { event_target:dw_real_victim = { is_female = yes } }
		sound = boiled_alive_female_02
	}
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_MNM_20067
		tooltip = {
			event_target:dw_real_victim = {
				death = {
					death_reason = death_vanished killer = FROMFROM
				}
			}
		}
		add_society_currency_medium_effect = yes
	}
}

# You realize what your rival has done!
character_event = {
	id = MNM.20068
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_intrigue
	
	title = EVTTITLE_MNM_20061
	desc = EVTDESC_MNM_20068
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				NOT = { trait = lunatic }
			}
			random = {
				chance = 34
				set_character_flag = gain_lunatic
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_20068
		opinion = {
			who = FROMFROMFROM
			modifier = opinion_nemesis
			years = 100
		}
		hidden_tooltip = {
			FROMFROMFROM = {
				opinion = {
					who = ROOT
					modifier = opinion_nemesis
					years = 100
				}
			}
		}
		
		if = {
			limit = {
				NOT = { trait = paranoid }
				NOT = { trait = trusting }
			}
			add_trait = paranoid
		}
		if = {
			limit = {
				trait = trusting
			}
			remove_trait = trusting
		}
		
		if = {
			limit = {
				has_character_flag = gain_lunatic
			}
			add_trait = lunatic
		}
		
		clr_character_flag = gain_lunatic
	}
}

###########################################
# Abduction Decision - Hidden start
# Fired from decision_abduct
###########################################

# Abduction Start
character_event = {
	id = MNM.20070
	desc = EVTDESC_MNM_20070
	picture = GFX_evt_shady_meeting
	border = GFX_event_normal_frame_intrigue
	
	capable_only = yes
	prisoner = no
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			save_event_target_as = target_abduction
		}
		save_event_target_as = target_kidnapper
	}
	
	option = {
		name = EXCELLENT
		character_event = { id = MNM.20080 days = 20 random = 20 tooltip = EVTTOOLTIP_MNM_20080 }
	}
}

# Hidden 'outcome tombola' event for the "Abduct" decision
character_event = {
	id = MNM.20080
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				OR = {
					prisoner = yes # I have become imprisoned
					trait = incapable # I have become incapable
					AND = {
						is_devil_worshiper_trigger = no
						NOT = { society_member_of = the_assassins }
					}
				}
			}
			character_event = { id = MNM.20100 } # Clear out any flags, etc
			break = yes # Stop execution here
		}
		
		if = {
			limit = {
				FROMFROM = {
					is_alive = no
				}
			}
			
			character_event = { id = MNM.20101 }
			break = yes
		}
		
		if = {
			limit = {
				FROMFROM = {
					prisoner = yes
				}
			}
			character_event = { id = MNM.20102 }
			break = yes
		}
		
		if = {
			limit = {
				FROMFROM = {
					same_society_as = ROOT
				}
			}
			character_event = { id = MNM.20104 }
			break = yes
		}
		
		if = {
			limit = {
				NOT = {
					has_opinion_modifier = {
						who = FROMFROM
						modifier = opinion_abducting
					}
				}
			}
			break = yes # I have stopped spying on this character
		}
		
		repeat_event = { id = MNM.20080 days = 30 random = 30 } # Fire again with no scope changes
		
		if = {
			limit = {
				FROMFROM = {
					OR = {
						trait = on_hajj
						is_inaccessible_trigger = yes
						trait = on_pilgrimage
					}
				}
			}
			break = yes
		}
		
		random_list = {
			10000 = { # No luck yet
				modifier = {
					factor = 0.75
					has_character_modifier = wol_schemer_1
				}
				modifier = {
					factor = 0.5
					has_character_modifier = wol_schemer_2
				}
				modifier = {
					factor = 0.2
					trait = schemer
				}
				modifier = {
					factor = 0.5
					FROMFROM = { trait = trusting }
				}
				modifier = {
					factor = 1.5
					FROMFROM = { has_character_modifier = wol_schemer_1 }
				}
				modifier = {
					factor = 3.0
					FROMFROM = { has_character_modifier = wol_schemer_2 }
				}
				modifier = {
					factor = 5.0
					FROMFROM = { trait = schemer }
				}
				modifier = {
					factor = 3.0
					FROMFROM = { trait = paranoid }
				}
				modifier = {
					factor = 1.5
					FROMFROM = { tier = BARON }
				}
				modifier = {
					factor = 2.0
					FROMFROM = { tier = COUNT }
				}
				modifier = {
					factor = 3 #Makes sure it's very hard to abduct the same person twice
					FROMFROM = {
						OR = {
							has_opinion_modifier = {
								who = ROOT
								modifier = opinion_attempted_abduction
							}
							has_opinion_modifier = {
								who = ROOT
								modifier = opinion_abducted
							}
						}
					}
				}
				modifier = {
					factor = 2.0
					society_influence < 5
				}
				modifier = {
					factor = 2.0
					society_influence < 10
				}
				modifier = {
					factor = 0.5
					society_influence >= 50
				}
				modifier = {
					factor = 0.5
					society_influence >= 80
				}
				modifier = {
					factor = 0.25
					FROMFROM = {
						is_ruler = no
						liege = { character = ROOT }
					}
				}
				random = {
					chance = 25
					character_event = { id = MNM.20103 } # Time to give up?
				}
			}
			10000 = { # Success!
				character_event = { id = MNM.20081 }
			}
		}
	}
}

# Chance to abduct the target!
character_event = {
	id = MNM.20081
	picture = GFX_evt_bandits
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	desc = {
		text = EVTDESC_MNM_20081 
		trigger = {
			FROMFROMFROM = {
				age = 14
			}
		}
	}
	
	desc = {
		text = EVTDESC_MNM_20081_CHILD
		picture = GFX_evt_child_play
		trigger = {
			FROMFROMFROM = {
				NOT = { age = 14 }
			}
		}
	}
	
	option = {
		name = EVTOPTA_MNM_20081
		ai_chance = {
			factor = 100
		}
		increase_visibility_effect = yes
		FROMFROMFROM = {
			character_event = { id = MNM.20082 days = 3 tooltip = EVTTOOLTIP_MNM_20081 }
		}
	}
	option = {
		name = EVTOPTB_MNM_20081
		ai_chance = {
			factor = 10
		}
	}
}

# Target gets abducted... or not.
character_event = {
	id = MNM.20082
	picture = GFX_evt_bandits
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	desc = {
		text = EVTDESC_WOL_2121
		picture = GFX_evt_child_play
		trigger = {
			age = 14
		}
	}
	
	desc = {
		text = EVTDESC_MNM_20082_CHILD
		picture = GFX_evt_children_talking
		trigger = {
			NOT = { age = 14 }
			age = 4
		}
	}
	
	desc = {
		text = EVTDESC_MNM_20082_BABY
		picture = GFX_evt_children_talking
		trigger = {
			NOT = { age = 4 }
		}
	}
	
	immediate = {
		random = {
			chance = 75
			modifier = {
				factor = 0.1 #Makes sure it's very hard to abduct the same person twice
				OR = {
					has_opinion_modifier = {
						who = FROM
						modifier = opinion_attempted_abduction
					}
					has_opinion_modifier = {
						who = FROM
						modifier = opinion_abducted
					}
				}
			}
			modifier = {
				factor = 0.1
				age = 14
				OR = {
					has_character_modifier = seduced_loyal_bodyguard
					has_character_modifier = seduced_loyal_spy_maid
				}
			}
			modifier = {
				factor = 2.0
				trait = trusting
			}
			
			set_character_flag = abduction_success
		}
	}
	
	option = {
		name = {
			text = EVTOPT_WOL_2121_CAUGHT
			trigger = {
				age = 14
			}
		}
		name = {
			text = EVTOPT_MNM_20082_CHILD_CAUGHT
			trigger = {
				NOT = { age = 14 }
				age = 4
			}
		}
		name = {
			text = EVTOPT_MNM_20082_BABY_CAUGHT
			trigger = {
				NOT = { age = 4 }
			}
		}
		
		trigger = { has_character_flag = abduction_success }
		
		imprison = FROM

		opinion = {
			who = FROM
			modifier = opinion_abducted
			years = 50
		}
		
		hidden_effect = {
			FROM = {
				character_event = { id = MNM.20083 }
			}
		}
		
		clr_character_flag = abduction_success
	}
	
	option = {
		name = {
			text = EVTOPT_WOL_2121
			trigger = {
				age = 14
			}
		}
		name = {
			text = EVTOPT_MNM_20082_CHILD
			trigger = {
				NOT = { age = 14 }
				age = 4
			}
		}
		name = {
			text = EVTOPT_MNM_20082_BABY
			trigger = {
				NOT = { age = 4 }
			}
		}
		
		trigger = { NOT = { has_character_flag = abduction_success } }
		
		if = {
			limit = {
				is_incapable = no
				age = 4
				OR = {
					trait = paranoid
					random = 50
				}
			}
			custom_tooltip = {
				text = EVTTOOLTIP_MNM_20082_PERP
			}
			opinion = {
				who = FROM
				modifier = opinion_attempted_abduction
				years = 10
			}
		}
		
		hidden_effect = {
			FROM = {
				character_event = { id = MNM.20084 }
			}
		}
	}
}

# Target gets abducted!
character_event = {
	id = MNM.20083
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	desc = EVTDESC_MNM_20083
	
	immediate = {
		character_event = { id = MNM.20100 }
	}
	
	option = {
		name = EXCELLENT

		tooltip = {
			reverse_opinion = {
				who = FROM
				modifier = opinion_abducted
				years = 50
			}
		}
	}
}

# Abduction fails
character_event = {
	id = MNM.20084
	picture = GFX_evt_bandits
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	desc = EVTDESC_MNM_20084
	
	option = {
		name = EVTOPTA_MNM_20084

		tooltip = {
			reverse_opinion = {
				who = FROM
				modifier = opinion_attempted_abduction
				years = 10
			}
		}
	}
}

# End of "Abduction" events to clear out flags, etc
character_event = {
	id = MNM.20100
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		remove_opinion = {
			who = event_target:target_abduction
			modifier = opinion_abducting
		}
		
		clear_delayed_event = { id = MNM.20080 }
	}
}

# My target has died!
character_event = {
	id = MNM.20101
	
	desc = EVTDESC_MNM_20101
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue
	
	show_from_from_from = yes
	
	is_triggered_only = yes
	
	immediate = {
		character_event = { id = MNM.20100 }
	}
	
	option = {
		name = EVTOPTA_MNM_20101
	}
}

# My target has been imprisoned!
character_event = {
	id = MNM.20102
	
	desc = EVTDESC_MNM_20102
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue
	
	show_from_from_from = yes
	
	is_triggered_only = yes
	
	immediate = {
		character_event = { id = MNM.20100 }
	}
	
	option = {
		name = EVTOPTA_MNM_20102
	}
}

# My efforts are not bearing fruit. Give up?
character_event = {
	id = MNM.20103
	
	desc = EVTDESC_MNM_20103
	picture = GFX_evt_eavesdropping
	border = GFX_event_normal_frame_intrigue
	
	show_from_from_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_WOL_2065 # Give up
		ai_chance = {
			factor = 10
		}
		character_event = { id = MNM.20100 tooltip = EVTTOOLTIP_MNM_20103 }
	}
	
	option = {
		name = EVTOPTB_MNM_20103 # Keep at it
		ai_chance = {
			factor = 100
		}
	}
}

# My target has joined my Society
character_event = {
	id = MNM.20104
	
	desc = EVTDESC_MNM_20104
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue
	
	show_from_from_from = yes
	
	is_triggered_only = yes
	
	immediate = {
		character_event = { id = MNM.20100 }
	}
	
	option = {
		name = EVTOPTA_MNM_20101
	}
}

####### Hidden: Demon/Witch-hunters SET-UP ########
character_event = {
	id = MNM.7854
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		has_dlc = "Mystics"
		is_devil_worshiper_trigger = yes
		OR = {
   			has_character_modifier = known_satanist
   			has_character_flag = was_ratted_out_by_fellow_member
		}
	}
	
	weight_multiplier = {
		factor = 1
		modifier = {
			factor = 1.5
			society_rank == 3
		}
		modifier = {
			factor = 2
			society_rank == 4
		}
		modifier = {
			factor = 2
			independent = yes
		}
	}
	
	immediate = {
		if = { #Incapable ruler attacked in bed
			limit = { is_incapable = yes }
			set_character_flag = DW_was_attacked_is_incapable
			break = yes
		}
		#chooses who attacks you...
		random_list = {
			10 = {
				trigger = { NOT = { has_character_flag = DW_was_attacked_by_the_slayer } }
				set_character_flag = DW_was_attacked_by_the_slayer
			}
			10 = {
				set_character_flag = DW_was_attacked_by_angry_villagers
				trigger = {
					OR = {
						has_character_modifier = cat_familiar
						has_character_modifier = wolf_familiar
						has_character_modifier = raven_familiar
						has_character_modifier = owl_familiar
					}
					NOT = { has_character_flag = DW_was_attacked_by_angry_villagers }
				}
			}
			10 = {
				trigger = { NOT = { has_character_flag = DW_was_attacked_by_demon_hunters } }
				set_character_flag = DW_was_attacked_by_demon_hunters
			}
			10 = {
				trigger = { NOT = { has_character_flag = DW_was_attacked_by_lone_demon_hunter } }
				set_character_flag = DW_was_attacked_by_lone_demon_hunter
			}
			10 = {
				trigger = { NOT = { has_character_flag = DW_was_attacked_by_righteous_knights } }
				set_character_flag = DW_was_attacked_by_righteous_knights
			}

			#if attacked a second time...
			10 = {
				trigger = { has_character_flag = DW_was_attacked_by_the_slayer }
				modifier = {
   					factor = 1000
  					has_character_flag = DW_was_attacked_by_the_slayer
   				}
				set_character_flag = DW_was_attacked_by_the_slayer_again
				clr_character_flag = DW_was_attacked_by_the_slayer
			}
			10 = {
				trigger = { has_character_flag = DW_was_attacked_by_angry_villagers }
				modifier = {
   					factor = 1000
  					has_character_flag = DW_was_attacked_by_angry_villagers
   				}
				set_character_flag = DW_was_attacked_by_angry_villagers_again
				clr_character_flag = DW_was_attacked_by_angry_villagers
			}
			10 = {
				trigger = { has_character_flag = DW_was_attacked_by_demon_hunters }
				modifier = {
   					factor = 1000
  					has_character_flag = DW_was_attacked_by_demon_hunters
   				}
				set_character_flag = DW_was_attacked_by_demon_hunters_again
				clr_character_flag = DW_was_attacked_by_demon_hunters
			}
			10 = {
				trigger = { has_character_flag = DW_was_attacked_by_lone_demon_hunter }
				modifier = {
   					factor = 1000
  					has_character_flag = DW_was_attacked_by_lone_demon_hunter
   				}
				set_character_flag = DW_was_attacked_by_lone_demon_hunter_again
				clr_character_flag = DW_was_attacked_by_lone_demon_hunter
			}
			10 = {
				trigger = { has_character_flag = DW_was_attacked_by_righteous_knights }
				modifier = {
   					factor = 1000
  					has_character_flag = DW_was_attacked_by_righteous_knights
   				}
				set_character_flag = DW_was_attacked_by_righteous_knights_again
				clr_character_flag = DW_was_attacked_by_righteous_knights
			}
		}

		#Finds someone else to blame...
		hidden_effect = {
			society = {
				#first look for someone you like...
  				random_society_member = {
					limit = {
						is_incapable = no
						prisoner = no
						NOT = { character = ROOT }
						OR = {
							is_friend = ROOT
							is_lover = ROOT
						}
					}
					save_event_target_as = other_member_to_blame
					break = yes
				}
				#Then look for someone you rival...
				random_society_member = {
					limit = {
						is_incapable = no
						prisoner = no
						is_rival = ROOT
						NOT = { character = ROOT }
					}
					save_event_target_as = other_member_to_blame
					break = yes
				}
				#Then look for someone of your own dynasty...
				random_society_member = {
					limit = {
						is_incapable = no
						prisoner = no
						is_blood_relative_of_root_trigger = yes
						NOT = { character = ROOT }
					}
					save_event_target_as = other_member_to_blame
					break = yes
				}
				#find someone at court...
				random_society_member = {
					limit = {
						is_incapable = no
						prisoner = no
						host = { character = ROOT }
						NOT = { character = ROOT }
					}
					save_event_target_as = other_member_to_blame
					break = yes
				}
				
				# Then look for someone in the same realm
				random_society_member = {
					limit = {
						is_incapable = no
						prisoner = no
						NOT = { character = ROOT }
						same_realm = ROOT
					}
					save_event_target_as = other_member_to_blame
					break = yes
				}
				
				# Then look abroad...
				random_society_member = {
					limit = {
						is_incapable = no
						prisoner = no
						NOT = { character = ROOT }
						is_within_diplo_range = ROOT
					}
					save_event_target_as = other_member_to_blame
				}
			}
		}
	}
	after = {
		character_event = { id = MNM.7855 }
	}
}

#Demon/Witch-hunters have tracked you down!
character_event = {
	id = MNM.7855
	title = EVTTITLE_MNM_7855
	picture = GFX_evt_catching_heretic
	border = GFX_event_normal_frame_war
	is_triggered_only = yes

	hide_from = yes

	trigger = {
		has_dlc = "Mystics"
		is_devil_worshiper_trigger = yes
		OR = {
   			has_character_modifier = known_satanist
   			has_character_flag = was_ratted_out_by_fellow_member
		}
	}

	desc = {
		trigger = { has_character_flag = DW_was_attacked_by_the_slayer } #The Slayer
		text = EVTDESC_MNM_7855_A
		picture = GFX_evt_whispers
	}
	desc = { #To set pictures...
		trigger = {
   			has_character_flag = DW_was_attacked_by_angry_villagers # Angry Villagers
			has_dlc = "Reapers"
		}
		text = EVTDESC_MNM_7855_B
		picture = GFX_evt_witch_burning
	}
	desc = { #To set pictures (if NOT has Reapers)...
		trigger = {
   			has_character_flag = DW_was_attacked_by_angry_villagers
			NOT = { has_dlc = "Reapers" }
		}
		text = EVTDESC_MNM_7855_B
		picture = GFX_evt_catching_heretic
	}
	desc = {
		trigger = { has_character_flag = DW_was_attacked_by_demon_hunters } #Winchesters
		text = EVTDESC_MNM_7855_C
		picture = GFX_evt_catching_heretic
	}
	desc = {
		trigger = { has_character_flag = DW_was_attacked_by_lone_demon_hunter } #Demon Hunter
		text = EVTDESC_MNM_7855_D
		picture = GFX_evt_dark_love
	}
	desc = {
		trigger = { has_character_flag = DW_was_attacked_by_righteous_knights } #Holy Knights
		text = EVTDESC_MNM_7855_E
		picture = GFX_evt_catching_heretic
	}
	desc = {
		trigger = { has_character_flag = DW_was_attacked_is_incapable } #Incapable ruler attacked in bed
		text = EVTDESC_MNM_7855_F
		picture = GFX_evt_illness
	}
	desc = {
		trigger = { has_character_flag = DW_was_attacked_by_the_slayer_again } #The Slayer II
		text = EVTDESC_MNM_7855_A_again
		picture = GFX_evt_whispers
	}
	desc = { #To set pictures...
		trigger = {
   			has_character_flag = DW_was_attacked_by_angry_villagers_again # Angry Villagers II
			has_dlc = "Reapers"
		}
		text = EVTDESC_MNM_7855_B_again
		picture = GFX_evt_witch_burning
	}
	desc = { #To set pictures (if NOT has Reapers)...
		trigger = {
   			has_character_flag = DW_was_attacked_by_angry_villagers_again
			NOT = { has_dlc = "Reapers" }
		}
		text = EVTDESC_MNM_7855_B_again
		picture = GFX_evt_catching_heretic
	}
	desc = {
		trigger = { has_character_flag = DW_was_attacked_by_demon_hunters_again } #Winchesters II
		text = EVTDESC_MNM_7855_C_again
		picture = GFX_evt_dark_prayer
	}
	desc = {
		trigger = { has_character_flag = DW_was_attacked_by_lone_demon_hunter_again } #Demon Hunter II 
		text = EVTDESC_MNM_7855_D_again
		picture = GFX_evt_shadow
	}
	desc = {
		trigger = { has_character_flag = DW_was_attacked_by_righteous_knights_again } #Holy Knights II
		text = EVTDESC_MNM_7855_E_again
		picture = GFX_evt_battle
	}

	option = { #fight them...
		trigger = { NOT = { has_character_flag = DW_was_attacked_is_incapable } }
		name = {
			trigger = {
				OR = {
					has_character_flag = DW_was_attacked_by_the_slayer
					has_character_flag = DW_was_attacked_by_angry_villagers
					has_character_flag = DW_was_attacked_by_demon_hunters
					has_character_flag = DW_was_attacked_by_lone_demon_hunter
					has_character_flag = DW_was_attacked_by_righteous_knights
				}
			}
			text = EVTOPTA_MNM_7855
		}
		name = {
			trigger = {
				OR = {
					has_character_flag = DW_was_attacked_by_the_slayer_again
					has_character_flag = DW_was_attacked_by_angry_villagers_again
					has_character_flag = DW_was_attacked_by_demon_hunters_again
					has_character_flag = DW_was_attacked_by_lone_demon_hunter_again
					has_character_flag = DW_was_attacked_by_righteous_knights_again
				}
			}
			text = EVTOPTA_MNM_7855_again
		}
		custom_tooltip = { text = EVTOPTA_MNM_7855_TT }

		random_list = {
			10 = {
				#Nothing happens
				modifier = {
   					factor = 0.9
  					has_injury_trigger = yes
   				}
   				modifier = {
   					factor = 0.9
  					is_maimed_trigger = yes
   				}
   				modifier = {
   					factor = 0.9
   					has_severe_disability_trigger = yes
   				}
   				modifier = {
   					factor = 0.9
   					has_medium_disability_trigger = yes
   				}
   				modifier = {
   					factor = 1.1
   					is_smart_trigger = yes
   				}
   				modifier = {
   					factor = 1.1
   					is_strong_trigger = yes
   				}
   				custom_tooltip = { text = they_escape_TT }
			}
			30 = { #You are injured
 				modifier = {
   					factor = 0.9
  					combat_rating = 1
   				}
 				modifier = {
   					factor = 0.9
  					combat_rating = 2
   				}
   				modifier = {
   					factor = 0.9
  					combat_rating = 3
   				}
   				modifier = {
   					factor = 0.9
  					combat_rating = 4
   				}
   				modifier = {
   					factor = 0.9
  					combat_rating = 5
   				}
   				custom_tooltip = {
					text = you_are_seriously_injured_TT
					hidden_effect = { add_maimed_trait_effect = yes }
				}
			}
			50 = { #You are slain in personal combat
				modifier = {
   					factor = 0.9
  					combat_rating = 1
   				}
 				modifier = {
   					factor = 0.9
  					combat_rating = 2
   				}
   				modifier = {
   					factor = 0.9
  					combat_rating = 3
   				}
   				modifier = {
   					factor = 0.9
  					combat_rating = 4
   				}
   				modifier = {
   					factor = 0.9
  					combat_rating = 5
   				}
   				modifier = {
   					factor = 0.9
   					has_lifestyle_martial_trigger = yes
   				}
   				modifier = {
   					factor = 0.9
   					has_education_martial_trigger = yes
   					has_top_tier_education_trait_trigger = yes
   				}
   				modifier = {
   					factor = 1.1
					has_severe_disability_trigger = yes
   				}
   				modifier = {
   					factor = 1.1
	   				is_dumb_trigger = yes
   				}
   				modifier = {
   					factor = 1.1
   					is_weak_trigger = yes
   				}
   				custom_tooltip = {
					text = you_are_killed_in_personal_combat_TT
					hidden_effect = { death = { death_reason = death_duel } }
				}
			}
		}
	}

	option = { #attempt to bribe them...
		trigger = { NOT = { has_character_flag = DW_was_attacked_is_incapable } }
		name = {
			text = EVTOPTC_MNM_7855_A
			trigger = { has_character_flag = DW_was_attacked_by_the_slayer }
		}
		name = {
			text = EVTOPTC_MNM_7855_B
			trigger = { has_character_flag = DW_was_attacked_by_angry_villagers }
		}
		name = {
			text = EVTOPTC_MNM_7855_C
			trigger = { has_character_flag = DW_was_attacked_by_demon_hunters }
		}
		name = {
			text = EVTOPTC_MNM_7855_D
			trigger = { has_character_flag = DW_was_attacked_by_lone_demon_hunter }
		}
		name = {
			text = EVTOPTC_MNM_7855_E
			trigger = { has_character_flag = DW_was_attacked_by_righteous_knights }
		}
		name = {
			text = EVTOPTC_MNM_7855_A_again
			trigger = { has_character_flag = DW_was_attacked_by_the_slayer_again }
		}
		name = {
			text = EVTOPTC_MNM_7855_B_again
			trigger = { has_character_flag = DW_was_attacked_by_angry_villagers_again }
		}
		name = {
			text = EVTOPTC_MNM_7855_C_again
			trigger = { has_character_flag = DW_was_attacked_by_demon_hunters_again }
		}
		name = {
			text = EVTOPTC_MNM_7855_D_again
			trigger = { has_character_flag = DW_was_attacked_by_lone_demon_hunter_again }
		}
		name = {
			text = EVTOPTC_MNM_7855_E_again
			trigger = { has_character_flag = DW_was_attacked_by_righteous_knights_again }
		}

		custom_tooltip = {
			text = EVTOPTC_MNM_7855_TT
		}

		scaled_wealth = {
			value = -1 min = -100
		}

		random_list = {
			10 = {
   				modifier = {
   					factor = 0.9
  					has_unattractive_trait_trigger = yes
   				}
   				modifier = {
   					factor = 0.9
   					is_unattractive_trigger = yes
   				}
 				modifier = {
   					factor = 1.1
  					diplomacy = 10
   				}
   				modifier = {
   					factor = 1.1
  					diplomacy = 15
   				}
   				modifier = {
   					factor = 1.1
  					diplomacy = 17
   				}
 				modifier = {
   					factor = 1.1
  					diplomacy = 20
   				}
   				modifier = {
   					factor = 1.1
   					has_top_tier_education_trait_trigger = yes
   					has_education_diplomacy_trigger = yes
   				}
   				modifier = {
   					factor = 1.1
  					has_attractive_trait_trigger = yes
   				}
   				modifier = {
   					factor = 1.1
   					is_attractive_trigger = yes
   				}
				custom_tooltip = { text = they_accept_your_offer_TT }
			}
			20 = { #You are injured
				custom_tooltip = { text = you_are_seriously_injured_TT }
				hidden_effect = { add_maimed_trait_effect = yes }
			}
			40 = { #You are dragged off and burnt as a witch/warlock
				trigger = {
					OR = {
						has_character_flag = DW_was_attacked_by_angry_villagers
						has_character_flag = DW_was_attacked_by_demon_hunters
						has_character_flag = DW_was_attacked_by_righteous_knights
						has_character_flag = DW_was_attacked_by_angry_villagers_again
						has_character_flag = DW_was_attacked_by_demon_hunters_again
						has_character_flag = DW_was_attacked_by_righteous_knights_again
					}
				}
				custom_tooltip = {
					text = they_drag_you_off_to_burn
					hidden_effect = { death = { death_reason = death_execution_burning } }
				}
			}
			10 = { #You are dragged off and burnt as a witch/warlock
				trigger = {
					OR = {
						has_character_flag = DW_was_attacked_by_lone_demon_hunter
						has_character_flag = DW_was_attacked_by_lone_demon_hunter_again
					}
				}
				custom_tooltip = {
					text = they_saw_you_in_half
					hidden_effect = { death = { death_reason = death_execution_sawing } }
				}
			}
			10 = { #You are dragged off and burnt as a witch/warlock
				trigger = {
					OR = {
						has_character_flag = DW_was_attacked_by_the_slayer
						has_character_flag = DW_was_attacked_by_the_slayer_again   					
					}
				}
				custom_tooltip = {
					text = they_impale_you
					hidden_effect = { death = { death_reason = death_execution_impaling } }
				}
			}
		}
	}

	option = { #do a spell (sacrifice your child)...
		name = EVTOPTB_MNM_7855
		custom_tooltip = { text = EVTOPTB_MNM_7855_TT }

		if = {
			limit = {
				OR = {
					has_character_flag = DW_was_attacked_by_the_slayer
					has_character_flag = DW_was_attacked_by_lone_demon_hunter
				}
			}
			custom_tooltip = { text = EVTOPTB_MNM_7855_TT_singular }	
		}
		if = {
			limit = {
				OR = {
					has_character_flag = DW_was_attacked_by_angry_villagers
					has_character_flag = DW_was_attacked_by_demon_hunters
					has_character_flag = DW_was_attacked_by_righteous_knights
				}
			}
			custom_tooltip = { text = EVTOPTB_MNM_7855_TT_plural }	
		}

		detract_society_currency_major_effect = yes

		random_child = {
			limit = { is_child_of = ROOT }
			random_accident_death_effect = yes
		}

		trigger = {
			NOT = { has_character_flag = DW_was_attacked_is_incapable }
			has_society_currency_major_trigger = yes
			num_of_children = 1
			any_child = {
				is_child_of = ROOT
				ai = yes
			}
		}
	}

	option = { #offer them another member...!
		name = EVTOPTD_MNM_7855
		custom_tooltip = { text = EVTOPTD_MNM_7855_TT }

		if = {
			limit = {
				OR = {
					has_character_flag = DW_was_attacked_by_angry_villagers
					has_character_flag = DW_was_attacked_by_demon_hunters
					has_character_flag = DW_was_attacked_by_righteous_knights
					has_character_flag = DW_was_attacked_by_angry_villagers_again
					has_character_flag = DW_was_attacked_by_demon_hunters_again
					has_character_flag = DW_was_attacked_by_righteous_knights_again
				}
			}
			random = {
				chance = 50
				custom_tooltip = {
					text = they_drag_you_off_to_burn
					hidden_effect = { death = { death_reason = death_execution_burning } }
				}
			}			
		}
		if = {
			limit = {
				OR = {
					has_character_flag = DW_was_attacked_by_lone_demon_hunter
					has_character_flag = DW_was_attacked_by_lone_demon_hunter_again
				}
			}
			random = {
				chance = 50
				custom_tooltip = {
					text = they_saw_you_in_half
					hidden_effect = { death = { death_reason = death_execution_sawing } }
				}
			}			
		}
		if = {
			limit = {
				OR = {
					has_character_flag = DW_was_attacked_by_the_slayer
					has_character_flag = DW_was_attacked_by_the_slayer_again
				}
			}
			random = {
				chance = 50
				custom_tooltip = {
					text = they_impale_you
					hidden_effect = { death = { death_reason = death_execution_impaling } }
				}
			}			
		}

		event_target:other_member_to_blame = {
			set_character_flag = was_ratted_out_by_fellow_member
			if = {
				limit = {
					ai = yes
				}
				increase_visibility_minor_effect = yes
			}
		}

		trigger = {
			NOT = { has_character_flag = DW_was_attacked_is_incapable }
 			is_devil_worshiper_trigger = yes
 			society_rank < 4

 			event_target:other_member_to_blame = { always = yes }
		}
	}
	option = {
		name = EVTOPTE_MNM_7855
		trigger = { has_character_flag = DW_was_attacked_is_incapable }
		death = { death_reason = death_execution_burning }
	}
	
	after = {
		#CLEAR ALL FLAGS
		clr_character_flag = DW_was_attacked_by_the_slayer_again
		clr_character_flag = DW_was_attacked_by_angry_villagers_again
		clr_character_flag = DW_was_attacked_by_demon_hunters_again
		clr_character_flag = DW_was_attacked_by_lone_demon_hunter_again
		clr_character_flag = DW_was_attacked_by_righteous_knights_again
		clr_character_flag = was_ratted_out_by_fellow_member
	}
}